grk::T1 Struct Reference

`#include <T1.h>`

## Public Member Functions

| T1 (bool isCompressor, uint32_t maxCblkW, uint32_t maxCblkH)
| ~T1 ()
bool | decompress_cblk (DecompressCodeblock *cblk, uint8_t *compressedData, uint8_t orientation, uint32_t cblksty)
void | code_block_enc_deallocate (cblk_enc *p_code_block)
| ENCODE ////////////////////////////////////////////////////.
bool | alloc (uint32_t w, uint32_t h)
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)
int32_t * | getUncompressedData (void)
void | attachUncompressedData (int32_t *data, uint32_t w, uint32_t h)
void | allocCompressedData (size_t len)
uint8_t * | getCompressedDataBuffer (void)

## Static Public Member Functions

static double | getnorm (uint32_t level, uint8_t orientation, bool reversible)

## Public Attributes

mqcoder | coder

## Private Member Functions

bool | allocUncompressedData (size_t len)
void | deallocUncompressedData (void)
template<uint32_t w, uint32_t h, bool vsc>
void | dec_clnpass (int32_t bpno)
void | dec_clnpass (int32_t bpno, int32_t cblksty)
void | dec_clnpass_check_segsym (int32_t cblksty)
void | dec_sigpass_raw (int32_t bpno, int32_t cblksty)
void | dec_refpass_raw (int32_t bpno)
void | dec_sigpass_mqc (int32_t bpno, int32_t cblksty)
void | dec_refpass_mqc (int32_t bpno)
void | dec_refpass_step_raw (grk_flag *flagsp, int32_t *datap, int32_t poshalf, uint32_t ci)
void | dec_sigpass_step_raw (grk_flag *flagsp, int32_t *datap, int32_t oneplushalf, uint32_t vsc, uint32_t ci)
void | enc_clnpass (int32_t bpno, int32_t *nmsedec, uint32_t cblksty)
void | enc_sigpass (int32_t bpno, int32_t *nmsedec, uint8_t type, uint32_t cblksty)
void | enc_refpass (int32_t bpno, int32_t *nmsedec, uint8_t type)
int | enc_is_term_pass (cblk_enc *cblk, uint32_t cblksty, int32_t bpno, uint32_t passtype)
bool | 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, int32_t bpno, uint32_t qmfbid, double stepsize, const double *mct_norms, uint32_t mct_numcomps)

## Private Attributes

int32_t * | uncompressedData
size_t | uncompressedDataLen
bool | ownsUncompressedData
uint32_t | w
uint32_t | h
uint32_t | uncompressedDataStride
uint8_t * | compressedData
size_t | compressedDataLen
grk_flag * | flags
| Flags used by decompressor and compressor.
uint32_t | flagssize
bool | compressor

## Constructor & Destructor Documentation

## T1()

grk::T1::T1 | ( | bool | isCompressor,
|  | uint32_t | maxCblkW,
|  | uint32_t | maxCblkH
| ) |  |

References allocCompressedData(), coder, and grk::grk_read().

## ~T1()

grk::T1::~T1 | ( |  | ) |

References compressedData, deallocUncompressedData(), flags, and grk::grk_aligned_free().

## Member Function Documentation

## alloc()

bool grk::T1::alloc | ( | uint32_t | w,
|  | uint32_t | h
| ) |  |

References allocUncompressedData(), compressor, flags, flagssize, grk::grk_aligned_free(), grk::grk_aligned_malloc(), grk::GRK_ERROR(), grk::grk_read(), h, T1_PI_0, T1_PI_1, T1_PI_2, T1_PI_3, uncompressedData, uncompressedDataStride, and w.

Referenced by attachUncompressedData(), and grk::t1_part1::T1Part1::preCompress().

## allocCompressedData()

void grk::T1::allocCompressedData | ( | size_t | len | ) |

References compressedData, compressedDataLen, and grk::grk_read().

Referenced by grk::t1_part1::T1Part1::decompress(), and T1().

## allocUncompressedData()

bool grk::T1::allocUncompressedData | ( | size_t | len | ) |

private

References deallocUncompressedData(), grk::grk_aligned_malloc(), grk::GRK_ERROR(), grk::grk_read(), ownsUncompressedData, uncompressedData, and uncompressedDataLen.

Referenced by alloc().

## attachUncompressedData()

