OpenJPH: ojph::local::param_qcd Struct Reference

OpenJPH Open-source implementation of JPEG2000 Part-15

Loading...
Searching...
No Matches
ojph::local::param_qcd Struct Reference

`#include <ojph_params_local.h>`

## Public Types
enum | default_comp_num : ui16 { OJPH_QCD_UNKNOWN = 65534 , OJPH_QCD_DEFAULT = 65535 }
enum | qcd_type : ui8 { UNDEFINED = 0 , QCD_MAIN = 1 , QCC_MAIN = 2 , QCD_TILE = 3 , QCC_TILE = 4 }
enum | qfactor_const : ui8 { QFACTOR_UNSET = 0 }
using | comp_type = ojph::param_qcd::comp_type

## Public Member Functions
| param_qcd (param_qcd *top_qcd=NULL, ui16 comp_idx=OJPH_QCD_DEFAULT)
| ~param_qcd ()
void | restart ()
void | check_validity (const param_siz &siz, const param_cod &cod)
void | make_quant_steps (ui32 comp_num, const param_cod &cod, const param_siz &siz)
bool | is_qcc_needed (ui32 comp_num, const param_cod &cod, const param_siz &siz)
void | set_delta (float delta)
void | set_qfactor (ui8 qfactor)
ui32 | get_num_guard_bits () const
ui32 | get_MAGB () const
ui32 | get_Kmax (const param_dfs *dfs, ui32 num_decompositions, ui32 resolution, ui32 subband) const
ui32 | propose_precision (const param_cod *cod) const
float | get_irrev_delta (const param_dfs *dfs, ui32 num_decompositions, ui32 comp_num, ui32 resolution, ui32 subband) const
bool | write (outfile_base *file)
bool | write_qcc (outfile_base *file, ui32 num_comps)
void | read (infile_base *file)
void | read_qcc (infile_base *file, ui32 num_comps)
void | set_delta (ui32 comp_idx, float delta)
void | set_qfactor (ui32 comp_idx, comp_type ctype, ui8 qfactor)
param_qcd * | get_qcc (ui32 comp_idx)
const param_qcd * | get_qcc (ui32 comp_idx) const
param_qcd * | add_qcc_object (ui32 comp_idx)
ui16 | get_comp_idx () const

## Private Member Functions
void | init (param_qcd *top_qcd, ui16 comp_idx)
void | destroy ()
void | set_rev_quant (ui32 num_decomps, ui32 bit_depth, bool is_employing_color_transform)
void | set_irrev_quant (ui32 num_decomps)
void | encode_SPqcd (ui32 subband_index, float delta)
ui32 | get_largest_Kmax () const
bool | internal_write_qcc (outfile_base *file, ui32 num_comps)
void | trim_non_existing_components (ui32 num_comps)
ui8 | decode_SPqcd (ui8 v) const
ui8 | encode_SPqcd (ui8 v) const

## Private Attributes
qcd_type | type
bool | is_init
ui16 | Lqcd
ui8 | Sqcd
union { |
ui8 u8 [97] |
ui16 u16 [97] |
} | SPqcd
ui32 | num_subbands
bool | enabled
param_qcd * | next
param_qcd * | top_qcd
float | base_delta
ui8 | qfactor
comp_type | ctype
bool | is_color_trans
ui32 | num_decomps
ui32 | bit_depth
bool | is_signed
ui32 | wavelet_kern
ojph::point | sampling
ui16 | comp_idx
param_qcd * | avail

## Detailed Description

Definition at line 686 of file ojph_params_local.h.

## Member Typedef Documentation

## ◆ comp_type

using ojph::local::param_qcd::comp_type = ojph::param_qcd::comp_type

Definition at line 710 of file ojph_params_local.h.

## Member Enumeration Documentation

## ◆ default_comp_num

enum ojph::local::param_qcd::default_comp_num : ui16

Enumerator
OJPH_QCD_UNKNOWN |
OJPH_QCD_DEFAULT |

