frontend/va: Allow distinction for HRD params sent from app and frontend defaults

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22530>
This commit is contained in:
Sil Vilerino 2023-04-15 16:09:58 -04:00 committed by Marge Bot
parent 30a6363c8f
commit 44c53786a0
3 changed files with 12 additions and 0 deletions

View file

@ -339,6 +339,10 @@ vlVaHandleVAEncMiscParameterTypeHRDH264(vlVaContext *context, VAEncMiscParameter
if (ms->buffer_size) {
context->desc.h264enc.rate_ctrl[0].vbv_buffer_size = ms->buffer_size;
context->desc.h264enc.rate_ctrl[0].vbv_buf_lv = (ms->initial_buffer_fullness << 6 ) / ms->buffer_size;
context->desc.h264enc.rate_ctrl[0].vbv_buf_initial_size = ms->initial_buffer_fullness;
/* Distinguishes from the default params set for these values in other
functions and app specific params passed down via HRD buffer */
context->desc.h264enc.rate_ctrl[0].app_requested_hrd_buffer = true;
}
return VA_STATUS_SUCCESS;

View file

@ -412,6 +412,10 @@ vlVaHandleVAEncMiscParameterTypeHRDHEVC(vlVaContext *context, VAEncMiscParameter
if (ms->buffer_size) {
context->desc.h265enc.rc.vbv_buffer_size = ms->buffer_size;
context->desc.h265enc.rc.vbv_buf_lv = (ms->initial_buffer_fullness << 6 ) / ms->buffer_size;
context->desc.h265enc.rc.vbv_buf_initial_size = ms->initial_buffer_fullness;
/* Distinguishes from the default params set for these values in other
functions and app specific params passed down via HRD buffer */
context->desc.h265enc.rc.app_requested_hrd_buffer = true;
}
return VA_STATUS_SUCCESS;

View file

@ -409,6 +409,8 @@ struct pipe_h264_enc_rate_control
unsigned frame_rate_den;
unsigned vbv_buffer_size;
unsigned vbv_buf_lv;
unsigned vbv_buf_initial_size;
bool app_requested_hrd_buffer;
unsigned target_bits_picture;
unsigned peak_bits_picture_integer;
unsigned peak_bits_picture_fraction;
@ -612,6 +614,8 @@ struct pipe_h265_enc_rate_control
unsigned quant_b_frames;
unsigned vbv_buffer_size;
unsigned vbv_buf_lv;
unsigned vbv_buf_initial_size;
bool app_requested_hrd_buffer;
unsigned target_bits_picture;
unsigned peak_bits_picture_integer;
unsigned peak_bits_picture_fraction;