Grok  7.6.3
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 public:
28  void compress(std::vector<CompressBlockExec*> *blocks);
29 
31  const double *mct_norms,
32  uint16_t mct_numcomps);
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 
47 }
grk::T1CompressScheduler::needsRateControl
bool needsRateControl
Definition: T1CompressScheduler.h:40
ThreadPool::get
static ThreadPool * get()
Definition: ThreadPool.hpp:51
grk::CompressBlockExec
Definition: T1Structs.h:281
grk::TileCodingParams
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition: CodingParams.h:121
grk::TileCodingParams::tccps
TileComponentCodingParams * tccps
tile-component coding parameters
Definition: CodingParams.h:163
grk::T1CompressScheduler::blockCount
std::atomic< int64_t > blockCount
Definition: T1CompressScheduler.h:43
grk::T1CompressScheduler::~T1CompressScheduler
~T1CompressScheduler()
Definition: T1CompressScheduler.cpp:28
grk::CompressBlockExec::open
bool open(T1Interface *t1)
Definition: T1Structs.cpp:643
grk::T1CompressScheduler
Definition: T1CompressScheduler.h:24
grk::T1CompressScheduler::compress
void compress(std::vector< CompressBlockExec * > *blocks)
Definition: T1CompressScheduler.cpp:90
grk::T1CompressScheduler::t1Implementations
std::vector< T1Interface * > t1Implementations
Definition: T1CompressScheduler.h:38
grk::grk_tile::distotile
double distotile
Definition: TileProcessor.h:36
grk::grk_tile::comps
TileComponent * comps
Definition: TileProcessor.h:35
grk::T1CompressScheduler::scheduleCompress
void scheduleCompress(TileCodingParams *tcp, const double *mct_norms, uint16_t mct_numcomps)
Definition: T1CompressScheduler.cpp:33
grk::T1CompressScheduler::encodeBlocks
CompressBlockExec ** encodeBlocks
Definition: T1CompressScheduler.h:42
ThreadPool::num_threads
size_t num_threads()
Definition: ThreadPool.hpp:49
grk::T1CompressScheduler::tile
grk_tile * tile
Definition: T1CompressScheduler.h:37
grk
Copyright (C) 2016-2021 Grok Image Compression Inc.
Definition: BitIO.cpp:23
grk::CompressBlockExec::distortion
double distortion
Definition: T1Structs.h:289
grk_includes.h
grk::grk_tile
Definition: TileProcessor.h:31
grk::T1CompressScheduler::block_mutex
std::mutex block_mutex
Definition: T1CompressScheduler.h:41
grk::T1CompressScheduler::T1CompressScheduler
T1CompressScheduler(grk_tile *tile, bool needsRateControl)
Definition: T1CompressScheduler.cpp:22
grk::T1Interface
Definition: T1Interface.h:23
grk::T1CompressScheduler::distortion_mutex
std::mutex distortion_mutex
Definition: T1CompressScheduler.h:39
ThreadPool::thread_number
int thread_number(std::thread::id id)
Definition: ThreadPool.hpp:44
grk::T1Factory::get_t1
static T1Interface * get_t1(bool isCompressor, TileCodingParams *tcp, uint32_t maxCblkW, uint32_t maxCblkH)
Definition: T1Factory.cpp:32
grk::grk_tile::numcomps
uint32_t numcomps
Definition: TileProcessor.h:34