diff options
author | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | 2016-04-20 16:13:52 +0530 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2016-05-20 15:27:35 -0700 |
commit | 33db7a0f4e5e2eb937a17b550ff8092a13f929a3 (patch) | |
tree | 1e3b1d610e76843b5b9731c2218026e1863e3391 | |
parent | 37579218eb5261d59c36fcc741b11155894dddd7 (diff) | |
download | android_external_libavc-33db7a0f4e5e2eb937a17b550ff8092a13f929a3.tar.gz android_external_libavc-33db7a0f4e5e2eb937a17b550ff8092a13f929a3.tar.bz2 android_external_libavc-33db7a0f4e5e2eb937a17b550ff8092a13f929a3.zip |
Decoder: Initialize slice parameters before concealing error MBs
Also memset ps_dec_op structure to zero.
For error input, this ensures dimensions are initialized to zero
Bug: 28165661
Change-Id: I66eb2ddc5e02e74b7ff04da5f749443920f37141
-rw-r--r-- | decoder/ih264d_api.c | 8 | ||||
-rw-r--r-- | decoder/ih264d_parse_pslice.c | 9 | ||||
-rw-r--r-- | decoder/ih264d_parse_slice.c | 3 |
3 files changed, 18 insertions, 2 deletions
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c index 40ce3c6..255b4cd 100644 --- a/decoder/ih264d_api.c +++ b/decoder/ih264d_api.c @@ -2618,6 +2618,14 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) ps_dec_ip = (ivd_video_decode_ip_t *)pv_api_ip; ps_dec_op = (ivd_video_decode_op_t *)pv_api_op; + + { + UWORD32 u4_size; + u4_size = ps_dec_op->u4_size; + memset(ps_dec_op, 0, sizeof(ivd_video_decode_op_t)); + ps_dec_op->u4_size = u4_size; + } + ps_dec->pv_dec_out = ps_dec_op; ps_dec->process_called = 1; if(ps_dec->init_done != 1) diff --git a/decoder/ih264d_parse_pslice.c b/decoder/ih264d_parse_pslice.c index 3cac387..79172ee 100644 --- a/decoder/ih264d_parse_pslice.c +++ b/decoder/ih264d_parse_pslice.c @@ -1496,6 +1496,12 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec, if(ps_dec->ps_pps[i].u1_is_valid == TRUE) j = i; { + //initialize slice params required by ih264d_start_of_pic to valid values + ps_dec->ps_cur_slice->u1_bottom_field_flag = 0; + ps_dec->ps_cur_slice->u1_field_pic_flag = 0; + ps_dec->ps_cur_slice->u1_slice_type = P_SLICE; + ps_dec->ps_cur_slice->u1_nal_ref_idc = 1; + ps_dec->ps_cur_slice->u1_nal_unit_type = 1; ret = ih264d_start_of_pic(ps_dec, poc, ps_cur_poc, ps_dec->ps_cur_slice->u2_frame_num, &ps_dec->ps_pps[j]); @@ -1665,6 +1671,9 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec, } ps_dec->ps_cur_slice->u2_first_mb_in_slice = ps_dec->u2_total_mbs_coded << u1_mbaff; + ps_dec->ps_cur_slice->i1_slice_alpha_c0_offset = 0; + ps_dec->ps_cur_slice->i1_slice_beta_offset = 0; + if(ps_dec->ps_cur_slice->u1_field_pic_flag) ps_dec->u2_prv_frame_num = ps_dec->ps_cur_slice->u2_frame_num; diff --git a/decoder/ih264d_parse_slice.c b/decoder/ih264d_parse_slice.c index eef9db5..e3e5e3b 100644 --- a/decoder/ih264d_parse_slice.c +++ b/decoder/ih264d_parse_slice.c @@ -733,7 +733,7 @@ WORD32 ih264d_start_of_pic(dec_struct_t *ps_dec, ps_dec->u4_deblk_mb_x = 0; ps_dec->u4_deblk_mb_y = 0; - + ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat; H264_MUTEX_UNLOCK(&ps_dec->process_disp_mutex); return OK; @@ -1874,7 +1874,6 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice, ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data; } - ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat; if(u1_slice_type == I_SLICE) { ps_dec->ps_cur_pic->u4_pack_slc_typ |= I_SLC_BIT; |