From 96c581e8979e79f95245f8a222c1cc925a02923d Mon Sep 17 00:00:00 2001 From: Thong Thai Date: Tue, 13 Jul 2021 11:55:28 -0400 Subject: [PATCH] frontends/va: check number of temporal layers supported by encoder Checks the encoder to determine the number of temporal layers supported, and returns max_num_temporal_layers_minus1, along with setting the corresponding control flag if multiple layers are supported. Signed-off-by: Thong Thai Reviewed-by: Boyuan Zhang Part-of: --- src/gallium/frontends/va/config.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/frontends/va/config.c b/src/gallium/frontends/va/config.c index b654f42838a..337b06cfe97 100644 --- a/src/gallium/frontends/va/config.c +++ b/src/gallium/frontends/va/config.c @@ -159,6 +159,15 @@ vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint en case VAConfigAttribRateControl: value = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR; break; + case VAConfigAttribEncRateControlExt: + value = pscreen->get_video_param(pscreen, ProfileToPipe(profile), + PIPE_VIDEO_ENTRYPOINT_ENCODE, + PIPE_VIDEO_CAP_MAX_TEMPORAL_LAYERS); + if (value > 0) { + value -= 1; + value |= (1 << 8); /* temporal_layer_bitrate_control_flag */ + } + break; case VAConfigAttribEncPackedHeaders: value = VA_ENC_PACKED_HEADER_NONE; if (u_reduce_video_profile(ProfileToPipe(profile)) == PIPE_VIDEO_FORMAT_MPEG4_AVC ||