void grk::T1::attachUncompressedData | ( | int32_t * | data,
|  | uint32_t | w,
|  | uint32_t | h
| ) |  |

References alloc(), deallocUncompressedData(), and uncompressedData.

Referenced by grk::t1_part1::T1Part1::decompress().

## code_block_enc_allocate()

bool grk::T1::code_block_enc_allocate | ( | cblk_enc * | p_code_block | ) |

private

References grk::grk_calloc(), and grk::grk_read().

Referenced by compress_cblk().

## code_block_enc_deallocate()

void grk::T1::code_block_enc_deallocate | ( | cblk_enc * | code_block | ) |

ENCODE ////////////////////////////////////////////////////.

Deallocate the compressing data of the given precinct.

References grk::grk_free(), and grk::grk_read().

Referenced by grk::t1_part1::T1Part1::compress().

## compress_cblk()

double grk::T1::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::cblk_enc::data, enc_clnpass(), enc_is_term_pass(), enc_refpass(), enc_sigpass(), grk::floorlog2(), getwmsedec(), GRK_CBLKSTY_LAZY, GRK_CBLKSTY_PTERM, GRK_CBLKSTY_RESET, GRK_CBLKSTY_SEGSYM, grk::grk_read(), lut_ctxno_zc, grk::mqc_bypass_flush_enc(), grk::mqc_bypass_get_extra_bytes_enc(), grk::mqc_bypass_init_enc(), grk::mqc_erterm_enc(), grk::mqc_flush_enc(), grk::mqc_init_enc(), grk::mqc_numbytes_enc(), grk::mqc_resetstates(), grk::mqc_restart_init_enc(), grk::mqc_segmark_enc(), grk::cblk_enc::numbps, grk::cblk_enc::numPassesTotal, grk::cblk_enc::passes, grk::pass_enc::rate, T1_NMSEDEC_FRACBITS, T1_TYPE_MQ, T1_TYPE_RAW, and grk::pass_enc::term.

Referenced by grk::t1_part1::T1Part1::compress().

## deallocUncompressedData()

void grk::T1::deallocUncompressedData | ( | void |  | ) |

private

References grk::grk_aligned_free(), ownsUncompressedData, and uncompressedData.

Referenced by allocUncompressedData(), attachUncompressedData(), and ~T1().

## dec_clnpass() [1/2]

template<uint32_t w, uint32_t h, bool vsc>

void grk::T1::dec_clnpass | ( | int32_t | bpno | ) |

private

References dec_clnpass_internal, grk::grk_read(), h, and w.

Referenced by decompress_cblk().

## dec_clnpass() [2/2]

void grk::T1::dec_clnpass | ( | int32_t | bpno,
|  | int32_t | cblksty
| ) |  |

private

References dec_clnpass_check_segsym(), dec_clnpass_internal, GRK_CBLKSTY_VSC, grk::grk_read(), h, and w.

## dec_clnpass_check_segsym()

void grk::T1::dec_clnpass_check_segsym | ( | int32_t | cblksty | ) |

private

References coder, GRK_CBLKSTY_SEGSYM, grk::grk_read(), grk::GRK_WARN(), mqc_decode, mqc_setcurctx, and T1_CTXNO_UNI.

Referenced by dec_clnpass().

## dec_refpass_mqc()

void grk::T1::dec_refpass_mqc | ( | int32_t | bpno | ) |

private

References dec_refpass_mqc_internal, grk::grk_read(), h, and w.

Referenced by decompress_cblk().

## dec_refpass_raw()

void grk::T1::dec_refpass_raw | ( | int32_t | bpno | ) |

private

References dec_refpass_step_raw(), flags, grk::grk_read(), h, uncompressedData, and w.

Referenced by decompress_cblk().

## dec_refpass_step_raw()

void grk::T1::dec_refpass_step_raw | ( | grk_flag * | flagsp,
|  | int32_t * | datap,
|  | int32_t | poshalf,
|  | uint32_t | ci
| ) |  |

inline private

References coder, grk::grk_read(), mqc_raw_decode(), T1_MU_THIS, T1_PI_THIS, and T1_SIGMA_THIS.

Referenced by dec_refpass_raw().

## dec_sigpass_mqc()

void grk::T1::dec_sigpass_mqc | ( | int32_t | bpno,
|  | int32_t | cblksty
| ) |  |

private

References dec_sigpass_mqc_internal, GRK_CBLKSTY_VSC, grk::grk_read(), h, and w.

Referenced by decompress_cblk().

## dec_sigpass_raw()

void grk::T1::dec_sigpass_raw | ( | int32_t | bpno,
|  | int32_t | cblksty
| ) |  |

private

References dec_sigpass_step_raw(), flags, GRK_CBLKSTY_VSC, grk::grk_read(), h, uncompressedData, and w.

Referenced by decompress_cblk().

## dec_sigpass_step_raw()

void grk::T1::dec_sigpass_step_raw | ( | grk_flag * | flagsp,
|  | int32_t * | datap,
|  | int32_t | oneplushalf,
|  | uint32_t | vsc,
|  | uint32_t | ci
| ) |  |

inline private

References coder, flags, grk::grk_read(), mqc_raw_decode(), T1_PI_THIS, T1_SIGMA_NEIGHBOURS, T1_SIGMA_THIS, grk::update_flags(), and w.

Referenced by dec_sigpass_raw().

## decompress_cblk()

bool grk::T1::decompress_cblk | ( | DecompressCodeblock * | cblk,
|  | uint8_t * | compressedData,
|  | uint8_t | orientation,
|  | uint32_t | cblksty
| ) |  |

References coder, compressedData, dec_clnpass(), dec_refpass_mqc(), dec_refpass_raw(), dec_sigpass_mqc(), dec_sigpass_raw(), grk::DecompressCodeblock::getNumSegments(), grk::DecompressCodeblock::getSegment(), GRK_CBLKSTY_LAZY, GRK_CBLKSTY_PTERM, GRK_CBLKSTY_RESET, grk::GRK_ERROR(), grk::grk_read(), grk::GRK_WARN(), lut_ctxno_zc, grk::mqcoder::lut_ctxno_zc_orient, grk::maxBitPlanesGRK, grk::mqc_finish_dec(), grk::mqc_init_dec(), grk::mqc_raw_init_dec(), grk::mqc_resetstates(), grk::Codeblock::numbps, T1_TYPE_MQ, and T1_TYPE_RAW.

Referenced by grk::t1_part1::T1Part1::decompress().

## enc_clnpass()

void grk::T1::enc_clnpass | ( | int32_t | bpno,
|  | int32_t * | nmsedec,
|  | uint32_t | cblksty
| ) |  |

private

References coder, flags, grk::getctxno_sc(), grk::getctxno_zc(), grk::getctxtno_sc_or_spb_index(), grk::getnmsedec_sig(), grk::getspb(), GRK_CBLKSTY_VSC, grk::grk_read(), h, mqc_encode_macro, POP_MQC, PUSH_MQC, smr_abs, smr_sign, T1_CTXNO_AGG, 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, uncompressedDataStride, grk::update_flags(), and w.

Referenced by compress_cblk().

## enc_is_term_pass()

int grk::T1::enc_is_term_pass | ( | cblk_enc * | cblk,
|  | uint32_t | cblksty,
|  | int32_t | bpno,
|  | uint32_t | passtype
| ) |  |

private

References GRK_CBLKSTY_LAZY, GRK_CBLKSTY_TERMALL, grk::grk_read(), and grk::cblk_enc::numbps.

Referenced by compress_cblk().

## enc_refpass()

void grk::T1::enc_refpass | ( | int32_t | bpno,
|  | int32_t * | nmsedec,
|  | uint8_t | type
| ) |  |

private

References coder, enc_refpass_step_macro, flags, grk::grk_read(), h, POP_MQC, PUSH_MQC, 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, uncompressedDataStride, and w.

Referenced by compress_cblk().

## enc_sigpass()

void grk::T1::enc_sigpass | ( | int32_t | bpno,
|  | int32_t * | nmsedec,
|  | uint8_t | type,
|  | uint32_t | cblksty
| ) |  |

private

References coder, enc_sigpass_step_macro, flags, GRK_CBLKSTY_VSC, grk::grk_read(), h, POP_MQC, PUSH_MQC, T1_NMSEDEC_FRACBITS, uncompressedData, uncompressedDataStride, and w.

Referenced by compress_cblk().

## getCompressedDataBuffer()

uint8_t * grk::T1::getCompressedDataBuffer | ( | void |  | ) |

References compressedData.

Referenced by grk::t1_part1::T1Part1::decompress().

## getnorm()

double grk::T1::getnorm | ( | uint32_t | level,
|  | uint8_t | orientation,
|  | bool | reversible
| ) |  |

static

References grk::dwt_norms, grk::dwt_norms_real, and grk::grk_read().

Referenced by grk::Quantizer::generate(), getnorm_53(), and getnorm_97().

## getnorm_53()

double grk::T1::getnorm_53 | ( | uint32_t | level,
|  | uint8_t | orientation
| ) |  |

private

Get the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT.

Parameters

  level | Level of the wavelet function
  orientation | Band of the wavelet function

Returns
  the norm of the wavelet function

References getnorm().

Referenced by getwmsedec().

## getnorm_97()

double grk::T1::getnorm_97 | ( | uint32_t | level,
|  | uint8_t | orientation
| ) |  |

private

Get the norm of a wavelet function of a subband at a specified level for the irreversible 9-7 DWT.

Parameters

  level | Level of the wavelet function
  orientation | Band of the wavelet function

Returns
  the norm of the 9-7 wavelet

References getnorm().

Referenced by getwmsedec().

## getUncompressedData()

int32_t * grk::T1::getUncompressedData | ( | void |  | ) |

References uncompressedData.

Referenced by grk::t1_part1::T1Part1::decompress(), and grk::t1_part1::T1Part1::preCompress().

## getwmsedec()

double grk::T1::getwmsedec | ( | int32_t | nmsedec,
|  | uint16_t | compno,
|  | uint32_t | level,
|  | uint8_t | orientation,
|  | int32_t | bpno,
|  | uint32_t | qmfbid,
|  | double | stepsize,
|  | const double * | mct_norms,
|  | uint32_t | mct_numcomps
| ) |  |

private

References getnorm_53(), getnorm_97(), and grk::grk_read().

Referenced by compress_cblk().

## Member Data Documentation

## coder

mqcoder grk::T1::coder

Referenced by compress_cblk(), dec_clnpass_check_segsym(), dec_refpass_step_raw(), dec_sigpass_step_raw(), decompress_cblk(), enc_clnpass(), enc_refpass(), enc_sigpass(), and T1().

## compressedData

uint8_t* grk::T1::compressedData

private

Referenced by allocCompressedData(), decompress_cblk(), getCompressedDataBuffer(), and ~T1().

## compressedDataLen

size_t grk::T1::compressedDataLen

private

Referenced by allocCompressedData().

## compressor

bool grk::T1::compressor

private

Referenced by alloc().

## flags

grk_flag* grk::T1::flags

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+flags_stride] 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(), dec_refpass_raw(), dec_sigpass_raw(), dec_sigpass_step_raw(), enc_clnpass(), enc_refpass(), enc_sigpass(), and ~T1().

## flagssize

uint32_t grk::T1::flagssize

private

Referenced by alloc().

## h

uint32_t grk::T1::h

private

Referenced by alloc(), dec_clnpass(), dec_clnpass(), dec_refpass_mqc(), dec_refpass_raw(), dec_sigpass_mqc(), dec_sigpass_raw(), enc_clnpass(), enc_refpass(), and enc_sigpass().

## ownsUncompressedData

bool grk::T1::ownsUncompressedData

private

Referenced by allocUncompressedData(), and deallocUncompressedData().

## uncompressedData

int32_t* grk::T1::uncompressedData

private

Referenced by alloc(), allocUncompressedData(), attachUncompressedData(), deallocUncompressedData(), dec_refpass_raw(), dec_sigpass_raw(), enc_clnpass(), enc_refpass(), enc_sigpass(), and getUncompressedData().

## uncompressedDataLen

size_t grk::T1::uncompressedDataLen

private

Referenced by allocUncompressedData().

## uncompressedDataStride

uint32_t grk::T1::uncompressedDataStride

private

Referenced by alloc(), enc_clnpass(), enc_refpass(), and enc_sigpass().

## w

uint32_t grk::T1::w

private

Referenced by alloc(), dec_clnpass(), dec_clnpass(), dec_refpass_mqc(), dec_refpass_raw(), dec_sigpass_mqc(), dec_sigpass_raw(), dec_sigpass_step_raw(), enc_clnpass(), enc_refpass(), and enc_sigpass().

The documentation for this struct was generated from the following files:

- T1.h
- T1.cpp