int i, s, numcomps, maxvalue, sliceno, slicepos, maxslice = 0;
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;
char endian1,endian2,sign;
/* Separaci�n del caso de un �nico slice frente al de muchos */
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;
maxslice = 1;
strcpy(pgxfiles[0],relpath);
} else {
- //Fetch only the path
+ /*Fetch only the path */
strcpy(tmpdirpath,relpath);
if ((tmp = strrchr(tmpdirpath,'/')) != NULL){
tmp++; *tmp='\0';
strcpy(dirpath,"./");
}
- //Fetch the pattern of the volume slices
+ /*Fetch the pattern of the volume slices*/
if ((tmp = strrchr (relpath,'/')) != NULL)
tmp++;
else
strcpy(tmp,dirpath);
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)
continue;
i = 0;
tmp2 = strpbrk (tmp2+1,"0123456789");
}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){
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);
pgxslicepos[sliceno] = slicepos - 1;
sliceno++;
if (slicepos>maxslice)
maxslice = slicepos;
- //Colocamos el slices en su posicion correspondiente
+ /*Colocamos el slices en su posicion correspondiente*/
strcpy(pgxfiles[slicepos-1],tmp);
}
}
/* set volume data :only one component, that is a volume*/
comp = &volume->comps[0];
- }//if sliceno==1
+ }/*if sliceno==1*/
offset = w * h * s;
}
fclose(f);
- } // for s --> sliceno
+ } /* for s --> sliceno*/
comp->bpp = int_floorlog2(maxvalue) + 1;
if (sliceno != 1)
closedir( dirp );
- //dump_volume(stdout, volume);
+ /*dump_volume(stdout, volume);*/
return volume;
}
offset = (sliceno / lrr * l) + (sliceno % lrr);
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++) {
int v = volume->comps[0].data[(i / wrr * w) + (i % wrr) + offset];
if (volume->comps[0].bigendian) {
}
fclose(fdest);
- }//for sliceno
- }//for compno
+ }/*for sliceno*/
+ }/*for compno*/
return 0;
}
int i, compno, w, h, l, numcomps = 1;
int prec, max = 0;
-// char temp[32];
+/* char temp[32];*/
char line[100];
int bigendian;
fseek(fimg, 0, SEEK_SET);
while (!feof(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){
sscanf(line,"%*s%*[ \t]%d",&prec);
} else if (strncmp(line,"Color",5) == 0){
sscanf(line, "%*s%*[ \t]%d%*[ \t]%d%*[ \t]%d",&w,&h,&l);
}
}
- //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, "Resolution(mm)%[ \t]%d%[ \t]%d%[ \t]%d%[ \n\t]",temp,&subsampling_dx,temp,&subsampling_dy,temp,&subsampling_dz,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, "Resolution(mm)%[ \t]%d%[ \t]%d%[ \t]%d%[ \n\t]",temp,&subsampling_dx,temp,&subsampling_dy,temp,&subsampling_dz,temp);*/
#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);
int offset, sliceno;
FILE *fdest = NULL;
FILE *fimgdest = NULL;
-// char *imgtemp;
+/* char *imgtemp;*/
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");
if (!fdest) {
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++) {
offset = (sliceno / lrr * l) + (sliceno % lrr);
return 0;
}
- //Fetch only the path
+ /*Fetch only the path */
strcpy(tmpdirpath,fileimg);
if ((tmp = strrchr(tmpdirpath,'/')) != NULL){
tmp++; *tmp='\0';
fseek(fimg, 0, SEEK_SET);
while (!feof(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){
sscanf(line,"%*s%*[ \t]%s",datatype);
} else if (strncmp(line,"File",4) == 0){
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 (i = 0; i < 256; ++i) {
int orient = j;
}
printf("%i\n};\n\n", lut_ctxno_zc[1023]);
- // lut_ctxno_sc
+ /* lut_ctxno_sc */
printf("static char lut_ctxno_sc[256] = {\n ");
for (i = 0; i < 255; ++i) {
printf("0x%x, ", t1_init_ctxno_sc(i << 4));
}
printf("0x%x\n};\n\n", t1_init_ctxno_sc(255 << 4));
- // lut_spb
+ /* lut_spb */
printf("static char lut_spb[256] = {\n ");
for (i = 0; i < 255; ++i) {
printf("%i, ", t1_init_spb(i << 4));
if (!cas) {
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 < sn; i++) S(i) += (D_(i - 1) + D_(i) + 2) >> 2;
+ /*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 < dn; i++){
D(i) -= (S_(i) + S_(i + 1)) >> 1;
- //ops += 2;
+ /*ops += 2;*/
}
for (i = 0; i < sn; i++){
S(i) += (D_(i - 1) + D_(i) + 2) >> 2;
- //ops += 3;
+ /*ops += 3;*/
}
}
} else {
}*/
if (!sn && dn == 1){
S(0) *= 2;
- //ops++;
+ /*ops++;*/
} else {
for (i = 0; i < dn; i++){
S(i) -= (DD_(i) + DD_(i - 1)) >> 1;
- // ops += 2;
+ /* ops += 2;*/
}
for (i = 0; i < sn; i++){
D(i) += (SS_(i) + SS_(i + 1) + 2) >> 2;
- // ops += 3;
+ /* ops += 3;*/
}
}
}
/* Perform the convolution of the vectors. */
int i,j;
double *tmp = (double *)opj_malloc(2*lenXPS * sizeof(double));
- //Upsample
+ /*Upsample*/
memset(tmp, 0, 2*lenXPS*sizeof(double));
for (i = 0; i < lenXPS; i++) {
*(tmp + 2*i) = *(nXPS + i);
*(nXPS + i) = 0;
}
- //Convolution
+ /*Convolution*/
for (i = 0; i < 2*lenXPS; i++) {
for (j = 0; j < lenLPS; 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);
levely = (orient == 0) ? level[1]-1 : level[1];
levelz = (orient == 0) ? level[2]-1 : level[2];
- //X axis
+ /*X axis*/
lenLPS = wtfiltX->lenLPS;
lenHPS = wtfiltX->lenHPS;
for (i = 0; i < levelx; i++) {
free(nLPSx);
free(nHPSx);
- //Y axis
+ /*Y axis*/
if (dwtid[0] != dwtid[1] || level[0] != level[1]){
lenLPS = wtfiltY->lenLPS;
lenHPS = wtfiltY->lenHPS;
Ly = Lx;
Hy = Hx;
}
- //Z axis
+ /*Z axis*/
if (levelz >= 0) {
lenLPS = wtfiltZ->lenLPS;
lenHPS = wtfiltZ->lenHPS;
}
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->LPS = (double *)opj_malloc(wtfilt->lenLPS * sizeof(double));
wtfilt->HPS = (double *)opj_malloc(wtfilt->lenHPS * sizeof(double));
wtfilt->LPS[6] = -0.091271763114; wtfilt->HPS[6] = -0.078223266529;
wtfilt->HPS[7] = 0.016864118443;
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->LPS = (double *)opj_malloc(wtfilt->lenLPS * sizeof(double));
wtfilt->HPS = (double *)opj_malloc(wtfilt->lenHPS * sizeof(double));
n = 11 - int_floorlog2(stepsize);
bandno_stepsize->mant = (n < 0 ? stepsize >> -n : stepsize << n) & 0x7ff;
bandno_stepsize->expn = numbps - p;
- //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
+ /*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*/
}
/*
cj = a + (i * wh);
- //Horizontal
+ /*Horizontal*/
sn = rw1;
dn = rw - rw1;
bj = (int*)opj_malloc(rw * sizeof(int));
}
opj_free(bj);
- //Vertical
+ /*Vertical*/
sn = rh1;
dn = rh - rh1;
bj = (int*)opj_malloc(rh * sizeof(int));
}
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;
dn = rd - rd1;
bj = (int*)opj_malloc(rd * sizeof(int));
}
}
- //fprintf(stdout,"[INFO] Ops: %d \n",ops);
+ /*fprintf(stdout,"[INFO] Ops: %d \n",ops);*/
}
fprintf(stdout,"IDWT Transform %d %d %d %d\n",level, z, 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;
dn = rd - rd1;
bj = (int*)opj_malloc(rd * sizeof(int));
}
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);
- //Vertical
+ /*Vertical*/
sn = rh1;
dn = rh - rh1;
bj = (int*)opj_malloc(rh * sizeof(int));
}
opj_free(bj);
- //Horizontal
+ /*Horizontal*/
sn = rw1;
dn = rw - rw1;
bj = (int*)opj_malloc(rw * sizeof(int));
else
return 3;
}
- //else if (reversible == 0){
+ /*else if (reversible == 0){*/
return 0;
}
if (flagnorm[levelx][levely][levelz][orient] == 1) {
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 {
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 *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(wtfilty, dwtid[1]);
dwt_getwtfilters(wtfiltz, dwtid[2]);
- //Calculate the corresponding norm
+ /*Calculate the corresponding norm */
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;
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->HPS); opj_free(wtfilty->HPS); opj_free(wtfiltz->HPS);
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;
}
if (tccp->qntsty == J3D_CCP_QNTSTY_NOQNT) {
stepsize = 1.0;
} 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;
}
- //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]);
}
}
return a;\r
}\r
\r
-#endif // !_WIN32\r
+#endif /* !_WIN32 */\r
\r
/* ----------------------------------------------------------------------- */\r
\r
int correction = 3;\r
double tmpwmsedec;\r
type = ((bpno < (cblk->numbps - 4)) && (passtype < 2) && (cblksty & J3D_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;\r
- //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);\r
+ /*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);*/\r
\r
switch (passtype) {\r
case 0:\r
t1_enc_refpass(t1, w, h, l, bpno, &nmsedec, type, cblksty);\r
break;\r
case 2:\r
- //fprintf(stdout,"w %d h %d l %d bpno %d orient %d \n",w,h,l,bpno,orient);\r
+ /*fprintf(stdout,"w %d h %d l %d bpno %d orient %d \n",w,h,l,bpno,orient);*/\r
t1_enc_clnpass(t1, w, h, l, bpno, orient, &nmsedec, cblksty);\r
/* code switch SEGMARK (i.e. SEGSYM) */\r
if (cblksty & J3D_CCP_CBLKSTY_SEGSYM)\r
/* destroy MQC and RAW handles */\r
mqc_destroy(t1->mqc);\r
raw_destroy(t1->raw);\r
- //opj_free(t1->data);\r
- //opj_free(t1->flags);\r
+ /*opj_free(t1->data);*/\r
+ /*opj_free(t1->flags);*/\r
opj_free(t1);\r
}\r
}\r
int n=0;\r
int level[3];\r
FILE *fid = NULL;\r
-// char filename[10];\r
+/* char filename[10];*/\r
tile->distotile = 0; /* fixed_quality */\r
\r
for (compno = 0; compno < tile->numcomps; compno++) {\r
for (cblkno = 0; cblkno < prc->cblkno[0] * prc->cblkno[1] * prc->cblkno[2]; cblkno++) {\r
opj_tcd_cblk_t *cblk = &prc->cblks[cblkno];\r
\r
- //fprintf(stdout,"Precno %d Cblkno %d \n",precno,cblkno);\r
+ /*fprintf(stdout,"Precno %d Cblkno %d \n",precno,cblkno);*/\r
if (band->bandno == 0) {\r
x = cblk->x0 - band->x0;\r
y = cblk->y0 - band->y0;\r
for (i = 0; i < cblk->x1 - cblk->x0; i++) {\r
t1->data[k][j][i] = \r
tilec->data[(x + i) + (y + j) * (tilec->x1 - tilec->x0) + (z + k) * (tilec->x1 - tilec->x0) * (tilec->y1 - tilec->y0)] << T1_NMSEDEC_FRACBITS;\r
-//fprintf(fid," %d",t1->data[k][j][i]);\r
+/*fprintf(fid," %d",t1->data[k][j][i]);*/\r
}\r
}\r
}\r
}\r
for (i = 0; i < 3; i++) \r
level[i] = tilec->numresolution[i] - 1 - resno;\r
- //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);\r
+ /*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);*/\r
t1_encode_cblk(t1, cblk, orient, compno, level, tcp->tccps[compno].dwtid, band->stepsize, tcp->tccps[compno].cblksty, tile->numcomps, tile);\r
\r
} /* cblkno */\r
} /* precno */\r
-//fprintf(fid,"\n");\r
+/*fprintf(fid,"\n");*/\r
} /* bandno */\r
-//fclose(fid);\r
+/*fclose(fid);*/\r
} /* resno */\r
} /* compno */\r
}\r
}\r
w2 = dwt_getnorm(orient, level, dwtid);\r
\r
- //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);\r
+ /*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);*/\r
wmsedec = w1 * w2 * stepsize * (1 << bpno);\r
wmsedec *= wmsedec * nmsedec / 8192.0;\r
\r
\r
static int t1_3d_getctxno_sc(unsigned int f) {\r
return t1_3d_init_ctxno_sc((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN));\r
- //return t1->lut_ctxno_sc[((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN)) >> 4];\r
+ /*return t1->lut_ctxno_sc[((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN)) >> 4];*/\r
}\r
\r
static int t1_3d_getctxno_mag(unsigned int f, int fsvr) {\r
\r
static int t1_3d_getspb(unsigned int f) {\r
return t1_3d_init_spb((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN));\r
- //return t1->lut_spb[((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN)) >> 4];\r
+ /*return t1->lut_spb[((f & T1_3D_SIG_PRIM) | ((f >> 16) & T1_3D_SGN)) >> 4];*/\r
}\r
\r
static int t1_3d_getnmsedec_sig(opj_t1_3d_t *t1, int x, int bitpos) {\r
+ ((f & T1_3D_SIG_BNW) != 0) + ((f & T1_3D_SIG_BNE) != 0) + ((f & T1_3D_SIG_BSE) != 0) + ((f & T1_3D_SIG_BSW) != 0);\r
\r
switch (orient) {\r
- case 0: //LLL\r
- case 7: //HHH\r
+ case 0: /*LLL*/\r
+ case 7: /*HHH*/\r
hvc = h + v + c;\r
d2 = d2xy + d2xz + d2yz;\r
if (!hvc) {\r
n = 15;\r
}\r
break;\r
- //LHL, HLL, LLH\r
+ /*LHL, HLL, LLH*/\r
case 1:\r
case 2:\r
case 4:\r
n = (!d2xy2yz) ? ((!d3) ? 0 : 1) : ((!d3) ? 2 : 3); \r
} else if (d2xy == 1) {\r
n = (!d2xy2yz) ? ((!d3) ? 4 : 5) : 6; \r
- } else { //>=2\r
+ } else { /*>=2*/\r
n = 7;\r
}\r
} else {\r
- n = (v == 1) ? 8 : 9; // =1 or =2\r
+ n = (v == 1) ? 8 : 9; /* =1 or =2*/\r
} \r
} else if (hc == 1) {\r
n = (!v) ? ( (!d2xy) ? ( (!d2xy2yz) ? ( (!d3) ? 10 : 11) : (12) ) : (13) ) : (14);\r
- } else { //if (hc >= 2)\r
+ } else { /*if (hc >= 2)*/\r
n = 15;\r
}\r
break;\r
- //HLH, HHL, LHH\r
+ /*HLH, HHL, LHH*/\r
case 3:\r
case 5:\r
case 6:\r
n = (!d3) ? 0 : 1;\r
} else if (hc == 1) {\r
n = (!d2xy2xz) ? 2 : 3;\r
- } else { //if >= 2\r
+ } else { /*if >= 2*/\r
n = 4;\r
}\r
} else if ( d2xz>=1 && !hc ) {\r
n = (!hc) ? 10 : 11;\r
} else if (d2xz == 2) {\r
n = (!hc) ? 12 : 13;\r
- } else { // if (d2xz >= 3) {\r
+ } else { /* if (d2xz >= 3) {*/\r
n = 14;\r
}\r
} else if (v == 2) {\r
\r
static int t1_3d_init_ctxno_mag(unsigned int f, int f2) {\r
int n;\r
- if (!(f2 & T1_3D_REFINE)) //First refinement for this coefficient (no previous refinement)\r
+ if (!(f2 & T1_3D_REFINE)) /*First refinement for this coefficient (no previous refinement)*/\r
n = (f & (T1_3D_SIG_PRIM)) ? 1 : 0;\r
else\r
n = 2;\r
\r
orient = band->bandno; /* FIXME */\r
\r
- //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);\r
+ /*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);*/\r
t1_3d_decode_cblk(t1, cblk, orient, tcp->tccps[compno].roishift, tcp->tccps[compno].cblksty);\r
\r
if (band->bandno == 0) {\r
while (pi_next(&pi[pino])) {\r
if (pi[pino].layno < maxlayers) {\r
e = t2_encode_packet(tile, &cp->tcps[tileno], &pi[pino], c, dest + len - c, volume_info, tileno, cp);\r
- //opj_event_msg(t2->cinfo, EVT_INFO, " t2_encode_packet: %d bytes coded\n",e);\r
+ /*opj_event_msg(t2->cinfo, EVT_INFO, " t2_encode_packet: %d bytes coded\n",e);*/\r
if (e == -999) {\r
break;\r
} else {\r
p = tree->numleafsh * tree->numleafsv * tree->numleafsz;\r
p0 = p;\r
n = 0;\r
- //fprintf(stdout,"\nH %d V %d Z %d numlvls %d nodes %d\n",tree->numleafsh,tree->numleafsv,tree->numleafsz,numlvls,tree->numnodes);\r
+ /*fprintf(stdout,"\nH %d V %d Z %d numlvls %d nodes %d\n",tree->numleafsh,tree->numleafsv,tree->numleafsz,numlvls,tree->numnodes);*/\r
for (i = 0; i < numlvls - 1; ++i) {\r
for (j = 0; j < nplv[i]; ++j) {\r
k = nplh[i]*nplz[i];\r
while (--k >= 0) {\r
- node->parent = parentnode; //fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);\r
+ node->parent = parentnode; /*fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);*/\r
++node; ++n; \r
if (--k >= 0 && n < p) {\r
- node->parent = parentnode; //fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);\r
+ node->parent = parentnode; /*fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);*/\r
++node; ++n; \r
}\r
- if (nplz[i] != 1){ //2D operation vs 3D operation\r
+ if (nplz[i] != 1){ /*2D operation vs 3D operation*/\r
if (--k >= 0 && n < p) {\r
- node->parent = parentnode; //fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);\r
+ node->parent = parentnode; /*fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);*/\r
++node; ++n;\r
}\r
if (--k >= 0 && n < p) {\r
- node->parent = parentnode; //fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);\r
+ node->parent = parentnode; /*fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);*/\r
++node; ++n;\r
}\r
}\r
++parentnode; ++p;\r
}\r
if ((j & 1) || j == nplv[i] - 1) {\r
- parentnode0 = parentnode; p0 = p; //fprintf(stdout,"parent = node[%d] \n",p);\r
+ parentnode0 = parentnode; p0 = p; /*fprintf(stdout,"parent = node[%d] \n",p);*/\r
} else {\r
- parentnode = parentnode0; p = p0; //fprintf(stdout,"parent = node[%d] \n",p);\r
+ parentnode = parentnode0; p = p0; /*fprintf(stdout,"parent = node[%d] \n",p);*/\r
parentnode0 += nplh[i]*nplz[i]; p0 += nplh[i]*nplz[i];\r
}\r
}\r
opj_volume_destroy(volume);\r
return NULL;\r
}\r
- //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);\r
+ /*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);*/\r
}\r
}\r
\r