CDecoder Class Reference

PGF decoder. More...

#include <Decoder.h>

List of all members.

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 ()
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_
void SetStreamPosToData () THROW_
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_
CPGFStreamGetStream ()
bool MacroBlocksAvailable () const
void DecodeTileBuffer () THROW_
void SkipTileBuffer () THROW_
void SetROI ()

Private Member Functions

void ReadMacroBlock (CMacroBlock *block) THROW_
 throws IOException

Private Attributes

CPGFStreamm_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)
CMacroBlockm_currentBlock
 current macro block (used by main thread)
bool m_roi
 true: ensures region of interest (ROI) decoding

Detailed Description

PGF decoder.

PGF decoder class.

Author:
C. Stamm, R. Spuler

Definition at line 46 of file Decoder.h.


Constructor & Destructor Documentation

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.

Parameters:
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.

Parameters:
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.

00076 : m_stream(stream)
00077 , m_startPos(0)
00078 , m_streamSizeEstimation(0)
00079 , m_encodedHeaderLength(0)
00080 , m_currentBlockIndex(0)
00081 , m_macroBlocksAvailable(0)
00082 #ifdef __PGFROISUPPORT__
00083 , m_roi(false)
00084 #endif
00085 {
00086         ASSERT(m_stream);
00087 
00088         int count, expected;
00089 
00090         // store current stream position
00091         m_startPos = m_stream->GetPos();
00092 
00093         // read magic and version
00094         count = expected = MagicVersionSize;
00095         m_stream->Read(&count, &preHeader);
00096         if (count != expected) ReturnWithError(MissingData);
00097 
00098         // read header size
00099         if (preHeader.version & Version6) {
00100                 // 32 bit header size since version 6
00101                 count = expected = 4;
00102         } else {
00103                 count = expected = 2;
00104         }
00105         m_stream->Read(&count, ((UINT8*)&preHeader) + MagicVersionSize);
00106         if (count != expected) ReturnWithError(MissingData);
00107 
00108         // make sure the values are correct read
00109         preHeader.hSize = __VAL(preHeader.hSize);
00110 
00111         // check magic number
00112         if (memcmp(preHeader.magic, PGFMagic, 3) != 0) {
00113                 // error condition: wrong Magic number
00114                 ReturnWithError(FormatCannotRead);
00115         }
00116 
00117         // read file header
00118         count = expected = (preHeader.hSize < HeaderSize) ? preHeader.hSize : HeaderSize;
00119         m_stream->Read(&count, &header);
00120         if (count != expected) ReturnWithError(MissingData);
00121 
00122         // make sure the values are correct read
00123         header.height = __VAL(UINT32(header.height));
00124         header.width = __VAL(UINT32(header.width));
00125 
00126         // be ready to read all versions including version 0
00127         if (preHeader.version > 0) {
00128 #ifndef __PGFROISUPPORT__
00129                 // check ROI usage
00130                 if (preHeader.version & PGFROI) ReturnWithError(FormatCannotRead);
00131 #endif
00132 
00133                 int size = preHeader.hSize - HeaderSize;
00134 
00135                 if (size > 0) {
00136                         // read post-header
00137                         if (header.mode == ImageModeIndexedColor) {
00138                                 if (size < ColorTableSize) ReturnWithError(FormatCannotRead);
00139                                 // read color table
00140                                 count = expected = ColorTableSize;
00141                                 m_stream->Read(&count, postHeader.clut);
00142                                 if (count != expected) ReturnWithError(MissingData);
00143                                 size -= count;
00144                         }
00145 
00146                         if (size > 0) {
00147                                 userDataPos = m_stream->GetPos();
00148                                 postHeader.userDataLen = size;
00149                                 if (skipUserData) {
00150                                         Skip(size);
00151                                 } else {
00152                                         // create user data memory block
00153                                         postHeader.userData = new(std::nothrow) UINT8[postHeader.userDataLen];
00154                                         if (!postHeader.userData) ReturnWithError(InsufficientMemory);
00155 
00156                                         // read user data
00157                                         count = expected = postHeader.userDataLen;
00158                                         m_stream->Read(&count, postHeader.userData);
00159                                         if (count != expected) ReturnWithError(MissingData);
00160                                 }
00161                         }
00162                 }
00163 
00164                 // create levelLength
00165                 levelLength = new(std::nothrow) UINT32[header.nLevels];
00166                 if (!levelLength) ReturnWithError(InsufficientMemory);
00167 
00168                 // read levelLength
00169                 count = expected = header.nLevels*WordBytes;
00170                 m_stream->Read(&count, levelLength);
00171                 if (count != expected) ReturnWithError(MissingData);
00172 
00173 #ifdef PGF_USE_BIG_ENDIAN 
00174                 // make sure the values are correct read
00175                 for (int i=0; i < header.nLevels; i++) {
00176                         levelLength[i] = __VAL(levelLength[i]);
00177                 }
00178 #endif
00179 
00180                 // compute the total size in bytes; keep attention: level length information is optional
00181                 for (int i=0; i < header.nLevels; i++) {
00182                         m_streamSizeEstimation += levelLength[i];
00183                 }
00184                 
00185         }
00186 
00187         // store current stream position
00188         m_encodedHeaderLength = UINT32(m_stream->GetPos() - m_startPos);
00189 
00190         // set number of threads
00191 #ifdef LIBPGF_USE_OPENMP 
00192         m_macroBlockLen = omp_get_num_procs();
00193 #else
00194         m_macroBlockLen = 1;
00195 #endif
00196 
00197         if (useOMP && m_macroBlockLen > 1) {
00198 #ifdef LIBPGF_USE_OPENMP
00199                 omp_set_num_threads(m_macroBlockLen);
00200 #endif
00201 
00202                 // create macro block array
00203                 m_macroBlocks = new(std::nothrow) CMacroBlock*[m_macroBlockLen];
00204                 if (!m_macroBlocks) ReturnWithError(InsufficientMemory);
00205                 for (int i = 0; i < m_macroBlockLen; i++) m_macroBlocks[i] = new CMacroBlock();
00206                 m_currentBlock = m_macroBlocks[m_currentBlockIndex];
00207         } else {
00208                 m_macroBlocks = 0;
00209                 m_macroBlockLen = 1; // there is only one macro block
00210                 m_currentBlock = new(std::nothrow) CMacroBlock();
00211                 if (!m_currentBlock) ReturnWithError(InsufficientMemory);
00212         }
00213 }

