summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2017-08-15 11:54:22 -0400
committerLeo Liu <[email protected]>2017-08-21 10:09:09 -0400
commitef099e67995d9190666ee907e12356091d9cbff7 (patch)
tree0a9dd9a6e0a8188a959c273a56a9ec9de95bef98 /src
parent8e9175744e9c5528f9c44836b43381181976ce13 (diff)
st/va: add slice parameter handling for MJPEG
Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/va/picture_mjpeg.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/va/picture_mjpeg.c b/src/gallium/state_trackers/va/picture_mjpeg.c
index 17f077962e6..326c890c880 100644
--- a/src/gallium/state_trackers/va/picture_mjpeg.c
+++ b/src/gallium/state_trackers/va/picture_mjpeg.c
@@ -85,5 +85,27 @@ void vlVaHandleHuffmanTableBufferType(vlVaContext *context, vlVaBuffer *buf)
void vlVaHandleSliceParameterBufferMJPEG(vlVaContext *context, vlVaBuffer *buf)
{
- /* TODO */
+ VASliceParameterBufferJPEGBaseline *mjpeg = buf->data;
+ int i;
+
+ assert(buf->size >= sizeof(VASliceParameterBufferJPEGBaseline) && buf->num_elements == 1);
+
+ context->desc.mjpeg.slice_parameter.slice_data_size = mjpeg->slice_data_size;
+ context->desc.mjpeg.slice_parameter.slice_data_offset = mjpeg->slice_data_offset;
+ context->desc.mjpeg.slice_parameter.slice_data_flag = mjpeg->slice_data_flag;
+ context->desc.mjpeg.slice_parameter.slice_horizontal_position = mjpeg->slice_horizontal_position;
+ context->desc.mjpeg.slice_parameter.slice_vertical_position = mjpeg->slice_vertical_position;
+
+ for (i = 0; i < mjpeg->num_components; ++i) {
+ context->desc.mjpeg.slice_parameter.components[i].component_selector =
+ mjpeg->components[i].component_selector;
+ context->desc.mjpeg.slice_parameter.components[i].dc_table_selector =
+ mjpeg->components[i].dc_table_selector;
+ context->desc.mjpeg.slice_parameter.components[i].ac_table_selector =
+ mjpeg->components[i].ac_table_selector;
+ }
+
+ context->desc.mjpeg.slice_parameter.num_components = mjpeg->num_components;
+ context->desc.mjpeg.slice_parameter.restart_interval = mjpeg->restart_interval;
+ context->desc.mjpeg.slice_parameter.num_mcus = mjpeg->num_mcus;
}