grk::TileProcessor Struct Reference

`#include <TileProcessor.h>`

## Public Member Functions

| TileProcessor (uint16_t index, CodeStream *codeStream, BufferedStream *stream, bool isCompressor, StripCache *stripCache)
| ~TileProcessor ()
bool | init (void)
bool | createWindowBuffers (const GrkImage *outputImage)
void | deallocBuffers ()
bool | preCompressTile (void)
bool | canWritePocMarker (void)
bool | writeTilePartT2 (uint32_t *tileBytesWritten)
bool | doCompress (void)
bool | decompressT2T1 (GrkImage *outputImage)
bool | ingestUncompressedData (uint8_t *p_src, uint64_t src_length)
bool | needsRateControl ()
void | ingestImage ()
bool | cacheTilePartPackets (CodeStreamDecompress *codeStream)
void | generateImage (GrkImage *src_image, Tile *src_tile)
GrkImage * | getImage (void)
void | release (GRK_TILE_CACHE_STRATEGY strategy)
void | setCorruptPacket (void)
PacketTracker * | getPacketTracker (void)
grk_rect32 | getUnreducedTileWindow (void)
TileCodingParams * | getTileCodingParams (void)
uint8_t | getMaxNumDecompressResolutions (void)
BufferedStream * | getStream (void)
uint32_t | getPreCalculatedTileLen (void)
bool | canPreCalculateTileLen (void)
uint16_t | getIndex (void) const
void | incrementIndex (void)
Tile * | getTile (void)
Scheduler * | getScheduler (void)
bool | isCompressor (void)
uint64_t | getTilePartDataLength (void)
bool | subtractMarkerSegmentLength (uint16_t markerLen)
bool | setTilePartDataLength (uint16_t tilePart, uint32_t tilePartLength, bool lastTilePartInCodeStream)
uint64_t | getNumProcessedPackets (void)
void | incNumProcessedPackets (void)
void | incNumProcessedPackets (uint64_t numPackets)
uint64_t | getNumDecompressedPackets (void)
void | incNumDecompressedPackets (void)

## Public Attributes

bool | first_poc_tile_part_
| Compression Only true for first POC tile part, otherwise false.
uint8_t | tilePartCounter_
| Compressing Only index of tile part being currently coding.
uint32_t | pino
| Compression Only Current packet iterator number.
GrkImage * | headerImage
grk_plugin_tile * | current_plugin_tile
CodingParams * | cp_
PLCache | packetLengthCache

## Private Member Functions

bool | isWholeTileDecompress (uint16_t compno)
| Returns whether a tile component should be fully decompressed, taking into account win_* members.
bool | needsMctDecompress (uint16_t compno)
bool | needsMctDecompress (void)
bool | mctDecompress (FlowComponent *flow)
bool | dcLevelShiftCompress ()
bool | mct_encode ()
bool | dwt_encode ()
void | t1_encode ()
bool | encodeT2 (uint32_t *packet_bytes_written)
bool | rateAllocate (uint32_t *allPacketBytes)
bool | layerNeedsRateControl (uint32_t layno)
bool | makeSingleLosslessLayer ()
void | makeLayerFinal (uint32_t layno)
bool | pcrdBisectSimple (uint32_t *p_data_written)
void | makeLayerSimple (uint32_t layno, double thresh, bool finalAttempt)
bool | pcrdBisectFeasible (uint32_t *p_data_written)
void | makeLayerFeasible (uint32_t layno, uint16_t thresh, bool finalAttempt)

## Private Attributes

Tile * | tile
Scheduler * | scheduler_
uint64_t | numProcessedPackets
std::atomic< uint64_t > | numDecompressedPackets
uint64_t | tilePartDataLength
uint16_t | tileIndex_
| index of tile being currently compressed/decompressed
PacketTracker | packetTracker_
BufferedStream * | stream_
bool | corrupt_packet_
uint32_t | newTilePartProgressionPosition
| position of the tile part flag in progression order
TileCodingParams * | tcp_
bool | truncated
GrkImage * | image_
bool | isCompressor_
grk_rect32 | unreducedImageWindow
uint32_t | preCalculatedTileLen
mct * | mct_

## Constructor & Destructor Documentation

## TileProcessor()

grk::TileProcessor::TileProcessor | ( | uint16_t | index,
|  | CodeStream * | codeStream,
|  | BufferedStream * | stream,
|  | bool | isCompressor,
|  | StripCache * | stripCache
| ) |  |

