summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@cyngn.com>2016-08-02 11:02:16 -0700
committerJessica Wagantall <jwagantall@cyngn.com>2016-08-02 11:37:38 -0700
commit6718ae7e5dfd747712e8b76a1607b5bbbdad98d3 (patch)
treecaa08fc3731238f47cf0af982ef5650fe609c033
parenta76695a86559023014f495c263b111ce2bd6b473 (diff)
parent326fe991a4b7971e8aeaf4ac775491dd8abd85bb (diff)
downloadandroid_external_libavc-6718ae7e5dfd747712e8b76a1607b5bbbdad98d3.tar.gz
android_external_libavc-6718ae7e5dfd747712e8b76a1607b5bbbdad98d3.tar.bz2
android_external_libavc-6718ae7e5dfd747712e8b76a1607b5bbbdad98d3.zip
Merge tag 'android-6.0.1_r61' into HEAD
Android 6.0.1 Release 61 (MOB30Z) Change-Id: I107a592189bf09de163549a3645c37eff8b70e03
-rw-r--r--decoder/ih264d_api.c9
-rw-r--r--decoder/ih264d_parse_headers.c6
-rw-r--r--decoder/ih264d_parse_pslice.c5
-rw-r--r--decoder/ih264d_parse_slice.c7
4 files changed, 21 insertions, 6 deletions
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c
index e2fa322..801960b 100644
--- a/decoder/ih264d_api.c
+++ b/decoder/ih264d_api.c
@@ -1895,12 +1895,14 @@ 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 = 2;
+ ps_dec->u1_first_pb_nal_in_pic = 1;
ps_dec->u1_slice_header_done = 0;
ps_dec->u1_dangling_field = 0;
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");
@@ -2065,8 +2067,10 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
if((ret == IVD_RES_CHANGED)
|| (ret == IVD_MEM_ALLOC_FAILED)
|| (ret == ERROR_UNAVAIL_PICBUF_T)
- || (ret == ERROR_UNAVAIL_MVBUF_T))
+ || (ret == ERROR_UNAVAIL_MVBUF_T)
+ || (ret == ERROR_INV_SPS_PPS_T))
{
+ ps_dec->u4_slice_start_code_found = 0;
break;
}
@@ -2148,7 +2152,8 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
if((ret == IVD_RES_CHANGED)
|| (ret == IVD_MEM_ALLOC_FAILED)
|| (ret == ERROR_UNAVAIL_PICBUF_T)
- || (ret == ERROR_UNAVAIL_MVBUF_T))
+ || (ret == ERROR_UNAVAIL_MVBUF_T)
+ || (ret == ERROR_INV_SPS_PPS_T))
{
/* signal the decode thread */
diff --git a/decoder/ih264d_parse_headers.c b/decoder/ih264d_parse_headers.c
index 94ec8a8..1d97071 100644
--- a/decoder/ih264d_parse_headers.c
+++ b/decoder/ih264d_parse_headers.c
@@ -1038,6 +1038,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 a751a88..c712ed5 100644
--- a/decoder/ih264d_parse_pslice.c
+++ b/decoder/ih264d_parse_pslice.c
@@ -1550,6 +1550,7 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec,
}
}
}
+ ps_dec->u4_first_slice_in_pic = 0;
}
else
{
@@ -1842,11 +1843,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 5ff92f8..911b11d 100644
--- a/decoder/ih264d_parse_slice.c
+++ b/decoder/ih264d_parse_slice.c
@@ -374,6 +374,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;
@@ -573,7 +574,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;
@@ -940,7 +940,6 @@ WORD32 ih264d_end_of_pic(dec_struct_t *ps_dec,
dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
WORD32 ret;
- ps_dec->u1_first_pb_nal_in_pic = 1;
ps_dec->u2_mbx = 0xffff;
ps_dec->u2_mby = 0;
{
@@ -1425,7 +1424,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;
@@ -1908,7 +1910,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;