Check change in CTB size when decoding multiple SPS with same id

If an SPS is being overwritten, ensure CTB size remains same.
If not, return from decoder and reset the decoder state in the
subsequent decode call.

Bug: 140322595
Test: poc in bug

Change-Id: I5f1e52d3bd2b48874a088ab32054f5a89e62eeb5
This commit is contained in:
Harish Mahendrakar 2019-09-13 16:52:49 -07:00 • committed by Ray Essick
parent 9fcd94f316
commit 70940fbabd

View file

@ -1675,6 +1675,19 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec)
{
return IHEVCD_INVALID_PARAMETER;
}
/* Check if CTB size is different in case of multiple SPS with same ID */
{
sps_t *ps_sps_old = (ps_codec->s_parse.ps_sps_base + sps_id);
if(ps_sps_old->i1_sps_valid && ps_sps_old->i1_log2_ctb_size != ctb_log2_size_y)
{
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_sps->i1_log2_ctb_size = ctb_log2_size_y;
UEV_PARSE("log2_min_transform_block_size_minus2", value, ps_bitstrm);