OpenJPEG  1.5.1
Data Structures
j2k.c File Reference
#include "opj_includes.h"

Data Structures

struct  j2k_prog_order
 
struct  opj_dec_mstabent
 

Local static functions

typedef struct j2k_prog_order j2k_prog_order_t
 
typedef struct opj_dec_mstabent opj_dec_mstabent_t
 
j2k_prog_order_t j2k_prog_order_list []
 
opj_dec_mstabent_t j2k_dec_mstab []
 
static void j2k_write_soc (opj_j2k_t *j2k)
 Write the SOC marker (Start Of Codestream) More...
 
static void j2k_read_soc (opj_j2k_t *j2k)
 Read the SOC marker (Start of Codestream) More...
 
static void j2k_write_siz (opj_j2k_t *j2k)
 Write the SIZ marker (image and tile size) More...
 
static void j2k_read_siz (opj_j2k_t *j2k)
 Read the SIZ marker (image and tile size) More...
 
static void j2k_write_com (opj_j2k_t *j2k)
 Write the COM marker (comment) More...
 
static void j2k_read_com (opj_j2k_t *j2k)
 Read the COM marker (comment) More...
 
static void j2k_write_cox (opj_j2k_t *j2k, int compno)
 Write the value concerning the specified component in the marker COD and COC. More...
 
static void j2k_read_cox (opj_j2k_t *j2k, int compno)
 Read the value concerning the specified component in the marker COD and COC. More...
 
static void j2k_write_cod (opj_j2k_t *j2k)
 Write the COD marker (coding style default) More...
 
static void j2k_read_cod (opj_j2k_t *j2k)
 Read the COD marker (coding style default) More...
 
static void j2k_write_coc (opj_j2k_t *j2k, int compno)
 Write the COC marker (coding style component) More...
 
static void j2k_read_coc (opj_j2k_t *j2k)
 Read the COC marker (coding style component) More...
 
static void j2k_write_qcx (opj_j2k_t *j2k, int compno)
 Write the value concerning the specified component in the marker QCD and QCC. More...
 
static void j2k_read_qcx (opj_j2k_t *j2k, int compno, int len)
 Read the value concerning the specified component in the marker QCD and QCC. More...
 
static void j2k_write_qcd (opj_j2k_t *j2k)
 Write the QCD marker (quantization default) More...
 
static void j2k_read_qcd (opj_j2k_t *j2k)
 Read the QCD marker (quantization default) More...
 
static void j2k_write_qcc (opj_j2k_t *j2k, int compno)
 Write the QCC marker (quantization component) More...
 
static void j2k_read_qcc (opj_j2k_t *j2k)
 Read the QCC marker (quantization component) More...
 
static void j2k_write_poc (opj_j2k_t *j2k)
 Write the POC marker (progression order change) More...
 
static void j2k_read_poc (opj_j2k_t *j2k)
 Read the POC marker (progression order change) More...
 
static void j2k_read_crg (opj_j2k_t *j2k)
 Read the CRG marker (component registration) More...
 
static void j2k_read_tlm (opj_j2k_t *j2k)
 Read the TLM marker (tile-part lengths) More...
 
static void j2k_read_plm (opj_j2k_t *j2k)
 Read the PLM marker (packet length, main header) More...
 
static void j2k_read_plt (opj_j2k_t *j2k)
 Read the PLT marker (packet length, tile-part header) More...
 
static void j2k_read_ppm (opj_j2k_t *j2k)
 Read the PPM marker (packet packet headers, main header) More...
 
static void j2k_read_ppt (opj_j2k_t *j2k)
 Read the PPT marker (packet packet headers, tile-part header) More...
 
static void j2k_write_tlm (opj_j2k_t *j2k)
 Write the TLM marker (Mainheader) More...
 
static void j2k_write_sot (opj_j2k_t *j2k)
 Write the SOT marker (start of tile-part) More...
 
static void j2k_read_sot (opj_j2k_t *j2k)
 Read the SOT marker (start of tile-part) More...
 
static void j2k_write_sod (opj_j2k_t *j2k, void *tile_coder)
 Write the SOD marker (start of data) More...
 
static void j2k_read_sod (opj_j2k_t *j2k)
 Read the SOD marker (start of data) More...
 
