Grok  9.5.0
T1CompressScheduler.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 
18 #pragma once
19 
20 #include <thread>
21 
22 namespace grk
23 {
25 {
26  public:
29  void compress(std::vector<CompressBlockExec*>* blocks);
30 
31  void scheduleCompress(TileCodingParams* tcp, const double* mct_norms, uint16_t mct_numcomps);
32 
33  private:
34  bool compress(size_t threadId, uint64_t maxBlocks);
35  void compress(T1Interface* impl, CompressBlockExec* block);
36 
38  std::vector<T1Interface*> t1Implementations;
39  mutable std::mutex distortion_mutex;
41  mutable std::mutex block_mutex;
43  std::atomic<int64_t> blockCount;
44 };
45 
46 } // namespace grk
Definition: T1CompressScheduler.h:25
~T1CompressScheduler()
Definition: T1CompressScheduler.cpp:25
T1CompressScheduler(Tile *tile, bool needsRateControl)
Definition: T1CompressScheduler.cpp:22
std::mutex block_mutex
Definition: T1CompressScheduler.h:41
void scheduleCompress(TileCodingParams *tcp, const double *mct_norms, uint16_t mct_numcomps)
Definition: T1CompressScheduler.cpp:31
bool needsRateControl
Definition: T1CompressScheduler.h:40
std::mutex distortion_mutex
Definition: T1CompressScheduler.h:39
std::vector< T1Interface * > t1Implementations
Definition: T1CompressScheduler.h:38
CompressBlockExec ** encodeBlocks
Definition: T1CompressScheduler.h:42
void compress(std::vector< CompressBlockExec * > *blocks)
Definition: T1CompressScheduler.cpp:96
Tile * tile
Definition: T1CompressScheduler.h:37
std::atomic< int64_t > blockCount
Definition: T1CompressScheduler.h:43
Definition: T1Interface.h:26
Copyright (C) 2016-2021 Grok Image Compression Inc.
Definition: ICacheable.h:20
Definition: BlockExec.h:57
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition: CodingParams.h:122
Definition: TileProcessor.h:39