libpgf 7.26.45
PGF - Progressive Graphics File
Loading...
Searching...
No Matches
pgf::CDecoder Class Reference

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_t *&levelLength, uint64_t &userDataPos, bool useOMP, uint32_t userDataPolicy)
 ~CDecoder ()
 Destructor.
void Partition (CSubband *band, int quantParam, int width, int height, int startPos, int pitch)
void DecodeInterleaved (CWaveletTransform *wtChannel, int level, int quantParam)
uint32_t GetEncodedHeaderLength () const
void SetStreamPosToStart ()
 Resets stream position to beginning of PGF pre-header.
void SetStreamPosToData ()
 Resets stream position to beginning of data block.
void Skip (uint64_t offset)
void DequantizeValue (CSubband *band, uint32_t bandPos, int quantParam)
uint32_t ReadEncodedData (uint8_t *target, uint32_t len) const
void DecodeBuffer ()
CPGFStream * GetStream ()
void GetNextMacroBlock ()

Private Member Functions

void ReadMacroBlock (CMacroBlock *block)
 throws IOException

Private Attributes

CPGFStream * m_stream
 input PGF stream
uint64_t m_startPos
 stream position at the beginning of the PGF pre-header
uint64_t m_streamSizeEstimation
 estimation of stream size
uint32_t 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)

Detailed Description

PGF decoder.

PGF decoder class.

Author
C. Stamm, R. Spuler

Definition at line 41 of file Decoder.h.

Constructor & Destructor Documentation

◆ CDecoder()

pgf::CDecoder::CDecoder ( CPGFStream * stream,
PGFPreHeader & preHeader,
PGFHeader & header,
PGFPostHeader & postHeader,
uint32_t *& levelLength,
uint64_t & userDataPos,
bool useOMP,
uint32_t userDataPolicy )

Constructor: Read pre-header, header, and levelLength at current stream position. It might throw an IOException.

Parameters
streamA PGF stream
preHeader[out] A PGF pre-header
header[out] A PGF header
postHeader[out] A PGF post-header
levelLengthThe location of the levelLength array. The array is allocated in this method. The caller has to delete this array.
userDataPosThe stream position of the user data (metadata)
useOMPIf true, then the decoder will use multi-threading based on openMP
userDataPolicyPolicy of user data (meta-data) handling while reading PGF headers.

Constructor Read pre-header, header, and levelLength It might throw an IOException.

Parameters
streamA PGF stream
preHeader[out] A PGF pre-header
header[out] A PGF header
postHeader[out] A PGF post-header
levelLengthThe location of the levelLength array. The array is allocated in this method. The caller has to delete this array.
userDataPosThe stream position of the user data (metadata)
useOMPIf true, then the decoder will use multi-threading based on openMP
userDataPolicyPolicy of user data (meta-data) handling while reading PGF headers.

Definition at line 74 of file Decoder.cpp.