explicit

## ~TileProcessor()

grk::TileProcessor::~TileProcessor | ( |  | ) |

References GRK_TILE_CACHE_NONE, mct_, release(), and scheduler_.

## Member Function Documentation

## cacheTilePartPackets()

bool grk::TileProcessor::cacheTilePartPackets | ( | CodeStreamDecompress * | codeStream | ) |

References grk::TileLengthMarkers::addTileMarkerInfo(), grk::DECOMPRESS_STATE_NO_EOC, grk::DECOMPRESS_STATE_TPH_SOT, grk::CodeStreamDecompress::get_current_decode_tcp(), grk::CodeStreamDecompress::getCodeStreamInfo(), grk::CodeStreamDecompress::getDecompressorState(), grk::BufferedStream::getZeroCopyPtr(), grk::GRK_ERROR(), grk::grk_read(), grk::GRK_WARN(), grk::J2K_MS_SOD, grk::MARKER_BYTES, grk::BufferedStream::numBytesLeft(), grk::BufferedStream::read(), grk::DecompressorState::setState(), stream_, grk::BufferedStream::supportsZeroCopy(), grk::BufferedStream::tell(), tileIndex_, tilePartDataLength, and truncated.

Referenced by grk::CodeStreamDecompress::parseTileParts().

## canPreCalculateTileLen()

bool grk::TileProcessor::canPreCalculateTileLen | ( | void |  | ) |

References grk::CodingParams::coding_params_, cp_, grk::EncodingParams::enableTilePartGeneration_, grk::CodingParams::enc_, grk::CodingParams::tcps, and tileIndex_.

Referenced by doCompress(), and grk::CodeStreamCompress::writeTilePart().

## canWritePocMarker()

bool grk::TileProcessor::canWritePocMarker | ( | void |  | ) |

References cp_, GRK_IS_CINEMA, grk::grk_read(), grk::TileCodingParams::hasPoc(), grk::CodingParams::rsiz, grk::CodingParams::tcps, tileIndex_, and tilePartCounter_.

Referenced by doCompress(), and grk::CodeStreamCompress::writeTilePart().

## createWindowBuffers()

bool grk::TileProcessor::createWindowBuffers | ( | const GrkImage * | outputImage | ) |

References _grk_image::comps, grk::Tile::comps, grk::grk_read(), headerImage, isCompressor_, grk::Tile::numcomps_, grk::grk_rect< T >::scaleDownCeil(), tile, and unreducedImageWindow.

Referenced by decompressT2T1(), and preCompressTile().

## dcLevelShiftCompress()

bool grk::TileProcessor::dcLevelShiftCompress | ( |  | ) |

private

References _grk_image::comps, grk::Tile::comps, grk::TileComponentCodingParams::dc_level_shift_, grk::grk_read(), headerImage, needsMctDecompress(), grk::Tile::numcomps_, grk::TileCodingParams::tccps, tcp_, and tile.

Referenced by doCompress().

## deallocBuffers()

void grk::TileProcessor::deallocBuffers | ( |  | ) |

References grk::Tile::comps, grk::TileComponent::dealloc(), grk::grk_read(), grk::Tile::numcomps_, and tile.

Referenced by decompressT2T1().

## decompressT2T1()

bool grk::TileProcessor::decompressT2T1 | ( | GrkImage * | outputImage | ) |

References grk::TileComponent::allocRegionWindow(), _grk_image::comps, grk::Tile::comps, cp_, createWindowBuffers(), current_plugin_tile, deallocBuffers(), grk::mct::decompress_dc_shift_irrev(), grk::mct::decompress_dc_shift_rev(), _grk_plugin_tile::decompress_flags, generateImage(), ExecSingleton::get(), grk::Scheduler::getCodecFlow(), grk::ImageComponentFlow::getFinalFlowT1(), grk::Scheduler::getImageComponentFlow(), getIndex(), getNumDecompressedPackets(), grk::Scheduler::getPrePostProc(), getTile(), getTileCodingParams(), GRK_DECODE_POST_T1, GRK_DECODE_T1, GRK_DECODE_T2, grk::GRK_ERROR(), grk::grk_read(), grk::GRK_WARN(), headerImage, isWholeTileDecompress(), grk::TileCodingParams::mct, mct_, mctDecompress(), needsMctDecompress(), _grk_image::numcomps, grk::Tile::numcomps_, grk::Resolution::parserMap_, _grk_image_comp::prec, FlowComponent::precede(), grk::ParserMap::precinctParsers_, grk::TileComponent::resolutions_, grk::Scheduler::run(), grk::Scheduler::schedule(), scheduler_, grk::TileCodingParams::tccps, tcp_, tile, tileIndex_, truncated, and grk::CodingParams::wholeTileDecompress_.

