libpgf
6.14.12
PGF - Progressive Graphics File
|
PGF decoder. More...
#include <Decoder.h>
Classes | |
class | CMacroBlock |
A macro block is a decoding unit of fixed size (uncoded) More... | |
Public Member Functions | |
CDecoder (CPGFStream *stream, PGFPreHeader &preHeader, PGFHeader &header, PGFPostHeader &postHeader, UINT32 *&levelLength, UINT64 &userDataPos, bool useOMP, bool skipUserData) THROW_ | |
~CDecoder () | |
Destructor. More... | |
void | Partition (CSubband *band, int quantParam, int width, int height, int startPos, int pitch) THROW_ |
void | DecodeInterleaved (CWaveletTransform *wtChannel, int level, int quantParam) THROW_ |
UINT32 | GetEncodedHeaderLength () const |
void | SetStreamPosToStart () THROW_ |
Reset stream position to beginning of PGF pre-header. More... | |
void | SetStreamPosToData () THROW_ |
Reset stream position to beginning of data block. More... | |
void | Skip (UINT64 offset) THROW_ |
void | DequantizeValue (CSubband *band, UINT32 bandPos, int quantParam) THROW_ |
UINT32 | ReadEncodedData (UINT8 *target, UINT32 len) const THROW_ |
void | DecodeBuffer () THROW_ |
CPGFStream * | GetStream () |
bool | MacroBlocksAvailable () const |
Private Member Functions | |
void | ReadMacroBlock (CMacroBlock *block) THROW_ |
throws IOException More... | |
Private Attributes | |
CPGFStream * | m_stream |
input PGF stream More... | |
UINT64 | m_startPos |
stream position at the beginning of the PGF pre-header More... | |
UINT64 | m_streamSizeEstimation |
estimation of stream size More... | |
UINT32 | m_encodedHeaderLength |
stream offset from startPos to the beginning of the data part (highest level) More... | |
CMacroBlock ** | m_macroBlocks |
array of macroblocks More... | |
int | m_currentBlockIndex |
index of current macro block More... | |
int | m_macroBlockLen |
array length More... | |
int | m_macroBlocksAvailable |
number of decoded macro blocks (including currently used macro block) More... | |
CMacroBlock * | m_currentBlock |
current macro block (used by main thread) More... | |
CDecoder::CDecoder | ( | CPGFStream * | stream, |
PGFPreHeader & | preHeader, | ||
PGFHeader & | header, | ||
PGFPostHeader & | postHeader, | ||
UINT32 *& | levelLength, | ||
UINT64 & | userDataPos, | ||
bool | useOMP, | ||
bool | skipUserData | ||
) |
Constructor: Read pre-header, header, and levelLength at current stream position. It might throw an IOException.
stream | A PGF stream |
preHeader | [out] A PGF pre-header |
header | [out] A PGF header |
postHeader | [out] A PGF post-header |
levelLength | The location of the levelLength array. The array is allocated in this method. The caller has to delete this array. |
userDataPos | The stream position of the user data (metadata) |
useOMP | If true, then the decoder will use multi-threading based on openMP |
skipUserData | If true, then user data is not read. In case of available user data, the file position is still returned in userDataPos. |
Constructor Read pre-header, header, and levelLength It might throw an IOException.
stream | A PGF stream |
preHeader | [out] A PGF pre-header |
header | [out] A PGF header |
postHeader | [out] A PGF post-header |
levelLength | The location of the levelLength array. The array is allocated in this method. The caller has to delete this array. |
userDataPos | The stream position of the user data (metadata) |
useOMP | If true, then the decoder will use multi-threading based on openMP |
skipUserData | If true, then user data is not read. In case of available user data, the file position is still returned in userDataPos. |
Definition at line 73 of file Decoder.cpp.
CDecoder::~CDecoder | ( | ) |
Destructor.
Definition at line 217 of file Decoder.cpp.
void CDecoder::DecodeBuffer | ( | ) |
Reads stream and decodes tile buffer It might throw an IOException.
Definition at line 480 of file Decoder.cpp.
void CDecoder::DecodeInterleaved | ( | CWaveletTransform * | wtChannel, |
int | level, | ||
int | quantParam | ||
) |
Deccoding and dequantization of HL and LH subband (interleaved) using partitioning scheme. Partitioning scheme: The plane is partitioned in squares of side length InterBlockSize. It might throw an IOException.
wtChannel | A wavelet transform channel containing the HL and HL band |
level | Wavelet transform level |
quantParam | Dequantization value |
Definition at line 319 of file Decoder.cpp.
void CDecoder::DequantizeValue | ( | CSubband * | band, |
UINT32 | bandPos, | ||
int | quantParam | ||
) |
Dequantization of a single value at given position in subband. It might throw an IOException.
band | A subband |
bandPos | A valid position in subband band |
quantParam | The quantization parameter |
Dequantization of a single value at given position in subband. If encoded data is available, then stores dequantized band value into buffer m_value at position m_valuePos. Otherwise reads encoded data block and decodes it. It might throw an IOException.
band | A subband |
bandPos | A valid position in subband band |
quantParam | The quantization parameter |
Definition at line 448 of file Decoder.cpp.
|
inline |
Return the length of all encoded headers in bytes.
Definition at line 137 of file Decoder.h.
|
inline |
|
inline |
Definition at line 179 of file Decoder.h.
void CDecoder::Partition | ( | CSubband * | band, |
int | quantParam, | ||
int | width, | ||
int | height, | ||
int | startPos, | ||
int | pitch | ||
) |
Unpartitions a rectangular region of a given subband. Partitioning scheme: The plane is partitioned in squares of side length LinBlockSize. Read wavelet coefficients from the output buffer of a macro block. It might throw an IOException.
band | A subband |
quantParam | Dequantization value |
width | The width of the rectangle |
height | The height of the rectangle |
startPos | The relative subband position of the top left corner of the rectangular region |
pitch | The number of bytes in row of the subband |
Definition at line 252 of file Decoder.cpp.
UINT32 CDecoder::ReadEncodedData | ( | UINT8 * | target, |
UINT32 | len | ||
) | const |
Copies data from the open stream to a target buffer. It might throw an IOException.
target | The target buffer |
len | The number of bytes to read |
Definition at line 232 of file Decoder.cpp.
|
private |
throws IOException
Definition at line 521 of file Decoder.cpp.
|
inline |
Reset stream position to beginning of data block.
Definition at line 145 of file Decoder.h.
|
inline |
Reset stream position to beginning of PGF pre-header.
Definition at line 141 of file Decoder.h.
void CDecoder::Skip | ( | UINT64 | offset | ) |
Skip a given number of bytes in the open stream. It might throw an IOException.
Definition at line 435 of file Decoder.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |