aboutsummaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorHamsalekha S <hamsalekha.s@ittiam.com>2017-06-06 18:05:00 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-06-06 18:05:00 +0000
commitd603f906d26eede34ea1610166e672c694511d3b (patch)
tree495a25d6633f997c2a826b4bd7d1dab13fecba2f /decoder
parent8197af671dceb107292e8e861c634c925ddf03d0 (diff)
parent8b3d04328021dff5bec2d0c136de1f087ea998e5 (diff)
downloadlibavc-d603f906d26eede34ea1610166e672c694511d3b.tar.gz
Merge "Fix resolution change within a decode call." into mnc-dev am: 7fc42b801c am: 252ca18add am: 4c6288e861 am: 90fc697c82
am: 8b3d043280 Change-Id: I3812d5c6cd9ea03959c020ad12ceec69144a282c
Diffstat (limited to 'decoder')
-rw-r--r--decoder/ih264d_api.c1
-rw-r--r--decoder/ih264d_parse_headers.c10
-rw-r--r--decoder/ih264d_structs.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c
index 6940788..640fdea 100644
--- a/decoder/ih264d_api.c
+++ b/decoder/ih264d_api.c
@@ -1927,6 +1927,7 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
ps_dec->u4_bs_deblk_thread_created = 0;
ps_dec->u4_cur_bs_mb_num = 0;
ps_dec->u4_start_recon_deblk = 0;
+ ps_dec->u4_sps_cnt_in_process = 0;
DEBUG_THREADS_PRINTF(" Starting process call\n");
diff --git a/decoder/ih264d_parse_headers.c b/decoder/ih264d_parse_headers.c
index 068ee5b..2694114 100644
--- a/decoder/ih264d_parse_headers.c
+++ b/decoder/ih264d_parse_headers.c
@@ -1154,6 +1154,16 @@ WORD32 ih264d_parse_nal_unit(iv_obj_t *dec_hdl,
/* ! */
ih264d_rbsp_to_sodb(ps_dec->ps_bitstrm);
i_status = ih264d_parse_sps(ps_dec, ps_bitstrm);
+ ps_dec->u4_sps_cnt_in_process++;
+ /*If a resolution change happens within a process call, due to multiple sps
+ * we will not support it.
+ */
+ if((ps_dec->u4_sps_cnt_in_process > 1 ) &&
+ (i_status == IVD_RES_CHANGED))
+ {
+ i_status = ERROR_INV_SPS_PPS_T;
+ ps_dec->u1_res_changed = 0;
+ }
if(i_status == ERROR_INV_SPS_PPS_T)
return i_status;
if(!i_status)
diff --git a/decoder/ih264d_structs.h b/decoder/ih264d_structs.h
index 4260393..cde3dd7 100644
--- a/decoder/ih264d_structs.h
+++ b/decoder/ih264d_structs.h
@@ -1249,6 +1249,7 @@ typedef struct _DecStruct
UWORD32 u4_cur_bs_mb_num;
UWORD32 u4_bs_cur_slice_num_mbs;
UWORD32 u4_cur_deblk_mb_num;
+ UWORD32 u4_sps_cnt_in_process;
volatile UWORD16 u2_cur_slice_num_bs;
UWORD32 u4_deblk_mb_x;