Grok  9.5.0
T2Compress.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2021 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 namespace grk
25 {
26 struct TileProcessor;
27 
31 struct T2Compress
32 {
33  T2Compress(TileProcessor* tileProc);
34 
35  /*
36  Encode the packets of a tile to a destination buffer
37  @param tileno number of the tile encoded
38  @param maxlayers maximum number of layers
39  @param dest the destination buffer
40  @param p_data_written amount of data written
41  @param first_poc_tile_part true if first POC tile part, otherwise false
42  @param tppos The position of the tile part flag in the progression order
43  @param pino packet iterator number
44  */
45  bool compressPackets(uint16_t tileno, uint16_t maxlayers, IBufferedStream* stream,
46  uint32_t* p_data_written, bool first_poc_tile_part, uint32_t tppos,
47  uint32_t pino);
48 
59  bool compressPacketsSimulate(uint16_t tileno, uint16_t maxlayers, uint32_t* p_data_written,
60  uint32_t max_len, uint32_t tppos, PacketLengthMarkers* markers,
61  bool finalSimulation);
62 
63  private:
65 
75  uint32_t* p_data_written);
76 
87  bool compressPacketSimulate(TileCodingParams* tcp, PacketIter* pi, uint32_t* p_data_written,
88  uint32_t len, PacketLengthMarkers* markers, bool finalSimulation);
89 
90  bool compressHeader(BitIO* bio, Resolution* res, uint16_t layno, uint64_t precinctIndex);
91 };
92 
93 } // namespace grk
Definition: BitIO.h:33
Copyright (C) 2016-2021 Grok Image Compression Inc.
Definition: ICacheable.h:20
Definition: IBufferedStream.h:20
Packet iterator.
Definition: PacketIter.h:163
Definition: PacketLengthMarkers.h:39
Definition: Resolution.h:24
Tier-2 coding.
Definition: T2Compress.h:32
bool compressPacket(TileCodingParams *tcp, PacketIter *pi, IBufferedStream *stream, uint32_t *p_data_written)
Encode a packet of a tile to a destination buffer.
Definition: T2Compress.cpp:265
bool compressPacketSimulate(TileCodingParams *tcp, PacketIter *pi, uint32_t *p_data_written, uint32_t len, PacketLengthMarkers *markers, bool finalSimulation)
Encode a packet of a tile to a destination buffer.
Definition: T2Compress.cpp:364
bool compressPacketsSimulate(uint16_t tileno, uint16_t maxlayers, uint32_t *p_data_written, uint32_t max_len, uint32_t tppos, PacketLengthMarkers *markers, bool finalSimulation)
Simulate compressing packets of a tile to a destination buffer.
Definition: T2Compress.cpp:61
bool compressPackets(uint16_t tileno, uint16_t maxlayers, IBufferedStream *stream, uint32_t *p_data_written, bool first_poc_tile_part, uint32_t tppos, uint32_t pino)
Definition: T2Compress.cpp:28
T2Compress(TileProcessor *tileProc)
Definition: T2Compress.cpp:27
bool compressHeader(BitIO *bio, Resolution *res, uint16_t layno, uint64_t precinctIndex)
Definition: T2Compress.cpp:120
TileProcessor * tileProcessor
Definition: T2Compress.h:64
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition: CodingParams.h:122
Tile processor for decompression and compression.
Definition: TileProcessor.h:77