static void j2k_write_rgn (opj_j2k_t *j2k, int compno, int tileno)
 Write the RGN marker (region-of-interest) More...
 
static void j2k_read_rgn (opj_j2k_t *j2k)
 Read the RGN marker (region-of-interest) More...
 
static void j2k_write_eoc (opj_j2k_t *j2k)
 Write the EOC marker (end of codestream) More...
 
static void j2k_read_eoc (opj_j2k_t *j2k)
 Read the EOC marker (end of codestream) More...
 
static void j2k_read_unk (opj_j2k_t *j2k)
 Read an unknown marker. More...
 
static void j2k_add_mhmarker (opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len)
 Add main header marker information. More...
 
static void j2k_add_tlmarker (int tileno, opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len)
 Add tile header marker information. More...
 
char * j2k_convert_progression_order (OPJ_PROG_ORDER prg_order)
 Converts an enum type progression order to string type. More...
 
static int j2k_get_num_tp (opj_cp_t *cp, int pino, int tileno)
 
int j2k_calculate_tp (opj_cp_t *cp, int img_numcomp, opj_image_t *image, opj_j2k_t *j2k)
 mem allocation for TLM marker More...
 
static opj_dec_mstabent_tj2k_dec_mstab_lookup (int id)
 Read the lookup table containing all the marker, status and action. More...
 
opj_j2k_tj2k_create_decompress (opj_common_ptr cinfo)
 Creates a J2K decompression structure. More...
 
void j2k_destroy_decompress (opj_j2k_t *j2k)
 Destroy a J2K decompressor handle. More...
 
void j2k_setup_decoder (opj_j2k_t *j2k, opj_dparameters_t *parameters)
 Setup the decoder decoding parameters using user parameters. More...
 
opj_image_tj2k_decode (opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *cstr_info)
 Decode an image from a JPEG-2000 codestream. More...
 
opj_image_tj2k_decode_jpt_stream (opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *cstr_info)
 Decode an image form a JPT-stream (JPEG 2000, JPIP) More...
 
opj_j2k_tj2k_create_compress (opj_common_ptr cinfo)
 Creates a J2K compression structure. More...
 
void j2k_destroy_compress (opj_j2k_t *j2k)
 Destroy a J2K compressor handle. More...
 
void j2k_setup_encoder (opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_t *image)
 Setup the encoder parameters using the current image and using user parameters. More...
 
opj_bool j2k_encode (opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info)
 Encode an image into a JPEG-2000 codestream. More...
 

Typedef Documentation

◆ j2k_prog_order_t

◆ opj_dec_mstabent_t

Function Documentation

◆ j2k_add_mhmarker()

static void j2k_add_mhmarker ( opj_codestream_info_t cstr_info,
unsigned short int  type,
int  pos,
int  len 
)
static

Add main header marker information.

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

References opj_marker_info_t::len, opj_codestream_info::marker, opj_codestream_info::marknum, opj_codestream_info::maxmarknum, opj_realloc, opj_marker_info_t::pos, and opj_marker_info_t::type.

Referenced by j2k_write_cod(), j2k_write_com(), j2k_write_qcd(), j2k_write_siz(), and j2k_write_soc().

◆ j2k_add_tlmarker()

static void j2k_add_tlmarker ( int  tileno,
opj_codestream_info_t cstr_info,
unsigned short int  type,
int  pos,
int  len 
)
static

Add tile header marker information.

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

References opj_marker_info_t::len, opj_tile_info::marker, opj_tile_info::marknum, opj_tile_info::maxmarknum, opj_codestream_info::maxmarknum, opj_realloc, opj_marker_info_t::pos, opj_codestream_info::tile, and opj_marker_info_t::type.

Referenced by j2k_write_sod(), and j2k_write_sot().

◆ j2k_calculate_tp()

int j2k_calculate_tp ( opj_cp_t cp,
int  img_numcomp,
opj_image_t image,
opj_j2k_t j2k 
)

◆ j2k_convert_progression_order()

char* j2k_convert_progression_order ( OPJ_PROG_ORDER  prg_order)

Converts an enum type progression order to string type.

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

Referenced by j2k_get_num_tp().

◆ j2k_create_compress()

opj_j2k_t* j2k_create_compress ( opj_common_ptr  cinfo)

Creates a J2K compression structure.

