|
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. | |
| 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. | |
| void | SetStreamPosToData () THROW_ |
| Reset stream position to beginning of data block. | |
| 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 | |
Private Attributes | |
| CPGFStream * | m_stream |
| input PGF stream | |
| UINT64 | m_startPos |
| stream position at the beginning of the PGF pre-header | |
| UINT64 | m_streamSizeEstimation |
| estimation of stream size | |
| UINT32 | m_encodedHeaderLength |
| stream offset from startPos to the beginning of the data part (highest level) | |
| CMacroBlock ** | m_macroBlocks |
| array of macroblocks | |
| int | m_currentBlockIndex |
| index of current macro block | |
| int | m_macroBlockLen |
| array length | |
| int | m_macroBlocksAvailable |
| number of decoded macro blocks (including currently used macro block) | |
| CMacroBlock * | m_currentBlock |
| current macro block (used by main thread) | |
| 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 | ( | ) |
| void CDecoder::DecodeBuffer | ( | ) |
Reads stream and decodes tile buffer It might throw an IOException.
Definition at line 479 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 318 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 447 of file Decoder.cpp.
|
inline |
|
inline |
|
inline |
| 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 251 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 231 of file Decoder.cpp.
|
private |
throws IOException
Definition at line 520 of file Decoder.cpp.
|
inline |
|
inline |
| void CDecoder::Skip | ( | UINT64 | offset | ) |
Skip a given number of bytes in the open stream. It might throw an IOException.
Definition at line 434 of file Decoder.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |