OpenJPH
Open-source implementation of JPEG2000 Part-15
Loading...
Searching...
No Matches
ojph::param_qcd Class Reference

Quantization parameters object. More...

#include <ojph_params.h>

Public Types

enum  comp_type : ui8 { OJPH_COMP_Y = 0 , OJPH_COMP_CB = 1 , OJPH_COMP_CR = 2 , OJPH_COMP_UNDEFINED = 0xFF }

Public Member Functions

 param_qcd (local::param_qcd *p)
void set_irrev_quant (float delta)
 Set the irreversible quantization base delta.
void set_irrev_quant (float delta, size_t num_weights, const float weights[])
 Set the irreversible reference quantization step size delta_r and weight coefficients sqrt(w_b) for all components.
void set_qfactor (float qfactor)
 Sets Qfactor.
void set_irrev_quant (ui32 comp_idx, float delta, size_t num_weights, const float weights[])
 Set the irreversible reference quantization step size delta_r and weight coefficients sqrt(w_b) for a specific component.
void set_irrev_quant (ui32 comp_idx, float delta)
 Set the irreversible quantization base delta for a specific component.
void set_qfactor (ui32 comp_idx, comp_type ctype, float qfactor)
 Sets Qfactor for a specific component.

Static Public Member Functions

static comp_type ui8_2_comp_type (ui8 c)

Private Attributes

local::param_qcd * state

Detailed Description

Quantization parameters object.

Definition at line 169 of file ojph_params.h.

Member Enumeration Documentation

◆ comp_type

Enumerator
OJPH_COMP_Y 
OJPH_COMP_CB 
OJPH_COMP_CR 
OJPH_COMP_UNDEFINED 

Definition at line 172 of file ojph_params.h.

Constructor & Destructor Documentation

◆ param_qcd()

ojph::param_qcd::param_qcd ( local::param_qcd * p)
inline

Definition at line 186 of file ojph_params.h.

References state.

Referenced by ojph::codestream::access_qcd().

Member Function Documentation

◆ set_irrev_quant() [1/4]

void ojph::param_qcd::set_irrev_quant ( float delta)

Set the irreversible quantization base delta.

This represents the default base delta and influences QCD marker segment

Parameters
delta

Definition at line 413 of file ojph_params.cpp.

References ojph::local::param_qcd::set_delta(), and state.

Referenced by LLVMFuzzerTestOneInput(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ set_irrev_quant() [2/4]

void ojph::param_qcd::set_irrev_quant ( float delta,
size_t num_weights,
const float weights[] )

Set the irreversible reference quantization step size delta_r and weight coefficients sqrt(w_b) for all components.

See also
set_irrev_quant(ui32, float, float*, size_t)
Parameters
deltaReference quantization step size delta_r
num_weightsNumber of coefficients in weights
weightsArray of weight coefficients sqrt(w_b) in subband order

Definition at line 419 of file ojph_params.cpp.

References ojph::local::param_qcd::set_delta(), and state.

◆ set_irrev_quant() [3/4]

void ojph::param_qcd::set_irrev_quant ( ui32 comp_idx,
float delta )

Set the irreversible quantization base delta for a specific component.

This represents the default base delta for component comp_idx, and influences QCC marker segment for the component, inserting one if needed, which is usually the case.

Parameters
comp_idx
delta

Definition at line 431 of file ojph_params.cpp.

References ojph::local::param_qcd::set_delta(), and state.

◆ set_irrev_quant() [4/4]

void ojph::param_qcd::set_irrev_quant ( ui32 comp_idx,
float delta,
size_t num_weights,
const float weights[] )

Set the irreversible reference quantization step size delta_r and weight coefficients sqrt(w_b) for a specific component.

The quantization step size delta_b for subband b is given by: delta_b = delta_r / sqrt(G_b * w_b * M_c) where G_b is the energy gain factor for the sub-band synthesis operator, w_b is the visual weight, and M_c accounts for the gain from the MCT/ICT. The b corresponds to the subband order:

{LH1, HL1, HH1, LH2, HL2, HH2 … , HHN, LLN}

Parameters
comp_idxTarget component
deltaReference quantization step size delta_r
num_weightsNumber of coefficients in weights
weightsArray of weight coefficients sqrt(w_b) in subband order

Definition at line 437 of file ojph_params.cpp.

References ojph::local::param_qcd::set_delta(), and state.

◆ set_qfactor() [1/2]

void ojph::param_qcd::set_qfactor ( float qfactor)

Sets Qfactor.

This is a top level Qfactor; it will automatically set the qfactor; if you have one or two channels they will be set to luminance (or Y) visual weighting. If you have three or more, the first three will be set to Y, Cb, Cr; channels 4 onwards will be set to luminance. If that does not match the desired behaviour; then do not set the top level qfactor, but set the Qfactor for individual channels according to desired visual weighting type, using set_qfactor(ui32 comp_idx, comp_type ctype, float qfactor);

Note that setting Qfactor takes precedence over setting an irreversible quantization base delta.

Parameters
qfactorCompression quality as an integer between 1 (worst quality) and 100 (best quality)

Definition at line 426 of file ojph_params.cpp.

References ojph::local::param_qcd::set_qfactor(), and state.

Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ set_qfactor() [2/2]

void ojph::param_qcd::set_qfactor ( ui32 comp_idx,
comp_type ctype,
float qfactor )

Sets Qfactor for a specific component.

Setting Qfactor takes precedence over setting an irreversible quantization base delta

Parameters
comp_idxComponent index
ctypeIndicates whether the component is a Y, Cb or Cr channel, after the ICT if present
qfactorCompression quality as an integer between 1 (worst quality) and 100 (best quality)

Definition at line 444 of file ojph_params.cpp.

References ojph::local::param_qcd::set_qfactor(), and state.

◆ ui8_2_comp_type()

comp_type ojph::param_qcd::ui8_2_comp_type ( ui8 c)
inlinestatic

Definition at line 178 of file ojph_params.h.

References OJPH_COMP_CR, OJPH_COMP_UNDEFINED, and OJPH_COMP_Y.

Referenced by ojph::local::param_qcd::check_validity().

Member Data Documentation

◆ state

local::param_qcd* ojph::param_qcd::state
private

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