[trunk] Set of warnings fix for gcc -pedantic
This commit is contained in:
parent
514fc72050
commit
82afd3a891
|
@ -153,7 +153,7 @@ opj_volume_t* pgxtovolume(char *relpath, opj_cparameters_t *parameters) {
|
||||||
int i, s, numcomps, maxvalue, sliceno, slicepos, maxslice = 0;
|
int i, s, numcomps, maxvalue, sliceno, slicepos, maxslice = 0;
|
||||||
|
|
||||||
OPJ_COLOR_SPACE color_space;
|
OPJ_COLOR_SPACE color_space;
|
||||||
opj_volume_cmptparm_t cmptparm; // maximum of 1 component
|
opj_volume_cmptparm_t cmptparm; /* maximum of 1 component */
|
||||||
opj_volume_t * volume = NULL;
|
opj_volume_t * volume = NULL;
|
||||||
|
|
||||||
char endian1,endian2,sign;
|
char endian1,endian2,sign;
|
||||||
|
@ -182,13 +182,13 @@ opj_volume_t* pgxtovolume(char *relpath, opj_cparameters_t *parameters) {
|
||||||
|
|
||||||
/* Separación del caso de un único slice frente al de muchos */
|
/* Separación del caso de un único slice frente al de muchos */
|
||||||
if ((tmp = strrchr(relpath,'-')) == NULL){
|
if ((tmp = strrchr(relpath,'-')) == NULL){
|
||||||
//fprintf(stdout,"[INFO] A volume of only one slice....\n");
|
/*fprintf(stdout,"[INFO] A volume of only one slice....\n");*/
|
||||||
sliceno = 1;
|
sliceno = 1;
|
||||||
maxslice = 1;
|
maxslice = 1;
|
||||||
strcpy(pgxfiles[0],relpath);
|
strcpy(pgxfiles[0],relpath);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//Fetch only the path
|
/*Fetch only the path */
|
||||||
strcpy(tmpdirpath,relpath);
|
strcpy(tmpdirpath,relpath);
|
||||||
if ((tmp = strrchr(tmpdirpath,'/')) != NULL){
|
if ((tmp = strrchr(tmpdirpath,'/')) != NULL){
|
||||||
tmp++; *tmp='\0';
|
tmp++; *tmp='\0';
|
||||||
|
@ -197,7 +197,7 @@ opj_volume_t* pgxtovolume(char *relpath, opj_cparameters_t *parameters) {
|
||||||
strcpy(dirpath,"./");
|
strcpy(dirpath,"./");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Fetch the pattern of the volume slices
|
/*Fetch the pattern of the volume slices*/
|
||||||
if ((tmp = strrchr (relpath,'/')) != NULL)
|
if ((tmp = strrchr (relpath,'/')) != NULL)
|
||||||
tmp++;
|
tmp++;
|
||||||
else
|
else
|
||||||
|
@ -228,7 +228,7 @@ opj_volume_t* pgxtovolume(char *relpath, opj_cparameters_t *parameters) {
|
||||||
strcpy(tmp,dirpath);
|
strcpy(tmp,dirpath);
|
||||||
tmp = strcat(tmp,direntp->d_name);
|
tmp = strcat(tmp,direntp->d_name);
|
||||||
|
|
||||||
//Obtenemos el index de la secuencia de slices
|
/*Obtenemos el index de la secuencia de slices*/
|
||||||
if ((tmp2 = strpbrk (direntp->d_name, "0123456789")) == NULL)
|
if ((tmp2 = strpbrk (direntp->d_name, "0123456789")) == NULL)
|
||||||
continue;
|
continue;
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -238,18 +238,18 @@ opj_volume_t* pgxtovolume(char *relpath, opj_cparameters_t *parameters) {
|
||||||
tmp2 = strpbrk (tmp2+1,"0123456789");
|
tmp2 = strpbrk (tmp2+1,"0123456789");
|
||||||
}tmpno[i]='\0';
|
}tmpno[i]='\0';
|
||||||
|
|
||||||
//Comprobamos que no estamos leyendo algo raro como pattern.jp3d
|
/*Comprobamos que no estamos leyendo algo raro como pattern.jp3d*/
|
||||||
if ((point = strpbrk (point,".")) == NULL){
|
if ((point = strpbrk (point,".")) == NULL){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//Slicepos --> index de slice; Sliceno --> no de slices hasta el momento
|
/*Slicepos --> index de slice; Sliceno --> no de slices hasta el momento*/
|
||||||
slicepos = atoi(tmpno);
|
slicepos = atoi(tmpno);
|
||||||
pgxslicepos[sliceno] = slicepos - 1;
|
pgxslicepos[sliceno] = slicepos - 1;
|
||||||
sliceno++;
|
sliceno++;
|
||||||
if (slicepos>maxslice)
|
if (slicepos>maxslice)
|
||||||
maxslice = slicepos;
|
maxslice = slicepos;
|
||||||
|
|
||||||
//Colocamos el slices en su posicion correspondiente
|
/*Colocamos el slices en su posicion correspondiente*/
|
||||||
strcpy(pgxfiles[slicepos-1],tmp);
|
strcpy(pgxfiles[slicepos-1],tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ opj_volume_t* pgxtovolume(char *relpath, opj_cparameters_t *parameters) {
|
||||||
/* set volume data :only one component, that is a volume*/
|
/* set volume data :only one component, that is a volume*/
|
||||||
comp = &volume->comps[0];
|
comp = &volume->comps[0];
|
||||||
|
|
||||||
}//if sliceno==1
|
}/*if sliceno==1*/
|
||||||
|
|
||||||
offset = w * h * s;
|
offset = w * h * s;
|
||||||
|
|
||||||
|
@ -365,11 +365,11 @@ opj_volume_t* pgxtovolume(char *relpath, opj_cparameters_t *parameters) {
|
||||||
|
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
} // for s --> sliceno
|
} /* for s --> sliceno*/
|
||||||
comp->bpp = int_floorlog2(maxvalue) + 1;
|
comp->bpp = int_floorlog2(maxvalue) + 1;
|
||||||
if (sliceno != 1)
|
if (sliceno != 1)
|
||||||
closedir( dirp );
|
closedir( dirp );
|
||||||
//dump_volume(stdout, volume);
|
/*dump_volume(stdout, volume);*/
|
||||||
return volume;
|
return volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ int volumetopgx(opj_volume_t * volume, char *outfile) {
|
||||||
|
|
||||||
offset = (sliceno / lrr * l) + (sliceno % lrr);
|
offset = (sliceno / lrr * l) + (sliceno % lrr);
|
||||||
offset = wrr * hrr * offset;
|
offset = wrr * hrr * offset;
|
||||||
//fprintf(stdout,"%d %d %d %d\n",offset,wrr*hrr,wrr,w);
|
/*fprintf(stdout,"%d %d %d %d\n",offset,wrr*hrr,wrr,w);*/
|
||||||
for (i = 0; i < wrr * hrr; i++) {
|
for (i = 0; i < wrr * hrr; i++) {
|
||||||
int v = volume->comps[0].data[(i / wrr * w) + (i % wrr) + offset];
|
int v = volume->comps[0].data[(i / wrr * w) + (i % wrr) + offset];
|
||||||
if (volume->comps[0].bigendian) {
|
if (volume->comps[0].bigendian) {
|
||||||
|
@ -449,8 +449,8 @@ int volumetopgx(opj_volume_t * volume, char *outfile) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(fdest);
|
fclose(fdest);
|
||||||
}//for sliceno
|
}/*for sliceno*/
|
||||||
}//for compno
|
}/*for compno*/
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -469,7 +469,7 @@ opj_volume_t* bintovolume(char *filename, char *fileimg, opj_cparameters_t *para
|
||||||
int i, compno, w, h, l, numcomps = 1;
|
int i, compno, w, h, l, numcomps = 1;
|
||||||
int prec, max = 0;
|
int prec, max = 0;
|
||||||
|
|
||||||
// char temp[32];
|
/* char temp[32];*/
|
||||||
char line[100];
|
char line[100];
|
||||||
int bigendian;
|
int bigendian;
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ opj_volume_t* bintovolume(char *filename, char *fileimg, opj_cparameters_t *para
|
||||||
fseek(fimg, 0, SEEK_SET);
|
fseek(fimg, 0, SEEK_SET);
|
||||||
while (!feof(fimg)) {
|
while (!feof(fimg)) {
|
||||||
fgets(line,100,fimg);
|
fgets(line,100,fimg);
|
||||||
//fprintf(stdout,"%s %d \n",line,feof(fimg));
|
/*fprintf(stdout,"%s %d \n",line,feof(fimg));*/
|
||||||
if (strncmp(line,"Bpp",3) == 0){
|
if (strncmp(line,"Bpp",3) == 0){
|
||||||
sscanf(line,"%*s%*[ \t]%d",&prec);
|
sscanf(line,"%*s%*[ \t]%d",&prec);
|
||||||
} else if (strncmp(line,"Color",5) == 0){
|
} else if (strncmp(line,"Color",5) == 0){
|
||||||
|
@ -501,9 +501,9 @@ opj_volume_t* bintovolume(char *filename, char *fileimg, opj_cparameters_t *para
|
||||||
sscanf(line, "%*s%*[ \t]%d%*[ \t]%d%*[ \t]%d",&w,&h,&l);
|
sscanf(line, "%*s%*[ \t]%d%*[ \t]%d%*[ \t]%d",&w,&h,&l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//fscanf(fimg, "Bpp%[ \t]%d%[ \t\n]",temp,&prec,temp);
|
/*fscanf(fimg, "Bpp%[ \t]%d%[ \t\n]",temp,&prec,temp);*/
|
||||||
//fscanf(fimg, "Color Map%[ \t]%d%[ \n\t]Dimensions%[ \t]%d%[ \t]%d%[ \t]%d%[ \n\t]",temp,&color_space,temp,temp,&w,temp,&h,temp,&l,temp);
|
/*fscanf(fimg, "Color Map%[ \t]%d%[ \n\t]Dimensions%[ \t]%d%[ \t]%d%[ \t]%d%[ \n\t]",temp,&color_space,temp,temp,&w,temp,&h,temp,&l,temp);*/
|
||||||
//fscanf(fimg, "Resolution(mm)%[ \t]%d%[ \t]%d%[ \t]%d%[ \n\t]",temp,&subsampling_dx,temp,&subsampling_dy,temp,&subsampling_dz,temp);
|
/*fscanf(fimg, "Resolution(mm)%[ \t]%d%[ \t]%d%[ \t]%d%[ \n\t]",temp,&subsampling_dx,temp,&subsampling_dy,temp,&subsampling_dz,temp);*/
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
fprintf(stdout, "[INFO] %d \t %d %d %d \t %3.2f %2.2f %2.2f \t %d \n",color_space,w,h,l,subsampling_dx,subsampling_dy,subsampling_dz,prec);
|
fprintf(stdout, "[INFO] %d \t %d %d %d \t %3.2f %2.2f %2.2f \t %d \n",color_space,w,h,l,subsampling_dx,subsampling_dy,subsampling_dz,prec);
|
||||||
|
@ -679,10 +679,10 @@ int volumetobin(opj_volume_t * volume, char *outfile) {
|
||||||
int offset, sliceno;
|
int offset, sliceno;
|
||||||
FILE *fdest = NULL;
|
FILE *fdest = NULL;
|
||||||
FILE *fimgdest = NULL;
|
FILE *fimgdest = NULL;
|
||||||
// char *imgtemp;
|
/* char *imgtemp;*/
|
||||||
char name[256];
|
char name[256];
|
||||||
|
|
||||||
for (compno = 0; compno < 1; compno++) { //Only one component
|
for (compno = 0; compno < 1; compno++) { /*Only one component*/
|
||||||
|
|
||||||
fdest = fopen(outfile, "wb");
|
fdest = fopen(outfile, "wb");
|
||||||
if (!fdest) {
|
if (!fdest) {
|
||||||
|
@ -717,7 +717,7 @@ int volumetobin(opj_volume_t * volume, char *outfile) {
|
||||||
nbytes = 4;
|
nbytes = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
//fprintf(stdout,"w %d wr %d wrr %d h %d hr %d hrr %d l %d lr %d lrr %d max %d nbytes %d\n Factor %d %d %d",w,wr,wrr,h,hr,hrr,l,lr,lrr,max,nbytes,volume->comps[compno].factor[0],volume->comps[compno].factor[1],volume->comps[compno].factor[2]);
|
/*fprintf(stdout,"w %d wr %d wrr %d h %d hr %d hrr %d l %d lr %d lrr %d max %d nbytes %d\n Factor %d %d %d",w,wr,wrr,h,hr,hrr,l,lr,lrr,max,nbytes,volume->comps[compno].factor[0],volume->comps[compno].factor[1],volume->comps[compno].factor[2]);*/
|
||||||
|
|
||||||
for(sliceno = 0; sliceno < lrr; sliceno++) {
|
for(sliceno = 0; sliceno < lrr; sliceno++) {
|
||||||
offset = (sliceno / lrr * l) + (sliceno % lrr);
|
offset = (sliceno / lrr * l) + (sliceno % lrr);
|
||||||
|
@ -787,7 +787,7 @@ opj_volume_t* imgtovolume(char *fileimg, opj_cparameters_t *parameters) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Fetch only the path
|
/*Fetch only the path */
|
||||||
strcpy(tmpdirpath,fileimg);
|
strcpy(tmpdirpath,fileimg);
|
||||||
if ((tmp = strrchr(tmpdirpath,'/')) != NULL){
|
if ((tmp = strrchr(tmpdirpath,'/')) != NULL){
|
||||||
tmp++; *tmp='\0';
|
tmp++; *tmp='\0';
|
||||||
|
@ -799,7 +799,7 @@ opj_volume_t* imgtovolume(char *fileimg, opj_cparameters_t *parameters) {
|
||||||
fseek(fimg, 0, SEEK_SET);
|
fseek(fimg, 0, SEEK_SET);
|
||||||
while (!feof(fimg)) {
|
while (!feof(fimg)) {
|
||||||
fgets(line,100,fimg);
|
fgets(line,100,fimg);
|
||||||
//fprintf(stdout,"%s %d \n",line,feof(fimg));
|
/*fprintf(stdout,"%s %d \n",line,feof(fimg));*/
|
||||||
if (strncmp(line,"Image",5) == 0){
|
if (strncmp(line,"Image",5) == 0){
|
||||||
sscanf(line,"%*s%*[ \t]%s",datatype);
|
sscanf(line,"%*s%*[ \t]%s",datatype);
|
||||||
} else if (strncmp(line,"File",4) == 0){
|
} else if (strncmp(line,"File",4) == 0){
|
||||||
|
|
|
@ -193,7 +193,7 @@ int main(){
|
||||||
|
|
||||||
printf("/* This file was automatically generated by t1_generate_luts.c */\n\n");
|
printf("/* This file was automatically generated by t1_generate_luts.c */\n\n");
|
||||||
|
|
||||||
// lut_ctxno_zc
|
/* lut_ctxno_zc */
|
||||||
for (j = 0; j < 4; ++j) {
|
for (j = 0; j < 4; ++j) {
|
||||||
for (i = 0; i < 256; ++i) {
|
for (i = 0; i < 256; ++i) {
|
||||||
int orient = j;
|
int orient = j;
|
||||||
|
@ -214,7 +214,7 @@ int main(){
|
||||||
}
|
}
|
||||||
printf("%i\n};\n\n", lut_ctxno_zc[1023]);
|
printf("%i\n};\n\n", lut_ctxno_zc[1023]);
|
||||||
|
|
||||||
// lut_ctxno_sc
|
/* lut_ctxno_sc */
|
||||||
printf("static char lut_ctxno_sc[256] = {\n ");
|
printf("static char lut_ctxno_sc[256] = {\n ");
|
||||||
for (i = 0; i < 255; ++i) {
|
for (i = 0; i < 255; ++i) {
|
||||||
printf("0x%x, ", t1_init_ctxno_sc(i << 4));
|
printf("0x%x, ", t1_init_ctxno_sc(i << 4));
|
||||||
|
@ -223,7 +223,7 @@ int main(){
|
||||||
}
|
}
|
||||||
printf("0x%x\n};\n\n", t1_init_ctxno_sc(255 << 4));
|
printf("0x%x\n};\n\n", t1_init_ctxno_sc(255 << 4));
|
||||||
|
|
||||||
// lut_spb
|
/* lut_spb */
|
||||||
printf("static char lut_spb[256] = {\n ");
|
printf("static char lut_spb[256] = {\n ");
|
||||||
for (i = 0; i < 255; ++i) {
|
for (i = 0; i < 255; ++i) {
|
||||||
printf("%i, ", t1_init_spb(i << 4));
|
printf("%i, ", t1_init_spb(i << 4));
|
||||||
|
|
|
@ -335,15 +335,15 @@ static void dwt_encode_53(int *a, int dn, int sn, int cas) {
|
||||||
|
|
||||||
if (!cas) {
|
if (!cas) {
|
||||||
if ((dn > 0) || (sn > 1)) { /* NEW : CASE ONE ELEMENT */
|
if ((dn > 0) || (sn > 1)) { /* NEW : CASE ONE ELEMENT */
|
||||||
//for (i = 0; i < dn; i++) D(i) -= (S_(i) + S_(i + 1)) >> 1;
|
/*for (i = 0; i < dn; i++) D(i) -= (S_(i) + S_(i + 1)) >> 1;*/
|
||||||
//for (i = 0; i < sn; i++) S(i) += (D_(i - 1) + D_(i) + 2) >> 2;
|
/*for (i = 0; i < sn; i++) S(i) += (D_(i - 1) + D_(i) + 2) >> 2;*/
|
||||||
for (i = 0; i < dn; i++){
|
for (i = 0; i < dn; i++){
|
||||||
D(i) -= (S_(i) + S_(i + 1)) >> 1;
|
D(i) -= (S_(i) + S_(i + 1)) >> 1;
|
||||||
//ops += 2;
|
/*ops += 2;*/
|
||||||
}
|
}
|
||||||
for (i = 0; i < sn; i++){
|
for (i = 0; i < sn; i++){
|
||||||
S(i) += (D_(i - 1) + D_(i) + 2) >> 2;
|
S(i) += (D_(i - 1) + D_(i) + 2) >> 2;
|
||||||
//ops += 3;
|
/*ops += 3;*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -355,15 +355,15 @@ static void dwt_encode_53(int *a, int dn, int sn, int cas) {
|
||||||
}*/
|
}*/
|
||||||
if (!sn && dn == 1){
|
if (!sn && dn == 1){
|
||||||
S(0) *= 2;
|
S(0) *= 2;
|
||||||
//ops++;
|
/*ops++;*/
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < dn; i++){
|
for (i = 0; i < dn; i++){
|
||||||
S(i) -= (DD_(i) + DD_(i - 1)) >> 1;
|
S(i) -= (DD_(i) + DD_(i - 1)) >> 1;
|
||||||
// ops += 2;
|
/* ops += 2;*/
|
||||||
}
|
}
|
||||||
for (i = 0; i < sn; i++){
|
for (i = 0; i < sn; i++){
|
||||||
D(i) += (SS_(i) + SS_(i + 1) + 2) >> 2;
|
D(i) += (SS_(i) + SS_(i + 1) + 2) >> 2;
|
||||||
// ops += 3;
|
/* ops += 3;*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -466,17 +466,17 @@ static int upandconv(double *nXPS, double *LPS, int lenXPS, int lenLPS) {
|
||||||
/* Perform the convolution of the vectors. */
|
/* Perform the convolution of the vectors. */
|
||||||
int i,j;
|
int i,j;
|
||||||
double *tmp = (double *)opj_malloc(2*lenXPS * sizeof(double));
|
double *tmp = (double *)opj_malloc(2*lenXPS * sizeof(double));
|
||||||
//Upsample
|
/*Upsample*/
|
||||||
memset(tmp, 0, 2*lenXPS*sizeof(double));
|
memset(tmp, 0, 2*lenXPS*sizeof(double));
|
||||||
for (i = 0; i < lenXPS; i++) {
|
for (i = 0; i < lenXPS; i++) {
|
||||||
*(tmp + 2*i) = *(nXPS + i);
|
*(tmp + 2*i) = *(nXPS + i);
|
||||||
*(nXPS + i) = 0;
|
*(nXPS + i) = 0;
|
||||||
}
|
}
|
||||||
//Convolution
|
/*Convolution*/
|
||||||
for (i = 0; i < 2*lenXPS; i++) {
|
for (i = 0; i < 2*lenXPS; i++) {
|
||||||
for (j = 0; j < lenLPS; j++) {
|
for (j = 0; j < lenLPS; j++) {
|
||||||
*(nXPS+i+j) = *(nXPS+i+j) + *(tmp + i) * *(LPS + j);
|
*(nXPS+i+j) = *(nXPS+i+j) + *(tmp + i) * *(LPS + j);
|
||||||
//fprintf(stdout,"*(tmp + %d) * *(LPS + %d) = %f * %f \n",i,j,*(tmp + i),*(LPS + j));
|
/*fprintf(stdout,"*(tmp + %d) * *(LPS + %d) = %f * %f \n",i,j,*(tmp + i),*(LPS + j));*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(tmp);
|
free(tmp);
|
||||||
|
@ -493,7 +493,7 @@ static double dwt_calc_wtnorms(int orient, int level[3], int dwtid[3], opj_wtfil
|
||||||
levely = (orient == 0) ? level[1]-1 : level[1];
|
levely = (orient == 0) ? level[1]-1 : level[1];
|
||||||
levelz = (orient == 0) ? level[2]-1 : level[2];
|
levelz = (orient == 0) ? level[2]-1 : level[2];
|
||||||
|
|
||||||
//X axis
|
/*X axis*/
|
||||||
lenLPS = wtfiltX->lenLPS;
|
lenLPS = wtfiltX->lenLPS;
|
||||||
lenHPS = wtfiltX->lenHPS;
|
lenHPS = wtfiltX->lenHPS;
|
||||||
for (i = 0; i < levelx; i++) {
|
for (i = 0; i < levelx; i++) {
|
||||||
|
@ -522,7 +522,7 @@ static double dwt_calc_wtnorms(int orient, int level[3], int dwtid[3], opj_wtfil
|
||||||
free(nLPSx);
|
free(nLPSx);
|
||||||
free(nHPSx);
|
free(nHPSx);
|
||||||
|
|
||||||
//Y axis
|
/*Y axis*/
|
||||||
if (dwtid[0] != dwtid[1] || level[0] != level[1]){
|
if (dwtid[0] != dwtid[1] || level[0] != level[1]){
|
||||||
lenLPS = wtfiltY->lenLPS;
|
lenLPS = wtfiltY->lenLPS;
|
||||||
lenHPS = wtfiltY->lenHPS;
|
lenHPS = wtfiltY->lenHPS;
|
||||||
|
@ -555,7 +555,7 @@ static double dwt_calc_wtnorms(int orient, int level[3], int dwtid[3], opj_wtfil
|
||||||
Ly = Lx;
|
Ly = Lx;
|
||||||
Hy = Hx;
|
Hy = Hx;
|
||||||
}
|
}
|
||||||
//Z axis
|
/*Z axis*/
|
||||||
if (levelz >= 0) {
|
if (levelz >= 0) {
|
||||||
lenLPS = wtfiltZ->lenLPS;
|
lenLPS = wtfiltZ->lenLPS;
|
||||||
lenHPS = wtfiltZ->lenHPS;
|
lenHPS = wtfiltZ->lenHPS;
|
||||||
|
@ -610,7 +610,7 @@ static double dwt_calc_wtnorms(int orient, int level[3], int dwtid[3], opj_wtfil
|
||||||
|
|
||||||
}
|
}
|
||||||
static void dwt_getwtfilters(opj_wtfilt_t *wtfilt, int dwtid) {
|
static void dwt_getwtfilters(opj_wtfilt_t *wtfilt, int dwtid) {
|
||||||
if (dwtid == 0) { //DWT 9-7
|
if (dwtid == 0) { /*DWT 9-7 */
|
||||||
wtfilt->lenLPS = 7; wtfilt->lenHPS = 9;
|
wtfilt->lenLPS = 7; wtfilt->lenHPS = 9;
|
||||||
wtfilt->LPS = (double *)opj_malloc(wtfilt->lenLPS * sizeof(double));
|
wtfilt->LPS = (double *)opj_malloc(wtfilt->lenLPS * sizeof(double));
|
||||||
wtfilt->HPS = (double *)opj_malloc(wtfilt->lenHPS * sizeof(double));
|
wtfilt->HPS = (double *)opj_malloc(wtfilt->lenHPS * sizeof(double));
|
||||||
|
@ -623,7 +623,7 @@ static void dwt_getwtfilters(opj_wtfilt_t *wtfilt, int dwtid) {
|
||||||
wtfilt->LPS[6] = -0.091271763114; wtfilt->HPS[6] = -0.078223266529;
|
wtfilt->LPS[6] = -0.091271763114; wtfilt->HPS[6] = -0.078223266529;
|
||||||
wtfilt->HPS[7] = 0.016864118443;
|
wtfilt->HPS[7] = 0.016864118443;
|
||||||
wtfilt->HPS[8] = 0.026748757411;
|
wtfilt->HPS[8] = 0.026748757411;
|
||||||
} else if (dwtid == 1) { //DWT 5-3
|
} else if (dwtid == 1) { /*DWT 5-3 */
|
||||||
wtfilt->lenLPS = 3; wtfilt->lenHPS = 5;
|
wtfilt->lenLPS = 3; wtfilt->lenHPS = 5;
|
||||||
wtfilt->LPS = (double *)opj_malloc(wtfilt->lenLPS * sizeof(double));
|
wtfilt->LPS = (double *)opj_malloc(wtfilt->lenLPS * sizeof(double));
|
||||||
wtfilt->HPS = (double *)opj_malloc(wtfilt->lenHPS * sizeof(double));
|
wtfilt->HPS = (double *)opj_malloc(wtfilt->lenHPS * sizeof(double));
|
||||||
|
@ -646,8 +646,8 @@ static void dwt_encode_stepsize(int stepsize, int numbps, opj_stepsize_t *bandno
|
||||||
n = 11 - int_floorlog2(stepsize);
|
n = 11 - int_floorlog2(stepsize);
|
||||||
bandno_stepsize->mant = (n < 0 ? stepsize >> -n : stepsize << n) & 0x7ff;
|
bandno_stepsize->mant = (n < 0 ? stepsize >> -n : stepsize << n) & 0x7ff;
|
||||||
bandno_stepsize->expn = numbps - p;
|
bandno_stepsize->expn = numbps - p;
|
||||||
//if J3D_CCP_QNTSTY_NOQNT --> stepsize = 8192.0 --> p = 0, n = -2 --> mant = 0; expn = (prec+gain)
|
/*if J3D_CCP_QNTSTY_NOQNT --> stepsize = 8192.0 --> p = 0, n = -2 --> mant = 0; expn = (prec+gain)*/
|
||||||
//else --> bandno_stepsize = (1<<(numbps - expn)) + (1<<(numbps - expn - 11)) * Ub
|
/*else --> bandno_stepsize = (1<<(numbps - expn)) + (1<<(numbps - expn - 11)) * Ub*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -715,7 +715,7 @@ void dwt_encode(opj_tcd_tilecomp_t * tilec, int dwtid[3]) {
|
||||||
|
|
||||||
cj = a + (i * wh);
|
cj = a + (i * wh);
|
||||||
|
|
||||||
//Horizontal
|
/*Horizontal*/
|
||||||
sn = rw1;
|
sn = rw1;
|
||||||
dn = rw - rw1;
|
dn = rw - rw1;
|
||||||
bj = (int*)opj_malloc(rw * sizeof(int));
|
bj = (int*)opj_malloc(rw * sizeof(int));
|
||||||
|
@ -736,7 +736,7 @@ void dwt_encode(opj_tcd_tilecomp_t * tilec, int dwtid[3]) {
|
||||||
}
|
}
|
||||||
opj_free(bj);
|
opj_free(bj);
|
||||||
|
|
||||||
//Vertical
|
/*Vertical*/
|
||||||
sn = rh1;
|
sn = rh1;
|
||||||
dn = rh - rh1;
|
dn = rh - rh1;
|
||||||
bj = (int*)opj_malloc(rh * sizeof(int));
|
bj = (int*)opj_malloc(rh * sizeof(int));
|
||||||
|
@ -759,7 +759,7 @@ void dwt_encode(opj_tcd_tilecomp_t * tilec, int dwtid[3]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (z < levelz){
|
if (z < levelz){
|
||||||
//Axial fprintf(stdout,"Axial DWT Transform %d %d %d\n",z,rd,rd1);
|
/*Axial fprintf(stdout,"Axial DWT Transform %d %d %d\n",z,rd,rd1);*/
|
||||||
sn = rd1;
|
sn = rd1;
|
||||||
dn = rd - rd1;
|
dn = rd - rd1;
|
||||||
bj = (int*)opj_malloc(rd * sizeof(int));
|
bj = (int*)opj_malloc(rd * sizeof(int));
|
||||||
|
@ -782,7 +782,7 @@ void dwt_encode(opj_tcd_tilecomp_t * tilec, int dwtid[3]) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//fprintf(stdout,"[INFO] Ops: %d \n",ops);
|
/*fprintf(stdout,"[INFO] Ops: %d \n",ops);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -842,7 +842,7 @@ void dwt_decode(opj_tcd_tilecomp_t * tilec, int stops[3], int dwtid[3]) {
|
||||||
fprintf(stdout,"IDWT Transform %d %d %d %d\n",level, z, rd,rd1);*/
|
fprintf(stdout,"IDWT Transform %d %d %d %d\n",level, z, rd,rd1);*/
|
||||||
|
|
||||||
if (z >= stops[2] && rd != rd1) {
|
if (z >= stops[2] && rd != rd1) {
|
||||||
//fprintf(stdout,"Axial Transform %d %d %d %d\n",levelz, z, rd,rd1);
|
/*fprintf(stdout,"Axial Transform %d %d %d %d\n",levelz, z, rd,rd1);*/
|
||||||
sn = rd1;
|
sn = rd1;
|
||||||
dn = rd - rd1;
|
dn = rd - rd1;
|
||||||
bj = (int*)opj_malloc(rd * sizeof(int));
|
bj = (int*)opj_malloc(rd * sizeof(int));
|
||||||
|
@ -865,10 +865,10 @@ void dwt_decode(opj_tcd_tilecomp_t * tilec, int stops[3], int dwtid[3]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < rd; i++) {
|
for (i = 0; i < rd; i++) {
|
||||||
//Fetch corresponding slice for doing DWT-2D
|
/*Fetch corresponding slice for doing DWT-2D*/
|
||||||
cj = tilec->data + (i * wh);
|
cj = tilec->data + (i * wh);
|
||||||
|
|
||||||
//Vertical
|
/*Vertical*/
|
||||||
sn = rh1;
|
sn = rh1;
|
||||||
dn = rh - rh1;
|
dn = rh - rh1;
|
||||||
bj = (int*)opj_malloc(rh * sizeof(int));
|
bj = (int*)opj_malloc(rh * sizeof(int));
|
||||||
|
@ -889,7 +889,7 @@ void dwt_decode(opj_tcd_tilecomp_t * tilec, int stops[3], int dwtid[3]) {
|
||||||
}
|
}
|
||||||
opj_free(bj);
|
opj_free(bj);
|
||||||
|
|
||||||
//Horizontal
|
/*Horizontal*/
|
||||||
sn = rw1;
|
sn = rw1;
|
||||||
dn = rw - rw1;
|
dn = rw - rw1;
|
||||||
bj = (int*)opj_malloc(rw * sizeof(int));
|
bj = (int*)opj_malloc(rw * sizeof(int));
|
||||||
|
@ -931,7 +931,7 @@ int dwt_getgain(int orient, int reversible) {
|
||||||
else
|
else
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
//else if (reversible == 0){
|
/*else if (reversible == 0){*/
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -946,25 +946,25 @@ double dwt_getnorm(int orient, int level[3], int dwtid[3]) {
|
||||||
|
|
||||||
if (flagnorm[levelx][levely][levelz][orient] == 1) {
|
if (flagnorm[levelx][levely][levelz][orient] == 1) {
|
||||||
norm = dwt_norm[levelx][levely][levelz][orient];
|
norm = dwt_norm[levelx][levely][levelz][orient];
|
||||||
//fprintf(stdout,"[INFO] Level: %d %d %d Orient %d Dwt_norm: %f \n",level[0],level[1],level[2],orient,norm);
|
/*fprintf(stdout,"[INFO] Level: %d %d %d Orient %d Dwt_norm: %f \n",level[0],level[1],level[2],orient,norm);*/
|
||||||
} else {
|
} else {
|
||||||
opj_wtfilt_t *wtfiltx =(opj_wtfilt_t *) opj_malloc(sizeof(opj_wtfilt_t));
|
opj_wtfilt_t *wtfiltx =(opj_wtfilt_t *) opj_malloc(sizeof(opj_wtfilt_t));
|
||||||
opj_wtfilt_t *wtfilty =(opj_wtfilt_t *) opj_malloc(sizeof(opj_wtfilt_t));
|
opj_wtfilt_t *wtfilty =(opj_wtfilt_t *) opj_malloc(sizeof(opj_wtfilt_t));
|
||||||
opj_wtfilt_t *wtfiltz =(opj_wtfilt_t *) opj_malloc(sizeof(opj_wtfilt_t));
|
opj_wtfilt_t *wtfiltz =(opj_wtfilt_t *) opj_malloc(sizeof(opj_wtfilt_t));
|
||||||
//Fetch equivalent filters for each dimension
|
/*Fetch equivalent filters for each dimension*/
|
||||||
dwt_getwtfilters(wtfiltx, dwtid[0]);
|
dwt_getwtfilters(wtfiltx, dwtid[0]);
|
||||||
dwt_getwtfilters(wtfilty, dwtid[1]);
|
dwt_getwtfilters(wtfilty, dwtid[1]);
|
||||||
dwt_getwtfilters(wtfiltz, dwtid[2]);
|
dwt_getwtfilters(wtfiltz, dwtid[2]);
|
||||||
//Calculate the corresponding norm
|
/*Calculate the corresponding norm */
|
||||||
norm = dwt_calc_wtnorms(orient, level, dwtid, wtfiltx, wtfilty, wtfiltz);
|
norm = dwt_calc_wtnorms(orient, level, dwtid, wtfiltx, wtfilty, wtfiltz);
|
||||||
//Save norm in array (no recalculation)
|
/*Save norm in array (no recalculation)*/
|
||||||
dwt_norm[levelx][levely][levelz][orient] = norm;
|
dwt_norm[levelx][levely][levelz][orient] = norm;
|
||||||
flagnorm[levelx][levely][levelz][orient] = 1;
|
flagnorm[levelx][levely][levelz][orient] = 1;
|
||||||
//Free reserved space
|
/*Free reserved space*/
|
||||||
opj_free(wtfiltx->LPS); opj_free(wtfilty->LPS); opj_free(wtfiltz->LPS);
|
opj_free(wtfiltx->LPS); opj_free(wtfilty->LPS); opj_free(wtfiltz->LPS);
|
||||||
opj_free(wtfiltx->HPS); opj_free(wtfilty->HPS); opj_free(wtfiltz->HPS);
|
opj_free(wtfiltx->HPS); opj_free(wtfilty->HPS); opj_free(wtfiltz->HPS);
|
||||||
opj_free(wtfiltx); opj_free(wtfilty); opj_free(wtfiltz);
|
opj_free(wtfiltx); opj_free(wtfilty); opj_free(wtfiltz);
|
||||||
//fprintf(stdout,"[INFO] Dwtid: %d %d %d Level: %d %d %d Orient %d Norm: %f \n",dwtid[0],dwtid[1],dwtid[2],level[0],level[1],level[2],orient,norm);
|
/*fprintf(stdout,"[INFO] Dwtid: %d %d %d Level: %d %d %d Orient %d Norm: %f \n",dwtid[0],dwtid[1],dwtid[2],level[0],level[1],level[2],orient,norm);*/
|
||||||
}
|
}
|
||||||
return norm;
|
return norm;
|
||||||
}
|
}
|
||||||
|
@ -1004,10 +1004,10 @@ void dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, int prec) {
|
||||||
if (tccp->qntsty == J3D_CCP_QNTSTY_NOQNT) {
|
if (tccp->qntsty == J3D_CCP_QNTSTY_NOQNT) {
|
||||||
stepsize = 1.0;
|
stepsize = 1.0;
|
||||||
} else {
|
} else {
|
||||||
double norm = dwt_getnorm(orient,level,tccp->dwtid); //Fetch norms if irreversible transform (by the moment only I9.7)
|
double norm = dwt_getnorm(orient,level,tccp->dwtid); /*Fetch norms if irreversible transform (by the moment only I9.7)*/
|
||||||
stepsize = (1 << (gain + 1)) / norm;
|
stepsize = (1 << (gain + 1)) / norm;
|
||||||
}
|
}
|
||||||
//fprintf(stdout,"[INFO] Bandno: %d Orient: %d Level: %d %d %d Stepsize: %f\n",bandno,orient,level[0],level[1],level[2],stepsize);
|
/*fprintf(stdout,"[INFO] Bandno: %d Orient: %d Level: %d %d %d Stepsize: %f\n",bandno,orient,level[0],level[1],level[2],stepsize);*/
|
||||||
dwt_encode_stepsize((int) floor(stepsize * 8192.0), prec + gain, &tccp->stepsizes[bandno]);
|
dwt_encode_stepsize((int) floor(stepsize * 8192.0), prec + gain, &tccp->stepsizes[bandno]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ _itoa(int i, char *a, int r) {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !_WIN32
|
#endif /* !_WIN32 */
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
|
@ -558,7 +558,7 @@ static void t1_encode_cblk(opj_t1_t *t1, opj_tcd_cblk_t * cblk, int orient, int
|
||||||
int correction = 3;
|
int correction = 3;
|
||||||
double tmpwmsedec;
|
double tmpwmsedec;
|
||||||
type = ((bpno < (cblk->numbps - 4)) && (passtype < 2) && (cblksty & J3D_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;
|
type = ((bpno < (cblk->numbps - 4)) && (passtype < 2) && (cblksty & J3D_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;
|
||||||
//fprintf(stdout,"passno %d passtype %d w %d h %d l %d bpno %d orient %d type %d cblksty %d\n",passno,passtype,w,h,l,bpno,orient,type,cblksty);
|
/*fprintf(stdout,"passno %d passtype %d w %d h %d l %d bpno %d orient %d type %d cblksty %d\n",passno,passtype,w,h,l,bpno,orient,type,cblksty);*/
|
||||||
|
|
||||||
switch (passtype) {
|
switch (passtype) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -568,7 +568,7 @@ static void t1_encode_cblk(opj_t1_t *t1, opj_tcd_cblk_t * cblk, int orient, int
|
||||||
t1_enc_refpass(t1, w, h, l, bpno, &nmsedec, type, cblksty);
|
t1_enc_refpass(t1, w, h, l, bpno, &nmsedec, type, cblksty);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
//fprintf(stdout,"w %d h %d l %d bpno %d orient %d \n",w,h,l,bpno,orient);
|
/*fprintf(stdout,"w %d h %d l %d bpno %d orient %d \n",w,h,l,bpno,orient);*/
|
||||||
t1_enc_clnpass(t1, w, h, l, bpno, orient, &nmsedec, cblksty);
|
t1_enc_clnpass(t1, w, h, l, bpno, orient, &nmsedec, cblksty);
|
||||||
/* code switch SEGMARK (i.e. SEGSYM) */
|
/* code switch SEGMARK (i.e. SEGSYM) */
|
||||||
if (cblksty & J3D_CCP_CBLKSTY_SEGSYM)
|
if (cblksty & J3D_CCP_CBLKSTY_SEGSYM)
|
||||||
|
@ -923,8 +923,8 @@ void t1_destroy(opj_t1_t *t1) {
|
||||||
/* destroy MQC and RAW handles */
|
/* destroy MQC and RAW handles */
|
||||||
mqc_destroy(t1->mqc);
|
mqc_destroy(t1->mqc);
|
||||||
raw_destroy(t1->raw);
|
raw_destroy(t1->raw);
|
||||||
//opj_free(t1->data);
|
/*opj_free(t1->data);*/
|
||||||
//opj_free(t1->flags);
|
/*opj_free(t1->flags);*/
|
||||||
opj_free(t1);
|
opj_free(t1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -935,7 +935,7 @@ void t1_encode_cblks(opj_t1_t *t1, opj_tcd_tile_t *tile, opj_tcp_t *tcp) {
|
||||||
int n=0;
|
int n=0;
|
||||||
int level[3];
|
int level[3];
|
||||||
FILE *fid = NULL;
|
FILE *fid = NULL;
|
||||||
// char filename[10];
|
/* char filename[10];*/
|
||||||
tile->distotile = 0; /* fixed_quality */
|
tile->distotile = 0; /* fixed_quality */
|
||||||
|
|
||||||
for (compno = 0; compno < tile->numcomps; compno++) {
|
for (compno = 0; compno < tile->numcomps; compno++) {
|
||||||
|
@ -959,7 +959,7 @@ void t1_encode_cblks(opj_t1_t *t1, opj_tcd_tile_t *tile, opj_tcp_t *tcp) {
|
||||||
for (cblkno = 0; cblkno < prc->cblkno[0] * prc->cblkno[1] * prc->cblkno[2]; cblkno++) {
|
for (cblkno = 0; cblkno < prc->cblkno[0] * prc->cblkno[1] * prc->cblkno[2]; cblkno++) {
|
||||||
opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
|
opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];
|
||||||
|
|
||||||
//fprintf(stdout,"Precno %d Cblkno %d \n",precno,cblkno);
|
/*fprintf(stdout,"Precno %d Cblkno %d \n",precno,cblkno);*/
|
||||||
if (band->bandno == 0) {
|
if (band->bandno == 0) {
|
||||||
x = cblk->x0 - band->x0;
|
x = cblk->x0 - band->x0;
|
||||||
y = cblk->y0 - band->y0;
|
y = cblk->y0 - band->y0;
|
||||||
|
@ -1007,7 +1007,7 @@ void t1_encode_cblks(opj_t1_t *t1, opj_tcd_tile_t *tile, opj_tcp_t *tcp) {
|
||||||
for (i = 0; i < cblk->x1 - cblk->x0; i++) {
|
for (i = 0; i < cblk->x1 - cblk->x0; i++) {
|
||||||
t1->data[k][j][i] =
|
t1->data[k][j][i] =
|
||||||
tilec->data[(x + i) + (y + j) * (tilec->x1 - tilec->x0) + (z + k) * (tilec->x1 - tilec->x0) * (tilec->y1 - tilec->y0)] << T1_NMSEDEC_FRACBITS;
|
tilec->data[(x + i) + (y + j) * (tilec->x1 - tilec->x0) + (z + k) * (tilec->x1 - tilec->x0) * (tilec->y1 - tilec->y0)] << T1_NMSEDEC_FRACBITS;
|
||||||
//fprintf(fid," %d",t1->data[k][j][i]);
|
/*fprintf(fid," %d",t1->data[k][j][i]);*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1031,14 +1031,14 @@ void t1_encode_cblks(opj_t1_t *t1, opj_tcd_tile_t *tile, opj_tcp_t *tcp) {
|
||||||
}
|
}
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
level[i] = tilec->numresolution[i] - 1 - resno;
|
level[i] = tilec->numresolution[i] - 1 - resno;
|
||||||
//fprintf(stdout,"t1_encode_cblk(t1, cblk, %d, %d, %d %d %d, %d, %f, %d, %d, tile);\n", orient, compno, level[0], level[1], level[2], tcp->tccps[compno].reversible, band->stepsize, tcp->tccps[compno].cblksty, tile->numcomps);
|
/*fprintf(stdout,"t1_encode_cblk(t1, cblk, %d, %d, %d %d %d, %d, %f, %d, %d, tile);\n", orient, compno, level[0], level[1], level[2], tcp->tccps[compno].reversible, band->stepsize, tcp->tccps[compno].cblksty, tile->numcomps);*/
|
||||||
t1_encode_cblk(t1, cblk, orient, compno, level, tcp->tccps[compno].dwtid, band->stepsize, tcp->tccps[compno].cblksty, tile->numcomps, tile);
|
t1_encode_cblk(t1, cblk, orient, compno, level, tcp->tccps[compno].dwtid, band->stepsize, tcp->tccps[compno].cblksty, tile->numcomps, tile);
|
||||||
|
|
||||||
} /* cblkno */
|
} /* cblkno */
|
||||||
} /* precno */
|
} /* precno */
|
||||||
//fprintf(fid,"\n");
|
/*fprintf(fid,"\n");*/
|
||||||
} /* bandno */
|
} /* bandno */
|
||||||
//fclose(fid);
|
/*fclose(fid);*/
|
||||||
} /* resno */
|
} /* resno */
|
||||||
} /* compno */
|
} /* compno */
|
||||||
}
|
}
|
||||||
|
@ -1172,7 +1172,7 @@ double t1_getwmsedec(int nmsedec, int compno, int level[3], int orient, int bpno
|
||||||
}
|
}
|
||||||
w2 = dwt_getnorm(orient, level, dwtid);
|
w2 = dwt_getnorm(orient, level, dwtid);
|
||||||
|
|
||||||
//fprintf(stdout,"nmsedec %d level %d %d %d orient %d bpno %d stepsize %f \n",nmsedec ,level[0],level[1],level[2],orient,bpno,stepsize);
|
/*fprintf(stdout,"nmsedec %d level %d %d %d orient %d bpno %d stepsize %f \n",nmsedec ,level[0],level[1],level[2],orient,bpno,stepsize);*/
|
||||||
wmsedec = w1 * w2 * stepsize * (1 << bpno);
|
wmsedec = w1 * w2 * stepsize * (1 << bpno);
|
||||||
wmsedec *= wmsedec * nmsedec / 8192.0;
|
wmsedec *= wmsedec * nmsedec / 8192.0;
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ static int t1_3d_getctxno_zc(unsigned int f, int orient) {
|
||||||
|
|
||||||
static int t1_3d_getctxno_sc(unsigned int f) {
|
static int t1_3d_getctxno_sc(unsigned int f) {
|
||||||
return t1_3d_init_ctxno_sc((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN));
|
return t1_3d_init_ctxno_sc((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN));
|
||||||
//return t1->lut_ctxno_sc[((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN)) >> 4];
|
/*return t1->lut_ctxno_sc[((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN)) >> 4];*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static int t1_3d_getctxno_mag(unsigned int f, int fsvr) {
|
static int t1_3d_getctxno_mag(unsigned int f, int fsvr) {
|
||||||
|
@ -141,7 +141,7 @@ static int t1_3d_getctxno_mag(unsigned int f, int fsvr) {
|
||||||
|
|
||||||
static int t1_3d_getspb(unsigned int f) {
|
static int t1_3d_getspb(unsigned int f) {
|
||||||
return t1_3d_init_spb((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN));
|
return t1_3d_init_spb((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN));
|
||||||
//return t1->lut_spb[((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN)) >> 4];
|
/*return t1->lut_spb[((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN)) >> 4];*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static int t1_3d_getnmsedec_sig(opj_t1_3d_t *t1, int x, int bitpos) {
|
static int t1_3d_getnmsedec_sig(opj_t1_3d_t *t1, int x, int bitpos) {
|
||||||
|
@ -773,8 +773,8 @@ static int t1_3d_init_ctxno_zc(unsigned int f, int orient) {
|
||||||
+ ((f & T1_3D_SIG_BNW) != 0) + ((f & T1_3D_SIG_BNE) != 0) + ((f & T1_3D_SIG_BSE) != 0) + ((f & T1_3D_SIG_BSW) != 0);
|
+ ((f & T1_3D_SIG_BNW) != 0) + ((f & T1_3D_SIG_BNE) != 0) + ((f & T1_3D_SIG_BSE) != 0) + ((f & T1_3D_SIG_BSW) != 0);
|
||||||
|
|
||||||
switch (orient) {
|
switch (orient) {
|
||||||
case 0: //LLL
|
case 0: /*LLL*/
|
||||||
case 7: //HHH
|
case 7: /*HHH*/
|
||||||
hvc = h + v + c;
|
hvc = h + v + c;
|
||||||
d2 = d2xy + d2xz + d2yz;
|
d2 = d2xy + d2xz + d2yz;
|
||||||
if (!hvc) {
|
if (!hvc) {
|
||||||
|
@ -805,7 +805,7 @@ static int t1_3d_init_ctxno_zc(unsigned int f, int orient) {
|
||||||
n = 15;
|
n = 15;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
//LHL, HLL, LLH
|
/*LHL, HLL, LLH*/
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
case 4:
|
case 4:
|
||||||
|
@ -817,19 +817,19 @@ static int t1_3d_init_ctxno_zc(unsigned int f, int orient) {
|
||||||
n = (!d2xy2yz) ? ((!d3) ? 0 : 1) : ((!d3) ? 2 : 3);
|
n = (!d2xy2yz) ? ((!d3) ? 0 : 1) : ((!d3) ? 2 : 3);
|
||||||
} else if (d2xy == 1) {
|
} else if (d2xy == 1) {
|
||||||
n = (!d2xy2yz) ? ((!d3) ? 4 : 5) : 6;
|
n = (!d2xy2yz) ? ((!d3) ? 4 : 5) : 6;
|
||||||
} else { //>=2
|
} else { /*>=2*/
|
||||||
n = 7;
|
n = 7;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
n = (v == 1) ? 8 : 9; // =1 or =2
|
n = (v == 1) ? 8 : 9; /* =1 or =2*/
|
||||||
}
|
}
|
||||||
} else if (hc == 1) {
|
} else if (hc == 1) {
|
||||||
n = (!v) ? ( (!d2xy) ? ( (!d2xy2yz) ? ( (!d3) ? 10 : 11) : (12) ) : (13) ) : (14);
|
n = (!v) ? ( (!d2xy) ? ( (!d2xy2yz) ? ( (!d3) ? 10 : 11) : (12) ) : (13) ) : (14);
|
||||||
} else { //if (hc >= 2)
|
} else { /*if (hc >= 2)*/
|
||||||
n = 15;
|
n = 15;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
//HLH, HHL, LHH
|
/*HLH, HHL, LHH*/
|
||||||
case 3:
|
case 3:
|
||||||
case 5:
|
case 5:
|
||||||
case 6:
|
case 6:
|
||||||
|
@ -841,7 +841,7 @@ static int t1_3d_init_ctxno_zc(unsigned int f, int orient) {
|
||||||
n = (!d3) ? 0 : 1;
|
n = (!d3) ? 0 : 1;
|
||||||
} else if (hc == 1) {
|
} else if (hc == 1) {
|
||||||
n = (!d2xy2xz) ? 2 : 3;
|
n = (!d2xy2xz) ? 2 : 3;
|
||||||
} else { //if >= 2
|
} else { /*if >= 2*/
|
||||||
n = 4;
|
n = 4;
|
||||||
}
|
}
|
||||||
} else if ( d2xz>=1 && !hc ) {
|
} else if ( d2xz>=1 && !hc ) {
|
||||||
|
@ -856,7 +856,7 @@ static int t1_3d_init_ctxno_zc(unsigned int f, int orient) {
|
||||||
n = (!hc) ? 10 : 11;
|
n = (!hc) ? 10 : 11;
|
||||||
} else if (d2xz == 2) {
|
} else if (d2xz == 2) {
|
||||||
n = (!hc) ? 12 : 13;
|
n = (!hc) ? 12 : 13;
|
||||||
} else { // if (d2xz >= 3) {
|
} else { /* if (d2xz >= 3) {*/
|
||||||
n = 14;
|
n = 14;
|
||||||
}
|
}
|
||||||
} else if (v == 2) {
|
} else if (v == 2) {
|
||||||
|
@ -920,7 +920,7 @@ static int t1_3d_init_ctxno_sc(unsigned int f) {
|
||||||
|
|
||||||
static int t1_3d_init_ctxno_mag(unsigned int f, int f2) {
|
static int t1_3d_init_ctxno_mag(unsigned int f, int f2) {
|
||||||
int n;
|
int n;
|
||||||
if (!(f2 & T1_3D_REFINE)) //First refinement for this coefficient (no previous refinement)
|
if (!(f2 & T1_3D_REFINE)) /*First refinement for this coefficient (no previous refinement)*/
|
||||||
n = (f & (T1_3D_SIG_PRIM)) ? 1 : 0;
|
n = (f & (T1_3D_SIG_PRIM)) ? 1 : 0;
|
||||||
else
|
else
|
||||||
n = 2;
|
n = 2;
|
||||||
|
@ -1137,7 +1137,7 @@ void t1_3d_decode_cblks(opj_t1_3d_t *t1, opj_tcd_tile_t *tile, opj_tcp_t *tcp) {
|
||||||
|
|
||||||
orient = band->bandno; /* FIXME */
|
orient = band->bandno; /* FIXME */
|
||||||
|
|
||||||
//fprintf(stdout,"[INFO] t1_3d_decode_cblk(t1, cblk, orient(%d), tcp->tccps[compno].roishift (%d), tcp->tccps[compno].cblksty (%d));\n",orient,tcp->tccps[compno].roishift, tcp->tccps[compno].cblksty);
|
/*fprintf(stdout,"[INFO] t1_3d_decode_cblk(t1, cblk, orient(%d), tcp->tccps[compno].roishift (%d), tcp->tccps[compno].cblksty (%d));\n",orient,tcp->tccps[compno].roishift, tcp->tccps[compno].cblksty);*/
|
||||||
t1_3d_decode_cblk(t1, cblk, orient, tcp->tccps[compno].roishift, tcp->tccps[compno].cblksty);
|
t1_3d_decode_cblk(t1, cblk, orient, tcp->tccps[compno].roishift, tcp->tccps[compno].cblksty);
|
||||||
|
|
||||||
if (band->bandno == 0) {
|
if (band->bandno == 0) {
|
||||||
|
|
|
@ -568,7 +568,7 @@ int t2_encode_packets(opj_t2_t* t2, int tileno, opj_tcd_tile_t *tile, int maxlay
|
||||||
while (pi_next(&pi[pino])) {
|
while (pi_next(&pi[pino])) {
|
||||||
if (pi[pino].layno < maxlayers) {
|
if (pi[pino].layno < maxlayers) {
|
||||||
e = t2_encode_packet(tile, &cp->tcps[tileno], &pi[pino], c, dest + len - c, volume_info, tileno, cp);
|
e = t2_encode_packet(tile, &cp->tcps[tileno], &pi[pino], c, dest + len - c, volume_info, tileno, cp);
|
||||||
//opj_event_msg(t2->cinfo, EVT_INFO, " t2_encode_packet: %d bytes coded\n",e);
|
/*opj_event_msg(t2->cinfo, EVT_INFO, " t2_encode_packet: %d bytes coded\n",e);*/
|
||||||
if (e == -999) {
|
if (e == -999) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -112,33 +112,33 @@ opj_tgt_tree_t *tgt_create(int numleafsh, int numleafsv, int numleafsz) {
|
||||||
p = tree->numleafsh * tree->numleafsv * tree->numleafsz;
|
p = tree->numleafsh * tree->numleafsv * tree->numleafsz;
|
||||||
p0 = p;
|
p0 = p;
|
||||||
n = 0;
|
n = 0;
|
||||||
//fprintf(stdout,"\nH %d V %d Z %d numlvls %d nodes %d\n",tree->numleafsh,tree->numleafsv,tree->numleafsz,numlvls,tree->numnodes);
|
/*fprintf(stdout,"\nH %d V %d Z %d numlvls %d nodes %d\n",tree->numleafsh,tree->numleafsv,tree->numleafsz,numlvls,tree->numnodes);*/
|
||||||
for (i = 0; i < numlvls - 1; ++i) {
|
for (i = 0; i < numlvls - 1; ++i) {
|
||||||
for (j = 0; j < nplv[i]; ++j) {
|
for (j = 0; j < nplv[i]; ++j) {
|
||||||
k = nplh[i]*nplz[i];
|
k = nplh[i]*nplz[i];
|
||||||
while (--k >= 0) {
|
while (--k >= 0) {
|
||||||
node->parent = parentnode; //fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);
|
node->parent = parentnode; /*fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);*/
|
||||||
++node; ++n;
|
++node; ++n;
|
||||||
if (--k >= 0 && n < p) {
|
if (--k >= 0 && n < p) {
|
||||||
node->parent = parentnode; //fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);
|
node->parent = parentnode; /*fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);*/
|
||||||
++node; ++n;
|
++node; ++n;
|
||||||
}
|
}
|
||||||
if (nplz[i] != 1){ //2D operation vs 3D operation
|
if (nplz[i] != 1){ /*2D operation vs 3D operation*/
|
||||||
if (--k >= 0 && n < p) {
|
if (--k >= 0 && n < p) {
|
||||||
node->parent = parentnode; //fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);
|
node->parent = parentnode; /*fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);*/
|
||||||
++node; ++n;
|
++node; ++n;
|
||||||
}
|
}
|
||||||
if (--k >= 0 && n < p) {
|
if (--k >= 0 && n < p) {
|
||||||
node->parent = parentnode; //fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);
|
node->parent = parentnode; /*fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);*/
|
||||||
++node; ++n;
|
++node; ++n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
++parentnode; ++p;
|
++parentnode; ++p;
|
||||||
}
|
}
|
||||||
if ((j & 1) || j == nplv[i] - 1) {
|
if ((j & 1) || j == nplv[i] - 1) {
|
||||||
parentnode0 = parentnode; p0 = p; //fprintf(stdout,"parent = node[%d] \n",p);
|
parentnode0 = parentnode; p0 = p; /*fprintf(stdout,"parent = node[%d] \n",p);*/
|
||||||
} else {
|
} else {
|
||||||
parentnode = parentnode0; p = p0; //fprintf(stdout,"parent = node[%d] \n",p);
|
parentnode = parentnode0; p = p0; /*fprintf(stdout,"parent = node[%d] \n",p);*/
|
||||||
parentnode0 += nplh[i]*nplz[i]; p0 += nplh[i]*nplz[i];
|
parentnode0 += nplh[i]*nplz[i]; p0 += nplh[i]*nplz[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ opj_volume_t* OPJ_CALLCONV opj_volume_create(int numcmpts, opj_volume_cmptparm_t
|
||||||
opj_volume_destroy(volume);
|
opj_volume_destroy(volume);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
//fprintf(stdout,"%d %d %d %d %d %d %d %d %d", comp->w,comp->h, comp->l, comp->dx, comp->dy, comp->dz, comp->prec, comp->bpp, comp->sgnd);
|
/*fprintf(stdout,"%d %d %d %d %d %d %d %d %d", comp->w,comp->h, comp->l, comp->dx, comp->dy, comp->dz, comp->prec, comp->bpp, comp->sgnd);*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue