summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-06-11 21:07:36 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-06-11 21:07:36 +0000
commit8b5c548571efb49da4c13d2d8b694b911cb98ecb (patch)
tree3a6f92cea3d9672d27e12ef40e8b6203a9e57c41
parent48900d4e516231f228943cb7dab2d33a5660558f (diff)
parent2ecb18fc4515237709576057be92cb53eca520e3 (diff)
downloadandroid_external_libavc-8b5c548571efb49da4c13d2d8b694b911cb98ecb.tar.gz
android_external_libavc-8b5c548571efb49da4c13d2d8b694b911cb98ecb.tar.bz2
android_external_libavc-8b5c548571efb49da4c13d2d8b694b911cb98ecb.zip
Merge cherrypicks of [7982564, 7982192, 7982565, 7981411, 7982522, 7982682, 7982193, 7982194, 7982523, 7982480, 7982623, 7981412, 7981413, 7982605, 7982606, 7982607, 7982608, 7981749, 7981750, 7981751, 7981752, 7981753, 7981754, 7982624, 7982394, 7982395, 7982625, 7982687, 7982566, 7982567, 7982568, 7982688, 7982689, 7982690, 7982195, 7982196, 7982611, 7982612, 7982396, 7982694, 7982695, 7982215] into pi-qpr3-release
Change-Id: I545c88228a2ba4b2dcd72311fe6bc859e0fd7906
-rw-r--r--decoder/ih264d_parse_slice.c67
-rw-r--r--decoder/ih264d_parse_slice.h1
2 files changed, 68 insertions, 0 deletions
diff --git a/decoder/ih264d_parse_slice.c b/decoder/ih264d_parse_slice.c
index db02bfe..b477c10 100644
--- a/decoder/ih264d_parse_slice.c
+++ b/decoder/ih264d_parse_slice.c
@@ -979,6 +979,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
@@ -1821,6 +1884,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;
diff --git a/decoder/ih264d_parse_slice.h b/decoder/ih264d_parse_slice.h
index c012062..0f82ec9 100644
--- a/decoder/ih264d_parse_slice.h
+++ b/decoder/ih264d_parse_slice.h
@@ -37,6 +37,7 @@
#include "ih264_platform_macros.h"
#include "ih264d_structs.h"
#include "ih264d_error_handler.h"
+WORD32 ih264d_fix_error_in_dpb(dec_struct_t * ps_dec);
WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice,
UWORD8 u1_nal_ref_idc,
dec_struct_t * ps_dec );