Grok  9.7.5
BlockExec.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 #pragma once
18 #include "grk_includes.h"
19 
20 namespace grk
21 {
22 struct BlockExec
23 {
26  cblk_sty(0), qmfbid(0), x(0), y(0), k_msbs(0), R_b(0)
27  {}
28  virtual bool open(T1Interface* t1) = 0;
29  virtual ~BlockExec() = default;
31  uint8_t bandIndex;
32  uint8_t bandNumbps;
34  float stepsize;
35  uint8_t cblk_sty;
36  uint8_t qmfbid;
37  /* code block offset in buffer coordinates*/
38  uint32_t x;
39  uint32_t y;
40  // missing bit planes for all blocks in band
41  uint8_t k_msbs;
42  uint8_t R_b;
43 };
45 {
46  DecompressBlockExec() : cblk(nullptr), resno(0), roishift(0) {}
47  bool open(T1Interface* t1)
48  {
49  return t1->decompress(this);
50  }
51  void close(void) {}
53  uint8_t resno;
54  uint8_t roishift;
55 };
57 {
59  : cblk(nullptr), tile(nullptr), doRateControl(false), distortion(0), tiledp(nullptr),
60  compno(0), resno(0), precinctIndex(0), cblkno(0), inv_step_ht(0), mct_norms(nullptr),
61 #ifdef DEBUG_LOSSLESS_T1
62  unencodedData(nullptr),
63 #endif
64  mct_numcomps(0)
65  {}
66  bool open(T1Interface* t1)
67  {
68  return t1->compress(this);
69  }
70  void close(void) {}
74  double distortion;
75  int32_t* tiledp;
76  uint16_t compno;
77  uint8_t resno;
78  uint64_t precinctIndex;
79  uint64_t cblkno;
80  float inv_step_ht;
81  const double* mct_norms;
82 #ifdef DEBUG_LOSSLESS_T1
83  int32_t* unencodedData;
84 #endif
85  uint16_t mct_numcomps;
86 };
87 
88 } // namespace grk
Definition: T1Interface.h:26
virtual bool decompress(DecompressBlockExec *block)=0
virtual bool compress(CompressBlockExec *block)=0
Copyright (C) 2016-2022 Grok Image Compression Inc.
Definition: ICacheable.h:20
eBandOrientation
Definition: Subband.h:25
@ BAND_ORIENT_LL
Definition: Subband.h:26
Definition: BlockExec.h:23
uint32_t y
Definition: BlockExec.h:39
uint32_t x
Definition: BlockExec.h:38
uint8_t bandNumbps
Definition: BlockExec.h:32
uint8_t k_msbs
Definition: BlockExec.h:41
uint8_t qmfbid
Definition: BlockExec.h:36
TileComponent * tilec
Definition: BlockExec.h:30
float stepsize
Definition: BlockExec.h:34
virtual bool open(T1Interface *t1)=0
BlockExec()
Definition: BlockExec.h:24
virtual ~BlockExec()=default
uint8_t R_b
Definition: BlockExec.h:42
uint8_t cblk_sty
Definition: BlockExec.h:35
eBandOrientation bandOrientation
Definition: BlockExec.h:33
uint8_t bandIndex
Definition: BlockExec.h:31
Definition: BlockExec.h:57
Tile * tile
Definition: BlockExec.h:72
bool open(T1Interface *t1)
Definition: BlockExec.h:66
int32_t * tiledp
Definition: BlockExec.h:75
bool doRateControl
Definition: BlockExec.h:73
void close(void)
Definition: BlockExec.h:70
float inv_step_ht
Definition: BlockExec.h:80
uint16_t compno
Definition: BlockExec.h:76
double distortion
Definition: BlockExec.h:74
uint64_t cblkno
Definition: BlockExec.h:79
uint8_t resno
Definition: BlockExec.h:77
uint16_t mct_numcomps
Definition: BlockExec.h:85
uint64_t precinctIndex
Definition: BlockExec.h:78
CompressBlockExec()
Definition: BlockExec.h:58
const double * mct_norms
Definition: BlockExec.h:81
CompressCodeblock * cblk
Definition: BlockExec.h:71
Definition: Codeblock.h:123
Definition: BlockExec.h:45
uint8_t roishift
Definition: BlockExec.h:54
uint8_t resno
Definition: BlockExec.h:53
bool open(T1Interface *t1)
Definition: BlockExec.h:47
void close(void)
Definition: BlockExec.h:51
DecompressBlockExec()
Definition: BlockExec.h:46
DecompressCodeblock * cblk
Definition: BlockExec.h:52
Definition: Codeblock.h:182
Definition: TileComponent.h:28
Definition: TileProcessor.h:39