OpenJPEG  1.5.1
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_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...
 

Local static functions

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...
 

Exported functions

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...
 
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...
 

Detailed Description

Macro Definition Documentation

#define J2K_CCP_CBLKSTY_LAZY   0x01

Selective arithmetic coding bypass.

Referenced by t1_decode_cblk(), t1_encode_cblk(), and t2_init_seg().

#define J2K_CCP_CBLKSTY_PTERM   0x10

Predictable termination.

Referenced by t1_encode_cblk().

#define J2K_CCP_CBLKSTY_RESET   0x02

Reset context probabilities on coding pass boundaries.

Referenced by t1_decode_cblk(), and t1_encode_cblk().

#define J2K_CCP_CBLKSTY_SEGSYM   0x20

Segmentation symbols are used.

Referenced by t1_dec_clnpass(), and t1_encode_cblk().

#define J2K_CCP_CBLKSTY_TERMALL   0x04

Termination on each coding pass.

Referenced by t1_encode_cblk(), and 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 j2k_setup_encoder().

#define J2K_CCP_QNTSTY_SIQNT   1

Referenced by j2k_read_qcx(), and j2k_write_qcx().

#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.

Referenced by j2k_write_coc().

#define J2K_MS_COD   0xff52

COD marker value.

Referenced by check_EPHuse(), and j2k_write_cod().

#define J2K_MS_COM   0xff64

COM marker value.

Referenced by j2k_write_com().

#define J2K_MS_CRG   0xff63

CRG marker value.

#define J2K_MS_EOC   0xffd9

EOC marker value.

Referenced by j2k_write_eoc(), and jpwl_correct().

#define J2K_MS_EPB   0xff66

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

Referenced by j2k_write_epb(), jpwl_correct(), jpwl_dump_marks(), jpwl_encode(), jpwl_epb_write(), jpwl_epbs_add(), and jpwl_prepare_marks().

#define J2K_MS_EPC   0xff68

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

Referenced by j2k_write_epc(), jpwl_dump_marks(), jpwl_encode(), jpwl_epc_write(), and jpwl_prepare_marks().

#define J2K_MS_EPH   0xff92

EPH marker value.

#define J2K_MS_ESD   0xff67

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

Referenced by jpwl_dump_marks(), jpwl_encode(), jpwl_esd_write(), and jpwl_prepare_marks().

#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.

Referenced by j2k_write_poc().

#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 j2k_write_qcc().

#define J2K_MS_QCD   0xff5c

QCD marker value.

Referenced by j2k_write_qcd().

#define J2K_MS_RED   0xff69

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

Referenced by jpwl_dump_marks(), and jpwl_encode().

#define J2K_MS_RGN   0xff5e

RGN marker value.

Referenced by j2k_write_rgn().

#define J2K_MS_SEC   0xff65

SEC marker value (Part 8: Secure JPEG 2000)

Referenced by j2k_write_sec().

#define J2K_MS_SIZ   0xff51

SIZ marker value.

Referenced by j2k_write_siz(), and jpwl_correct().

#define J2K_MS_SOC   0xff4f

SOC marker value.

Referenced by j2k_write_soc(), and jpwl_correct().

#define J2K_MS_SOD   0xff93

SOD marker value.

Referenced by j2k_write_sod(), and jpwl_correct().

#define J2K_MS_SOP   0xff91

SOP marker value.

#define J2K_MS_SOT   0xff90

SOT marker value.

Referenced by j2k_decode(), j2k_write_sot(), and jpwl_correct().

#define J2K_MS_TLM   0xff55

TLM marker value.

Referenced by j2k_write_tlm().

Typedef Documentation

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 opj_j2k_t

JPEG-2000 codestream reader/writer.

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_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_ERR 

the decoding process has encountered an error

enum T2_MODE

T2 encoding mode.

Enumerator
THRESH_CALC 
FINAL_PASS 

Function called in Rate allocation process.

Function Documentation

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().

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().

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, 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.

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().

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().

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().

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_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.

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().

void j2k_destroy_decompress ( opj_j2k_t j2k)
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_tcd::cur_totnum_tp, opj_j2k::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_tcd::tp_pos, opj_cp::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().

static void j2k_read_coc ( opj_j2k_t j2k)
static
static void j2k_read_cod ( opj_j2k_t j2k)
static
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().

static void j2k_read_cox ( opj_j2k_t j2k,
int  compno 
)
static
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.

static void j2k_read_eoc ( opj_j2k_t j2k)
static
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().

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().

static void j2k_read_poc ( opj_j2k_t j2k)
static
static void j2k_read_ppm ( opj_j2k_t j2k)
static
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.

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().

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.

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().

static void j2k_read_rgn ( opj_j2k_t j2k)
static
static void j2k_read_siz ( opj_j2k_t j2k)
static
static void j2k_read_soc ( opj_j2k_t j2k)
static
static void j2k_read_sod ( opj_j2k_t j2k)
static
static void j2k_read_sot ( opj_j2k_t j2k)
static
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().

static void j2k_read_unk ( opj_j2k_t j2k)
static
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().

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().

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().

static void j2k_write_cod ( opj_j2k_t j2k)
static
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().

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().

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().

static void j2k_write_poc ( opj_j2k_t j2k)
static
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().

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().

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().

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().

static void j2k_write_siz ( opj_j2k_t j2k)
static
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().

static void j2k_write_sod ( opj_j2k_t j2k,
void *  tile_coder 
)
static
static void j2k_write_sot ( opj_j2k_t j2k)
static
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().