## doCompress()

bool grk::TileProcessor::doCompress | ( | void |  | ) |

References canPreCalculateTileLen(), canWritePocMarker(), grk::PacketTracker::clear(), grk::CodingParams::coding_params_, cp_, grk::PLCache::createMarkers(), current_plugin_tile, dcLevelShiftCompress(), grk::PLCache::deleteMarkers(), dwt_encode(), grk::CodingParams::enc_, grk::PLCache::getMarkers(), grk::TileCodingParams::getNumProgressions(), grk::CodeStreamCompress::getPocSize(), grk::PLMarkerMgr::getTotalBytesWritten(), grk_plugin_get_debug_state(), GRK_PLUGIN_STATE_DEBUG, GRK_PLUGIN_STATE_MCT_ONLY, grk::grk_read(), mct_encode(), grk::Tile::numcomps_, packetLengthCache, packetTracker_, preCalculatedTileLen, rateAllocate(), grk::set_context_stream(), grk::sot_marker_segment_len_minus_tile_data_len, stream_, t1_encode(), tcp_, grk::CodingParams::tcps, tile, tileIndex_, and grk::EncodingParams::writePLT.

## dwt_encode()

bool grk::TileProcessor::dwt_encode | ( |  | ) |

private

References grk::WaveletFwdImpl::compress(), grk::Tile::comps, grk::grk_read(), grk::Tile::numcomps_, grk::TileCodingParams::tccps, tcp_, and tile.

Referenced by doCompress().

## encodeT2()

bool grk::TileProcessor::encodeT2 | ( | uint32_t * | packet_bytes_written | ) |

private

References first_poc_tile_part_, grk::Precinct::getDecompressedBlockPtr(), grk::grk_read(), newTilePartProgressionPosition, grk::TileCodingParams::numlayers, grk::TileComponent::numresolutions, pino, grk::TileComponent::resolutions_, stream_, tcp_, tileIndex_, and grk::grk_rect< T >::x0.

Referenced by writeTilePartT2().

## generateImage()

void grk::TileProcessor::generateImage | ( | GrkImage * | src_image,
|  | Tile * | src_tile
| ) |  |

References grk::GrkImage::duplicate(), grk_object_unref(), grk::grk_read(), image_, and _grk_image::obj.

Referenced by decompressT2T1().

## getImage()

GrkImage * grk::TileProcessor::getImage | ( | void |  | ) |

References image_.

Referenced by grk::CodeStreamDecompress::getImage().

## getIndex()

uint16_t grk::TileProcessor::getIndex | ( | void |  | ) | const

References tileIndex_.

Referenced by grk::PacketIter::checkForRemainingValidProgression(), decompressT2T1(), grk::PacketIter::enableTilePartGeneration(), grk::CodeStreamDecompress::findNextSOT(), grk::CodeStreamDecompress::get_current_decode_tcp(), grk::CodeStreamDecompress::nextTLM(), grk::CodeStreamDecompress::parseTileParts(), grk::PacketParser::readHeader(), setTilePartDataLength(), grk::CodeStreamCompress::writeTilePart(), and grk::CodeStreamCompress::writeTileParts().

## getMaxNumDecompressResolutions()

uint8_t grk::TileProcessor::getMaxNumDecompressResolutions | ( | void |  | ) |

References grk::CodingParams::coding_params_, cp_, grk::CodingParams::dec_, grk::grk_read(), grk::Tile::numcomps_, grk::TileComponentCodingParams::numresolutions, grk::DecodingParams::reduce_, grk::TileCodingParams::tccps, grk::CodingParams::tcps, tile, and tileIndex_.

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

## getNumDecompressedPackets()

uint64_t grk::TileProcessor::getNumDecompressedPackets | ( | void |  | ) |

References numDecompressedPackets.

Referenced by decompressT2T1().

