Encodes this macro block into internal code buffer. Several macro blocks can be encoded in parallel. Call CEncoder::WriteMacroBlock after this method.
482 UINT32 sigLen, codeLen = 0, wordPos, refLen, signLen;
495 for (UINT32 k=0; k < bufferSize; k++) {
501 for (UINT32 k=0; k < bufferSize; k++) {
516 planeMask = 1 << (nPlanes - 1);
518 for (
int plane = nPlanes - 1; plane >= 0; plane--) {
564 if (useRL && codeLen <=
MaxCodeLen && codeLen < signLen) {
591 for (UINT32 k=0; k < codeLen; k++) {
601 for (UINT32 k=0; k < refLen; k++) {
613 for (UINT32 k=0; k < refLen; k++) {
UINT8 NumberOfBitplanes()
UINT32 AlignWordPos(UINT32 pos)
#define BufferSize
must be a multiple of WordWidth
UINT32 m_codePos
current position in encoded bitstream
UINT32 RLESigns(UINT32 codePos, UINT32 *signBits, UINT32 signLen)
#define RLblockSizeLen
block size length (< 16): ld(BufferSize) < RLblockSizeLen <= 2*ld(BufferSize)
bool m_sigFlagVector[BufferSize+1]
#define BufferLen
number of words per buffer
void ClearBit(UINT32 *stream, UINT32 pos)
#define MaxBitPlanesLog
number of bits to code the maximum number of bit planes (in 32 or 16 bit mode)
UINT32 DecomposeBitplane(UINT32 bufferSize, UINT32 planeMask, UINT32 codePos, UINT32 *sigBits, UINT32 *refBits, UINT32 *signBits, UINT32 &signLen, UINT32 &codeLen)
UINT32 m_codeBuffer[CodeBufferLen]
output buffer for encoded bitstream
void SetBit(UINT32 *stream, UINT32 pos)
UINT32 NumberOfWords(UINT32 pos)
#define MaxBitPlanes
maximum number of bit planes of m_value: 32 minus sign bit
bool m_favorSpeed
favor speed over size
void SetValueBlock(UINT32 *stream, UINT32 pos, UINT32 val, UINT32 k)
ROIBlockHeader m_header
block header
#define CodeBufferLen
number of words in code buffer (CodeBufferLen > BufferLen)
#define MaxCodeLen
max length of RL encoded block
#define CodeBufferBitLen
max number of bits in m_codeBuffer