In DecHelper::initDecoder(), mInputBuf was statically allocated with
1 MB (1024 * 1024 bytes). For high-resolution streams with large single-slice
NAL units (such as Main_422_10_B_RExt_Sony_2 at 2560x1600, where the IDR
slice NAL exceeds 1.1 MB), BitsFile::read() was capped by mInputBuf's
capacity, truncating the input bitstream and resulting in incomplete decoding
of the frame.
- In DecHelper::decodeHeader(), dynamically reallocate mInputBuf once
mWidth, mHeight, and mBitDepth are known if the required size exceeds
the current buffer capacity.
- In DecHelper::decodeFile(), update inputFrameSize to mInputBuf.capacity()
instead of mWidth * mHeight * 3 (which didn't account for bit depths > 8).
Test: ./hevc_dec_tests
TAG=agy
CONV=476d1054-10ff-4f19-88d5-a1c8dae7b57f
Do not silently ignore decoder errors during header decoding, frame
decoding, and flushing:
- In decodeHeader, return false if ret != IV_SUCCESS, if u4_error_code != 0,
or if picture dimensions are 0 (indicating SPS was not decoded).
- In flushDecoder, verify flush control call succeeds with u4_error_code == 0,
and propagate decodeFrame errors rather than ignoring them.
- In decodeFile, check return values of decodeHeader, decodeFrame, and
flushDecoder rather than ignoring failures when bytes are consumed or
unconditionally returning true. Also ensure mHeaderDecoded is verified.
Test: ./hevc_dec_tests
TAG=agy
CONV=48905bde-d3a5-425e-adb8-a157966a81b1
Encoder tests currently do not dump recon as ihevce_plugin doesn't yet support recon dump.
This will be enabled once the recon dump is supported.
Decoder tests currently validate just a few files from big buck bunny.
Use "ctest" run all the tests when using cmake.
This downloads the required media files and uses them in the tests.
If running the tests directly using the test binaries, then download the media files
and export HEVC_TEST_DIR to the extracted folder before running the binaries directly.