Grok 20.3.2
grk::PacketManager Class Reference

#include <PacketManager.h>

Public Member Functions

 PacketManager (bool compression, GrkImage *img, CodingParams *cparams, uint16_t tilenumber, T2_MODE t2_mode, ITileProcessor *tileProc)
virtual ~PacketManager ()
PacketItergetPacketIter (uint32_t poc) const
void enable_tile_part_generation (uint32_t prog_iter_num, bool first_poc_tile_part, uint8_t newTilePartProgressionPosition)
 Modify the packet iterator for enabling tile part generation.
IncludeTrackergetIncludeTracker (void)
uint32_t getNumProgressions (void)
ITileProcessorgetTileProcessor (void)
GrkImagegetImage ()
Rect32 getTileBounds (void)
CodingParamsgetCodingParams (void)
T2_MODE getT2Mode (void)

Static Public Member Functions

static void updateCompressParams (const GrkImage *image, CodingParams *p_cp, TileCodingParams *tcp, uint16_t tile_no)
 Updates the compressing parameters of the codec.

Static Private Member Functions

static void updateCompressTcpProgressions (TileCodingParams *tcp, uint16_t num_comps, Rect32 tileBounds, uint64_t max_precincts, uint8_t max_res, uint32_t dx_min, uint32_t dy_min, bool poc)
 Updates the coding parameters.
static void getParams (const GrkImage *image, CodingParams *p_cp, TileCodingParams *tcp, uint16_t tileno, Rect32 *tileBounds, uint32_t *dx_min, uint32_t *dy_min, IncludeTracker *includeTracker, uint64_t *max_precincts, uint8_t *max_res, uint32_t **componentPrecinctInfo)
 Get the compression parameters needed to update the coding parameters and all the pocs.

Private Attributes

GrkImageimage_
CodingParamscp_
uint16_t tileIndex_
IncludeTrackerincludeTracker_
PacketIterpi_
T2_MODE t2Mode_
ITileProcessortileProcessor_
Rect32 tileBounds_

Constructor & Destructor Documentation

◆ PacketManager()

◆ ~PacketManager()

grk::PacketManager::~PacketManager ( )
virtual

References includeTracker_, and pi_.

Member Function Documentation

◆ enable_tile_part_generation()

void grk::PacketManager::enable_tile_part_generation ( uint32_t prog_iter_num,
bool first_poc_tile_part,
uint8_t newTilePartProgressionPosition )

Modify the packet iterator for enabling tile part generation.

Parameters
prog_iter_numpacket iterator number
first_poc_tile_parttrue for first POC tile part
newTilePartProgressionPositionThe position of the tile part flag in the progression order

References enable_tile_part_generation(), and pi_.

Referenced by grk::T2Compress::compressPackets(), grk::T2Compress::compressPacketsSimulate(), and enable_tile_part_generation().

◆ getCodingParams()

CodingParams * grk::PacketManager::getCodingParams ( void )

References cp_.

◆ getImage()

GrkImage * grk::PacketManager::getImage ( )

References image_.

Referenced by grk::PacketIter::init().

◆ getIncludeTracker()

IncludeTracker * grk::PacketManager::getIncludeTracker ( void )

References includeTracker_.

◆ getNumProgressions()

uint32_t grk::PacketManager::getNumProgressions ( void )

References tileProcessor_.

◆ getPacketIter()

PacketIter * grk::PacketManager::getPacketIter ( uint32_t poc) const

◆ getParams()

void grk::PacketManager::getParams ( const GrkImage * image,
CodingParams * p_cp,
TileCodingParams * tcp,
uint16_t tileno,
Rect32 * tileBounds,
uint32_t * dx_min,
uint32_t * dy_min,
IncludeTracker * includeTracker,
uint64_t * max_precincts,
uint8_t * max_res,
uint32_t ** componentPrecinctInfo )
staticprivate

Get the compression parameters needed to update the coding parameters and all the pocs.

The precinct widths, heights, dx and dy for each component at each resolution will be stored as well. the last parameter of the function should be an array of pointers of size nb components, each pointer leading to an area of size 4 * max_res. The data is stored inside this area with the following pattern : dx_compi_res0 , dy_compi_res0 , w_compi_res0, h_compi_res0 , dx_compi_res1 , dy_compi_res1 , w_compi_res1, h_compi_res1 , ...

