aboutsummaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2021-09-29 16:33:58 -0700
committerHarish Mahendrakar <harish.mahendrakar@ittiam.com>2021-09-29 17:20:50 -0700
commitb10161aba2ac6133f3fa4049921ad024c4dcab16 (patch)
treea11e8fedcd83119054957062a337879d0b0af2a5 /decoder
parentc8b3f9e46f68ef18d1eb65be7a2132dc960e7720 (diff)
downloadlibhevc-b10161aba2ac6133f3fa4049921ad024c4dcab16.tar.gz
decoder: Ignore RASL NALs after flush
After flush, if the first slice NAL sent to decoder is a CRA picture, then it may have associated RASL NALs that need to be skipped as they may contain references to pictures that are not present in the bitstream that is fed to the decoder. Currently decoder was handling this case only at the start of decode and after receiving an EOS NAL. Now it is updated to ignore such RASL NALs associated with CRA after flush as well. This is needed to handle seek in clips, where CRA NALS are marked as sync points. Bug: 194768162 Test: poc in bug Test: atest VtsHalMediaC2V1_0TargetVideoDecTest Test: atest CtsMediaV2TestCases:CodecDecoderTest Change-Id: If5f38b0689c98c4d2a2a720b81d7e28593be5732
Diffstat (limited to 'decoder')
-rw-r--r--decoder/ihevcd_api.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/decoder/ihevcd_api.c b/decoder/ihevcd_api.c
index 4d094be..d8ee57d 100644
--- a/decoder/ihevcd_api.c
+++ b/decoder/ihevcd_api.c
@@ -2427,6 +2427,10 @@ WORD32 ihevcd_set_flush_mode(iv_obj_t *ps_codec_obj,
/* once it comes out of flush mode */
ps_codec->u4_pic_cnt = 0;
ps_codec->u4_disp_cnt = 0;
+
+ /* If the first slice NAL fed to decoder after flush is a CRA NAL, then */
+ /* it may have associated RASL nals that need to be skipped */
+ ps_codec->i4_cra_as_first_pic = 1;
return IV_SUCCESS;