39 #define BufferLen (BufferSize/WordWidth)
40 #define CodeBufferLen BufferSize
67 void Init(
int lastLevelIndex) {
71 m_lastLevelIndex = lastLevelIndex;
78 void BitplaneEncode();
89 UINT32 RLESigns(UINT32 codePos, UINT32* signBits, UINT32 signLen);
90 UINT32 DecomposeBitplane(UINT32 bufferSize, UINT32 planeMask, UINT32 codePos, UINT32* sigBits, UINT32* refBits, UINT32* signBits, UINT32& signLen, UINT32& codeLen);
91 UINT8 NumberOfBitplanes();
92 bool GetBitAtPos(UINT32
pos, UINT32 planeMask)
const {
return (abs(m_value[pos]) & planeMask) > 0; }
109 UINT64& userDataPos,
bool useOMP)
THROW_;
158 void SetEncodedLevel(
int currentLevel) {
ASSERT(currentLevel >= 0); m_currentBlock->m_lastLevelIndex = m_nLevels - currentLevel - 1; m_forceWriting =
true; }
170 INT64 ComputeHeaderLength()
const {
return m_levelLengthPos - m_startPosition; }
175 INT64 ComputeBufferLength()
const {
return m_stream->GetPos() - m_bufferStartPos; }
180 INT64 ComputeOffset()
const {
return m_stream->GetPos() - m_levelLengthPos; }
184 void SetBufferStartPos() { m_bufferStartPos = m_stream->GetPos(); }
186 #ifdef __PGFROISUPPORT__
190 void EncodeTileBuffer()
THROW_ {
ASSERT(m_currentBlock && m_currentBlock->m_valuePos >= 0 && m_currentBlock->m_valuePos <=
BufferSize); EncodeBuffer(
ROIBlockHeader(m_currentBlock->m_valuePos,
true)); }
194 void SetROI() { m_roi =
true; }
198 void DumpBuffer()
const;
203 void WriteMacroBlock(CMacroBlock* block)
THROW_;
206 UINT64 m_startPosition;
207 UINT64 m_levelLengthPos;
208 UINT64 m_bufferStartPos;
210 CMacroBlock **m_macroBlocks;
212 int m_lastMacroBlock;
213 CMacroBlock *m_currentBlock;
215 UINT32* m_levelLength;
216 int m_currLevelIndex;
220 #ifdef __PGFROISUPPORT__