Open sivileri opened 9 months ago
Actually, looks like this also affects other codecs like H264/HEVC encoding with VAAPI, could we add such check for those as well?
OK, I will add the max ref frames check. BTW, 2 refs for P frame is only avaliable for AV1. Other codecs still use one ref for P frame.
Thanks @feiwan1 ! For B frames in AV1, vaon12 is also reporting the L1 limit in the upper 16 bits of VAConfigAttribEncMaxRefFrames, right now looks like encoding B uses 2 references, could also the max references check be staged in the B case in case in the future there are more references used in B frame, so they're always under the L1 limit of VAConfigAttribEncMaxRefFrames too ?
Thanks @feiwan1 ! For B frames in AV1, vaon12 is also reporting the L1 limit in the upper 16 bits of VAConfigAttribEncMaxRefFrames, right now looks like encoding B uses 2 references, could also the max references check be staged in the B case in case in the future there are more references used in B frame, so they're always under the L1 limit of VAConfigAttribEncMaxRefFrames too ?
Sure, both L0 and L1 should be checked.
On official ffmpeg (with the upstreamed AV1 encode patch), the encoder seems to be generating bitstreams using always 2 reference frames set to LAST/GOLDEN for P, even when VAConfigAttribEncMaxRefFrames.L0 reports a lower limit (e.g max 1 L0 reference frame).
@feiwan1 Is this something that could be checked so only the LAST reference is used for P when VAConfigAttribEncMaxRefFrames.L0 = 1 ? This affects the vaon12 VA driver which has encode AV1 support over different hardware abstracted through D3D12 reporting different support for VAConfigAttribEncMaxRefFrames.
Thanks!