[Mesa-dev] [PATCH 6/6] st/va: add h264 decoder level support

Marek Olšák maraeo at gmail.com
Mon Apr 20 15:31:14 PDT 2015


From: Leo Liu <leo.liu at amd.com>

Signed-off-by: Leo Liu <leo.liu at amd.com>
Reviewed-by: Christian König <christian.koenig at amd.com>
---
 src/gallium/state_trackers/va/context.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index a7a55f9..0a733b3 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -167,6 +167,11 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,
    templat.max_references = num_render_targets;
    templat.expect_chunked_decode = true;
 
+   if (u_reduce_video_profile(templat.profile) ==
+       PIPE_VIDEO_FORMAT_MPEG4_AVC)
+      templat.level = u_get_h264_level(templat.width, templat.height,
+                            &templat.max_references);
+
    context->decoder = drv->pipe->create_video_codec(drv->pipe, &templat);
    if (!context->decoder) {
       FREE(context);
-- 
2.1.0



More information about the mesa-dev mailing list