summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-03-15 23:16:33 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-03-15 23:16:33 +0000
commite9a5ff6a638763ce4e926a180d5ab04114f1a732 (patch)
tree4f63d98ffb8a67a10c3728dd75cddf29423b99eb
parent3f1e03369e6ab95ebf7650cf7565f1eeec937921 (diff)
parentd80f82fefec06b0db92565e8c0b74a9ba9667c6a (diff)
downloadplatform_external_libhevc-nougat-mr0.5-release.tar.gz
platform_external_libhevc-nougat-mr0.5-release.tar.bz2
platform_external_libhevc-nougat-mr0.5-release.zip
Merge cherrypicks of [6738238, 6739193, 6738335, 6738239, 6739470, 6739471, 6738201, 6738202, 6738203, 6738204, 6738205, 6738206, 6738207, 6738208, 6738209, 6739510, 6739511, 6739512, 6739513, 6739514, 6739515, 6739516, 6738336, 6739517, 6739518, 6738416, 6738417, 6739472, 6739473, 6739519, 6739520, 6739071, 6739072, 6738695, 6738696, 6738697, 6738698, 6738699, 6738243, 6739521, 6738244, 6738153, 6738154, 6738155, 6738156, 6738157, 6738158, 6738159, 6738160, 6739522, 6739523] into nyc-bugfix-releaseandroid-7.0.0_r36nougat-mr0.5-release
Change-Id: Ic2130349b436089e0ad4d713b0e44710a616b69d
-rw-r--r--decoder/ihevcd_parse_headers.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/decoder/ihevcd_parse_headers.c b/decoder/ihevcd_parse_headers.c
index a537306..803c6c1 100644
--- a/decoder/ihevcd_parse_headers.c
+++ b/decoder/ihevcd_parse_headers.c
@@ -1600,6 +1600,18 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec)
if((0 >= disp_wd) || (0 >= disp_ht))
return IHEVCD_INVALID_PARAMETER;
+ if((0 != ps_codec->u4_allocate_dynamic_done) &&
+ ((ps_codec->i4_disp_wd != disp_wd) ||
+ (ps_codec->i4_disp_ht != disp_ht)))
+ {
+ if(0 == ps_codec->i4_first_pic_done)
+ {
+ return IHEVCD_INVALID_PARAMETER;
+ }
+ ps_codec->i4_reset_flag = 1;
+ return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
+ }
+
ps_codec->i4_disp_wd = disp_wd;
ps_codec->i4_disp_ht = disp_ht;
@@ -1822,16 +1834,32 @@ IHEVCD_ERROR_T ihevcd_parse_pps(codec_t *ps_codec)
ps_pps->i1_tiles_enabled_flag = value;
/* When tiles are enabled and width or height is >= 4096,
- * CTB Size should at least be 32. 16x16 CTBs can result
- * in tile position greater than 255 for 4096,
+ * CTB Size should at least be 32 while if width or height is >= 8192,
+ * CTB Size should at least be 64 and so on. 16x16 CTBs can result
+ * in tile position greater than 255 for 4096 while 32x32 CTBs can result
+ * in tile position greater than 255 for 8192,
* which decoder does not support.
*/
- if((ps_pps->i1_tiles_enabled_flag) &&
- (ps_sps->i1_log2_ctb_size == 4) &&
- ((ps_sps->i2_pic_width_in_luma_samples >= 4096) ||
- (ps_sps->i2_pic_height_in_luma_samples >= 4096)))
+ if (ps_pps->i1_tiles_enabled_flag)
{
- return IHEVCD_INVALID_HEADER;
+ if((ps_sps->i1_log2_ctb_size == 4) &&
+ ((ps_sps->i2_pic_width_in_luma_samples >= 4096) ||
+ (ps_sps->i2_pic_height_in_luma_samples >= 4096)))
+ {
+ return IHEVCD_INVALID_HEADER;
+ }
+ if((ps_sps->i1_log2_ctb_size == 5) &&
+ ((ps_sps->i2_pic_width_in_luma_samples >= 8192) ||
+ (ps_sps->i2_pic_height_in_luma_samples >= 8192)))
+ {
+ return IHEVCD_INVALID_HEADER;
+ }
+ if((ps_sps->i1_log2_ctb_size == 6) &&
+ ((ps_sps->i2_pic_width_in_luma_samples >= 16384) ||
+ (ps_sps->i2_pic_height_in_luma_samples >= 16384)))
+ {
+ return IHEVCD_INVALID_HEADER;
+ }
}
BITS_PARSE("entropy_coding_sync_enabled_flag", value, ps_bitstrm, 1);