OpenJPEG  2.2.0
Data Structures | Macros | Typedefs | Enumerations
J2K - JPEG-2000 codestream reader/writer

Data Structures

struct  opj_stepsize
 Quantization stepsize. More...
 
struct  opj_tccp
 Tile-component coding parameters. More...
 
struct  opj_mct_data
 FIXME DOC. More...
 
struct  opj_simple_mcc_decorrelation_data
 FIXME DOC. More...
 
struct  opj_ppx_struct
 
struct  opj_tcp
 Tile coding parameters : this structure is used to store coding/decoding parameters common to all tiles (information like COD, COC in main header) More...
 
struct  opj_encoding_param
 
struct  opj_decoding_param
 
struct  opj_cp
 Coding parameters. More...
 
struct  opj_j2k_dec
 
struct  opj_j2k_enc
 
struct  opj_j2k
 JPEG-2000 codestream reader/writer. More...
 

Macros

#define J2K_CP_CSTY_PRT   0x01
 
#define J2K_CP_CSTY_SOP   0x02
 
#define J2K_CP_CSTY_EPH   0x04
 
#define J2K_CCP_CSTY_PRT   0x01
 
#define J2K_CCP_CBLKSTY_LAZY   0x01
 Selective arithmetic coding bypass. More...
 
#define J2K_CCP_CBLKSTY_RESET   0x02
 Reset context probabilities on coding pass boundaries. More...
 
#define J2K_CCP_CBLKSTY_TERMALL   0x04
 Termination on each coding pass. More...
 
#define J2K_CCP_CBLKSTY_VSC   0x08
 Vertically stripe causal context. More...
 
#define J2K_CCP_CBLKSTY_PTERM   0x10
 Predictable termination. More...
 
#define J2K_CCP_CBLKSTY_SEGSYM   0x20
 Segmentation symbols are used. More...
 
#define J2K_CCP_QNTSTY_NOQNT   0
 
#define J2K_CCP_QNTSTY_SIQNT   1
 
#define J2K_CCP_QNTSTY_SEQNT   2
 
#define J2K_MS_SOC   0xff4f
 SOC marker value. More...
 
#define J2K_MS_SOT   0xff90
 SOT marker value. More...
 
#define J2K_MS_SOD   0xff93
 SOD marker value. More...
 
#define J2K_MS_EOC   0xffd9
 EOC marker value. More...
 
#define J2K_MS_SIZ   0xff51
 SIZ marker value. More...
 
#define J2K_MS_COD   0xff52
 COD marker value. More...
 
#define J2K_MS_COC   0xff53
 COC marker value. More...
 
#define J2K_MS_RGN   0xff5e
 RGN marker value. More...
 
#define J2K_MS_QCD   0xff5c
 QCD marker value. More...
 
#define J2K_MS_QCC   0xff5d
 QCC marker value. More...
 
#define J2K_MS_POC   0xff5f
 POC marker value. More...
 
#define J2K_MS_TLM   0xff55
 TLM marker value. More...
 
#define J2K_MS_PLM   0xff57
 PLM marker value. More...
 
#define J2K_MS_PLT   0xff58
 PLT marker value. More...
 
#define J2K_MS_PPM   0xff60
 PPM marker value. More...
 
#define J2K_MS_PPT   0xff61
 PPT marker value. More...
 
#define J2K_MS_SOP   0xff91
 SOP marker value. More...
 
#define J2K_MS_EPH   0xff92
 EPH marker value. More...
 
#define J2K_MS_CRG   0xff63
 CRG marker value. More...
 
#define J2K_MS_COM   0xff64
 COM marker value. More...
 
#define J2K_MS_CBD   0xff78
 CBD marker value. More...
 
#define J2K_MS_MCC   0xff75
 MCC marker value. More...
 
#define J2K_MS_MCT   0xff74
 MCT marker value. More...
 
#define J2K_MS_MCO   0xff77
 MCO marker value. More...
 
#define J2K_MS_UNK   0
 UNKNOWN marker value. More...
 
#define J2K_MS_EPC   0xff68
 EPC marker value (Part 11: JPEG 2000 for Wireless) More...
 
#define J2K_MS_EPB   0xff66
 EPB marker value (Part 11: JPEG 2000 for Wireless) More...
 
#define J2K_MS_ESD   0xff67
 ESD marker value (Part 11: JPEG 2000 for Wireless) More...
 
#define J2K_MS_RED   0xff69
 RED marker value (Part 11: JPEG 2000 for Wireless) More...
 
#define J2K_MS_SEC   0xff65
 SEC marker value (Part 8: Secure JPEG 2000) More...
 
#define J2K_MS_INSEC   0xff94
 INSEC marker value (Part 8: Secure JPEG 2000) More...
 

Typedefs

typedef enum J2K_STATUS J2K_STATUS
 Values that specify the status of the decoding process when decoding the main header. More...
 
typedef enum MCT_ELEMENT_TYPE J2K_MCT_ELEMENT_TYPE
 Type of elements storing in the MCT data. More...
 
typedef enum MCT_ARRAY_TYPE J2K_MCT_ARRAY_TYPE
 Type of MCT array. More...
 
typedef enum T2_MODE J2K_T2_MODE
 T2 encoding mode. More...
 
typedef struct opj_stepsize opj_stepsize_t
 Quantization stepsize. More...
 
typedef struct opj_tccp opj_tccp_t
 Tile-component coding parameters. More...
 
typedef struct opj_mct_data opj_mct_data_t
 FIXME DOC. More...
 
typedef struct opj_simple_mcc_decorrelation_data opj_simple_mcc_decorrelation_data_t
 FIXME DOC. More...
 
typedef struct opj_ppx_struct opj_ppx
 
typedef struct opj_tcp opj_tcp_t
 Tile coding parameters : this structure is used to store coding/decoding parameters common to all tiles (information like COD, COC in main header) More...
 
typedef struct opj_encoding_param opj_encoding_param_t
 
typedef struct opj_decoding_param opj_decoding_param_t
 
typedef struct opj_cp opj_cp_t
 Coding parameters. More...
 
typedef struct opj_j2k_dec opj_j2k_dec_t
 
typedef struct opj_j2k_enc opj_j2k_enc_t
 
typedef struct opj_j2k opj_j2k_t
 JPEG-2000 codestream reader/writer. More...
 

Enumerations

enum  J2K_STATUS {
  J2K_STATE_NONE = 0x0000, J2K_STATE_MHSOC = 0x0001, J2K_STATE_MHSIZ = 0x0002, J2K_STATE_MH = 0x0004,
  J2K_STATE_TPHSOT = 0x0008, J2K_STATE_TPH = 0x0010, J2K_STATE_MT = 0x0020, J2K_STATE_NEOC = 0x0040,
  J2K_STATE_DATA = 0x0080, J2K_STATE_EOC = 0x0100, J2K_STATE_ERR = 0x8000
}
 Values that specify the status of the decoding process when decoding the main header. More...
 
enum  MCT_ELEMENT_TYPE { MCT_TYPE_INT16 = 0, MCT_TYPE_INT32 = 1, MCT_TYPE_FLOAT = 2, MCT_TYPE_DOUBLE = 3 }
 Type of elements storing in the MCT data. More...
 
enum  MCT_ARRAY_TYPE { MCT_TYPE_DEPENDENCY = 0, MCT_TYPE_DECORRELATION = 1, MCT_TYPE_OFFSET = 2 }
 Type of MCT array. More...
 
enum  T2_MODE { THRESH_CALC = 0, FINAL_PASS = 1 }
 T2 encoding mode. More...
 

Local static functions

