Fix DebugBitstream issue caused by PDP
Bug
The bug can be reproduced following the workflow for RaceHorses CTC RA QP27 GOP04:
-
Encode:
EncoderApp.exe -c encoder_randomaccess_ecm.cfg -c classD_randomaccess.cfg -c RaceHorses.cfg --SEIDecodedPictureHash=1 --PrintHexPSNR=1 --FramesToBeEncoded=33 --IntraPeriod=32 --FrameSkip=128 -q 27 -o rec.yuv --Verbosity=6 -b encoded.bin
-
Read 2 frames and start encoding from POC=16:
EncoderApp.exe -c encoder_randomaccess_ecm.cfg -c classD_randomaccess.cfg -c RaceHorses.cfg --SEIDecodedPictureHash=1 --PrintHexPSNR=1 --FramesToBeEncoded=33 --IntraPeriod=32 --FrameSkip=128 -q 27 -o rec.yuv --Verbosity=6 -b recoded.bin --DebugBitstream=encoded.bin --DebugPOC=16
Segmentation fault at POC 16
Safety
No encoding behavior change is observed for CTC
Result
No bitstream issues under workflow Encode - Rewrite - Decode for CTC (not affected by this commit)
Though exhaustive testing is not feasible, a large number of tests has been executed and no issue is observed under workflow Encode - Read N frames and Encode rest - Decode for CTC (after this commit)
In simpler words, all DebugBitstream issues seem to be solved at the moment.