summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2017-08-15 10:53:22 -0400
committerLeo Liu <[email protected]>2017-08-21 10:09:09 -0400
commit535b3c2363fd54c15f954306035e6b2ab7dc19f5 (patch)
tree7c1f6e6129123bcf8e4ee2846bc8967a2b29e7df /src/gallium
parent41f17eb5f002bbe5fb7a6a851bf10b24819bb773 (diff)
st/va: add picture parameter handling for MJPEG
Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/va/picture_mjpeg.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/va/picture_mjpeg.c b/src/gallium/state_trackers/va/picture_mjpeg.c
index b0276e80dc5..50f339eebfb 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)