Decoder: Conceal picture only if valid picture buffer is obtained. am: 5df744afde am: 7f78e3aa9a am: 8810e9db7f am: 1ab3e51baf am: 32c369cc3f am: fd327a47fb am: b10090d47a am: 2825c578d3 am: 1d6b06a73a
am: 7f049a7472
Change-Id: I5a44be13778eb16c0300d13e5dc1c32d7e0c506a
diff --git a/Android.bp b/Android.bp
index ac7d304..464f768 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,5 +1,7 @@
cc_library_static {
name: "libavcdec",
+ vendor_available: true,
+ shared_libs: ["liblog", "libcutils",],
cflags: [
"-fPIC",
@@ -230,6 +232,8 @@
cc_library_static {
name: "libavcenc",
+ vendor_available: true,
+ shared_libs: ["liblog", "libcutils",],
cflags: [
"-DNDEBUG",
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..3da5c7a
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,3 @@
+marcone@google.com
+essick@google.com
+lajos@google.com
diff --git a/decoder/ih264d_defs.h b/decoder/ih264d_defs.h
index 0682339..4622775 100644
--- a/decoder/ih264d_defs.h
+++ b/decoder/ih264d_defs.h
@@ -34,8 +34,9 @@
*
************************************************************************
*/
-#define H264_MAX_FRAME_WIDTH 3840
-#define H264_MAX_FRAME_HEIGHT 2176
+#define H264_MAX_FRAME_WIDTH 4080
+#define H264_MAX_FRAME_HEIGHT 4080
+#define H264_MAX_FRAME_SIZE (4096 * 2048)
#define H264_MIN_FRAME_WIDTH 16
#define H264_MIN_FRAME_HEIGHT 16
diff --git a/decoder/ih264d_parse_headers.c b/decoder/ih264d_parse_headers.c
index d8c37a6..4f3136f 100644
--- a/decoder/ih264d_parse_headers.c
+++ b/decoder/ih264d_parse_headers.c
@@ -791,6 +791,12 @@
u1_level_idc, ps_seq->u2_total_num_of_mbs);
u1_frm = ih264d_get_bit_h264(ps_bitstrm);
+ if((ps_dec->i4_header_decoded & 1) && (ps_seq->u1_frame_mbs_only_flag != u1_frm))
+ {
+ ps_dec->u1_res_changed = 1;
+ return IVD_RES_CHANGED;
+ }
+
ps_seq->u1_frame_mbs_only_flag = u1_frm;
COPYTHECONTEXT("SPS: frame_mbs_only_flag", u1_frm);
@@ -911,7 +917,9 @@
}
/* Check for unsupported resolutions */
- if((u2_pic_wd > H264_MAX_FRAME_WIDTH) || (u2_pic_ht > H264_MAX_FRAME_HEIGHT))
+ if((u2_pic_wd > H264_MAX_FRAME_WIDTH) || (u2_pic_ht > H264_MAX_FRAME_HEIGHT)
+ || (u2_pic_wd < H264_MIN_FRAME_WIDTH) || (u2_pic_ht < H264_MIN_FRAME_HEIGHT)
+ || (u2_pic_wd * (UWORD32)u2_pic_ht > H264_MAX_FRAME_SIZE))
{
return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
}
diff --git a/decoder/ih264d_utils.c b/decoder/ih264d_utils.c
index 63a279d..e85daba 100644
--- a/decoder/ih264d_utils.c
+++ b/decoder/ih264d_utils.c
@@ -641,27 +641,6 @@
return (i4_size);
}
-/***************************************************************************/
-/* If change in Level or the required PicBuffers i4_size is more than the */
-/* current one FREE the current PicBuffers and allocate affresh */
-/***************************************************************************/
-UWORD8 ih264d_is_sps_changed(prev_seq_params_t * ps_prv,
- dec_seq_params_t * ps_cur)
-{
-
- if((ps_prv->u2_frm_wd_in_mbs != ps_cur->u2_frm_wd_in_mbs)
- || (ps_prv->u1_level_idc != ps_cur->u1_level_idc)
- || (ps_prv->u1_profile_idc != ps_cur->u1_profile_idc)
- || (ps_cur->u2_frm_ht_in_mbs != ps_prv->u2_frm_ht_in_mbs)
- || (ps_cur->u1_frame_mbs_only_flag
- != ps_prv->u1_frame_mbs_only_flag)
- || (ps_cur->u1_direct_8x8_inference_flag
- != ps_prv->u1_direct_8x8_inference_flag))
- return 1;
-
- return 0;
-}
-
/**************************************************************************/
/* This function initialises the value of ps_dec->u1_recon_mb_grp */
/* ps_dec->u1_recon_mb_grp must satisfy the following criteria */
@@ -747,8 +726,7 @@
/* If change in Level or the required PicBuffers i4_size is more than the */
/* current one FREE the current PicBuffers and allocate affresh */
/***************************************************************************/
- if(!ps_dec->u1_init_dec_flag
- || ih264d_is_sps_changed(ps_prev_seq_params, ps_seq))
+ if(!ps_dec->u1_init_dec_flag)
{
ps_dec->u1_max_dec_frame_buffering = ih264d_get_dpb_size(ps_seq);