Grok  7.6.0
Quantizer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2020 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 
24 #include <cstdint>
25 
26 
27 namespace grk {
28 
29 
30 struct CodeStream;
31 
35 struct grk_stepsize {
37  uint8_t expn;
39  uint16_t mant;
40 };
41 
42 
43 
44 struct CodeStream;
46 struct BufferedStream;
47 struct grk_band;
48 struct TileCodingParams;
49 struct TileProcessor;
50 
51 
52 class Quantizer {
53 public:
54 
56  grk_band *band,
57  uint32_t resno,
58  uint8_t bandno,
60  uint32_t image_precision,
61  bool encode);
62 
63 
64  uint32_t get_SQcd_SQcc_size(CodeStream *codeStream, uint32_t comp_no);
65  bool compare_SQcd_SQcc(CodeStream *codeStream,
66  uint32_t first_comp_no, uint32_t second_comp_no);
67  bool read_SQcd_SQcc(CodeStream *codeStream, TileProcessor *tileProcessor, bool fromQCC, uint32_t comp_no,
68  uint8_t *p_header_data, uint16_t *header_size);
69  bool write_SQcd_SQcc(CodeStream *codeStream,uint32_t comp_no, BufferedStream *stream);
71 };
72 
73 }
grk::grk_band
Definition: TileProcessor.h:143
grk::Quantizer::get_SQcd_SQcc_size
uint32_t get_SQcd_SQcc_size(CodeStream *codeStream, uint32_t comp_no)
grk::TileProcessor
Tile coder/decoder.
Definition: TileProcessor.h:211
grk::TileCodingParams
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition: CodingParams.h:117
grk::Quantizer::write_SQcd_SQcc
bool write_SQcd_SQcc(CodeStream *codeStream, uint32_t comp_no, BufferedStream *stream)
grk::BufferedStream
Byte input-output stream.
Definition: BufferedStream.h:38
grk::TileComponentCodingParams
Tile-component coding parameters.
Definition: CodingParams.h:49
grk::Quantizer::compare_SQcd_SQcc
bool compare_SQcd_SQcc(CodeStream *codeStream, uint32_t first_comp_no, uint32_t second_comp_no)
grk::grk_stepsize::mant
uint16_t mant
mantissa -11 bits
Definition: Quantizer.h:39
grk::grk_stepsize
Quantization stepsize.
Definition: Quantizer.h:35
grk::Quantizer::setBandStepSizeAndBps
void setBandStepSizeAndBps(TileCodingParams *tcp, grk_band *band, uint32_t resno, uint8_t bandno, TileComponentCodingParams *tccp, uint32_t image_precision, bool encode)
grk::CodeStream
Definition: CodeStream.h:130
grk
Copyright (C) 2016-2020 Grok Image Compression Inc.
Definition: BitIO.h:27
grk::Quantizer::read_SQcd_SQcc
bool read_SQcd_SQcc(CodeStream *codeStream, TileProcessor *tileProcessor, bool fromQCC, uint32_t comp_no, uint8_t *p_header_data, uint16_t *header_size)
grk::Quantizer::apply_quant
void apply_quant(TileComponentCodingParams *src, TileComponentCodingParams *dest)
grk::grk_stepsize::expn
uint8_t expn
exponent - 5 bits
Definition: Quantizer.h:37
grk::Quantizer
Definition: Quantizer.h:52