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;
228 "You cannot set image extent nor tile size to zero");
231 "tile offset has to be smaller than image offset");
234 "the top left tile must intersect with the image");
240 assert(comp_num <
Csiz);
241 return (
cptr[comp_num].SSiz & 0x7F) + 1u;
245 assert(comp_num <
Csiz);
246 return (
cptr[comp_num].SSiz & 0x80) != 0;
250 assert(comp_num <
Csiz);
373 friend ::ojph::param_cod;
423 assert(val == 0 || val == 1);
425 SGCod.mc_trans = val;
436 if (
SGCod.mc_trans == 1 && num_comps < 3)
438 "color transform can only be employed when the image has 3 or "
439 "more color components");
441 if (
SGCod.mc_trans == 1)
443 bool test_signedness =
false;
444 bool test_bit_depth =
false;
445 bool test_downsampling =
false;
449 for (
ui32 i = 1; i < 3; ++i)
452 test_downsampling = test_downsampling
453 || (p.
x != p1.
x || p.
y != p1.
y);
454 test_bit_depth = test_bit_depth
456 test_signedness = test_signedness
459 if (test_downsampling)
461 "when color transform is used, the first 3 colour components "
462 "must have the same downsampling factor.");
465 "when color transform is used, the first 3 colour components "
466 "must have the same bit depth.");
469 "when color transform is used, the first 3 colour components "
470 "must have the same signedness (signed or unsigned).");
479 for (
ui32 i = 0; i < num_comps; ++i)
482 if (r.
x & (r.
x - 1) || r.
y & (r.
y - 1))
483 OJPH_ERROR(0x00040013,
"For RPCL and PCRL progression orders,"
484 "component downsampling factors have to be powers of 2");
493 return SPcod.num_decomp;
497 return top_cod->get_num_decompositions();
499 return SPcod.num_decomp;
509 {
return SPcod.get_block_dims(); }
513 {
return SPcod.get_log_block_dims(); }
517 {
return SPcod.wavelet_trans; }
526 return (
SGCod.mc_trans == 1);
528 return top_cod->is_employing_color_transform();
535 return size(1 << t.
w, 1 << t.
h);
542 return SPcod.get_log_precinct_size(res_num);
551 return (
Scod & 2) == 2;
559 return (
Scod & 4) == 4;
597 {
return (
SPcod.num_decomp & 0x80) != 0; }
601 {
return SPcod.num_decomp & 0xF; }
665 friend ::ojph::param_qcd;
704 ui32 num_decompositions,
745 bool is_employing_color_transform);
752 {
return (
ui8)(v >> 3); }
754 {
return (
ui8)(v << 3); }
808 bool& is_signed,
ui8& nl_type)
const;
817 Cnlt = special_comp_num::ALL_COMPS;
819 Tnlt = nonlinearity::OJPH_NLT_UNDEFINED;
914 ui8 tile_part_index = 0,
ui8 num_tile_parts = 0)
917 Psot = payload_length + 12;
919 TPsot = tile_part_index;
920 TNsot = num_tile_parts;
1115 { 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
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
bool read_coefficient(infile_base *file, float &K)
param_atk * get_atk(int index)
bool is_whole_sample() const
const lifting_step * get_step(ui32 s) const
param_atk(param_atk *top_atk=NULL, ui8 type=OJPH_ATK_TOP)
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)
union ojph::local::param_qcd::@262151020275265050145105016205145272340175320315 SPqcd
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)
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 check_validity(const param_cod &cod)
bool write(outfile_base *file)
param_siz(const param_siz &)=delete
ui16 get_num_components() const
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()
ui32 get_height(ui32 comp_num) 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)
point get_downsampling(ui32 comp_num) const
void reset_Rsiz_flag(ui16 flag)
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)
ui32 get_width(ui32 comp_num) 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)