#include "opj_includes.h"
#include "opj_common.h"
static void opj_t2_putcommacode(opj_bio_t *bio, OPJ_INT32 n);
static OPJ_UINT32 opj_t2_getcommacode(opj_bio_t *bio);
static void opj_t2_putnumpasses(opj_bio_t *bio, OPJ_UINT32 n);
static OPJ_UINT32 opj_t2_getnumpasses(opj_bio_t *bio);
static OPJ_BOOL opj_t2_encode_packet(OPJ_UINT32 tileno,
opj_tcd_tile_t *tile,
opj_tcp_t *tcp,
opj_pi_iterator_t *pi,
OPJ_BYTE *dest,
OPJ_UINT32 * p_data_written,
OPJ_UINT32 len,
opj_codestream_info_t *cstr_info,
J2K_T2_MODE p_t2_mode,
opj_event_mgr_t *p_manager);
static OPJ_BOOL opj_t2_decode_packet(opj_t2_t* t2,
opj_tcd_tile_t *tile,
opj_tcp_t *tcp,
opj_pi_iterator_t *pi,
OPJ_BYTE *src,
OPJ_UINT32 * data_read,
OPJ_UINT32 max_length,
opj_packet_info_t *pack_info,
opj_event_mgr_t *p_manager);
static OPJ_BOOL opj_t2_skip_packet(opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile,
opj_tcp_t *p_tcp,
opj_pi_iterator_t *p_pi,
OPJ_BYTE *p_src,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_length,
opj_packet_info_t *p_pack_info,
opj_event_mgr_t *p_manager);
static OPJ_BOOL opj_t2_read_packet_header(opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile,
opj_tcp_t *p_tcp,
opj_pi_iterator_t *p_pi,
OPJ_BOOL * p_is_data_present,
OPJ_BYTE *p_src_data,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_length,
opj_packet_info_t *p_pack_info,
opj_event_mgr_t *p_manager);
static OPJ_BOOL opj_t2_read_packet_data(opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile,
opj_pi_iterator_t *p_pi,
OPJ_BYTE *p_src_data,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_length,
opj_packet_info_t *pack_info,
opj_event_mgr_t *p_manager);
static OPJ_BOOL opj_t2_skip_packet_data(opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile,
opj_pi_iterator_t *p_pi,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_length,
opj_packet_info_t *pack_info,
opj_event_mgr_t *p_manager);
static OPJ_BOOL opj_t2_init_seg(opj_tcd_cblk_dec_t* cblk,
OPJ_UINT32 index,
OPJ_UINT32 cblksty,
OPJ_UINT32 first);
static void opj_t2_putcommacode(opj_bio_t *bio, OPJ_INT32 n)
{ … }
static OPJ_UINT32 opj_t2_getcommacode(opj_bio_t *bio)
{ … }
static void opj_t2_putnumpasses(opj_bio_t *bio, OPJ_UINT32 n)
{ … }
static OPJ_UINT32 opj_t2_getnumpasses(opj_bio_t *bio)
{ … }
OPJ_BOOL opj_t2_encode_packets(opj_t2_t* p_t2,
OPJ_UINT32 p_tile_no,
opj_tcd_tile_t *p_tile,
OPJ_UINT32 p_maxlayers,
OPJ_BYTE *p_dest,
OPJ_UINT32 * p_data_written,
OPJ_UINT32 p_max_len,
opj_codestream_info_t *cstr_info,
opj_tcd_marker_info_t* p_marker_info,
OPJ_UINT32 p_tp_num,
OPJ_INT32 p_tp_pos,
OPJ_UINT32 p_pino,
J2K_T2_MODE p_t2_mode,
opj_event_mgr_t *p_manager)
{ … }
#if 0
#define JAS_FPRINTF …
#else
static void opj_null_jas_fprintf(FILE* file, const char * format, ...)
{ … }
#define JAS_FPRINTF …
#endif
OPJ_BOOL opj_t2_decode_packets(opj_tcd_t* tcd,
opj_t2_t *p_t2,
OPJ_UINT32 p_tile_no,
opj_tcd_tile_t *p_tile,
OPJ_BYTE *p_src,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_len,
opj_codestream_index_t *p_cstr_index,
opj_event_mgr_t *p_manager)
{ … }
opj_t2_t* opj_t2_create(opj_image_t *p_image, opj_cp_t *p_cp)
{ … }
void opj_t2_destroy(opj_t2_t *t2)
{ … }
static OPJ_BOOL opj_t2_decode_packet(opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile,
opj_tcp_t *p_tcp,
opj_pi_iterator_t *p_pi,
OPJ_BYTE *p_src,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_length,
opj_packet_info_t *p_pack_info,
opj_event_mgr_t *p_manager)
{ … }
static OPJ_BOOL opj_t2_encode_packet(OPJ_UINT32 tileno,
opj_tcd_tile_t * tile,
opj_tcp_t * tcp,
opj_pi_iterator_t *pi,
OPJ_BYTE *dest,
OPJ_UINT32 * p_data_written,
OPJ_UINT32 length,
opj_codestream_info_t *cstr_info,
J2K_T2_MODE p_t2_mode,
opj_event_mgr_t *p_manager)
{ … }
static OPJ_BOOL opj_t2_skip_packet(opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile,
opj_tcp_t *p_tcp,
opj_pi_iterator_t *p_pi,
OPJ_BYTE *p_src,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_length,
opj_packet_info_t *p_pack_info,
opj_event_mgr_t *p_manager)
{ … }
static OPJ_BOOL opj_t2_read_packet_header(opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile,
opj_tcp_t *p_tcp,
opj_pi_iterator_t *p_pi,
OPJ_BOOL * p_is_data_present,
OPJ_BYTE *p_src_data,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_length,
opj_packet_info_t *p_pack_info,
opj_event_mgr_t *p_manager)
{ … }
static OPJ_BOOL opj_t2_read_packet_data(opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile,
opj_pi_iterator_t *p_pi,
OPJ_BYTE *p_src_data,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_length,
opj_packet_info_t *pack_info,
opj_event_mgr_t* p_manager)
{ … }
static OPJ_BOOL opj_t2_skip_packet_data(opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile,
opj_pi_iterator_t *p_pi,
OPJ_UINT32 * p_data_read,
OPJ_UINT32 p_max_length,
opj_packet_info_t *pack_info,
opj_event_mgr_t *p_manager)
{ … }
static OPJ_BOOL opj_t2_init_seg(opj_tcd_cblk_dec_t* cblk,
OPJ_UINT32 index,
OPJ_UINT32 cblksty,
OPJ_UINT32 first)
{ … }