Mesa (main): frontends/va: check number of temporal layers supported by encoder
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jul 26 20:27:34 UTC 2021
Module: Mesa
Branch: main
Commit: 96c581e8979e79f95245f8a222c1cc925a02923d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=96c581e8979e79f95245f8a222c1cc925a02923d
Author: Thong Thai <thong.thai at amd.com>
Date: Tue Jul 13 11:55:28 2021 -0400
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 <thong.thai at amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>
---
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 ||
More information about the mesa-commit
mailing list