|
Grok 20.3.2
|
#include <CompressScheduler.h>
Public Member Functions | |
| CompressScheduler (Tile *tile, bool needsRateControl, TileCodingParams *tcp, const double *mct_norms, uint16_t mct_numcomps) | |
| Constructs a CompressScheduler. | |
| ~CompressScheduler () override=default | |
| Destroys a CompressScheduler. | |
| bool | scheduleT1 (ITileProcessor *proc) override |
| Schedules all T1 tasks for a ITileProcessor. | |
| bool | populateT1Flow (FlowComponent *flow) |
| const RateControlStats & | getRateControlStats () const |
| Get rate control stats collected during T1 encoding. | |
| Public Member Functions inherited from grk::SchedulerStandard | |
| SchedulerStandard (uint16_t numComps) | |
| Constructs a SchedulerStandard. | |
| ~SchedulerStandard () override | |
| Destroys a SchedulerStandard. | |
| void | release (void) override |
| Releases flow components. | |
| ImageComponentFlow * | getImageComponentFlow (uint16_t compno) |
| Gets ImageComponentFlow for component. | |
| Public Member Functions inherited from grk::CodecScheduler | |
| CodecScheduler (uint16_t numComps) | |
| Contructs a CodecScheduler. | |
| virtual | ~CodecScheduler () |
| Destroys a CodecScheduler. | |
| void | run (void) |
| Runs tf::Executor. | |
| bool | wait (void) |
| Waits for tf::Executor to complete. | |
| Public Member Functions inherited from FlowComponent | |
| void | addTo (tf::Taskflow &composition) |
| Composes this FlowComponent's tf::Taskflow with another tf::Taskflow. | |
| void | precede (FlowComponent &successor) |
| Schedule this FlowComponent before another FlowComponent. | |
| void | precede (tf::Task &successor) |
| Schedule this Taskflow before another FlowComponent. | |
| tf::Task & | getCompositionTask (void) |
| void | conditional_precede (FlowComponent *root, FlowComponent *successor, std::function< int()> condition_lambda) |
| Conditionally schedule successor based on condition_lambda. | |
| FlowComponent * | name (const std::string &name) |
| Gets name of composition task. | |
| tf::Task & | nextTask () |
| Gets next task placeholder for componentFlow_. | |
Private Member Functions | |
| bool | compress (size_t workerId, uint64_t maxBlocks) |
| compress next block | |
| void | compress (t1::ICoder *coder, t1::CompressBlockExec *block) |
| compress block | |
Private Attributes | |
| Tile * | tile_ |
| Tile to compress | |
| std::mutex | distortion_mutex_ |
| mutex to serialize distortion decrease from blocks | |
| bool | needsRateControl_ |
| true if rate control requested | |
| std::vector< t1::CompressBlockExec * > | encodeBlocks_ |
| vector of CompressBlockExec encode blocks | |
| std::atomic< int64_t > | blockCount_ |
| atomic counter to keep track of number of encoded blocks | |
| TileCodingParams * | tcp_ |
| TileCodingParams for this tile | |
| const double * | mct_norms_ |
| array of mct norms | |
| uint16_t | mct_numcomps_ |
| number of components to apply mct to | |
| RateControlStats | rateControlStats_ |
| rate control statistics collected during T1 encoding | |
Additional Inherited Members | |
| Protected Member Functions inherited from grk::SchedulerStandard | |
| void | graph (uint16_t compno) |
| Calculates task graph for component. | |
| Protected Member Functions inherited from grk::CodecScheduler | |
| void | releaseCoders (void) |
| Protected Attributes inherited from grk::SchedulerStandard | |
| std::vector< ImageComponentFlow * > | imageComponentFlow_ |
| store image component flows | |
| Protected Attributes inherited from grk::CodecScheduler | |
| std::atomic_bool | success_ |
| atomic tracking of compress/decompress success | |
| uint16_t | numcomps_ |
| number of components | |
| std::vector< t1::ICoder * > | coders_ |
| pool of ICoder | |
| tf::Future< void > | runFuture_ |
| tf::Future<void> resulting from running scheduler | |
| grk::CompressScheduler::CompressScheduler | ( | Tile * | tile, |
| bool | needsRateControl, | ||
| TileCodingParams * | tcp, | ||
| const double * | mct_norms, | ||
| uint16_t | mct_numcomps ) |
Constructs a CompressScheduler.
| tile | Tile |
| needsRateControl | true if rate control needed |
| tcp | TileCodingParams |
| mct_norms | array of mct norms |
| mct_numcomps | number of mct components |
References blockCount_, mct_norms_, mct_numcomps_, needsRateControl_, grk::CodecScheduler::numcomps_, grk::Tile::numcomps_, rateControlStats_, grk::SchedulerStandard::SchedulerStandard(), tcp_, and tile_.
|
overridedefault |
Destroys a CompressScheduler.
|
private |
compress next block
| workerId | worker id |
| maxBlocks | maximum number of blocks |
References blockCount_, grk::CodecScheduler::coders_, compress(), and encodeBlocks_.
Referenced by compress(), populateT1Flow(), and scheduleT1().
|
private |
compress block
| coder | ICoder coder implementation |
| block | CompressBlockExec compression block |
References grk::t1::CompressBlockExec::cblk, grk::t1::CompressBlockExec::compno, grk::RateControl::convexHull(), grk::t1::CompressBlockExec::distortion, distortion_mutex_, needsRateControl_, grk::t1::CompressBlockExec::open(), rateControlStats_, and tile_.
|
inline |
Get rate control stats collected during T1 encoding.
References rateControlStats_.
| bool grk::CompressScheduler::populateT1Flow | ( | FlowComponent * | flow | ) |
|
overridevirtual |
Schedules all T1 tasks for a ITileProcessor.
| proc | ITileProcessor |
Implements grk::CodecScheduler.
References grk::CodecScheduler::coders_, compress(), encodeBlocks_, TFSingleton::get(), grk::t1::CoderFactory::makeCoder(), mct_norms_, mct_numcomps_, needsRateControl_, TFSingleton::num_threads(), tcp_, and tile_.
|
private |
atomic counter to keep track of number of encoded blocks
Referenced by compress(), and CompressScheduler().
|
mutableprivate |
mutex to serialize distortion decrease from blocks
Referenced by compress().
|
private |
vector of CompressBlockExec encode blocks
Referenced by compress(), populateT1Flow(), and scheduleT1().
|
private |
array of mct norms
Referenced by CompressScheduler(), populateT1Flow(), and scheduleT1().
|
private |
number of components to apply mct to
Referenced by CompressScheduler(), populateT1Flow(), and scheduleT1().
|
private |
true if rate control requested
Referenced by compress(), CompressScheduler(), populateT1Flow(), and scheduleT1().
|
private |
rate control statistics collected during T1 encoding
Referenced by compress(), CompressScheduler(), and getRateControlStats().
|
private |
TileCodingParams for this tile
Referenced by CompressScheduler(), populateT1Flow(), and scheduleT1().
|
private |
Tile to compress
Referenced by compress(), CompressScheduler(), populateT1Flow(), and scheduleT1().