|
Grok 20.3.2
|
Tile coding parameters : this structure is used to store coding/decoding parameters common to all tiles (information like COD, COC in main header). More...
#include <CodingParams.h>
Public Member Functions | |
| TileCodingParams (CodingParams *cp) | |
| TileCodingParams (const TileCodingParams &rhs) | |
| TileCodingParams & | operator= (const TileCodingParams &)=delete |
| ~TileCodingParams () | |
| bool | advanceTilePartCounter (uint16_t tileIndex, uint8_t tilePartIndex) |
| bool | initDefault (GrkImage *headerImage) |
| bool | readPpt (uint8_t *headerData, uint16_t headerSize) |
| Reads a PPT marker (Packed packet headers, tile-part header). | |
| bool | mergePpt (void) |
| Merges all PPT markers read (Packed headers, tile-part header). | |
| bool | readSPCodSPCoc (uint16_t compno, uint8_t *headerData, uint16_t *headerSize) |
| Reads a SPCod or SPCoc element, i.e. | |
| bool | readSQcdSQcc (bool fromTileHeader, bool fromQCC, uint16_t compno, uint8_t *headerData, uint16_t *headerSize) |
| Reads a SQcd or SQcc element, i.e. | |
| bool | readCod (uint8_t *headerData, uint16_t headerSize) |
| Reads a COD marker (Coding Style defaults). | |
| bool | readCoc (uint8_t *headerData, uint16_t headerSize) |
| Reads a COC marker (Coding Style Component). | |
| bool | readQcd (bool fromTileHeader, uint8_t *headerData, uint16_t headerSize) |
| Reads a QCD marker (Quantization defaults). | |
| bool | readQcc (bool fromTileHeader, uint8_t *headerData, uint16_t headerSize) |
| Reads a QCC marker (Quantization component). | |
| bool | readRgn (uint8_t *headerData, uint16_t headerSize) |
| Reads a RGN marker (Region Of Interest). | |
| bool | readPoc (uint8_t *headerData, uint16_t headerSize, int tilePartIndex) |
| Reads a POC marker (Progression Order Change). | |
| bool | readMct (uint8_t *headerData, uint16_t headerSize) |
| Reads a MCT marker (Multiple Component Transform). | |
| bool | readMco (uint8_t *headerData, uint16_t headerSize) |
| Reads a MCO marker (Multiple Component Transform Ordering). | |
| bool | readMcc (uint8_t *headerData, uint16_t headerSize) |
| Reads a MCC marker (Multiple Component Collection). | |
| bool | addMct (uint32_t index) |
| void | updateLayersToDecompress (void) |
| bool | validateQuantization (void) |
| void | setIsHT (bool ht, bool reversible, uint8_t guardBits) |
| bool | isHT (void) |
| uint32_t | getNumProgressions (void) |
| bool | hasPoc (void) |
| void | finalizePocs (void) |
Public Attributes | |
| CodingParams * | cp_ = nullptr |
| bool | wholeTileDecompress_ = true |
| uint8_t | csty_ = 0 |
| coding style | |
| GRK_PROG_ORDER | prg_ = GRK_PROG_UNKNOWN |
| progression order | |
| uint16_t | numLayers_ = 0 |
| number of layers | |
| uint16_t | layersToDecompress_ = 0 |
| uint8_t | mct_ = 0 |
| multi-component transform identifier | |
| double | rates_ [maxCompressLayersGRK] |
| rates of layers | |
| uint32_t | numpocs_ = 0 |
| number of progression order changes | |
| grk_progression | progressionOrderChange_ [GRK_MAXRLVLS] |
| progression order changes | |
| uint32_t | pptMarkersCount_ = 0 |
| number of ppt markers (reserved size) | |
| grk_ppx * | pptMarkers_ = nullptr |
| ppt markers data (table indexed by Zppt) | |
| uint8_t * | pptData_ = nullptr |
| packet header store there for future use in t2_decode_packet | |
| uint8_t * | pptBuffer_ = nullptr |
| used to keep a track of the allocated memory | |
| size_t | pptLength_ = 0 |
| size of ppt_data | |
| double | distortion_ [maxCompressLayersGRK] |
| fixed_quality | |
| uint32_t | mainQcdQntsty = 0 |
| uint32_t | mainQcdNumStepSizes = 0 |
| TileComponentCodingParams * | tccps_ = nullptr |
| tile-component coding parameters | |
| uint8_t | tilePartCounter_ = 0 |
| uint8_t | signalledNumTileParts_ = 0 |
| number of tile parts for the tile, signlled by TLM or SOT marker. | |
| PacketCache * | packets_ = nullptr |
| double * | mct_norms_ = nullptr |
| compressing norms | |
| float * | mctDecodingMatrix_ = nullptr |
| the mct decoding matrix | |
| float * | mctCodingMatrix_ = nullptr |
| the mct coding matrix | |
| grk_mct_data * | mctRecords_ = nullptr |
| mct records | |
| uint32_t | numMctRecords_ = 0 |
| the number of mct records. | |
| uint32_t | numMaxMctRecords_ = 0 |
| the max number of mct records. | |
| grk_simple_mcc_decorrelation_data * | mccRecords_ = nullptr |
| mcc records | |
| uint32_t | numMccRecords_ = 0 |
| the number of mct records. | |
| uint32_t | numMaxMccRecords_ = 0 |
| the max number of mct records. | |
| uint32_t | cod_ = 0 |
| If cod == true --> there was a COD marker for the present tile. | |
| bool | ppt_ = false |
| If ppt == true --> there was a PPT marker for the present tile. | |
| Quantizer * | qcd_ = nullptr |
| uint16_t | numComps_ = 0 |
Private Attributes | |
| bool | ht_ = false |
| std::mutex | pocMutex_ |
| std::vector< std::vector< grk_progression > > | pocLists_ |
Tile coding parameters : this structure is used to store coding/decoding parameters common to all tiles (information like COD, COC in main header).
It also stores compressed packets for a particular tile.
|
explicit |
References cp_, distortion_, grk::maxCompressLayersGRK, progressionOrderChange_, and rates_.
Referenced by operator=(), and TileCodingParams().
| grk::TileCodingParams::TileCodingParams | ( | const TileCodingParams & | rhs | ) |
References cod_, cp_, csty_, distortion_, grk::grk_malloc(), grk::grklog, ht_, layersToDecompress_, mainQcdNumStepSizes, mainQcdQntsty, grk::QuantizerFactory::makeQuantizer(), mccRecords_, mct_, mct_norms_, mctCodingMatrix_, mctDecodingMatrix_, mctRecords_, numComps_, grk::TileComponentCodingParams::numgbits_, numLayers_, numMaxMccRecords_, numMaxMctRecords_, numMccRecords_, numMctRecords_, numpocs_, packets_, ppt_, pptBuffer_, pptData_, pptLength_, pptMarkers_, pptMarkersCount_, prg_, progressionOrderChange_, qcd_, grk::TileComponentCodingParams::qmfbid_, rates_, signalledNumTileParts_, tccps_, TileCodingParams(), tilePartCounter_, and wholeTileDecompress_.
| grk::TileCodingParams::~TileCodingParams | ( | ) |
References grk::grk_free(), mccRecords_, mct_norms_, mctCodingMatrix_, mctDecodingMatrix_, mctRecords_, numMctRecords_, packets_, pptBuffer_, pptMarkers_, pptMarkersCount_, qcd_, and tccps_.
| bool grk::TileCodingParams::addMct | ( | uint32_t | index | ) |
element discarded
References grk::grk_free(), grk::grk_malloc(), mccRecords_, grk::MCT_ELEMENT_SIZE, mctDecodingMatrix_, numComps_, numMccRecords_, and tccps_.
Referenced by readMco().
| bool grk::TileCodingParams::advanceTilePartCounter | ( | uint16_t | tileIndex, |
| uint8_t | tilePartIndex ) |
References grk::grklog, and tilePartCounter_.
| void grk::TileCodingParams::finalizePocs | ( | void | ) |
References GRK_MAXRLVLS, grk::grklog, numComps_, numLayers_, numpocs_, pocLists_, pocMutex_, progressionOrderChange_, signalledNumTileParts_, and tccps_.
| uint32_t grk::TileCodingParams::getNumProgressions | ( | void | ) |
References numpocs_.
Referenced by grk::PacketManager::updateCompressTcpProgressions().
| bool grk::TileCodingParams::hasPoc | ( | void | ) |
References numpocs_.
Referenced by grk::PacketIter::init(), and grk::PacketManager::updateCompressParams().
| bool grk::TileCodingParams::initDefault | ( | GrkImage * | headerImage | ) |
| bool grk::TileCodingParams::isHT | ( | void | ) |
References ht_.
| bool grk::TileCodingParams::mergePpt | ( | void | ) |
Merges all PPT markers read (Packed headers, tile-part header).
| tcp | TileCodingParams |
References grk::grk_free(), grk::grklog, ppt_, pptBuffer_, pptData_, pptLength_, pptMarkers_, and pptMarkersCount_.
|
delete |
References TileCodingParams().
| bool grk::TileCodingParams::readCoc | ( | uint8_t * | headerData, |
| uint16_t | headerSize ) |
Reads a COC marker (Coding Style Component).
| headerData | header data |
| headerSize | size of header data |
References grk::grk_read(), grk::grklog, numComps_, readSPCodSPCoc(), and tccps_.
| bool grk::TileCodingParams::readCod | ( | uint8_t * | headerData, |
| uint16_t | headerSize ) |
Reads a COD marker (Coding Style defaults).
| headerData | header data |
| headerSize | size of header data |
References grk::CCP_CSTY_PRECINCT, cod_, grk::codSocLen, grk::CP_CSTY_EPH, grk::CP_CSTY_PRT, grk::CP_CSTY_SOP, csty_, GRK_NUM_PROGRESSION_ORDERS, grk::grk_read(), grk::grklog, mct_, numComps_, numLayers_, prg_, readSPCodSPCoc(), tccps_, and updateLayersToDecompress().
| bool grk::TileCodingParams::readMcc | ( | uint8_t * | headerData, |
| uint16_t | headerSize ) |
Reads a MCC marker (Multiple Component Collection).
| headerData | header data |
| headerSize | size of header data |
NOT FOUND
References grk::default_number_mcc_records, grk::grk_free(), grk::grk_read(), grk::grk_realloc(), grk::grklog, mccRecords_, mctRecords_, numMaxMccRecords_, numMccRecords_, and numMctRecords_.
| bool grk::TileCodingParams::readMco | ( | uint8_t * | headerData, |
| uint16_t | headerSize ) |
Reads a MCO marker (Multiple Component Transform Ordering).
| headerData | header data |
| headerSize | size of header data |
References addMct(), grk::grk_free(), grk::grk_read(), grk::grklog, mctDecodingMatrix_, numComps_, and tccps_.
| bool grk::TileCodingParams::readMct | ( | uint8_t * | headerData, |
| uint16_t | headerSize ) |
Reads a MCT marker (Multiple Component Transform).
| headerData | header data |
| headerSize | size of header data |
References grk::grk_simple_mcc_decorrelation_data::decorrelation_array_, grk::default_number_mct_records, grk::grk_free(), grk::grk_malloc(), grk::grk_read(), grk::grk_realloc(), grk::grklog, mccRecords_, mctRecords_, numMaxMctRecords_, numMccRecords_, numMctRecords_, and grk::grk_simple_mcc_decorrelation_data::offset_array_.
| bool grk::TileCodingParams::readPoc | ( | uint8_t * | headerData, |
| uint16_t | headerSize, | ||
| int | tilePartIndex ) |
Reads a POC marker (Progression Order Change).
| headerData | header data |
| headerSize | size of header data |
| tilePartIndex | the tile part index (-1 for main header) |
References GRK_MAXRLVLS, GRK_NUM_PROGRESSION_ORDERS, grk::grk_read(), grk::grklog, numComps_, numpocs_, pocLists_, pocMutex_, and progressionOrderChange_.
| bool grk::TileCodingParams::readPpt | ( | uint8_t * | headerData, |
| uint16_t | headerSize ) |
Reads a PPT marker (Packed packet headers, tile-part header).
| headerData | header data |
| headerSize | size of header data |
References cp_, grk::grk_calloc(), grk::grk_malloc(), grk::grk_read(), grk::grk_realloc(), grk::grklog, ppt_, pptMarkers_, and pptMarkersCount_.
| bool grk::TileCodingParams::readQcc | ( | bool | fromTileHeader, |
| uint8_t * | headerData, | ||
| uint16_t | headerSize ) |
Reads a QCC marker (Quantization component).
fromTileHeader true if marker from tile header
| headerData | header data |
| headerSize | size of header data |
References grk::grk_read(), grk::grklog, numComps_, and readSQcdSQcc().
| bool grk::TileCodingParams::readQcd | ( | bool | fromTileHeader, |
| uint8_t * | headerData, | ||
| uint16_t | headerSize ) |
Reads a QCD marker (Quantization defaults).
| fromTileHeader | true if marker is from tile header |
| headerData | header data |
| headerSize | size of header data |
References GRK_MAXBANDS, grk::grklog, numComps_, readSQcdSQcc(), and tccps_.
| bool grk::TileCodingParams::readRgn | ( | uint8_t * | headerData, |
| uint16_t | headerSize ) |
Reads a RGN marker (Region Of Interest).
| headerData | header data |
| headerSize | size of header data |
References grk::grk_read(), grk::grklog, numComps_, and tccps_.
| bool grk::TileCodingParams::readSPCodSPCoc | ( | uint16_t | compno, |
| uint8_t * | headerData, | ||
| uint16_t * | headerSize ) |
Reads a SPCod or SPCoc element, i.e.
the coding style of a given component of a tile.
| compno | component number |
| headerData | header data |
| headerSize | size of header data |
References grk::CCP_CSTY_PRECINCT, cp_, GRK_CBLKSTY_HT_ONLY, GRK_CBLKSTY_LAZY, GRK_CBLKSTY_RESET, GRK_MAX_DECOMP_LVLS, grk::grk_read(), grk::grklog, grk::SPCodSPCocLen, and tccps_.
| bool grk::TileCodingParams::readSQcdSQcc | ( | bool | fromTileHeader, |
| bool | fromQCC, | ||
| uint16_t | compno, | ||
| uint8_t * | headerData, | ||
| uint16_t * | headerSize ) |
Reads a SQcd or SQcc element, i.e.
the quantization values of a band in the QCD or QCC.
| fromTileHeader | true if marker is from tile header |
| fromQCC | true if reading QCC, otherwise false (reading QCD) |
| compno | the component number to output. |
| headerData | the data buffer. |
| headerSize | pointer to the size of the data buffer, it is changed by the function. |
References grk::CCP_QNTSTY_NOQNT, grk::CCP_QNTSTY_SEQNT, grk::CCP_QNTSTY_SIQNT, GRK_MAXBANDS, grk::grk_read(), grk::grklog, mainQcdNumStepSizes, mainQcdQntsty, numComps_, and tccps_.
| void grk::TileCodingParams::setIsHT | ( | bool | ht, |
| bool | reversible, | ||
| uint8_t | guardBits ) |
References ht_, grk::QuantizerFactory::makeQuantizer(), and qcd_.
| void grk::TileCodingParams::updateLayersToDecompress | ( | void | ) |
References cp_, layersToDecompress_, and numLayers_.
Referenced by readCod().
| bool grk::TileCodingParams::validateQuantization | ( | void | ) |
| uint32_t grk::TileCodingParams::cod_ = 0 |
If cod == true --> there was a COD marker for the present tile.
Referenced by readCod(), and TileCodingParams().
| CodingParams* grk::TileCodingParams::cp_ = nullptr |
Referenced by readPpt(), readSPCodSPCoc(), TileCodingParams(), TileCodingParams(), and updateLayersToDecompress().
| uint8_t grk::TileCodingParams::csty_ = 0 |
coding style
Referenced by grk::T2Compress::compressPacket(), grk::T2Compress::compressPacketSimulate(), grk::CodeStreamDecompress::dumpTileHeader(), readCod(), and TileCodingParams().
| double grk::TileCodingParams::distortion_[maxCompressLayersGRK] |
fixed_quality
Referenced by TileCodingParams(), and TileCodingParams().
|
private |
Referenced by isHT(), setIsHT(), and TileCodingParams().
| uint16_t grk::TileCodingParams::layersToDecompress_ = 0 |
Referenced by TileCodingParams(), and updateLayersToDecompress().
| uint32_t grk::TileCodingParams::mainQcdNumStepSizes = 0 |
Referenced by readSQcdSQcc(), TileCodingParams(), and validateQuantization().
| uint32_t grk::TileCodingParams::mainQcdQntsty = 0 |
Referenced by readSQcdSQcc(), TileCodingParams(), and validateQuantization().
| grk_simple_mcc_decorrelation_data* grk::TileCodingParams::mccRecords_ = nullptr |
mcc records
Referenced by addMct(), grk::CodeStreamCompress::init_mct_encoding(), initDefault(), readMcc(), readMct(), TileCodingParams(), and ~TileCodingParams().
| uint8_t grk::TileCodingParams::mct_ = 0 |
multi-component transform identifier
Referenced by grk::CodeStreamDecompress::dumpTileHeader(), grk::CodeStreamCompress::init_mct_encoding(), readCod(), and TileCodingParams().
| double* grk::TileCodingParams::mct_norms_ = nullptr |
compressing norms
Referenced by TileCodingParams(), and ~TileCodingParams().
| float* grk::TileCodingParams::mctCodingMatrix_ = nullptr |
the mct coding matrix
Referenced by TileCodingParams(), and ~TileCodingParams().
| float* grk::TileCodingParams::mctDecodingMatrix_ = nullptr |
the mct decoding matrix
Referenced by addMct(), grk::CodeStreamCompress::init_mct_encoding(), readMco(), TileCodingParams(), and ~TileCodingParams().
| grk_mct_data* grk::TileCodingParams::mctRecords_ = nullptr |
mct records
Referenced by grk::CodeStreamCompress::init_mct_encoding(), initDefault(), readMcc(), readMct(), TileCodingParams(), and ~TileCodingParams().
| uint16_t grk::TileCodingParams::numComps_ = 0 |
Referenced by addMct(), finalizePocs(), initDefault(), readCoc(), readCod(), readMco(), readPoc(), readQcc(), readQcd(), readRgn(), readSQcdSQcc(), TileCodingParams(), and validateQuantization().
| uint16_t grk::TileCodingParams::numLayers_ = 0 |
number of layers
Referenced by grk::CodeStreamDecompress::dumpTileHeader(), finalizePocs(), grk::PacketIter::init(), readCod(), TileCodingParams(), grk::PacketManager::updateCompressTcpProgressions(), and updateLayersToDecompress().
| uint32_t grk::TileCodingParams::numMaxMccRecords_ = 0 |
the max number of mct records.
Referenced by grk::CodeStreamCompress::init_mct_encoding(), initDefault(), readMcc(), and TileCodingParams().
| uint32_t grk::TileCodingParams::numMaxMctRecords_ = 0 |
the max number of mct records.
Referenced by grk::CodeStreamCompress::init_mct_encoding(), initDefault(), readMct(), and TileCodingParams().
| uint32_t grk::TileCodingParams::numMccRecords_ = 0 |
the number of mct records.
Referenced by addMct(), grk::CodeStreamCompress::init_mct_encoding(), readMcc(), readMct(), and TileCodingParams().
| uint32_t grk::TileCodingParams::numMctRecords_ = 0 |
the number of mct records.
Referenced by grk::CodeStreamCompress::init_mct_encoding(), readMcc(), readMct(), TileCodingParams(), and ~TileCodingParams().
| uint32_t grk::TileCodingParams::numpocs_ = 0 |
number of progression order changes
Referenced by finalizePocs(), getNumProgressions(), hasPoc(), grk::PacketManager::PacketManager(), readPoc(), and TileCodingParams().
| PacketCache* grk::TileCodingParams::packets_ = nullptr |
Referenced by TileCodingParams(), and ~TileCodingParams().
|
private |
Referenced by finalizePocs(), and readPoc().
|
private |
Referenced by finalizePocs(), and readPoc().
| bool grk::TileCodingParams::ppt_ = false |
If ppt == true --> there was a PPT marker for the present tile.
Referenced by mergePpt(), readPpt(), and TileCodingParams().
| uint8_t* grk::TileCodingParams::pptBuffer_ = nullptr |
used to keep a track of the allocated memory
Referenced by mergePpt(), TileCodingParams(), and ~TileCodingParams().
| uint8_t* grk::TileCodingParams::pptData_ = nullptr |
packet header store there for future use in t2_decode_packet
Referenced by mergePpt(), and TileCodingParams().
| size_t grk::TileCodingParams::pptLength_ = 0 |
size of ppt_data
Referenced by mergePpt(), and TileCodingParams().
| grk_ppx* grk::TileCodingParams::pptMarkers_ = nullptr |
ppt markers data (table indexed by Zppt)
Referenced by mergePpt(), readPpt(), TileCodingParams(), and ~TileCodingParams().
| uint32_t grk::TileCodingParams::pptMarkersCount_ = 0 |
number of ppt markers (reserved size)
Referenced by mergePpt(), readPpt(), TileCodingParams(), and ~TileCodingParams().
| GRK_PROG_ORDER grk::TileCodingParams::prg_ = GRK_PROG_UNKNOWN |
progression order
Referenced by grk::CodeStreamDecompress::dumpTileHeader(), grk::PacketIter::init(), readCod(), TileCodingParams(), and grk::PacketManager::updateCompressTcpProgressions().
| grk_progression grk::TileCodingParams::progressionOrderChange_[GRK_MAXRLVLS] |
progression order changes
Referenced by finalizePocs(), grk::PacketIter::init(), readPoc(), TileCodingParams(), TileCodingParams(), and grk::PacketManager::updateCompressTcpProgressions().
| Quantizer* grk::TileCodingParams::qcd_ = nullptr |
Referenced by setIsHT(), TileCodingParams(), and ~TileCodingParams().
| double grk::TileCodingParams::rates_[maxCompressLayersGRK] |
rates of layers
Referenced by TileCodingParams(), and TileCodingParams().
| uint8_t grk::TileCodingParams::signalledNumTileParts_ = 0 |
number of tile parts for the tile, signlled by TLM or SOT marker.
Referenced by finalizePocs(), TileCodingParams(), and grk::SOTMarker::write().
| TileComponentCodingParams* grk::TileCodingParams::tccps_ = nullptr |
tile-component coding parameters
Referenced by addMct(), grk::CodeStreamDecompress::dumpTileHeader(), finalizePocs(), grk::PacketManager::getParams(), grk::PacketIter::init(), grk::CodeStreamCompress::init_mct_encoding(), initDefault(), readCoc(), readCod(), readMco(), readQcd(), readRgn(), readSPCodSPCoc(), readSQcdSQcc(), TileCodingParams(), validateQuantization(), and ~TileCodingParams().
| uint8_t grk::TileCodingParams::tilePartCounter_ = 0 |
Referenced by advanceTilePartCounter(), and TileCodingParams().
| bool grk::TileCodingParams::wholeTileDecompress_ = true |
Referenced by grk::DecompressScheduler::scheduleT1(), and TileCodingParams().