77 : m_stream(stream)
78 , m_startPos(0)
83#ifdef __PGFROISUPPORT__
84 , m_roi(false)
85#endif
86 {
87 ASSERT(m_stream);
88
89 int count, expected;
90
91 // store current stream position
93
94 // read magic and version
95 count = expected = MagicVersionSize;
96 m_stream->Read(&count, &preHeader);
97 if (count != expected) ReturnWithError(MissingData);
98
99 // read header size
100 if (preHeader.version & Version6) {
101 // 32 bit header size since version 6
102 count = expected = 4;
103 } else {
104 count = expected = 2;
105 }
106 m_stream->Read(&count, ((uint8_t*)&preHeader) + MagicVersionSize);
107 if (count != expected) ReturnWithError(MissingData);
108
109 // make sure the values are correct read
110 preHeader.hSize = __VAL(preHeader.hSize);
111
112 // check magic number
113 if (memcmp(preHeader.magic, PGFMagic, 3) != 0) {
114 // error condition: wrong Magic number
115 ReturnWithError(FormatCannotRead);
116 }
117
118 // read file header
119 count = expected = (preHeader.hSize < HeaderSize) ? preHeader.hSize : HeaderSize;
120 m_stream->Read(&count, &header);
121 if (count != expected) ReturnWithError(MissingData);
122
123 // make sure the values are correct read
124 header.height = __VAL(uint32_t(header.height));
125 header.width = __VAL(uint32_t(header.width));
126
127 // be ready to read all versions including version 0
128 if (preHeader.version > 0) {
129#ifndef __PGFROISUPPORT__
130 // check ROI usage
131 if (preHeader.version & PGFROI) ReturnWithError(FormatCannotRead);
132#endif
133
134 uint32_t size = preHeader.hSize;
135
136 if (size > HeaderSize) {
137 size -= HeaderSize;
138 count = 0;
139
140 // read post-header
141 if (header.mode == ImageModeIndexedColor) {
142 if (size < ColorTableSize) ReturnWithError(FormatCannotRead);
143 // read color table
144 count = expected = ColorTableSize;
145 m_stream->Read(&count, postHeader.clut);
146 if (count != expected) ReturnWithError(MissingData);
147 }
148
149 if (size > (uint32_t)count) {
150 size -= count;
151
152 // read/skip user data
153 UP::Policy policy = (userDataPolicy <= MaxUserDataSize) ? UP::CachePrefix : 0xFFFFFFFF - userDataPolicy;
154 userDataPos = m_stream->GetPos();
155 postHeader.userDataLen = size;
156
157 if (policy == UP::Skip) {
158 postHeader.cachedUserDataLen = 0;
159 postHeader.userData = nullptr;
160 Skip(size);
161 } else {
162 postHeader.cachedUserDataLen = (policy == UP::CachePrefix) ? __min(size, userDataPolicy) : size;
163
164 // create user data memory block
165 postHeader.userData = new(std::nothrow) uint8_t[postHeader.cachedUserDataLen];
166 if (!postHeader.userData) ReturnWithError(InsufficientMemory);
167
168 // read user data
169 count = expected = postHeader.cachedUserDataLen;
170 m_stream->Read(&count, postHeader.userData);
171 if (count != expected) ReturnWithError(MissingData);
172
173 // skip remaining user data
174 if (postHeader.cachedUserDataLen < size) Skip(size - postHeader.cachedUserDataLen);
175 }
176 }
177 }
178
179 // create levelLength
180 levelLength = new(std::nothrow) uint32_t[header.nLevels];
181 if (!levelLength) ReturnWithError(InsufficientMemory);
182
183 // read levelLength
184 count = expected = header.nLevels*WordBytes;
185 m_stream->Read(&count, levelLength);
186 if (count != expected) ReturnWithError(MissingData);
187
188#ifdef PGF_USE_BIG_ENDIAN
189 // make sure the values are correct read
190 for (int i = 0; i < header.nLevels; i++) {
191 levelLength[i] = __VAL(levelLength[i]);
192 }
193#endif
194
195 // compute the total size in bytes; keep attention: level length information is optional
196 for (int i = 0; i < header.nLevels; i++) {
197 m_streamSizeEstimation += levelLength[i];
198 }
199
200 }
201
202 // store current stream position
204
205 // set number of threads
206#ifdef LIBPGF_USE_OPENMP
207 m_macroBlockLen = omp_get_num_procs();
208#else
209 m_macroBlockLen = 1;
210#endif
211
212 if (useOMP && m_macroBlockLen > 1) {
213#ifdef LIBPGF_USE_OPENMP
214 omp_set_num_threads(m_macroBlockLen);
215#endif
216
217 // create macro block array
218 m_macroBlocks = new(std::nothrow) CMacroBlock*[m_macroBlockLen];
219 if (!m_macroBlocks) ReturnWithError(InsufficientMemory);
220 for (int i = 0; i < m_macroBlockLen; i++) m_macroBlocks[i] = new CMacroBlock();
222 } else {
223 m_macroBlocks = 0;
224 m_macroBlockLen = 1; // there is only one macro block
225 m_currentBlock = new(std::nothrow) CMacroBlock();
226 if (!m_currentBlock) ReturnWithError(InsufficientMemory);
227 }
228 }
constexpr uint32_t WordBytes
sizeof(uint32_t)
Definition PGFplatform.h:76
constexpr uint8_t ImageModeIndexedColor
#define __VAL(x)
#define __min(x, y)
A macro block is a decoding unit of fixed size (uncoded).
Definition Decoder.h:46
CMacroBlock()
Constructor: Initializes new macro block.
Definition Decoder.h:50
int m_macroBlocksAvailable
number of decoded macro blocks (including currently used macro block)
Definition Decoder.h:203
CMacroBlock ** m_macroBlocks
array of macroblocks
Definition Decoder.h:200
void Skip(uint64_t offset)
Definition Decoder.cpp:450
int m_currentBlockIndex
index of current macro block
Definition Decoder.h:201
int m_macroBlockLen
array length
Definition Decoder.h:202
CPGFStream * m_stream
input PGF stream
Definition Decoder.h:195
uint64_t m_streamSizeEstimation
estimation of stream size
Definition Decoder.h:197
uint32_t m_encodedHeaderLength
stream offset from startPos to the beginning of the data part (highest level)
Definition Decoder.h:198
uint64_t m_startPos
stream position at the beginning of the PGF pre-header
Definition Decoder.h:196
CMacroBlock * m_currentBlock
current macro block (used by main thread)
Definition Decoder.h:204
virtual void Read(int *count, void *buffer)=0
virtual uint64_t GetPos() const =0
constexpr Policy Skip
Definition PGFtypes.h:112
constexpr Policy CachePrefix
Definition PGFtypes.h:112
uint32_t Policy
Definition PGFtypes.h:110
constexpr size_t HeaderSize
Definition PGFtypes.h:379
constexpr size_t MagicVersionSize
Definition PGFtypes.h:377
constexpr size_t MaxUserDataSize
Definition PGFtypes.h:382
constexpr const char * PGFMagic
PGF identification.
Definition PGFtypes.h:61
constexpr int Version6
hSize in PGFPreHeader uses 32 bits instead of 16 bits
Definition PGFtypes.h:72
constexpr size_t ColorTableSize
Definition PGFtypes.h:380
constexpr int PGFROI
supports Regions Of Interest
Definition PGFtypes.h:70

