CompressScheduler.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/>.
*
*/
#pragma once
namespace grk
{
class CompressScheduler : public Scheduler
{
public:
CompressScheduler(Tile* tile, bool needsRateControl, TileCodingParams* tcp,
const double* mct_norms, uint16_t mct_numcomps);
~CompressScheduler() = default;
bool schedule(uint16_t compno) override;
private:
bool scheduleBlocks(uint16_t compno);
void compress(std::vector<CompressBlockExec*>* blocks);
bool compress(size_t threadId, uint64_t maxBlocks);
void compress(T1Interface* impl, CompressBlockExec* block);
Tile* tile;
mutable std::mutex distortion_mutex;
bool needsRateControl;
CompressBlockExec** encodeBlocks;
std::atomic<int64_t> blockCount;
TileCodingParams* tcp_;
const double* mct_norms_;
uint16_t mct_numcomps_;
};
} // namespace grk
grk::CompressScheduler
Definition CompressScheduler.h:22
grk::CompressScheduler::tcp_
TileCodingParams * tcp_
Definition CompressScheduler.h:40
grk::CompressScheduler::tile
Tile * tile
Definition CompressScheduler.h:35
grk::CompressScheduler::encodeBlocks
CompressBlockExec ** encodeBlocks
Definition CompressScheduler.h:38
grk::CompressScheduler::mct_numcomps_
uint16_t mct_numcomps_
Definition CompressScheduler.h:42
grk::CompressScheduler::distortion_mutex
std::mutex distortion_mutex
Definition CompressScheduler.h:36
grk::CompressScheduler::scheduleBlocks
bool scheduleBlocks(uint16_t compno)
Definition CompressScheduler.cpp:37
grk::CompressScheduler::compress
void compress(std::vector< CompressBlockExec * > *blocks)
Definition CompressScheduler.cpp:101
grk::CompressScheduler::~CompressScheduler
~CompressScheduler()=default
grk::CompressScheduler::needsRateControl
bool needsRateControl
Definition CompressScheduler.h:37
grk::CompressScheduler::mct_norms_
const double * mct_norms_
Definition CompressScheduler.h:41
grk::CompressScheduler::blockCount
std::atomic< int64_t > blockCount
Definition CompressScheduler.h:39
grk::CompressScheduler::schedule
bool schedule(uint16_t compno) override
Definition CompressScheduler.cpp:33
grk::Scheduler
Definition Scheduler.h:22
grk::T1Interface
Definition T1Interface.h:26
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::CompressBlockExec
Definition BlockExec.h:57
grk::TileCodingParams
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition CodingParams.h:122
grk::Tile
Definition TileProcessor.h:39