[Mesa-dev] [PATCH 12/15] st/va: handle VAIQMatrixBufferMPEG2

Christian König deathsimple at vodafone.de
Tue Jun 18 02:27:42 PDT 2013


From: Christian König <christian.koenig at amd.com>

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 src/gallium/state_trackers/va/picture.c |   29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c
index 8d16dfa..66cd6ca 100644
--- a/src/gallium/state_trackers/va/picture.c
+++ b/src/gallium/state_trackers/va/picture.c
@@ -29,6 +29,7 @@
 #include "pipe/p_video_decoder.h"
 
 #include "util/u_handle_table.h"
+#include "util/u_video.h"
 
 #include "va_private.h"
 
@@ -60,6 +61,32 @@ vlVaBeginPicture(VADriverContextP ctx, VAContextID context_id, VASurfaceID rende
    return VA_STATUS_SUCCESS;
 }
 
+static void
+handleIQMatrixBuffer(vlVaContext *context, vlVaBuffer *buf)
+{
+   VAIQMatrixBufferMPEG2 *mpeg2;
+
+   switch (u_reduce_video_profile(context->decoder->profile)) {
+   case PIPE_VIDEO_CODEC_MPEG12:
+      assert(buf->size >= sizeof(VAIQMatrixBufferMPEG2) && buf->num_elements == 1);
+      mpeg2 = buf->data;
+
+      if (mpeg2->load_intra_quantiser_matrix)
+         context->desc.mpeg12.intra_matrix = mpeg2->intra_quantiser_matrix;
+      else
+         context->desc.mpeg12.intra_matrix = NULL;
+
+      if (mpeg2->load_non_intra_quantiser_matrix)
+         context->desc.mpeg12.non_intra_matrix = mpeg2->non_intra_quantiser_matrix;
+      else
+         context->desc.mpeg12.non_intra_matrix = NULL;
+      break;
+
+   default:
+      break;
+   }
+}
+
 VAStatus
 vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buffers, int num_buffers)
 {
@@ -90,7 +117,7 @@ vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buff
          break;
 
       case VAIQMatrixBufferType:
-         // TODO
+         handleIQMatrixBuffer(context, buf);
          break;
 
       case VASliceParameterBufferType:
-- 
1.7.9.5



More information about the mesa-dev mailing list