Grok  10.0.3
QuantizerOpenHTJ2K.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2022 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 
58 namespace openhtj2k
59 {
61 {
62  public:
63  QuantizerOpenHTJ2K(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::IBufferedStream* 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();
72  float base_delta;
73 };
74 
75 } // namespace openhtj2k
Definition: PostT1DecompressFiltersOpenHTJ2K.h:6
Definition: IBufferedStream.h:20
Definition: Quantizer.h:39
Definition: QuantizerOpenHTJ2K.h:61
QuantizerOpenHTJ2K(bool reversible, uint8_t guard_bits)
Definition: QuantizerOpenHTJ2K.cpp:157
bool write(grk::IBufferedStream *stream) override
Definition: QuantizerOpenHTJ2K.cpp:259
float base_delta
Definition: QuantizerOpenHTJ2K.h:72
void generate(uint32_t decomps, uint32_t max_bit_depth, bool color_transform, bool is_signed) override
Definition: QuantizerOpenHTJ2K.cpp:160
void set_rev_quant(uint32_t bit_depth, bool is_employing_color_transform)
Definition: QuantizerOpenHTJ2K.cpp:175
void set_irrev_quant()
Definition: QuantizerOpenHTJ2K.cpp:195
uint32_t get_MAGBp() const
Definition: QuantizerOpenHTJ2K.cpp:240