Grok 12.0.1
Quantizer.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016-2024 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 * This source code incorporates work covered by the BSD 2-clause license.
18 * Please see the LICENSE file in the root directory for details.
19 *
20 */
21
22#pragma once
23
24namespace grk
25{
37
39{
40 public:
42 virtual ~Quantizer() = default;
43 // for compress
45 // for decompress
48 bool is_signed);
49 virtual bool write(BufferedStream* stream);
50
51 protected:
54 union
55 {
58 };
61};
62
63} // namespace grk
Copyright (C) 2016-2024 Grok Image Compression Inc.
Definition ICacheable.h:20
void grk_read(const uint8_t *buffer, TYPE *value, uint32_t numBytes)
Definition BufferedStream.h:239
Definition BufferedStream.h:35
Definition Quantizer.h:39
uint32_t num_decomps
Definition Quantizer.h:59
Quantizer(bool reversible, uint8_t guard_bits)
Definition Quantizer.cpp:26
virtual void generate(uint32_t decomps, uint32_t max_bit_depth, bool color_transform, bool is_signed)
Definition Quantizer.cpp:80
virtual ~Quantizer()=default
uint8_t Sqcd
Definition Quantizer.h:53
virtual bool write(BufferedStream *stream)
Definition Quantizer.cpp:113
void pull(grk_stepsize *stepptr)
Note:
Definition Quantizer.cpp:50
uint32_t get_num_guard_bits() const
Definition Quantizer.cpp:33
uint8_t u8_SPqcd[97]
Definition Quantizer.h:56
void push(grk_stepsize *stepptr)
Definition Quantizer.cpp:68
uint16_t u16_SPqcd[97]
Definition Quantizer.h:57
bool isReversible
Definition Quantizer.h:60
Quantization stepsize.
Definition Quantizer.h:30
uint16_t mant
mantissa -11 bits
Definition Quantizer.h:35
uint8_t expn
exponent - 5 bits
Definition Quantizer.h:33
grk_stepsize()
Definition Quantizer.h:31