grk::PacketManager Class Reference

`#include <PacketManager.h>`

## Public Member Functions

| PacketManager (bool compression, GrkImage *img, CodingParams *cparams, uint16_t tilenumber, J2K_T2_MODE t2_mode, TileProcessor *tileProc)
virtual | ~PacketManager ()
PacketIter * | getPacketIter (uint32_t poc) const
void | enableTilePartGeneration (uint32_t pino, bool first_poc_tile_part, uint32_t tppos)
| Modify the packet iterator for enabling tile part generation.
IncludeTracker * | getIncludeTracker (void)
uint32_t | getNumProgressions (void)
TileProcessor * | getTileProcessor (void)
GrkImage * | getImage ()
grk_rect32 | getTileBounds (void)
CodingParams * | getCodingParams (void)
J2K_T2_MODE | getT2Mode (void)

## Static Public Member Functions

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

## Static Private Member Functions

static void | updateCompressTcpProgressions (CodingParams *p_cp, uint16_t num_comps, uint16_t tileno, grk_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, const CodingParams *p_cp, uint16_t tileno, grk_rect32 *tileBounds, uint32_t *dx_min, uint32_t *dy_min, uint64_t *precincts, uint64_t *max_precincts, uint8_t *max_res, uint32_t **precinctByComponent)
| Get the compression parameters needed to update the coding parameters and all the pocs.

## Private Attributes

GrkImage * | image
CodingParams * | cp
uint16_t | tileno
IncludeTracker * | includeTracker
PacketIter * | pi_
J2K_T2_MODE | t2Mode
TileProcessor * | tileProcessor
grk_rect32 | tileBounds_

## Constructor & Destructor Documentation

## PacketManager()

grk::PacketManager::PacketManager | ( | bool | compression,
|  | GrkImage * | img,
|  | CodingParams * | cparams,
|  | uint16_t | tilenumber,
|  | J2K_T2_MODE | t2_mode,
|  | TileProcessor * | tileProc
| ) |  |

References cp, grk::FINAL_PASS, getParams(), GRK_IS_CINEMA, GRK_J2K_MAXRLVLS, grk::grk_read(), image, includeTracker, grk::PacketIter::init(), _grk_image::numcomps, grk::TileCodingParams::numpocs, grk::IncludeTracker::numPrecinctsPerRes, pi_, grk::CodingParams::rsiz, grk::CodingParams::t_grid_height, grk::CodingParams::tcps, tileBounds_, tileno, and updateCompressTcpProgressions().

## ~PacketManager()

grk::PacketManager::~PacketManager | ( |  | ) |

virtual

References grk::PacketIter::destroy_include(), includeTracker, and pi_.

## Member Function Documentation

## enableTilePartGeneration()

void grk::PacketManager::enableTilePartGeneration | ( | uint32_t | pino,
|  | bool | first_poc_tile_part,
|  | uint32_t | tppos
| ) |  |

Modify the packet iterator for enabling tile part generation.

Parameters

  pino | packet iterator number
  first_poc_tile_part | true for first POC tile part
  tppos | The position of the tile part flag in the progression order

References enableTilePartGeneration(), grk::grk_read(), and pi_.

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

## getCodingParams()

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

References cp.

Referenced by grk::PacketIter::checkForRemainingValidProgression(), and grk::PacketIter::enableTilePartGeneration().

## getImage()

GrkImage * grk::PacketManager::getImage | ( |  | ) |

References image.

## getIncludeTracker()

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

References includeTracker.

Referenced by grk::PacketIter::destroy_include(), grk::PacketIter::get_include(), and grk::PacketIter::update_include().

## getNumProgressions()

uint32_t grk::PacketManager::getNumProgressions | ( | void |  | ) |

References cp, grk::CodingParams::tcps, and tileno.

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

## getPacketIter()

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

References grk::grk_read(), and pi_.

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

## getParams()

void grk::PacketManager::getParams | ( | const GrkImage * | image,
|  | const CodingParams * | p_cp,
|  | uint16_t | tileno,
|  | grk_rect32 * | tileBounds,
|  | uint32_t * | dx_min,
|  | uint32_t * | dy_min,
|  | uint64_t * | precincts,
|  | uint64_t * | max_precincts,
|  | uint8_t * | max_res,
|  | uint32_t ** | precinctByComponent
| ) |  |