## getNumProcessedPackets()

uint64_t grk::TileProcessor::getNumProcessedPackets | ( | void |  | ) |

References numProcessedPackets.

Referenced by grk::T2Compress::compressPacket(), and grk::T2Decompress::processPacket().

## getPacketTracker()

PacketTracker * grk::TileProcessor::getPacketTracker | ( | void |  | ) |

References packetTracker_.

Referenced by grk::T2Compress::compressPacket(), grk::T2Compress::compressPacketSimulate(), and grk::T2Compress::compressPacketsSimulate().

## getPreCalculatedTileLen()

uint32_t grk::TileProcessor::getPreCalculatedTileLen | ( | void |  | ) |

References preCalculatedTileLen.

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

## getScheduler()

Scheduler * grk::TileProcessor::getScheduler | ( | void |  | ) |

References scheduler_.

## getStream()

BufferedStream * grk::TileProcessor::getStream | ( | void |  | ) |

References stream_.

## getTile()

Tile * grk::TileProcessor::getTile | ( | void |  | ) |

References tile.

Referenced by grk::T2Compress::compressPacket(), grk::T2Compress::compressPacketSimulate(), decompressT2T1(), grk::T2Decompress::processPacket(), grk::PacketParser::readData(), grk::PacketParser::readDataFinalize(), and grk::PacketParser::readHeader().

## getTileCodingParams()

TileCodingParams * grk::TileProcessor::getTileCodingParams | ( | void |  | ) |

References cp_, grk::CodingParams::tcps, and tileIndex_.

Referenced by grk::T2Decompress::decompressPackets(), decompressT2T1(), grk::PacketIter::init(), grk::PrecinctPacketParsers::PrecinctPacketParsers(), grk::T2Decompress::processPacket(), and grk::PacketParser::readHeader().

## getTilePartDataLength()

uint64_t grk::TileProcessor::getTilePartDataLength | ( | void |  | ) |

References tilePartDataLength.

Referenced by grk::CodeStreamDecompress::parseTileParts().

## getUnreducedTileWindow()

grk_rect32 grk::TileProcessor::getUnreducedTileWindow | ( | void |  | ) |

References grk::grk_rect< T >::clip(), tile, and unreducedImageWindow.

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

## incNumDecompressedPackets()

void grk::TileProcessor::incNumDecompressedPackets | ( | void |  | ) |

References numDecompressedPackets.

Referenced by grk::PacketParser::readDataFinalize().

## incNumProcessedPackets() [1/2]

void grk::TileProcessor::incNumProcessedPackets | ( | uint64_t | numPackets | ) |

References grk::grk_read(), and numProcessedPackets.

## incNumProcessedPackets() [2/2]

void grk::TileProcessor::incNumProcessedPackets | ( | void |  | ) |

References numProcessedPackets.

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

## incrementIndex()

void grk::TileProcessor::incrementIndex | ( | void |  | ) |

References tileIndex_.

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

## ingestImage()

void grk::TileProcessor::ingestImage | ( |  | ) |

References _grk_image::comps, grk::Tile::comps, grk::grk_read(), headerImage, _grk_image::numcomps, tile, _grk_image::x0, and _grk_image::y0.

Referenced by preCompressTile().

## ingestUncompressedData()

bool grk::TileProcessor::ingestUncompressedData | ( | uint8_t * | p_src,
|  | uint64_t | src_length
| ) |  |

References _grk_image::comps, grk::Tile::comps, grk::grk_read(), headerImage, _grk_image::numcomps, and tile.

## init()

bool grk::TileProcessor::init | ( | void |  | ) |

References _grk_image::comps, grk::Tile::comps, cp_, current_plugin_tile, grk::CodingParams::getTileBounds(), grk::GRK_ERROR(), grk_plugin_get_debug_state(), GRK_PLUGIN_STATE_DEBUG, grk::grk_read(), grk::GRK_WARN(), headerImage, grk::PacketTracker::init(), isCompressor_, _grk_image::numcomps, grk::Tile::numcomps_, numProcessedPackets, grk::TileComponent::numresolutions, packetTracker_, grk::TileComponent::resolutions_, grk::CodingParams::t_grid_width, grk::CodingParams::tcps, tile, grk::tile_equals(), tileIndex_, grk::grk_rect< T >::x0, grk::grk_rect< T >::x1, grk::grk_rect< T >::y0, and grk::grk_rect< T >::y1.