Parameters
cinfoCodec context info
Returns
Returns a handle to a J2K compressor if successful, returns NULL otherwise

References opj_j2k::cinfo, and opj_calloc.

Referenced by jp2_create_compress(), and opj_create_compress().

◆ j2k_create_decompress()

opj_j2k_t* j2k_create_decompress ( opj_common_ptr  cinfo)

Creates a J2K decompression structure.

Parameters
cinfoCodec context info
Returns
Returns a handle to a J2K decompressor if successful, returns NULL otherwise

References opj_j2k::cinfo, opj_j2k::default_tcp, opj_calloc, opj_free, and opj_j2k::tile_data.

Referenced by jp2_create_decompress(), and opj_create_decompress().

◆ j2k_dec_mstab_lookup()

static opj_dec_mstabent_t* j2k_dec_mstab_lookup ( int  id)
static

Read the lookup table containing all the marker, status and action.

Parameters
idMarker value

References opj_dec_mstabent::id, and j2k_dec_mstab.

Referenced by j2k_decode(), and j2k_decode_jpt_stream().

◆ j2k_decode()

opj_image_t* j2k_decode ( opj_j2k_t j2k,
opj_cio_t cio,
opj_codestream_info_t cstr_info 
)

Decode an image from a JPEG-2000 codestream.

Parameters
j2kJ2K decompressor handle
cioInput buffer stream
cstr_infoCodestream information structure if required, NULL otherwise
Returns
Returns a decoded image if successful, returns NULL otherwise

References opj_j2k::cinfo, opj_j2k::cio, cio_numbytesleft(), cio_read(), cio_seek(), cio_tell(), cio_write(), opj_cp::correct, opj_j2k::cp, opj_j2k::cstr_info, EVT_ERROR, EVT_INFO, EVT_WARNING, opj_dec_mstabent::handler, opj_dec_mstabent::id, opj_j2k::image, j2k_dec_mstab_lookup(), J2K_MS_SOT, j2k_read_eoc(), J2K_STATE_ERR, J2K_STATE_MHSOC, J2K_STATE_MT, J2K_STATE_NEOC, JPWL_ASSUME, jpwl_correct(), opj_cp::limit_decoding, LIMIT_TO_MAIN_HEADER, opj_event_msg(), opj_image_create0(), opj_image_destroy(), opj_j2k::state, and opj_dec_mstabent::states.

Referenced by opj_decode_with_info(), and opj_jp2_decode().

◆ j2k_decode_jpt_stream()

opj_image_t* j2k_decode_jpt_stream ( opj_j2k_t j2k,
opj_cio_t cio,
opj_codestream_info_t cstr_info 
)

Decode an image form a JPT-stream (JPEG 2000, JPIP)

Parameters
j2kJ2K decompressor handle
cioInput buffer stream
cstr_infoCodestream information structure if required, NULL otherwise
Returns
Returns a decoded image if successful, returns NULL otherwise

References opj_j2k::cinfo, opj_j2k::cio, cio_numbytesleft(), cio_read(), cio_tell(), opj_jpt_msg_header::Class_Id, EVT_ERROR, EVT_WARNING, opj_dec_mstabent::handler, opj_j2k::image, j2k_dec_mstab_lookup(), j2k_read_eoc(), J2K_STATE_ERR, J2K_STATE_MHSOC, J2K_STATE_MT, J2K_STATE_NEOC, jpt_init_msg_header(), jpt_read_msg_header(), opj_jpt_msg_header::Msg_length, OPJ_ARG_NOT_USED, opj_event_msg(), opj_image_create0(), opj_image_destroy(), opj_j2k::state, and opj_dec_mstabent::states.

Referenced by opj_decode_with_info().

◆ j2k_destroy_compress()

void j2k_destroy_compress ( opj_j2k_t j2k)

Destroy a J2K compressor handle.

Parameters
j2kJ2K compressor handle to destroy

References opj_cp::comment, opj_j2k::cp, opj_cp::matrice, opj_free, opj_tcp::tccps, opj_cp::tcps, opj_cp::th, and opj_cp::tw.

Referenced by jp2_destroy_compress(), and opj_destroy_compress().

◆ j2k_destroy_decompress()

void j2k_destroy_decompress ( opj_j2k_t j2k)

◆ j2k_encode()

