39#ifndef OJPH_PARAMS_LOCAL_H
40#define OJPH_PARAMS_LOCAL_H
167 friend ::ojph::param_siz;
212 assert(comp_num <
Csiz);
213 assert(downsampling.
x != 0 && downsampling.
y != 0);
227 "You cannot set image extent nor tile size to zero");
230 "tile offset has to be smaller than image offset");
233 "the top left tile must intersect with the image");
239 assert(comp_num <
Csiz);
240 return (
cptr[comp_num].SSiz & 0x7F) + 1u;
244 assert(comp_num <
Csiz);
245 return (
cptr[comp_num].SSiz & 0x80) != 0;
249 assert(comp_num <
Csiz);
372 friend ::ojph::param_cod;
428 assert(val == 0 || val == 1);
443 "color transform can only be employed when the image has 3 or "
444 "more color components");
448 bool test_signedness =
false;
449 bool test_bit_depth =
false;
450 bool test_downsampling =
false;
454 for (
ui32 i = 1; i < 3; ++i)
457 test_downsampling = test_downsampling
458 || (p.
x != p1.
x || p.
y != p1.
y);
459 test_bit_depth = test_bit_depth
461 test_signedness = test_signedness
464 if (test_downsampling)
466 "when color transform is used, the first 3 colour components "
467 "must have the same downsampling factor.");
470 "when color transform is used, the first 3 colour components "
471 "must have the same bit depth.");
474 "when color transform is used, the first 3 colour components "
475 "must have the same signedness (signed or unsigned).");
484 for (
ui32 i = 0; i < num_comps; ++i)
487 if (r.
x & (r.
x - 1) || r.
y & (r.
y - 1))
488 OJPH_ERROR(0x00040013,
"For RPCL and PCRL progression orders,"
489 "component downsampling factors have to be powers of 2");
540 return size(1 << t.
w, 1 << t.
h);
556 return (
Scod & 2) == 2;
564 return (
Scod & 4) == 4;
644 friend ::ojph::param_qcd;
690 ui32 num_decompositions,
704 bool is_employing_color_transform);
711 {
return (
ui8)(v >> 3); }
713 {
return (
ui8)(v << 3); }
750 Cnlt = special_comp_num::ALL_COMPS;
752 Tnlt = nonlinearity::OJPH_NLT_UNDEFINED;
767 bool& is_signed,
ui8& nl_type)
const;
850 ui8 tile_part_index = 0,
ui8 num_tile_parts = 0)
853 Psot = payload_length + 12;
855 TPsot = tile_part_index;
856 TNsot = num_tile_parts;
1029 { 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
const param_atk * get_atk(int index) const
ui32 get_num_steps() const
bool is_reversible() const
bool read(infile_base *file)
void init(bool clear_all=true)
int get_coeff_type() const
bool read_coefficient(infile_base *file, float &K)
bool is_whole_sample() const
const lifting_step * get_step(ui32 s) const
void link(param_atk *next)
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 read_coc(infile_base *file, ui32 num_comps, param_cod *top_cod)
bool is_dfs_defined() const
bool packets_use_eph() const
ui8 get_num_decompositions() const
void update_atk(const param_atk *atk)
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
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)
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)
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)
union ojph::local::param_qcd::@6 SPqcd
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)