Grok 20.3.2
QuantizerOJPH.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// This software is released under the 2-Clause BSD license, included
19// below.
20//
21// Copyright (c) 2019, Aous Naman
22// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
23// Copyright (c) 2019, The University of New South Wales, Australia
24//
25// Redistribution and use in source and binary forms, with or without
26// modification, are permitted provided that the following conditions are
27// met:
28//
29// 1. Redistributions of source code must retain the above copyright
30// notice, this list of conditions and the following disclaimer.
31//
32// 2. Redistributions in binary form must reproduce the above copyright
33// notice, this list of conditions and the following disclaimer in the
34// documentation and/or other materials provided with the distribution.
35//
36// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
37// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
38// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
39// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
40// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
42// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
43// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
44// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
45// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
46// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47//***************************************************************************/
48// This file is part of the OpenJPH software implementation.
49// File: ojph_expand.cpp
50// Author: Aous Naman
51// Date: 28 August 2019
52//***************************************************************************/
53
54#pragma once
55#include "Quantizer.h"
56
57namespace grk::ojph
58{
59struct QuantizerOJPH : public Quantizer
60{
61public:
62 QuantizerOJPH(bool reversible, uint8_t guard_bits);
63 void generate(uint8_t decomps, uint8_t max_bit_depth, bool color_transform,
64 bool is_signed) override;
65 bool write(t1_t2::IStreamWriter* stream) override;
66
67private:
68 uint32_t get_MAGBp() const;
69 void set_rev_quant(uint8_t bit_depth, bool is_employing_color_transform);
70 void set_irrev_quant();
72};
73
74} // namespace grk::ojph
Definition QuantizerOJPH.cpp:79
Quantizer(bool reversible, uint8_t guard_bits)
Definition Quantizer.cpp:23
void set_irrev_quant()
Definition QuantizerOJPH.cpp:213
float base_delta
Definition QuantizerOJPH.h:71
uint32_t get_MAGBp() const
Definition QuantizerOJPH.cpp:260
void set_rev_quant(uint8_t bit_depth, bool is_employing_color_transform)
Definition QuantizerOJPH.cpp:193
bool write(t1_t2::IStreamWriter *stream) override
Definition QuantizerOJPH.cpp:278
void generate(uint8_t decomps, uint8_t max_bit_depth, bool color_transform, bool is_signed) override
Definition QuantizerOJPH.cpp:178
QuantizerOJPH(bool reversible, uint8_t guard_bits)
Definition QuantizerOJPH.cpp:175
Definition IStreamWriter.h:9