summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2018-03-14 16:27:18 -0400
committerLeo Liu <[email protected]>2018-04-12 11:15:13 -0400
commitbf0f5fe9296ce4322bd9ae50ec192e12b4f9bf5e (patch)
tree980b211e29987a2ff067679d1ca5a6f465900db1
parent05176fe65e8f3fac15da0c0cdbd5485fb12e7702 (diff)
st/va: add slice parameter handling for VP9
Signed-off-by: Leo Liu <[email protected]> Acked-by: Christian König <[email protected]>
-rw-r--r--src/gallium/state_trackers/va/picture_vp9.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/va/picture_vp9.c b/src/gallium/state_trackers/va/picture_vp9.c
index d333a0cbcdf..38684ca21e1 100644
--- a/src/gallium/state_trackers/va/picture_vp9.c
+++ b/src/gallium/state_trackers/va/picture_vp9.c
@@ -84,5 +84,28 @@ void vlVaHandlePictureParameterBufferVP9(vlVaDriver *drv, vlVaContext *context,
void vlVaHandleSliceParameterBufferVP9(vlVaContext *context, vlVaBuffer *buf)
{
- /* TODO */
+ VASliceParameterBufferVP9 *vp9 = buf->data;
+ int i;
+
+ assert(buf->size >= sizeof(VASliceParameterBufferVP9) && buf->num_elements == 1);
+
+ context->desc.vp9.slice_parameter.slice_data_size = vp9->slice_data_size;
+ context->desc.vp9.slice_parameter.slice_data_offset = vp9->slice_data_offset;
+ context->desc.vp9.slice_parameter.slice_data_flag = vp9->slice_data_flag;
+
+ for (i = 0; i < 8; ++i) {
+ context->desc.vp9.slice_parameter.seg_param[i].segment_flags.segment_reference_enabled =
+ vp9->seg_param[i].segment_flags.fields.segment_reference_enabled;
+ context->desc.vp9.slice_parameter.seg_param[i].segment_flags.segment_reference =
+ vp9->seg_param[i].segment_flags.fields.segment_reference;
+ context->desc.vp9.slice_parameter.seg_param[i].segment_flags.segment_reference_skipped =
+ vp9->seg_param[i].segment_flags.fields.segment_reference_skipped;
+
+ memcpy(context->desc.vp9.slice_parameter.seg_param[i].filter_level, vp9->seg_param[i].filter_level, 4 * 2);
+
+ context->desc.vp9.slice_parameter.seg_param[i].luma_ac_quant_scale = vp9->seg_param[i].luma_ac_quant_scale;
+ context->desc.vp9.slice_parameter.seg_param[i].luma_dc_quant_scale = vp9->seg_param[i].luma_dc_quant_scale;
+ context->desc.vp9.slice_parameter.seg_param[i].chroma_ac_quant_scale = vp9->seg_param[i].chroma_ac_quant_scale;
+ context->desc.vp9.slice_parameter.seg_param[i].chroma_dc_quant_scale = vp9->seg_param[i].chroma_dc_quant_scale;
+ }
}