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