I'm trying to do data hiding in HEVC reference software version 16.24.
I've been tasked to change the intra-prediction modes to hide the texts.
I've successfully found all I needed to run the required algorithm to extract and recalculate intra prediction modes in all intra blocks.
I read the information in encodeSlice()
function from TEncSlice
righ before m_pcCuEncoder->encodeCtu( pCtu );
is executed.
Then I change the intra-prediction modes in TEncSbac::codeIntraDirLumaAng()
righ before they are written to the bitstream.
Everything is working perfectly and the encoder encodes the frames without any errors or warnings.
But When I run the HEVC Decoder on my stego stream, the decoder only decodes some slices of the first frame and terminate with the error:
TAppDecoder: ../source/Lib/TLibDecoder/TDecSlice.cpp:282: Void TDecSlice::decompressSlice(TComInputBitstream**, TComPic*, TDecSbac*): Assertion `binVal' failed.
Aborted (core dumped)
Checking the intra-prediction modes from the decoded slices, are not the same as the recalculated ones, neither are equal to the original modes before recalculations. Some are the recalculated but some are not.
I'm stuck Here. Please help
[Edits]
As far as I know, the assertion tends to compare the size of bits of decoded values a s compared with info of number of bits recorded somewhere by the encoder.
Below is the code with line throwing the error
// The sub-stream/stream should be terminated after this CTU.
// (end of slice-segment, end of tile, end of wavefront-CTU-row)
UInt binVal;
pcSbacDecoder->parseTerminatingBit(binVal);
assert(binVal); //<- TDecSlice.cpp:282