CDecoder::~CDecoder (  ) 

Destructor

Definition at line 217 of file Decoder.cpp.

00217                     {
00218         if (m_macroBlocks) {
00219                 for (int i=0; i < m_macroBlockLen; i++) delete m_macroBlocks[i];
00220                 delete[] m_macroBlocks;
00221         } else {
00222                 delete m_currentBlock;
00223         }
00224 }


Member Function Documentation

void CDecoder::DecodeBuffer (  ) 

Reads stream and decodes tile buffer It might throw an IOException.

Definition at line 480 of file Decoder.cpp.

00480                                    {
00481         ASSERT(m_macroBlocksAvailable <= 0);
00482 
00483         // macro block management
00484         if (m_macroBlockLen == 1) {
00485                 ASSERT(m_currentBlock);
00486                 ReadMacroBlock(m_currentBlock);
00487                 m_currentBlock->BitplaneDecode();
00488                 m_macroBlocksAvailable = 1;
00489         } else {
00490                 m_macroBlocksAvailable = 0;
00491                 for (int i=0; i < m_macroBlockLen; i++) {
00492                         // read sequentially several blocks
00493                         try {
00494                                 ReadMacroBlock(m_macroBlocks[i]);
00495                                 m_macroBlocksAvailable++;
00496                         } catch(IOException& ex) {
00497                                 if (ex.error == MissingData) {
00498                                         break; // no further data available
00499                                 } else {
00500                                         throw;
00501                                 }
00502                         }
00503                 }
00504 #ifdef LIBPGF_USE_OPENMP
00505                 // decode in parallel
00506                 #pragma omp parallel for default(shared) //no declared exceptions in next block
00507 #endif
00508                 for (int i=0; i < m_macroBlocksAvailable; i++) {
00509                         m_macroBlocks[i]->BitplaneDecode();
00510                 }
00511                 
00512                 // prepare current macro block
00513                 m_currentBlockIndex = 0;
00514                 m_currentBlock = m_macroBlocks[m_currentBlockIndex];
00515         }
00516 }

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.

