39 #define BufferLen (BufferSize/WordWidth) 40 #define CodeBufferLen BufferSize 57 #pragma warning( suppress : 4351 ) 71 void Init(
int lastLevelIndex) {
93 UINT32
RLESigns(UINT32 codePos, UINT32* signBits, UINT32 signLen);
94 UINT32
DecomposeBitplane(UINT32 bufferSize, UINT32 planeMask, UINT32 codePos, UINT32* sigBits, UINT32* refBits, UINT32* signBits, UINT32& signLen, UINT32& codeLen);
96 bool GetBitAtPos(UINT32 pos, UINT32 planeMask)
const {
return (abs(m_value[pos]) & planeMask) > 0; }
113 UINT64& userDataPos,
bool useOMP) THROW_;
157 void Partition(
CSubband* band,
int width,
int height,
int startPos,
int pitch) THROW_;
190 #ifdef __PGFROISUPPORT__ 198 void SetROI() { m_roi =
true; }
202 void DumpBuffer()
const;
224 #ifdef __PGFROISUPPORT__ UINT8 NumberOfBitplanes()
int m_macroBlockLen
array length
void SetBufferStartPos()
Save current stream position as beginning of current level.
void WriteMacroBlock(CMacroBlock *block) THROW_
UINT32 m_valuePos
current buffer position
Abstract stream base class.
int m_lastLevelIndex
index of last encoded level: [0, nLevels); used because a level-end can occur before a buffer is full...
#define BufferSize
must be a multiple of WordWidth
UINT32 m_maxAbsValue
maximum absolute coefficient in each buffer
UINT32 m_codePos
current position in encoded bitstream
UINT32 RLESigns(UINT32 codePos, UINT32 *signBits, UINT32 signLen)
#define CodeBufferLen
number of words in code buffer (CodeBufferLen > BufferLen)
UINT32 WriteLevelLength(UINT32 *&levelLength) THROW_
PGF wavelet subband class.
bool m_sigFlagVector[BufferSize+1]
UINT32 * m_levelLength
temporary saves the level index
void EncodeBuffer(ROIBlockHeader h) THROW_
bool GetBitAtPos(UINT32 pos, UINT32 planeMask) const
CMacroBlock(CEncoder *encoder)
UINT32 DecomposeBitplane(UINT32 bufferSize, UINT32 planeMask, UINT32 codePos, UINT32 *sigBits, UINT32 *refBits, UINT32 *signBits, UINT32 &signLen, UINT32 &codeLen)
INT64 ComputeBufferLength() const
void Partition(CSubband *band, int width, int height, int startPos, int pitch) THROW_
bool m_forceWriting
all macro blocks have to be written into the stream
CMacroBlock * m_currentBlock
current macro block (used by main thread)
UINT32 UpdateLevelLength() THROW_
CMacroBlock ** m_macroBlocks
array of macroblocks
UINT64 m_startPosition
stream position of PGF start (PreHeader)
UINT32 m_codeBuffer[CodeBufferLen]
output buffer for encoded bitstream
A macro block is an encoding unit of fixed size (uncoded)
virtual UINT64 GetPos() const =0
CPGFStream * m_stream
output PMF stream
UINT64 m_bufferStartPos
stream position of encoded buffer
UINT64 m_levelLengthPos
stream position of Metadata
INT64 ComputeHeaderLength() const
void WriteValue(CSubband *band, int bandPos) THROW_
void FavorSpeedOverSize()
Encoder favors speed over compression size.
bool m_favorSpeed
favor speed over size
int m_currLevelIndex
counts where (=index) to save next value
DataT m_value[BufferSize]
input buffer of values with index m_valuePos
ROIBlockHeader m_header
block header
int m_lastMacroBlock
array index of the last created macro block
INT64 ComputeOffset() const
UINT8 m_nLevels
number of levels
CEncoder(CPGFStream *stream, PGFPreHeader preHeader, PGFHeader header, const PGFPostHeader &postHeader, UINT64 &userDataPos, bool useOMP) THROW_
void Init(int lastLevelIndex)
void UpdatePostHeaderSize(PGFPreHeader preHeader) THROW_
void SetEncodedLevel(int currentLevel)