Parameters
imagethe image being encoded.
p_cpthe coding parameters.
tilenothe tile index of the tile being encoded.
tileBoundstile bounds
dx_minminimum dx of all the components of all the resolutions for the tile.
dy_minminimum dy of all the components of all the resolutions for the tile.
precinctsarray of precincts
max_precinctsmaximum number of precincts for all the bands of the tile
max_resmaximum number of resolutions for all the poc inside the tile.
componentPrecinctInfostores precinct exponents and precinct grid dimensions for each component

References grk::ceildivpow2(), grk::floordivpow2(), grk::GrkImage::getBounds(), grk::CodingParams::getTileBounds(), grk::IncludeTracker::resetNumPrecinctsPerRes(), grk::Rect< T >::scaleDownCeil(), grk::CodingParams::t_grid_height_, grk::CodingParams::t_grid_width_, grk::TileCodingParams::tccps_, and grk::IncludeTracker::updateNumPrecinctsPerRes().

Referenced by PacketManager(), and updateCompressParams().

◆ getT2Mode()

T2_MODE grk::PacketManager::getT2Mode ( void )

References t2Mode_.

◆ getTileBounds()

Rect32 grk::PacketManager::getTileBounds ( void )

References tileBounds_.

◆ getTileProcessor()

ITileProcessor * grk::PacketManager::getTileProcessor ( void )

References tileProcessor_.

◆ updateCompressParams()

void grk::PacketManager::updateCompressParams ( const GrkImage * image,
CodingParams * p_cp,
TileCodingParams * tcp,
uint16_t tile_no )
static

Updates the compressing parameters of the codec.

Parameters
imagethe image being encoded.
p_cpthe coding parameters.
tile_noindex of the tile being encoded.

References getParams(), grk::TileCodingParams::hasPoc(), and updateCompressTcpProgressions().

Referenced by grk::CodeStreamCompress::getNumTileParts().

◆ updateCompressTcpProgressions()

void grk::PacketManager::updateCompressTcpProgressions ( TileCodingParams * tcp,
uint16_t num_comps,
Rect32 tileBounds,
uint64_t max_precincts,
uint8_t max_res,
uint32_t dx_min,
uint32_t dy_min,
bool poc )
staticprivate

Updates the coding parameters.

Parameters
tcpTileCodingParams
num_compsthe number of components
tileBoundstile bounds
max_precinctsthe maximum number of precincts for all the bands of the tile
max_resthe maximum number of resolutions for all the poc inside the tile.
dx_minthe minimum dx of all the components of all the resolutions for the tile.
dy_minthe minimum dy of all the components of all the resolutions for the tile.
poctrue if there is a progressio order change

References grk::TileCodingParams::getNumProgressions(), grk::TileCodingParams::numLayers_, grk::TileCodingParams::prg_, grk::TileCodingParams::progressionOrderChange_, grk::Rect< T >::x0, grk::Rect< T >::x1, grk::Rect< T >::y0, and grk::Rect< T >::y1.

Referenced by PacketManager(), and updateCompressParams().

Member Data Documentation

◆ cp_

CodingParams* grk::PacketManager::cp_
private

Referenced by getCodingParams(), and PacketManager().

◆ image_

GrkImage* grk::PacketManager::image_
private

Referenced by getImage(), and PacketManager().

◆ includeTracker_

IncludeTracker* grk::PacketManager::includeTracker_
private

◆ pi_

PacketIter* grk::PacketManager::pi_
private

◆ t2Mode_

T2_MODE grk::PacketManager::t2Mode_
private

Referenced by getT2Mode(), and PacketManager().

◆ tileBounds_

Rect32 grk::PacketManager::tileBounds_
private

Referenced by getTileBounds(), and PacketManager().

◆ tileIndex_

uint16_t grk::PacketManager::tileIndex_
private

Referenced by PacketManager().

◆ tileProcessor_

ITileProcessor* grk::PacketManager::tileProcessor_
private

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