aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2018-03-14 15:57:48 -0400
committerLeo Liu <[email protected]>2018-04-12 11:15:13 -0400
commit05176fe65e8f3fac15da0c0cdbd5485fb12e7702 (patch)
tree17dd8780318f777bdc9a1f86f83bebababed9206
parent9ff83d13e5fe9aeed0ab6192a0e5dc6f01046700 (diff)
st/va: add picture 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.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/va/picture_vp9.c b/src/gallium/state_trackers/va/picture_vp9.c
index 62350692c58..d333a0cbcdf 100644
--- a/src/gallium/state_trackers/va/picture_vp9.c
+++ b/src/gallium/state_trackers/va/picture_vp9.c
@@ -29,7 +29,57 @@
void vlVaHandlePictureParameterBufferVP9(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf)
{
- /* TODO */
+ VADecPictureParameterBufferVP9 *vp9 = buf->data;
+ int i;
+
+ assert(buf->size >= sizeof(VADecPictureParameterBufferVP9) && buf->num_elements == 1);
+
+ context->desc.vp9.picture_parameter.frame_width = vp9->frame_width;
+ context->desc.vp9.picture_parameter.frame_height = vp9->frame_height;
+
+ context->desc.vp9.picture_parameter.pic_fields.subsampling_x = vp9->pic_fields.bits.subsampling_x;
+ context->desc.vp9.picture_parameter.pic_fields.subsampling_y = vp9->pic_fields.bits.subsampling_y;
+ context->desc.vp9.picture_parameter.pic_fields.frame_type = vp9->pic_fields.bits.frame_type;
+ context->desc.vp9.picture_parameter.pic_fields.show_frame = vp9->pic_fields.bits.show_frame;
+ context->desc.vp9.picture_parameter.pic_fields.error_resilient_mode = vp9->pic_fields.bits.error_resilient_mode;
+ context->desc.vp9.picture_parameter.pic_fields.intra_only = vp9->pic_fields.bits.intra_only;
+ context->desc.vp9.picture_parameter.pic_fields.allow_high_precision_mv = vp9->pic_fields.bits.allow_high_precision_mv;
+ context->desc.vp9.picture_parameter.pic_fields.mcomp_filter_type = vp9->pic_fields.bits.mcomp_filter_type;
+ context->desc.vp9.picture_parameter.pic_fields.frame_parallel_decoding_mode = vp9->pic_fields.bits.frame_parallel_decoding_mode;
+ context->desc.vp9.picture_parameter.pic_fields.reset_frame_context = vp9->pic_fields.bits.reset_frame_context;
+ context->desc.vp9.picture_parameter.pic_fields.refresh_frame_context = vp9->pic_fields.bits.refresh_frame_context;
+ context->desc.vp9.picture_parameter.pic_fields.frame_context_idx = vp9->pic_fields.bits.frame_context_idx;
+ context->desc.vp9.picture_parameter.pic_fields.segmentation_enabled = vp9->pic_fields.bits.segmentation_enabled;
+ context->desc.vp9.picture_parameter.pic_fields.segmentation_temporal_update = vp9->pic_fields.bits.segmentation_temporal_update;
+ context->desc.vp9.picture_parameter.pic_fields.segmentation_update_map = vp9->pic_fields.bits.segmentation_update_map;
+ context->desc.vp9.picture_parameter.pic_fields.last_ref_frame = vp9->pic_fields.bits.last_ref_frame;
+ context->desc.vp9.picture_parameter.pic_fields.last_ref_frame_sign_bias = vp9->pic_fields.bits.last_ref_frame_sign_bias;
+ context->desc.vp9.picture_parameter.pic_fields.golden_ref_frame = vp9->pic_fields.bits.golden_ref_frame;
+ context->desc.vp9.picture_parameter.pic_fields.golden_ref_frame_sign_bias = vp9->pic_fields.bits.golden_ref_frame_sign_bias;
+ context->desc.vp9.picture_parameter.pic_fields.alt_ref_frame = vp9->pic_fields.bits.alt_ref_frame;
+ context->desc.vp9.picture_parameter.pic_fields.alt_ref_frame_sign_bias = vp9->pic_fields.bits.alt_ref_frame_sign_bias;
+ context->desc.vp9.picture_parameter.pic_fields.lossless_flag = vp9->pic_fields.bits.lossless_flag;
+
+ context->desc.vp9.picture_parameter.filter_level = vp9->filter_level;
+ context->desc.vp9.picture_parameter.sharpness_level = vp9->sharpness_level;
+
+ context->desc.vp9.picture_parameter.log2_tile_rows = vp9->log2_tile_rows;
+ context->desc.vp9.picture_parameter.log2_tile_columns = vp9->log2_tile_columns;
+
+ context->desc.vp9.picture_parameter.frame_header_length_in_bytes = vp9->frame_header_length_in_bytes;
+ context->desc.vp9.picture_parameter.first_partition_size = vp9->first_partition_size;
+
+ for (i = 0; i < 7; ++i)
+ context->desc.vp9.picture_parameter.mb_segment_tree_probs[i] = vp9->mb_segment_tree_probs[i];
+ for (i = 0; i < 3; ++i)
+ context->desc.vp9.picture_parameter.segment_pred_probs[i] = vp9->segment_pred_probs[i];
+
+ context->desc.vp9.picture_parameter.profile = vp9->profile;
+
+ context->desc.vp9.picture_parameter.bit_depth = vp9->bit_depth;
+
+ for (i = 0 ; i < 8 ; i++)
+ vlVaGetReferenceFrame(drv, vp9->reference_frames[i], &context->desc.vp9.ref[i]);
}
void vlVaHandleSliceParameterBufferVP9(vlVaContext *context, vlVaBuffer *buf)