Definition at line 690 of file ojph_params_local.h.

## ◆ qcd_type

enum ojph::local::param_qcd::qcd_type : ui8

Enumerator
UNDEFINED |
QCD_MAIN |
QCC_MAIN |
QCD_TILE |
QCC_TILE |

Definition at line 696 of file ojph_params_local.h.

## ◆ qfactor_const

enum ojph::local::param_qcd::qfactor_const : ui8

Enumerator
QFACTOR_UNSET |

Definition at line 705 of file ojph_params_local.h.

## Constructor & Destructor Documentation

## ◆ param_qcd()

ojph::local::param_qcd::param_qcd | ( | param_qcd * | top_qcd = NULL,
|  | ui16 | comp_idx = OJPH_QCD_DEFAULT )
| inline

Definition at line 713 of file ojph_params_local.h.

References avail, comp_idx, init(), OJPH_QCD_DEFAULT, param_qcd(), and top_qcd.

Referenced by add_qcc_object(), check_validity(), get_MAGB(), get_qcc(), get_qcc(), init(), param_qcd(), propose_precision(), restart(), set_delta(), set_qfactor(), trim_non_existing_components(), and write_qcc().

## ◆ ~param_qcd()

ojph::local::param_qcd::~param_qcd | ( |  | ) |
| inline

Definition at line 715 of file ojph_params_local.h.

References destroy().

## Member Function Documentation

## ◆ add_qcc_object()

param_qcd * ojph::local::param_qcd::add_qcc_object | ( | ui32 | comp_idx | ) |

Definition at line 2061 of file ojph_params.cpp.

References avail, comp_idx, init(), next, param_qcd(), QCD_MAIN, and type.

Referenced by check_validity(), set_delta(), and set_qfactor().

## ◆ check_validity()

void ojph::local::param_qcd::check_validity | ( | const param_siz & | siz,
|  | const param_cod & | cod )

Definition at line 1359 of file ojph_params.cpp.

References add_qcc_object(), base_delta, ojph::local::param_cod::get_coc(), ojph::local::param_siz::get_num_components(), get_qcc(), is_qcc_needed(), make_quant_steps(), param_qcd(), QCD_MAIN, qfactor, QFACTOR_UNSET, set_delta(), set_qfactor(), trim_non_existing_components(), type, and ojph::param_qcd::ui8_2_comp_type().

## ◆ decode_SPqcd()

ui8 ojph::local::param_qcd::decode_SPqcd | ( | ui8 | v | ) | const
| inlineprivate

Definition at line 794 of file ojph_params_local.h.

Referenced by get_Kmax(), get_largest_Kmax(), and get_MAGB().

## ◆ destroy()

void ojph::local::param_qcd::destroy | ( |  | ) |
| inlineprivate

Definition at line 775 of file ojph_params_local.h.

References avail, and next.

Referenced by ~param_qcd().

## ◆ encode_SPqcd() [1/2]

void ojph::local::param_qcd::encode_SPqcd | ( | ui32 | subband_index,
|  | float | delta )
| private

Definition at line 1602 of file ojph_params.cpp.

References SPqcd.

Referenced by set_irrev_quant(), and set_rev_quant().

## ◆ encode_SPqcd() [2/2]

ui8 ojph::local::param_qcd::encode_SPqcd | ( | ui8 | v | ) | const
| inlineprivate

Definition at line 796 of file ojph_params_local.h.

## ◆ get_comp_idx()

ui16 ojph::local::param_qcd::get_comp_idx | ( |  | ) | const
| inline

Definition at line 752 of file ojph_params_local.h.

References comp_idx.

Referenced by ojph::local::codestream::read_headers().

## ◆ get_irrev_delta()

float ojph::local::param_qcd::get_irrev_delta | ( | const param_dfs * | dfs,
|  | ui32 | num_decompositions,
|  | ui32 | comp_num,
|  | ui32 | resolution,
|  | ui32 | subband ) const

Definition at line 1650 of file ojph_params.cpp.