Parameters:
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.

00319                                                                                                {
00320         CSubband* hlBand = wtChannel->GetSubband(level, HL);
00321         CSubband* lhBand = wtChannel->GetSubband(level, LH);
00322         const div_t lhH = div(lhBand->GetHeight(), InterBlockSize);
00323         const div_t hlW = div(hlBand->GetWidth(), InterBlockSize);
00324         const int hlws = hlBand->GetWidth() - InterBlockSize;
00325         const int hlwr = hlBand->GetWidth() - hlW.rem;
00326         const int lhws = lhBand->GetWidth() - InterBlockSize;
00327         const int lhwr = lhBand->GetWidth() - hlW.rem;
00328         int hlPos, lhPos;
00329         int hlBase = 0, lhBase = 0, hlBase2, lhBase2;
00330 
00331         ASSERT(lhBand->GetWidth() >= hlBand->GetWidth());
00332         ASSERT(hlBand->GetHeight() >= lhBand->GetHeight());
00333 
00334         if (!hlBand->AllocMemory()) ReturnWithError(InsufficientMemory);
00335         if (!lhBand->AllocMemory()) ReturnWithError(InsufficientMemory);
00336 
00337         // correct quantParam with normalization factor
00338         quantParam -= level;
00339         if (quantParam < 0) quantParam = 0;
00340 
00341         // main height
00342         for (int i=0; i < lhH.quot; i++) {
00343                 // main width
00344                 hlBase2 = hlBase;
00345                 lhBase2 = lhBase;
00346                 for (int j=0; j < hlW.quot; j++) {
00347                         hlPos = hlBase2;
00348                         lhPos = lhBase2;
00349                         for (int y=0; y < InterBlockSize; y++) {
00350                                 for (int x=0; x < InterBlockSize; x++) {
00351                                         DequantizeValue(hlBand, hlPos, quantParam);
00352                                         DequantizeValue(lhBand, lhPos, quantParam);
00353                                         hlPos++;
00354                                         lhPos++;
00355                                 }
00356                                 hlPos += hlws;
00357                                 lhPos += lhws;
00358                         }
00359                         hlBase2 += InterBlockSize;
00360                         lhBase2 += InterBlockSize;
00361                 }
00362                 // rest of width
00363                 hlPos = hlBase2;
00364                 lhPos = lhBase2;
00365                 for (int y=0; y < InterBlockSize; y++) {
00366                         for (int x=0; x < hlW.rem; x++) {
00367                                 DequantizeValue(hlBand, hlPos, quantParam);
00368                                 DequantizeValue(lhBand, lhPos, quantParam);
00369                                 hlPos++;
00370                                 lhPos++;
00371                         }
00372                         // width difference between HL and LH
00373                         if (lhBand->GetWidth() > hlBand->GetWidth()) {
00374                                 DequantizeValue(lhBand, lhPos, quantParam);
00375                         }
00376                         hlPos += hlwr;
00377                         lhPos += lhwr;
00378                         hlBase += hlBand->GetWidth();
00379                         lhBase += lhBand->GetWidth();
00380                 }
00381         }
00382         // main width 
00383         hlBase2 = hlBase;
00384         lhBase2 = lhBase;
00385         for (int j=0; j < hlW.quot; j++) {
00386                 // rest of height
00387                 hlPos = hlBase2;
00388                 lhPos = lhBase2;
00389                 for (int y=0; y < lhH.rem; y++) {
00390                         for (int x=0; x < InterBlockSize; x++) {
00391                                 DequantizeValue(hlBand, hlPos, quantParam);
00392                                 DequantizeValue(lhBand, lhPos, quantParam);
00393                                 hlPos++;
00394                                 lhPos++;
00395                         }
00396                         hlPos += hlws;
00397                         lhPos += lhws;
00398                 }
00399                 hlBase2 += InterBlockSize;
00400                 lhBase2 += InterBlockSize;
00401         }
00402         // rest of height
00403         hlPos = hlBase2;
00404         lhPos = lhBase2;
00405         for (int y=0; y < lhH.rem; y++) {
00406                 // rest of width
00407                 for (int x=0; x < hlW.rem; x++) {
00408                         DequantizeValue(hlBand, hlPos, quantParam);
00409                         DequantizeValue(lhBand, lhPos, quantParam);
00410                         hlPos++;
00411                         lhPos++;
00412                 }
00413                 // width difference between HL and LH
00414                 if (lhBand->GetWidth() > hlBand->GetWidth()) {
00415                         DequantizeValue(lhBand, lhPos, quantParam);
00416                 }
00417                 hlPos += hlwr;
00418                 lhPos += lhwr;
00419                 hlBase += hlBand->GetWidth();
00420         }
00421         // height difference between HL and LH
00422         if (hlBand->GetHeight() > lhBand->GetHeight()) {
00423                 // total width
00424                 hlPos = hlBase;
00425                 for (int j=0; j < hlBand->GetWidth(); j++) {
00426                         DequantizeValue(hlBand, hlPos, quantParam);
00427                         hlPos++;
00428                 }
00429         }
00430 }