opj_bool j2k_encode ( opj_j2k_t j2k,
opj_cio_t cio,
opj_image_t image,
opj_codestream_info_t cstr_info 
)

Encode an image into a JPEG-2000 codestream.

Parameters
j2kJ2K compressor handle
cioOutput buffer stream
imageImage to encode
cstr_infoCodestream information structure if required, NULL otherwise
Returns
Returns true if successful, returns false otherwise

References opj_cp::cinema, CINEMA4K_24, opj_j2k::cinfo, opj_j2k::cio, cio_tell(), opj_codestream_info::codestream_size, opj_cp::comment, opj_j2k::cp, opj_j2k::cstr_info, opj_tcd::cur_pino, opj_j2k::cur_totnum_tp, opj_tcd::cur_totnum_tp, opj_j2k::cur_tp_num, opj_j2k::curtileno, opj_codestream_info::D_max, opj_tile_info::end_pos, opj_cp::epc_on, EVT_INFO, opj_j2k::image, opj_codestream_info::image_h, opj_codestream_info::image_w, j2k_calculate_tp(), j2k_get_num_tp(), j2k_write_coc(), j2k_write_cod(), j2k_write_com(), j2k_write_eoc(), j2k_write_poc(), j2k_write_qcc(), j2k_write_qcd(), j2k_write_rgn(), j2k_write_siz(), j2k_write_soc(), j2k_write_sod(), j2k_write_sot(), j2k_write_tlm(), jpwl_encode(), opj_codestream_info::main_head_end, opj_codestream_info::main_head_start, opj_tile_info::marker, opj_codestream_info::marker, opj_tile_info::marknum, opj_codestream_info::marknum, opj_tile_info::maxmarknum, opj_codestream_info::maxmarknum, opj_image::numcomps, opj_codestream_info::numcomps, opj_codestream_info::numdecompos, opj_codestream_info::numlayers, opj_tcp::numpocs, opj_event_msg(), opj_free, opj_malloc, OPJ_TRUE, opj_codestream_info::packno, opj_j2k::pos_correction, opj_codestream_info::prog, opj_tccp::roishift, opj_tile_info::start_pos, opj_tcp::tccps, tcd_create(), tcd_destroy(), tcd_free_encode(), tcd_init_encode(), tcd_malloc_encode(), opj_cp::tcps, opj_cp::tdx, opj_cp::tdy, opj_cp::th, opj_codestream_info::th, opj_codestream_info::tile, opj_codestream_info::tile_Ox, opj_codestream_info::tile_Oy, opj_codestream_info::tile_x, opj_codestream_info::tile_y, opj_j2k::totnum_tp, opj_tile_info::tp, opj_tp_info::tp_end_header, opj_tp_info::tp_end_pos, opj_j2k::tp_num, opj_tp_info::tp_numpacks, opj_cp::tp_pos, opj_tcd::tp_pos, opj_tp_info::tp_start_pack, opj_tp_info::tp_start_pos, opj_cp::tw, opj_codestream_info::tw, opj_cp::tx0, opj_cp::ty0, opj_image::x0, opj_image::x1, opj_image::y0, and opj_image::y1.

Referenced by jp2_write_jp2c(), and opj_encode_with_info().

◆ j2k_get_num_tp()

static int j2k_get_num_tp ( opj_cp_t cp,
int  pino,
int  tileno 
)
static

◆ j2k_read_coc()

static void j2k_read_coc ( opj_j2k_t j2k)
static

◆ j2k_read_cod()

static void j2k_read_cod ( opj_j2k_t j2k)
static

◆ j2k_read_com()

static void j2k_read_com ( opj_j2k_t j2k)
static

Read the COM marker (comment)

Parameters
j2kJ2K handle

References opj_j2k::cio, cio_read(), and cio_skip().

◆ j2k_read_cox()

static void j2k_read_cox ( opj_j2k_t j2k,
int  compno 
)
static

◆ j2k_read_crg()

static void j2k_read_crg ( opj_j2k_t j2k)
static

Read the CRG marker (component registration)

Parameters
j2kJ2K handle

References opj_j2k::cio, cio_read(), opj_j2k::image, and opj_image::numcomps.

◆ j2k_read_eoc()

static void j2k_read_eoc ( opj_j2k_t j2k)
static

◆ j2k_read_plm()

static void j2k_read_plm ( opj_j2k_t j2k)
static

