From 46d8e57f16897f16ce8db7312e99d78476e1fdeb Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 4 Oct 2024 08:27:09 +0200 Subject: [PATCH] frontends/va: Remove now unused ref fields for AV1 encode Need to get rid of these as they allocate buffers for drivers not implementing create_dpb_buffer and waste memory. No driver is using these fields anymore. Reviewed-by: Ruijing Dong Part-of: --- src/gallium/frontends/va/picture_av1_enc.c | 19 ------------------- src/gallium/include/pipe/p_video_state.h | 3 --- 2 files changed, 22 deletions(-) diff --git a/src/gallium/frontends/va/picture_av1_enc.c b/src/gallium/frontends/va/picture_av1_enc.c index 23f6e5a08c2..a963f0e5b8b 100644 --- a/src/gallium/frontends/va/picture_av1_enc.c +++ b/src/gallium/frontends/va/picture_av1_enc.c @@ -133,7 +133,6 @@ vlVaDpbIndex(vlVaContext *context, VASurfaceID id) VAStatus vlVaHandleVAEncPictureParameterBufferTypeAV1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) { VAEncPictureParameterBufferAV1 *av1 = buf->data; - struct pipe_video_buffer *video_buf = NULL; vlVaBuffer *coded_buf; vlVaSurface *surf; int i, j; @@ -339,24 +338,6 @@ VAStatus vlVaHandleVAEncPictureParameterBufferTypeAV1(vlVaDriver *drv, vlVaConte if (context->desc.av1enc.frame_type == FRAME_TYPE_KEY_FRAME) context->desc.av1enc.last_key_frame_num = context->desc.av1enc.frame_num; - if (av1->reconstructed_frame != VA_INVALID_ID) { - vlVaGetReferenceFrame(drv, av1->reconstructed_frame, &video_buf); - context->desc.av1enc.recon_frame = video_buf; - } - else - context->desc.av1enc.recon_frame = NULL; - - for (int i = 0 ; i < ARRAY_SIZE(context->desc.av1enc.ref_list); i++) { - if (av1->reference_frames[i] != VA_INVALID_ID) { - vlVaGetReferenceFrame(drv, av1->reference_frames[i], &video_buf); - context->desc.av1enc.ref_list[i] = video_buf; - } - else - context->desc.av1enc.ref_list[i] = NULL; - } - - context->desc.av1enc.ref_frame_ctrl_l0 = av1->ref_frame_ctrl_l0.value; - /* Initialize slice descriptors for this picture */ context->desc.av1enc.num_tile_groups = 0; memset(&context->desc.av1enc.tile_groups, 0, sizeof(context->desc.av1enc.tile_groups)); diff --git a/src/gallium/include/pipe/p_video_state.h b/src/gallium/include/pipe/p_video_state.h index b836402146a..70aeb670e40 100644 --- a/src/gallium/include/pipe/p_video_state.h +++ b/src/gallium/include/pipe/p_video_state.h @@ -1389,9 +1389,6 @@ struct pipe_av1_enc_picture_desc uint8_t refresh_frame_flags; uint8_t ref_frame_idx[7]; uint32_t delta_frame_id_minus_1[7]; - uint32_t ref_frame_ctrl_l0; /* forward prediction only */ - void *ref_list[8]; /* for tracking ref frames */ - void *recon_frame; uint32_t frame_presentation_time; uint32_t current_frame_id; uint32_t ref_order_hint[8];