Remove some simple warnings about comments
This commit is contained in:
parent
abf9809c22
commit
c469e1339f
|
@ -427,7 +427,7 @@ char get_next_file(int imageno,dircnt_t *dirptr,img_fol_t *img_fol, opj_cparamet
|
||||||
sprintf(infilename,"%s/%s",img_fol->imgdirpath,image_filename);
|
sprintf(infilename,"%s/%s",img_fol->imgdirpath,image_filename);
|
||||||
strncpy(parameters->infile, infilename, sizeof(infilename));
|
strncpy(parameters->infile, infilename, sizeof(infilename));
|
||||||
|
|
||||||
//Set output file
|
/*Set output file*/
|
||||||
strcpy(temp_ofname,get_file_name(image_filename));
|
strcpy(temp_ofname,get_file_name(image_filename));
|
||||||
while((temp_p = strtok(NULL,".")) != NULL){
|
while((temp_p = strtok(NULL,".")) != NULL){
|
||||||
strcat(temp_ofname,temp1);
|
strcat(temp_ofname,temp1);
|
||||||
|
@ -1550,7 +1550,7 @@ int main(int argc, char **argv) {
|
||||||
num_images=get_num_images(img_fol.imgdirpath);
|
num_images=get_num_images(img_fol.imgdirpath);
|
||||||
dirptr=(dircnt_t*)malloc(sizeof(dircnt_t));
|
dirptr=(dircnt_t*)malloc(sizeof(dircnt_t));
|
||||||
if(dirptr){
|
if(dirptr){
|
||||||
dirptr->filename_buf = (char*)malloc(num_images*OPJ_PATH_LEN*sizeof(char)); // Stores at max 10 image file names
|
dirptr->filename_buf = (char*)malloc(num_images*OPJ_PATH_LEN*sizeof(char)); /* Stores at max 10 image file names*/
|
||||||
dirptr->filename = (char**) malloc(num_images*sizeof(char*));
|
dirptr->filename = (char**) malloc(num_images*sizeof(char*));
|
||||||
if(!dirptr->filename_buf){
|
if(!dirptr->filename_buf){
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1699,7 +1699,7 @@ int main(int argc, char **argv) {
|
||||||
cio = opj_cio_open((opj_common_ptr)cinfo, NULL, 0);
|
cio = opj_cio_open((opj_common_ptr)cinfo, NULL, 0);
|
||||||
|
|
||||||
/* encode the image */
|
/* encode the image */
|
||||||
if (*indexfilename) // If need to extract codestream information
|
if (*indexfilename) /* If need to extract codestream information*/
|
||||||
bSuccess = opj_encode_with_info(cinfo, cio, image, &cstr_info);
|
bSuccess = opj_encode_with_info(cinfo, cio, image, &cstr_info);
|
||||||
else
|
else
|
||||||
bSuccess = opj_encode(cinfo, cio, image, NULL);
|
bSuccess = opj_encode(cinfo, cio, image, NULL);
|
||||||
|
@ -1760,7 +1760,7 @@ int main(int argc, char **argv) {
|
||||||
cio = opj_cio_open((opj_common_ptr)cinfo, NULL, 0);
|
cio = opj_cio_open((opj_common_ptr)cinfo, NULL, 0);
|
||||||
|
|
||||||
/* encode the image */
|
/* encode the image */
|
||||||
if (*indexfilename || parameters.jpip_on) // If need to extract codestream information
|
if (*indexfilename || parameters.jpip_on) /* If need to extract codestream information*/
|
||||||
bSuccess = opj_encode_with_info(cinfo, cio, image, &cstr_info);
|
bSuccess = opj_encode_with_info(cinfo, cio, image, &cstr_info);
|
||||||
else
|
else
|
||||||
bSuccess = opj_encode(cinfo, cio, image, NULL);
|
bSuccess = opj_encode(cinfo, cio, image, NULL);
|
||||||
|
|
|
@ -260,7 +260,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
|
||||||
int x1 = x0 + cstr_info->tile_x;
|
int x1 = x0 + cstr_info->tile_x;
|
||||||
int y1 = y0 + cstr_info->tile_y;
|
int y1 = y0 + cstr_info->tile_y;
|
||||||
|
|
||||||
// Count the maximum number of precincts
|
/* Count the maximum number of precincts */
|
||||||
int max_numprec = 0;
|
int max_numprec = 0;
|
||||||
for (resno = 0; resno < max_numdecompos + 1; resno++) {
|
for (resno = 0; resno < max_numdecompos + 1; resno++) {
|
||||||
int numprec = cstr_info->tile[tileno].pw[resno] * cstr_info->tile[tileno].ph[resno];
|
int numprec = cstr_info->tile[tileno].pw[resno] * cstr_info->tile[tileno].ph[resno];
|
||||||
|
@ -311,7 +311,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
|
||||||
} /* PCRL */
|
} /* PCRL */
|
||||||
|
|
||||||
else { /* CPRL */
|
else { /* CPRL */
|
||||||
// Count the maximum number of precincts
|
/* Count the maximum number of precincts */
|
||||||
int max_numprec = 0;
|
int max_numprec = 0;
|
||||||
for (resno = 0; resno < max_numdecompos + 1; resno++) {
|
for (resno = 0; resno < max_numdecompos + 1; resno++) {
|
||||||
int numprec = cstr_info->tile[tileno].pw[resno] * cstr_info->tile[tileno].ph[resno];
|
int numprec = cstr_info->tile[tileno].pw[resno] * cstr_info->tile[tileno].ph[resno];
|
||||||
|
|
|
@ -180,7 +180,7 @@ char get_next_file(int imageno,dircnt_t *dirptr,img_fol_t *img_fol, opj_dparamet
|
||||||
sprintf(infilename,"%s/%s",img_fol->imgdirpath,image_filename);
|
sprintf(infilename,"%s/%s",img_fol->imgdirpath,image_filename);
|
||||||
strncpy(parameters->infile, infilename, sizeof(infilename));
|
strncpy(parameters->infile, infilename, sizeof(infilename));
|
||||||
|
|
||||||
//Set output file
|
/*Set output file*/
|
||||||
strcpy(temp_ofname,strtok(image_filename,"."));
|
strcpy(temp_ofname,strtok(image_filename,"."));
|
||||||
while((temp_p = strtok(NULL,".")) != NULL){
|
while((temp_p = strtok(NULL,".")) != NULL){
|
||||||
strcat(temp_ofname,temp1);
|
strcat(temp_ofname,temp1);
|
||||||
|
@ -356,7 +356,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
dirptr=(dircnt_t*)malloc(sizeof(dircnt_t));
|
dirptr=(dircnt_t*)malloc(sizeof(dircnt_t));
|
||||||
if(dirptr){
|
if(dirptr){
|
||||||
dirptr->filename_buf = (char*)malloc(num_images*OPJ_PATH_LEN*sizeof(char)); // Stores at max 10 image file names
|
dirptr->filename_buf = (char*)malloc(num_images*OPJ_PATH_LEN*sizeof(char)); /* Stores at max 10 image file names*/
|
||||||
dirptr->filename = (char**) malloc(num_images*sizeof(char*));
|
dirptr->filename = (char**) malloc(num_images*sizeof(char*));
|
||||||
|
|
||||||
if(!dirptr->filename_buf){
|
if(!dirptr->filename_buf){
|
||||||
|
@ -377,7 +377,7 @@ int main(int argc, char *argv[])
|
||||||
num_images=1;
|
num_images=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/* */
|
||||||
if (parameters.outfile[0] != 0)
|
if (parameters.outfile[0] != 0)
|
||||||
{
|
{
|
||||||
fout = fopen(parameters.outfile,"w");
|
fout = fopen(parameters.outfile,"w");
|
||||||
|
@ -445,7 +445,7 @@ int main(int argc, char *argv[])
|
||||||
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
||||||
|
|
||||||
/* decode the stream and fill the image structure */
|
/* decode the stream and fill the image structure */
|
||||||
if (*indexfilename) // If need to extract codestream information
|
if (*indexfilename) /* If need to extract codestream information*/
|
||||||
image = opj_decode_with_info(dinfo, cio, &cstr_info);
|
image = opj_decode_with_info(dinfo, cio, &cstr_info);
|
||||||
else
|
else
|
||||||
image = opj_decode(dinfo, cio);
|
image = opj_decode(dinfo, cio);
|
||||||
|
@ -494,7 +494,7 @@ int main(int argc, char *argv[])
|
||||||
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
||||||
|
|
||||||
/* decode the stream and fill the image structure */
|
/* decode the stream and fill the image structure */
|
||||||
if (*indexfilename) // If need to extract codestream information
|
if (*indexfilename) /* If need to extract codestream information*/
|
||||||
image = opj_decode_with_info(dinfo, cio, &cstr_info);
|
image = opj_decode_with_info(dinfo, cio, &cstr_info);
|
||||||
else
|
else
|
||||||
image = opj_decode(dinfo, cio);
|
image = opj_decode(dinfo, cio);
|
||||||
|
@ -547,7 +547,7 @@ int main(int argc, char *argv[])
|
||||||
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
||||||
|
|
||||||
/* decode the stream and fill the image structure */
|
/* decode the stream and fill the image structure */
|
||||||
if (*indexfilename) // If need to extract codestream information
|
if (*indexfilename) /* If need to extract codestream information*/
|
||||||
image = opj_decode_with_info(dinfo, cio, &cstr_info);
|
image = opj_decode_with_info(dinfo, cio, &cstr_info);
|
||||||
else
|
else
|
||||||
image = opj_decode(dinfo, cio);
|
image = opj_decode(dinfo, cio);
|
||||||
|
@ -611,7 +611,7 @@ static void j2k_dump_image(FILE *fd, opj_image_t * img) {
|
||||||
fprintf(fd, " comp %d {\n", compno);
|
fprintf(fd, " comp %d {\n", compno);
|
||||||
fprintf(fd, " dx=%d, dy=%d\n", comp->dx, comp->dy);
|
fprintf(fd, " dx=%d, dy=%d\n", comp->dx, comp->dy);
|
||||||
fprintf(fd, " prec=%d\n", comp->prec);
|
fprintf(fd, " prec=%d\n", comp->prec);
|
||||||
//fprintf(fd, " bpp=%d\n", comp->bpp);
|
/*fprintf(fd, " bpp=%d\n", comp->bpp);*/
|
||||||
fprintf(fd, " sgnd=%d\n", comp->sgnd);
|
fprintf(fd, " sgnd=%d\n", comp->sgnd);
|
||||||
fprintf(fd, " }\n");
|
fprintf(fd, " }\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,7 +221,7 @@ char get_next_file(int imageno,dircnt_t *dirptr,img_fol_t *img_fol, opj_dparamet
|
||||||
sprintf(infilename,"%s/%s",img_fol->imgdirpath,image_filename);
|
sprintf(infilename,"%s/%s",img_fol->imgdirpath,image_filename);
|
||||||
strncpy(parameters->infile, infilename, sizeof(infilename));
|
strncpy(parameters->infile, infilename, sizeof(infilename));
|
||||||
|
|
||||||
//Set output file
|
/*Set output file*/
|
||||||
strcpy(temp_ofname,strtok(image_filename,"."));
|
strcpy(temp_ofname,strtok(image_filename,"."));
|
||||||
while((temp_p = strtok(NULL,".")) != NULL){
|
while((temp_p = strtok(NULL,".")) != NULL){
|
||||||
strcat(temp_ofname,temp1);
|
strcat(temp_ofname,temp1);
|
||||||
|
@ -551,7 +551,7 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
dirptr=(dircnt_t*)malloc(sizeof(dircnt_t));
|
dirptr=(dircnt_t*)malloc(sizeof(dircnt_t));
|
||||||
if(dirptr){
|
if(dirptr){
|
||||||
dirptr->filename_buf = (char*)malloc(num_images*OPJ_PATH_LEN*sizeof(char)); // Stores at max 10 image file names
|
dirptr->filename_buf = (char*)malloc(num_images*OPJ_PATH_LEN*sizeof(char)); /* Stores at max 10 image file names*/
|
||||||
dirptr->filename = (char**) malloc(num_images*sizeof(char*));
|
dirptr->filename = (char**) malloc(num_images*sizeof(char*));
|
||||||
|
|
||||||
if(!dirptr->filename_buf){
|
if(!dirptr->filename_buf){
|
||||||
|
@ -625,7 +625,7 @@ int main(int argc, char **argv) {
|
||||||
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
||||||
|
|
||||||
/* decode the stream and fill the image structure */
|
/* decode the stream and fill the image structure */
|
||||||
if (*indexfilename) // If need to extract codestream information
|
if (*indexfilename) /* If need to extract codestream information*/
|
||||||
image = opj_decode_with_info(dinfo, cio, &cstr_info);
|
image = opj_decode_with_info(dinfo, cio, &cstr_info);
|
||||||
else
|
else
|
||||||
image = opj_decode(dinfo, cio);
|
image = opj_decode(dinfo, cio);
|
||||||
|
@ -668,7 +668,7 @@ int main(int argc, char **argv) {
|
||||||
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
||||||
|
|
||||||
/* decode the stream and fill the image structure */
|
/* decode the stream and fill the image structure */
|
||||||
if (*indexfilename) // If need to extract codestream information
|
if (*indexfilename) /* If need to extract codestream information*/
|
||||||
image = opj_decode_with_info(dinfo, cio, &cstr_info);
|
image = opj_decode_with_info(dinfo, cio, &cstr_info);
|
||||||
else
|
else
|
||||||
image = opj_decode(dinfo, cio);
|
image = opj_decode(dinfo, cio);
|
||||||
|
@ -711,7 +711,7 @@ int main(int argc, char **argv) {
|
||||||
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
cio = opj_cio_open((opj_common_ptr)dinfo, src, file_length);
|
||||||
|
|
||||||
/* decode the stream and fill the image structure */
|
/* decode the stream and fill the image structure */
|
||||||
if (*indexfilename) // If need to extract codestream information
|
if (*indexfilename) /* If need to extract codestream information*/
|
||||||
image = opj_decode_with_info(dinfo, cio, &cstr_info);
|
image = opj_decode_with_info(dinfo, cio, &cstr_info);
|
||||||
else
|
else
|
||||||
image = opj_decode(dinfo, cio);
|
image = opj_decode(dinfo, cio);
|
||||||
|
@ -847,7 +847,7 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//end main
|
/*end main*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -197,7 +197,7 @@ again:
|
||||||
return o->val;
|
return o->val;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}//(end for)String not found in the list
|
}/*(end for)String not found in the list*/
|
||||||
fprintf(stderr,"Invalid option %s\n",arg);
|
fprintf(stderr,"Invalid option %s\n",arg);
|
||||||
++opj_optind;
|
++opj_optind;
|
||||||
return (BADCH);
|
return (BADCH);
|
||||||
|
@ -244,11 +244,11 @@ found:
|
||||||
fprintf(stderr,"Invalid option %s\n",arg);
|
fprintf(stderr,"Invalid option %s\n",arg);
|
||||||
++opj_optind;
|
++opj_optind;
|
||||||
return (BADCH);
|
return (BADCH);
|
||||||
}//end of not found
|
}/*end of not found*/
|
||||||
|
|
||||||
}// end of single character
|
}/* end of single character*/
|
||||||
}//end '-'
|
}/*end '-'*/
|
||||||
fprintf(stderr,"Invalid option\n");
|
fprintf(stderr,"Invalid option\n");
|
||||||
++opj_optind;
|
++opj_optind;
|
||||||
return (BADCH);;
|
return (BADCH);;
|
||||||
}//end function
|
}/*end function*/
|
||||||
|
|
|
@ -64,12 +64,12 @@ typedef struct v4dwt_local {
|
||||||
int cas ;
|
int cas ;
|
||||||
} v4dwt_t ;
|
} v4dwt_t ;
|
||||||
|
|
||||||
static const float dwt_alpha = 1.586134342f; // 12994
|
static const float dwt_alpha = 1.586134342f; /* 12994 */
|
||||||
static const float dwt_beta = 0.052980118f; // 434
|
static const float dwt_beta = 0.052980118f; /* 434 */
|
||||||
static const float dwt_gamma = -0.882911075f; // -7233
|
static const float dwt_gamma = -0.882911075f; /* -7233 */
|
||||||
static const float dwt_delta = -0.443506852f; // -3633
|
static const float dwt_delta = -0.443506852f; /* -3633 */
|
||||||
|
|
||||||
static const float K = 1.230174105f; // 10078
|
static const float K = 1.230174105f; /* 10078 */
|
||||||
/* FIXME: What is this constant? */
|
/* FIXME: What is this constant? */
|
||||||
static const float c13318 = 1.625732422f;
|
static const float c13318 = 1.625732422f;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
# define INDEXBOX_MANAGER_H_
|
# define INDEXBOX_MANAGER_H_
|
||||||
|
|
||||||
#include "openjpeg.h"
|
#include "openjpeg.h"
|
||||||
#include "j2k.h" // needed to use jp2.h
|
#include "j2k.h" /* needed to use jp2.h */
|
||||||
#include "jp2.h"
|
#include "jp2.h"
|
||||||
|
|
||||||
#define JPIP_CIDX 0x63696478 /* Codestream index */
|
#define JPIP_CIDX 0x63696478 /* Codestream index */
|
||||||
|
|
|
@ -678,7 +678,7 @@ static void j2k_read_cox(opj_j2k_t *j2k, int compno) {
|
||||||
|
|
||||||
tccp->numresolutions = cio_read(cio, 1) + 1; /* SPcox (D) */
|
tccp->numresolutions = cio_read(cio, 1) + 1; /* SPcox (D) */
|
||||||
|
|
||||||
// If user wants to remove more resolutions than the codestream contains, return error
|
/* If user wants to remove more resolutions than the codestream contains, return error*/
|
||||||
if (cp->reduce >= tccp->numresolutions) {
|
if (cp->reduce >= tccp->numresolutions) {
|
||||||
opj_event_msg(j2k->cinfo, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions to remove is higher than the number "
|
opj_event_msg(j2k->cinfo, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions to remove is higher than the number "
|
||||||
"of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno);
|
"of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno);
|
||||||
|
@ -1360,7 +1360,7 @@ static void j2k_read_sot(opj_j2k_t *j2k) {
|
||||||
if (numparts)
|
if (numparts)
|
||||||
j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_realloc(j2k->cstr_info->tile[tileno].tp, numparts * sizeof(opj_tp_info_t));
|
j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_realloc(j2k->cstr_info->tile[tileno].tp, numparts * sizeof(opj_tp_info_t));
|
||||||
else
|
else
|
||||||
j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_realloc(j2k->cstr_info->tile[tileno].tp, 10 * sizeof(opj_tp_info_t)); // Fixme (10)
|
j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_realloc(j2k->cstr_info->tile[tileno].tp, 10 * sizeof(opj_tp_info_t)); /* Fixme (10)*/
|
||||||
j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos = cio_tell(cio) - 12;
|
j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos = cio_tell(cio) - 12;
|
||||||
j2k->cstr_info->tile[tileno].tp[partno].tp_end_pos =
|
j2k->cstr_info->tile[tileno].tp[partno].tp_end_pos =
|
||||||
j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos + totlen - 1;
|
j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos + totlen - 1;
|
||||||
|
@ -1861,13 +1861,13 @@ opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *c
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
e = j2k_dec_mstab_lookup(id);
|
e = j2k_dec_mstab_lookup(id);
|
||||||
// Check if the marker is known
|
/* Check if the marker is known*/
|
||||||
if (!(j2k->state & e->states)) {
|
if (!(j2k->state & e->states)) {
|
||||||
opj_image_destroy(image);
|
opj_image_destroy(image);
|
||||||
opj_event_msg(cinfo, EVT_ERROR, "%.8x: unexpected marker %x\n", cio_tell(cio) - 2, id);
|
opj_event_msg(cinfo, EVT_ERROR, "%.8x: unexpected marker %x\n", cio_tell(cio) - 2, id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// Check if the decoding is limited to the main header
|
/* Check if the decoding is limited to the main header*/
|
||||||
if (e->id == J2K_MS_SOT && j2k->cp->limit_decoding == LIMIT_TO_MAIN_HEADER) {
|
if (e->id == J2K_MS_SOT && j2k->cp->limit_decoding == LIMIT_TO_MAIN_HEADER) {
|
||||||
opj_event_msg(cinfo, EVT_INFO, "Main Header decoded.\n");
|
opj_event_msg(cinfo, EVT_INFO, "Main Header decoded.\n");
|
||||||
return image;
|
return image;
|
||||||
|
@ -2214,10 +2214,10 @@ void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_
|
||||||
|
|
||||||
if(parameters->cp_cinema)
|
if(parameters->cp_cinema)
|
||||||
{
|
{
|
||||||
//Precinct size for lowest frequency subband=128
|
/*Precinct size for lowest frequency subband=128*/
|
||||||
tccp->prcw[0] = 7;
|
tccp->prcw[0] = 7;
|
||||||
tccp->prch[0] = 7;
|
tccp->prch[0] = 7;
|
||||||
//Precinct size at all other resolutions = 256
|
/*Precinct size at all other resolutions = 256*/
|
||||||
for (j = 1; j < tccp->numresolutions; j++) {
|
for (j = 1; j < tccp->numresolutions; j++) {
|
||||||
tccp->prcw[j] = 8;
|
tccp->prcw[j] = 8;
|
||||||
tccp->prch[j] = 8;
|
tccp->prch[j] = 8;
|
||||||
|
@ -2259,7 +2259,7 @@ void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_
|
||||||
}
|
}
|
||||||
p++;
|
p++;
|
||||||
/*printf("\nsize precinct for level %d : %d,%d\n", j,tccp->prcw[j], tccp->prch[j]); */
|
/*printf("\nsize precinct for level %d : %d,%d\n", j,tccp->prcw[j], tccp->prch[j]); */
|
||||||
} //end for
|
} /*end for*/
|
||||||
} else {
|
} else {
|
||||||
for (j = 0; j < tccp->numresolutions; j++) {
|
for (j = 0; j < tccp->numresolutions; j++) {
|
||||||
tccp->prcw[j] = 15;
|
tccp->prcw[j] = 15;
|
||||||
|
|
|
@ -84,7 +84,7 @@ int write_phix( int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int
|
||||||
|
|
||||||
int write_phixfaix( int coff, int compno, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
|
int write_phixfaix( int coff, int compno, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
|
||||||
{
|
{
|
||||||
int len, lenp, tileno, version, i, nmax, size_of_coding; // 4 or 8
|
int len, lenp, tileno, version, i, nmax, size_of_coding; /* 4 or 8 */
|
||||||
opj_tile_info_t *tile_Idx;
|
opj_tile_info_t *tile_Idx;
|
||||||
opj_packet_info_t packet;
|
opj_packet_info_t packet;
|
||||||
int resno, precno, layno, num_packet;
|
int resno, precno, layno, num_packet;
|
||||||
|
|
|
@ -56,7 +56,7 @@ int write_ppix( int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int
|
||||||
int len, lenp, compno, i;
|
int len, lenp, compno, i;
|
||||||
opj_jp2_box_t *box;
|
opj_jp2_box_t *box;
|
||||||
|
|
||||||
// printf("cstr_info.packno %d\n", cstr_info.packno); //NMAX?
|
/* printf("cstr_info.packno %d\n", cstr_info.packno); //NMAX? */
|
||||||
|
|
||||||
lenp = -1;
|
lenp = -1;
|
||||||
box = (opj_jp2_box_t *)opj_calloc( cstr_info.numcomps, sizeof(opj_jp2_box_t));
|
box = (opj_jp2_box_t *)opj_calloc( cstr_info.numcomps, sizeof(opj_jp2_box_t));
|
||||||
|
@ -88,7 +88,7 @@ int write_ppix( int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int
|
||||||
|
|
||||||
int write_ppixfaix( int coff, int compno, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
|
int write_ppixfaix( int coff, int compno, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
|
||||||
{
|
{
|
||||||
int len, lenp, tileno, version, i, nmax, size_of_coding; // 4 or 8
|
int len, lenp, tileno, version, i, nmax, size_of_coding; /* 4 or 8*/
|
||||||
opj_tile_info_t *tile_Idx;
|
opj_tile_info_t *tile_Idx;
|
||||||
opj_packet_info_t packet;
|
opj_packet_info_t packet;
|
||||||
int resno, precno, layno, num_packet;
|
int resno, precno, layno, num_packet;
|
||||||
|
|
|
@ -255,8 +255,8 @@ static int t2_encode_packet(opj_tcd_tile_t * tile, opj_tcp_t * tcp, opj_pi_itera
|
||||||
/* </EPH> */
|
/* </EPH> */
|
||||||
|
|
||||||
/* << INDEX */
|
/* << INDEX */
|
||||||
// End of packet header position. Currently only represents the distance to start of packet
|
/* End of packet header position. Currently only represents the distance to start of packet
|
||||||
// Will be updated later by incrementing with packet start value
|
// Will be updated later by incrementing with packet start value */
|
||||||
if(cstr_info && cstr_info->index_write) {
|
if(cstr_info && cstr_info->index_write) {
|
||||||
opj_packet_info_t *info_PK = &cstr_info->tile[tileno].packet[cstr_info->packno];
|
opj_packet_info_t *info_PK = &cstr_info->tile[tileno].packet[cstr_info->packno];
|
||||||
info_PK->end_ph_pos = (int)(c - dest);
|
info_PK->end_ph_pos = (int)(c - dest);
|
||||||
|
@ -403,8 +403,8 @@ static int t2_decode_packet(opj_t2_t* t2, unsigned char *src, int len, opj_tcd_t
|
||||||
}
|
}
|
||||||
|
|
||||||
/* << INDEX */
|
/* << INDEX */
|
||||||
// End of packet header position. Currently only represents the distance to start of packet
|
/* End of packet header position. Currently only represents the distance to start of packet
|
||||||
// Will be updated later by incrementing with packet start value
|
// Will be updated later by incrementing with packet start value*/
|
||||||
if(pack_info) {
|
if(pack_info) {
|
||||||
pack_info->end_ph_pos = (int)(c - src);
|
pack_info->end_ph_pos = (int)(c - src);
|
||||||
}
|
}
|
||||||
|
@ -503,8 +503,8 @@ static int t2_decode_packet(opj_t2_t* t2, unsigned char *src, int len, opj_tcd_t
|
||||||
}
|
}
|
||||||
|
|
||||||
/* << INDEX */
|
/* << INDEX */
|
||||||
// End of packet header position. Currently only represents the distance to start of packet
|
/* End of packet header position. Currently only represents the distance to start of packet
|
||||||
// Will be updated later by incrementing with packet start value
|
// Will be updated later by incrementing with packet start value*/
|
||||||
if(pack_info) {
|
if(pack_info) {
|
||||||
pack_info->end_ph_pos = (int)(hd - src);
|
pack_info->end_ph_pos = (int)(hd - src);
|
||||||
}
|
}
|
||||||
|
@ -662,8 +662,8 @@ int t2_encode_packets(opj_t2_t* t2,int tileno, opj_tcd_tile_t *tile, int maxlaye
|
||||||
info_PK->start_pos = ((cp->tp_on | tcp->POC)&& info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[cstr_info->packno - 1].end_pos + 1;
|
info_PK->start_pos = ((cp->tp_on | tcp->POC)&& info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[cstr_info->packno - 1].end_pos + 1;
|
||||||
}
|
}
|
||||||
info_PK->end_pos = info_PK->start_pos + e - 1;
|
info_PK->end_pos = info_PK->start_pos + e - 1;
|
||||||
info_PK->end_ph_pos += info_PK->start_pos - 1; // End of packet header which now only represents the distance
|
info_PK->end_ph_pos += info_PK->start_pos - 1; /* End of packet header which now only represents the distance
|
||||||
// to start of packet is incremented by value of start of packet
|
// to start of packet is incremented by value of start of packet*/
|
||||||
}
|
}
|
||||||
|
|
||||||
cstr_info->packno++;
|
cstr_info->packno++;
|
||||||
|
@ -728,8 +728,8 @@ int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj
|
||||||
opj_packet_info_t *info_PK = &info_TL->packet[cstr_info->packno];
|
opj_packet_info_t *info_PK = &info_TL->packet[cstr_info->packno];
|
||||||
if (!cstr_info->packno) {
|
if (!cstr_info->packno) {
|
||||||
info_PK->start_pos = info_TL->end_header + 1;
|
info_PK->start_pos = info_TL->end_header + 1;
|
||||||
} else if (info_TL->packet[cstr_info->packno-1].end_pos >= (int)cstr_info->tile[tileno].tp[curtp].tp_end_pos){ // New tile part
|
} else if (info_TL->packet[cstr_info->packno-1].end_pos >= (int)cstr_info->tile[tileno].tp[curtp].tp_end_pos){ /* New tile part*/
|
||||||
info_TL->tp[curtp].tp_numpacks = cstr_info->packno - tp_start_packno; // Number of packets in previous tile-part
|
info_TL->tp[curtp].tp_numpacks = cstr_info->packno - tp_start_packno; /* Number of packets in previous tile-part*/
|
||||||
info_TL->tp[curtp].tp_start_pack = tp_start_packno;
|
info_TL->tp[curtp].tp_start_pack = tp_start_packno;
|
||||||
tp_start_packno = cstr_info->packno;
|
tp_start_packno = cstr_info->packno;
|
||||||
curtp++;
|
curtp++;
|
||||||
|
@ -738,8 +738,8 @@ int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj
|
||||||
info_PK->start_pos = (cp->tp_on && info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[cstr_info->packno - 1].end_pos + 1;
|
info_PK->start_pos = (cp->tp_on && info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[cstr_info->packno - 1].end_pos + 1;
|
||||||
}
|
}
|
||||||
info_PK->end_pos = info_PK->start_pos + e - 1;
|
info_PK->end_pos = info_PK->start_pos + e - 1;
|
||||||
info_PK->end_ph_pos += info_PK->start_pos - 1; // End of packet header which now only represents the distance
|
info_PK->end_ph_pos += info_PK->start_pos - 1; /* End of packet header which now only represents the distance
|
||||||
// to start of packet is incremented by value of start of packet
|
// to start of packet is incremented by value of start of packet*/
|
||||||
cstr_info->packno++;
|
cstr_info->packno++;
|
||||||
}
|
}
|
||||||
/* << INDEX */
|
/* << INDEX */
|
||||||
|
@ -753,7 +753,7 @@ int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj
|
||||||
}
|
}
|
||||||
/* INDEX >> */
|
/* INDEX >> */
|
||||||
if(cstr_info) {
|
if(cstr_info) {
|
||||||
cstr_info->tile[tileno].tp[curtp].tp_numpacks = cstr_info->packno - tp_start_packno; // Number of packets in last tile-part
|
cstr_info->tile[tileno].tp[curtp].tp_numpacks = cstr_info->packno - tp_start_packno; /* Number of packets in last tile-part*/
|
||||||
cstr_info->tile[tileno].tp[curtp].tp_start_pack = tp_start_packno;
|
cstr_info->tile[tileno].tp[curtp].tp_start_pack = tp_start_packno;
|
||||||
}
|
}
|
||||||
/* << INDEX */
|
/* << INDEX */
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "opj_includes.h"
|
#include "opj_includes.h"
|
||||||
|
|
||||||
void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t * img) {
|
void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t * img) {
|
||||||
int tileno, compno, resno, bandno, precno;//, cblkno;
|
int tileno, compno, resno, bandno, precno;/*, cblkno;*/
|
||||||
|
|
||||||
fprintf(fd, "image {\n");
|
fprintf(fd, "image {\n");
|
||||||
fprintf(fd, " tw=%d, th=%d x0=%d x1=%d y0=%d y1=%d\n",
|
fprintf(fd, " tw=%d, th=%d x0=%d x1=%d y0=%d y1=%d\n",
|
||||||
|
|
|
@ -109,7 +109,7 @@ int write_tilemhix( int coff, opj_codestream_info_t cstr_info, int tileno, opj_c
|
||||||
cio_write( cio, marker[i].len, 2);
|
cio_write( cio, marker[i].len, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// free( marker);
|
/* free( marker);*/
|
||||||
|
|
||||||
len = cio_tell( cio) - lenp;
|
len = cio_tell( cio) - lenp;
|
||||||
cio_seek( cio, lenp);
|
cio_seek( cio, lenp);
|
||||||
|
|
|
@ -84,7 +84,7 @@ int write_tpixfaix( int coff, int compno, opj_codestream_info_t cstr_info, int j
|
||||||
int i, j;
|
int i, j;
|
||||||
int Aux;
|
int Aux;
|
||||||
int num_max_tile_parts;
|
int num_max_tile_parts;
|
||||||
int size_of_coding; // 4 or 8
|
int size_of_coding; /* 4 or 8 */
|
||||||
opj_tp_info_t tp;
|
opj_tp_info_t tp;
|
||||||
int version;
|
int version;
|
||||||
|
|
||||||
|
@ -118,10 +118,10 @@ int write_tpixfaix( int coff, int compno, opj_codestream_info_t cstr_info, int j
|
||||||
Aux = j + 1;
|
Aux = j + 1;
|
||||||
|
|
||||||
cio_write( cio, Aux,4);
|
cio_write( cio, Aux,4);
|
||||||
//cio_write(img.tile[i].tile_parts[j].num_reso_AUX,4); /* Aux_i,j : Auxiliary value */
|
/*cio_write(img.tile[i].tile_parts[j].num_reso_AUX,4);*/ /* Aux_i,j : Auxiliary value */
|
||||||
// fprintf(stderr,"AUX value %d\n",Aux);
|
/* fprintf(stderr,"AUX value %d\n",Aux);*/
|
||||||
}
|
}
|
||||||
//cio_write(0,4);
|
/*cio_write(0,4);*/
|
||||||
}
|
}
|
||||||
/* PADDING */
|
/* PADDING */
|
||||||
while (j < num_max_tile_parts){
|
while (j < num_max_tile_parts){
|
||||||
|
|
Loading…
Reference in New Issue