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_qfactor (float qfactor)
 Sets Qfactor.
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_qcdstate

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/2]

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(), and TEST().

◆ set_irrev_quant() [2/2]

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 424 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 419 of file ojph_params.cpp.

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

Referenced by main().

◆ 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 430 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

Definition at line 246 of file ojph_params.h.

Referenced by param_qcd(), set_irrev_quant(), set_irrev_quant(), set_qfactor(), and set_qfactor().


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