Read the PLM marker (packet length, main header)

Parameters
j2kJ2K handle

References opj_j2k::cio, and cio_read().

◆ j2k_read_plt()

static void j2k_read_plt ( opj_j2k_t j2k)
static

Read the PLT marker (packet length, tile-part header)

Parameters
j2kJ2K handle

References opj_j2k::cio, and cio_read().

◆ j2k_read_poc()

static void j2k_read_poc ( opj_j2k_t j2k)
static

◆ j2k_read_ppm()

static void j2k_read_ppm ( opj_j2k_t j2k)
static

◆ j2k_read_ppt()

static void j2k_read_ppt ( opj_j2k_t j2k)
static

Read the PPT marker (packet packet headers, tile-part header)

Parameters
j2kJ2K handle

References opj_j2k::cio, cio_read(), opj_j2k::cp, opj_j2k::curtileno, opj_malloc, opj_realloc, opj_tcp::ppt, opj_tcp::ppt_data, opj_tcp::ppt_data_first, opj_tcp::ppt_len, opj_tcp::ppt_store, and opj_cp::tcps.

◆ j2k_read_qcc()

static void j2k_read_qcc ( opj_j2k_t j2k)
static

Read the QCC marker (quantization component)

Parameters
j2kJ2K handle

References opj_j2k::cinfo, opj_j2k::cio, cio_read(), opj_cp::correct, opj_j2k::cp, EVT_ERROR, EVT_WARNING, opj_j2k::image, j2k_read_qcx(), JPWL_ASSUME, opj_image::numcomps, and opj_event_msg().

◆ j2k_read_qcd()

static void j2k_read_qcd ( opj_j2k_t j2k)
static

Read the QCD marker (quantization default)

Parameters
j2kJ2K handle

References opj_j2k::cio, cio_read(), cio_seek(), cio_tell(), opj_j2k::image, j2k_read_qcx(), and opj_image::numcomps.

◆ j2k_read_qcx()

static void j2k_read_qcx ( opj_j2k_t j2k,
int  compno,
int  len 
)
static

Read the value concerning the specified component in the marker QCD and QCC.

Parameters
j2kJ2K handle
compnoNumber of the component concern by the information read
lenLength of the information in the QCX part of the marker QCD/QCC

References opj_j2k::cinfo, opj_j2k::cio, cio_read(), opj_cp::correct, opj_j2k::cp, opj_j2k::curtileno, opj_j2k::default_tcp, EVT_ERROR, EVT_WARNING, opj_stepsize::expn, J2K_CCP_QNTSTY_NOQNT, J2K_CCP_QNTSTY_SIQNT, J2K_MAXBANDS, J2K_STATE_TPH, JPWL_ASSUME, opj_stepsize::mant, opj_tccp::numgbits, opj_event_msg(), opj_tccp::qntsty, opj_j2k::state, opj_tccp::stepsizes, opj_tcp::tccps, and opj_cp::tcps.

Referenced by j2k_read_qcc(), and j2k_read_qcd().

◆ j2k_read_rgn()

static void j2k_read_rgn ( opj_j2k_t j2k)
static

◆ j2k_read_siz()

static void j2k_read_siz ( opj_j2k_t j2k)
static

◆ j2k_read_soc()

static void j2k_read_soc ( opj_j2k_t j2k)
static

◆ j2k_read_sod()

static void j2k_read_sod ( opj_j2k_t j2k)
static

◆ j2k_read_sot()

static void j2k_read_sot ( opj_j2k_t j2k)
static

◆ j2k_read_tlm()

static void j2k_read_tlm ( opj_j2k_t j2k)
static

Read the TLM marker (tile-part lengths)

Parameters
j2kJ2K handle

References opj_j2k::cio, and cio_read().

◆ j2k_read_unk()

static void j2k_read_unk ( opj_j2k_t j2k)
static

◆ j2k_setup_decoder()

void j2k_setup_decoder ( opj_j2k_t j2k,
opj_dparameters_t parameters 
)

Setup the decoder decoding parameters using user parameters.

Decoding parameters are returned in j2k->cp.

Parameters
j2kJ2K decompressor handle
parametersdecompression parameters