◆ ~CDecoder()

pgf::CDecoder::~CDecoder ( )

Destructor.

Definition at line 232 of file Decoder.cpp.

232 {
233 if (m_macroBlocks) {
234 for (int i = 0; i < m_macroBlockLen; i++) delete m_macroBlocks[i];
235 delete[] m_macroBlocks;
236 } else {
237 delete m_currentBlock;
238 }
239 }

Member Function Documentation

◆ DecodeBuffer()

void pgf::CDecoder::DecodeBuffer ( )

Reads next block(s) from stream and decodes them It might throw an IOException.

Definition at line 495 of file Decoder.cpp.

495 {
496 ASSERT(m_macroBlocksAvailable <= 0);
497
498 // macro block management
499 if (m_macroBlockLen == 1) {
500 ASSERT(m_currentBlock);
504 } else {
506 for (int i = 0; i < m_macroBlockLen; i++) {
507 // read sequentially several blocks
508 try {
511 } catch (IOException& ex) {
512 if (ex.error == MissingData || ex.error == FormatCannotRead) {
513 break; // no further data available or the data isn't valid PGF data (might occur in streaming or PPPExt)
514 } else {
515 throw;
516 }
517 }
518 }
519#ifdef LIBPGF_USE_OPENMP
520 // decode in parallel
521#pragma omp parallel for default(shared) //no declared exceptions in next block
522#endif
523 for (int i = 0; i < m_macroBlocksAvailable; i++) {
525 }
526
527 // prepare current macro block
530 }
531 }
void ReadMacroBlock(CMacroBlock *block)
throws IOException
Definition Decoder.cpp:536

◆ DecodeInterleaved()

void pgf::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
wtChannelA wavelet transform channel containing the HL and HL band
levelWavelet transform level
quantParamDequantization value

Definition at line 334 of file Decoder.cpp.

