diff --git a/libopenjpeg/jp2.c b/libopenjpeg/jp2.c index 1c7205b6..a3d72bc4 100644 --- a/libopenjpeg/jp2.c +++ b/libopenjpeg/jp2.c @@ -1010,7 +1010,7 @@ opj_bool opj_jp2_read_pclr( opj_jp2_v2_t *jp2, jp2_pclr->channel_size = channel_size; jp2_pclr->entries = entries; jp2_pclr->nr_entries = nr_entries; - jp2_pclr->nr_channels = nr_channels; + jp2_pclr->nr_channels = (OPJ_BYTE) l_value; jp2_pclr->cmap = NULL; jp2->color.jp2_pclr = jp2_pclr; @@ -1578,8 +1578,8 @@ opj_bool jp2_write_jp2c_v2( opj_jp2_v2_t *jp2, opj_stream_private_t *cio, opj_event_mgr_t * p_manager ) { - unsigned int j2k_codestream_exit; - unsigned char l_data_header [8]; + OPJ_OFF_T j2k_codestream_exit; + OPJ_BYTE l_data_header [8]; // preconditions assert(jp2 != 00); @@ -1588,7 +1588,9 @@ opj_bool jp2_write_jp2c_v2( opj_jp2_v2_t *jp2, assert(opj_stream_has_seek(cio)); j2k_codestream_exit = opj_stream_tell(cio); - opj_write_bytes(l_data_header,j2k_codestream_exit - jp2->j2k_codestream_offset,4); /* size of codestream */ + opj_write_bytes(l_data_header, + (OPJ_UINT32) (j2k_codestream_exit - jp2->j2k_codestream_offset), + 4); /* size of codestream */ opj_write_bytes(l_data_header + 4,JP2_JP2C,4); /* JP2C */ if (! opj_stream_seek(cio,jp2->j2k_codestream_offset,p_manager)) { @@ -1770,8 +1772,9 @@ void jp2_destroy_compress(opj_jp2_t *jp2) { void jp2_setup_encoder( opj_jp2_v2_t *jp2, opj_cparameters_t *parameters, opj_image_t *image, - opj_event_mgr_t * p_manager) { - int i; + opj_event_mgr_t * p_manager) +{ + OPJ_UINT32 i; int depth_0, sign; if(!jp2 || !parameters || !image) diff --git a/libopenjpeg/jp2.h b/libopenjpeg/jp2.h index ba0f9ea7..9b9259c4 100644 --- a/libopenjpeg/jp2.h +++ b/libopenjpeg/jp2.h @@ -93,7 +93,7 @@ Channel description: channel index, type, assocation */ typedef struct opj_jp2_cdef_info { - unsigned short cn, typ, asoc; + OPJ_UINT16 cn, typ, asoc; } opj_jp2_cdef_info_t; /** @@ -102,7 +102,7 @@ Channel descriptions and number of descriptions typedef struct opj_jp2_cdef { opj_jp2_cdef_info_t *info; - unsigned short n; + OPJ_UINT16 n; } opj_jp2_cdef_t; /** @@ -110,8 +110,8 @@ Component mappings: channel index, mapping type, palette index */ typedef struct opj_jp2_cmap_comp { - unsigned short cmp; - unsigned char mtyp, pcol; + OPJ_UINT16 cmp; + OPJ_BYTE mtyp, pcol; } opj_jp2_cmap_comp_t; /** @@ -119,11 +119,12 @@ Palette data: table entries, palette columns */ typedef struct opj_jp2_pclr { - unsigned int *entries; - unsigned char *channel_sign; - unsigned char *channel_size; + OPJ_INT32 *entries; + OPJ_BYTE *channel_sign; + OPJ_BYTE *channel_size; opj_jp2_cmap_comp_t *cmap; - unsigned short nr_entries, nr_channels; + OPJ_UINT16 nr_entries; + OPJ_BYTE nr_channels; } opj_jp2_pclr_t; /** @@ -131,12 +132,12 @@ Collector for ICC profile, palette, component mapping, channel description */ typedef struct opj_jp2_color { - unsigned char *icc_profile_buf; - int icc_profile_len; + OPJ_BYTE *icc_profile_buf; + OPJ_UINT32 icc_profile_len; opj_jp2_cdef_t *jp2_cdef; opj_jp2_pclr_t *jp2_pclr; - unsigned char jp2_has_colr; + OPJ_BYTE jp2_has_colr; } opj_jp2_color_t; /** @@ -209,7 +210,7 @@ typedef struct opj_jp2_v2 OPJ_UINT32 numcl; OPJ_UINT32 *cl; opj_jp2_comps_t *comps; - OPJ_UINT32 j2k_codestream_offset; + OPJ_OFF_T j2k_codestream_offset; OPJ_UINT32 jp2_state; OPJ_UINT32 jp2_img_state;