memset(p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps ,0,l_image->numcomps*sizeof(opj_tccp_t));
p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mct_records =
- (opj_mct_data_t*)opj_malloc(J2K_MCT_DEFAULT_NB_RECORDS * sizeof(opj_mct_data_t));
+ (opj_mct_data_t*)opj_malloc(OPJ_J2K_MCT_DEFAULT_NB_RECORDS * sizeof(opj_mct_data_t));
if (! p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mct_records) {
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to take in charge SIZ marker\n");
return OPJ_FALSE;
}
- memset(p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mct_records,0,J2K_MCT_DEFAULT_NB_RECORDS * sizeof(opj_mct_data_t));
- p_j2k->m_specific_param.m_decoder.m_default_tcp->m_nb_max_mct_records = J2K_MCT_DEFAULT_NB_RECORDS;
+ memset(p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mct_records,0,OPJ_J2K_MCT_DEFAULT_NB_RECORDS * sizeof(opj_mct_data_t));
+ p_j2k->m_specific_param.m_decoder.m_default_tcp->m_nb_max_mct_records = OPJ_J2K_MCT_DEFAULT_NB_RECORDS;
p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mcc_records =
(opj_simple_mcc_decorrelation_data_t*)
- opj_malloc(J2K_MCC_DEFAULT_NB_RECORDS * sizeof(opj_simple_mcc_decorrelation_data_t));
+ opj_malloc(OPJ_J2K_MCC_DEFAULT_NB_RECORDS * sizeof(opj_simple_mcc_decorrelation_data_t));
if (! p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mcc_records) {
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to take in charge SIZ marker\n");
return OPJ_FALSE;
}
- memset(p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mcc_records,0,J2K_MCC_DEFAULT_NB_RECORDS * sizeof(opj_simple_mcc_decorrelation_data_t));
- p_j2k->m_specific_param.m_decoder.m_default_tcp->m_nb_max_mcc_records = J2K_MCC_DEFAULT_NB_RECORDS;
+ memset(p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mcc_records,0,OPJ_J2K_MCC_DEFAULT_NB_RECORDS * sizeof(opj_simple_mcc_decorrelation_data_t));
+ p_j2k->m_specific_param.m_decoder.m_default_tcp->m_nb_max_mcc_records = OPJ_J2K_MCC_DEFAULT_NB_RECORDS;
/* set up default dc level shift */
for (i=0;i<l_image->numcomps;++i) {
if (i == l_tcp->m_nb_mct_records) {
if (l_tcp->m_nb_mct_records == l_tcp->m_nb_max_mct_records) {
opj_mct_data_t *new_mct_records;
- l_tcp->m_nb_max_mct_records += J2K_MCT_DEFAULT_NB_RECORDS;
+ l_tcp->m_nb_max_mct_records += OPJ_J2K_MCT_DEFAULT_NB_RECORDS;
new_mct_records = (opj_mct_data_t *) opj_realloc(l_tcp->m_mct_records, l_tcp->m_nb_max_mct_records * sizeof(opj_mct_data_t));
if (! new_mct_records) {
if (i == l_tcp->m_nb_mcc_records) {
if (l_tcp->m_nb_mcc_records == l_tcp->m_nb_max_mcc_records) {
opj_simple_mcc_decorrelation_data_t *new_mcc_records;
- l_tcp->m_nb_max_mcc_records += J2K_MCC_DEFAULT_NB_RECORDS;
+ l_tcp->m_nb_max_mcc_records += OPJ_J2K_MCC_DEFAULT_NB_RECORDS;
new_mcc_records = (opj_simple_mcc_decorrelation_data_t *) opj_realloc(
l_tcp->m_mcc_records, l_tcp->m_nb_max_mcc_records * sizeof(opj_simple_mcc_decorrelation_data_t));
l_j2k->m_is_decoder = 0;
l_j2k->m_cp.m_is_decoder = 0;
- l_j2k->m_specific_param.m_encoder.m_header_tile_data = (OPJ_BYTE *) opj_malloc(J2K_DEFAULT_HEADER_SIZE);
+ l_j2k->m_specific_param.m_encoder.m_header_tile_data = (OPJ_BYTE *) opj_malloc(OPJ_J2K_DEFAULT_HEADER_SIZE);
if (! l_j2k->m_specific_param.m_encoder.m_header_tile_data) {
opj_j2k_destroy(l_j2k);
return NULL;
}
- l_j2k->m_specific_param.m_encoder.m_header_tile_data_size = J2K_DEFAULT_HEADER_SIZE;
+ l_j2k->m_specific_param.m_encoder.m_header_tile_data_size = OPJ_J2K_DEFAULT_HEADER_SIZE;
/* validation list creation*/
l_j2k->m_validation_list = opj_procedure_list_create();
if (p_tcp->m_mct_decoding_matrix) {
if (p_tcp->m_nb_mct_records == p_tcp->m_nb_max_mct_records) {
opj_mct_data_t *new_mct_records;
- p_tcp->m_nb_max_mct_records += J2K_MCT_DEFAULT_NB_RECORDS;
+ p_tcp->m_nb_max_mct_records += OPJ_J2K_MCT_DEFAULT_NB_RECORDS;
new_mct_records = (opj_mct_data_t *) opj_realloc(p_tcp->m_mct_records, p_tcp->m_nb_max_mct_records * sizeof(opj_mct_data_t));
if (! new_mct_records) {
if (p_tcp->m_nb_mct_records == p_tcp->m_nb_max_mct_records) {
opj_mct_data_t *new_mct_records;
- p_tcp->m_nb_max_mct_records += J2K_MCT_DEFAULT_NB_RECORDS;
+ p_tcp->m_nb_max_mct_records += OPJ_J2K_MCT_DEFAULT_NB_RECORDS;
new_mct_records = (opj_mct_data_t *) opj_realloc(p_tcp->m_mct_records, p_tcp->m_nb_max_mct_records * sizeof(opj_mct_data_t));
if (! new_mct_records) {
opj_free(p_tcp->m_mct_records);
if (p_tcp->m_nb_mcc_records == p_tcp->m_nb_max_mcc_records) {
opj_simple_mcc_decorrelation_data_t *new_mcc_records;
- p_tcp->m_nb_max_mcc_records += J2K_MCT_DEFAULT_NB_RECORDS;
+ p_tcp->m_nb_max_mcc_records += OPJ_J2K_MCT_DEFAULT_NB_RECORDS;
new_mcc_records = (opj_simple_mcc_decorrelation_data_t *) opj_realloc(
p_tcp->m_mcc_records, p_tcp->m_nb_max_mcc_records * sizeof(opj_simple_mcc_decorrelation_data_t));
if (! new_mcc_records) {
}
memset(l_j2k->m_specific_param.m_decoder.m_default_tcp,0,sizeof(opj_tcp_t));
- l_j2k->m_specific_param.m_decoder.m_header_data = (OPJ_BYTE *) opj_malloc(J2K_DEFAULT_HEADER_SIZE);
+ l_j2k->m_specific_param.m_decoder.m_header_data = (OPJ_BYTE *) opj_malloc(OPJ_J2K_DEFAULT_HEADER_SIZE);
if (! l_j2k->m_specific_param.m_decoder.m_header_data) {
opj_j2k_destroy(l_j2k);
return 00;
}
- l_j2k->m_specific_param.m_decoder.m_header_data_size = J2K_DEFAULT_HEADER_SIZE;
+ l_j2k->m_specific_param.m_decoder.m_header_data_size = OPJ_J2K_DEFAULT_HEADER_SIZE;
l_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec = -1 ;
(*p_header_size) :
(*p_header_size) / 2;
- if( l_num_band > J2K_MAXBANDS ) {
+ if( l_num_band > OPJ_J2K_MAXBANDS ) {
opj_event_msg(p_manager, EVT_WARNING, "While reading CCP_QNTSTY element inside QCD or QCC marker segment, "
- "number of subbands (%d) is greater to J2K_MAXBANDS (%d). So we limit the number of elements stored to "
- "J2K_MAXBANDS (%d) and skip the rest. \n", l_num_band, J2K_MAXBANDS, J2K_MAXBANDS);
+ "number of subbands (%d) is greater to OPJ_J2K_MAXBANDS (%d). So we limit the number of elements stored to "
+ "OPJ_J2K_MAXBANDS (%d) and skip the rest. \n", l_num_band, OPJ_J2K_MAXBANDS, OPJ_J2K_MAXBANDS);
/*return OPJ_FALSE;*/
}
}
if (l_cp->correct) {
/* if JPWL is on, we check whether there are too many subbands */
- if (/*(l_num_band < 0) ||*/ (l_num_band >= J2K_MAXBANDS)) {
+ if (/*(l_num_band < 0) ||*/ (l_num_band >= OPJ_J2K_MAXBANDS)) {
opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
"JPWL: bad number of subbands in Sqcx (%d)\n",
l_num_band);
for (l_band_no = 0; l_band_no < l_num_band; l_band_no++) {
opj_read_bytes(l_current_ptr, &l_tmp ,1); /* SPqcx_i */
++l_current_ptr;
- if (l_band_no < J2K_MAXBANDS){
+ if (l_band_no < OPJ_J2K_MAXBANDS){
l_tccp->stepsizes[l_band_no].expn = l_tmp>>3;
l_tccp->stepsizes[l_band_no].mant = 0;
}
for (l_band_no = 0; l_band_no < l_num_band; l_band_no++) {
opj_read_bytes(l_current_ptr, &l_tmp ,2); /* SPqcx_i */
l_current_ptr+=2;
- if (l_band_no < J2K_MAXBANDS){
+ if (l_band_no < OPJ_J2K_MAXBANDS){
l_tccp->stepsizes[l_band_no].expn = l_tmp >> 11;
l_tccp->stepsizes[l_band_no].mant = l_tmp & 0x7ff;
}
/* Add Antonin : if scalar_derived -> compute other stepsizes */
if (l_tccp->qntsty == J2K_CCP_QNTSTY_SIQNT) {
- for (l_band_no = 1; l_band_no < J2K_MAXBANDS; l_band_no++) {
+ for (l_band_no = 1; l_band_no < OPJ_J2K_MAXBANDS; l_band_no++) {
l_tccp->stepsizes[l_band_no].expn =
((l_tccp->stepsizes[0].expn) - ((l_band_no - 1) / 3) > 0) ?
(l_tccp->stepsizes[0].expn) - ((l_band_no - 1) / 3) : 0;
l_ref_tccp = &l_tcp->tccps[0];
l_copied_tccp = l_ref_tccp + 1;
- l_size = J2K_MAXBANDS * sizeof(opj_stepsize_t);
+ l_size = OPJ_J2K_MAXBANDS * sizeof(opj_stepsize_t);
for (i=1;i<p_j2k->m_private_image->numcomps;++i) {
l_copied_tccp->qntsty = l_ref_tccp->qntsty;
l_tccp_info->cblkh = l_tccp->cblkh;
l_tccp_info->cblksty = l_tccp->cblksty;
l_tccp_info->qmfbid = l_tccp->qmfbid;
- if (l_tccp->numresolutions < J2K_MAXRLVLS)
+ if (l_tccp->numresolutions < OPJ_J2K_MAXRLVLS)
{
memcpy(l_tccp_info->prch, l_tccp->prch, l_tccp->numresolutions);
memcpy(l_tccp_info->prcw, l_tccp->prcw, l_tccp->numresolutions);
l_tccp_info->numgbits = l_tccp->numgbits;
numbands = (l_tccp->qntsty == J2K_CCP_QNTSTY_SIQNT) ? 1 : l_tccp->numresolutions * 3 - 2;
- if (numbands < J2K_MAXBANDS) {
+ if (numbands < OPJ_J2K_MAXBANDS) {
for (bandno = 0; bandno < numbands; bandno++) {
l_tccp_info->stepsizes_mant[bandno] = l_tccp->stepsizes[bandno].mant;
l_tccp_info->stepsizes_expn[bandno] = l_tccp->stepsizes[bandno].expn;
#define OPJ_PATH_LEN 4096 /**< Maximum allowed size for filenames */
-#define J2K_MAXRLVLS 33 /**< Number of maximum resolution level authorized */
-#define J2K_MAXBANDS (3*J2K_MAXRLVLS-2) /**< Number of maximum sub-band linked to number of resolution level */
+#define OPJ_J2K_MAXRLVLS 33 /**< Number of maximum resolution level authorized */
+#define OPJ_J2K_MAXBANDS (3*OPJ_J2K_MAXRLVLS-2) /**< Number of maximum sub-band linked to number of resolution level */
-#define J2K_DEFAULT_NB_SEGS 10
-#define J2K_STREAM_CHUNK_SIZE 0x100000 /** 1 mega by default */
-#define J2K_DEFAULT_HEADER_SIZE 1000
-#define J2K_MCC_DEFAULT_NB_RECORDS 10
-#define J2K_MCT_DEFAULT_NB_RECORDS 10
+#define OPJ_J2K_DEFAULT_NB_SEGS 10
+#define OPJ_J2K_STREAM_CHUNK_SIZE 0x100000 /** 1 mega by default */
+#define OPJ_J2K_DEFAULT_HEADER_SIZE 1000
+#define OPJ_J2K_MCC_DEFAULT_NB_RECORDS 10
+#define OPJ_J2K_MCT_DEFAULT_NB_RECORDS 10
/* UniPG>> */
#define JPWL_MAX_NO_TILESPECS 16 /**< Maximum number of tile parts expected by JPWL: increase at your will */
/**
* Callback function prototype for events
- * @param msg Event message
- * @param client_data
+ * @param msg Event message
+ * @param client_data FIXME DOC
* */
typedef void (*opj_msg_callback) (const char *msg, void *client_data);
/* number of precinct size specifications */
int res_spec;
/** initial precinct width */
- int prcw_init[J2K_MAXRLVLS];
+ int prcw_init[OPJ_J2K_MAXRLVLS];
/** initial precinct height */
- int prch_init[J2K_MAXRLVLS];
+ int prch_init[OPJ_J2K_MAXRLVLS];
/**@name command line encoder parameters (not used inside the library) */
/*@{*/
if != 0, then original dimension divided by 2^(reduce);
if == 0 or not used, image is decoded to the full resolution
*/
- int cp_reduce;
+ OPJ_UINT32 cp_reduce;
/**
Set the maximum number of quality layers to decode.
If there are less quality layers than the specified number, all the quality layers are decoded.
if != 0, then only the first "layer" layers are decoded;
if == 0 or not used, all the quality layers are decoded
*/
- int cp_layer;
+ OPJ_UINT32 cp_layer;
/**@name command line decoder parameters (not used inside the library) */
/*@{*/
/** quantisation style */
OPJ_UINT32 qntsty;
/** stepsizes used for quantization */
- OPJ_UINT32 stepsizes_mant[J2K_MAXBANDS];
+ OPJ_UINT32 stepsizes_mant[OPJ_J2K_MAXBANDS];
/** stepsizes used for quantization */
- OPJ_UINT32 stepsizes_expn[J2K_MAXBANDS];
+ OPJ_UINT32 stepsizes_expn[OPJ_J2K_MAXBANDS];
/** number of guard bits */
OPJ_UINT32 numgbits;
/** Region Of Interest shift */
OPJ_INT32 roishift;
/** precinct width */
- OPJ_UINT32 prcw[J2K_MAXRLVLS];
+ OPJ_UINT32 prcw[OPJ_J2K_MAXRLVLS];
/** precinct height */
- OPJ_UINT32 prch[J2K_MAXRLVLS];
+ OPJ_UINT32 prch[OPJ_J2K_MAXRLVLS];
}
opj_tccp_info_t;
*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream (FILE * p_file, OPJ_SIZE_T p_buffer_size, opj_bool p_is_read_stream);
-/* -----------> */
-
/*
==========================================================
event manager functions definitions