References opj_cp::correct, opj_j2k::cp, opj_dparameters::cp_layer, opj_dparameters::cp_limit_decoding, opj_dparameters::cp_reduce, opj_cp::exp_comps, opj_dparameters::jpwl_correct, opj_dparameters::jpwl_exp_comps, opj_dparameters::jpwl_max_tiles, opj_cp::layer, opj_cp::limit_decoding, opj_cp::max_tiles, opj_calloc, and opj_cp::reduce.

Referenced by jp2_setup_decoder(), and opj_setup_decoder().

◆ j2k_setup_encoder()

void j2k_setup_encoder ( opj_j2k_t j2k,
opj_cparameters_t parameters,
opj_image_t image 
)

Setup the encoder parameters using the current image and using user parameters.

Coding parameters are returned in j2k->cp.

Parameters
j2kJ2K compressor handle
parameterscompression parameters
imageinput filled image

References opj_tccp::cblkh, opj_tccp::cblksty, opj_tccp::cblkw, opj_cparameters::cblockh_init, opj_cparameters::cblockw_init, opj_cp::cinema, opj_cp::comment, opj_poc::compno0, opj_poc::compno1, opj_image::comps, opj_j2k::cp, 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_cp::disto_alloc, opj_tcp::distoratio, dwt_calc_explicit_stepsizes(), opj_cp::epb_on, opj_cp::epc_on, opj_cp::esd_on, opj_cp::fixed_alloc, opj_cp::fixed_quality, opj_image_comp::h, opj_cp::hprot_MH, opj_cp::hprot_TPH, opj_cp::hprot_TPH_tileno, opj_cp::img_size, opj_cp::info_on, int_ceildiv(), int_floorlog2(), 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_cp::matrice, opj_cp::max_comp_size, opj_cparameters::max_comp_size, opj_tcp::mct, 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_calloc, OPJ_FALSE, opj_malloc, OPJ_TRUE, 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_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_tcp::tccps, 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_cp::tp_flag, opj_cparameters::tp_flag, opj_cp::tp_on, 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 jp2_setup_encoder(), and opj_setup_encoder().

◆ j2k_write_coc()

static void j2k_write_coc ( opj_j2k_t j2k,
int  compno 
)
static

Write the COC marker (coding style component)

Parameters
j2kJ2K handle
compnoNumber of the component concerned by the information written

References opj_j2k::cio, cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_j2k::cp, opj_tccp::csty, opj_j2k::curtileno, opj_j2k::image, J2K_MS_COC, j2k_write_cox(), opj_image::numcomps, opj_tcp::tccps, and opj_cp::tcps.

Referenced by j2k_encode().

◆ j2k_write_cod()

static void j2k_write_cod ( opj_j2k_t j2k)
static

◆ j2k_write_com()

static void j2k_write_com ( opj_j2k_t j2k)
static

Write the COM marker (comment)

Parameters
j2kJ2K handle

References opj_j2k::cio, cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_cp::comment, opj_j2k::cp, opj_j2k::cstr_info, j2k_add_mhmarker(), and J2K_MS_COM.

Referenced by j2k_encode().

◆ j2k_write_cox()

static void j2k_write_cox ( opj_j2k_t j2k,
int  compno 
)
static

Write the value concerning the specified component in the marker COD and COC.

Parameters
j2kJ2K handle
compnoNumber of the component concerned by the information written

References opj_tccp::cblkh, opj_tccp::cblksty, opj_tccp::cblkw, opj_j2k::cio, cio_write(), opj_j2k::cp, opj_tccp::csty, opj_j2k::curtileno, J2K_CCP_CSTY_PRT, opj_tccp::numresolutions, opj_tccp::prch, opj_tccp::prcw, opj_tccp::qmfbid, opj_tcp::tccps, and opj_cp::tcps.

Referenced by j2k_write_coc(), and j2k_write_cod().

◆ j2k_write_eoc()

static void j2k_write_eoc ( opj_j2k_t j2k)
static

Write the EOC marker (end of codestream)

Parameters
j2kJ2K handle

References opj_j2k::cio, cio_tell(), cio_write(), opj_j2k::cstr_info, j2k_add_marker(), and J2K_MS_EOC.

Referenced by j2k_encode().

◆ j2k_write_poc()

static void j2k_write_poc ( opj_j2k_t j2k)
static

◆ j2k_write_qcc()

static void j2k_write_qcc ( opj_j2k_t j2k,
int  compno 
)
static