334 {
335 CSubband* hlBand = wtChannel->GetSubband(level, Orient::HL);
336 CSubband* lhBand = wtChannel->GetSubband(level, Orient::LH);
337 const div_t lhH = div(lhBand->GetHeight(), InterBlockSize);
338 const div_t hlW = div(hlBand->GetWidth(), InterBlockSize);
339 const int hlws = hlBand->GetWidth() - InterBlockSize;
340 const int hlwr = hlBand->GetWidth() - hlW.rem;
341 const int lhws = lhBand->GetWidth() - InterBlockSize;
342 const int lhwr = lhBand->GetWidth() - hlW.rem;
343 int hlPos, lhPos;
344 int hlBase = 0, lhBase = 0, hlBase2, lhBase2;
345
346 ASSERT(lhBand->GetWidth() >= hlBand->GetWidth());
347 ASSERT(hlBand->GetHeight() >= lhBand->GetHeight());
348
349 if (!hlBand->AllocMemory()) ReturnWithError(InsufficientMemory);
350 if (!lhBand->AllocMemory()) ReturnWithError(InsufficientMemory);
351
352 // correct quantParam with normalization factor
353 quantParam -= level;
354 if (quantParam < 0) quantParam = 0;
355
356 // main height
357 for (int i = 0; i < lhH.quot; i++) {
358 // main width
359 hlBase2 = hlBase;
360 lhBase2 = lhBase;
361 for (int j = 0; j < hlW.quot; j++) {
362 hlPos = hlBase2;
363 lhPos = lhBase2;
364 for (int y = 0; y < InterBlockSize; y++) {
365 for (int x = 0; x < InterBlockSize; x++) {
366 DequantizeValue(hlBand, hlPos, quantParam);
367 DequantizeValue(lhBand, lhPos, quantParam);
368 hlPos++;
369 lhPos++;
370 }
371 hlPos += hlws;
372 lhPos += lhws;
373 }
374 hlBase2 += InterBlockSize;
375 lhBase2 += InterBlockSize;
376 }
377 // rest of width
378 hlPos = hlBase2;
379 lhPos = lhBase2;
380 for (int y = 0; y < InterBlockSize; y++) {
381 for (int x = 0; x < hlW.rem; x++) {
382 DequantizeValue(hlBand, hlPos, quantParam);
383 DequantizeValue(lhBand, lhPos, quantParam);
384 hlPos++;
385 lhPos++;
386 }
387 // width difference between HL and LH
388 if (lhBand->GetWidth() > hlBand->GetWidth()) {
389 DequantizeValue(lhBand, lhPos, quantParam);
390 }
391 hlPos += hlwr;
392 lhPos += lhwr;
393 hlBase += hlBand->GetWidth();
394 lhBase += lhBand->GetWidth();
395 }
396 }
397 // main width
398 hlBase2 = hlBase;
399 lhBase2 = lhBase;
400 for (int j = 0; j < hlW.quot; j++) {
401 // rest of height
402 hlPos = hlBase2;
403 lhPos = lhBase2;
404 for (int y = 0; y < lhH.rem; y++) {
405 for (int x = 0; x < InterBlockSize; x++) {
406 DequantizeValue(hlBand, hlPos, quantParam);
407 DequantizeValue(lhBand, lhPos, quantParam);
408 hlPos++;
409 lhPos++;
410 }
411 hlPos += hlws;
412 lhPos += lhws;
413 }
414 hlBase2 += InterBlockSize;
415 lhBase2 += InterBlockSize;
416 }
417 // rest of height
418 hlPos = hlBase2;
419 lhPos = lhBase2;
420 for (int y = 0; y < lhH.rem; y++) {
421 // rest of width
422 for (int x = 0; x < hlW.rem; x++) {
423 DequantizeValue(hlBand, hlPos, quantParam);
424 DequantizeValue(lhBand, lhPos, quantParam);
425 hlPos++;
426 lhPos++;
427 }
428 // width difference between HL and LH
429 if (lhBand->GetWidth() > hlBand->GetWidth()) {
430 DequantizeValue(lhBand, lhPos, quantParam);
431 }
432 hlPos += hlwr;
433 lhPos += lhwr;
434 hlBase += hlBand->GetWidth();
435 }
436 // height difference between HL and LH
437 if (hlBand->GetHeight() > lhBand->GetHeight()) {
438 // total width
439 hlPos = hlBase;
440 for (int j = 0; j < hlBand->GetWidth(); j++) {
441 DequantizeValue(hlBand, hlPos, quantParam);
442 hlPos++;
443 }
444 }
445 }
void DequantizeValue(CSubband *band, uint32_t bandPos, int quantParam)
Definition Decoder.cpp:463
constexpr Orientation LH
Definition PGFtypes.h:106
constexpr Orientation HL
Definition PGFtypes.h:105
constexpr int InterBlockSize
side length of a coefficient block in a HL or LH subband
Definition PGFtypes.h:89

◆ DequantizeValue()

void pgf::CDecoder::DequantizeValue ( CSubband * band,
uint32_t bandPos,
int quantParam )

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

Parameters
bandA subband
bandPosA valid position in subband band
quantParamThe 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
bandA subband
bandPosA valid position in subband band
quantParamThe quantization parameter

Definition at line 463 of file Decoder.cpp.

