OpenJPEG 1.5.1
|
The JPEG-2000 Codestream Reader/Writer (J2K) More...
Go to the source code of this file.
Data Structures | |
struct | opj_stepsize |
Quantization stepsize. More... | |
struct | opj_tccp |
Tile-component coding parameters. More... | |
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_cp |
Coding parameters. More... | |
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_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 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_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_cp | opj_cp_t |
Coding parameters. More... | |
typedef struct opj_j2k | opj_j2k_t |
JPEG-2000 codestream reader/writer. More... | |
Enumerations | |
enum | J2K_STATUS { 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_ERR = 0x0080 } |
Values that specify the status of the decoding process when decoding the main header. More... | |
enum | T2_MODE { THRESH_CALC = 0 , FINAL_PASS = 1 } |
T2 encoding mode. More... | |
Functions | |
Exported functions | |
opj_j2k_t * | j2k_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_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. More... | |
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) More... | |
opj_j2k_t * | j2k_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... | |
char * | j2k_convert_progression_order (OPJ_PROG_ORDER prg_order) |
Converts an enum type progression order to string type. 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... | |
The JPEG-2000 Codestream Reader/Writer (J2K)
The functions in J2K.C have for goal to read/write the several parts of the codestream: markers and data.
#define J2K_CCP_CBLKSTY_LAZY 0x01 |
Selective arithmetic coding bypass.
#define J2K_CCP_CBLKSTY_PTERM 0x10 |
Predictable termination.
#define J2K_CCP_CBLKSTY_RESET 0x02 |
Reset context probabilities on coding pass boundaries.
#define J2K_CCP_CBLKSTY_SEGSYM 0x20 |
Segmentation symbols are used.
#define J2K_CCP_CBLKSTY_TERMALL 0x04 |
Termination on each coding pass.
#define J2K_CCP_CBLKSTY_VSC 0x08 |
Vertically stripe causal context.
#define J2K_CCP_CSTY_PRT 0x01 |
#define J2K_CCP_QNTSTY_NOQNT 0 |
#define J2K_CCP_QNTSTY_SEQNT 2 |
#define J2K_CCP_QNTSTY_SIQNT 1 |
#define J2K_CP_CSTY_EPH 0x04 |
#define J2K_CP_CSTY_PRT 0x01 |
#define J2K_CP_CSTY_SOP 0x02 |
#define J2K_MS_COC 0xff53 |
COC marker value.
#define J2K_MS_COD 0xff52 |
COD marker value.
#define J2K_MS_COM 0xff64 |
COM marker value.
#define J2K_MS_CRG 0xff63 |
CRG marker value.
#define J2K_MS_EOC 0xffd9 |
EOC marker value.
#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_PLM 0xff57 |
PLM marker value.
#define J2K_MS_PLT 0xff58 |
PLT marker value.
#define J2K_MS_POC 0xff5f |
POC marker value.
#define J2K_MS_PPM 0xff60 |
PPM marker value.
#define J2K_MS_PPT 0xff61 |
PPT marker value.
#define J2K_MS_QCC 0xff5d |
QCC marker value.
#define J2K_MS_QCD 0xff5c |
QCD marker value.
#define J2K_MS_RED 0xff69 |
RED marker value (Part 11: JPEG 2000 for Wireless)
#define J2K_MS_RGN 0xff5e |
RGN marker value.
#define J2K_MS_SEC 0xff65 |
SEC marker value (Part 8: Secure JPEG 2000)
#define J2K_MS_SIZ 0xff51 |
SIZ marker value.
#define J2K_MS_SOC 0xff4f |
SOC marker value.
#define J2K_MS_SOD 0xff93 |
SOD marker value.
#define J2K_MS_SOP 0xff91 |
SOP marker value.
#define J2K_MS_SOT 0xff90 |
SOT marker value.
#define J2K_MS_TLM 0xff55 |
TLM marker value.
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_stepsize opj_stepsize_t |
Quantization stepsize.
typedef struct opj_tccp opj_tccp_t |
Tile-component coding parameters.
Tile coding parameters : this structure is used to store coding/decoding parameters common to all tiles (information like COD, COC in main header)
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.
enum T2_MODE |
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().
opj_j2k_t * j2k_create_compress | ( | opj_common_ptr | cinfo | ) |
Creates a J2K compression structure.
cinfo | Codec context info |
References opj_j2k::cinfo, and opj_calloc.
Referenced by jp2_create_compress(), and opj_create_compress().
opj_j2k_t * j2k_create_decompress | ( | opj_common_ptr | cinfo | ) |
Creates a J2K decompression structure.
cinfo | Codec context info |
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().
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.
j2k | J2K decompressor handle |
cio | Input buffer stream |
cstr_info | Codestream information structure if required, 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().
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)
j2k | J2K decompressor handle |
cio | Input buffer stream |
cstr_info | Codestream information structure if required, 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_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().
void j2k_destroy_compress | ( | opj_j2k_t * | j2k | ) |
Destroy a J2K compressor handle.
j2k | J2K 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().
void j2k_destroy_decompress | ( | opj_j2k_t * | j2k | ) |
Destroy a J2K decompressor handle.
j2k | J2K decompressor handle to destroy |
References opj_cp::comment, opj_j2k::cp, opj_j2k::default_tcp, opj_free, opj_cp::ppm_data_first, opj_tcp::ppt_data_first, opj_tcp::tccps, opj_cp::tcps, opj_cp::th, opj_j2k::tile_data, opj_j2k::tile_len, opj_cp::tileno, opj_cp::tileno_size, and opj_cp::tw.
Referenced by jp2_destroy_decompress(), and opj_destroy_decompress().
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.
j2k | J2K compressor handle |
cio | Output buffer stream |
image | Image to encode |
cstr_info | Codestream information structure if required, NULL 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().
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.
j2k | J2K decompressor handle |
parameters | decompression 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().
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.
j2k | J2K compressor handle |
parameters | compression parameters |
image | input 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().