|
Grok 20.3.2
|
Caches tile processors so that repeated decompress calls on the same codec can reuse SOT metadata, packet data, and decompressed images. More...
#include <TileCache.h>
Public Member Functions | |
| TileCache () | |
| ~TileCache () | |
| void | init (uint16_t numTiles) |
| bool | empty () const |
| void | setStrategy (uint32_t strategy) |
| uint32_t | getStrategy () const |
| void | setMaxActiveTiles (uint16_t maxActive) |
| Set the maximum number of tiles that can hold decompressed data simultaneously. | |
| uint16_t | getMaxActiveTiles () const |
| void | setTruncated (void) |
| void | setDirty (bool dirty) |
| void | setDirty (uint16_t tileIndex, bool dirty) |
| bool | isDirty (uint16_t tileIndex) |
| TileCacheEntry * | put (uint16_t tile_index, ITileProcessor *processor) |
| TileCacheEntry * | get (uint16_t tile_index) |
| void | release (uint16_t tileIndex) |
| void | releaseForSwath (uint16_t tileIndex) |
| Release tile data unconditionally (swath consumer path). | |
| void | resetSOTParsing () |
| bool | allSlatedSOTMarkersParsed (const std::set< uint16_t > &tilesSlatedForDecompression) |
| bool | setProgressionState (grk_progression_state state) |
| grk_progression_state | getProgressionState (uint16_t tileIndex) |
Private Member Functions | |
| void | promoteLRU (uint16_t tileIndex) |
| Move a tile to the front of the LRU list (most recently used). | |
| void | evictLRU () |
| Evict least-recently-used tiles when over the active limit. | |
Private Attributes | |
| std::vector< TileCacheEntry * > | cache_ |
| std::list< uint16_t > | lruList_ |
| uint32_t | strategy_ |
| bool | initialized_ |
| uint16_t | maxActiveTiles_ |
Caches tile processors so that repeated decompress calls on the same codec can reuse SOT metadata, packet data, and decompressed images.
Called before a sequential codestream re-walk. Resets numSOTsParsed_, tilePartCounter_, and tilePartSeq_ so that the SOT handler can re-populate them. Tiles that already have a decompressed image or are best-effort are skipped — their cached state is preserved.
|
inline |
References GRK_TILE_CACHE_NONE, initialized_, maxActiveTiles_, and strategy_.
|
inline |
References cache_.
|
inline |
|
inline |
References cache_.
|
inlineprivate |
Evict least-recently-used tiles when over the active limit.
Eviction releases the tile's decompressed data via GRK_TILE_CACHE_LRU but keeps the processor for potential re-decompression.
References cache_, GRK_TILE_CACHE_LRU, lruList_, and maxActiveTiles_.
Referenced by put().
|
inline |
References cache_, and promoteLRU().
Referenced by getProgressionState(), grk::TLMMarker::seekNextSlated(), and setProgressionState().
|
inline |
References maxActiveTiles_.
|
inline |
References get().
|
inline |
References strategy_.
|
inline |
References cache_, and initialized_.
|
inline |
References cache_.
|
inlineprivate |
Move a tile to the front of the LRU list (most recently used).
References lruList_, and maxActiveTiles_.
|
inline |
References cache_, evictLRU(), grk::grklog, and promoteLRU().
|
inline |
Release tile data unconditionally (swath consumer path).
Called by TileCompletion when the swath consumer has moved past a tile row. Frees both image_ and tile_ regardless of cache strategy, since the consumer has explicitly acknowledged it no longer needs the data.
References cache_.
|
inline |
References cache_.
|
inline |
References cache_.
|
inline |
References cache_.
|
inline |
Set the maximum number of tiles that can hold decompressed data simultaneously.
0 means no limit (all tiles stay active).
References maxActiveTiles_.
|
inline |
References get().
|
inline |
References strategy_.
|
inline |
References cache_.
|
private |
Referenced by empty(), evictLRU(), get(), init(), isDirty(), put(), release(), releaseForSwath(), resetSOTParsing(), setDirty(), setDirty(), setTruncated(), and ~TileCache().
|
private |
Referenced by init(), and TileCache().
|
private |
Referenced by evictLRU(), and promoteLRU().
|
private |
Referenced by evictLRU(), getMaxActiveTiles(), promoteLRU(), setMaxActiveTiles(), and TileCache().
|
private |
Referenced by getStrategy(), release(), setStrategy(), and TileCache().