Grok 20.3.2
WaveletPoolData.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016-2026 Grok Image Compression Inc.
3 *
4 * This source code is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License, version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This source code is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Affero General Public License for more details.
12 *
13 * You should have received a copy of the GNU Affero General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18#pragma once
19
20#include <memory>
21#include <cstdint>
22#include <cstddef>
23#include "MemManager.h"
24
25namespace grk
26{
27
28uint32_t get_PLL_COLS_53();
31
40{
41public:
42 WaveletPoolData() = default;
43 ~WaveletPoolData() = default;
44
47
56 bool alloc(size_t maxDim);
57
58 uint8_t* getHoriz(size_t threadIndex) const
59 {
60 return horizData_[threadIndex].get();
61 }
62
63 uint8_t* getVert(size_t threadIndex) const
64 {
65 return vertData_[threadIndex].get();
66 }
67
68 bool isAllocated() const
69 {
70 return isAllocated_;
71 }
72
73private:
75 {
76 void operator()(uint8_t* ptr) const noexcept
77 {
79 }
80 };
81
82 using BufferPtr = std::unique_ptr<uint8_t[], AlignedDeleter>;
83 std::unique_ptr<BufferPtr[]> horizData_;
84 std::unique_ptr<BufferPtr[]> vertData_;
85 bool isAllocated_ = false;
86 size_t allocatedMaxDim_ = 0;
87};
88
89} // namespace grk
std::unique_ptr< BufferPtr[]> vertData_
Definition WaveletPoolData.h:84
bool alloc(size_t maxDim)
Allocate per-thread horiz/vert scratch buffers.
Definition WaveletPoolData.cpp:26
~WaveletPoolData()=default
size_t allocatedMaxDim_
Definition WaveletPoolData.h:86
WaveletPoolData & operator=(const WaveletPoolData &)=delete
std::unique_ptr< BufferPtr[]> horizData_
Definition WaveletPoolData.h:83
std::unique_ptr< uint8_t[], AlignedDeleter > BufferPtr
Definition WaveletPoolData.h:82
bool isAllocated() const
Definition WaveletPoolData.h:68
uint8_t * getHoriz(size_t threadIndex) const
Definition WaveletPoolData.h:58
WaveletPoolData(const WaveletPoolData &)=delete
uint8_t * getVert(size_t threadIndex) const
Definition WaveletPoolData.h:63
bool isAllocated_
Definition WaveletPoolData.h:85
WaveletPoolData()=default
ResWindow.
Definition CompressedChunkCache.h:36
uint32_t get_PLL_COLS_16_97()
uint32_t get_PLL_COLS_16_53()
uint32_t get_PLL_COLS_53()
void grk_aligned_free(void *ptr)
Definition MemManager.h:324
Definition WaveletPoolData.h:75
void operator()(uint8_t *ptr) const noexcept
Definition WaveletPoolData.h:76