Referenced by grk::CodeStreamDecompress::parseTileParts(), and preCompressTile().

## isCompressor()

bool grk::TileProcessor::isCompressor | ( | void |  | ) |

References isCompressor_.

Referenced by grk::TileComponent::init(), and grk::Resolution::init().

## isWholeTileDecompress()

bool grk::TileProcessor::isWholeTileDecompress | ( | uint16_t | compno | ) |

private

Returns whether a tile component should be fully decompressed, taking into account win_* members.

Parameters

  compno | Component number

Returns
  true if the tile component should be fully decompressed

References grk::TileComponentWindowBase< T >::bounds(), grk::Tile::comps, grk::TileComponent::getWindow(), grk::grk_read(), grk::grk_rect< T >::intersection(), grk::shift, and tile.

Referenced by decompressT2T1().

## layerNeedsRateControl()

bool grk::TileProcessor::layerNeedsRateControl | ( | uint32_t | layno | ) |

private

References grk::CodingParams::coding_params_, cp_, grk::TileCodingParams::distortion, grk::CodingParams::enc_, grk::grk_read(), grk::TileCodingParams::rates, and tcp_.

Referenced by makeSingleLosslessLayer(), needsRateControl(), pcrdBisectFeasible(), and pcrdBisectSimple().

## makeLayerFeasible()

void grk::TileProcessor::makeLayerFeasible | ( | uint32_t | layno,
|  | uint16_t | thresh,
|  | bool | finalAttempt
| ) |  |

private

References grk::Tile::comps, grk::grk_read(), grk::Tile::layerDistoration, grk::Tile::numcomps_, grk::TileComponent::resolutions_, tile, and grk::Resolution::tileBand.

Referenced by pcrdBisectFeasible().

## makeLayerFinal()

void grk::TileProcessor::makeLayerFinal | ( | uint32_t | layno | ) |

private

References grk::Tile::comps, grk::grk_read(), grk::Tile::layerDistoration, grk::Tile::numcomps_, grk::prepareBlockForFirstLayer(), grk::TileComponent::resolutions_, tile, and grk::Resolution::tileBand.

Referenced by makeSingleLosslessLayer(), pcrdBisectFeasible(), and pcrdBisectSimple().

## makeLayerSimple()

void grk::TileProcessor::makeLayerSimple | ( | uint32_t | layno,
|  | double | thresh,
|  | bool | finalAttempt
| ) |  |

private

References grk::Tile::comps, grk::grk_read(), grk::Tile::layerDistoration, grk::Tile::numcomps_, grk::prepareBlockForFirstLayer(), grk::CodePass::rate, grk::TileComponent::resolutions_, tile, and grk::Resolution::tileBand.

Referenced by pcrdBisectSimple().

## makeSingleLosslessLayer()

bool grk::TileProcessor::makeSingleLosslessLayer | ( |  | ) |

private

References layerNeedsRateControl(), makeLayerFinal(), grk::TileCodingParams::numlayers, and tcp_.

Referenced by pcrdBisectFeasible(), and pcrdBisectSimple().

## mct_encode()

bool grk::TileProcessor::mct_encode | ( |  | ) |

private

References grk::mct::compress_custom(), grk::mct::compress_irrev(), grk::mct::compress_rev(), _grk_image::comps, grk::Tile::comps, grk::TileComponentWindow< T >::getResWindowBufferHighestSimple(), grk::TileComponent::getWindow(), grk::grk_read(), headerImage, grk::TileCodingParams::mct, mct_, grk::TileCodingParams::mct_coding_matrix_, grk::Tile::numcomps_, grk::TileComponentCodingParams::qmfbid, _grk_image_comp::sgnd, grk::TileComponentWindow< T >::stridedArea(), grk::TileCodingParams::tccps, tcp_, and tile.

Referenced by doCompress().

## mctDecompress()

bool grk::TileProcessor::mctDecompress | ( | FlowComponent * | flow | ) |

private

References _grk_image::comps, grk::Tile::comps, grk::mct::decompress_custom(), grk::mct::decompress_irrev(), grk::mct::decompress_rev(), grk::TileComponentWindow< T >::getResWindowBufferHighestSimple(), grk::TileComponent::getWindow(), grk::grk_read(), headerImage, grk::TileCodingParams::mct, mct_, grk::TileCodingParams::mct_decoding_matrix_, grk::Tile::numcomps_, grk::TileComponentCodingParams::qmfbid, _grk_image_comp::sgnd, grk::TileComponentWindow< T >::stridedArea(), grk::TileCodingParams::tccps, tcp_, and tile.

