-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[VAAPI AV1 Encode] Encoder doesn't check VAConfigAttribEncMaxRefFrames #278
Comments
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 ? |
Sure, both L0 and L1 should be checked. |
Some drivers are more strict about the size of the reference lists given (i.e. VAOn12 [1]). The next_prev list is used to handle multiple "L0" references in AV1 encode. Restrict the size of next_prev based on the value of ref_l0 when the GOP structure is initialized. [1] intel/cartwheel-ffmpeg#278 v2: fix indentation issues
Some drivers are more strict about the size of the reference lists given (i.e. VAOn12 [1]). The next_prev list is used to handle multiple "L0" references in AV1 encode. Restrict the size of next_prev based on the value of ref_l0 when the GOP structure is initialized. [1] intel/cartwheel-ffmpeg#278 v2: fix indentation issues
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!
The text was updated successfully, but these errors were encountered: