• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/intel-driver


Commit MetaInfo

Revisãof5cac6fd7171c801bd13f7e0c48a86cff234a004 (tree)
Hora2015-04-29 16:58:36
AutorXiang, Haihao <haihao.xiang@inte...>
CommiterXiang, Haihao

Mensagem de Log

HEVC/dec: Fix collocated_ref_idx and collocated_from_l0_flag

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>

Mudança Sumário

Diff

--- a/src/gen9_mfd.c
+++ b/src/gen9_mfd.c
@@ -197,6 +197,10 @@ gen9_hcpd_hevc_decode_init(VADriverContextP ctx,
197197 size <<= 6;
198198 ALLOC_GEN_BUFFER((&gen9_hcpd_context->sao_tile_column_buffer), "sao tile column buffer", size);
199199
200+ gen9_hcpd_context->first_inter_slice_collocated_ref_idx = 0;
201+ gen9_hcpd_context->first_inter_slice_collocated_from_l0_flag = 0;
202+ gen9_hcpd_context->first_inter_slice_valid = 0;
203+
200204 return VA_STATUS_SUCCESS;
201205 }
202206
@@ -707,6 +711,9 @@ gen9_hcpd_get_collocated_ref_idx(VADriverContextP ctx,
707711 if (slice_param->collocated_ref_idx > 14)
708712 return 0;
709713
714+ if (!slice_param->LongSliceFlags.fields.slice_temporal_mvp_enabled_flag)
715+ return 0;
716+
710717 if (slice_param->LongSliceFlags.fields.slice_type == HEVC_SLICE_I)
711718 return 0;
712719
@@ -779,6 +786,7 @@ gen9_hcpd_slice_state(VADriverContextP ctx,
779786 {
780787 struct intel_batchbuffer *batch = gen9_hcpd_context->base.batch;
781788 int slice_hor_pos, slice_ver_pos, next_slice_hor_pos, next_slice_ver_pos;
789+ unsigned short collocated_ref_idx, collocated_from_l0_flag;
782790
783791 slice_hor_pos = slice_param->slice_segment_address % gen9_hcpd_context->picture_width_in_ctbs;
784792 slice_ver_pos = slice_param->slice_segment_address / gen9_hcpd_context->picture_width_in_ctbs;
@@ -791,6 +799,25 @@ gen9_hcpd_slice_state(VADriverContextP ctx,
791799 next_slice_ver_pos = 0;
792800 }
793801
802+ collocated_ref_idx = gen9_hcpd_get_collocated_ref_idx(ctx, pic_param, slice_param, gen9_hcpd_context);
803+ collocated_from_l0_flag = slice_param->LongSliceFlags.fields.collocated_from_l0_flag;
804+
805+ if ((!gen9_hcpd_context->first_inter_slice_valid) &&
806+ (slice_param->LongSliceFlags.fields.slice_type != HEVC_SLICE_I) &&
807+ slice_param->LongSliceFlags.fields.slice_temporal_mvp_enabled_flag) {
808+ gen9_hcpd_context->first_inter_slice_collocated_ref_idx = collocated_ref_idx;
809+ gen9_hcpd_context->first_inter_slice_collocated_from_l0_flag = collocated_from_l0_flag;
810+ gen9_hcpd_context->first_inter_slice_valid = 1;
811+ }
812+
813+ /* HW requirement */
814+ if (gen9_hcpd_context->first_inter_slice_valid &&
815+ ((slice_param->LongSliceFlags.fields.slice_type == HEVC_SLICE_I) ||
816+ (!slice_param->LongSliceFlags.fields.slice_temporal_mvp_enabled_flag))) {
817+ collocated_ref_idx = gen9_hcpd_context->first_inter_slice_collocated_ref_idx;
818+ collocated_from_l0_flag = gen9_hcpd_context->first_inter_slice_collocated_from_l0_flag;
819+ }
820+
794821 BEGIN_BCS_BATCH(batch, 9);
795822
796823 OUT_BCS_BATCH(batch, HCP_SLICE_STATE | (9 - 2));
@@ -810,12 +837,12 @@ gen9_hcpd_slice_state(VADriverContextP ctx,
810837 !next_slice_param << 2 |
811838 slice_param->LongSliceFlags.fields.slice_type);
812839 OUT_BCS_BATCH(batch,
813- gen9_hcpd_get_collocated_ref_idx(ctx, pic_param, slice_param, gen9_hcpd_context) << 26 |
840+ collocated_ref_idx << 26 |
814841 (5 - slice_param->five_minus_max_num_merge_cand - 1) << 23 |
815842 slice_param->LongSliceFlags.fields.cabac_init_flag << 22 |
816843 slice_param->luma_log2_weight_denom << 19 |
817844 ((slice_param->luma_log2_weight_denom + slice_param->delta_chroma_log2_weight_denom) & 0x7) << 16 |
818- slice_param->LongSliceFlags.fields.collocated_from_l0_flag << 15 |
845+ collocated_from_l0_flag << 15 |
819846 gen9_hcpd_is_low_delay(ctx, pic_param, slice_param) << 14 |
820847 slice_param->LongSliceFlags.fields.mvd_l1_zero_flag << 13 |
821848 slice_param->LongSliceFlags.fields.slice_sao_luma_flag << 12 |
--- a/src/gen9_mfd.h
+++ b/src/gen9_mfd.h
@@ -65,6 +65,10 @@ struct gen9_hcpd_context
6565 GenBuffer sao_line_buffer;
6666 GenBuffer sao_tile_line_buffer;
6767 GenBuffer sao_tile_column_buffer;
68+
69+ unsigned short first_inter_slice_collocated_ref_idx;
70+ unsigned short first_inter_slice_collocated_from_l0_flag;
71+ int first_inter_slice_valid;
6872 };
6973
7074 #endif /* GEN9_MFD_H */