summaryrefslogtreecommitdiffstats
path: root/decoder/ih264d_parse_slice.c
diff options
context:
space:
mode:
authorRakesh Kumar <rakesh.kumar@ittiam.com>2019-05-29 14:31:32 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-05-29 14:31:32 -0700
commit75cd59e45bff03df01de8857ff55e9a64891ce45 (patch)
tree5b5577b3c53dcf6a6f7ce2051edc700fd5de67fa /decoder/ih264d_parse_slice.c
parent26bcb6b37b018dd08b169ff14d76adc54d7b7b2c (diff)
parentd406f0881641f97ff8127f4e5144b769211a8a7d (diff)
downloadplatform_external_libavc-75cd59e45bff03df01de8857ff55e9a64891ce45.tar.gz
platform_external_libavc-75cd59e45bff03df01de8857ff55e9a64891ce45.tar.bz2
platform_external_libavc-75cd59e45bff03df01de8857ff55e9a64891ce45.zip
[automerger] Decoder: Delete node from st if lt and st point to same am: f312a1d305 am: f82a1f8d7f am: ae2c8cfdc1 am: 8332d0bfa2 am: 1e6ef7fee5 am: b1734142ff am: 9460fbd521 am: 224bcf4592
am: d406f08816 Change-Id: I1351851c15384868d9ab579857e4fc46076f5942
Diffstat (limited to 'decoder/ih264d_parse_slice.c')
-rw-r--r--decoder/ih264d_parse_slice.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/decoder/ih264d_parse_slice.c b/decoder/ih264d_parse_slice.c
index c384f45..8d50f9a 100644
--- a/decoder/ih264d_parse_slice.c
+++ b/decoder/ih264d_parse_slice.c
@@ -982,6 +982,69 @@ WORD32 ih264d_end_of_pic(dec_struct_t *ps_dec)
return OK;
}
+
+/*!
+ **************************************************************************
+ * \if Function name : ih264d_fix_error_in_dpb \endif
+ *
+ * \brief
+ * fix error in DPB
+ *
+ * \return
+ * Number of node(s) deleted
+ **************************************************************************
+ */
+
+WORD32 ih264d_fix_error_in_dpb(dec_struct_t *ps_dec)
+{
+ /*--------------------------------------------------------------------*/
+ /* If there is common node in lt_list and st_list then delete it from */
+ /* st_list */
+ /*--------------------------------------------------------------------*/
+ UWORD8 no_of_nodes_deleted = 0;
+ UWORD8 lt_ref_num = ps_dec->ps_dpb_mgr->u1_num_lt_ref_bufs;
+ struct dpb_info_t *ps_lt_curr_dpb = ps_dec->ps_dpb_mgr->ps_dpb_ht_head;
+ while(lt_ref_num && ps_lt_curr_dpb)
+ {
+ if(ps_dec->ps_dpb_mgr->ps_dpb_st_head
+ && ((ps_lt_curr_dpb->s_bot_field.u1_reference_info
+ | ps_lt_curr_dpb->s_top_field.u1_reference_info)
+ == (IS_SHORT_TERM | IS_LONG_TERM)))
+ {
+ struct dpb_info_t *ps_st_next_dpb = ps_dec->ps_dpb_mgr->ps_dpb_st_head;
+ struct dpb_info_t *ps_st_curr_dpb = ps_dec->ps_dpb_mgr->ps_dpb_st_head;
+ UWORD8 st_ref_num = ps_dec->ps_dpb_mgr->u1_num_st_ref_bufs;
+ while(st_ref_num && ps_st_curr_dpb)
+ {
+ if(ps_st_curr_dpb == ps_lt_curr_dpb)
+ {
+ if(st_ref_num == ps_dec->ps_dpb_mgr->u1_num_st_ref_bufs)
+ {
+ ps_dec->ps_dpb_mgr->ps_dpb_st_head =
+ ps_dec->ps_dpb_mgr->ps_dpb_st_head->ps_prev_short;
+ ps_st_curr_dpb = ps_dec->ps_dpb_mgr->ps_dpb_st_head;
+ }
+ else
+ {
+ ps_st_next_dpb->ps_prev_short = ps_st_curr_dpb->ps_prev_short;
+ }
+ ps_dec->ps_dpb_mgr->u1_num_st_ref_bufs--;
+ ps_dec->ps_dpb_mgr->u1_num_lt_ref_bufs++;
+ no_of_nodes_deleted++;
+ break;
+ }
+ ps_st_next_dpb = ps_st_curr_dpb;
+ ps_st_curr_dpb = ps_st_curr_dpb->ps_prev_short;
+ st_ref_num--;
+ }
+ }
+ ps_lt_curr_dpb = ps_lt_curr_dpb->ps_prev_long;
+ lt_ref_num--;
+ }
+ return no_of_nodes_deleted;
+}
+
+
/*!
**************************************************************************
* \if Function name : DecodeSlice \endif
@@ -1772,6 +1835,10 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice,
ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
}
+ ret = ih264d_fix_error_in_dpb(ps_dec);
+ if(ret < 0)
+ return ERROR_DBP_MANAGER_T;
+
if(u1_slice_type == I_SLICE)
{
ps_dec->ps_cur_pic->u4_pack_slc_typ |= I_SLC_BIT;