Grok  7.6.0
T1Encoder.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 
18 #pragma once
19 
20 #include <thread>
21 
22 namespace grk {
23 
24 class T1Encoder {
25 public:
26  T1Encoder(TileCodingParams *tcp, grk_tile *tile, uint32_t encodeMaxCblkW,
27  uint32_t encodeMaxCblkH, bool needsRateControl);
29  void compress(std::vector<encodeBlockInfo*> *blocks);
30 
31 private:
32  bool compress(size_t threadId, uint64_t maxBlocks);
33  void compress(T1Interface *impl, encodeBlockInfo *block);
34 
36  std::vector<T1Interface*> threadStructs;
37  mutable std::mutex distortion_mutex;
39  mutable std::mutex block_mutex;
41  std::atomic<int64_t> blockCount;
42 
43 };
44 
45 }
grk::T1Encoder::needsRateControl
bool needsRateControl
Definition: T1Encoder.h:38
grk::T1Encoder::compress
void compress(T1Interface *impl, encodeBlockInfo *block)
grk::T1Encoder::threadStructs
std::vector< T1Interface * > threadStructs
Definition: T1Encoder.h:36
grk::TileCodingParams
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition: CodingParams.h:117
grk::T1Encoder
Definition: T1Encoder.h:24
grk
Copyright (C) 2016-2020 Grok Image Compression Inc.
Definition: BitIO.h:27
grk::T1Encoder::encodeBlocks
encodeBlockInfo ** encodeBlocks
Definition: T1Encoder.h:40
grk::grk_tile
Definition: TileProcessor.h:180
grk::T1Encoder::compress
void compress(std::vector< encodeBlockInfo * > *blocks)
grk::T1Encoder::tile
grk_tile * tile
Definition: T1Encoder.h:35
grk::T1Encoder::compress
bool compress(size_t threadId, uint64_t maxBlocks)
grk::T1Encoder::distortion_mutex
std::mutex distortion_mutex
Definition: T1Encoder.h:37
grk::T1Encoder::~T1Encoder
~T1Encoder()
grk::T1Interface
Definition: T1Interface.h:103
grk::T1Encoder::T1Encoder
T1Encoder(TileCodingParams *tcp, grk_tile *tile, uint32_t encodeMaxCblkW, uint32_t encodeMaxCblkH, bool needsRateControl)
grk::encodeBlockInfo
Definition: T1Interface.h:58
grk::T1Encoder::blockCount
std::atomic< int64_t > blockCount
Definition: T1Encoder.h:41
grk::T1Encoder::block_mutex
std::mutex block_mutex
Definition: T1Encoder.h:39