Grok  7.6.2
TileComponent.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 #include "testing.h"
24 #include <vector>
25 
26 #include "TileProcessor.h"
27 
28 namespace grk {
29 
30 // tile component
31 struct TileComponent : public grk_rect_u32 {
32  TileComponent();
34 
35  bool create_buffer(grk_rect_u32 *unreduced_tile_comp_dims,grk_rect_u32 unreduced_tile_comp_window_dims);
36  bool init(bool isCompressor,
37  bool whole_tile,
38  grk_rect_u32 unreduced_tile_comp_dims,
39  grk_rect_u32 unreduced_tile_comp_window_dims,
40  uint8_t prec,
41  CodingParams *cp,
42  TileCodingParams *tcp,
44  grk_plugin_tile *current_plugin_tile);
45 
46  void allocSparseBuffer(uint32_t numres);
47  void release_mem();
48  bool subbandIntersectsAOI(uint8_t resno,
49  eBandOrientation orient,
50  const grk_rect_u32 *aoi) const;
51 
53  bool isWholeTileDecoding();
55  bool postDecompress(int32_t *srcData, DecompressBlockExec *block, bool isHT);
56 
57  Resolution *resolutions; /* resolutions information */
58  uint8_t numresolutions; /* number of resolution levels */
59  uint8_t resolutions_to_decompress; /* number of resolutions level to decompress (at max)*/
61 #ifdef DEBUG_LOSSLESS_T2
62  Resolution* round_trip_resolutions; /* round trip resolution information */
63 #endif
64 private:
65  template<typename F> bool postDecompressImpl(int32_t *srcData, DecompressBlockExec *block);
71 
72 };
73 
74 }
75 
76 
77 
78 
grk::TileComponent::TileComponent
TileComponent()
Definition: TileComponent.cpp:29
grk::TileComponent::resolutions
Resolution * resolutions
Definition: TileComponent.h:57
grk::grk_rectangle< uint32_t >
DEBUG_TILE_COMPONENT
const bool DEBUG_TILE_COMPONENT
Definition: TileComponent.cpp:25
grk::grk_rectangle::height
T height() const
Definition: util.h:165
grk::ISparseBuffer
Definition: SparseBuffer.h:72
grk::TileCodingParams
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition: CodingParams.h:121
grk::Subband::precincts
std::vector< Precinct * > precincts
Definition: T1Structs.h:219
grk::TileComponentCodingParams
Tile-component coding parameters.
Definition: CodingParams.h:49
grk::TileComponent::m_sa
ISparseBuffer * m_sa
Definition: TileComponent.h:66
grk::BlockExec::y
uint32_t y
Definition: T1Structs.h:261
grk::CodingParams::m_coding_params
union grk::CodingParams::@0 m_coding_params
PostDecompressFilters.h
grk::uint_floordivpow2
static uint32_t uint_floordivpow2(uint32_t a, uint32_t b)
Divide an unsigned integer by a power of 2 and round downwards.
Definition: grk_intmath.h:55
grk::TileComponentCodingParams::quant
Quantizer quant
Definition: CodingParams.h:60
grk::TileComponent::release_mem
void release_mem()
Definition: TileComponent.cpp:47
grk::grk_rectangle::x1
T x1
Definition: util.h:76
grk::BlockExec::band_orientation
eBandOrientation band_orientation
Definition: T1Structs.h:255
grk::TileComponentCodingParams::numresolutions
uint8_t numresolutions
number of resolutions
Definition: CodingParams.h:54
_grk_plugin_tile
Plugin tile.
Definition: grok.h:1240
grk::TileComponent::getBuffer
TileComponentWindowBuffer< int32_t > * getBuffer() const
Definition: TileComponent.cpp:321
testing.h
grk::BlockExec::x
uint32_t x
Definition: T1Structs.h:260
grk::TileComponentCodingParams::qmfbid
uint8_t qmfbid
discrete wavelet transform identifier
Definition: CodingParams.h:65
grk::grk_rectangle::rect_union
grk_rectangle< T > rect_union(const grk_rectangle< T > *rhs) const
Definition: util.h:150
grk::TileComponentWindowBuffer::getPaddedTileBandWindow
const grk_rect_u32 getPaddedTileBandWindow(uint8_t resno, eBandOrientation orientation) const
Definition: TileComponentWindowBuffer.h:392
grk::TileComponentWindowBuffer< int32_t >
grk::TileComponent::resolutions_to_decompress
uint8_t resolutions_to_decompress
Definition: TileComponent.h:59
grk::TileComponent::m_tccp
TileComponentCodingParams * m_tccp
Definition: TileComponent.h:70
grk::DecompressBlockExec::cblk
DecompressCodeblock * cblk
Definition: T1Structs.h:275
grk::grk_rectangle::grow
grk_rectangle< T > & grow(T boundary)
Definition: util.h:175
grk::TileComponent::buf
TileComponentWindowBuffer< int32_t > * buf
Definition: TileComponent.h:69
grk::SparseBuffer
Definition: SparseBuffer.h:159
grk::TileComponent::resolutions_decompressed
uint8_t resolutions_decompressed
Definition: TileComponent.h:60
grk::TileComponent::~TileComponent
~TileComponent()
Definition: TileComponent.cpp:43
grk::CodingParams
Coding parameters.
Definition: CodingParams.h:235
grk::grk_buffer_2d::copy
void copy(grk_buffer_2d &rhs, F filter)
Definition: util.h:366
grk::DecodingParams::m_reduce
uint8_t m_reduce
if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, image is decompressed to...
Definition: CodingParams.h:227
grk::DecompressBlockExec::resno
uint8_t resno
Definition: T1Structs.h:276
grk::TileComponent::subbandIntersectsAOI
bool subbandIntersectsAOI(uint8_t resno, eBandOrientation orient, const grk_rect_u32 *aoi) const
Definition: TileComponent.cpp:169
grk::grk_rectangle::width
T width() const
Definition: util.h:162
grk::Resolution::band
Subband band[BAND_NUM_INDICES]
Definition: T1Structs.h:240
grk::TileComponent::postDecompressImpl
bool postDecompressImpl(int32_t *srcData, DecompressBlockExec *block)
Definition: TileComponent.cpp:364
grk::ISparseBuffer::write
virtual bool write(uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, const int32_t *src, const uint32_t src_col_stride, const uint32_t src_line_stride, bool forgiving)=0
Write the content of a rectangular window into the sparse array from a user buffer.
grk::TileComponentWindowBuffer::transform
void transform(uint8_t resno, eBandOrientation orientation, uint32_t &offsetx, uint32_t &offsety) const
Tranform code block offsets.
Definition: TileComponentWindowBuffer.h:345
grk::grk_buffer_2d
Definition: util.h:271
grk::TileComponent::init
bool init(bool isCompressor, bool whole_tile, grk_rect_u32 unreduced_tile_comp_dims, grk_rect_u32 unreduced_tile_comp_window_dims, uint8_t prec, CodingParams *cp, TileCodingParams *tcp, TileComponentCodingParams *tccp, grk_plugin_tile *current_plugin_tile)
Initialize tile component in unreduced tile component coordinates (tile component coordinates take su...
Definition: TileComponent.cpp:69
grk
Copyright (C) 2016-2020 Grok Image Compression Inc.
Definition: BitIO.cpp:23
grk::TileComponent
Definition: TileComponent.h:31
grk::TileComponentCodingParams::prch
uint32_t prch[GRK_J2K_MAXRLVLS]
precinct height (power of 2 exponent)
Definition: CodingParams.h:86
grk::TileComponentCodingParams::prcw
uint32_t prcw[GRK_J2K_MAXRLVLS]
precinct width (power of 2 exponent)
Definition: CodingParams.h:84
grk_includes.h
grk::TileComponent::getSparseBuffer
ISparseBuffer * getSparseBuffer()
Definition: TileComponent.cpp:328
grk::grk_rect_u32
grk_rectangle< uint32_t > grk_rect_u32
Definition: util.h:48
grk::TileComponent::wholeTileDecompress
bool wholeTileDecompress
Definition: TileComponent.h:67
grk::BlockExec::qmfbid
uint32_t qmfbid
Definition: T1Structs.h:258
grk::TileComponent::create_buffer
bool create_buffer(grk_rect_u32 *unreduced_tile_comp_dims, grk_rect_u32 unreduced_tile_comp_window_dims)
Definition: TileComponent.cpp:281
grk::grk_rectangle::intersection
grk_rectangle< T > intersection(const grk_rectangle< T > rhs) const
Definition: util.h:137
grk::TileComponent::allocSparseBuffer
void allocSparseBuffer(uint32_t numres)
Definition: TileComponent.cpp:179
grk::TileComponentWindowBuffer::getCodeBlockDestWindow
const grk_buffer_2d< T > * getCodeBlockDestWindow(uint8_t resno, eBandOrientation orientation) const
Get code block destination window.
Definition: TileComponentWindowBuffer.h:377
grk::TileComponent::m_is_encoder
bool m_is_encoder
Definition: TileComponent.h:68
grk::Quantizer::setBandStepSizeAndBps
bool setBandStepSizeAndBps(TileCodingParams *tcp, Subband *band, uint32_t resno, uint8_t bandIndex, TileComponentCodingParams *tccp, uint8_t image_precision, bool compress)
Definition: Quantizer.cpp:26
grk::Resolution
Definition: T1Structs.h:231
grk::TileComponent::numresolutions
uint8_t numresolutions
Definition: TileComponent.h:58
grk::grk_rectangle::set_rect
void set_rect(grk_rectangle< T > *rhs)
Definition: util.h:118
grk::eBandOrientation
eBandOrientation
Definition: T1Structs.h:36
grk::TileComponent::isWholeTileDecoding
bool isWholeTileDecoding()
Definition: TileComponent.cpp:325
grk::grk_rectangle::x0
T x0
Definition: util.h:76
grk::grk_rectangle::y1
T y1
Definition: util.h:76
grk::res_window
Class to manage multiple buffers needed to perform DWT transform.
Definition: TileComponentWindowBuffer.h:29
TileProcessor.h
grk::CodingParams::m_dec
DecodingParams m_dec
Definition: CodingParams.h:266
grk::DecompressBlockExec
Definition: T1Structs.h:270
grk::MissingSparseBlockException
Definition: grk_exceptions.h:36
grk::grk_rectangle::y0
T y0
Definition: util.h:76
grk::TileComponent::postDecompress
bool postDecompress(int32_t *srcData, DecompressBlockExec *block, bool isHT)
Definition: TileComponent.cpp:332
grk::DecompressBlockExec::roishift
uint32_t roishift
Definition: T1Structs.h:277
grk::GRK_ERROR
void GRK_ERROR(const char *fmt,...)
Definition: logger.cpp:57
grk::BAND_ORIENT_LL
@ BAND_ORIENT_LL
Definition: T1Structs.h:37
grk::grk_rectangle::non_empty
bool non_empty(void) const
Definition: util.h:94