|
OpenJPH
Open-source implementation of JPEG2000 Part-15
|
non-linearity point transformation object (implements NLT marker segment) More...
#include <ojph_params.h>
Public Types | |
| enum | special_comp_num : ui16 { ALL_COMPS = 65535 } |
| enum | nonlinearity : ui8 { OJPH_NLT_NO_NLT = 0 , OJPH_NLT_GAMMA_STYLE_NLT = 1 , OJPH_NLT_LUT_STYLE_NLT = 2 , OJPH_NLT_BINARY_COMPLEMENT_NLT = 3 , OJPH_NLT_BINARY_COMPLEMENT_PLUS_LUT = 4 , OJPH_NLT_UNDEFINED = 255 } |
Public Member Functions | |
| param_nlt (local::param_nlt *p) | |
| void | set_nonlinear_transform (ui32 comp_num, ui8 nl_type) |
| void | set_nonlinear_transform (ui32 comp_num, ui8 decoded_bit_depth, bool decoded_signedness, ui32 d_min, ui32 d_max, ui8 pt_val, ui16 num_points, void *points, ui8 nl_type) |
| bool | get_nonlinear_transform (ui32 comp_num, ui8 &decoded_bit_depth, bool &decoded_signedness, ui8 &nl_type) const |
Private Attributes | |
| local::param_nlt * | state |
non-linearity point transformation object (implements NLT marker segment)
There are a few things to know here. The NLT marker segment contains the nonlinearity type and the bit depth and signedness of the component to which it applies. There is the default component ALL_COMPS which applies to all components unless it is overridden by another NLT segment marker. The library checks that the settings make sense, and also make sure that bit depth and signedness are correct, creating any missing NLT marker segments in the process. If all components have the same bit depth and signedness, and need nonlinearity type 3 (Binary Complement to Sign Magnitude Conversion), then the best option is to set ALL_COMPS to type 3. Otherwise, the best option is to set type 3 only to components that need it, leaving out the default ALL_COMPS nonlinearity not set. Another option is for the end-user can set the ALL_COMPS to type 3, and then put exception for the components that does not need type 3, by setting them to type 0.
The library, during validity check, which is run when the codestream is created for writing, will do the following: – If ALL_COMPS is set to type 0, it will be ignored, and the codestream will NOT have the corresponding NLT marker segment. – If ALL_COMPS is set to type 3, then the following will happen:
It also worth noting that type 3 nonlinearity has no effect on positive image samples. It is also not recommended for integer-valued types. It is only recommended for floating-point image samples, for which some of the samples are negative, where type 3 nonlinearity should be beneficial. This is because the encoding engine expects two-complement representation for negative values while floating point numbers have a sign bit followed by an exponent, which has a biased integer representation. The core idea is to make floating-point representation more compatible with integer representation.
Definition at line 299 of file ojph_params.h.
| enum ojph::param_nlt::nonlinearity : ui8 |
| Enumerator | |
|---|---|
| OJPH_NLT_NO_NLT | |
| OJPH_NLT_GAMMA_STYLE_NLT | |
| OJPH_NLT_LUT_STYLE_NLT | |
| OJPH_NLT_BINARY_COMPLEMENT_NLT | |
| OJPH_NLT_BINARY_COMPLEMENT_PLUS_LUT | |
| OJPH_NLT_UNDEFINED | |
Definition at line 303 of file ojph_params.h.
| Enumerator | |
|---|---|
| ALL_COMPS | |
Definition at line 302 of file ojph_params.h.
|
inline |
Definition at line 313 of file ojph_params.h.
References state.
Referenced by ojph::codestream::access_nlt().
| bool ojph::param_nlt::get_nonlinear_transform | ( | ui32 | comp_num, |
| ui8 & | decoded_bit_depth, | ||
| bool & | decoded_signedness, | ||
| ui8 & | nl_type ) const |
Definition at line 462 of file ojph_params.cpp.
References ojph::local::param_nlt::get_nonlinear_transform(), and state.
Referenced by TEST().
| void ojph::param_nlt::set_nonlinear_transform | ( | ui32 | comp_num, |
| ui8 | decoded_bit_depth, | ||
| bool | decoded_signedness, | ||
| ui32 | d_min, | ||
| ui32 | d_max, | ||
| ui8 | pt_val, | ||
| ui16 | num_points, | ||
| void * | points, | ||
| ui8 | nl_type ) |
Definition at line 450 of file ojph_params.cpp.
References ojph::local::param_nlt::set_nonlinear_transform(), and state.
Definition at line 444 of file ojph_params.cpp.
References ojph::local::param_nlt::set_nonlinear_transform(), and state.
Referenced by main().
|
private |
Definition at line 392 of file ojph_params.h.
Referenced by get_nonlinear_transform(), param_nlt(), set_nonlinear_transform(), and set_nonlinear_transform().