Referenced by decompressT2T1().

## needsMctDecompress() [1/2]

bool grk::TileProcessor::needsMctDecompress | ( | uint16_t | compno | ) |

private

References needsMctDecompress().

## needsMctDecompress() [2/2]

bool grk::TileProcessor::needsMctDecompress | ( | void |  | ) |

private

References grk::GrkImage::componentsEqual(), grk::GRK_WARN(), headerImage, grk::TileCodingParams::mct, grk::TileCodingParams::mct_decoding_matrix_, grk::Tile::numcomps_, tcp_, and tile.

Referenced by dcLevelShiftCompress(), decompressT2T1(), and needsMctDecompress().

## needsRateControl()

bool grk::TileProcessor::needsRateControl | ( |  | ) |

References grk::grk_read(), layerNeedsRateControl(), grk::TileCodingParams::numlayers, and tcp_.

Referenced by t1_encode().

## pcrdBisectFeasible()

bool grk::TileProcessor::pcrdBisectFeasible | ( | uint32_t * | p_data_written | ) |

private

References grk::EncodingParams::allocationByFixedQuality_, grk::grk_rect< T >::area(), grk::CodingParams::coding_params_, grk::compress_synch_with_plugin(), _grk_image::comps, grk::Tile::comps, grk::RateControl::convexHull(), cp_, grk::Tile::distortion, grk::CodingParams::enc_, grk::PLCache::getMarkers(), grk_plugin_get_debug_state(), GRK_PLUGIN_STATE_PRE_TR1, grk::grk_read(), headerImage, grk::Tile::layerDistoration, layerNeedsRateControl(), makeLayerFeasible(), makeLayerFinal(), makeSingleLosslessLayer(), grk::maxCompressLayersGRK, newTilePartProgressionPosition, grk::Tile::numcomps_, grk::TileCodingParams::numlayers, packetLengthCache, _grk_image_comp::prec, grk::TileComponent::resolutions_, tcp_, tile, grk::Resolution::tileBand, and tileIndex_.

Referenced by rateAllocate().

## pcrdBisectSimple()

bool grk::TileProcessor::pcrdBisectSimple | ( | uint32_t * | p_data_written | ) |

private

References grk::EncodingParams::allocationByFixedQuality_, grk::grk_rect< T >::area(), grk::CodingParams::coding_params_, grk::compress_synch_with_plugin(), _grk_image::comps, grk::Tile::comps, cp_, grk::TileCodingParams::distortion, grk::Tile::distortion, grk::CodingParams::enc_, grk::PLCache::getMarkers(), grk_plugin_get_debug_state(), GRK_PLUGIN_STATE_PRE_TR1, grk::grk_read(), headerImage, grk::Tile::layerDistoration, layerNeedsRateControl(), makeLayerFinal(), makeLayerSimple(), makeSingleLosslessLayer(), grk::maxCompressLayersGRK, newTilePartProgressionPosition, grk::Tile::numcomps_, grk::TileCodingParams::numlayers, packetLengthCache, _grk_image_comp::prec, grk::TileCodingParams::rates, grk::TileComponent::resolutions_, tcp_, tile, grk::Resolution::tileBand, and tileIndex_.

Referenced by rateAllocate().

## preCompressTile()

bool grk::TileProcessor::preCompressTile | ( | void |  | ) |

References _grk_image::comps, grk::Tile::comps, cp_, createWindowBuffers(), first_poc_tile_part_, grk::GRK_ERROR(), grk::grk_read(), headerImage, ingestImage(), init(), _grk_image::numcomps, grk::CodingParams::t_grid_height, grk::CodingParams::t_grid_width, tile, and tilePartCounter_.

## rateAllocate()

bool grk::TileProcessor::rateAllocate | ( | uint32_t * | allPacketBytes | ) |

private

References grk::CodingParams::coding_params_, cp_, grk::CodingParams::enc_, grk::grk_read(), pcrdBisectFeasible(), pcrdBisectSimple(), and grk::EncodingParams::rateControlAlgorithm.

