[Mesa-dev] [PATCH 09/20] st/va: add picture parameter handling for MJPEG

Leo Liu leo.liu at amd.com
Wed Aug 16 17:53:12 UTC 2017


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/picture_mjpeg.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/va/picture_mjpeg.c b/src/gallium/state_trackers/va/picture_mjpeg.c
index b0276e80dc..50f339eebf 100644
--- a/src/gallium/state_trackers/va/picture_mjpeg.c
+++ b/src/gallium/state_trackers/va/picture_mjpeg.c
@@ -29,7 +29,26 @@
 
 void vlVaHandlePictureParameterBufferMJPEG(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf)
 {
-   /* TODO */
+   VAPictureParameterBufferJPEGBaseline *mjpeg = buf->data;
+   int i;
+
+   assert(buf->size >= sizeof(VAPictureParameterBufferJPEGBaseline) && buf->num_elements == 1);
+
+   context->desc.mjpeg.picture_parameter.picture_width = mjpeg->picture_width;
+   context->desc.mjpeg.picture_parameter.picture_height = mjpeg->picture_height;
+
+   for (i = 0; i < mjpeg->num_components; ++i) {
+      context->desc.mjpeg.picture_parameter.components[i].component_id =
+         mjpeg->components[i].component_id;
+      context->desc.mjpeg.picture_parameter.components[i].h_sampling_factor =
+         mjpeg->components[i].h_sampling_factor;
+      context->desc.mjpeg.picture_parameter.components[i].v_sampling_factor =
+         mjpeg->components[i].v_sampling_factor;
+      context->desc.mjpeg.picture_parameter.components[i].quantiser_table_selector =
+         mjpeg->components[i].quantiser_table_selector;
+   }
+
+   context->desc.mjpeg.picture_parameter.num_components = mjpeg->num_components;
 }
 
 void vlVaHandleIQMatrixBufferMJPEG(vlVaContext *context, vlVaBuffer *buf)
-- 
2.11.0



More information about the mesa-dev mailing list