diff options
author | Christian König <[email protected]> | 2013-09-24 03:03:33 -0600 |
---|---|---|
committer | Christian König <[email protected]> | 2013-10-28 11:08:12 +0100 |
commit | 925ffa8c4a5760d0f79de6bf1fab52c2d6e83b17 (patch) | |
tree | a833c0b55f211e8352946041970106fc1a8b7761 /src/gallium/drivers | |
parent | 6f2410c9aa5b0a2e7f08c9e60f4d3dc84cfa9f41 (diff) |
vl/h264: split fields into SPS/PPS
Add alot of missing fields as well.
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c | 30 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c | 24 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv84_video_bsp.c | 38 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv84_video_vp.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_uvd.c | 59 |
5 files changed, 79 insertions, 80 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c b/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c index ba2a91716d2..6d968c18399 100644 --- a/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video_bsp.c @@ -204,25 +204,25 @@ nouveau_vp3_fill_picparm_h264_bsp(struct nouveau_vp3_decoder *dec, h->unk00 = 1; h->pad1 = h->pad2 = 0; h->unk = 0; - h->log2_max_frame_num_minus4 = d->log2_max_frame_num_minus4; - h->frame_mbs_only_flag = d->frame_mbs_only_flag; - h->direct_8x8_inference_flag = d->direct_8x8_inference_flag; + h->log2_max_frame_num_minus4 = d->pps->sps->log2_max_frame_num_minus4; + h->frame_mbs_only_flag = d->pps->sps->frame_mbs_only_flag; + h->direct_8x8_inference_flag = d->pps->sps->direct_8x8_inference_flag; h->width_mb = mb(dec->base.width); h->height_mb = mb(dec->base.height); - h->entropy_coding_mode_flag = d->entropy_coding_mode_flag; - h->pic_order_present_flag = d->pic_order_present_flag; - h->pic_order_cnt_type = d->pic_order_cnt_type; - h->log2_max_pic_order_cnt_lsb_minus4 = d->log2_max_pic_order_cnt_lsb_minus4; - h->delta_pic_order_always_zero_flag = d->delta_pic_order_always_zero_flag; + h->entropy_coding_mode_flag = d->pps->entropy_coding_mode_flag; + h->pic_order_present_flag = d->pps->bottom_field_pic_order_in_frame_present_flag; + h->pic_order_cnt_type = d->pps->sps->pic_order_cnt_type; + h->log2_max_pic_order_cnt_lsb_minus4 = d->pps->sps->log2_max_pic_order_cnt_lsb_minus4; + h->delta_pic_order_always_zero_flag = d->pps->sps->delta_pic_order_always_zero_flag; h->num_ref_idx_l0_active_minus1 = d->num_ref_idx_l0_active_minus1; h->num_ref_idx_l1_active_minus1 = d->num_ref_idx_l1_active_minus1; - h->weighted_pred_flag = d->weighted_pred_flag; - h->weighted_bipred_idc = d->weighted_bipred_idc; - h->pic_init_qp_minus26 = d->pic_init_qp_minus26; - h->deblocking_filter_control_present_flag = d->deblocking_filter_control_present_flag; - h->redundant_pic_cnt_present_flag = d->redundant_pic_cnt_present_flag; - h->transform_8x8_mode_flag = d->transform_8x8_mode_flag; - h->mb_adaptive_frame_field_flag = d->mb_adaptive_frame_field_flag; + h->weighted_pred_flag = d->pps->weighted_pred_flag; + h->weighted_bipred_idc = d->pps->weighted_bipred_idc; + h->pic_init_qp_minus26 = d->pps->pic_init_qp_minus26; + h->deblocking_filter_control_present_flag = d->pps->deblocking_filter_control_present_flag; + h->redundant_pic_cnt_present_flag = d->pps->redundant_pic_cnt_present_flag; + h->transform_8x8_mode_flag = d->pps->transform_8x8_mode_flag; + h->mb_adaptive_frame_field_flag = d->pps->sps->mb_adaptive_frame_field_flag; h->field_pic_flag = d->field_pic_flag; h->bottom_field_flag = d->bottom_field_flag; memset(h->real_pad, 0, sizeof(h->real_pad)); diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c b/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c index add998d98ef..a0f53328dc9 100644 --- a/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c +++ b/src/gallium/drivers/nouveau/nouveau_vp3_video_vp.c @@ -340,22 +340,22 @@ nouveau_vp3_fill_picparm_h264_vp(struct nouveau_vp3_decoder *dec, nouveau_vp3_inter_sizes(dec, 1, &ring, &h->bucket_size, &h->inter_ring_data_size); h->u220 = 0; - h->f0 = d->mb_adaptive_frame_field_flag; - h->f1 = d->direct_8x8_inference_flag; - h->weighted_pred_flag = d->weighted_pred_flag; - h->f3 = d->constrained_intra_pred_flag; + h->f0 = d->pps->sps->mb_adaptive_frame_field_flag; + h->f1 = d->pps->sps->direct_8x8_inference_flag; + h->weighted_pred_flag = d->pps->weighted_pred_flag; + h->f3 = d->pps->constrained_intra_pred_flag; h->is_reference = d->is_reference; h->interlace = d->field_pic_flag; h->bottom_field_flag = d->bottom_field_flag; h->f7 = 0; // TODO: figure out when set.. - h->log2_max_frame_num_minus4 = d->log2_max_frame_num_minus4; + h->log2_max_frame_num_minus4 = d->pps->sps->log2_max_frame_num_minus4; h->u31_45 = 1; - h->pic_order_cnt_type = d->pic_order_cnt_type; - h->pic_init_qp_minus26 = d->pic_init_qp_minus26; - h->chroma_qp_index_offset = d->chroma_qp_index_offset; - h->second_chroma_qp_index_offset = d->second_chroma_qp_index_offset; - h->weighted_bipred_idc = d->weighted_bipred_idc; + h->pic_order_cnt_type = d->pps->sps->pic_order_cnt_type; + h->pic_init_qp_minus26 = d->pps->pic_init_qp_minus26; + h->chroma_qp_index_offset = d->pps->chroma_qp_index_offset; + h->second_chroma_qp_index_offset = d->pps->second_chroma_qp_index_offset; + h->weighted_bipred_idc = d->pps->weighted_bipred_idc; h->tmp_idx = 0; // set in h264_vp_refs below h->fifo_dec_index = 0; // always set to 0 to be fifo compatible with other codecs h->frame_number = d->frame_num; @@ -363,8 +363,8 @@ nouveau_vp3_fill_picparm_h264_vp(struct nouveau_vp3_decoder *dec, h->field_order_cnt[0] = d->field_order_cnt[0]; h->field_order_cnt[1] = d->field_order_cnt[1]; memset(h->refs, 0, sizeof(h->refs)); - memcpy(h->m4x4, d->scaling_lists_4x4, sizeof(h->m4x4)); - memcpy(h->m8x8, d->scaling_lists_8x8, sizeof(h->m8x8)); + memcpy(h->m4x4, d->pps->ScalingList4x4, sizeof(h->m4x4)); + memcpy(h->m8x8, d->pps->ScalingList8x8, sizeof(h->m8x8)); h->u220 = 0; for (i = 0; i < d->num_ref_frames; ++i) { if (!d->ref[i]) diff --git a/src/gallium/drivers/nouveau/nv50/nv84_video_bsp.c b/src/gallium/drivers/nouveau/nv50/nv84_video_bsp.c index 86047b5f463..de923e486b6 100644 --- a/src/gallium/drivers/nouveau/nv50/nv84_video_bsp.c +++ b/src/gallium/drivers/nouveau/nv50/nv84_video_bsp.c @@ -136,7 +136,7 @@ nv84_decoder_bsp(struct nv84_decoder *dec, params.iseqparm.chroma_format_idc = 1; params.iseqparm.pic_width_in_mbs_minus1 = mb(dec->base.width) - 1; - if (desc->field_pic_flag || desc->mb_adaptive_frame_field_flag) + if (desc->field_pic_flag || desc->pps->sps->mb_adaptive_frame_field_flag) params.iseqparm.pic_height_in_map_units_minus1 = mb_half(dec->base.height) - 1; else params.iseqparm.pic_height_in_map_units_minus1 = mb(dec->base.height) - 1; @@ -162,26 +162,26 @@ nv84_decoder_bsp(struct nv84_decoder *dec, } params.iseqparm.num_ref_frames = desc->num_ref_frames; - params.iseqparm.mb_adaptive_frame_field_flag = desc->mb_adaptive_frame_field_flag; - params.ipicparm.constrained_intra_pred_flag = desc->constrained_intra_pred_flag; - params.ipicparm.weighted_pred_flag = desc->weighted_pred_flag; - params.ipicparm.weighted_bipred_idc = desc->weighted_bipred_idc; - params.iseqparm.frame_mbs_only_flag = desc->frame_mbs_only_flag; - params.ipicparm.transform_8x8_mode_flag = desc->transform_8x8_mode_flag; - params.ipicparm.chroma_qp_index_offset = desc->chroma_qp_index_offset; - params.ipicparm.second_chroma_qp_index_offset = desc->second_chroma_qp_index_offset; - params.ipicparm.pic_init_qp_minus26 = desc->pic_init_qp_minus26; + params.iseqparm.mb_adaptive_frame_field_flag = desc->pps->sps->mb_adaptive_frame_field_flag; + params.ipicparm.constrained_intra_pred_flag = desc->pps->constrained_intra_pred_flag; + params.ipicparm.weighted_pred_flag = desc->pps->weighted_pred_flag; + params.ipicparm.weighted_bipred_idc = desc->pps->weighted_bipred_idc; + params.iseqparm.frame_mbs_only_flag = desc->pps->sps->frame_mbs_only_flag; + params.ipicparm.transform_8x8_mode_flag = desc->pps->transform_8x8_mode_flag; + params.ipicparm.chroma_qp_index_offset = desc->pps->chroma_qp_index_offset; + params.ipicparm.second_chroma_qp_index_offset = desc->pps->second_chroma_qp_index_offset; + params.ipicparm.pic_init_qp_minus26 = desc->pps->pic_init_qp_minus26; params.ipicparm.num_ref_idx_l0_active_minus1 = desc->num_ref_idx_l0_active_minus1; params.ipicparm.num_ref_idx_l1_active_minus1 = desc->num_ref_idx_l1_active_minus1; - params.iseqparm.log2_max_frame_num_minus4 = desc->log2_max_frame_num_minus4; - params.iseqparm.pic_order_cnt_type = desc->pic_order_cnt_type; - params.iseqparm.log2_max_pic_order_cnt_lsb_minus4 = desc->log2_max_pic_order_cnt_lsb_minus4; - params.iseqparm.delta_pic_order_always_zero_flag = desc->delta_pic_order_always_zero_flag; - params.iseqparm.direct_8x8_inference_flag = desc->direct_8x8_inference_flag; - params.ipicparm.entropy_coding_mode_flag = desc->entropy_coding_mode_flag; - params.ipicparm.pic_order_present_flag = desc->pic_order_present_flag; - params.ipicparm.deblocking_filter_control_present_flag = desc->deblocking_filter_control_present_flag; - params.ipicparm.redundant_pic_cnt_present_flag = desc->redundant_pic_cnt_present_flag; + params.iseqparm.log2_max_frame_num_minus4 = desc->pps->sps->log2_max_frame_num_minus4; + params.iseqparm.pic_order_cnt_type = desc->pps->sps->pic_order_cnt_type; + params.iseqparm.log2_max_pic_order_cnt_lsb_minus4 = desc->pps->sps->log2_max_pic_order_cnt_lsb_minus4; + params.iseqparm.delta_pic_order_always_zero_flag = desc->pps->sps->delta_pic_order_always_zero_flag; + params.iseqparm.direct_8x8_inference_flag = desc->pps->sps->direct_8x8_inference_flag; + params.ipicparm.entropy_coding_mode_flag = desc->pps->entropy_coding_mode_flag; + params.ipicparm.pic_order_present_flag = desc->pps->bottom_field_pic_order_in_frame_present_flag; + params.ipicparm.deblocking_filter_control_present_flag = desc->pps->deblocking_filter_control_present_flag; + params.ipicparm.redundant_pic_cnt_present_flag = desc->pps->redundant_pic_cnt_present_flag; memcpy(dec->bitstream->map, ¶ms, sizeof(params)); for (i = 0; i < num_buffers; i++) { diff --git a/src/gallium/drivers/nouveau/nv50/nv84_video_vp.c b/src/gallium/drivers/nouveau/nv50/nv84_video_vp.c index 619aa4e7a40..f3480b2e00e 100644 --- a/src/gallium/drivers/nouveau/nv50/nv84_video_vp.c +++ b/src/gallium/drivers/nouveau/nv50/nv84_video_vp.c @@ -90,9 +90,9 @@ nv84_decoder_vp_h264(struct nv84_decoder *dec, memset(¶m1, 0, sizeof(param1)); memset(¶m2, 0, sizeof(param2)); - memcpy(¶m1.scaling_lists_4x4, desc->scaling_lists_4x4, + memcpy(¶m1.scaling_lists_4x4, desc->pps->ScalingList4x4, sizeof(param1.scaling_lists_4x4)); - memcpy(¶m1.scaling_lists_8x8, desc->scaling_lists_8x8, + memcpy(¶m1.scaling_lists_8x8, desc->pps->ScalingList8x8, sizeof(param1.scaling_lists_8x8)); param1.width = width; @@ -100,7 +100,7 @@ nv84_decoder_vp_h264(struct nv84_decoder *dec, param1.height = param1.h2 = height; param1.h1 = param1.h3 = align(height, 32); param1.format = 0x3231564e; /* 'NV12' */ - param1.mb_adaptive_frame_field_flag = desc->mb_adaptive_frame_field_flag; + param1.mb_adaptive_frame_field_flag = desc->pps->sps->mb_adaptive_frame_field_flag; param1.field_pic_flag = desc->field_pic_flag; param2.width = width; @@ -116,7 +116,7 @@ nv84_decoder_vp_h264(struct nv84_decoder *dec, param2.top = desc->bottom_field_flag ? 2 : 1; param2.bottom = desc->bottom_field_flag; } - param2.mb_adaptive_frame_field_flag = desc->mb_adaptive_frame_field_flag; + param2.mb_adaptive_frame_field_flag = desc->pps->sps->mb_adaptive_frame_field_flag; param2.is_reference = desc->is_reference; PUSH_SPACE(push, 5 + 16 + 3 + 2 + 6 + (is_ref ? 2 : 0) + 3 + 2 + 4 + 2); diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c index 6d878418ba7..95757e30395 100644 --- a/src/gallium/drivers/radeon/radeon_uvd.c +++ b/src/gallium/drivers/radeon/radeon_uvd.c @@ -380,10 +380,16 @@ static struct ruvd_h264 get_h264_msg(struct ruvd_decoder *dec, struct pipe_h264_ result.level = 41; result.sps_info_flags = 0; - result.sps_info_flags |= pic->direct_8x8_inference_flag << 0; - result.sps_info_flags |= pic->mb_adaptive_frame_field_flag << 1; - result.sps_info_flags |= pic->frame_mbs_only_flag << 2; - result.sps_info_flags |= pic->delta_pic_order_always_zero_flag << 3; + result.sps_info_flags |= pic->pps->sps->direct_8x8_inference_flag << 0; + result.sps_info_flags |= pic->pps->sps->mb_adaptive_frame_field_flag << 1; + result.sps_info_flags |= pic->pps->sps->frame_mbs_only_flag << 2; + result.sps_info_flags |= pic->pps->sps->delta_pic_order_always_zero_flag << 3; + + result.bit_depth_luma_minus8 = pic->pps->sps->bit_depth_luma_minus8; + result.bit_depth_chroma_minus8 = pic->pps->sps->bit_depth_chroma_minus8; + result.log2_max_frame_num_minus4 = pic->pps->sps->log2_max_frame_num_minus4; + result.pic_order_cnt_type = pic->pps->sps->pic_order_cnt_type; + result.log2_max_pic_order_cnt_lsb_minus4 = pic->pps->sps->log2_max_pic_order_cnt_lsb_minus4; switch (dec->base.chroma_format) { case PIPE_VIDEO_CHROMA_FORMAT_400: @@ -401,37 +407,30 @@ static struct ruvd_h264 get_h264_msg(struct ruvd_decoder *dec, struct pipe_h264_ } result.pps_info_flags = 0; - result.pps_info_flags |= pic->transform_8x8_mode_flag << 0; - result.pps_info_flags |= pic->redundant_pic_cnt_present_flag << 1; - result.pps_info_flags |= pic->constrained_intra_pred_flag << 2; - result.pps_info_flags |= pic->deblocking_filter_control_present_flag << 3; - result.pps_info_flags |= pic->weighted_bipred_idc << 4; - result.pps_info_flags |= pic->weighted_pred_flag << 6; - result.pps_info_flags |= pic->pic_order_present_flag << 7; - result.pps_info_flags |= pic->entropy_coding_mode_flag << 8; - - result.bit_depth_luma_minus8 = 0; - result.bit_depth_chroma_minus8 = 0; - - result.log2_max_frame_num_minus4 = pic->log2_max_frame_num_minus4; - result.pic_order_cnt_type = pic->pic_order_cnt_type; - result.log2_max_pic_order_cnt_lsb_minus4 = pic->log2_max_pic_order_cnt_lsb_minus4; - result.num_ref_frames = pic->num_ref_frames; - result.pic_init_qp_minus26 = pic->pic_init_qp_minus26; - result.chroma_qp_index_offset = pic->chroma_qp_index_offset; - result.second_chroma_qp_index_offset = pic->second_chroma_qp_index_offset; + result.pps_info_flags |= pic->pps->transform_8x8_mode_flag << 0; + result.pps_info_flags |= pic->pps->redundant_pic_cnt_present_flag << 1; + result.pps_info_flags |= pic->pps->constrained_intra_pred_flag << 2; + result.pps_info_flags |= pic->pps->deblocking_filter_control_present_flag << 3; + result.pps_info_flags |= pic->pps->weighted_bipred_idc << 4; + result.pps_info_flags |= pic->pps->weighted_pred_flag << 6; + result.pps_info_flags |= pic->pps->bottom_field_pic_order_in_frame_present_flag << 7; + result.pps_info_flags |= pic->pps->entropy_coding_mode_flag << 8; + + result.num_slice_groups_minus1 = pic->pps->num_slice_groups_minus1; + result.slice_group_map_type = pic->pps->slice_group_map_type; + result.slice_group_change_rate_minus1 = pic->pps->slice_group_change_rate_minus1; + result.pic_init_qp_minus26 = pic->pps->pic_init_qp_minus26; + result.chroma_qp_index_offset = pic->pps->chroma_qp_index_offset; + result.second_chroma_qp_index_offset = pic->pps->second_chroma_qp_index_offset; + + memcpy(result.scaling_list_4x4, pic->pps->ScalingList4x4, 6*16); + memcpy(result.scaling_list_8x8, pic->pps->ScalingList8x8, 2*64); - result.num_slice_groups_minus1 = 0; - result.slice_group_map_type = 0; + result.num_ref_frames = pic->num_ref_frames; result.num_ref_idx_l0_active_minus1 = pic->num_ref_idx_l0_active_minus1; result.num_ref_idx_l1_active_minus1 = pic->num_ref_idx_l1_active_minus1; - result.slice_group_change_rate_minus1 = 0; - - memcpy(result.scaling_list_4x4, pic->scaling_lists_4x4, 6*64); - memcpy(result.scaling_list_8x8, pic->scaling_lists_8x8, 2*64); - result.frame_num = pic->frame_num; memcpy(result.frame_num_list, pic->frame_num_list, 4*16); result.curr_field_order_cnt_list[0] = pic->field_order_cnt[0]; |