463 {
464 ASSERT(m_currentBlock);
465
467 // all data of current macro block has been read --> prepare next macro block
469 }
470
471 band->SetData(bandPos, m_currentBlock->m_value[m_currentBlock->m_valuePos] << quantParam);
473 }
DataT m_value[BufferSize]
output buffer of values with index m_valuePos
Definition Decoder.h:72
uint32_t m_valuePos
current position in m_value
Definition Decoder.h:74
bool IsCompletelyRead() const
Definition Decoder.h:63
void GetNextMacroBlock()
Definition Decoder.cpp:478

◆ GetEncodedHeaderLength()

uint32_t pgf::CDecoder::GetEncodedHeaderLength ( ) const
inline

Returns the length of all encoded headers in bytes.

Returns
The length of all encoded headers in bytes

Definition at line 131 of file Decoder.h.

131{ return m_encodedHeaderLength; }

◆ GetNextMacroBlock()

void pgf::CDecoder::GetNextMacroBlock ( )

Gets next macro block It might throw an IOException.

Definition at line 478 of file Decoder.cpp.

478 {
479 // current block has been read --> prepare next current block
481
482 if (m_macroBlocksAvailable > 0) {
484 } else {
485 DecodeBuffer();
486 }
487 ASSERT(m_currentBlock);
488 }
void DecodeBuffer()
Definition Decoder.cpp:495

◆ GetStream()

CPGFStream * pgf::CDecoder::GetStream ( )
inline
Returns
Stream

Definition at line 169 of file Decoder.h.

169{ return m_stream; }

◆ Partition()

void pgf::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
bandA subband
quantParamDequantization value
widthThe width of the rectangle
heightThe height of the rectangle
startPosThe relative subband position of the top left corner of the rectangular region
pitchThe number of bytes in row of the subband

Definition at line 267 of file Decoder.cpp.

267 {
268 ASSERT(band);
269
270 const div_t ww = div(width, LinBlockSize);
271 const div_t hh = div(height, LinBlockSize);
272 const int ws = pitch - LinBlockSize;
273 const int wr = pitch - ww.rem;
274 int pos, base = startPos, base2;
275
276 // main height
277 for (int i = 0; i < hh.quot; i++) {
278 // main width
279 base2 = base;
280 for (int j = 0; j < ww.quot; j++) {
281 pos = base2;
282 for (int y = 0; y < LinBlockSize; y++) {
283 for (int x = 0; x < LinBlockSize; x++) {
284 DequantizeValue(band, pos, quantParam);
285 pos++;
286 }
287 pos += ws;
288 }
289 base2 += LinBlockSize;
290 }
291 // rest of width
292 pos = base2;
293 for (int y = 0; y < LinBlockSize; y++) {
294 for (int x = 0; x < ww.rem; x++) {
295 DequantizeValue(band, pos, quantParam);
296 pos++;
297 }
298 pos += wr;
299 base += pitch;
300 }
301 }
302 // main width
303 base2 = base;
304 for (int j = 0; j < ww.quot; j++) {
305 // rest of height
306 pos = base2;
307 for (int y = 0; y < hh.rem; y++) {
308 for (int x = 0; x < LinBlockSize; x++) {
309 DequantizeValue(band, pos, quantParam);
310 pos++;
311 }
312 pos += ws;
313 }
314 base2 += LinBlockSize;
315 }
316 // rest of height
317 pos = base2;
318 for (int y = 0; y < hh.rem; y++) {
319 // rest of width
320 for (int x = 0; x < ww.rem; x++) {
321 DequantizeValue(band, pos, quantParam);
322 pos++;
323 }
324 pos += wr;
325 }
326 }
constexpr int LinBlockSize
side length of a coefficient block in a HH or LL subband
Definition PGFtypes.h:88

◆ ReadEncodedData()

uint32_t pgf::CDecoder::ReadEncodedData ( uint8_t * target,
uint32_t len ) const

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

Parameters
targetThe target buffer
lenThe number of bytes to read
Returns
The number of bytes copied to the target buffer

Definition at line 247 of file Decoder.cpp.

247 {
248 ASSERT(m_stream);
249
250 int count = len;
251 m_stream->Read(&count, target);
252
253 return count;
254 }

◆ ReadMacroBlock()

void pgf::CDecoder::ReadMacroBlock ( CMacroBlock * block)
private

throws IOException