References ojph::local::param_dfs::exists(), ojph::local::param_dfs::get_subband_idx(), num_subbands, OJPH_ERROR, OJPH_INFO, SPqcd, and Sqcd.

Referenced by ojph::local::subband::finalize_alloc().

## ◆ get_Kmax()

ui32 ojph::local::param_qcd::get_Kmax | ( | const param_dfs * | dfs,
|  | ui32 | num_decompositions,
|  | ui32 | resolution,
|  | ui32 | subband ) const

Definition at line 1715 of file ojph_params.cpp.

References decode_SPqcd(), ojph::local::param_dfs::exists(), get_num_guard_bits(), ojph::local::param_dfs::get_subband_idx(), num_subbands, OJPH_INFO, SPqcd, and Sqcd.

Referenced by ojph::local::subband::finalize_alloc().

## ◆ get_largest_Kmax()

ui32 ojph::local::param_qcd::get_largest_Kmax | ( |  | ) | const
| private

Definition at line 1751 of file ojph_params.cpp.

References decode_SPqcd(), get_num_guard_bits(), num_subbands, ojph_max, SPqcd, and Sqcd.

Referenced by propose_precision().

## ◆ get_MAGB()

ui32 ojph::local::param_qcd::get_MAGB | ( |  | ) | const

Definition at line 1615 of file ojph_params.cpp.

References decode_SPqcd(), get_num_guard_bits(), next, num_decomps, num_subbands, ojph_max, param_qcd(), SPqcd, Sqcd, u16, and u8.

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

## ◆ get_num_guard_bits()

ui32 ojph::local::param_qcd::get_num_guard_bits | ( |  | ) | const

Definition at line 1709 of file ojph_params.cpp.

References Sqcd.

Referenced by get_Kmax(), get_largest_Kmax(), and get_MAGB().

## ◆ get_qcc() [1/2]

param_qcd * ojph::local::param_qcd::get_qcc | ( | ui32 | comp_idx | ) |

Definition at line 2038 of file ojph_params.cpp.

References comp_idx, get_qcc(), and param_qcd().

Referenced by check_validity(), ojph::local::resolution::finalize_alloc(), ojph::local::subband::finalize_alloc(), get_qcc(), ojph::local::resolution::pre_alloc(), ojph::local::subband::pre_alloc(), propose_precision(), set_delta(), and set_qfactor().

## ◆ get_qcc() [2/2]

const param_qcd * ojph::local::param_qcd::get_qcc | ( | ui32 | comp_idx | ) | const

Definition at line 2047 of file ojph_params.cpp.

References comp_idx, next, param_qcd(), QCD_MAIN, top_qcd, and type.

## ◆ init()

void ojph::local::param_qcd::init | ( | param_qcd * | top_qcd,
|  | ui16 | comp_idx )
| inlineprivate

Definition at line 756 of file ojph_params_local.h.

References base_delta, comp_idx, ctype, enabled, is_init, Lqcd, next, num_subbands, param_qcd(), QCC_MAIN, QCD_MAIN, qfactor, QFACTOR_UNSET, sampling, SPqcd, Sqcd, top_qcd, and type.

Referenced by add_qcc_object(), param_qcd(), and restart().

## ◆ internal_write_qcc()

bool ojph::local::param_qcd::internal_write_qcc | ( | outfile_base * | file,
|  | ui32 | num_comps )
| private

Definition at line 1837 of file ojph_params.cpp.

References comp_idx, Lqcd, num_subbands, ojph::local::QCC, SPqcd, Sqcd, ojph::swap_bytes_if_le(), and ojph::outfile_base::write().

Referenced by write_qcc().

## ◆ is_qcc_needed()

bool ojph::local::param_qcd::is_qcc_needed | ( | ui32 | comp_num,
|  | const param_cod & | cod,
|  | const param_siz & | siz )

Definition at line 1470 of file ojph_params.cpp.