Referenced by doCompress().

## release()

void grk::TileProcessor::release | ( | GRK_TILE_CACHE_STRATEGY | strategy | ) |

References grk_object_unref(), grk::grk_read(), GRK_TILE_CACHE_NONE, image_, _grk_image::obj, and tile.

Referenced by ~TileProcessor().

## setCorruptPacket()

void grk::TileProcessor::setCorruptPacket | ( | void |  | ) |

## setTilePartDataLength()

bool grk::TileProcessor::setTilePartDataLength | ( | uint16_t | tilePart,
|  | uint32_t | tilePartLength,
|  | bool | lastTilePartInCodeStream
| ) |  |

References getIndex(), grk::GRK_ERROR(), grk::grk_read(), grk::GRK_WARN(), grk::BufferedStream::numBytesLeft(), grk::sot_marker_segment_len_minus_tile_data_len, stream_, and tilePartDataLength.

Referenced by grk::SOTMarker::read().

## subtractMarkerSegmentLength()

bool grk::TileProcessor::subtractMarkerSegmentLength | ( | uint16_t | markerLen | ) |

References grk::GRK_ERROR(), grk::grk_read(), grk::MARKER_LENGTH_BYTES, and tilePartDataLength.

Referenced by grk::CodeStreamDecompress::readCurrentMarkerBody().

## t1_encode()

void grk::TileProcessor::t1_encode | ( |  | ) |

private

References grk::mct::get_norms_irrev(), grk::mct::get_norms_rev(), grk::grk_read(), headerImage, needsRateControl(), _grk_image::numcomps, grk::Scheduler::schedule(), scheduler_, tcp_, and tile.

Referenced by doCompress().

## writeTilePartT2()

bool grk::TileProcessor::writeTilePartT2 | ( | uint32_t * | tileBytesWritten | ) |

References encodeT2(), grk::PLCache::getMarkers(), grk::PLMarkerMgr::getTotalBytesWritten(), grk::grk_read(), grk::J2K_MS_SOD, packetLengthCache, stream_, tilePartCounter_, grk::PLMarkerMgr::write(), and grk::BufferedStream::writeShort().

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

## Member Data Documentation

## corrupt_packet_

bool grk::TileProcessor::corrupt_packet_

private

## cp_

CodingParams* grk::TileProcessor::cp_

Referenced by canPreCalculateTileLen(), canWritePocMarker(), grk::T2Compress::compressPackets(), grk::T2Compress::compressPacketsSimulate(), grk::T2Decompress::decompressPackets(), decompressT2T1(), doCompress(), getMaxNumDecompressResolutions(), getTileCodingParams(), grk::TileComponent::init(), init(), grk::PacketIter::isWholeTile(), layerNeedsRateControl(), pcrdBisectFeasible(), pcrdBisectSimple(), preCompressTile(), rateAllocate(), grk::PacketParser::readData(), and grk::PacketParser::readHeader().

## current_plugin_tile

grk_plugin_tile* grk::TileProcessor::current_plugin_tile

Referenced by decompressT2T1(), doCompress(), grk::CodeStreamDecompress::findNextSOT(), grk::Resolution::init(), and init().

## first_poc_tile_part_

bool grk::TileProcessor::first_poc_tile_part_

Compression Only true for first POC tile part, otherwise false.

Referenced by encodeT2(), preCompressTile(), and grk::CodeStreamCompress::writeTileParts().

## headerImage

GrkImage* grk::TileProcessor::headerImage

Referenced by grk::T2Compress::compressPackets(), grk::T2Compress::compressPacketsSimulate(), createWindowBuffers(), dcLevelShiftCompress(), grk::T2Decompress::decompressPackets(), decompressT2T1(), ingestImage(), ingestUncompressedData(), init(), mct_encode(), mctDecompress(), needsMctDecompress(), pcrdBisectFeasible(), pcrdBisectSimple(), preCompressTile(), and t1_encode().

## image_

GrkImage* grk::TileProcessor::image_

private

Referenced by generateImage(), getImage(), and release().

## isCompressor_

bool grk::TileProcessor::isCompressor_

private

Referenced by createWindowBuffers(), init(), and isCompressor().

## mct_

mct* grk::TileProcessor::mct_

private

Referenced by decompressT2T1(), mct_encode(), mctDecompress(), and ~TileProcessor().

## newTilePartProgressionPosition