Definition at line 536 of file Decoder.cpp.

536 {
537 ASSERT(block);
538
539 uint16_t wordLen;
540 ROIBlockHeader h(BufferSize);
541 int count, expected;
542
543#ifdef TRACE
544 //uint32_t filePos = (uint32_t)m_stream->GetPos();
545 //printf("DecodeBuffer: %d\n", filePos);
546#endif
547
548 // read wordLen
549 count = expected = sizeof(uint16_t);
550 m_stream->Read(&count, &wordLen);
551 if (count != expected) ReturnWithError(MissingData);
552 wordLen = __VAL(wordLen); // convert wordLen
553 if (wordLen > BufferSize) ReturnWithError(FormatCannotRead);
554
555#ifdef __PGFROISUPPORT__
556 // read ROIBlockHeader
557 if (m_roi) {
558 count = expected = sizeof(ROIBlockHeader);
559 m_stream->Read(&count, &h.val);
560 if (count != expected) ReturnWithError(MissingData);
561 h.val = __VAL(h.val); // convert ROIBlockHeader
562 }
563#endif
564 // save header
565 block->m_header = h;
566
567 // read data
568 count = expected = wordLen*WordBytes;
569 m_stream->Read(&count, block->m_codeBuffer);
570 if (count != expected) ReturnWithError(MissingData);
571
572#ifdef PGF_USE_BIG_ENDIAN
573 // convert data
574 count /= WordBytes;
575 for (int i = 0; i < count; i++) {
576 block->m_codeBuffer[i] = __VAL(block->m_codeBuffer[i]);
577 }
578#endif
579
580#ifdef __PGFROISUPPORT__
581 ASSERT(m_roi && h.rbh.bufferSize <= BufferSize || h.rbh.bufferSize == BufferSize);
582#else
583 ASSERT(h.rbh.bufferSize == BufferSize);
584#endif
585 }
constexpr uint32_t BufferSize
must be a multiple of WordWidth, BufferSize <= UINT16_MAX
Definition PGFtypes.h:84

◆ SetStreamPosToData()

void pgf::CDecoder::SetStreamPosToData ( )
inline

Resets stream position to beginning of data block.

Definition at line 139 of file Decoder.h.

139{ ASSERT(m_stream); m_stream->SetPos(FSFromStart, m_startPos + m_encodedHeaderLength); }
virtual void SetPos(short posMode, int64_t posOff)=0

◆ SetStreamPosToStart()

void pgf::CDecoder::SetStreamPosToStart ( )
inline

Resets stream position to beginning of PGF pre-header.

Definition at line 135 of file Decoder.h.

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

◆ Skip()

void pgf::CDecoder::Skip ( uint64_t offset)

Skips a given number of bytes in the open stream. It might throw an IOException.

Definition at line 450 of file Decoder.cpp.

450 {
451 m_stream->SetPos(FSFromCurrent, offset);
452 }

Member Data Documentation

◆ m_currentBlock

CMacroBlock* pgf::CDecoder::m_currentBlock
private

current macro block (used by main thread)

Definition at line 204 of file Decoder.h.

◆ m_currentBlockIndex

int pgf::CDecoder::m_currentBlockIndex
private

index of current macro block

Definition at line 201 of file Decoder.h.

◆ m_encodedHeaderLength

uint32_t pgf::CDecoder::m_encodedHeaderLength
private

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

Definition at line 198 of file Decoder.h.

◆ m_macroBlockLen

int pgf::CDecoder::m_macroBlockLen
private

array length

Definition at line 202 of file Decoder.h.

◆ m_macroBlocks

CMacroBlock** pgf::CDecoder::m_macroBlocks
private

array of macroblocks

Definition at line 200 of file Decoder.h.

◆ m_macroBlocksAvailable

int pgf::CDecoder::m_macroBlocksAvailable
private

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

Definition at line 203 of file Decoder.h.

◆ m_startPos

uint64_t pgf::CDecoder::m_startPos
private

stream position at the beginning of the PGF pre-header

Definition at line 196 of file Decoder.h.

◆ m_stream

CPGFStream* pgf::CDecoder::m_stream
private

input PGF stream

Definition at line 195 of file Decoder.h.

◆ m_streamSizeEstimation

uint64_t pgf::CDecoder::m_streamSizeEstimation
private

estimation of stream size

Definition at line 197 of file Decoder.h.


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