References bit_depth, ojph::local::param_siz::get_bit_depth(), ojph::local::param_cod::get_num_decompositions(), ojph::local::param_cod::get_wavelet_kern(), is_color_trans, ojph::local::param_cod::is_employing_color_transform(), is_init, is_signed, ojph::local::param_siz::is_signed(), num_decomps, OJPH_ERROR, and wavelet_kern.

Referenced by check_validity().

## ◆ make_quant_steps()

void ojph::local::param_qcd::make_quant_steps | ( | ui32 | comp_num,
|  | const param_cod & | cod,
|  | const param_siz & | siz )

Definition at line 1435 of file ojph_params.cpp.

References base_delta, bit_depth, ojph::local::param_cod::DWT_IRV97, ojph::local::param_cod::DWT_REV53, ojph::local::param_siz::get_bit_depth(), ojph::local::param_siz::get_downsampling(), ojph::local::param_cod::get_num_decompositions(), ojph::local::param_cod::get_wavelet_kern(), is_color_trans, ojph::local::param_cod::is_employing_color_transform(), is_init, is_signed, ojph::local::param_siz::is_signed(), num_decomps, num_subbands, OJPH_ERROR, ojph_min, OJPH_WARN, qfactor, QFACTOR_UNSET, sampling, set_irrev_quant(), set_rev_quant(), and wavelet_kern.

Referenced by check_validity().

## ◆ propose_precision()

ui32 ojph::local::param_qcd::propose_precision | ( | const param_cod * | cod | ) | const

Definition at line 1684 of file ojph_params.cpp.

References comp_idx, ojph::local::param_cod::get_coc(), ojph::local::param_cod::get_comp_idx(), get_largest_Kmax(), get_qcc(), main(), ojph::local::param_cod::OJPH_COD_DEFAULT, ojph_max, and param_qcd().

Referenced by ojph::local::resolution::finalize_alloc(), ojph::local::subband::finalize_alloc(), and ojph::local::subband::pre_alloc().

## ◆ read()

void ojph::local::param_qcd::read | ( | infile_base * | file | ) |

Definition at line 1903 of file ojph_params.cpp.

References Lqcd, num_subbands, OJPH_ERROR, ojph::infile_base::read(), SPqcd, Sqcd, and ojph::swap_bytes_if_le().

## ◆ read_qcc()

void ojph::local::param_qcd::read_qcc | ( | infile_base * | file,
|  | ui32 | num_comps )

Definition at line 1950 of file ojph_params.cpp.

References comp_idx, Lqcd, num_subbands, OJPH_ERROR, ojph::infile_base::read(), SPqcd, Sqcd, and ojph::swap_bytes_if_le().

Referenced by ojph::local::codestream::read_headers().

## ◆ restart()

void ojph::local::param_qcd::restart | ( |  | ) |
| inline

Definition at line 718 of file ojph_params_local.h.

References avail, init(), next, OJPH_QCD_DEFAULT, param_qcd(), and top_qcd.

## ◆ set_delta() [1/2]

void ojph::local::param_qcd::set_delta | ( | float | delta | ) |
| inline

Definition at line 732 of file ojph_params_local.h.

References base_delta.

Referenced by check_validity(), and set_delta().

## ◆ set_delta() [2/2]

void ojph::local::param_qcd::set_delta | ( | ui32 | comp_idx,
|  | float | delta )

Definition at line 2011 of file ojph_params.cpp.

References add_qcc_object(), comp_idx, get_qcc(), param_qcd(), QCD_MAIN, set_delta(), and type.

## ◆ set_irrev_quant()

void ojph::local::param_qcd::set_irrev_quant | ( | ui32 | num_decomps | ) |
| private

Definition at line 1542 of file ojph_params.cpp.