void CDecoder::DecodeTileBuffer (  ) 

Reads stream and decodes tile buffer It might throw an IOException.

Definition at line 463 of file Decoder.cpp.

00463                                        {
00464         // current block has been read --> prepare next current block
00465         m_macroBlocksAvailable--;
00466 
00467         if (m_macroBlocksAvailable > 0) {
00468                 m_currentBlock = m_macroBlocks[++m_currentBlockIndex];
00469         } else {
00470                 DecodeBuffer();
00471         }
00472         ASSERT(m_currentBlock);
00473 }

void CDecoder::DequantizeValue ( CSubband band,
UINT32  bandPos,
int  quantParam 
)

Dequantization of a single value at given position in subband. It might throw an IOException.

Parameters:
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.

Parameters:
band A subband
bandPos A valid position in subband band
quantParam The quantization parameter

Definition at line 448 of file Decoder.cpp.

00448                                                                                     {
00449         ASSERT(m_currentBlock);
00450 
00451         if (m_currentBlock->IsCompletelyRead()) {
00452                 // all data of current macro block has been read --> prepare next macro block
00453                 DecodeTileBuffer();
00454         }
00455         
00456         band->SetData(bandPos, m_currentBlock->m_value[m_currentBlock->m_valuePos] << quantParam);
00457         m_currentBlock->m_valuePos++;
00458 }

UINT32 CDecoder::GetEncodedHeaderLength (  )  const [inline]

Return the length of all encoded headers in bytes.

Returns:
The length of all encoded headers in bytes

Definition at line 137 of file Decoder.h.

00137 { return m_encodedHeaderLength; }

CPGFStream* CDecoder::GetStream (  )  [inline]
Returns:
Stream

Definition at line 175 of file Decoder.h.

00175 { return m_stream; }

bool CDecoder::MacroBlocksAvailable (  )  const [inline]
Returns:
True if decoded macro blocks are available for processing

Definition at line 179 of file Decoder.h.

