Grok 20.3.2
grk::TileCodingParams Struct Reference

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)
TileCodingParamsoperator= (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

CodingParamscp_ = 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_ppxpptMarkers_ = 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
TileComponentCodingParamstccps_ = 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.
PacketCachepackets_ = nullptr
double * mct_norms_ = nullptr
 compressing norms
float * mctDecodingMatrix_ = nullptr
 the mct decoding matrix
float * mctCodingMatrix_ = nullptr
 the mct coding matrix
grk_mct_datamctRecords_ = 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_datamccRecords_ = 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.
Quantizerqcd_ = nullptr
uint16_t numComps_ = 0

Private Attributes

bool ht_ = false
std::mutex pocMutex_
std::vector< std::vector< grk_progression > > pocLists_

Detailed Description

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.

Constructor & Destructor Documentation

◆ TileCodingParams() [1/2]

grk::TileCodingParams::TileCodingParams ( CodingParams * cp)
explicit

◆ TileCodingParams() [2/2]

◆ ~TileCodingParams()

Member Function Documentation

◆ addMct()

bool grk::TileCodingParams::addMct ( uint32_t index)

◆ advanceTilePartCounter()

bool grk::TileCodingParams::advanceTilePartCounter ( uint16_t tileIndex,
uint8_t tilePartIndex )

References grk::grklog, and tilePartCounter_.

◆ finalizePocs()

void grk::TileCodingParams::finalizePocs ( void )

◆ getNumProgressions()

uint32_t grk::TileCodingParams::getNumProgressions ( void )

◆ hasPoc()

bool grk::TileCodingParams::hasPoc ( void )

◆ initDefault()

◆ isHT()

bool grk::TileCodingParams::isHT ( void )

References ht_.

◆ mergePpt()

bool grk::TileCodingParams::mergePpt ( void )

Merges all PPT markers read (Packed headers, tile-part header).

Parameters
tcpTileCodingParams
Returns
true if successful

References grk::grk_free(), grk::grklog, ppt_, pptBuffer_, pptData_, pptLength_, pptMarkers_, and pptMarkersCount_.

◆ operator=()

TileCodingParams & grk::TileCodingParams::operator= ( const TileCodingParams & )
delete

References TileCodingParams().

◆ readCoc()

bool grk::TileCodingParams::readCoc ( uint8_t * headerData,
uint16_t headerSize )

Reads a COC marker (Coding Style Component).

Parameters
headerDataheader data
headerSizesize of header data
Returns
true if successful

References grk::grk_read(), grk::grklog, numComps_, readSPCodSPCoc(), and tccps_.

◆ readCod()

bool grk::TileCodingParams::readCod ( uint8_t * headerData,
uint16_t headerSize )

Reads a COD marker (Coding Style defaults).

Parameters
headerDataheader data
headerSizesize of header data
Returns
true if successful

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().

◆ readMcc()

bool grk::TileCodingParams::readMcc ( uint8_t * headerData,
uint16_t headerSize )

Reads a MCC marker (Multiple Component Collection).

Parameters
headerDataheader data
headerSizesize of header data
Returns
true if successful

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_.

◆ readMco()

bool grk::TileCodingParams::readMco ( uint8_t * headerData,
uint16_t headerSize )

Reads a MCO marker (Multiple Component Transform Ordering).

Parameters
headerDataheader data
headerSizesize of header data
Returns
true if successful

References addMct(), grk::grk_free(), grk::grk_read(), grk::grklog, mctDecodingMatrix_, numComps_, and tccps_.

◆ readMct()

bool grk::TileCodingParams::readMct ( uint8_t * headerData,
uint16_t headerSize )

◆ readPoc()

bool grk::TileCodingParams::readPoc ( uint8_t * headerData,
uint16_t headerSize,
int tilePartIndex )

Reads a POC marker (Progression Order Change).

Parameters
headerDataheader data
headerSizesize of header data
tilePartIndexthe tile part index (-1 for main header)
Returns
true if successful

References GRK_MAXRLVLS, GRK_NUM_PROGRESSION_ORDERS, grk::grk_read(), grk::grklog, numComps_, numpocs_, pocLists_, pocMutex_, and progressionOrderChange_.

◆ readPpt()

bool grk::TileCodingParams::readPpt ( uint8_t * headerData,
uint16_t headerSize )

Reads a PPT marker (Packed packet headers, tile-part header).

Parameters
headerDataheader data
headerSizesize of header data
Returns
true if successful

References cp_, grk::grk_calloc(), grk::grk_malloc(), grk::grk_read(), grk::grk_realloc(), grk::grklog, ppt_, pptMarkers_, and pptMarkersCount_.

◆ readQcc()

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

Parameters
headerDataheader data
headerSizesize of header data
Returns
true if successful

References grk::grk_read(), grk::grklog, numComps_, and readSQcdSQcc().

◆ readQcd()

bool grk::TileCodingParams::readQcd ( bool fromTileHeader,
uint8_t * headerData,
uint16_t headerSize )

Reads a QCD marker (Quantization defaults).

Parameters
fromTileHeadertrue if marker is from tile header
headerDataheader data
headerSizesize of header data
Returns
true if successful

References GRK_MAXBANDS, grk::grklog, numComps_, readSQcdSQcc(), and tccps_.

◆ readRgn()

bool grk::TileCodingParams::readRgn ( uint8_t * headerData,
uint16_t headerSize )

Reads a RGN marker (Region Of Interest).

Parameters
headerDataheader data
headerSizesize of header data
Returns
true if successful

References grk::grk_read(), grk::grklog, numComps_, and tccps_.

◆ readSPCodSPCoc()

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.

Parameters
compnocomponent number
headerDataheader data
headerSizesize of header data
Returns
true if successful

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_.

Referenced by readCoc(), and readCod().

◆ readSQcdSQcc()

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.

Parameters
fromTileHeadertrue if marker is from tile header
fromQCCtrue if reading QCC, otherwise false (reading QCD)
compnothe component number to output.
headerDatathe data buffer.
headerSizepointer to the size of the data buffer, it is changed by the function.
Returns
true if successful

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_.

Referenced by readQcc(), and readQcd().

◆ setIsHT()

void grk::TileCodingParams::setIsHT ( bool ht,
bool reversible,
uint8_t guardBits )

◆ updateLayersToDecompress()

void grk::TileCodingParams::updateLayersToDecompress ( void )

References cp_, layersToDecompress_, and numLayers_.

Referenced by readCod().

◆ validateQuantization()

Member Data Documentation

◆ cod_

uint32_t grk::TileCodingParams::cod_ = 0

If cod == true --> there was a COD marker for the present tile.

Referenced by readCod(), and TileCodingParams().

◆ cp_

CodingParams* grk::TileCodingParams::cp_ = nullptr

◆ csty_

◆ distortion_

double grk::TileCodingParams::distortion_[maxCompressLayersGRK]

fixed_quality

Referenced by TileCodingParams(), and TileCodingParams().

◆ ht_

bool grk::TileCodingParams::ht_ = false
private

Referenced by isHT(), setIsHT(), and TileCodingParams().

◆ layersToDecompress_

uint16_t grk::TileCodingParams::layersToDecompress_ = 0

◆ mainQcdNumStepSizes

uint32_t grk::TileCodingParams::mainQcdNumStepSizes = 0

◆ mainQcdQntsty

uint32_t grk::TileCodingParams::mainQcdQntsty = 0

◆ mccRecords_

◆ mct_

uint8_t grk::TileCodingParams::mct_ = 0

◆ mct_norms_

double* grk::TileCodingParams::mct_norms_ = nullptr

compressing norms

Referenced by TileCodingParams(), and ~TileCodingParams().

◆ mctCodingMatrix_

float* grk::TileCodingParams::mctCodingMatrix_ = nullptr

the mct coding matrix

Referenced by TileCodingParams(), and ~TileCodingParams().

◆ mctDecodingMatrix_

float* grk::TileCodingParams::mctDecodingMatrix_ = nullptr

◆ mctRecords_

grk_mct_data* grk::TileCodingParams::mctRecords_ = nullptr

◆ numComps_

◆ numLayers_

◆ numMaxMccRecords_

uint32_t grk::TileCodingParams::numMaxMccRecords_ = 0

the max number of mct records.

Referenced by grk::CodeStreamCompress::init_mct_encoding(), initDefault(), readMcc(), and TileCodingParams().

◆ numMaxMctRecords_

uint32_t grk::TileCodingParams::numMaxMctRecords_ = 0

the max number of mct records.

Referenced by grk::CodeStreamCompress::init_mct_encoding(), initDefault(), readMct(), and TileCodingParams().

◆ numMccRecords_

uint32_t grk::TileCodingParams::numMccRecords_ = 0

◆ numMctRecords_

uint32_t grk::TileCodingParams::numMctRecords_ = 0

◆ numpocs_

uint32_t grk::TileCodingParams::numpocs_ = 0

◆ packets_

PacketCache* grk::TileCodingParams::packets_ = nullptr

◆ pocLists_

std::vector<std::vector<grk_progression> > grk::TileCodingParams::pocLists_
private

Referenced by finalizePocs(), and readPoc().

◆ pocMutex_

std::mutex grk::TileCodingParams::pocMutex_
private

Referenced by finalizePocs(), and readPoc().

◆ ppt_

bool grk::TileCodingParams::ppt_ = false

If ppt == true --> there was a PPT marker for the present tile.

Referenced by mergePpt(), readPpt(), and TileCodingParams().

◆ pptBuffer_

uint8_t* grk::TileCodingParams::pptBuffer_ = nullptr

used to keep a track of the allocated memory

Referenced by mergePpt(), TileCodingParams(), and ~TileCodingParams().

◆ pptData_

uint8_t* grk::TileCodingParams::pptData_ = nullptr

packet header store there for future use in t2_decode_packet

Referenced by mergePpt(), and TileCodingParams().

◆ pptLength_

size_t grk::TileCodingParams::pptLength_ = 0

size of ppt_data

Referenced by mergePpt(), and TileCodingParams().

◆ pptMarkers_

grk_ppx* grk::TileCodingParams::pptMarkers_ = nullptr

ppt markers data (table indexed by Zppt)

Referenced by mergePpt(), readPpt(), TileCodingParams(), and ~TileCodingParams().

◆ pptMarkersCount_

uint32_t grk::TileCodingParams::pptMarkersCount_ = 0

number of ppt markers (reserved size)

Referenced by mergePpt(), readPpt(), TileCodingParams(), and ~TileCodingParams().

◆ prg_

◆ progressionOrderChange_

grk_progression grk::TileCodingParams::progressionOrderChange_[GRK_MAXRLVLS]

◆ qcd_

Quantizer* grk::TileCodingParams::qcd_ = nullptr

◆ rates_

double grk::TileCodingParams::rates_[maxCompressLayersGRK]

rates of layers

Referenced by TileCodingParams(), and TileCodingParams().

◆ signalledNumTileParts_

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().

◆ tccps_

◆ tilePartCounter_

uint8_t grk::TileCodingParams::tilePartCounter_ = 0

◆ wholeTileDecompress_

bool grk::TileCodingParams::wholeTileDecompress_ = true

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