Grok 15.1.0
grk::TileProcessor Struct Reference

#include <TileProcessor.h>

Public Member Functions

 TileProcessor (uint16_t index, CodeStream *codeStream, BufferedStream *stream, bool isCompressor)
 ~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)
GrkImagegetImage (void)
void release (uint32_t strategy)
void setCorruptPacket (void)
PacketTrackergetPacketTracker (void)
grk_rect32 getUnreducedTileWindow (void)
TileCodingParamsgetTileCodingParams (void)
uint8_t getMaxNumDecompressResolutions (void)
BufferedStreamgetStream (void)
uint32_t getPreCalculatedTileLen (void)
bool canPreCalculateTileLen (void)
uint16_t getIndex (void) const
void incrementIndex (void)
TilegetTile (void)
SchedulergetScheduler (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.
GrkImageheaderImage
grk_plugin_tilecurrent_plugin_tile
CodingParamscp_
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 disableRateControl)
bool layerNeedsRateControl (uint32_t layno)
bool makeSingleLosslessLayer ()
void makeLayerFinal (uint32_t layno)
bool pcrdBisectSimple (uint32_t *p_data_written, bool disableRateControl)
void makeLayerSimple (uint32_t layno, double thresh, bool finalAttempt)

Private Attributes

Tiletile
Schedulerscheduler_
uint64_t numProcessedPackets
std::atomic< uint64_t > numDecompressedPackets
uint64_t tilePartDataLength
uint16_t tileIndex_
 index of tile being currently compressed/decompressed
PacketTracker packetTracker_
BufferedStreamstream_
bool corrupt_packet_
uint32_t newTilePartProgressionPosition
 position of the tile part flag in progression order
TileCodingParamstcp_
bool truncated
GrkImageimage_
bool isCompressor_
grk_rect32 unreducedImageWindow
uint32_t preCalculatedTileLen
mctmct_

Constructor & Destructor Documentation

◆ TileProcessor()

◆ ~TileProcessor()

grk::TileProcessor::~TileProcessor ( )

Member Function Documentation

◆ cacheTilePartPackets()

◆ canPreCalculateTileLen()

bool grk::TileProcessor::canPreCalculateTileLen ( void )

◆ canWritePocMarker()

bool grk::TileProcessor::canWritePocMarker ( void )

◆ createWindowBuffers()

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

◆ dcLevelShiftCompress()

bool grk::TileProcessor::dcLevelShiftCompress ( )
private

References headerImage, needsMctDecompress(), tcp_, and tile.

Referenced by doCompress().

◆ deallocBuffers()

void grk::TileProcessor::deallocBuffers ( )

References tile.

Referenced by decompressT2T1().

◆ decompressT2T1()

◆ doCompress()

◆ dwt_encode()

bool grk::TileProcessor::dwt_encode ( )
private

References grk::WaveletFwdImpl::compress(), tcp_, and tile.

Referenced by doCompress().

◆ encodeT2()

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

◆ generateImage()

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

◆ getImage()

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

References image_.

◆ getIndex()

◆ getMaxNumDecompressResolutions()

uint8_t grk::TileProcessor::getMaxNumDecompressResolutions ( void )

References cp_, tile, and tileIndex_.

◆ getNumDecompressedPackets()

uint64_t grk::TileProcessor::getNumDecompressedPackets ( void )

References numDecompressedPackets.

Referenced by decompressT2T1().

◆ getNumProcessedPackets()

uint64_t grk::TileProcessor::getNumProcessedPackets ( void )

References numProcessedPackets.

◆ getPacketTracker()

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

References packetTracker_.

◆ getPreCalculatedTileLen()

uint32_t grk::TileProcessor::getPreCalculatedTileLen ( void )

◆ getScheduler()

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

References scheduler_.

◆ getStream()

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

References stream_.

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

◆ getTile()

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

◆ getTileCodingParams()

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

References cp_, and tileIndex_.

Referenced by decompressT2T1().

◆ getTilePartDataLength()

uint64_t grk::TileProcessor::getTilePartDataLength ( void )

References tilePartDataLength.

◆ getUnreducedTileWindow()

