[trunk] JP3D: completely redo the opj_tgt_create function. Take as input the initial opj_tgt_create as found in openjpeg 1.5, and extend with the 3rd dimension.
This commit is contained in:
parent
c075742bc8
commit
8c9151c86b
|
@ -68,6 +68,7 @@ opj_tgt_tree_t *tgt_create(int numleafsh, int numleafsv, int numleafsz) {
|
||||||
opj_tgt_node_t *node = NULL;
|
opj_tgt_node_t *node = NULL;
|
||||||
opj_tgt_node_t *parentnode = NULL;
|
opj_tgt_node_t *parentnode = NULL;
|
||||||
opj_tgt_node_t *parentnode0 = NULL;
|
opj_tgt_node_t *parentnode0 = NULL;
|
||||||
|
opj_tgt_node_t *parentnode1 = NULL;
|
||||||
opj_tgt_tree_t *tree = NULL;
|
opj_tgt_tree_t *tree = NULL;
|
||||||
int i, j, k, p, p0;
|
int i, j, k, p, p0;
|
||||||
int numlvls;
|
int numlvls;
|
||||||
|
@ -108,38 +109,32 @@ opj_tgt_tree_t *tgt_create(int numleafsh, int numleafsv, int numleafsz) {
|
||||||
node = tree->nodes;
|
node = tree->nodes;
|
||||||
parentnode = &tree->nodes[tree->numleafsh * tree->numleafsv * tree->numleafsz];
|
parentnode = &tree->nodes[tree->numleafsh * tree->numleafsv * tree->numleafsz];
|
||||||
parentnode0 = parentnode;
|
parentnode0 = parentnode;
|
||||||
|
parentnode1 = parentnode;
|
||||||
p = tree->numleafsh * tree->numleafsv * tree->numleafsz;
|
|
||||||
p0 = p;
|
|
||||||
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 (z = 0; z < nplz[i]; ++z) {
|
||||||
k = nplh[i]*nplz[i];
|
for (j = 0; j < nplv[i]; ++j) {
|
||||||
while (--k >= 0) {
|
k = nplh[i];
|
||||||
node->parent = parentnode; /*fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);*/
|
while(--k >= 0) {
|
||||||
++node; ++n;
|
node->parent = parentnode; /*fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);*/
|
||||||
if (--k >= 0 && n < p) {
|
++node;
|
||||||
node->parent = parentnode; /*fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);*/
|
if(--k >= 0) {
|
||||||
++node; ++n;
|
|
||||||
}
|
|
||||||
if (nplz[i] != 1){ /*2D operation vs 3D operation*/
|
|
||||||
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;
|
||||||
}
|
|
||||||
if (--k >= 0 && n < p) {
|
|
||||||
node->parent = parentnode; /*fprintf(stdout,"node[%d].parent = node[%d]\n",n,p);*/
|
|
||||||
++node; ++n;
|
|
||||||
}
|
}
|
||||||
|
++parentnode;
|
||||||
|
}
|
||||||
|
if((j & 1) || j == nplv[i] - 1) {
|
||||||
|
parentnode0 = parentnode;
|
||||||
|
} else {
|
||||||
|
parentnode = parentnode0;
|
||||||
}
|
}
|
||||||
++parentnode; ++p;
|
|
||||||
}
|
}
|
||||||
if ((j & 1) || j == nplv[i] - 1) {
|
if ((z & 1) || z == nplz[i] - 1) {
|
||||||
parentnode0 = parentnode; p0 = p; /*fprintf(stdout,"parent = node[%d] \n",p);*/
|
parentnode1 = parentnode;
|
||||||
} else {
|
} else {
|
||||||
parentnode = parentnode0; p = p0; /*fprintf(stdout,"parent = node[%d] \n",p);*/
|
parentnode0 = parentnode1;
|
||||||
parentnode0 += nplh[i]*nplz[i]; p0 += nplh[i]*nplz[i];
|
parentnode = parentnode1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue