summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2016-06-10 21:21:44 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-06-10 21:21:44 +0000
commit2e88a2aa6788d559c5cf3a2f19c6ec4d5780518b (patch)
treef3b5768ee4eb21fa00e97169ce97be417f57993d
parentcdfd7573ecb1e838e755d178022faa0df171df1a (diff)
parent5e4f64c0748095266e48f7f6663d9ce59738ad83 (diff)
downloadandroid_external_libavc-2e88a2aa6788d559c5cf3a2f19c6ec4d5780518b.tar.gz
android_external_libavc-2e88a2aa6788d559c5cf3a2f19c6ec4d5780518b.tar.bz2
android_external_libavc-2e88a2aa6788d559c5cf3a2f19c6ec4d5780518b.zip
Merge "Decoder: Fix slice number increment for error clips" into mnc-dev
-rw-r--r--decoder/ih264d_api.c1
-rw-r--r--decoder/ih264d_parse_headers.c6
-rw-r--r--decoder/ih264d_parse_pslice.c5
-rw-r--r--decoder/ih264d_parse_slice.c6
4 files changed, 15 insertions, 3 deletions
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c
index 8dc9daf..4123f3f 100644
--- a/decoder/ih264d_api.c
+++ b/decoder/ih264d_api.c
@@ -2884,6 +2884,7 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
ps_dec->u4_dec_thread_created = 0;
ps_dec->u4_bs_deblk_thread_created = 0;
ps_dec->u4_cur_bs_mb_num = 0;
+ ps_dec->u4_start_recon_deblk = 0;
DEBUG_THREADS_PRINTF(" Starting process call\n");
diff --git a/decoder/ih264d_parse_headers.c b/decoder/ih264d_parse_headers.c
index 21ebfa8..5f82110 100644
--- a/decoder/ih264d_parse_headers.c
+++ b/decoder/ih264d_parse_headers.c
@@ -1115,6 +1115,12 @@ WORD32 ih264d_parse_nal_unit(iv_obj_t *dec_hdl,
H264_DEC_DEBUG_PRINT("\nForbidden bit set in Nal Unit, Let's try\n");
}
u1_nal_unit_type = NAL_UNIT_TYPE(u1_first_byte);
+ // if any other nal unit other than slice nal is encountered in between a
+ // frame break out of loop without consuming header
+ if((ps_dec->u2_total_mbs_coded != 0) && (u1_nal_unit_type > IDR_SLICE_NAL))
+ {
+ return ERROR_INCOMPLETE_FRAME;
+ }
ps_dec->u1_nal_unit_type = u1_nal_unit_type;
u1_nal_ref_idc = (UWORD8)(NAL_REF_IDC(u1_first_byte));
//Skip all NALUs if SPS and PPS are not decoded
diff --git a/decoder/ih264d_parse_pslice.c b/decoder/ih264d_parse_pslice.c
index 946da1d..73303af 100644
--- a/decoder/ih264d_parse_pslice.c
+++ b/decoder/ih264d_parse_pslice.c
@@ -1552,6 +1552,7 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec,
}
}
}
+ ps_dec->u4_first_slice_in_pic = 0;
}
else
{
@@ -1836,11 +1837,13 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec,
H264_DEC_DEBUG_PRINT("Mbs in slice: %d\n", ps_dec->ps_cur_slice->u4_mbs_in_slice);
- ps_dec->u2_cur_slice_num++;
/* incremented here only if first slice is inserted */
if(ps_dec->u4_first_slice_in_pic != 0)
+ {
ps_dec->ps_parse_cur_slice++;
+ ps_dec->u2_cur_slice_num++;
+ }
ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
diff --git a/decoder/ih264d_parse_slice.c b/decoder/ih264d_parse_slice.c
index e3e5e3b..41c73c3 100644
--- a/decoder/ih264d_parse_slice.c
+++ b/decoder/ih264d_parse_slice.c
@@ -377,6 +377,7 @@ WORD32 ih264d_start_of_pic(dec_struct_t *ps_dec,
ps_dec->ps_parse_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
ps_dec->ps_decode_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
ps_dec->ps_computebs_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
+ ps_dec->u2_cur_slice_num = 0;
/* Initialize all the HP toolsets to zero */
ps_dec->s_high_profile.u1_scaling_present = 0;
@@ -585,7 +586,6 @@ WORD32 ih264d_start_of_pic(dec_struct_t *ps_dec,
ps_dec->u2_mv_2mb[1] = 0;
ps_dec->u1_last_pic_not_decoded = 0;
- ps_dec->u2_cur_slice_num = 0;
ps_dec->u2_cur_slice_num_dec_thread = 0;
ps_dec->u2_cur_slice_num_bs = 0;
ps_dec->u4_intra_pred_line_ofst = 0;
@@ -1439,7 +1439,10 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice,
}
if (ps_dec->u4_first_slice_in_pic == 0)
+ {
ps_dec->ps_parse_cur_slice++;
+ ps_dec->u2_cur_slice_num++;
+ }
ps_dec->u1_slice_header_done = 0;
@@ -1913,7 +1916,6 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice,
if(ret != OK)
return ret;
- ps_dec->u2_cur_slice_num++;
/* storing last Mb X and MbY of the slice */
ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;