static private

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

  p_image | the image being encoded.
  p_cp | the coding parameters.
  tileno | the tile index of the tile being encoded.
  tileBounds | tile bounds
  max_precincts | maximum number of precincts for all the bands of the tile
  max_res | maximum number of resolutions for all the poc inside the tile.
  dx_min | minimum dx of all the components of all the resolutions for the tile.
  dy_min | minimum dy of all the components of all the resolutions for the tile.
  precinctByComponent | stores log2 precinct grid dimensions by component

References _grk_image::comps, grk::floordivpow2(), GRK_J2K_MAXRLVLS, grk::grk_read(), image, _grk_image::numcomps, and tileno.

Referenced by PacketManager(), and updateCompressParams().

## getT2Mode()

J2K_T2_MODE grk::PacketManager::getT2Mode | ( | void |  | ) |

References t2Mode.

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

## getTileBounds()

grk_rect32 grk::PacketManager::getTileBounds | ( | void |  | ) |

References tileBounds_.

Referenced by grk::PacketIter::genPrecinctInfo(), grk::PacketIter::genPrecinctInfoOPT(), grk::PacketIter::genPrecinctX0Grid(), grk::PacketIter::genPrecinctY0Grid(), and grk::PacketIter::validatePrecinct().

## getTileProcessor()

TileProcessor * grk::PacketManager::getTileProcessor | ( | void |  | ) |

References tileProcessor.

Referenced by grk::PacketIter::checkForRemainingValidProgression(), grk::PacketIter::enableTilePartGeneration(), grk::PacketIter::genPrecinctInfo(), grk::PacketIter::genPrecinctInfoOPT(), grk::PacketIter::init(), grk::PacketIter::isWholeTile(), grk::PacketIter::next_pcrl(), grk::PacketIter::skipPackets(), and grk::PacketIter::validatePrecinct().

## updateCompressParams()

void grk::PacketManager::updateCompressParams | ( | const GrkImage * | p_image,
|  | CodingParams * | p_cp,
|  | uint16_t | tile_no
| ) |  |

static

Updates the compressing parameters of the codec.

Parameters

  p_image | the image being encoded.
  p_cp | the coding parameters.
  tile_no | index of the tile being encoded.

References getParams(), grk::grk_read(), image, _grk_image::numcomps, tileno, and updateCompressTcpProgressions().

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

## updateCompressTcpProgressions()

void grk::PacketManager::updateCompressTcpProgressions | ( | CodingParams * | p_cp,
|  | uint16_t | num_comps,
|  | uint16_t | tileno,
|  | grk_rect32 | tileBounds,
|  | uint64_t | max_precincts,
|  | uint8_t | max_res,
|  | uint32_t | dx_min,
|  | uint32_t | dy_min,
|  | bool | poc
| ) |  |

static private

Updates the coding parameters.

Parameters

  p_cp | the coding parameters to modify
  num_comps | the number of components
  tileno | the tile index being concerned.
  tileBounds | tile bounds
  max_precincts | the maximum number of precincts for all the bands of the tile
  max_res | the maximum number of resolutions for all the poc inside the tile.
  dx_min | the minimum dx of all the components of all the resolutions for the tile.
  dy_min | the minimum dy of all the components of all the resolutions for the tile.

References grk::grk_read(), and tileno.

Referenced by PacketManager(), and updateCompressParams().

## Member Data Documentation

## cp

CodingParams* grk::PacketManager::cp

private

Referenced by getCodingParams(), getNumProgressions(), and PacketManager().

## image

GrkImage* grk::PacketManager::image

private

Referenced by getImage(), getParams(), PacketManager(), and updateCompressParams().

## includeTracker

IncludeTracker* grk::PacketManager::includeTracker

private

Referenced by getIncludeTracker(), PacketManager(), and ~PacketManager().

## pi_

PacketIter* grk::PacketManager::pi_

private

Referenced by enableTilePartGeneration(), getPacketIter(), PacketManager(), and ~PacketManager().

## t2Mode

J2K_T2_MODE grk::PacketManager::t2Mode

private

Referenced by getT2Mode().

## tileBounds_

grk_rect32 grk::PacketManager::tileBounds_

private

Referenced by getTileBounds(), and PacketManager().

## tileno

uint16_t grk::PacketManager::tileno

private

Referenced by getNumProgressions(), getParams(), PacketManager(), updateCompressParams(), and updateCompressTcpProgressions().

## tileProcessor

TileProcessor* grk::PacketManager::tileProcessor

private

Referenced by getTileProcessor().

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

- PacketManager.h
- PacketManager.cpp