00179 { return m_macroBlocksAvailable > 1; }

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.

Parameters:
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.

00252                                                                                                               {
00253         ASSERT(band);
00254 
00255         const div_t ww = div(width, LinBlockSize);
00256         const div_t hh = div(height, LinBlockSize);
00257         const int ws = pitch - LinBlockSize;
00258         const int wr = pitch - ww.rem;
00259         int pos, base = startPos, base2;
00260 
00261         // main height
00262         for (int i=0; i < hh.quot; i++) {
00263                 // main width
00264                 base2 = base;
00265                 for (int j=0; j < ww.quot; j++) {
00266                         pos = base2;
00267                         for (int y=0; y < LinBlockSize; y++) {
00268                                 for (int x=0; x < LinBlockSize; x++) {
00269                                         DequantizeValue(band, pos, quantParam);
00270                                         pos++;
00271                                 }
00272                                 pos += ws;
00273                         }
00274                         base2 += LinBlockSize;
00275                 }
00276                 // rest of width
00277                 pos = base2;
00278                 for (int y=0; y < LinBlockSize; y++) {
00279                         for (int x=0; x < ww.rem; x++) {
00280                                 DequantizeValue(band, pos, quantParam);
00281                                 pos++;
00282                         }
00283                         pos += wr;
00284                         base += pitch;
00285                 }
00286         }
00287         // main width 
00288         base2 = base;
00289         for (int j=0; j < ww.quot; j++) {
00290                 // rest of height
00291                 pos = base2;
00292                 for (int y=0; y < hh.rem; y++) {
00293                         for (int x=0; x < LinBlockSize; x++) {
00294                                 DequantizeValue(band, pos, quantParam);
00295                                 pos++;
00296                         }
00297                         pos += ws;
00298                 }
00299                 base2 += LinBlockSize;
00300         }
00301         // rest of height
00302         pos = base2;
00303         for (int y=0; y < hh.rem; y++) {
00304                 // rest of width
00305                 for (int x=0; x < ww.rem; x++) {
00306                         DequantizeValue(band, pos, quantParam);
00307                         pos++;
00308                 }
00309                 pos += wr;
00310         }
00311 }

UINT32 CDecoder::ReadEncodedData ( UINT8 *  target,
UINT32  len 
) const

Copies data from the open stream to a target buffer. It might throw an IOException.

Parameters:
target The target buffer
len The number of bytes to read
Returns:
The number of bytes copied to the target buffer

Definition at line 232 of file Decoder.cpp.

00232                                                                        {
00233         ASSERT(m_stream);
00234 
00235         int count = len;
00236         m_stream->Read(&count, target);
00237 
00238         return count;
00239 }

void CDecoder::ReadMacroBlock ( CMacroBlock block  )  [private]

throws IOException

Definition at line 521 of file Decoder.cpp.

00521                                                        {
00522         ASSERT(block);
00523 
00524         UINT16 wordLen;
00525         ROIBlockHeader h(BufferSize);
00526         int count, expected;
00527 
00528 #ifdef TRACE
00529         //UINT32 filePos = (UINT32)m_stream->GetPos();
00530         //printf("DecodeBuffer: %d\n", filePos);
00531 #endif
00532 
00533         // read wordLen
00534         count = expected = sizeof(UINT16);
00535         m_stream->Read(&count, &wordLen); 
00536         if (count != expected) ReturnWithError(MissingData);
00537         wordLen = __VAL(wordLen);
00538         if (wordLen > BufferSize) 
00539                 ReturnWithError(FormatCannotRead);
00540 
00541 #ifdef __PGFROISUPPORT__
00542         // read ROIBlockHeader
00543         if (m_roi) {
00544                 m_stream->Read(&count, &h.val); 
00545                 if (count != expected) ReturnWithError(MissingData);
00546                 
00547                 // convert ROIBlockHeader
00548                 h.val = __VAL(h.val);
00549         }
00550 #endif
00551         // save header
00552         block->m_header = h;
00553 
00554         // read data
00555         count = expected = wordLen*WordBytes;
00556         m_stream->Read(&count, block->m_codeBuffer);
00557         if (count != expected) ReturnWithError(MissingData);
00558 
00559 #ifdef PGF_USE_BIG_ENDIAN 
00560         // convert data
00561         count /= WordBytes;
00562         for (int i=0; i < count; i++) {
00563                 block->m_codeBuffer[i] = __VAL(block->m_codeBuffer[i]);
00564         }
00565 #endif
00566 
00567 #ifdef __PGFROISUPPORT__
00568         ASSERT(m_roi && h.rbh.bufferSize <= BufferSize || h.rbh.bufferSize == BufferSize);
00569 #else
00570         ASSERT(h.rbh.bufferSize == BufferSize);
00571 #endif
00572 }

