Grok 10.0.5
WaveletFwd.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016-2023 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 * This source code incorporates work covered by the BSD 2-clause license.
17 * Please see the LICENSE file in the root directory for details.
18 *
19 */
20
21#pragma once
22
23namespace grk
24{
25class dwt53
26{
27 public:
28 void encode_and_deinterleave_v(int32_t* arrayIn, int32_t* tmpIn, uint32_t height, bool even,
29 uint32_t stride_width, uint32_t cols);
30
31 void encode_and_deinterleave_h_one_row(int32_t* rowIn, int32_t* tmpIn, uint32_t width,
32 bool even);
33};
34
35class dwt97
36{
37 public:
38 void encode_and_deinterleave_v(float* arrayIn, float* tmpIn, uint32_t height, bool even,
39 uint32_t stride_width, uint32_t cols);
40
41 void encode_and_deinterleave_h_one_row(float* rowIn, float* tmpIn, uint32_t width, bool even);
42
43 private:
44 void grk_v8dwt_encode_step1(float* fw, uint32_t end, const float cst);
45 void grk_v8dwt_encode_step2(float* fl, float* fw, uint32_t end, uint32_t m, float cst);
46 void encode_step2(float* fl, float* fw, uint32_t end, uint32_t m, float c);
47
48 void encode_step1_combined(float* fw, uint32_t iters_c1, uint32_t iters_c2, const float c1,
49 const float c2);
50 void encode_1_real(float* w, int32_t dn, int32_t sn, int32_t parity);
51};
52
53class WaveletFwdImpl
54{
55 public:
56 virtual ~WaveletFwdImpl() = default;
57 bool compress(TileComponent* tile_comp, uint8_t qmfbid);
58
59 private:
60 template<typename T, typename DWT>
61 bool encode_procedure(TileComponent* tilec);
62};
63
64} // namespace grk
TileComponent * tilec
Definition BlockExec.h:30
uint8_t qmfbid
discrete wavelet transform identifier
Definition CodingParams.h:66
uint32_t w
Definition FileFormat.h:145
uint32_t parity
Definition WaveletReverse.h:124
uint32_t c
temporary buffer where bits are coded or decoded
Definition mqc.h:46
uint8_t * end
pointer to the end of the buffer
Definition mqc.h:58
Copyright (C) 2016-2023 Grok Image Compression Inc.
Definition ICacheable.h:20