39#ifndef OJPH_PARAMS_LOCAL_H
40#define OJPH_PARAMS_LOCAL_H
167 friend ::ojph::param_siz;
213 assert(comp_num <
Csiz);
214 assert(downsampling.
x != 0 && downsampling.
y != 0);
216 cptr[comp_num].XRsiz = (
ui8)downsampling.
x;
217 cptr[comp_num].YRsiz = (
ui8)downsampling.
y;
239 "Image extent and/or tile size cannot be zero");
242 "Tile offset has to be smaller than the image offset");
245 "The top left tile must intersect with the image");
248 "The image extent must be larger than the image offset");
254 assert(comp_num <
Csiz);
255 return (
cptr[comp_num].SSiz & 0x7F) + 1u;
259 assert(comp_num <
Csiz);
260 return (
cptr[comp_num].SSiz & 0x80) != 0;
264 assert(comp_num <
Csiz);
387 friend ::ojph::param_cod;
437 assert(val == 0 || val == 1);
439 SGCod.mc_trans = val;
450 if (
SGCod.mc_trans == 1 && num_comps < 3)
452 "color transform can only be employed when the image has 3 or "
453 "more color components");
455 if (
SGCod.mc_trans == 1)
457 bool test_signedness =
false;
458 bool test_bit_depth =
false;
459 bool test_downsampling =
false;
463 for (
ui32 i = 1; i < 3; ++i)
466 test_downsampling = test_downsampling
467 || (p.
x != p1.
x || p.
y != p1.
y);
468 test_bit_depth = test_bit_depth
470 test_signedness = test_signedness
473 if (test_downsampling)
475 "when color transform is used, the first 3 colour components "
476 "must have the same downsampling factor.");
479 "when color transform is used, the first 3 colour components "
480 "must have the same bit depth.");
483 "when color transform is used, the first 3 colour components "
484 "must have the same signedness (signed or unsigned).");
493 for (
ui32 i = 0; i < num_comps; ++i)
496 if (r.
x & (r.
x - 1) || r.
y & (r.
y - 1))
497 OJPH_ERROR(0x00040013,
"For RPCL and PCRL progression orders,"
498 "component downsampling factors have to be powers of 2");
507 return SPcod.num_decomp;
511 return top_cod->get_num_decompositions();
513 return SPcod.num_decomp;
523 {
return SPcod.get_block_dims(); }
527 {
return SPcod.get_log_block_dims(); }
531 {
return SPcod.wavelet_trans; }
540 return (
SGCod.mc_trans == 1);
542 return top_cod->is_employing_color_transform();
549 return size(1 << t.
w, 1 << t.
h);
556 return SPcod.get_log_precinct_size(res_num);
565 return (
Scod & 2) == 2;
573 return (
Scod & 4) == 4;
611 {
return (
SPcod.num_decomp & 0x80) != 0; }
615 {
return SPcod.num_decomp & 0xF; }
679 friend ::ojph::param_qcd;
718 ui32 num_decompositions,
759 bool is_employing_color_transform);
766 {
return (
ui8)(v >> 3); }
768 {
return (
ui8)(v << 3); }
822 bool& is_signed,
ui8& nl_type)
const;
831 Cnlt = special_comp_num::ALL_COMPS;
833 Tnlt = nonlinearity::OJPH_NLT_UNDEFINED;
928 ui8 tile_part_index = 0,
ui8 num_tile_parts = 0)
931 Psot = payload_length + 12;
933 TPsot = tile_part_index;
934 TNsot = num_tile_parts;
1147 { assert(s <
Natk);
return d + s; }
const char OJPH_PN_STRING_BROADCAST[]
const char OJPH_PN_STRING_CINEMAS4K[]
const char OJPH_PO_STRING_PCRL[]
const char OJPH_PN_STRING_IMF[]
const char OJPH_PN_STRING_CINEMA4K[]
const char OJPH_PO_STRING_RLCP[]
const char OJPH_PN_STRING_CINEMA2K[]
const char OJPH_PO_STRING_RPCL[]
@ OJPH_TILEPART_RESOLUTIONS
@ OJPH_TILEPART_NO_DIVISIONS
@ OJPH_TILEPART_COMPONENTS
const char OJPH_PO_STRING_CPRL[]
const char OJPH_PN_STRING_PROFILE0[]
const char OJPH_PN_STRING_CINEMAS2K[]
const char OJPH_PO_STRING_LRCP[]
const char OJPH_PN_STRING_PROFILE1[]
#define ojph_div_ceil(a, b)
#define OJPH_ERROR(t,...)
size get_log_precinct_size(ui32 res_num) const
size get_block_dims() const
size get_log_block_dims() const
bool read_coefficient(infile_base *file, float &K, si32 &bytes)
void init(param_atk *top_atk)
ui32 get_num_steps() const
bool is_reversible() const
bool read(infile_base *file)
int get_coeff_type() const
param_atk * get_atk(int index)
bool is_whole_sample() const
const lifting_step * get_step(ui32 s) const
bool is_using_ws_extension() const
void check_validity(const param_cod &cod, const param_qcd &qcd)
void read(infile_base *file)
bool write(outfile_base *file)
void check_validity(const param_siz &siz)
bool write(outfile_base *file)
size get_block_dims() const
const param_cod * get_coc(ui32 comp_idx) const
bool internal_write_coc(outfile_base *file, ui32 num_comps)
size get_log_block_dims() const
ui16 get_dfs_index() const
bool write_coc(outfile_base *file, ui32 num_comps)
void set_reversible(bool reversible)
bool is_employing_color_transform() const
void employ_color_transform(ui8 val)
ui32 get_comp_idx() const
bool get_block_vertical_causality() const
const param_atk * access_atk() const
void read(infile_base *file)
size get_log_precinct_size(ui32 res_num) const
void init(param_cod *top_cod, ui16 comp_idx)
void read_coc(infile_base *file, ui32 num_comps, param_cod *top_cod)
void update_atk(param_atk *atk)
bool is_dfs_defined() const
bool packets_use_eph() const
ui8 get_num_decompositions() const
bool packets_may_use_sop() const
bool is_reversible() const
size get_precinct_size(ui32 res_num) const
param_cod(param_cod *top_cod=NULL, ui16 comp_idx=OJPH_COD_DEFAULT)
ui8 get_wavelet_kern() const
param_cod * add_coc_object(ui32 comp_idx)
bool read(infile_base *file)
dfs_dwt_type get_dwt_type(ui32 decomp_level) const
point get_res_downsamp(ui32 skipped_resolutions) const
ui32 get_subband_idx(ui32 num_decompositions, ui32 resolution, ui32 subband) const
const param_dfs * get_dfs(int index) const
ojph::param_nlt::special_comp_num special_comp_num
bool write(outfile_base *file) const
param_nlt * add_object(ui32 comp_num)
void trim_non_existing_components(ui32 num_comps)
void read(infile_base *file)
ojph::param_nlt::nonlinearity nonlinearity
bool get_nonlinear_transform(ui32 comp_num, ui8 &bit_depth, bool &is_signed, ui8 &nl_type) const
const param_nlt * get_nlt_object(ui32 comp_num) const
void check_validity(param_siz &siz)
bool is_any_enabled() const
void set_nonlinear_transform(ui32 comp_num, ui8 nl_type)
ui8 encode_SPqcd(ui8 v) const
bool write_qcc(outfile_base *file, ui32 num_comps)
void set_rev_quant(ui32 num_decomps, ui32 bit_depth, bool is_employing_color_transform)
void set_irrev_quant(ui32 num_decomps)
ui32 get_largest_Kmax() const
ui16 get_comp_idx() const
ui32 get_num_guard_bits() const
float get_irrev_delta(const param_dfs *dfs, ui32 num_decompositions, ui32 resolution, ui32 subband) const
void set_delta(float delta)
void read_qcc(infile_base *file, ui32 num_comps)
void check_validity(const param_siz &siz, const param_cod &cod)
bool write(outfile_base *file)
ui32 propose_precision(const param_cod *cod) const
void read(infile_base *file)
void init(param_qcd *top_qcd, ui16 comp_idx)
param_qcd * add_qcc_object(ui32 comp_idx)
ui32 get_Kmax(const param_dfs *dfs, ui32 num_decompositions, ui32 resolution, ui32 subband) const
ui8 decode_SPqcd(ui8 v) const
param_qcd * get_qcc(ui32 comp_idx)
param_qcd(param_qcd *top_qcd=NULL, ui16 comp_idx=OJPH_QCD_DEFAULT)
void trim_non_existing_components(ui32 num_comps)
bool internal_write_qcc(outfile_base *file, ui32 num_comps)
union ojph::local::param_qcd::@140013103227173134364232343330020031205064137337 SPqcd
void set_skipped_resolutions(ui32 skipped_resolutions)
ui32 get_bit_depth(ui32 comp_num) const
bool ws_kern_support_needed
ui32 get_recon_height(ui32 comp_num) const
bool is_signed(ui32 comp_num) const
void set_image_offset(point offset)
bool write(outfile_base *file)
param_siz(const param_siz &)=delete
ui16 get_num_components() const
void set_tile_size(size s)
point get_recon_downsampling(ui32 comp_num) const
void set_Rsiz_flag(ui16 flag)
point get_recon_size(ui32 comp_num) const
bool is_dfs_support_needed()
void set_cod(const param_cod &cod)
ui32 get_height(ui32 comp_num) const
point get_image_offset() const
void set_comp_info(ui32 comp_num, const point &downsampling, ui32 bit_depth, bool is_signed)
bool is_ws_kern_support_needed()
void link(const param_cod *cod)
size get_tile_size() const
point get_downsampling(ui32 comp_num) const
void reset_Rsiz_flag(ui16 flag)
point get_tile_offset() const
void set_tile_offset(point offset)
void read(infile_base *file)
param_siz & operator=(const param_siz &)=delete
void link(const param_dfs *dfs)
void set_num_components(ui32 num_comps)
void set_image_extent(point dims)
ui32 get_width(ui32 comp_num) const
point get_image_extent() const
ui32 get_recon_width(ui32 comp_num) const
ui8 get_num_tile_parts() const
void init(ui32 payload_length=0, ui16 tile_idx=0, ui8 tile_part_index=0, ui8 num_tile_parts=0)
ui16 get_tile_index() const
bool read(infile_base *file, bool resilient)
ui8 get_tile_part_index() const
ui32 get_payload_length() const
bool write(outfile_base *file, ui32 payload_len)
void set_next_pair(ui16 Ttlm, ui32 Ptlm)
bool write(outfile_base *file)
void init(ui32 num_pairs, Ttlm_Ptlm_pair *store)