References base_delta, bit_depth, ctype, encode_SPqcd(), ojph::local::visual_weights::get_delta_ref(), ojph::local::visual_weights::get_format(), ojph::local::visual_weights::get_gain(), ojph::local::sqrt_energy_gains::get_gain_h(), ojph::local::sqrt_energy_gains::get_gain_l(), ojph::local::visual_weights::get_no_weights(), ojph::local::visual_weights::get_weight(), ojph::local::visual_weights::get_weights(), num_decomps, OJPH_ERROR, qfactor, QFACTOR_UNSET, sampling, Sqcd, and ojph::local::visual_weights::VW_COLOUR_FORMAT_ERROR.

Referenced by make_quant_steps().

## ◆ set_qfactor() [1/2]

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

Definition at line 2021 of file ojph_params.cpp.

References add_qcc_object(), comp_idx, ctype, get_qcc(), OJPH_ERROR, param_qcd(), QCD_MAIN, qfactor, and type.

## ◆ set_qfactor() [2/2]

void ojph::local::param_qcd::set_qfactor | ( | ui8 | qfactor | ) |

Definition at line 1484 of file ojph_params.cpp.

References OJPH_ERROR, QCD_MAIN, qfactor, and type.

Referenced by check_validity().

## ◆ set_rev_quant()

void ojph::local::param_qcd::set_rev_quant | ( | ui32 | num_decomps,
|  | ui32 | bit_depth,
|  | bool | is_employing_color_transform )
| private

Definition at line 1495 of file ojph_params.cpp.

References bit_depth, encode_SPqcd(), ojph::local::bibo_gains::get_bibo_gain_h(), ojph::local::bibo_gains::get_bibo_gain_l(), num_decomps, OJPH_ERROR, ojph_max, SPqcd, and Sqcd.

Referenced by make_quant_steps().

## ◆ trim_non_existing_components()

void ojph::local::param_qcd::trim_non_existing_components | ( | ui32 | num_comps | ) |
| private

Definition at line 1890 of file ojph_params.cpp.

References comp_idx, enabled, next, OJPH_QCD_DEFAULT, param_qcd(), QCC_MAIN, QCD_MAIN, and type.

Referenced by check_validity().

## ◆ write()

bool ojph::local::param_qcd::write | ( | outfile_base * | file | ) |

Definition at line 1778 of file ojph_params.cpp.

References Lqcd, num_subbands, ojph::local::QCD, SPqcd, Sqcd, ojph::swap_bytes_if_le(), and ojph::outfile_base::write().

## ◆ write_qcc()

bool ojph::local::param_qcd::write_qcc | ( | outfile_base * | file,
|  | ui32 | num_comps )

Definition at line 1822 of file ojph_params.cpp.

References enabled, internal_write_qcc(), next, param_qcd(), QCD_MAIN, and type.

## Member Data Documentation

## ◆ avail

param_qcd* ojph::local::param_qcd::avail
| private

Definition at line 830 of file ojph_params_local.h.

Referenced by add_qcc_object(), destroy(), param_qcd(), and restart().

## ◆ base_delta

float ojph::local::param_qcd::base_delta
| private

Definition at line 815 of file ojph_params_local.h.

Referenced by check_validity(), init(), make_quant_steps(), set_delta(), and set_irrev_quant().

## ◆ bit_depth

ui32 ojph::local::param_qcd::bit_depth
| private

Definition at line 821 of file ojph_params_local.h.

Referenced by is_qcc_needed(), make_quant_steps(), set_irrev_quant(), and set_rev_quant().

## ◆ comp_idx

ui16 ojph::local::param_qcd::comp_idx
| private

Definition at line 827 of file ojph_params_local.h.

Referenced by add_qcc_object(), get_comp_idx(), get_qcc(), get_qcc(), init(), internal_write_qcc(), param_qcd(), propose_precision(), read_qcc(), set_delta(), set_qfactor(), and trim_non_existing_components().

## ◆ ctype

comp_type ojph::local::param_qcd::ctype
| private

Definition at line 818 of file ojph_params_local.h.

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

## ◆ enabled

bool ojph::local::param_qcd::enabled
| private

Definition at line 810 of file ojph_params_local.h.

Referenced by init(), trim_non_existing_components(), and write_qcc().

