|
Grok 20.3.2
|
#include <BlockCoder.h>
Public Member Functions | |
| BlockCoder (bool isCompressor, uint16_t maxCblkW, uint16_t maxCblkH, uint32_t cacheStrategy) | |
| ~BlockCoder () | |
| void | print (void) |
| bool | alloc (uint16_t w, uint16_t h) |
| void | code_block_enc_deallocate (cblk_enc *p_code_block) |
| ENCODE ////////////////////////////////////////////////////. | |
| double | compress_cblk (cblk_enc *cblk, uint32_t max, uint8_t orientation, uint16_t compno, uint8_t level, uint8_t qmfbid, double stepsize, uint32_t cblksty, const double *mct_norms, uint16_t mct_numcomps, bool doRateControl) |
| bool | decompress_cblk (CodeblockDecompress *cblk, uint8_t orientation, uint32_t cblksty) |
| int32_t * | getUncompressedData (void) |
| void | decompressInitOrientation (uint8_t orientation) |
| void | decompressInitSegment (uint8_t type, uint8_t **buffers, uint32_t *buffer_lengths, uint16_t num_buffers) |
| void | decompressUpdateSegment (uint8_t **buffers, uint32_t *buffer_lengths, uint16_t num_buffers) |
| bool | decompressPass (uint8_t passno, uint8_t passtype, uint8_t numBpsToDecompress, uint8_t type, uint32_t cblksty) |
| void | decompressFinish (uint32_t cblksty, bool finalLayer) |
| void | decompressBackup (void) |
| void | decompressRestore (uint8_t *passno, uint8_t *passtype, uint8_t *numBpsToDecompress) |
| void | setFinalLayer (bool isFinal) |
Static Public Member Functions | |
| static double | getnorm (uint32_t level, uint8_t orientation, bool reversible) |
| static bool | cacheAll (uint32_t strategy) |
Private Member Functions | |
| void | initFlags (void) |
| uint16_t | getFlagsStride (void) |
| uint16_t | getFlagsHeight (void) |
| void | checkSegSym (int32_t cblksty) |
| template<uint16_t w, uint16_t h, bool vsc> | |
| void | dec_clnpass (int8_t bpno) |
| void | dec_clnpass (int8_t bpno, int32_t cblksty) |
| template<uint16_t w, uint16_t h, bool vsc> | |
| void | dec_clnpass_diff (int8_t bpno, uint8_t passno, uint8_t passtype) |
| void | dec_clnpass_diff (int8_t bpno, uint8_t passno, uint8_t passtype, int32_t cblksty) |
| template<uint16_t w, uint16_t h, bool vsc> | |
| void | dec_clnpass_diff_final (int8_t bpno, uint8_t passno, uint8_t passtype) |
| void | dec_clnpass_diff_final (int8_t bpno, uint8_t passno, uint8_t passtype, int32_t cblksty) |
| template<uint16_t w, uint16_t h, bool vsc> | |
| void | dec_sigpass (int8_t bpno) |
| void | dec_sigpass (int8_t bpno, int32_t cblksty) |
| template<uint16_t w, uint16_t h, bool vsc> | |
| void | dec_sigpass_diff (int8_t bpno, uint8_t passno, uint8_t passtype) |
| void | dec_sigpass_diff (int8_t bpno, uint8_t passno, uint8_t passtype, int32_t cblksty) |
| template<uint16_t w, uint16_t h, bool vsc> | |
| void | dec_sigpass_diff_final (int8_t bpno, uint8_t passno, uint8_t passtype) |
| void | dec_sigpass_diff_final (int8_t bpno, uint8_t passno, uint8_t passtype, int32_t cblksty) |
| template<uint16_t w, uint16_t h> | |
| void | dec_refpass (int8_t bpno) |
| void | dec_refpass (int8_t bpno) |
| template<uint16_t w, uint16_t h> | |
| void | dec_refpass_diff (int8_t bpno, uint8_t passno, uint8_t passtype) |
| void | dec_refpass_diff (int8_t bpno, uint8_t passno, uint8_t passtype) |
| template<uint16_t w, uint16_t h> | |
| void | dec_refpass_diff_final (int8_t bpno, uint8_t passno, uint8_t passtype) |
| void | dec_refpass_diff_final (int8_t bpno, uint8_t passno, uint8_t passtype) |
| void | dec_sigpass_raw (int8_t bpno, int32_t cblksty) |
| void | dec_refpass_raw (int8_t bpno) |
| void | dec_refpass_step_raw (grk_flag *flagsPtr, int32_t *datap, int32_t poshalf, uint32_t ci) |
| void | dec_sigpass_step_raw (grk_flag *flagsPtr, int32_t *datap, int32_t oneplushalf, uint32_t vsc, uint32_t ci) |
| void | enc_clnpass (int8_t bpno, int32_t *nmsedec, uint32_t cblksty) |
| void | enc_sigpass (int8_t bpno, int32_t *nmsedec, uint8_t type, uint32_t cblksty) |
| void | enc_refpass (int8_t bpno, int32_t *nmsedec, uint8_t type) |
| int | enc_is_term_pass (cblk_enc *cblk, uint32_t cblksty, int8_t bpno, uint32_t passtype) |
| void | code_block_enc_allocate (cblk_enc *p_code_block) |
| double | getnorm_53 (uint32_t level, uint8_t orientation) |
| Get the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT. | |
| double | getnorm_97 (uint32_t level, uint8_t orientation) |
| Get the norm of a wavelet function of a subband at a specified level for the irreversible 9-7 DWT. | |
| double | getwmsedec (int32_t nmsedec, uint16_t compno, uint32_t level, uint8_t orientation, int8_t bpno, uint32_t qmfbid, double stepsize, const double *mct_norms, uint32_t mct_numcomps) |
Private Attributes | |
| uint32_t | cacheStrategy_ |
| mqcoder | coder |
| uint16_t | w_ |
| cached block width | |
| uint16_t | stride_ |
| cached block stride | |
| uint16_t | h_ |
| cached block height | |
| Buffer2dAligned32 | uncompressedBuf_ |
| uncompressed data buffer | |
| int32_t * | uncompressedData_ |
| pointer to uncompressedBuf_ data | |
| grk_flag * | flags_ |
| Flags used by decompressor and compressor. | |
| uint32_t | flagsLen_ |
| bool | compressor |
| grk::t1::BlockCoder::BlockCoder | ( | bool | isCompressor, |
| uint16_t | maxCblkW, | ||
| uint16_t | maxCblkH, | ||
| uint32_t | cacheStrategy ) |
References alloc(), cacheAll(), cacheStrategy_, coder, compressor, flags_, flagsLen_, h_, stride_, uncompressedData_, and w_.
Referenced by decompress_cblk().
| grk::t1::BlockCoder::~BlockCoder | ( | ) |
References flags_, and grk::grk_aligned_free().
| bool grk::t1::BlockCoder::alloc | ( | uint16_t | w, |
| uint16_t | h ) |
References cacheAll(), cacheStrategy_, compressor, flags_, flagsLen_, getFlagsStride(), grk::grk_aligned_free(), grk::grk_aligned_malloc(), grk::grklog, h_, initFlags(), stride_, uncompressedBuf_, uncompressedData_, and w_.
Referenced by BlockCoder(), and decompress_cblk().
|
static |
References GRK_TILE_CACHE_ALL.
Referenced by alloc(), BlockCoder(), decompress_cblk(), decompressBackup(), and decompressPass().
|
private |
References coder, CODER_SETCURCTX, DEC_SYMBOL, GRK_CBLKSTY_SEGSYM, grk::grklog, and grk::t1::T1_CTXNO_UNI.
Referenced by dec_clnpass(), dec_clnpass_diff(), and dec_clnpass_diff_final().
|
private |
References grk::t1::cblk_enc::passes.
Referenced by compress_cblk().
| void grk::t1::BlockCoder::code_block_enc_deallocate | ( | cblk_enc * | code_block | ) |
ENCODE ////////////////////////////////////////////////////.
Deallocate the compressing data of the given precinct.
References grk::t1::cblk_enc::passes.
| double grk::t1::BlockCoder::compress_cblk | ( | cblk_enc * | cblk, |
| uint32_t | max, | ||
| uint8_t | orientation, | ||
| uint16_t | compno, | ||
| uint8_t | level, | ||
| uint8_t | qmfbid, | ||
| double | stepsize, | ||
| uint32_t | cblksty, | ||
| const double * | mct_norms, | ||
| uint16_t | mct_numcomps, | ||
| bool | doRateControl ) |
References code_block_enc_allocate(), coder, grk::t1::cblk_enc::data, enc_clnpass(), enc_is_term_pass(), enc_refpass(), enc_sigpass(), grk::floorlog2(), grk::t1::cblk_enc::getPass(), getwmsedec(), GRK_CBLKSTY_LAZY, GRK_CBLKSTY_PTERM, GRK_CBLKSTY_RESET, GRK_CBLKSTY_SEGSYM, lut_ctxno_zc, grk::t1::cblk_enc::numbps, grk::t1::cblk_enc::numPassesTotal, grk::t1::cblk_enc::passes, grk::t1::pass_enc::rate, T1_NMSEDEC_FRACBITS, T1_TYPE_MQ, T1_TYPE_RAW, and grk::t1::pass_enc::term.
|
private |
References DEC_PASS_CLN_IMPL, h_, and w_.
Referenced by dec_clnpass(), and decompressPass().
|
private |
References checkSegSym(), dec_clnpass(), DEC_PASS_CLN_IMPL, GRK_CBLKSTY_VSC, h_, and w_.
|
private |
References DEC_PASS_CLN_IMPL_DIFF, h_, and w_.
Referenced by dec_clnpass_diff(), and decompressPass().
|
private |
References checkSegSym(), dec_clnpass_diff(), DEC_PASS_CLN_IMPL_DIFF, GRK_CBLKSTY_VSC, h_, and w_.
|
private |
References DEC_PASS_CLN_IMPL_DIFF_FINAL, h_, and w_.
Referenced by dec_clnpass_diff_final(), and decompressPass().
|
private |
References checkSegSym(), dec_clnpass_diff_final(), DEC_PASS_CLN_IMPL_DIFF_FINAL, GRK_CBLKSTY_VSC, h_, and w_.
|
private |
References DEC_PASS_REF_IMPL, dec_refpass(), h_, and w_.
|
private |
References DEC_PASS_REF_IMPL, h_, and w_.
Referenced by dec_refpass(), and decompressPass().
|
private |
References DEC_PASS_REF_IMPL_DIFF, dec_refpass_diff(), h_, and w_.
|
private |
References DEC_PASS_REF_IMPL_DIFF, h_, and w_.
Referenced by dec_refpass_diff(), and decompressPass().
|
private |
References DEC_PASS_REF_IMPL_DIFF_FINAL, dec_refpass_diff_final(), h_, and w_.
|
private |
References DEC_PASS_REF_IMPL_DIFF_FINAL, h_, and w_.
Referenced by dec_refpass_diff_final(), and decompressPass().
|
private |
References dec_refpass_step_raw(), flags_, h_, uncompressedData_, and w_.
Referenced by decompressPass().
|
inlineprivate |
References DEC_SYMBOL_RAW, T1_MU_THIS, T1_PI_THIS, and T1_SIGMA_THIS.
Referenced by dec_refpass_raw().
|
private |
References DEC_PASS_SIG_IMPL, h_, and w_.
Referenced by dec_sigpass(), and decompressPass().
|
private |
References DEC_PASS_SIG_IMPL, dec_sigpass(), GRK_CBLKSTY_VSC, h_, and w_.
|
private |
References DEC_PASS_SIG_IMPL_DIFF, h_, and w_.
Referenced by dec_sigpass_diff(), and decompressPass().
|
private |
References DEC_PASS_SIG_IMPL_DIFF, dec_sigpass_diff(), GRK_CBLKSTY_VSC, h_, and w_.
|
private |
References DEC_PASS_SIG_IMPL_DIFF_FINAL, h_, and w_.
Referenced by dec_sigpass_diff_final(), and decompressPass().
|
private |
References DEC_PASS_SIG_IMPL_DIFF_FINAL, dec_sigpass_diff_final(), GRK_CBLKSTY_VSC, h_, and w_.
|
private |
References dec_sigpass_step_raw(), flags_, GRK_CBLKSTY_VSC, h_, uncompressedData_, and w_.
Referenced by decompressPass().
|
inlineprivate |
References DEC_SYMBOL_RAW, T1_PI_THIS, T1_SIGMA_NEIGHBOURS, T1_SIGMA_THIS, grk::t1::update_flags(), and w_.
Referenced by dec_sigpass_raw().
| bool grk::t1::BlockCoder::decompress_cblk | ( | CodeblockDecompress * | cblk, |
| uint8_t | orientation, | ||
| uint32_t | cblksty ) |
| void grk::t1::BlockCoder::decompressBackup | ( | void | ) |
References cacheAll(), cacheStrategy_, coder, flags_, flagsLen_, grk::grk_aligned_malloc(), grk::grklog, h_, uncompressedData_, and w_.
| void grk::t1::BlockCoder::decompressFinish | ( | uint32_t | cblksty, |
| bool | finalLayer ) |
References coder, GRK_CBLKSTY_PTERM, and grk::grklog.
| void grk::t1::BlockCoder::decompressInitOrientation | ( | uint8_t | orientation | ) |
References coder, and lut_ctxno_zc.
| void grk::t1::BlockCoder::decompressInitSegment | ( | uint8_t | type, |
| uint8_t ** | buffers, | ||
| uint32_t * | buffer_lengths, | ||
| uint16_t | num_buffers ) |
References coder, and T1_TYPE_RAW.
| bool grk::t1::BlockCoder::decompressPass | ( | uint8_t | passno, |
| uint8_t | passtype, | ||
| uint8_t | numBpsToDecompress, | ||
| uint8_t | type, | ||
| uint32_t | cblksty ) |
References grk::t1::BACKUP_DISABLED, cacheAll(), cacheStrategy_, coder, dec_clnpass(), dec_clnpass_diff(), dec_clnpass_diff_final(), dec_refpass(), dec_refpass_diff(), dec_refpass_diff_final(), dec_refpass_raw(), dec_sigpass(), dec_sigpass_diff(), dec_sigpass_diff_final(), dec_sigpass_raw(), GRK_CBLKSTY_RESET, T1_TYPE_MQ, and T1_TYPE_RAW.
| void grk::t1::BlockCoder::decompressRestore | ( | uint8_t * | passno, |
| uint8_t * | passtype, | ||
| uint8_t * | numBpsToDecompress ) |
References grk::t1::BACKUP_DISABLED, coder, flags_, flagsLen_, h_, uncompressedData_, and w_.
| void grk::t1::BlockCoder::decompressUpdateSegment | ( | uint8_t ** | buffers, |
| uint32_t * | buffer_lengths, | ||
| uint16_t | num_buffers ) |
References coder.
|
private |
References coder, flags_, GETCTXNO_ZC, grk::t1::getctxtno_sc_or_spb_index(), grk::t1::getnmsedec_sig(), GRK_CBLKSTY_VSC, h_, lut_ctxno_sc, lut_spb, mqc_encode_macro, POP_MQC, PUSH_MQC, smr_abs, smr_sign, stride_, grk::t1::T1_CTXNO_AGG, grk::t1::T1_CTXNO_UNI, T1_NMSEDEC_FRACBITS, T1_PI_0, T1_PI_1, T1_PI_2, T1_PI_3, T1_PI_THIS, T1_SIGMA_10, T1_SIGMA_13, T1_SIGMA_4, T1_SIGMA_7, T1_SIGMA_THIS, uncompressedData_, grk::t1::update_flags(), and w_.
Referenced by compress_cblk().
|
private |
References GRK_CBLKSTY_LAZY, GRK_CBLKSTY_TERMALL, and grk::t1::cblk_enc::numbps.
Referenced by compress_cblk().
|
private |
References coder, enc_refpass_step_macro, flags_, h_, POP_MQC, PUSH_MQC, stride_, T1_NMSEDEC_FRACBITS, T1_PI_0, T1_PI_1, T1_PI_2, T1_PI_3, T1_SIGMA_10, T1_SIGMA_13, T1_SIGMA_4, T1_SIGMA_7, uncompressedData_, and w_.
Referenced by compress_cblk().
|
private |
References coder, enc_sigpass_step_macro, flags_, GRK_CBLKSTY_VSC, h_, POP_MQC, PUSH_MQC, stride_, T1_NMSEDEC_FRACBITS, uncompressedData_, and w_.
Referenced by compress_cblk().
|
private |
References h_.
Referenced by initFlags().
|
private |
References w_.
Referenced by alloc(), and initFlags().
|
static |
References grk::t1::dwt_norms, and grk::t1::dwt_norms_real.
Referenced by grk::Quantizer::generate(), getnorm_53(), and getnorm_97().
|
private |
Get the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT.
| level | Level of the wavelet function |
| orientation | Band of the wavelet function |
References getnorm().
Referenced by getwmsedec().
|
private |
Get the norm of a wavelet function of a subband at a specified level for the irreversible 9-7 DWT.
| level | Level of the wavelet function |
| orientation | Band of the wavelet function |
References getnorm().
Referenced by getwmsedec().
| int32_t * grk::t1::BlockCoder::getUncompressedData | ( | void | ) |
References uncompressedBuf_.
|
private |
References getnorm_53(), and getnorm_97().
Referenced by compress_cblk().
|
private |
References flags_, flagsLen_, getFlagsHeight(), getFlagsStride(), h_, T1_PI_0, T1_PI_1, T1_PI_2, and T1_PI_3.
Referenced by alloc().
| void grk::t1::BlockCoder::print | ( | void | ) |
References coder.
| void grk::t1::BlockCoder::setFinalLayer | ( | bool | isFinal | ) |
References coder.
|
private |
Referenced by alloc(), BlockCoder(), decompress_cblk(), decompressBackup(), and decompressPass().
|
private |
Referenced by BlockCoder(), checkSegSym(), compress_cblk(), decompress_cblk(), decompressBackup(), decompressFinish(), decompressInitOrientation(), decompressInitSegment(), decompressPass(), decompressRestore(), decompressUpdateSegment(), enc_clnpass(), enc_refpass(), enc_sigpass(), print(), and setFinalLayer().
|
private |
Referenced by alloc(), and BlockCoder().
|
private |
Flags used by decompressor and compressor.
Such that flags[1+0] is for state of col=0,row=0..3, flags[1+1] for col=1, row=0..3, flags[1+flagsStride] for col=0,row=4..7, ... This array avoids too much cache trashing when processing by 4 vertical samples as done in the various decoding steps.
Referenced by alloc(), BlockCoder(), dec_refpass_raw(), dec_sigpass_raw(), decompressBackup(), decompressRestore(), enc_clnpass(), enc_refpass(), enc_sigpass(), initFlags(), and ~BlockCoder().
|
private |
Referenced by alloc(), BlockCoder(), decompressBackup(), decompressRestore(), and initFlags().
|
private |
cached block height
Referenced by alloc(), BlockCoder(), dec_clnpass(), dec_clnpass(), dec_clnpass_diff(), dec_clnpass_diff(), dec_clnpass_diff_final(), dec_clnpass_diff_final(), dec_refpass(), dec_refpass_diff(), dec_refpass_diff_final(), dec_refpass_raw(), dec_sigpass(), dec_sigpass(), dec_sigpass_diff(), dec_sigpass_diff(), dec_sigpass_diff_final(), dec_sigpass_diff_final(), dec_sigpass_raw(), decompressBackup(), decompressRestore(), enc_clnpass(), enc_refpass(), enc_sigpass(), getFlagsHeight(), and initFlags().
|
private |
cached block stride
Referenced by alloc(), BlockCoder(), enc_clnpass(), enc_refpass(), and enc_sigpass().
|
private |
uncompressed data buffer
Referenced by alloc(), and getUncompressedData().
|
private |
pointer to uncompressedBuf_ data
Referenced by alloc(), BlockCoder(), dec_refpass_raw(), dec_sigpass_raw(), decompressBackup(), decompressRestore(), enc_clnpass(), enc_refpass(), and enc_sigpass().
|
private |
cached block width
Referenced by alloc(), BlockCoder(), dec_clnpass(), dec_clnpass(), dec_clnpass_diff(), dec_clnpass_diff(), dec_clnpass_diff_final(), dec_clnpass_diff_final(), dec_refpass(), dec_refpass_diff(), dec_refpass_diff_final(), dec_refpass_raw(), dec_sigpass(), dec_sigpass(), dec_sigpass_diff(), dec_sigpass_diff(), dec_sigpass_diff_final(), dec_sigpass_diff_final(), dec_sigpass_raw(), dec_sigpass_step_raw(), decompressBackup(), decompressRestore(), enc_clnpass(), enc_refpass(), enc_sigpass(), and getFlagsStride().