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 (ui8 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, ui8 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

enum ojph::param_qcd::comp_type : ui8

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.

## 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 411 of file ojph_params.cpp.

References 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 422 of file ojph_params.cpp.

References state.

## ◆ set_qfactor() [1/2]

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

Sets Qfactor for a specific component.

Setting Qfactor takes precedence over setting an irreversible quantization base delta

Parameters

  comp_idx | Component index
  ctype | Indicates whether the component is a Y, Cb or Cr channel, after the ICT if present
  qfactor | Compression quality as an integer between 1 (worst quality) and 100 (best quality)

Definition at line 428 of file ojph_params.cpp.

References state.

## ◆ set_qfactor() [2/2]

void ojph::param_qcd::set_qfactor | ( | ui8 | 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, ui8 qfactor);

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

Parameters

  qfactor | Compression quality as an integer between 1 (worst quality) and 100 (best quality)

Definition at line 417 of file ojph_params.cpp.

References state.

Referenced by main().

## ◆ ui8_2_comp_type()

comp_type ojph::param_qcd::ui8_2_comp_type | ( | ui8 | c | ) |
| inline static

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:

- /build/openjph/src/OpenJPH/src/core/openjph/ojph_params.h
- /build/openjph/src/OpenJPH/src/core/codestream/ojph_params.cpp