diff options
author | Hamsalekha S <hamsalekha.s@ittiam.com> | 2017-05-23 11:53:52 +0530 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-15 18:56:02 +0000 |
commit | 5d88b6e7fb3743989114658eec59498d25327e90 (patch) | |
tree | 10e8e4b0ba0fffdc9bcf31a5729b7ead62f2ae8d | |
parent | b96c229fdf73227aca5c84031a5a87aa629bcb2e (diff) | |
download | android_external_libavc-5d88b6e7fb3743989114658eec59498d25327e90.tar.gz android_external_libavc-5d88b6e7fb3743989114658eec59498d25327e90.tar.bz2 android_external_libavc-5d88b6e7fb3743989114658eec59498d25327e90.zip |
Initializing reference list for every P/B slice.
Reference list needs to be initialized for every P/B
slice, to ensure colocated picture always points to a
valid picture buffer, even in the case of error.
Bug: 36279112
Change-Id: I051d7e725b0af209cc7bb333db8da3518adf78a0
(cherry picked from commit f9d3f9af8fc113acda28e1a4e48d85736ee29c75)
-rw-r--r-- | decoder/ih264d_api.c | 2 | ||||
-rw-r--r-- | decoder/ih264d_parse_bslice.c | 17 | ||||
-rw-r--r-- | decoder/ih264d_parse_pslice.c | 18 | ||||
-rw-r--r-- | decoder/ih264d_parse_slice.c | 8 | ||||
-rw-r--r-- | decoder/ih264d_structs.h | 2 |
5 files changed, 5 insertions, 42 deletions
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c index 640fdea..2cde456 100644 --- a/decoder/ih264d_api.c +++ b/decoder/ih264d_api.c @@ -1002,7 +1002,6 @@ void ih264d_init_decoder(void * ps_dec_params) ps_dec->ps_cur_sps = NULL; ps_dec->u1_init_dec_flag = 0; ps_dec->u1_first_slice_in_stream = 1; - ps_dec->u1_first_pb_nal_in_pic = 1; ps_dec->u1_last_pic_not_decoded = 0; ps_dec->u4_app_disp_width = 0; ps_dec->i4_header_decoded = 0; @@ -1919,7 +1918,6 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) ps_dec->cur_dec_mb_num = 0; ps_dec->cur_recon_mb_num = 0; ps_dec->u4_first_slice_in_pic = 1; - ps_dec->u1_first_pb_nal_in_pic = 1; ps_dec->u1_slice_header_done = 0; ps_dec->u1_dangling_field = 0; diff --git a/decoder/ih264d_parse_bslice.c b/decoder/ih264d_parse_bslice.c index 85b0d0f..772964a 100644 --- a/decoder/ih264d_parse_bslice.c +++ b/decoder/ih264d_parse_bslice.c @@ -1405,22 +1405,9 @@ WORD32 ih264d_parse_bslice(dec_struct_t * ps_dec, UWORD16 u2_first_mb_in_slice) ps_slice->u1_num_ref_idx_lx_active[0] = u4_temp; ps_slice->u1_num_ref_idx_lx_active[1] = ui_temp1; } - /* Initialize the Reference list once in Picture if the slice type */ - /* of first slice is between 5 to 9 defined in table 7.3 of standard */ - /* If picture contains both P & B slices then Initialize the Reference*/ - /* List only when it switches from P to B and B to P */ - { - UWORD8 init_idx_flg = (ps_dec->u1_pr_sl_type - != ps_dec->ps_cur_slice->u1_slice_type); - if(ps_dec->u1_first_pb_nal_in_pic - || (init_idx_flg & !ps_dec->u1_sl_typ_5_9) - || ps_dec->u1_num_ref_idx_lx_active_prev - != ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]) - ih264d_init_ref_idx_lx_b(ps_dec); - if(ps_dec->u1_first_pb_nal_in_pic & ps_dec->u1_sl_typ_5_9) - ps_dec->u1_first_pb_nal_in_pic = 0; - } + + ih264d_init_ref_idx_lx_b(ps_dec); /* Store the value for future slices in the same picture */ ps_dec->u1_num_ref_idx_lx_active_prev = ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]; diff --git a/decoder/ih264d_parse_pslice.c b/decoder/ih264d_parse_pslice.c index 97ea27c..bcfbe05 100644 --- a/decoder/ih264d_parse_pslice.c +++ b/decoder/ih264d_parse_pslice.c @@ -1977,23 +1977,7 @@ WORD32 ih264d_parse_pslice(dec_struct_t *ps_dec, UWORD16 u2_first_mb_in_slice) UWORD8 uc_refIdxReFlagL0 = ih264d_get_bit_h264(ps_bitstrm); COPYTHECONTEXT("SH: ref_pic_list_reordering_flag_l0",uc_refIdxReFlagL0); - /* Initialize the Reference list once in Picture if the slice type */ - /* of first slice is between 5 to 9 defined in table 7.3 of standard */ - /* If picture contains both P & B slices then Initialize the Reference*/ - /* List only when it switches from P to B and B to P */ - { - UWORD8 init_idx_flg = (ps_dec->u1_pr_sl_type - != ps_dec->ps_cur_slice->u1_slice_type); - if(ps_dec->u1_first_pb_nal_in_pic - || (init_idx_flg & !ps_dec->u1_sl_typ_5_9) - || ps_dec->u1_num_ref_idx_lx_active_prev - != ps_cur_slice->u1_num_ref_idx_lx_active[0]) - { - ih264d_init_ref_idx_lx_p(ps_dec); - } - if(ps_dec->u1_first_pb_nal_in_pic & ps_dec->u1_sl_typ_5_9) - ps_dec->u1_first_pb_nal_in_pic = 0; - } + ih264d_init_ref_idx_lx_p(ps_dec); /* Store the value for future slices in the same picture */ ps_dec->u1_num_ref_idx_lx_active_prev = ps_cur_slice->u1_num_ref_idx_lx_active[0]; diff --git a/decoder/ih264d_parse_slice.c b/decoder/ih264d_parse_slice.c index 7e0815f..fad2dff 100644 --- a/decoder/ih264d_parse_slice.c +++ b/decoder/ih264d_parse_slice.c @@ -284,10 +284,8 @@ WORD32 ih264d_start_of_pic(dec_struct_t *ps_dec, { dec_err_status_t * ps_err = ps_dec->ps_dec_err_status; - if(ps_dec->u1_sl_typ_5_9 - && ((ps_cur_slice->u1_slice_type == I_SLICE) - || (ps_cur_slice->u1_slice_type - == SI_SLICE))) + if((ps_cur_slice->u1_slice_type == I_SLICE) + || (ps_cur_slice->u1_slice_type == SI_SLICE)) ps_err->u1_cur_pic_type = PIC_TYPE_I; else ps_err->u1_cur_pic_type = PIC_TYPE_UNKNOWN; @@ -1034,14 +1032,12 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice, u1_slice_type = u4_temp; COPYTHECONTEXT("SH: slice_type",(u1_slice_type)); - ps_dec->u1_sl_typ_5_9 = 0; /* Find Out the Slice Type is 5 to 9 or not then Set the Flag */ /* u1_sl_typ_5_9 = 1 .Which tells that all the slices in the Pic*/ /* will be of same type of current */ if(u1_slice_type > 4) { u1_slice_type -= 5; - ps_dec->u1_sl_typ_5_9 = 1; } { diff --git a/decoder/ih264d_structs.h b/decoder/ih264d_structs.h index cde3dd7..c83c34e 100644 --- a/decoder/ih264d_structs.h +++ b/decoder/ih264d_structs.h @@ -897,11 +897,9 @@ typedef struct _DecStruct /* slice Header Simplification */ UWORD8 u1_pr_sl_type; - UWORD8 u1_sl_typ_5_9; WORD32 i4_frametype; UWORD32 u4_app_disp_width; WORD32 i4_error_code; - UWORD8 u1_first_pb_nal_in_pic; UWORD32 u4_bitoffset; /* Variables added to handle field pics */ |