Grok 20.3.2
grk::WaveletPoolData Class Reference

Per-image pool of per-thread scratch buffers for the 5/3 wavelet. More...

#include <WaveletPoolData.h>

Classes

struct  AlignedDeleter

Public Member Functions

 WaveletPoolData ()=default
 ~WaveletPoolData ()=default
 WaveletPoolData (const WaveletPoolData &)=delete
WaveletPoolDataoperator= (const WaveletPoolData &)=delete
bool alloc (size_t maxDim)
 Allocate per-thread horiz/vert scratch buffers.
uint8_t * getHoriz (size_t threadIndex) const
uint8_t * getVert (size_t threadIndex) const
bool isAllocated () const

Private Types

using BufferPtr = std::unique_ptr<uint8_t[], AlignedDeleter>

Private Attributes

std::unique_ptr< BufferPtr[]> horizData_
std::unique_ptr< BufferPtr[]> vertData_
bool isAllocated_ = false
size_t allocatedMaxDim_ = 0

Detailed Description

Per-image pool of per-thread scratch buffers for the 5/3 wavelet.

Replaces the former static pool in WaveletReverse so that multiple images can decompress concurrently without sharing scratch memory.

Member Typedef Documentation

◆ BufferPtr

using grk::WaveletPoolData::BufferPtr = std::unique_ptr<uint8_t[], AlignedDeleter>
private

Constructor & Destructor Documentation

◆ WaveletPoolData() [1/2]

grk::WaveletPoolData::WaveletPoolData ( )
default

Referenced by operator=(), and WaveletPoolData().

◆ ~WaveletPoolData()

grk::WaveletPoolData::~WaveletPoolData ( )
default

◆ WaveletPoolData() [2/2]

grk::WaveletPoolData::WaveletPoolData ( const WaveletPoolData & )
delete

References WaveletPoolData().

Member Function Documentation

◆ alloc()

bool grk::WaveletPoolData::alloc ( size_t maxDim)

Allocate per-thread horiz/vert scratch buffers.

If already allocated with sufficient size, this is a no-op.

Parameters
maxDimmaximum image dimension (width or height)
Returns
true on success

References allocatedMaxDim_, grk::get_PLL_COLS_53(), grk::grk_aligned_free(), grk::grk_aligned_malloc(), horizData_, isAllocated_, TFSingleton::num_threads(), and vertData_.

◆ getHoriz()

uint8_t * grk::WaveletPoolData::getHoriz ( size_t threadIndex) const
inline

References horizData_.

◆ getVert()

uint8_t * grk::WaveletPoolData::getVert ( size_t threadIndex) const
inline

References vertData_.

◆ isAllocated()

bool grk::WaveletPoolData::isAllocated ( ) const
inline

References isAllocated_.

◆ operator=()

WaveletPoolData & grk::WaveletPoolData::operator= ( const WaveletPoolData & )
delete

References WaveletPoolData().

Member Data Documentation

◆ allocatedMaxDim_

size_t grk::WaveletPoolData::allocatedMaxDim_ = 0
private

Referenced by alloc().

◆ horizData_

std::unique_ptr<BufferPtr[]> grk::WaveletPoolData::horizData_
private

Referenced by alloc(), and getHoriz().

◆ isAllocated_

bool grk::WaveletPoolData::isAllocated_ = false
private

Referenced by alloc(), and isAllocated().

◆ vertData_

std::unique_ptr<BufferPtr[]> grk::WaveletPoolData::vertData_
private

Referenced by alloc(), and getVert().


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