static OPJ_BOOL opj_j2k_setup_header_reading (opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
 Sets up the procedures to do on reading header. More...
 
static OPJ_BOOL opj_j2k_read_header_procedure (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 The read header procedure. More...
 
static OPJ_BOOL opj_j2k_encoding_validation (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 The default encoding validation procedure without any extension. More...
 
static OPJ_BOOL opj_j2k_decoding_validation (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 The default decoding validation procedure without any extension. More...
 
static OPJ_BOOL opj_j2k_setup_encoding_validation (opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
 Sets up the validation ,i.e. More...
 
static OPJ_BOOL opj_j2k_setup_decoding_validation (opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
 Sets up the validation ,i.e. More...
 
static OPJ_BOOL opj_j2k_setup_end_compress (opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
 Sets up the validation ,i.e. More...
 
static OPJ_BOOL opj_j2k_mct_validation (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 The mct encoding validation procedure. More...
 
static OPJ_BOOL opj_j2k_build_decoder (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Builds the tcd decoder to use to decode tile. More...
 
static OPJ_BOOL opj_j2k_build_encoder (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Builds the tcd encoder to use to encode tile. More...
 
static OPJ_BOOL opj_j2k_create_tcd (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Creates a tile-coder decoder. More...
 
static OPJ_BOOL opj_j2k_exec (opj_j2k_t *p_j2k, opj_procedure_list_t *p_procedure_list, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Excutes the given procedures on the given codec. More...
 
static OPJ_BOOL opj_j2k_update_rates (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Updates the rates of the tcp. More...
 
static OPJ_BOOL opj_j2k_copy_default_tcp_and_create_tcd (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Copies the decoding tile parameters onto all the tile parameters. More...
 
static OPJ_BOOL opj_j2k_destroy_header_memory (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Destroys the memory associated with the decoding of headers. More...
 
static const struct opj_dec_memory_marker_handleropj_j2k_get_marker_handler (OPJ_UINT32 p_id)
 Reads the lookup table containing all the marker, status and action, and returns the handler associated with the marker value. More...
 
static void opj_j2k_tcp_destroy (opj_tcp_t *p_tcp)
 Destroys a tile coding parameter structure. More...
 
static void opj_j2k_tcp_data_destroy (opj_tcp_t *p_tcp)
 Destroys the data inside a tile coding parameter structure. More...
 
static void opj_j2k_cp_destroy (opj_cp_t *p_cp)
 Destroys a coding parameter structure. More...
 
static OPJ_BOOL opj_j2k_compare_SPCod_SPCoc (opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_first_comp_no, OPJ_UINT32 p_second_comp_no)
 Compare 2 a SPCod/ SPCoc elements, i.e. More...
 
static OPJ_BOOL opj_j2k_write_SPCod_SPCoc (opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_comp_no, OPJ_BYTE *p_data, OPJ_UINT32 *p_header_size, opj_event_mgr_t *p_manager)
 Writes a SPCod or SPCoc element, i.e. More...
 
static OPJ_UINT32 opj_j2k_get_SPCod_SPCoc_size (opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_comp_no)
 Gets the size taken by writing a SPCod or SPCoc for the given tile and component. More...
 
static OPJ_BOOL opj_j2k_read_SPCod_SPCoc (opj_j2k_t *p_j2k, OPJ_UINT32 compno, OPJ_BYTE *p_header_data, OPJ_UINT32 *p_header_size, opj_event_mgr_t *p_manager)
 Reads a SPCod or SPCoc element, i.e. More...
 
static OPJ_UINT32 opj_j2k_get_SQcd_SQcc_size (opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_comp_no)
 Gets the size taken by writing SQcd or SQcc element, i.e. More...
 
static OPJ_BOOL opj_j2k_compare_SQcd_SQcc (opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_first_comp_no, OPJ_UINT32 p_second_comp_no)
 Compares 2 SQcd or SQcc element, i.e. More...
 
static OPJ_BOOL opj_j2k_write_SQcd_SQcc (opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_comp_no, OPJ_BYTE *p_data, OPJ_UINT32 *p_header_size, opj_event_mgr_t *p_manager)
 Writes a SQcd or SQcc element, i.e. More...
 
static void opj_j2k_update_tlm (opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_part_size)
 Updates the Tile Length Marker. More...
 
static OPJ_BOOL opj_j2k_read_SQcd_SQcc (opj_j2k_t *p_j2k, OPJ_UINT32 compno, OPJ_BYTE *p_header_data, OPJ_UINT32 *p_header_size, opj_event_mgr_t *p_manager)
 Reads a SQcd or SQcc element, i.e. More...
 
static void opj_j2k_copy_tile_component_parameters (opj_j2k_t *p_j2k)
 Copies the tile component parameters of all the component from the first tile component. More...
 
static void opj_j2k_copy_tile_quantization_parameters (opj_j2k_t *p_j2k)
 Copies the tile quantization parameters of all the component from the first tile component. More...
 
static OPJ_BOOL opj_j2k_decode_tiles (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Reads the tiles. More...
 
static OPJ_BOOL opj_j2k_pre_write_tile (opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_index, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 
static OPJ_BOOL opj_j2k_update_image_data (opj_tcd_t *p_tcd, OPJ_BYTE *p_data, opj_image_t *p_output_image)
 
static void opj_get_tile_dimensions (opj_image_t *l_image, opj_tcd_tilecomp_t *l_tilec, opj_image_comp_t *l_img_comp, OPJ_UINT32 *l_size_comp, OPJ_UINT32 *l_width, OPJ_UINT32 *l_height, OPJ_UINT32 *l_offset_x, OPJ_UINT32 *l_offset_y, OPJ_UINT32 *l_image_width, OPJ_UINT32 *l_stride, OPJ_UINT32 *l_tile_offset)
 
static void opj_j2k_get_tile_data (opj_tcd_t *p_tcd, OPJ_BYTE *p_data)
 
static OPJ_BOOL opj_j2k_post_write_tile (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 
static OPJ_BOOL opj_j2k_setup_header_writing (opj_j2k_t *p_j2k, opj_event_mgr_t *p_manager)
 Sets up the procedures to do on writing header. More...
 
static OPJ_BOOL opj_j2k_write_first_tile_part (opj_j2k_t *p_j2k, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, OPJ_UINT32 p_total_data_size, opj_stream_private_t *p_stream, struct opj_event_mgr *p_manager)
 
static OPJ_BOOL opj_j2k_write_all_tile_parts (opj_j2k_t *p_j2k, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, OPJ_UINT32 p_total_data_size, opj_stream_private_t *p_stream, struct opj_event_mgr *p_manager)
 
static OPJ_BOOL opj_j2k_get_end_header (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Gets the offset of the header. More...
 
static OPJ_BOOL opj_j2k_allocate_tile_element_cstr_index (opj_j2k_t *p_j2k)
 
static OPJ_BOOL opj_j2k_write_soc (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the SOC marker (Start Of Codestream) More...
 
static OPJ_BOOL opj_j2k_read_soc (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Reads a SOC marker (Start of Codestream) More...
 
static OPJ_BOOL opj_j2k_write_siz (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the SIZ marker (image and tile size) More...
 
static OPJ_BOOL opj_j2k_read_siz (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a SIZ marker (image and tile size) More...
 
static OPJ_BOOL opj_j2k_write_com (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the COM marker (comment) More...
 
static OPJ_BOOL opj_j2k_read_com (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a COM marker (comments) More...
 
static OPJ_BOOL opj_j2k_write_cod (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the COD marker (Coding style default) More...
 
static OPJ_BOOL opj_j2k_read_cod (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a COD marker (Coding Styke defaults) More...
 
static OPJ_BOOL opj_j2k_compare_coc (opj_j2k_t *p_j2k, OPJ_UINT32 p_first_comp_no, OPJ_UINT32 p_second_comp_no)
 Compares 2 COC markers (Coding style component) More...
 
static OPJ_BOOL opj_j2k_write_coc (opj_j2k_t *p_j2k, OPJ_UINT32 p_comp_no, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the COC marker (Coding style component) More...
 
static void opj_j2k_write_coc_in_memory (opj_j2k_t *p_j2k, OPJ_UINT32 p_comp_no, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, opj_event_mgr_t *p_manager)
 Writes the COC marker (Coding style component) More...
 
static OPJ_UINT32 opj_j2k_get_max_coc_size (opj_j2k_t *p_j2k)
 Gets the maximum size taken by a coc. More...
 
static OPJ_BOOL opj_j2k_read_coc (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a COC marker (Coding Style Component) More...
 
static OPJ_BOOL opj_j2k_write_qcd (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the QCD marker (quantization default) More...
 
static OPJ_BOOL opj_j2k_read_qcd (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a QCD marker (Quantization defaults) More...
 
static OPJ_BOOL opj_j2k_compare_qcc (opj_j2k_t *p_j2k, OPJ_UINT32 p_first_comp_no, OPJ_UINT32 p_second_comp_no)
 Compare QCC markers (quantization component) More...
 
static OPJ_BOOL opj_j2k_write_qcc (opj_j2k_t *p_j2k, OPJ_UINT32 p_comp_no, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the QCC marker (quantization component) More...
 
static void opj_j2k_write_qcc_in_memory (opj_j2k_t *p_j2k, OPJ_UINT32 p_comp_no, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, opj_event_mgr_t *p_manager)
 Writes the QCC marker (quantization component) More...
 
static OPJ_UINT32 opj_j2k_get_max_qcc_size (opj_j2k_t *p_j2k)
 Gets the maximum size taken by a qcc. More...
 
static OPJ_BOOL opj_j2k_read_qcc (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a QCC marker (Quantization component) More...
 
static OPJ_BOOL opj_j2k_write_poc (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the POC marker (Progression Order Change) More...
 
static void opj_j2k_write_poc_in_memory (opj_j2k_t *p_j2k, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, opj_event_mgr_t *p_manager)
 Writes the POC marker (Progression Order Change) More...
 
static OPJ_UINT32 opj_j2k_get_max_poc_size (opj_j2k_t *p_j2k)
 Gets the maximum size taken by the writing of a POC. More...
 
static OPJ_BOOL opj_j2k_read_poc (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a POC marker (Progression Order Change) More...
 
static OPJ_UINT32 opj_j2k_get_max_toc_size (opj_j2k_t *p_j2k)
 Gets the maximum size taken by the toc headers of all the tile parts of any given tile. More...
 
static OPJ_UINT32 opj_j2k_get_specific_header_sizes (opj_j2k_t *p_j2k)
 Gets the maximum size taken by the headers of the SOT. More...
 
static OPJ_BOOL opj_j2k_read_crg (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a CRG marker (Component registration) More...
 
static OPJ_BOOL opj_j2k_read_tlm (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a TLM marker (Tile Length Marker) More...
 
static OPJ_BOOL opj_j2k_write_updated_tlm (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the updated tlm. More...
 
static OPJ_BOOL opj_j2k_read_plm (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a PLM marker (Packet length, main header marker) More...
 
static OPJ_BOOL opj_j2k_read_plt (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a PLT marker (Packet length, tile-part header) More...
 
static OPJ_BOOL opj_j2k_read_ppm (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a PPM marker (Packed headers, main header) More...
 
static OPJ_BOOL opj_j2k_merge_ppm (opj_cp_t *p_cp, opj_event_mgr_t *p_manager)
 Merges all PPM markers read (Packed headers, main header) More...
 
static OPJ_BOOL opj_j2k_read_ppt (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a PPT marker (Packed packet headers, tile-part header) More...
 
static OPJ_BOOL opj_j2k_merge_ppt (opj_tcp_t *p_tcp, opj_event_mgr_t *p_manager)
 Merges all PPT markers read (Packed headers, tile-part header) More...
 
static OPJ_BOOL opj_j2k_write_tlm (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the TLM marker (Tile Length Marker) More...
 
static OPJ_BOOL opj_j2k_write_sot (opj_j2k_t *p_j2k, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, const opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the SOT marker (Start of tile-part) More...
 
static OPJ_BOOL opj_j2k_get_sot_values (OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, OPJ_UINT32 *p_tile_no, OPJ_UINT32 *p_tot_len, OPJ_UINT32 *p_current_part, OPJ_UINT32 *p_num_parts, opj_event_mgr_t *p_manager)
 Reads values from a SOT marker (Start of tile-part) More...
 
static OPJ_BOOL opj_j2k_read_sot (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a SOT marker (Start of tile-part) More...
 
static OPJ_BOOL opj_j2k_write_sod (opj_j2k_t *p_j2k, opj_tcd_t *p_tile_coder, OPJ_BYTE *p_data, OPJ_UINT32 *p_data_written, OPJ_UINT32 p_total_data_size, const opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the SOD marker (Start of data) More...
 
static OPJ_BOOL opj_j2k_read_sod (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Reads a SOD marker (Start Of Data) More...
 
static OPJ_BOOL opj_j2k_write_rgn (opj_j2k_t *p_j2k, OPJ_UINT32 p_tile_no, OPJ_UINT32 p_comp_no, OPJ_UINT32 nb_comps, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the RGN marker (Region Of Interest) More...
 
static OPJ_BOOL opj_j2k_read_rgn (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a RGN marker (Region Of Interest) More...
 
static OPJ_BOOL opj_j2k_write_eoc (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the EOC marker (End of Codestream) More...
 
static OPJ_BOOL opj_j2k_write_mct_data_group (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the CBD-MCT-MCC-MCO markers (Multi components transform) More...
 
static OPJ_BOOL opj_j2k_init_info (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Inits the Info. More...
 
static OPJ_BOOL opj_j2k_add_mhmarker (opj_codestream_index_t *cstr_index, OPJ_UINT32 type, OPJ_OFF_T pos, OPJ_UINT32 len)
 Add main header marker information. More...
 
static OPJ_BOOL opj_j2k_add_tlmarker (OPJ_UINT32 tileno, opj_codestream_index_t *cstr_index, OPJ_UINT32 type, OPJ_OFF_T pos, OPJ_UINT32 len)
 Add tile header marker information. More...
 
static OPJ_BOOL opj_j2k_read_unk (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, OPJ_UINT32 *output_marker, opj_event_mgr_t *p_manager)
 Reads an unknown marker. More...
 
static OPJ_BOOL opj_j2k_write_mct_record (opj_j2k_t *p_j2k, opj_mct_data_t *p_mct_record, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the MCT marker (Multiple Component Transform) More...
 
static OPJ_BOOL opj_j2k_read_mct (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a MCT marker (Multiple Component Transform) More...
 
static OPJ_BOOL opj_j2k_write_mcc_record (opj_j2k_t *p_j2k, opj_simple_mcc_decorrelation_data_t *p_mcc_record, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the MCC marker (Multiple Component Collection) More...
 
static OPJ_BOOL opj_j2k_read_mcc (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a MCC marker (Multiple Component Collection) More...
 
static OPJ_BOOL opj_j2k_write_mco (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the MCO marker (Multiple component transformation ordering) More...
 
static OPJ_BOOL opj_j2k_read_mco (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a MCO marker (Multiple Component Transform Ordering) More...
 
static OPJ_BOOL opj_j2k_add_mct (opj_tcp_t *p_tcp, opj_image_t *p_image, OPJ_UINT32 p_index)
 
static void opj_j2k_read_int16_to_float (const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
 
static void opj_j2k_read_int32_to_float (const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
 
static void opj_j2k_read_float32_to_float (const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
 
static void opj_j2k_read_float64_to_float (const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
 
static void opj_j2k_read_int16_to_int32 (const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
 
static void opj_j2k_read_int32_to_int32 (const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
 
static void opj_j2k_read_float32_to_int32 (const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
 
static void opj_j2k_read_float64_to_int32 (const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
 
static void opj_j2k_write_float_to_int16 (const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
 
static void opj_j2k_write_float_to_int32 (const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
 
static void opj_j2k_write_float_to_float (const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
 
static void opj_j2k_write_float_to_float64 (const void *p_src_data, void *p_dest_data, OPJ_UINT32 p_nb_elem)
 
static OPJ_BOOL opj_j2k_end_encoding (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Ends the encoding, i.e. More...
 
static OPJ_BOOL opj_j2k_write_cbd (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes the CBD marker (Component bit depth definition) More...
 
static OPJ_BOOL opj_j2k_read_cbd (opj_j2k_t *p_j2k, OPJ_BYTE *p_header_data, OPJ_UINT32 p_header_size, opj_event_mgr_t *p_manager)
 Reads a CBD marker (Component bit depth definition) More...
 
static OPJ_BOOL opj_j2k_write_all_coc (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes COC marker for each component. More...
 
static OPJ_BOOL opj_j2k_write_all_qcc (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes QCC marker for each component. More...
 
static OPJ_BOOL opj_j2k_write_regions (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes regions of interests. More...
 
static OPJ_BOOL opj_j2k_write_epc (opj_j2k_t *p_j2k, opj_stream_private_t *p_stream, opj_event_mgr_t *p_manager)
 Writes EPC ???? More...
 
static OPJ_BOOL opj_j2k_check_poc_val (const opj_poc_t *p_pocs, OPJ_UINT32 p_nb_pocs, OPJ_UINT32 p_nb_resolutions, OPJ_UINT32 numcomps, OPJ_UINT32 numlayers, opj_event_mgr_t *p_manager)
 Checks the progression order changes values. More...
 
static OPJ_UINT32 opj_j2k_get_num_tp (opj_cp_t *cp, OPJ_UINT32 pino, OPJ_UINT32 tileno)
 Gets the number of tile parts used for the given change of progression (if any) and the given tile. More...
 
static OPJ_BOOL opj_j2k_calculate_tp (opj_j2k_t *p_j2k, opj_cp_t *cp, OPJ_UINT32 *p_nb_tiles, opj_image_t *image, opj_event_mgr_t *p_manager)
 Calculates the total number of tile parts needed by the encoder to encode such an image. More...
 
static void opj_j2k_dump_MH_info (opj_j2k_t *p_j2k, FILE *out_stream)
 
static void opj_j2k_dump_MH_index (opj_j2k_t *p_j2k, FILE *out_stream)
 
static opj_codestream_index_topj_j2k_create_cstr_index (void)
 
static OPJ_FLOAT32 opj_j2k_get_tp_stride (opj_tcp_t *p_tcp)
 
static OPJ_FLOAT32 opj_j2k_get_default_stride (opj_tcp_t *p_tcp)
 
static int opj_j2k_initialise_4K_poc (opj_poc_t *POC, int numres)
 
static void opj_j2k_set_cinema_parameters (opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)
 
static OPJ_BOOL opj_j2k_is_cinema_compliant (opj_image_t *image, OPJ_UINT16 rsiz, opj_event_mgr_t *p_manager)
 
static OPJ_BOOL opj_j2k_need_nb_tile_parts_correction (opj_stream_private_t *p_stream, OPJ_UINT32 tile_no, OPJ_BOOL *p_correction_needed, opj_event_mgr_t *p_manager)
 Checks for invalid number of tile-parts in SOT marker (TPsot==TNsot). More...
 
#define OPJ_UNUSED(x)   (void)x
 

Exported functions

void opj_j2k_setup_decoder (opj_j2k_t *j2k, opj_dparameters_t *parameters)
 Setup the decoder decoding parameters using user parameters. More...
 
OPJ_BOOL opj_j2k_set_threads (opj_j2k_t *j2k, OPJ_UINT32 num_threads)
 
opj_j2k_topj_j2k_create_compress (void)
 Creates a J2K compression structure. More...
 
OPJ_BOOL opj_j2k_setup_encoder (opj_j2k_t *p_j2k, opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)
 
char * opj_j2k_convert_progression_order (OPJ_PROG_ORDER prg_order)
 Converts an enum type progression order to string type. More...
 

Detailed Description

Macro Definition Documentation

#define J2K_CCP_CBLKSTY_LAZY   0x01

Selective arithmetic coding bypass.

Referenced by opj_t1_decode_cblk(), opj_t1_enc_is_term_pass(), opj_t1_encode_cblk(), and opj_t2_init_seg().

#define J2K_CCP_CBLKSTY_PTERM   0x10

Predictable termination.

Referenced by opj_t1_encode_cblk(), and opj_tcd_t1_decode().

#define J2K_CCP_CBLKSTY_RESET   0x02

Reset context probabilities on coding pass boundaries.

Referenced by opj_t1_decode_cblk(), and opj_t1_encode_cblk().

#define J2K_CCP_CBLKSTY_SEGSYM   0x20

Segmentation symbols are used.

Referenced by opj_t1_dec_clnpass_check_segsym(), and opj_t1_encode_cblk().

#define J2K_CCP_CBLKSTY_TERMALL   0x04

Termination on each coding pass.

Referenced by opj_t1_enc_is_term_pass(), and opj_t2_init_seg().

#define J2K_CCP_CBLKSTY_VSC   0x08
#define J2K_CCP_CSTY_PRT   0x01
#define J2K_CCP_QNTSTY_NOQNT   0
#define J2K_CCP_QNTSTY_SEQNT   2

Referenced by opj_j2k_setup_encoder().

#define J2K_CCP_QNTSTY_SIQNT   1
#define J2K_CP_CSTY_EPH   0x04
#define J2K_CP_CSTY_PRT   0x01

Referenced by opj_j2k_read_cod().

#define J2K_CP_CSTY_SOP   0x02
#define J2K_MS_CBD   0xff78

CBD marker value.

Referenced by opj_j2k_write_cbd().

#define J2K_MS_COC   0xff53

COC marker value.

Referenced by opj_j2k_write_coc_in_memory().

#define J2K_MS_COD   0xff52
#define J2K_MS_COM   0xff64

COM marker value.

Referenced by opj_j2k_write_com().

#define J2K_MS_CRG   0xff63

CRG marker value.

#define J2K_MS_EOC   0xffd9
#define J2K_MS_EPB   0xff66

EPB marker value (Part 11: JPEG 2000 for Wireless)

#define J2K_MS_EPC   0xff68

EPC marker value (Part 11: JPEG 2000 for Wireless)

#define J2K_MS_EPH   0xff92

EPH marker value.

#define J2K_MS_ESD   0xff67

ESD marker value (Part 11: JPEG 2000 for Wireless)

#define J2K_MS_INSEC   0xff94

INSEC marker value (Part 8: Secure JPEG 2000)

#define J2K_MS_MCC   0xff75

MCC marker value.

Referenced by opj_j2k_write_mcc_record().

#define J2K_MS_MCO   0xff77

MCO marker value.

Referenced by opj_j2k_write_mco().

#define J2K_MS_MCT   0xff74

MCT marker value.

Referenced by opj_j2k_write_mct_record().

#define J2K_MS_PLM   0xff57

PLM marker value.

#define J2K_MS_PLT   0xff58

PLT marker value.

#define J2K_MS_POC   0xff5f

POC marker value.

Referenced by opj_j2k_write_poc_in_memory().

#define J2K_MS_PPM   0xff60

PPM marker value.

#define J2K_MS_PPT   0xff61

PPT marker value.

#define J2K_MS_QCC   0xff5d

QCC marker value.

Referenced by opj_j2k_write_qcc_in_memory().

#define J2K_MS_QCD   0xff5c

QCD marker value.

Referenced by opj_j2k_read_header_procedure(), and opj_j2k_write_qcd().

#define J2K_MS_RED   0xff69

RED marker value (Part 11: JPEG 2000 for Wireless)

#define J2K_MS_RGN   0xff5e

RGN marker value.

Referenced by opj_j2k_write_rgn().

#define J2K_MS_SEC   0xff65

SEC marker value (Part 8: Secure JPEG 2000)

#define J2K_MS_SIZ   0xff51

SIZ marker value.

Referenced by opj_j2k_read_header_procedure(), and opj_j2k_write_siz().

#define J2K_MS_SOC   0xff4f

SOC marker value.

Referenced by opj_j2k_read_soc(), and opj_j2k_write_soc().

#define J2K_MS_SOD   0xff93

SOD marker value.

Referenced by opj_j2k_read_sod(), opj_j2k_read_tile_header(), and opj_j2k_write_sod().

#define J2K_MS_SOP   0xff91

SOP marker value.

#define J2K_MS_SOT   0xff90
#define J2K_MS_TLM   0xff55

TLM marker value.

Referenced by opj_j2k_write_tlm().

#define J2K_MS_UNK   0

UNKNOWN marker value.

Referenced by opj_j2k_read_header_procedure(), and opj_j2k_read_unk().

#define OPJ_UNUSED (   x)    (void)x

Typedef Documentation

Type of MCT array.

Type of elements storing in the MCT data.

typedef enum J2K_STATUS J2K_STATUS

Values that specify the status of the decoding process when decoding the main header.

These values may be combined with a | operator.

typedef enum T2_MODE J2K_T2_MODE

T2 encoding mode.

typedef struct opj_cp opj_cp_t

Coding parameters.

typedef struct opj_j2k_dec opj_j2k_dec_t
typedef struct opj_j2k_enc opj_j2k_enc_t
typedef struct opj_j2k opj_j2k_t

JPEG-2000 codestream reader/writer.

typedef struct opj_mct_data opj_mct_data_t

FIXME DOC.

typedef struct opj_ppx_struct opj_ppx

FIXME DOC.

typedef struct opj_stepsize opj_stepsize_t

Quantization stepsize.

typedef struct opj_tccp opj_tccp_t

Tile-component coding parameters.

typedef struct opj_tcp opj_tcp_t

Tile coding parameters : this structure is used to store coding/decoding parameters common to all tiles (information like COD, COC in main header)

Enumeration Type Documentation

enum J2K_STATUS

Values that specify the status of the decoding process when decoding the main header.

These values may be combined with a | operator.

Enumerator
J2K_STATE_NONE 

a SOC marker is expected

J2K_STATE_MHSOC 

a SOC marker is expected

J2K_STATE_MHSIZ 

a SIZ marker is expected

J2K_STATE_MH 

the decoding process is in the main header

J2K_STATE_TPHSOT 

the decoding process is in a tile part header and expects a SOT marker

J2K_STATE_TPH 

the decoding process is in a tile part header

J2K_STATE_MT 

the EOC marker has just been read

J2K_STATE_NEOC 

the decoding process must not expect a EOC marker because the codestream is truncated

J2K_STATE_DATA 

a tile header has been successfully read and codestream is expected

J2K_STATE_EOC 

the decoding process has encountered the EOC marker

J2K_STATE_ERR 

the decoding process has encountered an error (FIXME warning V1 = 0x0080)

Type of MCT array.

Enumerator
MCT_TYPE_DEPENDENCY 
MCT_TYPE_DECORRELATION 
MCT_TYPE_OFFSET 

Type of elements storing in the MCT data.

Enumerator
MCT_TYPE_INT16 
MCT_TYPE_INT32 

MCT data is stored as signed shorts.

MCT_TYPE_FLOAT 

MCT data is stored as signed integers.

MCT_TYPE_DOUBLE 

MCT data is stored as floats.

enum T2_MODE

T2 encoding mode.

Enumerator
THRESH_CALC 
FINAL_PASS 

Function called in Rate allocation process.

Function Documentation

static void opj_get_tile_dimensions ( opj_image_t l_image,
opj_tcd_tilecomp_t l_tilec,
opj_image_comp_t l_img_comp,
OPJ_UINT32 l_size_comp,
OPJ_UINT32 l_width,
OPJ_UINT32 l_height,
OPJ_UINT32 l_offset_x,
OPJ_UINT32 l_offset_y,
OPJ_UINT32 l_image_width,
OPJ_UINT32 l_stride,
OPJ_UINT32 l_tile_offset 
)
static
static OPJ_BOOL opj_j2k_add_mct ( opj_tcp_t p_tcp,
opj_image_t p_image,
OPJ_UINT32  p_index 
)
static
static OPJ_BOOL opj_j2k_add_mhmarker ( opj_codestream_index_t cstr_index,
OPJ_UINT32  type,
OPJ_OFF_T  pos,
OPJ_UINT32  len 
)
static

Add main header marker information.

Parameters
cstr_indexCodestream information structure
typemarker type
posbyte offset of marker segment
lenlength of marker segment

References opj_marker_info::len, opj_codestream_index::marker, opj_codestream_index::marknum, opj_codestream_index::maxmarknum, OPJ_FALSE, opj_free(), opj_realloc(), OPJ_TRUE, opj_marker_info::pos, and opj_marker_info::type.

Referenced by opj_j2k_read_header_procedure(), opj_j2k_read_soc(), and opj_j2k_read_unk().

static OPJ_BOOL opj_j2k_add_tlmarker ( OPJ_UINT32  tileno,
opj_codestream_index_t cstr_index,
OPJ_UINT32  type,
OPJ_OFF_T  pos,
OPJ_UINT32  len 
)
static

Add tile header marker information.

Parameters
tilenotile index number
cstr_indexCodestream information structure
typemarker type
posbyte offset of marker segment
lenlength of marker segment

References opj_tile_index::current_tpsno, J2K_MS_SOT, opj_marker_info::len, opj_tile_index::marker, opj_tile_index::marknum, opj_tile_index::maxmarknum, OPJ_FALSE, opj_free(), opj_realloc(), OPJ_TRUE, opj_marker_info::pos, opj_tp_index::start_pos, opj_codestream_index::tile_index, opj_tile_index::tp_index, and opj_marker_info::type.

Referenced by opj_j2k_read_sod(), and opj_j2k_read_tile_header().

static OPJ_BOOL opj_j2k_allocate_tile_element_cstr_index ( opj_j2k_t p_j2k)
static
static OPJ_BOOL opj_j2k_build_decoder ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Builds the tcd decoder to use to decode tile.

References OPJ_TRUE.

Referenced by opj_j2k_setup_decoding_validation().

static OPJ_BOOL opj_j2k_build_encoder ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Builds the tcd encoder to use to encode tile.

References OPJ_TRUE.

Referenced by opj_j2k_setup_encoding_validation().

static OPJ_BOOL opj_j2k_calculate_tp ( opj_j2k_t p_j2k,
opj_cp_t cp,
OPJ_UINT32 p_nb_tiles,
opj_image_t image,
opj_event_mgr_t p_manager 
)
static

Calculates the total number of tile parts needed by the encoder to encode such an image.

If not enough memory is available, then the function return false.

Parameters
p_nb_tilespointer that will hold the number of tile parts.
cpthe coding parameters for the image.
imagethe image to encode.
p_j2kthe p_j2k encoder.
p_managerthe user event manager.
Returns
true if the function was successful, false else.

References opj_tcp::m_nb_tile_parts, opj_tcp::numpocs, opj_j2k_get_num_tp(), opj_pi_update_encoding_parameters(), OPJ_TRUE, OPJ_UNUSED, tcp, opj_cp::tcps, opj_cp::th, and opj_cp::tw.

Referenced by opj_j2k_init_info().

static OPJ_BOOL opj_j2k_check_poc_val ( const opj_poc_t p_pocs,
OPJ_UINT32  p_nb_pocs,
OPJ_UINT32  p_nb_resolutions,
OPJ_UINT32  numcomps,
OPJ_UINT32  numlayers,
opj_event_mgr_t p_manager 
)
static

Checks the progression order changes values.

Tells of the poc given as input are valid. A nice message is outputted at errors.

Parameters
p_pocsthe progression order changes.
p_nb_pocsthe number of progression order changes.
p_nb_resolutionsthe number of resolutions.
numcompsthe number of components
numlayersthe number of layers.
p_managerthe user event manager.
Returns
true if the pocs are valid.

References opj_poc::compno0, EVT_ERROR, opj_poc::layno1, opj_calloc(), opj_event_msg(), OPJ_FALSE, opj_free(), OPJ_TRUE, and opj_poc::resno0.

Referenced by opj_j2k_setup_encoder().

static OPJ_BOOL opj_j2k_compare_coc ( opj_j2k_t p_j2k,
OPJ_UINT32  p_first_comp_no,
OPJ_UINT32  p_second_comp_no 
)
static

Compares 2 COC markers (Coding style component)

Parameters
p_j2kJ2K codec.
p_first_comp_nothe index of the first component to compare.
p_second_comp_nothe index of the second component to compare.
Returns
OPJ_TRUE if equals

References opj_tccp::csty, opj_j2k::m_cp, opj_j2k::m_current_tile_number, OPJ_FALSE, opj_j2k_compare_SPCod_SPCoc(), opj_tcp::tccps, and opj_cp::tcps.

Referenced by opj_j2k_write_all_coc().

static OPJ_BOOL opj_j2k_compare_qcc ( opj_j2k_t p_j2k,
OPJ_UINT32  p_first_comp_no,
OPJ_UINT32  p_second_comp_no 
)
static

Compare QCC markers (quantization component)

Parameters
p_j2kJ2K codec.
p_first_comp_nothe index of the first component to compare.
p_second_comp_nothe index of the second component to compare.
Returns
OPJ_TRUE if equals.

References opj_j2k::m_current_tile_number, and opj_j2k_compare_SQcd_SQcc().

Referenced by opj_j2k_write_all_qcc().

static OPJ_BOOL opj_j2k_compare_SPCod_SPCoc ( opj_j2k_t p_j2k,
OPJ_UINT32  p_tile_no,
OPJ_UINT32  p_first_comp_no,
OPJ_UINT32  p_second_comp_no 
)
static

Compare 2 a SPCod/ SPCoc elements, i.e.

the coding style of a given component of a tile.

Parameters
p_j2kJ2K codec.
p_tile_noTile number
p_first_comp_noThe 1st component number to compare.
p_second_comp_noThe 1st component number to compare.
Returns
OPJ_TRUE if SPCdod are equals.

References opj_tccp::cblkh, opj_tccp::cblksty, opj_tccp::cblkw, opj_tccp::csty, J2K_CCP_CSTY_PRT, opj_j2k::m_cp, opj_tccp::numresolutions, OPJ_FALSE, OPJ_TRUE, opj_tccp::prch, opj_tccp::prcw, opj_tccp::qmfbid, opj_tcp::tccps, and opj_cp::tcps.

Referenced by opj_j2k_compare_coc().

static OPJ_BOOL opj_j2k_compare_SQcd_SQcc ( opj_j2k_t p_j2k,
OPJ_UINT32  p_tile_no,
OPJ_UINT32  p_first_comp_no,
OPJ_UINT32  p_second_comp_no 
)
static

Compares 2 SQcd or SQcc element, i.e.

the quantization values of a band in the QCD or QCC.

Parameters
p_j2kJ2K codec.
p_tile_nothe tile to output.
p_first_comp_nothe first component number to compare.
p_second_comp_nothe second component number to compare.
Returns
OPJ_TRUE if equals.

References opj_stepsize::expn, J2K_CCP_QNTSTY_NOQNT, J2K_CCP_QNTSTY_SIQNT, opj_j2k::m_cp, opj_stepsize::mant, opj_tccp::numgbits, opj_tccp::numresolutions, OPJ_FALSE, OPJ_TRUE, opj_tccp::qntsty, opj_tccp::stepsizes, opj_tcp::tccps, and opj_cp::tcps.

Referenced by opj_j2k_compare_qcc().

char* opj_j2k_convert_progression_order ( OPJ_PROG_ORDER  prg_order)

Converts an enum type progression order to string type.

References j2k_prog_order::enum_prog, and j2k_prog_order::str_prog.

Referenced by opj_j2k_get_num_tp(), and opj_pi_create_encode().

static OPJ_BOOL opj_j2k_copy_default_tcp_and_create_tcd ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static void opj_j2k_copy_tile_component_parameters ( opj_j2k_t p_j2k)
static
static void opj_j2k_copy_tile_quantization_parameters ( opj_j2k_t p_j2k)
static
static void opj_j2k_cp_destroy ( opj_cp_t p_cp)
static
opj_j2k_t* opj_j2k_create_compress ( void  )
static opj_codestream_index_t * opj_j2k_create_cstr_index ( void  )
static
static OPJ_BOOL opj_j2k_create_tcd ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Creates a tile-coder decoder.

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References EVT_ERROR, opj_j2k::m_cp, opj_j2k::m_private_image, opj_j2k::m_tcd, opj_j2k::m_tp, opj_event_msg(), OPJ_FALSE, opj_tcd_create(), opj_tcd_destroy(), opj_tcd_init(), OPJ_TRUE, and OPJ_UNUSED.

Referenced by opj_j2k_setup_header_writing().

static OPJ_BOOL opj_j2k_decode_tiles ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_decoding_validation ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

The default decoding validation procedure without any extension.

Parameters
p_j2kthe jpeg2000 codec to validate.
p_streamthe input stream to validate.
p_managerthe user event manager.
Returns
true if the parameters are correct.

References opj_j2k::m_decoder, opj_j2k::m_procedure_list, opj_j2k::m_specific_param, opj_j2k_dec::m_state, opj_j2k::m_validation_list, OPJ_TRUE, and OPJ_UNUSED.

Referenced by opj_j2k_setup_decoding_validation().

static OPJ_BOOL opj_j2k_destroy_header_memory ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static void opj_j2k_dump_MH_index ( opj_j2k_t p_j2k,
FILE *  out_stream 
)
static
static void opj_j2k_dump_MH_info ( opj_j2k_t p_j2k,
FILE *  out_stream 
)
static
static OPJ_BOOL opj_j2k_encoding_validation ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

The default encoding validation procedure without any extension.

Parameters
p_j2kthe jpeg2000 codec to validate.
p_streamthe input stream to validate.
p_managerthe user event manager.
Returns
true if the parameters are correct.

References EVT_ERROR, J2K_STATE_NONE, opj_j2k::m_cp, opj_j2k::m_decoder, opj_j2k::m_procedure_list, opj_j2k::m_specific_param, opj_j2k_dec::m_state, opj_j2k::m_validation_list, opj_tccp::numresolutions, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, OPJ_UNUSED, opj_tcp::tccps, opj_cp::tcps, opj_cp::tdx, and opj_cp::tdy.

Referenced by opj_j2k_setup_encoding_validation().

static OPJ_BOOL opj_j2k_end_encoding ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Ends the encoding, i.e.

frees memory.

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References opj_j2k_enc::m_encoded_tile_data, opj_j2k_enc::m_encoded_tile_size, opj_j2k::m_encoder, opj_j2k::m_specific_param, opj_j2k::m_tcd, opj_j2k_enc::m_tlm_sot_offsets_buffer, opj_j2k_enc::m_tlm_sot_offsets_current, opj_free(), opj_tcd_destroy(), OPJ_TRUE, and OPJ_UNUSED.

Referenced by opj_j2k_setup_end_compress().

static OPJ_BOOL opj_j2k_exec ( opj_j2k_t p_j2k,
opj_procedure_list_t p_procedure_list,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Excutes the given procedures on the given codec.

Parameters
p_procedure_listthe list of procedures to execute
p_j2kthe jpeg2000 codec to execute the procedures on.
p_streamthe stream to execute the procedures on.
p_managerthe user manager.
Returns
true if all the procedures were successfully executed.

References opj_procedure_list_clear(), opj_procedure_list_get_first_procedure(), opj_procedure_list_get_nb_procedures(), and OPJ_TRUE.

Referenced by opj_j2k_decode(), opj_j2k_end_compress(), opj_j2k_get_tile(), opj_j2k_read_header(), and opj_j2k_start_compress().

static OPJ_FLOAT32 opj_j2k_get_default_stride ( opj_tcp_t p_tcp)
static

Referenced by opj_j2k_update_rates().

static OPJ_BOOL opj_j2k_get_end_header ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Gets the offset of the header.

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References opj_j2k::cstr_index, opj_codestream_index::main_head_end, opj_stream_tell(), OPJ_TRUE, and OPJ_UNUSED.

Referenced by opj_j2k_setup_header_writing().

static const opj_dec_memory_marker_handler_t * opj_j2k_get_marker_handler ( OPJ_UINT32  p_id)
static

Reads the lookup table containing all the marker, status and action, and returns the handler associated with the marker value.

Parameters
p_idMarker value to look up
Returns
the handler associated with the id.

References opj_dec_memory_marker_handler::id.

Referenced by opj_j2k_read_header_procedure(), opj_j2k_read_tile_header(), and opj_j2k_read_unk().

static OPJ_UINT32 opj_j2k_get_max_coc_size ( opj_j2k_t p_j2k)
static

Gets the maximum size taken by a coc.

Parameters
p_j2kthe jpeg2000 codec to use.

References opj_j2k::m_cp, opj_j2k::m_private_image, opj_image::numcomps, opj_j2k_get_SPCod_SPCoc_size(), opj_uint_max(), opj_cp::th, and opj_cp::tw.

Referenced by opj_j2k_get_max_qcc_size(), and opj_j2k_get_specific_header_sizes().

static OPJ_UINT32 opj_j2k_get_max_poc_size ( opj_j2k_t p_j2k)
static

Gets the maximum size taken by the writing of a POC.

References opj_j2k::m_cp, opj_tcp::numpocs, opj_uint_max(), opj_cp::tcps, opj_cp::th, and opj_cp::tw.

Referenced by opj_j2k_get_specific_header_sizes().

static OPJ_UINT32 opj_j2k_get_max_qcc_size ( opj_j2k_t p_j2k)
static

Gets the maximum size taken by a qcc.

References opj_j2k_get_max_coc_size().

Referenced by opj_j2k_get_specific_header_sizes().

static OPJ_UINT32 opj_j2k_get_max_toc_size ( opj_j2k_t p_j2k)
static

Gets the maximum size taken by the toc headers of all the tile parts of any given tile.

References opj_j2k::m_cp, opj_tcp::m_nb_tile_parts, opj_uint_max(), opj_cp::tcps, opj_cp::th, and opj_cp::tw.

Referenced by opj_j2k_get_specific_header_sizes().

static OPJ_UINT32 opj_j2k_get_num_tp ( opj_cp_t cp,
OPJ_UINT32  pino,
OPJ_UINT32  tileno 
)
static

Gets the number of tile parts used for the given change of progression (if any) and the given tile.

Parameters
cpthe coding parameters.
pinothe offset of the given poc (i.e. its position in the coding parameter).
tilenothe given tile.
Returns
the number of tile parts.

References opj_poc::compE, opj_poc::layE, opj_cp::m_enc, opj_cp::m_specific_param, opj_encoding_param::m_tp_flag, opj_encoding_param::m_tp_on, opj_encoding_param::m_tp_pos, opj_tcp::numpocs, opj_j2k_convert_progression_order(), opj_tcp::pocs, opj_poc::prcE, opj_tcp::prg, opj_poc::resE, tcp, opj_cp::tcps, opj_cp::th, and opj_cp::tw.

Referenced by opj_j2k_calculate_tp(), and opj_j2k_write_all_tile_parts().

static OPJ_BOOL opj_j2k_get_sot_values ( OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
OPJ_UINT32 p_tile_no,
OPJ_UINT32 p_tot_len,
OPJ_UINT32 p_current_part,
OPJ_UINT32 p_num_parts,
opj_event_mgr_t p_manager 
)
static

Reads values from a SOT marker (Start of tile-part)

the j2k decoder state is not affected. No side effects, no checks except for p_header_size.

Parameters
p_header_datathe data contained in the SOT marker.
p_header_sizethe size of the data contained in the SOT marker.
p_tile_noIsot.
p_tot_lenPsot.
p_current_partTPsot.
p_num_partsTNsot.
p_managerthe user event manager.

References EVT_ERROR, opj_event_msg(), OPJ_FALSE, opj_read_bytes, and OPJ_TRUE.

Referenced by opj_j2k_need_nb_tile_parts_correction(), and opj_j2k_read_sot().

static OPJ_UINT32 opj_j2k_get_SPCod_SPCoc_size ( opj_j2k_t p_j2k,
OPJ_UINT32  p_tile_no,
OPJ_UINT32  p_comp_no 
)
static

Gets the size taken by writing a SPCod or SPCoc for the given tile and component.

Parameters
p_j2kthe J2K codec.
p_tile_nothe tile index.
p_comp_nothe component being outputted.
Returns
the number of bytes taken by the SPCod element.

References opj_tccp::csty, J2K_CCP_CSTY_PRT, opj_j2k::m_cp, opj_tccp::numresolutions, opj_tcp::tccps, opj_cp::tcps, opj_cp::th, and opj_cp::tw.

Referenced by opj_j2k_get_max_coc_size(), opj_j2k_write_coc(), opj_j2k_write_coc_in_memory(), and opj_j2k_write_cod().

static OPJ_UINT32 opj_j2k_get_specific_header_sizes ( opj_j2k_t p_j2k)
static

Gets the maximum size taken by the headers of the SOT.

Parameters
p_j2kthe jpeg2000 codec to use.

References opj_j2k::m_cp, opj_j2k::m_private_image, opj_image::numcomps, OPJ_IS_CINEMA, opj_j2k_get_max_coc_size(), opj_j2k_get_max_poc_size(), opj_j2k_get_max_qcc_size(), opj_j2k_get_max_toc_size(), and opj_cp::rsiz.

Referenced by opj_j2k_update_rates().

static OPJ_UINT32 opj_j2k_get_SQcd_SQcc_size ( opj_j2k_t p_j2k,
OPJ_UINT32  p_tile_no,
OPJ_UINT32  p_comp_no 
)
static

Gets the size taken by writing SQcd or SQcc element, i.e.

the quantization values of a band in the QCD or QCC.

Parameters
p_tile_nothe tile index.
p_comp_nothe component being outputted.
p_j2kthe J2K codec.
Returns
the number of bytes taken by the SPCod element.

References J2K_CCP_QNTSTY_NOQNT, J2K_CCP_QNTSTY_SIQNT, opj_j2k::m_cp, opj_tccp::numresolutions, opj_tccp::qntsty, opj_tcp::tccps, opj_cp::tcps, and opj_cp::th.

Referenced by opj_j2k_write_qcc(), opj_j2k_write_qcc_in_memory(), and opj_j2k_write_qcd().

static void opj_j2k_get_tile_data ( opj_tcd_t p_tcd,
OPJ_BYTE p_data 
)
static
static OPJ_FLOAT32 opj_j2k_get_tp_stride ( opj_tcp_t p_tcp)
static
static OPJ_BOOL opj_j2k_init_info ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Inits the Info.

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References opj_j2k::m_cp, opj_j2k::m_encoder, opj_j2k::m_private_image, opj_j2k::m_specific_param, opj_j2k_enc::m_total_tile_parts, opj_j2k_calculate_tp(), and OPJ_UNUSED.

Referenced by opj_j2k_setup_header_writing().

static int opj_j2k_initialise_4K_poc ( opj_poc_t POC,
int  numres 
)
static
static OPJ_BOOL opj_j2k_is_cinema_compliant ( opj_image_t image,
OPJ_UINT16  rsiz,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_mct_validation ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

The mct encoding validation procedure.

Parameters
p_j2kthe jpeg2000 codec to validate.
p_streamthe input stream to validate.
p_managerthe user event manager.
Returns
true if the parameters are correct.

References opj_j2k::m_cp, opj_tcp::m_mct_coding_matrix, opj_j2k::m_private_image, opj_tcp::mct, opj_image::numcomps, OPJ_TRUE, OPJ_UNUSED, opj_tccp::qmfbid, opj_cp::rsiz, opj_tcp::tccps, opj_cp::tcps, opj_cp::th, and opj_cp::tw.

Referenced by opj_j2k_setup_encoding_validation().

static OPJ_BOOL opj_j2k_merge_ppm ( opj_cp_t p_cp,
opj_event_mgr_t p_manager 
)
static

Merges all PPM markers read (Packed headers, main header)

Parameters
p_cpmain coding parameters.
p_managerthe user event manager.

References EVT_ERROR, opj_ppx_struct::m_data, opj_ppx_struct::m_data_size, opj_event_msg(), OPJ_FALSE, opj_free(), opj_malloc(), opj_read_bytes, OPJ_TRUE, opj_cp::ppm, opj_cp::ppm_buffer, opj_cp::ppm_data, opj_cp::ppm_data_size, opj_cp::ppm_len, opj_cp::ppm_markers, and opj_cp::ppm_markers_count.

Referenced by opj_j2k_read_header_procedure().

static OPJ_BOOL opj_j2k_merge_ppt ( opj_tcp_t p_tcp,
opj_event_mgr_t p_manager 
)
static

Merges all PPT markers read (Packed headers, tile-part header)

Merges all PPT markers read (Packed packet headers, tile-part header)

Parameters
p_tcpthe tile.
p_managerthe user event manager.

References EVT_ERROR, opj_ppx_struct::m_data, opj_ppx_struct::m_data_size, opj_event_msg(), OPJ_FALSE, opj_free(), opj_malloc(), OPJ_TRUE, opj_tcp::ppt, opj_tcp::ppt_buffer, opj_tcp::ppt_data, opj_tcp::ppt_data_size, opj_tcp::ppt_len, opj_tcp::ppt_markers, and opj_tcp::ppt_markers_count.

Referenced by opj_j2k_read_tile_header().

static OPJ_BOOL opj_j2k_need_nb_tile_parts_correction ( opj_stream_private_t p_stream,
OPJ_UINT32  tile_no,
OPJ_BOOL p_correction_needed,
opj_event_mgr_t p_manager 
)
static

Checks for invalid number of tile-parts in SOT marker (TPsot==TNsot).

See issue 254.

Parameters
p_streamthe stream to read data from.
tile_notile number we're looking for.
p_correction_neededoutput value. if true, non conformant codestream needs TNsot correction.
p_managerthe user event manager.
Returns
true if the function was successful, false else.

References EVT_ERROR, J2K_MS_SOT, opj_event_msg(), OPJ_FALSE, opj_j2k_get_sot_values(), opj_read_bytes, opj_stream_has_seek(), opj_stream_read_data(), opj_stream_seek(), opj_stream_skip(), opj_stream_tell(), and OPJ_TRUE.

Referenced by opj_j2k_read_tile_header().

static OPJ_BOOL opj_j2k_post_write_tile ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_pre_write_tile ( opj_j2k_t p_j2k,
OPJ_UINT32  p_tile_index,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_read_cbd ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a CBD marker (Component bit depth definition)

Parameters
p_header_datathe data contained in the CBD box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the CBD marker.
p_managerthe user event manager.

References opj_image::comps, EVT_ERROR, opj_j2k::m_private_image, opj_image::numcomps, opj_event_msg(), OPJ_FALSE, opj_read_bytes, OPJ_TRUE, opj_image_comp::prec, and opj_image_comp::sgnd.

static OPJ_BOOL opj_j2k_read_coc ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a COC marker (Coding Style Component)

Parameters
p_header_datathe data contained in the COC box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the COC marker.
p_managerthe user event manager.

References opj_tccp::csty, EVT_ERROR, J2K_STATE_TPH, opj_j2k::m_cp, opj_j2k::m_current_tile_number, opj_j2k::m_decoder, opj_j2k_dec::m_default_tcp, opj_j2k::m_private_image, opj_j2k::m_specific_param, opj_j2k_dec::m_state, opj_image::numcomps, opj_event_msg(), OPJ_FALSE, opj_j2k_read_SPCod_SPCoc(), opj_read_bytes, OPJ_TRUE, opj_tcp::tccps, and opj_cp::tcps.

static OPJ_BOOL opj_j2k_read_cod ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_read_com ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a COM marker (comments)

Parameters
p_j2kthe jpeg2000 file codec.
p_header_datathe data contained in the COM box.
p_header_sizethe size of the data contained in the COM marker.
p_managerthe user event manager.

References OPJ_TRUE, and OPJ_UNUSED.

static OPJ_BOOL opj_j2k_read_crg ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a CRG marker (Component registration)

Parameters
p_header_datathe data contained in the TLM box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the TLM marker.
p_managerthe user event manager.

References EVT_ERROR, opj_j2k::m_private_image, opj_image::numcomps, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, and OPJ_UNUSED.

static void opj_j2k_read_float32_to_float ( const void *  p_src_data,
void *  p_dest_data,
OPJ_UINT32  p_nb_elem 
)
static

References opj_read_float.

static void opj_j2k_read_float32_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
OPJ_UINT32  p_nb_elem 
)
static

References opj_read_float.

static void opj_j2k_read_float64_to_float ( const void *  p_src_data,
void *  p_dest_data,
OPJ_UINT32  p_nb_elem 
)
static

References opj_read_double.

static void opj_j2k_read_float64_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
OPJ_UINT32  p_nb_elem 
)
static

References opj_read_double.

static OPJ_BOOL opj_j2k_read_header_procedure ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static void opj_j2k_read_int16_to_float ( const void *  p_src_data,
void *  p_dest_data,
OPJ_UINT32  p_nb_elem 
)
static

References opj_read_bytes.

static void opj_j2k_read_int16_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
OPJ_UINT32  p_nb_elem 
)
static

References opj_read_bytes.

static void opj_j2k_read_int32_to_float ( const void *  p_src_data,
void *  p_dest_data,
OPJ_UINT32  p_nb_elem 
)
static

References opj_read_bytes.

static void opj_j2k_read_int32_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
OPJ_UINT32  p_nb_elem 
)
static

References opj_read_bytes.

static OPJ_BOOL opj_j2k_read_mcc ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_read_mco ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a MCO marker (Multiple Component Transform Ordering)

Parameters
p_header_datathe data contained in the MCO box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the MCO marker.
p_managerthe user event manager.

References EVT_ERROR, EVT_WARNING, J2K_STATE_TPH, opj_j2k::m_cp, opj_j2k::m_current_tile_number, opj_tccp::m_dc_level_shift, opj_j2k::m_decoder, opj_j2k_dec::m_default_tcp, opj_tcp::m_mct_decoding_matrix, opj_j2k::m_private_image, opj_j2k::m_specific_param, opj_j2k_dec::m_state, opj_image::numcomps, opj_event_msg(), OPJ_FALSE, opj_free(), opj_j2k_add_mct(), opj_read_bytes, OPJ_TRUE, opj_tcp::tccps, and opj_cp::tcps.

static OPJ_BOOL opj_j2k_read_mct ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_read_plm ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a PLM marker (Packet length, main header marker)

Parameters
p_header_datathe data contained in the TLM box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the TLM marker.
p_managerthe user event manager.

References EVT_ERROR, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, and OPJ_UNUSED.

static OPJ_BOOL opj_j2k_read_plt ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a PLT marker (Packet length, tile-part header)

Parameters
p_header_datathe data contained in the PLT box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the PLT marker.
p_managerthe user event manager.

References EVT_ERROR, opj_event_msg(), OPJ_FALSE, opj_read_bytes, OPJ_TRUE, and OPJ_UNUSED.

static OPJ_BOOL opj_j2k_read_poc ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a POC marker (Progression Order Change)

Parameters
p_header_datathe data contained in the POC box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the POC marker.
p_managerthe user event manager.

References opj_poc::compno0, opj_poc::compno1, EVT_ERROR, J2K_STATE_TPH, opj_poc::layno1, opj_j2k::m_cp, opj_j2k::m_current_tile_number, opj_j2k::m_decoder, opj_j2k_dec::m_default_tcp, opj_j2k::m_private_image, opj_j2k::m_specific_param, opj_j2k_dec::m_state, opj_image::numcomps, opj_tcp::numlayers, opj_tcp::numpocs, opj_event_msg(), OPJ_FALSE, opj_read_bytes, OPJ_TRUE, opj_uint_min(), opj_tcp::POC, opj_tcp::pocs, opj_poc::prg, opj_poc::resno0, opj_poc::resno1, and opj_cp::tcps.

static OPJ_BOOL opj_j2k_read_ppm ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a PPM marker (Packed headers, main header)

Reads a PPM marker (Packed packet headers, main header)

Parameters
p_header_datathe data contained in the POC box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the POC marker.
p_managerthe user event manager.

References EVT_ERROR, opj_j2k::m_cp, opj_ppx_struct::m_data, opj_ppx_struct::m_data_size, opj_calloc(), opj_event_msg(), OPJ_FALSE, opj_malloc(), opj_read_bytes, opj_realloc(), OPJ_TRUE, opj_cp::ppm, opj_cp::ppm_markers, and opj_cp::ppm_markers_count.

static OPJ_BOOL opj_j2k_read_ppt ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a PPT marker (Packed packet headers, tile-part header)

Parameters
p_header_datathe data contained in the PPT box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the PPT marker.
p_managerthe user event manager.

References EVT_ERROR, opj_j2k::m_cp, opj_j2k::m_current_tile_number, opj_ppx_struct::m_data, opj_ppx_struct::m_data_size, opj_calloc(), opj_event_msg(), OPJ_FALSE, opj_malloc(), opj_read_bytes, opj_realloc(), OPJ_TRUE, opj_cp::ppm, opj_tcp::ppt, opj_tcp::ppt_markers, opj_tcp::ppt_markers_count, and opj_cp::tcps.

static OPJ_BOOL opj_j2k_read_qcc ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a QCC marker (Quantization component)

Parameters
p_header_datathe data contained in the QCC box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the QCC marker.
p_managerthe user event manager.

References opj_cp::correct, EVT_ERROR, EVT_WARNING, opj_j2k::m_cp, opj_j2k::m_private_image, opj_image::numcomps, opj_event_msg(), OPJ_FALSE, opj_j2k_read_SQcd_SQcc(), opj_read_bytes, and OPJ_TRUE.

static OPJ_BOOL opj_j2k_read_qcd ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a QCD marker (Quantization defaults)

Parameters
p_header_datathe data contained in the QCD box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the QCD marker.
p_managerthe user event manager.

References EVT_ERROR, opj_event_msg(), OPJ_FALSE, opj_j2k_copy_tile_quantization_parameters(), opj_j2k_read_SQcd_SQcc(), and OPJ_TRUE.

static OPJ_BOOL opj_j2k_read_rgn ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a RGN marker (Region Of Interest)

Parameters
p_header_datathe data contained in the POC box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the POC marker.
p_managerthe user event manager.

References opj_cp::correct, EVT_ERROR, J2K_STATE_TPH, opj_j2k::m_cp, opj_j2k::m_current_tile_number, opj_j2k::m_decoder, opj_j2k_dec::m_default_tcp, opj_j2k::m_private_image, opj_j2k::m_specific_param, opj_j2k_dec::m_state, opj_image::numcomps, opj_event_msg(), OPJ_FALSE, opj_read_bytes, OPJ_TRUE, opj_tccp::roishift, opj_tcp::tccps, and opj_cp::tcps.

static OPJ_BOOL opj_j2k_read_siz ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_read_soc ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Reads a SOC marker (Start of Codestream)

Parameters
p_j2kthe jpeg2000 file codec.
p_streamXXX needs data
p_managerthe user event manager.
p_j2kthe jpeg2000 file codec.
p_streamFIXME DOC
p_managerthe user event manager.

References opj_j2k::cstr_index, EVT_ERROR, EVT_INFO, J2K_MS_SOC, J2K_STATE_MHSIZ, opj_j2k::m_decoder, opj_j2k::m_specific_param, opj_j2k_dec::m_state, opj_codestream_index::main_head_start, opj_event_msg(), OPJ_FALSE, opj_j2k_add_mhmarker(), opj_read_bytes, opj_stream_read_data(), opj_stream_tell(), and OPJ_TRUE.

Referenced by opj_j2k_read_header_procedure().

static OPJ_BOOL opj_j2k_read_sod ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_read_sot ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_read_SPCod_SPCoc ( opj_j2k_t p_j2k,
OPJ_UINT32  compno,
OPJ_BYTE p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a SPCod or SPCoc element, i.e.

the coding style of a given component of a tile.

Parameters
p_j2kthe jpeg2000 codec.
compnoFIXME DOC
p_header_datathe data contained in the COM box.
p_header_sizethe size of the data contained in the COM marker.
p_managerthe user event manager.

References opj_tccp::cblkh, opj_tccp::cblksty, opj_tccp::cblkw, opj_tccp::csty, EVT_ERROR, J2K_CCP_CSTY_PRT, J2K_STATE_TPH, opj_j2k::m_cp, opj_j2k::m_current_tile_number, opj_cp::m_dec, opj_j2k::m_decoder, opj_j2k_dec::m_default_tcp, opj_decoding_param::m_reduce, opj_cp::m_specific_param, opj_j2k::m_specific_param, opj_j2k_dec::m_state, opj_tccp::numresolutions, opj_event_msg(), OPJ_FALSE, OPJ_J2K_MAXRLVLS, opj_read_bytes, OPJ_TRUE, opj_tccp::prch, opj_tccp::prcw, opj_tccp::qmfbid, opj_tcp::tccps, and opj_cp::tcps.

Referenced by opj_j2k_read_coc(), and opj_j2k_read_cod().

static OPJ_BOOL opj_j2k_read_SQcd_SQcc ( opj_j2k_t p_j2k,
OPJ_UINT32  compno,
OPJ_BYTE p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a SQcd or SQcc element, i.e.

the quantization values of a band in the QCD or QCC.

Parameters
p_j2kJ2K codec.
compnothe component number to output.
p_header_datathe data buffer.
p_header_sizepointer to the size of the data buffer, it is changed by the function.
p_managerthe user event manager.

References opj_cp::correct, EVT_ERROR, EVT_WARNING, opj_stepsize::expn, J2K_CCP_QNTSTY_NOQNT, J2K_CCP_QNTSTY_SIQNT, J2K_STATE_TPH, opj_j2k::m_cp, opj_j2k::m_current_tile_number, opj_j2k::m_decoder, opj_j2k_dec::m_default_tcp, opj_j2k::m_specific_param, opj_j2k_dec::m_state, opj_stepsize::mant, opj_tccp::numgbits, opj_event_msg(), OPJ_FALSE, OPJ_J2K_MAXBANDS, opj_read_bytes, OPJ_TRUE, opj_tccp::qntsty, opj_tccp::stepsizes, opj_tcp::tccps, and opj_cp::tcps.

Referenced by opj_j2k_read_qcc(), and opj_j2k_read_qcd().

static OPJ_BOOL opj_j2k_read_tlm ( opj_j2k_t p_j2k,
OPJ_BYTE p_header_data,
OPJ_UINT32  p_header_size,
opj_event_mgr_t p_manager 
)
static

Reads a TLM marker (Tile Length Marker)

Parameters
p_header_datathe data contained in the TLM box.
p_j2kthe jpeg2000 codec.
p_header_sizethe size of the data contained in the TLM marker.
p_managerthe user event manager.

References EVT_ERROR, opj_event_msg(), OPJ_FALSE, opj_read_bytes, OPJ_TRUE, and OPJ_UNUSED.

static OPJ_BOOL opj_j2k_read_unk ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
OPJ_UINT32 output_marker,
opj_event_mgr_t p_manager 
)
static

Reads an unknown marker.

Parameters
p_j2kthe jpeg2000 codec.
p_streamthe stream object to read from.
output_markerFIXME DOC
p_managerthe user event manager.
Returns
true if the marker could be deduced.

References opj_j2k::cstr_index, EVT_ERROR, EVT_WARNING, opj_dec_memory_marker_handler::id, J2K_MS_SOT, J2K_MS_UNK, opj_j2k::m_decoder, opj_j2k_dec::m_header_data, opj_j2k::m_specific_param, opj_j2k_dec::m_state, opj_event_msg(), OPJ_FALSE, opj_j2k_add_mhmarker(), opj_j2k_get_marker_handler(), opj_read_bytes, opj_stream_read_data(), opj_stream_tell(), OPJ_TRUE, and opj_dec_memory_marker_handler::states.

Referenced by opj_j2k_read_header_procedure().

static void opj_j2k_set_cinema_parameters ( opj_cparameters_t parameters,
opj_image_t image,
opj_event_mgr_t p_manager 
)
static
OPJ_BOOL opj_j2k_set_threads ( opj_j2k_t j2k,
OPJ_UINT32  num_threads 
)
void opj_j2k_setup_decoder ( opj_j2k_t j2k,
opj_dparameters_t parameters 
)
static OPJ_BOOL opj_j2k_setup_decoding_validation ( opj_j2k_t p_j2k,
opj_event_mgr_t p_manager 
)
static

Sets up the validation ,i.e.

adds the procedures to lauch to make sure the codec parameters are valid. Developpers wanting to extend the library can add their own validation procedures.

References opj_j2k::m_validation_list, OPJ_FALSE, opj_j2k_build_decoder(), opj_j2k_decoding_validation(), opj_procedure_list_add_procedure(), and OPJ_TRUE.

Referenced by opj_j2k_read_header().

OPJ_BOOL opj_j2k_setup_encoder ( opj_j2k_t p_j2k,
opj_cparameters_t parameters,
opj_image_t image,
opj_event_mgr_t p_manager 
)

References opj_tccp::cblkh, opj_tccp::cblksty, opj_tccp::cblkw, opj_cparameters::cblockh_init, opj_cparameters::cblockw_init, opj_cp::comment, opj_poc::compno0, opj_poc::compno1, opj_image::comps, opj_cparameters::cp_cinema, opj_cparameters::cp_comment, opj_cparameters::cp_disto_alloc, opj_cparameters::cp_fixed_alloc, opj_cparameters::cp_fixed_quality, opj_cparameters::cp_matrice, opj_cparameters::cp_rsiz, opj_cparameters::cp_tdx, opj_cparameters::cp_tdy, opj_cparameters::cp_tx0, opj_cparameters::cp_ty0, opj_tccp::csty, opj_tcp::csty, opj_cparameters::csty, opj_tcp::distoratio, opj_image_comp::dx, opj_image_comp::dy, opj_cp::epb_on, opj_cp::epc_on, opj_cp::esd_on, EVT_ERROR, EVT_WARNING, opj_image_comp::h, opj_cp::hprot_MH, opj_cp::hprot_TPH, opj_cp::hprot_TPH_tileno, opj_cp::info_on, opj_cparameters::irreversible, J2K_CCP_CSTY_PRT, J2K_CCP_QNTSTY_NOQNT, J2K_CCP_QNTSTY_SEQNT, opj_cparameters::jpwl_epc_on, opj_cparameters::jpwl_hprot_MH, opj_cparameters::jpwl_hprot_TPH, opj_cparameters::jpwl_hprot_TPH_tileno, JPWL_MAX_NO_PACKSPECS, JPWL_MAX_NO_TILESPECS, opj_cparameters::jpwl_pprot, opj_cparameters::jpwl_pprot_packno, opj_cparameters::jpwl_pprot_tileno, opj_cparameters::jpwl_sens_addr, opj_cparameters::jpwl_sens_MH, opj_cparameters::jpwl_sens_range, opj_cparameters::jpwl_sens_size, opj_cparameters::jpwl_sens_TPH, opj_cparameters::jpwl_sens_TPH_tileno, opj_poc::layno1, opj_j2k::m_cp, opj_tccp::m_dc_level_shift, opj_encoding_param::m_disto_alloc, opj_cp::m_enc, opj_encoding_param::m_fixed_alloc, opj_encoding_param::m_fixed_quality, opj_encoding_param::m_matrice, opj_encoding_param::m_max_comp_size, opj_tcp::m_mct_coding_matrix, opj_tcp::m_mct_decoding_matrix, opj_cp::m_specific_param, opj_encoding_param::m_tp_flag, opj_encoding_param::m_tp_on, opj_cparameters::max_comp_size, opj_cparameters::max_cs_size, opj_tcp::mct, opj_cparameters::mct_data, opj_tcp::mct_norms, opj_cparameters::mode, opj_image::numcomps, opj_tccp::numgbits, opj_tcp::numlayers, opj_tcp::numpocs, opj_cparameters::numpocs, opj_cparameters::numresolution, opj_tccp::numresolutions, opj_calculate_norms(), opj_calloc(), OPJ_CINEMA2K, OPJ_CINEMA2K_24, OPJ_CINEMA2K_48, OPJ_CINEMA4K, OPJ_CINEMA4K_24, OPJ_CINEMA_24_COMP, OPJ_CINEMA_24_CS, OPJ_CINEMA_48_COMP, OPJ_CINEMA_48_CS, opj_dwt_calc_explicit_stepsizes(), opj_event_msg(), OPJ_EXTENSION_MCT, OPJ_EXTENSION_NONE, OPJ_FALSE, opj_free(), opj_int_ceildiv(), opj_int_floorlog2(), OPJ_IS_BROADCAST, OPJ_IS_CINEMA, OPJ_IS_IMF, OPJ_IS_PART2, OPJ_IS_STORAGE, opj_j2k_check_poc_val(), opj_j2k_is_cinema_compliant(), OPJ_J2K_MAXRLVLS, opj_j2k_set_cinema_parameters(), opj_j2k_setup_mct_encoding(), opj_malloc(), opj_matrix_inversion_f(), OPJ_MCT, OPJ_OFF, OPJ_PROFILE_CINEMA_2K, OPJ_PROFILE_CINEMA_4K, OPJ_PROFILE_CINEMA_S2K, OPJ_PROFILE_CINEMA_S4K, OPJ_PROFILE_NONE, OPJ_PROFILE_PART2, OPJ_STD_RSIZ, OPJ_TRUE, opj_version(), opj_tcp::POC, opj_cparameters::POC, opj_tcp::pocs, opj_cp::pprot, opj_cp::pprot_packno, opj_cp::pprot_tileno, opj_tccp::prch, opj_cparameters::prch_init, opj_tccp::prcw, opj_cparameters::prcw_init, opj_image_comp::prec, opj_tcp::prg, opj_poc::prg1, opj_cparameters::prog_order, opj_tccp::qmfbid, opj_tccp::qntsty, opj_tcp::rates, opj_cp::red_on, opj_cparameters::res_spec, opj_poc::resno0, opj_poc::resno1, opj_cparameters::roi_compno, opj_cparameters::roi_shift, opj_tccp::roishift, opj_cp::rsiz, opj_cparameters::rsiz, opj_cp::sens_addr, opj_cp::sens_MH, opj_cp::sens_range, opj_cp::sens_size, opj_cp::sens_TPH, opj_cp::sens_TPH_tileno, opj_image_comp::sgnd, opj_tcp::tccps, tcp, opj_cparameters::tcp_distoratio, opj_cparameters::tcp_mct, opj_cparameters::tcp_numlayers, opj_cparameters::tcp_rates, opj_cp::tcps, opj_cp::tdx, opj_cp::tdy, opj_cp::th, opj_poc::tile, opj_cparameters::tile_size_on, opj_cparameters::tp_flag, opj_cparameters::tp_on, opj_cp::tw, opj_cp::tx0, opj_cp::ty0, opj_image_comp::w, opj_image::x1, and opj_image::y1.

Referenced by opj_create_compress(), and opj_jp2_setup_encoder().

static OPJ_BOOL opj_j2k_setup_encoding_validation ( opj_j2k_t p_j2k,
opj_event_mgr_t p_manager 
)
static

Sets up the validation ,i.e.

adds the procedures to lauch to make sure the codec parameters are valid. Developpers wanting to extend the library can add their own validation procedures.

References opj_j2k::m_validation_list, OPJ_FALSE, opj_j2k_build_encoder(), opj_j2k_encoding_validation(), opj_j2k_mct_validation(), opj_procedure_list_add_procedure(), and OPJ_TRUE.

Referenced by opj_j2k_start_compress().

static OPJ_BOOL opj_j2k_setup_end_compress ( opj_j2k_t p_j2k,
opj_event_mgr_t p_manager 
)
static

Sets up the validation ,i.e.

adds the procedures to lauch to make sure the codec parameters are valid. Developpers wanting to extend the library can add their own validation procedures.

References opj_j2k::m_cp, opj_j2k::m_procedure_list, OPJ_FALSE, OPJ_IS_CINEMA, opj_j2k_destroy_header_memory(), opj_j2k_end_encoding(), opj_j2k_write_eoc(), opj_j2k_write_epc(), opj_j2k_write_updated_tlm(), opj_procedure_list_add_procedure(), OPJ_TRUE, and opj_cp::rsiz.

Referenced by opj_j2k_end_compress().

static OPJ_BOOL opj_j2k_setup_header_reading ( opj_j2k_t p_j2k,
opj_event_mgr_t p_manager 
)
static

Sets up the procedures to do on reading header.

Developpers wanting to extend the library can add their own reading procedures.

References opj_j2k::m_procedure_list, OPJ_FALSE, opj_j2k_copy_default_tcp_and_create_tcd(), opj_j2k_read_header_procedure(), opj_procedure_list_add_procedure(), and OPJ_TRUE.

Referenced by opj_j2k_read_header().

static OPJ_BOOL opj_j2k_setup_header_writing ( opj_j2k_t p_j2k,
opj_event_mgr_t p_manager 
)
static
static void opj_j2k_tcp_data_destroy ( opj_tcp_t p_tcp)
static

Destroys the data inside a tile coding parameter structure.

Parameters
p_tcpthe tile coding parameter which contain data to destroy.

References opj_tcp::m_data, opj_tcp::m_data_size, and opj_free().

Referenced by opj_j2k_decode_tile(), and opj_j2k_tcp_destroy().

static void opj_j2k_tcp_destroy ( opj_tcp_t p_tcp)
static
static OPJ_BOOL opj_j2k_update_image_data ( opj_tcd_t p_tcd,
OPJ_BYTE p_data,
opj_image_t p_output_image 
)
static
static OPJ_BOOL opj_j2k_update_rates ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static void opj_j2k_update_tlm ( opj_j2k_t p_j2k,
OPJ_UINT32  p_tile_part_size 
)
static
static OPJ_BOOL opj_j2k_write_all_coc ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes COC marker for each component.

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References opj_j2k::m_private_image, opj_image::numcomps, OPJ_FALSE, opj_j2k_compare_coc(), opj_j2k_write_coc(), and OPJ_TRUE.

Referenced by opj_j2k_setup_header_writing().

static OPJ_BOOL opj_j2k_write_all_qcc ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes QCC marker for each component.

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References opj_j2k::m_private_image, opj_image::numcomps, OPJ_FALSE, opj_j2k_compare_qcc(), opj_j2k_write_qcc(), and OPJ_TRUE.

Referenced by opj_j2k_setup_header_writing().

static OPJ_BOOL opj_j2k_write_all_tile_parts ( opj_j2k_t p_j2k,
OPJ_BYTE p_data,
OPJ_UINT32 p_data_written,
OPJ_UINT32  p_total_data_size,
opj_stream_private_t p_stream,
struct opj_event_mgr p_manager 
)
static
static OPJ_BOOL opj_j2k_write_cbd ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_write_coc ( opj_j2k_t p_j2k,
OPJ_UINT32  p_comp_no,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes the COC marker (Coding style component)

Parameters
p_j2kJ2K codec.
p_comp_nothe index of the component to output.
p_streamthe stream to write data to.
p_managerthe user event manager.

References EVT_ERROR, opj_j2k::m_current_tile_number, opj_j2k::m_encoder, opj_j2k_enc::m_header_tile_data, opj_j2k_enc::m_header_tile_data_size, opj_j2k::m_private_image, opj_j2k::m_specific_param, opj_image::numcomps, opj_event_msg(), OPJ_FALSE, opj_free(), opj_j2k_get_SPCod_SPCoc_size(), opj_j2k_write_coc_in_memory(), opj_realloc(), opj_stream_write_data(), and OPJ_TRUE.

Referenced by opj_j2k_write_all_coc().

static void opj_j2k_write_coc_in_memory ( opj_j2k_t p_j2k,
OPJ_UINT32  p_comp_no,
OPJ_BYTE p_data,
OPJ_UINT32 p_data_written,
opj_event_mgr_t p_manager 
)
static

Writes the COC marker (Coding style component)

Parameters
p_j2kJ2K codec.
p_comp_nothe index of the component to output.
p_dataFIXME DOC
p_data_writtenFIXME DOC
p_managerthe user event manager.

References opj_tccp::csty, J2K_MS_COC, opj_j2k::m_cp, opj_j2k::m_current_tile_number, opj_j2k::m_private_image, opj_image::numcomps, opj_j2k_get_SPCod_SPCoc_size(), opj_j2k_write_SPCod_SPCoc(), opj_write_bytes, opj_tcp::tccps, and opj_cp::tcps.

Referenced by opj_j2k_write_coc(), and opj_j2k_write_first_tile_part().

static OPJ_BOOL opj_j2k_write_cod ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_write_com ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes the COM marker (comment)

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References opj_cp::comment, EVT_ERROR, J2K_MS_COM, opj_j2k::m_cp, opj_j2k::m_encoder, opj_j2k_enc::m_header_tile_data, opj_j2k_enc::m_header_tile_data_size, opj_j2k::m_specific_param, opj_event_msg(), OPJ_FALSE, opj_free(), opj_realloc(), opj_stream_write_data(), OPJ_TRUE, and opj_write_bytes.

Referenced by opj_j2k_setup_header_writing().

static OPJ_BOOL opj_j2k_write_eoc ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes the EOC marker (End of Codestream)

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References J2K_MS_EOC, opj_j2k::m_encoder, opj_j2k_enc::m_header_tile_data, opj_j2k::m_specific_param, OPJ_FALSE, opj_stream_flush(), opj_stream_write_data(), OPJ_TRUE, and opj_write_bytes.

Referenced by opj_j2k_setup_end_compress().

static OPJ_BOOL opj_j2k_write_epc ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes EPC ????

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References opj_codestream_index::codestream_size, opj_j2k::cstr_index, opj_codestream_index::main_head_start, opj_stream_tell(), OPJ_TRUE, and OPJ_UNUSED.

Referenced by opj_j2k_setup_end_compress().

static OPJ_BOOL opj_j2k_write_first_tile_part ( opj_j2k_t p_j2k,
OPJ_BYTE p_data,
OPJ_UINT32 p_data_written,
OPJ_UINT32  p_total_data_size,
opj_stream_private_t p_stream,
struct opj_event_mgr p_manager 
)
static
static void opj_j2k_write_float_to_float ( const void *  p_src_data,
void *  p_dest_data,
OPJ_UINT32  p_nb_elem 
)
static

References opj_write_float.

static void opj_j2k_write_float_to_float64 ( const void *  p_src_data,
void *  p_dest_data,
OPJ_UINT32  p_nb_elem 
)
static

References opj_write_double.

static void opj_j2k_write_float_to_int16 ( const void *  p_src_data,
void *  p_dest_data,
OPJ_UINT32  p_nb_elem 
)
static

References opj_write_bytes.

static void opj_j2k_write_float_to_int32 ( const void *  p_src_data,
void *  p_dest_data,
OPJ_UINT32  p_nb_elem 
)
static

References opj_write_bytes.

static OPJ_BOOL opj_j2k_write_mcc_record ( opj_j2k_t p_j2k,
opj_simple_mcc_decorrelation_data_t p_mcc_record,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_write_mco ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_write_mct_data_group ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes the CBD-MCT-MCC-MCO markers (Multi components transform)

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References opj_j2k::m_cp, opj_j2k::m_current_tile_number, opj_tcp::m_mcc_records, opj_tcp::m_mct_records, opj_tcp::m_nb_mcc_records, opj_tcp::m_nb_mct_records, OPJ_FALSE, opj_j2k_write_cbd(), opj_j2k_write_mcc_record(), opj_j2k_write_mco(), opj_j2k_write_mct_record(), OPJ_TRUE, and opj_cp::tcps.

Referenced by opj_j2k_setup_header_writing().

static OPJ_BOOL opj_j2k_write_mct_record ( opj_j2k_t p_j2k,
opj_mct_data_t p_mct_record,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_write_poc ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static void opj_j2k_write_poc_in_memory ( opj_j2k_t p_j2k,
OPJ_BYTE p_data,
OPJ_UINT32 p_data_written,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_write_qcc ( opj_j2k_t p_j2k,
OPJ_UINT32  p_comp_no,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes the QCC marker (quantization component)

Parameters
p_comp_nothe index of the component to output.
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References EVT_ERROR, opj_j2k::m_current_tile_number, opj_j2k::m_encoder, opj_j2k_enc::m_header_tile_data, opj_j2k_enc::m_header_tile_data_size, opj_j2k::m_private_image, opj_j2k::m_specific_param, opj_image::numcomps, opj_event_msg(), OPJ_FALSE, opj_free(), opj_j2k_get_SQcd_SQcc_size(), opj_j2k_write_qcc_in_memory(), opj_realloc(), opj_stream_write_data(), and OPJ_TRUE.

Referenced by opj_j2k_write_all_qcc().

static void opj_j2k_write_qcc_in_memory ( opj_j2k_t p_j2k,
OPJ_UINT32  p_comp_no,
OPJ_BYTE p_data,
OPJ_UINT32 p_data_written,
opj_event_mgr_t p_manager 
)
static

Writes the QCC marker (quantization component)

Parameters
p_j2kJ2K codec.
p_comp_nothe index of the component to output.
p_dataFIXME DOC
p_data_writtenthe stream to write data to.
p_managerthe user event manager.

References J2K_MS_QCC, opj_j2k::m_current_tile_number, opj_j2k::m_private_image, opj_image::numcomps, opj_j2k_get_SQcd_SQcc_size(), opj_j2k_write_SQcd_SQcc(), and opj_write_bytes.

Referenced by opj_j2k_write_first_tile_part(), and opj_j2k_write_qcc().

static OPJ_BOOL opj_j2k_write_qcd ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_write_regions ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes regions of interests.

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References opj_j2k::m_cp, opj_j2k::m_private_image, opj_image::numcomps, OPJ_FALSE, opj_j2k_write_rgn(), OPJ_TRUE, opj_tccp::roishift, opj_tcp::tccps, and opj_cp::tcps.

Referenced by opj_j2k_setup_header_writing().

static OPJ_BOOL opj_j2k_write_rgn ( opj_j2k_t p_j2k,
OPJ_UINT32  p_tile_no,
OPJ_UINT32  p_comp_no,
OPJ_UINT32  nb_comps,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes the RGN marker (Region Of Interest)

Parameters
p_tile_nothe tile to output
p_comp_nothe component to output
nb_compsthe number of components
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References J2K_MS_RGN, opj_j2k::m_cp, opj_j2k::m_encoder, opj_j2k_enc::m_header_tile_data, opj_j2k::m_specific_param, OPJ_FALSE, opj_stream_write_data(), OPJ_TRUE, opj_write_bytes, opj_tccp::roishift, opj_tcp::tccps, and opj_cp::tcps.

Referenced by opj_j2k_write_regions().

static OPJ_BOOL opj_j2k_write_siz ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_write_soc ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes the SOC marker (Start Of Codestream)

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References J2K_MS_SOC, opj_j2k::m_encoder, opj_j2k_enc::m_header_tile_data, opj_j2k::m_specific_param, OPJ_FALSE, opj_stream_write_data(), OPJ_TRUE, and opj_write_bytes.

Referenced by opj_j2k_setup_header_writing().

static OPJ_BOOL opj_j2k_write_sod ( opj_j2k_t p_j2k,
opj_tcd_t p_tile_coder,
OPJ_BYTE p_data,
OPJ_UINT32 p_data_written,
OPJ_UINT32  p_total_data_size,
const opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes the SOD marker (Start of data)

Parameters
p_j2kJ2K codec.
p_tile_coderFIXME DOC
p_dataFIXME DOC
p_data_writtenFIXME DOC
p_total_data_sizeFIXME DOC
p_streamthe stream to write data to.
p_managerthe user event manager.

References opj_tcd::cur_tp_num, EVT_ERROR, J2K_MS_SOD, opj_j2k_enc::m_current_poc_tile_part_number, opj_j2k::m_current_tile_number, opj_j2k_enc::m_current_tile_part_number, opj_j2k::m_encoder, opj_j2k::m_specific_param, opj_event_msg(), OPJ_FALSE, opj_tcd_encode_tile(), OPJ_TRUE, OPJ_UNUSED, opj_write_bytes, opj_tcd_tile::packno, opj_codestream_info::packno, opj_tcd::tcd_image, opj_tcd_image::tiles, and opj_tcd::tp_num.

Referenced by opj_j2k_write_all_tile_parts(), and opj_j2k_write_first_tile_part().

static OPJ_BOOL opj_j2k_write_sot ( opj_j2k_t p_j2k,
OPJ_BYTE p_data,
OPJ_UINT32 p_data_written,
const opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes the SOT marker (Start of tile-part)

Parameters
p_j2kJ2K codec.
p_dataFIXME DOC
p_data_writtenFIXME DOC
p_streamthe stream to write data to.
p_managerthe user event manager.

References J2K_MS_SOT, opj_j2k::m_cp, opj_j2k::m_current_tile_number, opj_j2k_enc::m_current_tile_part_number, opj_j2k::m_encoder, opj_tcp::m_nb_tile_parts, opj_j2k::m_specific_param, OPJ_TRUE, OPJ_UNUSED, opj_write_bytes, and opj_cp::tcps.

Referenced by opj_j2k_write_all_tile_parts(), and opj_j2k_write_first_tile_part().

static OPJ_BOOL opj_j2k_write_SPCod_SPCoc ( opj_j2k_t p_j2k,
OPJ_UINT32  p_tile_no,
OPJ_UINT32  p_comp_no,
OPJ_BYTE p_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t p_manager 
)
static

Writes a SPCod or SPCoc element, i.e.

the coding style of a given component of a tile.

Parameters
p_j2kJ2K codec.
p_tile_noFIXME DOC
p_comp_nothe component number to output.
p_dataFIXME DOC
p_header_sizeFIXME DOC
p_managerthe user event manager.
Returns
FIXME DOC

References opj_tccp::cblkh, opj_tccp::cblksty, opj_tccp::cblkw, opj_tccp::csty, EVT_ERROR, J2K_CCP_CSTY_PRT, opj_j2k::m_cp, opj_j2k::m_private_image, opj_image::numcomps, opj_tccp::numresolutions, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, opj_write_bytes, opj_tccp::prch, opj_tccp::prcw, opj_tccp::qmfbid, opj_tcp::tccps, opj_cp::tcps, opj_cp::th, and opj_cp::tw.

Referenced by opj_j2k_write_coc_in_memory(), and opj_j2k_write_cod().

static OPJ_BOOL opj_j2k_write_SQcd_SQcc ( opj_j2k_t p_j2k,
OPJ_UINT32  p_tile_no,
OPJ_UINT32  p_comp_no,
OPJ_BYTE p_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t p_manager 
)
static

Writes a SQcd or SQcc element, i.e.

the quantization values of a band in the QCD or QCC.

Parameters
p_tile_nothe tile to output.
p_comp_nothe component number to output.
p_datathe data buffer.
p_header_sizepointer to the size of the data buffer, it is changed by the function.
p_j2kJ2K codec.
p_managerthe user event manager.

References EVT_ERROR, opj_stepsize::expn, J2K_CCP_QNTSTY_NOQNT, J2K_CCP_QNTSTY_SIQNT, opj_j2k::m_cp, opj_stepsize::mant, opj_tccp::numgbits, opj_tccp::numresolutions, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, opj_write_bytes, opj_tccp::qntsty, opj_tccp::stepsizes, opj_tcp::tccps, opj_cp::tcps, and opj_cp::th.

Referenced by opj_j2k_write_qcc_in_memory(), and opj_j2k_write_qcd().

static OPJ_BOOL opj_j2k_write_tlm ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_j2k_write_updated_tlm ( opj_j2k_t p_j2k,
opj_stream_private_t p_stream,
opj_event_mgr_t p_manager 
)
static

Writes the updated tlm.

Parameters
p_streamthe stream to write data to.
p_j2kJ2K codec.
p_managerthe user event manager.

References opj_j2k::m_encoder, opj_j2k::m_specific_param, opj_j2k_enc::m_tlm_sot_offsets_buffer, opj_j2k_enc::m_tlm_start, opj_j2k_enc::m_total_tile_parts, OPJ_FALSE, opj_stream_seek(), opj_stream_tell(), opj_stream_write_data(), and OPJ_TRUE.

Referenced by opj_j2k_setup_end_compress().