T2Compress.h
Go to the documentation of this file.
/*
* Copyright (C) 2016-2023 Grok Image Compression Inc.
*
* This source code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This source code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* This source code incorporates work covered by the BSD 2-clause license.
* Please see the LICENSE file in the root directory for details.
*
*/
#pragma once
namespace grk
{
struct TileProcessor;
struct T2Compress
{
T2Compress(TileProcessor* tileProc);
/*
Encode the packets of a tile to a destination buffer
@param tileno number of the tile encoded
@param maxlayers maximum number of layers
@param dest the destination buffer
@param p_data_written amount of data written
@param first_poc_tile_part true if first POC tile part, otherwise false
@param tppos The position of the tile part flag in the progression order
@param pino packet iterator number
*/
bool compressPackets(uint16_t tileno, uint16_t maxlayers, BufferedStream* stream,
uint32_t* p_data_written, bool first_poc_tile_part, uint32_t tppos,
uint32_t pino);
bool compressPacketsSimulate(uint16_t tileno, uint16_t maxlayers, uint32_t* p_data_written,
uint32_t max_len, uint32_t tppos, PLMarkerMgr* markers,
bool isFinal);
private:
TileProcessor* tileProcessor;
bool compressPacket(TileCodingParams* tcp, PacketIter* pi, BufferedStream* stream,
uint32_t* p_data_written);
bool compressPacketSimulate(TileCodingParams* tcp, PacketIter* pi, uint32_t* p_data_written,
uint32_t len, PLMarkerMgr* markers);
bool compressHeader(BitIO* bio, Resolution* res, uint16_t layno, uint64_t precinctIndex);
};
} // namespace grk
grk::BitIO
Definition BitIO.h:33
grk
Copyright (C) 2016-2023 Grok Image Compression Inc.
Definition ICacheable.h:20
grk::grk_read
void grk_read(const uint8_t *buffer, TYPE *value, uint32_t numBytes)
Definition BufferedStream.h:239
grk::BufferedStream
Definition BufferedStream.h:35
grk::PLMarkerMgr
Definition PLMarkerMgr.h:30
grk::PacketIter
Packet iterator.
Definition PacketIter.h:217
grk::Resolution
Definition Resolution.h:25
grk::T2Compress
Tier-2 coding.
Definition T2Compress.h:32
grk::T2Compress::compressPackets
bool compressPackets(uint16_t tileno, uint16_t maxlayers, BufferedStream *stream, uint32_t *p_data_written, bool first_poc_tile_part, uint32_t tppos, uint32_t pino)
Definition T2Compress.cpp:172
grk::T2Compress::compressHeader
bool compressHeader(BitIO *bio, Resolution *res, uint16_t layno, uint64_t precinctIndex)
Definition T2Compress.cpp:202
grk::T2Compress::compressPacketSimulate
bool compressPacketSimulate(TileCodingParams *tcp, PacketIter *pi, uint32_t *p_data_written, uint32_t len, PLMarkerMgr *markers)
Encode a packet of a tile to a destination buffer.
Definition T2Compress.cpp:84
grk::T2Compress::compressPacketsSimulate
bool compressPacketsSimulate(uint16_t tileno, uint16_t maxlayers, uint32_t *p_data_written, uint32_t max_len, uint32_t tppos, PLMarkerMgr *markers, bool isFinal)
Simulate compressing packets of a tile to a destination buffer.
Definition T2Compress.cpp:27
grk::T2Compress::tileProcessor
TileProcessor * tileProcessor
Definition T2Compress.h:63
grk::T2Compress::compressPacket
bool compressPacket(TileCodingParams *tcp, PacketIter *pi, BufferedStream *stream, uint32_t *p_data_written)
Encode a packet of a tile to a destination buffer.
Definition T2Compress.cpp:340
grk::TileCodingParams
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition CodingParams.h:122
grk::TileProcessor
Definition TileProcessor.h:78