## ◆ is_color_trans

bool ojph::local::param_qcd::is_color_trans
| private

Definition at line 819 of file ojph_params_local.h.

Referenced by is_qcc_needed(), and make_quant_steps().

## ◆ is_init

bool ojph::local::param_qcd::is_init
| private

Definition at line 801 of file ojph_params_local.h.

Referenced by init(), is_qcc_needed(), and make_quant_steps().

## ◆ is_signed

bool ojph::local::param_qcd::is_signed
| private

Definition at line 822 of file ojph_params_local.h.

Referenced by is_qcc_needed(), and make_quant_steps().

## ◆ Lqcd

ui16 ojph::local::param_qcd::Lqcd
| private

Definition at line 802 of file ojph_params_local.h.

Referenced by init(), internal_write_qcc(), read(), read_qcc(), and write().

## ◆ next

param_qcd* ojph::local::param_qcd::next
| private

Definition at line 811 of file ojph_params_local.h.

Referenced by add_qcc_object(), destroy(), get_MAGB(), get_qcc(), init(), restart(), trim_non_existing_components(), and write_qcc().

## ◆ num_decomps

ui32 ojph::local::param_qcd::num_decomps
| private

Definition at line 820 of file ojph_params_local.h.

Referenced by get_MAGB(), is_qcc_needed(), make_quant_steps(), set_irrev_quant(), and set_rev_quant().

## ◆ num_subbands

ui32 ojph::local::param_qcd::num_subbands
| private

Definition at line 809 of file ojph_params_local.h.

Referenced by get_irrev_delta(), get_Kmax(), get_largest_Kmax(), get_MAGB(), init(), internal_write_qcc(), make_quant_steps(), read(), read_qcc(), and write().

## ◆ qfactor

ui8 ojph::local::param_qcd::qfactor
| private

Definition at line 817 of file ojph_params_local.h.

Referenced by check_validity(), init(), make_quant_steps(), set_irrev_quant(), set_qfactor(), and set_qfactor().

## ◆ sampling

ojph::point ojph::local::param_qcd::sampling
| private

Definition at line 824 of file ojph_params_local.h.

Referenced by init(), make_quant_steps(), and set_irrev_quant().

## ◆ [union]

union { ... } ojph::local::param_qcd::SPqcd

Referenced by encode_SPqcd(), get_irrev_delta(), get_Kmax(), get_largest_Kmax(), get_MAGB(), init(), internal_write_qcc(), read(), read_qcc(), set_rev_quant(), and write().

## ◆ Sqcd

ui8 ojph::local::param_qcd::Sqcd
| private

Definition at line 803 of file ojph_params_local.h.

Referenced by get_irrev_delta(), get_Kmax(), get_largest_Kmax(), get_MAGB(), get_num_guard_bits(), init(), internal_write_qcc(), read(), read_qcc(), set_irrev_quant(), set_rev_quant(), and write().

## ◆ top_qcd

param_qcd* ojph::local::param_qcd::top_qcd
| private

Definition at line 812 of file ojph_params_local.h.

Referenced by get_qcc(), init(), param_qcd(), and restart().

## ◆ type

qcd_type ojph::local::param_qcd::type
| private

Definition at line 800 of file ojph_params_local.h.

Referenced by add_qcc_object(), check_validity(), get_qcc(), init(), set_delta(), set_qfactor(), set_qfactor(), trim_non_existing_components(), and write_qcc().

## ◆ u16

ui16 ojph::local::param_qcd::u16[97]

Definition at line 807 of file ojph_params_local.h.

Referenced by get_MAGB().

## ◆ u8

ui8 ojph::local::param_qcd::u8[97]

Definition at line 806 of file ojph_params_local.h.

Referenced by get_MAGB().

## ◆ wavelet_kern

ui32 ojph::local::param_qcd::wavelet_kern
| private

Definition at line 823 of file ojph_params_local.h.

Referenced by is_qcc_needed(), and make_quant_steps().

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

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