uint32_t grk::TileProcessor::newTilePartProgressionPosition

private

position of the tile part flag in progression order

Referenced by encodeT2(), pcrdBisectFeasible(), and pcrdBisectSimple().

## numDecompressedPackets

std::atomic<uint64_t> grk::TileProcessor::numDecompressedPackets

private

Referenced by getNumDecompressedPackets(), and incNumDecompressedPackets().

## numProcessedPackets

uint64_t grk::TileProcessor::numProcessedPackets

private

Referenced by getNumProcessedPackets(), incNumProcessedPackets(), incNumProcessedPackets(), and init().

## packetLengthCache

PLCache grk::TileProcessor::packetLengthCache

Referenced by grk::T2Decompress::decompressPackets(), doCompress(), pcrdBisectFeasible(), pcrdBisectSimple(), grk::T2Decompress::processPacket(), grk::PacketIter::skipPackets(), and writeTilePartT2().

## packetTracker_

PacketTracker grk::TileProcessor::packetTracker_

private

Referenced by doCompress(), getPacketTracker(), and init().

## pino

uint32_t grk::TileProcessor::pino

Compression Only Current packet iterator number.

Referenced by encodeT2(), and grk::CodeStreamCompress::writeTileParts().

## preCalculatedTileLen

uint32_t grk::TileProcessor::preCalculatedTileLen

private

Referenced by doCompress(), and getPreCalculatedTileLen().

## scheduler_

Scheduler* grk::TileProcessor::scheduler_

private

Referenced by decompressT2T1(), getScheduler(), t1_encode(), and ~TileProcessor().

## stream_

BufferedStream* grk::TileProcessor::stream_

private

Referenced by cacheTilePartPackets(), doCompress(), encodeT2(), getStream(), setTilePartDataLength(), and writeTilePartT2().

## tcp_

TileCodingParams* grk::TileProcessor::tcp_

private

Referenced by dcLevelShiftCompress(), decompressT2T1(), doCompress(), dwt_encode(), encodeT2(), layerNeedsRateControl(), makeSingleLosslessLayer(), mct_encode(), mctDecompress(), needsMctDecompress(), needsRateControl(), pcrdBisectFeasible(), pcrdBisectSimple(), and t1_encode().

## tile

Tile* grk::TileProcessor::tile

private

Referenced by createWindowBuffers(), dcLevelShiftCompress(), deallocBuffers(), decompressT2T1(), doCompress(), dwt_encode(), getMaxNumDecompressResolutions(), getTile(), getUnreducedTileWindow(), ingestImage(), ingestUncompressedData(), init(), isWholeTileDecompress(), makeLayerFeasible(), makeLayerFinal(), makeLayerSimple(), mct_encode(), mctDecompress(), needsMctDecompress(), pcrdBisectFeasible(), pcrdBisectSimple(), preCompressTile(), release(), and t1_encode().

## tileIndex_

uint16_t grk::TileProcessor::tileIndex_

private

index of tile being currently compressed/decompressed

Referenced by cacheTilePartPackets(), canPreCalculateTileLen(), canWritePocMarker(), decompressT2T1(), doCompress(), encodeT2(), getIndex(), getMaxNumDecompressResolutions(), getTileCodingParams(), incrementIndex(), init(), pcrdBisectFeasible(), and pcrdBisectSimple().

## tilePartCounter_

uint8_t grk::TileProcessor::tilePartCounter_

Compressing Only index of tile part being currently coding.

tilePartCounter_ holds the total number of tile parts encoded thus far while the compressor is compressing the current tile part.

Referenced by canWritePocMarker(), preCompressTile(), grk::CodeStreamCompress::writeTilePart(), grk::CodeStreamCompress::writeTileParts(), and writeTilePartT2().

## tilePartDataLength

uint64_t grk::TileProcessor::tilePartDataLength

private

Referenced by cacheTilePartPackets(), getTilePartDataLength(), setTilePartDataLength(), and subtractMarkerSegmentLength().

## truncated

bool grk::TileProcessor::truncated

private

Referenced by cacheTilePartPackets(), and decompressT2T1().

## unreducedImageWindow

grk_rect32 grk::TileProcessor::unreducedImageWindow

private

Referenced by createWindowBuffers(), and getUnreducedTileWindow().

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

- TileProcessor.h
- TileProcessor.cpp