void CDecoder::SetROI (  )  [inline]

Enables region of interest (ROI) status.

Definition at line 194 of file Decoder.h.

00194 { m_roi = true; }

void CDecoder::SetStreamPosToData (  )  [inline]

Reset stream position to beginning of data block

Definition at line 145 of file Decoder.h.

00145 { ASSERT(m_stream); m_stream->SetPos(FSFromStart, m_startPos + m_encodedHeaderLength); }

void CDecoder::SetStreamPosToStart (  )  [inline]

Reset stream position to beginning of PGF pre-header

Definition at line 141 of file Decoder.h.

00141 { ASSERT(m_stream); m_stream->SetPos(FSFromStart, m_startPos); }

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.

00435                                         {
00436         m_stream->SetPos(FSFromCurrent, offset);
00437 }

void CDecoder::SkipTileBuffer (  ) 

Resets stream position to next tile. It might throw an IOException.

Definition at line 579 of file Decoder.cpp.

00579                                      {
00580         // current block is not used
00581         m_macroBlocksAvailable--;
00582 
00583         // check if pre-decoded data is available
00584         if (m_macroBlocksAvailable > 0) {
00585                 m_currentBlock = m_macroBlocks[++m_currentBlockIndex];
00586                 return;
00587         }
00588 
00589         UINT16 wordLen;
00590         int count, expected;
00591 
00592         // read wordLen
00593         count = expected = sizeof(wordLen);
00594         m_stream->Read(&count, &wordLen); 
00595         if (count != expected) ReturnWithError(MissingData);
00596         wordLen = __VAL(wordLen);
00597         ASSERT(wordLen <= BufferSize);
00598 
00599 #ifdef __PGFROISUPPORT__
00600         if (m_roi) {
00601                 // skip ROIBlockHeader
00602                 m_stream->SetPos(FSFromCurrent, sizeof(ROIBlockHeader));
00603         }
00604 #endif
00605 
00606         // skip data
00607         m_stream->SetPos(FSFromCurrent, wordLen*WordBytes);
00608 }


Member Data Documentation

current macro block (used by main thread)

Definition at line 213 of file Decoder.h.

index of current macro block

Definition at line 210 of file Decoder.h.

stream offset from startPos to the beginning of the data part (highest level)

Definition at line 207 of file Decoder.h.

array length

Definition at line 211 of file Decoder.h.

array of macroblocks

Definition at line 209 of file Decoder.h.

number of decoded macro blocks (including currently used macro block)

Definition at line 212 of file Decoder.h.

bool CDecoder::m_roi [private]

true: ensures region of interest (ROI) decoding

Definition at line 216 of file Decoder.h.

UINT64 CDecoder::m_startPos [private]

stream position at the beginning of the PGF pre-header

Definition at line 205 of file Decoder.h.

input PGF stream

Definition at line 204 of file Decoder.h.

estimation of stream size

Definition at line 206 of file Decoder.h.


The documentation for this class was generated from the following files:

Generated on 18 Feb 2019 for libpgf by  doxygen 1.6.1