I've been working on the HM reference software for a while, to improve something in the intra prediction part. Now a new intra prediction algorithm is added to the code and I let the encoder choose between my algorithm and the default algorithm of HM (according to the RDCost
of course).
What I need now, is to signal a flag for each PU, so that the decoder will be able to perform the same algorithm as the encoder decides in the rate distortion loop.
I want to know what exactly should I do to properly add this one bit flag to the stream, without breaking anything in the code.
Assuming that I want to use a CABAC context model to keep the track of my flag's statistics, what else should I do:
- adding a new context model like
ContextModel3DBuffer m_cCUIntraAlgorithmSCModel
to theTEncSbac.h
file. - properly initializing the model (both at encoder and decoder side) by looking at how the HM initialezes other context models.
- calling the function
m_pcBinIf->encodeBin(myFlag, cCUIntraAlgorithmSCModel)
andm_pcTDecBinIfdecodeBin(myFlag, cCUIntraAlgorithmSCModel)
at the encoder side and decoder side, respectively.
I take these three steps but apparently it breaks something.
PS: Even an equiprobable signaling (i.e. without using CABAC contexts) will be useful. I just want to send this flag peacefully!
Thanks in advance.