Write the QCC marker (quantization component)

Parameters
j2kJ2K handle
compnoNumber of the component concerned by the information written

References opj_j2k::cio, cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_j2k::image, J2K_MS_QCC, j2k_write_qcx(), and opj_image::numcomps.

Referenced by j2k_encode().

◆ j2k_write_qcd()

static void j2k_write_qcd ( opj_j2k_t j2k)
static

Write the QCD marker (quantization default)

Parameters
j2kJ2K handle

References opj_j2k::cio, cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_j2k::cstr_info, j2k_add_mhmarker(), J2K_MS_QCD, and j2k_write_qcx().

Referenced by j2k_encode().

◆ j2k_write_qcx()

static void j2k_write_qcx ( opj_j2k_t j2k,
int  compno 
)
static

Write the value concerning the specified component in the marker QCD and QCC.

Parameters
j2kJ2K handle
compnoNumber of the component concerned by the information written

References opj_j2k::cio, cio_write(), opj_j2k::cp, opj_j2k::curtileno, opj_stepsize::expn, J2K_CCP_QNTSTY_NOQNT, J2K_CCP_QNTSTY_SIQNT, opj_stepsize::mant, opj_tccp::numgbits, opj_tccp::numresolutions, opj_tccp::qntsty, opj_tccp::stepsizes, opj_tcp::tccps, and opj_cp::tcps.

Referenced by j2k_write_qcc(), and j2k_write_qcd().

◆ j2k_write_rgn()

static void j2k_write_rgn ( opj_j2k_t j2k,
int  compno,
int  tileno 
)
static

Write the RGN marker (region-of-interest)

Parameters
j2kJ2K handle
compnoNumber of the component concerned by the information written
tilenoNumber of the tile concerned by the information written

References opj_j2k::cio, cio_write(), opj_j2k::cp, opj_j2k::image, J2K_MS_RGN, opj_image::numcomps, opj_tccp::roishift, opj_tcp::tccps, and opj_cp::tcps.

Referenced by j2k_encode().

◆ j2k_write_siz()

static void j2k_write_siz ( opj_j2k_t j2k)
static

◆ j2k_write_soc()

static void j2k_write_soc ( opj_j2k_t j2k)
static

Write the SOC marker (Start Of Codestream)

Parameters
j2kJ2K handle

References opj_j2k::cio, cio_tell(), cio_write(), opj_j2k::cstr_info, j2k_add_marker(), j2k_add_mhmarker(), and J2K_MS_SOC.

Referenced by j2k_encode().

◆ j2k_write_sod()

static void j2k_write_sod ( opj_j2k_t j2k,
void *  tile_coder 
)
static

◆ j2k_write_sot()

static void j2k_write_sot ( opj_j2k_t j2k)
static

◆ j2k_write_tlm()

static void j2k_write_tlm ( opj_j2k_t j2k)
static

Write the TLM marker (Mainheader)

Parameters
j2kJ2K handle

References opj_j2k::cio, cio_skip(), cio_tell(), cio_write(), J2K_MS_TLM, opj_j2k::tlm_start, and opj_j2k::totnum_tp.

Referenced by j2k_encode().

Variable Documentation

◆ j2k_dec_mstab

opj_dec_mstabent_t j2k_dec_mstab[]

◆ j2k_prog_order_list

j2k_prog_order_t j2k_prog_order_list[]
Initial value:
= {
{CPRL, "CPRL"},
{LRCP, "LRCP"},
{PCRL, "PCRL"},
{RLCP, "RLCP"},
{RPCL, "RPCL"},
{(OPJ_PROG_ORDER)-1, ""}
}

Referenced by j2k_convert_progression_order().

OPJ_PROG_ORDER
enum PROG_ORDER OPJ_PROG_ORDER
Progression order.
PCRL
@ PCRL
precinct-component-resolution-layer order
Definition: openjpeg.h:123
LRCP
@ LRCP
layer-resolution-component-precinct order
Definition: openjpeg.h:120
CPRL
@ CPRL
component-precinct-resolution-layer order
Definition: openjpeg.h:124
RPCL
@ RPCL
resolution-precinct-component-layer order
Definition: openjpeg.h:122
RLCP
@ RLCP
resolution-layer-component-precinct order
Definition: openjpeg.h:121