#include "opj_includes.h"
#define OPJ_BOX_SIZE …
#define OPJ_UNUSED(x) …
static OPJ_BOOL opj_jp2_read_ihdr(opj_jp2_t *jp2,
OPJ_BYTE *p_image_header_data,
OPJ_UINT32 p_image_header_size,
opj_event_mgr_t * p_manager);
static OPJ_BYTE * opj_jp2_write_ihdr(opj_jp2_t *jp2,
OPJ_UINT32 * p_nb_bytes_written);
static OPJ_BYTE * opj_jp2_write_bpcc(opj_jp2_t *jp2,
OPJ_UINT32 * p_nb_bytes_written);
static OPJ_BOOL opj_jp2_read_bpcc(opj_jp2_t *jp2,
OPJ_BYTE * p_bpc_header_data,
OPJ_UINT32 p_bpc_header_size,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_read_cdef(opj_jp2_t * jp2,
OPJ_BYTE * p_cdef_header_data,
OPJ_UINT32 p_cdef_header_size,
opj_event_mgr_t * p_manager);
static void opj_jp2_apply_cdef(opj_image_t *image, opj_jp2_color_t *color,
opj_event_mgr_t *);
static OPJ_BYTE * opj_jp2_write_cdef(opj_jp2_t *jp2,
OPJ_UINT32 * p_nb_bytes_written);
static OPJ_BYTE * opj_jp2_write_colr(opj_jp2_t *jp2,
OPJ_UINT32 * p_nb_bytes_written);
static OPJ_BOOL opj_jp2_write_ftyp(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_read_ftyp(opj_jp2_t *jp2,
OPJ_BYTE * p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_skip_jp2c(opj_jp2_t *jp2,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_read_jp2h(opj_jp2_t *jp2,
OPJ_BYTE *p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_write_jp2h(opj_jp2_t *jp2,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_write_jp2c(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
#ifdef USE_JPIP
static OPJ_BOOL opj_jpip_write_iptr(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jpip_write_cidx(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jpip_write_fidx(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
#endif
static OPJ_BOOL opj_jp2_read_jp(opj_jp2_t *jp2,
OPJ_BYTE * p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_write_jp(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image,
opj_jp2_color_t *color,
opj_event_mgr_t * p_manager);
static void opj_jp2_free_pclr(opj_jp2_color_t *color);
static OPJ_BOOL opj_jp2_read_pclr(opj_jp2_t *jp2,
OPJ_BYTE * p_pclr_header_data,
OPJ_UINT32 p_pclr_header_size,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_read_cmap(opj_jp2_t * jp2,
OPJ_BYTE * p_cmap_header_data,
OPJ_UINT32 p_cmap_header_size,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_read_colr(opj_jp2_t *jp2,
OPJ_BYTE * p_colr_header_data,
OPJ_UINT32 p_colr_header_size,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_setup_end_header_writing(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_setup_end_header_reading(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_read_header_procedure(opj_jp2_t *jp2,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_exec(opj_jp2_t * jp2,
opj_procedure_list_t * p_procedure_list,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_read_boxhdr(opj_jp2_box_t *box,
OPJ_UINT32 * p_number_bytes_read,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_setup_encoding_validation(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_setup_header_writing(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_default_validation(opj_jp2_t * jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
static const opj_jp2_header_handler_t * opj_jp2_img_find_handler(
OPJ_UINT32 p_id);
static const opj_jp2_header_handler_t * opj_jp2_find_handler(OPJ_UINT32 p_id);
static const opj_jp2_header_handler_t jp2_header [] = …;
static const opj_jp2_header_handler_t jp2_img_header [] = …;
static OPJ_BOOL opj_jp2_read_boxhdr_char(opj_jp2_box_t *box,
OPJ_BYTE * p_data,
OPJ_UINT32 * p_number_bytes_read,
OPJ_UINT32 p_box_max_size,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_setup_decoding_validation(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_setup_header_reading(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager);
static OPJ_BOOL opj_jp2_read_boxhdr(opj_jp2_box_t *box,
OPJ_UINT32 * p_number_bytes_read,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager)
{ … }
#if 0
static void jp2_write_url(opj_cio_t *cio, char *Idx_file)
{
OPJ_UINT32 i;
opj_jp2_box_t box;
box.init_pos = cio_tell(cio);
cio_skip(cio, 4);
cio_write(cio, JP2_URL, 4);
cio_write(cio, 0, 1);
cio_write(cio, 0, 3);
if (Idx_file) {
for (i = 0; i < strlen(Idx_file); i++) {
cio_write(cio, Idx_file[i], 1);
}
}
box.length = cio_tell(cio) - box.init_pos;
cio_seek(cio, box.init_pos);
cio_write(cio, box.length, 4);
cio_seek(cio, box.init_pos + box.length);
}
#endif
static OPJ_BOOL opj_jp2_read_ihdr(opj_jp2_t *jp2,
OPJ_BYTE *p_image_header_data,
OPJ_UINT32 p_image_header_size,
opj_event_mgr_t * p_manager)
{ … }
static OPJ_BYTE * opj_jp2_write_ihdr(opj_jp2_t *jp2,
OPJ_UINT32 * p_nb_bytes_written
)
{ … }
static OPJ_BYTE * opj_jp2_write_bpcc(opj_jp2_t *jp2,
OPJ_UINT32 * p_nb_bytes_written
)
{ … }
static OPJ_BOOL opj_jp2_read_bpcc(opj_jp2_t *jp2,
OPJ_BYTE * p_bpc_header_data,
OPJ_UINT32 p_bpc_header_size,
opj_event_mgr_t * p_manager
)
{ … }
static OPJ_BYTE * opj_jp2_write_cdef(opj_jp2_t *jp2,
OPJ_UINT32 * p_nb_bytes_written)
{ … }
static OPJ_BYTE * opj_jp2_write_colr(opj_jp2_t *jp2,
OPJ_UINT32 * p_nb_bytes_written
)
{ … }
static void opj_jp2_free_pclr(opj_jp2_color_t *color)
{ … }
static OPJ_BOOL opj_jp2_check_color(opj_image_t *image, opj_jp2_color_t *color,
opj_event_mgr_t *p_manager)
{ … }
static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image,
opj_jp2_color_t *color,
opj_event_mgr_t * p_manager)
{ … }
static OPJ_BOOL opj_jp2_read_pclr(opj_jp2_t *jp2,
OPJ_BYTE * p_pclr_header_data,
OPJ_UINT32 p_pclr_header_size,
opj_event_mgr_t * p_manager
)
{ … }
static OPJ_BOOL opj_jp2_read_cmap(opj_jp2_t * jp2,
OPJ_BYTE * p_cmap_header_data,
OPJ_UINT32 p_cmap_header_size,
opj_event_mgr_t * p_manager
)
{ … }
static void opj_jp2_apply_cdef(opj_image_t *image, opj_jp2_color_t *color,
opj_event_mgr_t *manager)
{ … }
static OPJ_BOOL opj_jp2_read_cdef(opj_jp2_t * jp2,
OPJ_BYTE * p_cdef_header_data,
OPJ_UINT32 p_cdef_header_size,
opj_event_mgr_t * p_manager
)
{ … }
static OPJ_BOOL opj_jp2_read_colr(opj_jp2_t *jp2,
OPJ_BYTE * p_colr_header_data,
OPJ_UINT32 p_colr_header_size,
opj_event_mgr_t * p_manager
)
{ … }
static OPJ_BOOL opj_jp2_apply_color_postprocessing(opj_jp2_t *jp2,
opj_image_t* p_image,
opj_event_mgr_t * p_manager)
{ … }
OPJ_BOOL opj_jp2_decode(void *p_jp2,
opj_stream_private_t *p_stream,
opj_image_t* p_image,
opj_event_mgr_t * p_manager)
{ … }
static OPJ_BOOL opj_jp2_write_jp2h(opj_jp2_t *jp2,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager
)
{ … }
static OPJ_BOOL opj_jp2_write_ftyp(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager)
{ … }
static OPJ_BOOL opj_jp2_write_jp2c(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager)
{ … }
static OPJ_BOOL opj_jp2_write_jp(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager)
{ … }
void opj_jp2_setup_decoder(void *p_jp2, opj_dparameters_t *parameters)
{ … }
void opj_jp2_decoder_set_strict_mode(void *p_jp2, OPJ_BOOL strict)
{ … }
OPJ_BOOL opj_jp2_set_threads(void *p_jp2, OPJ_UINT32 num_threads)
{ … }
OPJ_BOOL opj_jp2_setup_encoder(void *p_jp2,
opj_cparameters_t *parameters,
opj_image_t *image,
opj_event_mgr_t * p_manager)
{ … }
OPJ_BOOL opj_jp2_encode(void *p_jp2,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager)
{ … }
OPJ_BOOL opj_jp2_end_decompress(void *p_jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager
)
{ … }
OPJ_BOOL opj_jp2_end_compress(void *p_jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager
)
{ … }
static OPJ_BOOL opj_jp2_setup_end_header_writing(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager)
{ … }
static OPJ_BOOL opj_jp2_setup_end_header_reading(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager)
{ … }
static OPJ_BOOL opj_jp2_default_validation(opj_jp2_t * jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager
)
{ … }
static OPJ_BOOL opj_jp2_read_header_procedure(opj_jp2_t *jp2,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager
)
{ … }
static OPJ_BOOL opj_jp2_exec(opj_jp2_t * jp2,
opj_procedure_list_t * p_procedure_list,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager
)
{ … }
OPJ_BOOL opj_jp2_start_compress(void *p_jp2,
opj_stream_private_t *stream,
opj_image_t * p_image,
opj_event_mgr_t * p_manager
)
{ … }
static const opj_jp2_header_handler_t * opj_jp2_find_handler(OPJ_UINT32 p_id)
{ … }
static const opj_jp2_header_handler_t * opj_jp2_img_find_handler(
OPJ_UINT32 p_id)
{ … }
static OPJ_BOOL opj_jp2_read_jp(opj_jp2_t *jp2,
OPJ_BYTE * p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager
)
{ … }
static OPJ_BOOL opj_jp2_read_ftyp(opj_jp2_t *jp2,
OPJ_BYTE * p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager
)
{ … }
static OPJ_BOOL opj_jp2_skip_jp2c(opj_jp2_t *jp2,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager)
{ … }
static OPJ_BOOL opj_jpip_skip_iptr(opj_jp2_t *jp2,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager)
{ … }
static OPJ_BOOL opj_jp2_read_jp2h(opj_jp2_t *jp2,
OPJ_BYTE *p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager
)
{ … }
static OPJ_BOOL opj_jp2_read_boxhdr_char(opj_jp2_box_t *box,
OPJ_BYTE * p_data,
OPJ_UINT32 * p_number_bytes_read,
OPJ_UINT32 p_box_max_size,
opj_event_mgr_t * p_manager
)
{ … }
OPJ_BOOL opj_jp2_read_header(opj_stream_private_t *p_stream,
void *p_jp2,
opj_image_t ** p_image,
opj_event_mgr_t * p_manager
)
{ … }
static OPJ_BOOL opj_jp2_setup_encoding_validation(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager)
{ … }
static OPJ_BOOL opj_jp2_setup_decoding_validation(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager)
{ … }
static OPJ_BOOL opj_jp2_setup_header_writing(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager)
{ … }
static OPJ_BOOL opj_jp2_setup_header_reading(opj_jp2_t *jp2,
opj_event_mgr_t * p_manager)
{ … }
OPJ_BOOL opj_jp2_read_tile_header(void *p_jp2,
OPJ_UINT32 * p_tile_index,
OPJ_UINT32 * p_data_size,
OPJ_INT32 * p_tile_x0,
OPJ_INT32 * p_tile_y0,
OPJ_INT32 * p_tile_x1,
OPJ_INT32 * p_tile_y1,
OPJ_UINT32 * p_nb_comps,
OPJ_BOOL * p_go_on,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager
)
{ … }
OPJ_BOOL opj_jp2_write_tile(void *p_jp2,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager
)
{ … }
OPJ_BOOL opj_jp2_decode_tile(void *p_jp2,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager
)
{ … }
void opj_jp2_destroy(void *p_jp2)
{ … }
OPJ_BOOL opj_jp2_set_decoded_components(void *p_jp2,
OPJ_UINT32 numcomps,
const OPJ_UINT32* comps_indices,
opj_event_mgr_t * p_manager)
{ … }
OPJ_BOOL opj_jp2_set_decode_area(void *p_jp2,
opj_image_t* p_image,
OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,
OPJ_INT32 p_end_x, OPJ_INT32 p_end_y,
opj_event_mgr_t * p_manager
)
{ … }
OPJ_BOOL opj_jp2_get_tile(void *jp2,
opj_stream_private_t *p_stream,
opj_image_t* p_image,
opj_event_mgr_t * p_manager,
OPJ_UINT32 tile_index
)
{ … }
opj_jp2_t* opj_jp2_create(OPJ_BOOL p_is_decoder)
{ … }
void jp2_dump(void* p_jp2, OPJ_INT32 flag, FILE* out_stream)
{ … }
opj_codestream_index_t* jp2_get_cstr_index(void* p_jp2)
{ … }
opj_codestream_info_v2_t* jp2_get_cstr_info(void* p_jp2)
{ … }
OPJ_BOOL opj_jp2_set_decoded_resolution_factor(void *p_jp2,
OPJ_UINT32 res_factor,
opj_event_mgr_t * p_manager)
{ … }
OPJ_BOOL opj_jp2_encoder_set_extra_options(
void *p_jp2,
const char* const* p_options,
opj_event_mgr_t * p_manager)
{ … }
#ifdef USE_JPIP
static OPJ_BOOL opj_jpip_write_iptr(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager)
{
OPJ_OFF_T j2k_codestream_exit;
OPJ_BYTE l_data_header [24];
assert(jp2 != 00);
assert(cio != 00);
assert(p_manager != 00);
assert(opj_stream_has_seek(cio));
j2k_codestream_exit = opj_stream_tell(cio);
opj_write_bytes(l_data_header, 24, 4);
opj_write_bytes(l_data_header + 4, JPIP_IPTR,
4);
#if 0
opj_write_bytes(l_data_header + 4 + 4, 0, 8);
opj_write_bytes(l_data_header + 8 + 8, 0, 8);
#else
opj_write_double(l_data_header + 4 + 4, 0);
opj_write_double(l_data_header + 8 + 8, 0);
#endif
if (! opj_stream_seek(cio, jp2->jpip_iptr_offset, p_manager)) {
opj_event_msg(p_manager, EVT_ERROR, "Failed to seek in the stream.\n");
return OPJ_FALSE;
}
if (opj_stream_write_data(cio, l_data_header, 24, p_manager) != 24) {
opj_event_msg(p_manager, EVT_ERROR, "Failed to seek in the stream.\n");
return OPJ_FALSE;
}
if (! opj_stream_seek(cio, j2k_codestream_exit, p_manager)) {
opj_event_msg(p_manager, EVT_ERROR, "Failed to seek in the stream.\n");
return OPJ_FALSE;
}
return OPJ_TRUE;
}
static OPJ_BOOL opj_jpip_write_fidx(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager)
{
OPJ_OFF_T j2k_codestream_exit;
OPJ_BYTE l_data_header [24];
OPJ_UNUSED(jp2);
assert(jp2 != 00);
assert(cio != 00);
assert(p_manager != 00);
assert(opj_stream_has_seek(cio));
opj_write_bytes(l_data_header, 24, 4);
opj_write_bytes(l_data_header + 4, JPIP_FIDX,
4);
opj_write_double(l_data_header + 4 + 4, 0);
opj_write_double(l_data_header + 8 + 8, 0);
if (opj_stream_write_data(cio, l_data_header, 24, p_manager) != 24) {
opj_event_msg(p_manager, EVT_ERROR, "Failed to seek in the stream.\n");
return OPJ_FALSE;
}
j2k_codestream_exit = opj_stream_tell(cio);
if (! opj_stream_seek(cio, j2k_codestream_exit, p_manager)) {
opj_event_msg(p_manager, EVT_ERROR, "Failed to seek in the stream.\n");
return OPJ_FALSE;
}
return OPJ_TRUE;
}
static OPJ_BOOL opj_jpip_write_cidx(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager)
{
OPJ_OFF_T j2k_codestream_exit;
OPJ_BYTE l_data_header [24];
OPJ_UNUSED(jp2);
assert(jp2 != 00);
assert(cio != 00);
assert(p_manager != 00);
assert(opj_stream_has_seek(cio));
j2k_codestream_exit = opj_stream_tell(cio);
opj_write_bytes(l_data_header, 24, 4);
opj_write_bytes(l_data_header + 4, JPIP_CIDX,
4);
#if 0
opj_write_bytes(l_data_header + 4 + 4, 0, 8);
opj_write_bytes(l_data_header + 8 + 8, 0, 8);
#else
opj_write_double(l_data_header + 4 + 4, 0);
opj_write_double(l_data_header + 8 + 8, 0);
#endif
if (! opj_stream_seek(cio, j2k_codestream_exit, p_manager)) {
opj_event_msg(p_manager, EVT_ERROR, "Failed to seek in the stream.\n");
return OPJ_FALSE;
}
if (opj_stream_write_data(cio, l_data_header, 24, p_manager) != 24) {
opj_event_msg(p_manager, EVT_ERROR, "Failed to seek in the stream.\n");
return OPJ_FALSE;
}
j2k_codestream_exit = opj_stream_tell(cio);
if (! opj_stream_seek(cio, j2k_codestream_exit, p_manager)) {
opj_event_msg(p_manager, EVT_ERROR, "Failed to seek in the stream.\n");
return OPJ_FALSE;
}
return OPJ_TRUE;
}
#if 0
static void write_prxy(int offset_jp2c, int length_jp2c, int offset_idx,
int length_idx, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager)
{
OPJ_BYTE l_data_header [8];
OPJ_OFF_T len, lenp;
lenp = opj_stream_tell(cio);
opj_stream_skip(cio, 4, p_manager);
opj_write_bytes(l_data_header, JPIP_PRXY, 4);
opj_stream_write_data(cio, l_data_header, 4, p_manager);
opj_write_bytes(l_data_header, offset_jp2c, 8);
opj_stream_write_data(cio, l_data_header, 8, p_manager);
opj_write_bytes(l_data_header, length_jp2c, 4);
opj_write_bytes(l_data_header + 4, JP2_JP2C, 4);
opj_stream_write_data(cio, l_data_header, 8, p_manager);
opj_write_bytes(l_data_header, 1, 1);
opj_stream_write_data(cio, l_data_header, 1, p_manager);
opj_write_bytes(l_data_header, offset_idx, 8);
opj_stream_write_data(cio, l_data_header, 8, p_manager);
opj_write_bytes(l_data_header, length_idx, 4);
opj_write_bytes(l_data_header + 4, JPIP_CIDX, 4);
opj_stream_write_data(cio, l_data_header, 8, p_manager);
len = opj_stream_tell(cio) - lenp;
opj_stream_skip(cio, lenp, p_manager);
opj_write_bytes(l_data_header, len, 4);
opj_stream_write_data(cio, l_data_header, 4, p_manager);
opj_stream_seek(cio, lenp + len, p_manager);
}
#endif
#if 0
static int write_fidx(int offset_jp2c, int length_jp2c, int offset_idx,
int length_idx, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager)
{
OPJ_BYTE l_data_header [4];
OPJ_OFF_T len, lenp;
lenp = opj_stream_tell(cio);
opj_stream_skip(cio, 4, p_manager);
opj_write_bytes(l_data_header, JPIP_FIDX, 4);
opj_stream_write_data(cio, l_data_header, 4, p_manager);
write_prxy(offset_jp2c, length_jp2c, offset_idx, length_idx, cio, p_manager);
len = opj_stream_tell(cio) - lenp;
opj_stream_skip(cio, lenp, p_manager);
opj_write_bytes(l_data_header, len, 4);
opj_stream_write_data(cio, l_data_header, 4, p_manager);
opj_stream_seek(cio, lenp + len, p_manager);
return len;
}
#endif
#endif