39 #define BufferLen (BufferSize/WordWidth)
40 #define CodeBufferLen BufferSize
57 #if defined(WIN32) || defined(WINCE) || defined(WIN64)
58 #pragma warning( suppress : 4351 )
73 void Init(
int lastLevelIndex) {
77 m_lastLevelIndex = lastLevelIndex;
84 void BitplaneEncode();
95 UINT32 RLESigns(UINT32 codePos, UINT32* signBits, UINT32 signLen);
96 UINT32 DecomposeBitplane(UINT32 bufferSize, UINT32 planeMask, UINT32 codePos, UINT32* sigBits, UINT32* refBits, UINT32* signBits, UINT32& signLen, UINT32& codeLen);
97 UINT8 NumberOfBitplanes();
98 bool GetBitAtPos(UINT32 pos, UINT32 planeMask)
const {
return (abs(m_value[pos]) & planeMask) > 0; }
115 UINT64& userDataPos,
bool useOMP) THROW_;
159 void Partition(
CSubband* band,
int width,
int height,
int startPos,
int pitch) THROW_;
164 void SetEncodedLevel(
int currentLevel) { ASSERT(currentLevel >= 0); m_currentBlock->m_lastLevelIndex = m_nLevels - currentLevel - 1; m_forceWriting =
true; }
192 #ifdef __PGFROISUPPORT__
193 void EncodeTileBuffer() THROW_ { ASSERT(m_currentBlock && m_currentBlock->m_valuePos >= 0 && m_currentBlock->m_valuePos <=
BufferSize); EncodeBuffer(
ROIBlockHeader(m_currentBlock->m_valuePos,
true)); }
204 void DumpBuffer()
const;
209 void WriteMacroBlock(CMacroBlock* block) THROW_;
212 UINT64 m_startPosition;
213 UINT64 m_levelLengthPos;
214 UINT64 m_bufferStartPos;
216 CMacroBlock **m_macroBlocks;
218 int m_lastMacroBlock;
219 CMacroBlock *m_currentBlock;
221 UINT32* m_levelLength;
222 int m_currLevelIndex;
226 #ifdef __PGFROISUPPORT__
void FavorSpeedOverSize()
Encoder favors speed over compression size.
Definition: Encoder.h:123
void SetROI()
Enables region of interest (ROI) status.
Definition: Encoder.h:200
~CEncoder()
Destructor.
Definition: Encoder.cpp:147
#define BufferSize
must be a multiple of WordWidth
Definition: PGFtypes.h:77
#define CodeBufferLen
number of words in code buffer (CodeBufferLen > BufferLen)
Definition: Encoder.h:40
Abstract stream base class.
Definition: PGFstream.h:39
CEncoder(CPGFStream *stream, PGFPreHeader preHeader, PGFHeader header, const PGFPostHeader &postHeader, UINT64 &userDataPos, bool useOMP) THROW_
Definition: Encoder.cpp:70
PGF encoder.
Definition: Encoder.h:46
INT64 ComputeBufferLength() const
Definition: Encoder.h:181
INT64 ComputeHeaderLength() const
Definition: Encoder.h:176
Wavelet channel class.
Definition: Subband.h:42
void SetEncodedLevel(int currentLevel)
Definition: Encoder.h:164
void WriteValue(CSubband *band, int bandPos) THROW_
Definition: Encoder.cpp:326
void SetBufferStartPos()
Save current stream position as beginning of current level.
Definition: Encoder.h:190
virtual UINT64 GetPos() const =0
PGF wavelet subband class.
UINT32 UpdateLevelLength() THROW_
Definition: Encoder.cpp:202
INT64 ComputeOffset() const
Definition: Encoder.h:186
void Partition(CSubband *band, int width, int height, int startPos, int pitch) THROW_
Definition: Encoder.cpp:246
PGF bit-stream operations.
void Flush() THROW_
Definition: Encoder.cpp:310
void UpdatePostHeaderSize(PGFPreHeader preHeader) THROW_
Definition: Encoder.cpp:160
UINT32 WriteLevelLength(UINT32 *&levelLength) THROW_
Definition: Encoder.cpp:177
void EncodeTileBuffer() THROW_
Definition: Encoder.h:196