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