grk_rect32 grk::TileProcessor::getUnreducedTileWindow ( void )

References tile, and unreducedImageWindow.

◆ incNumDecompressedPackets()

void grk::TileProcessor::incNumDecompressedPackets ( void )

◆ incNumProcessedPackets() [1/2]

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

References numProcessedPackets.

◆ incNumProcessedPackets() [2/2]

void grk::TileProcessor::incNumProcessedPackets ( void )

References numProcessedPackets.

◆ incrementIndex()

void grk::TileProcessor::incrementIndex ( void )

◆ ingestImage()

void grk::TileProcessor::ingestImage ( )

References grk::ceildiv(), headerImage, and tile.

Referenced by preCompressTile().

◆ ingestUncompressedData()

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

◆ init()

◆ isCompressor()

bool grk::TileProcessor::isCompressor ( void )

◆ isWholeTileDecompress()

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

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

Parameters
compnoComponent number
Returns
true if the tile component should be fully decompressed

References tile.

Referenced by decompressT2T1().

◆ layerNeedsRateControl()

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

◆ makeLayerFinal()

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

◆ makeLayerSimple()

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

◆ makeSingleLosslessLayer()

bool grk::TileProcessor::makeSingleLosslessLayer ( )
private

◆ mct_encode()

bool grk::TileProcessor::mct_encode ( )
private

References grk::mct::compress_custom(), headerImage, mct_, tcp_, and tile.

Referenced by doCompress().

◆ mctDecompress()

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

◆ needsMctDecompress() [1/2]

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

References needsMctDecompress().

◆ needsMctDecompress() [2/2]

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

◆ needsRateControl()

bool grk::TileProcessor::needsRateControl ( )

◆ pcrdBisectSimple()

◆ preCompressTile()

bool grk::TileProcessor::preCompressTile ( void )

◆ rateAllocate()

bool grk::TileProcessor::rateAllocate ( uint32_t * allPacketBytes,
bool disableRateControl )
private

References pcrdBisectSimple().

Referenced by doCompress().

◆ release()

void grk::TileProcessor::release ( uint32_t strategy)

◆ setCorruptPacket()

void grk::TileProcessor::setCorruptPacket ( void )

◆ setTilePartDataLength()

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

◆ subtractMarkerSegmentLength()

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

◆ t1_encode()

void grk::TileProcessor::t1_encode ( )
private

◆ writeTilePartT2()

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

Member Data Documentation

◆ corrupt_packet_

bool grk::TileProcessor::corrupt_packet_
private

Referenced by TileProcessor().

◆ cp_

◆ current_plugin_tile

◆ 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(), TileProcessor(), and grk::CodeStreamCompress::writeTileParts().

◆ headerImage

◆ image_

GrkImage* grk::TileProcessor::image_
private

◆ isCompressor_

bool grk::TileProcessor::isCompressor_
private

◆ mct_

mct* grk::TileProcessor::mct_
private

◆ newTilePartProgressionPosition

uint32_t grk::TileProcessor::newTilePartProgressionPosition
private

position of the tile part flag in progression order

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

◆ numDecompressedPackets

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

◆ numProcessedPackets

uint64_t grk::TileProcessor::numProcessedPackets
private

◆ packetLengthCache

PLCache grk::TileProcessor::packetLengthCache

◆ 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(), TileProcessor(), and grk::CodeStreamCompress::writeTileParts().

◆ preCalculatedTileLen

uint32_t grk::TileProcessor::preCalculatedTileLen
private

◆ scheduler_

Scheduler* grk::TileProcessor::scheduler_
private

◆ stream_

◆ tcp_

◆ tile

◆ tileIndex_

◆ 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(), TileProcessor(), grk::SOTMarker::write(), grk::CodeStreamCompress::writeTilePart(), grk::CodeStreamCompress::writeTileParts(), and writeTilePartT2().

◆ tilePartDataLength

uint64_t grk::TileProcessor::tilePartDataLength
private

◆ truncated

bool grk::TileProcessor::truncated
private

◆ unreducedImageWindow

grk_rect32 grk::TileProcessor::unreducedImageWindow
private

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