\r
static void j3d_write_cox(opj_j3d_t *j3d, int compno) {\r
int i;\r
+ int shift = 2;\r
\r
opj_cp_t *cp = j3d->cp;\r
opj_tcp_t *tcp = &cp->tcps[j3d->curtileno];\r
cio_write(cio, tccp->numresolution[1] - 1, 1); /* SPcox (E) No of decomposition levels in y-axis*/\r
cio_write(cio, tccp->numresolution[2] - 1, 1); /* SPcox (F) No of decomposition levels in z-axis*/\r
}\r
+ if (j3d->cinfo->codec_format == CODEC_J3D) {\r
+ /* Table A.7 */\r
+ shift = 0;\r
+ }\r
/* (cblkw - 2) + (cblkh - 2) + (cblkl - 2) <= 18*/\r
- cio_write(cio, tccp->cblk[0] - 2, 1); /* SPcox (G) Cblk width entre 10 y 2 (8 y 0)*/\r
- cio_write(cio, tccp->cblk[1] - 2, 1); /* SPcox (H) Cblk height*/\r
+ cio_write(cio, tccp->cblk[0] - shift, 1); /* SPcox (G) Cblk width entre 10 y 2 (8 y 0)*/\r
+ cio_write(cio, tccp->cblk[1] - shift, 1); /* SPcox (H) Cblk height*/\r
if (j3d->cinfo->codec_format == CODEC_J3D) {\r
- cio_write(cio, tccp->cblk[2] - 2, 1); /* SPcox (I) Cblk depth*/\r
+ cio_write(cio, tccp->cblk[2] - shift, 1); /* SPcox (I) Cblk depth*/\r
}\r
cio_write(cio, tccp->cblksty, 1); /* SPcox (J) Cblk style*/\r
cio_write(cio, tccp->dwtid[0], 1); /* SPcox (K) WT in x-axis 15444-2 Table A10*/\r
\r
static void j3d_read_cox(opj_j3d_t *j3d, int compno) {\r
int i;\r
+ int shift = 2;\r
\r
opj_cp_t *cp = j3d->cp;\r
opj_tcp_t *tcp = j3d->state == J3D_STATE_TPH ? &cp->tcps[j3d->curtileno] : j3d->default_tcp;\r
cp->reduce[1] = int_min((tccp->numresolution[1])-1, cp->reduce[1]);\r
cp->reduce[2] = int_min((tccp->numresolution[2])-1, cp->reduce[2]);\r
\r
- tccp->cblk[0] = cio_read(cio, 1) + 2; /* SPcox (G) */\r
- tccp->cblk[1] = cio_read(cio, 1) + 2; /* SPcox (H) */\r
+ if (j3d->cinfo->codec_format == CODEC_J3D) {\r
+ /* Table A.7 */\r
+ shift = 0;\r
+ }\r
+ tccp->cblk[0] = cio_read(cio, 1) + shift; /* SPcox (G) */\r
+ tccp->cblk[1] = cio_read(cio, 1) + shift; /* SPcox (H) */\r
if (j3d->cinfo->codec_format == CODEC_J3D)\r
- tccp->cblk[2] = cio_read(cio, 1) + 2; /* SPcox (I) */\r
+ tccp->cblk[2] = cio_read(cio, 1) + shift; /* SPcox (I) */\r
else\r
tccp->cblk[2] = tccp->cblk[0];\r
\r