int jpc_tsfb_synthesize(jpc_tsfb_t *tsfb, jas_seq2d_t *a) { return (tsfb->numlvls > 0) ? jpc_tsfb_synthesize2(tsfb, jas_seq2d_getref(a, jas_seq2d_xstart(a), jas_seq2d_ystart(a)), jas_seq2d_xstart(a), jas_seq2d_ystart(a), jas_seq2d_width(a), jas_seq2d_height(a), jas_seq2d_rowstep(a), tsfb->numlvls - 1) : 0; }
static void jpc_tsfbnode_synthesize(jpc_tsfbnode_t *node, int flags, jas_seq2d_t *x) { jpc_tsfbnodeband_t nodebands[JPC_TSFB_MAXBANDSPERNODE]; int numbands; jas_seq2d_t *y; int bandno; jpc_tsfbnodeband_t *band; if (node->numchildren > 0) { qmfb2d_getbands(node->hqmfb, node->vqmfb, jas_seq2d_xstart(x), jas_seq2d_ystart(x), jas_seq2d_xend(x), jas_seq2d_yend(x), JPC_TSFB_MAXBANDSPERNODE, &numbands, nodebands); y = jas_seq2d_create(0, 0, 0, 0); for (bandno = 0, band = nodebands; bandno < numbands; ++bandno, ++band) { if (node->children[bandno]) { if (band->xstart != band->xend && band->ystart != band->yend) { jas_seq2d_bindsub(y, x, band->locxstart, band->locystart, band->locxend, band->locyend); jas_seq2d_setshift(y, band->xstart, band->ystart); jpc_tsfbnode_synthesize(node->children[bandno], flags, y); } } } jas_seq2d_destroy(y); } if (node->hqmfb) { jpc_qmfb1d_synthesize(node->hqmfb, flags, x); } if (node->vqmfb) { jpc_qmfb1d_synthesize(node->vqmfb, flags | JPC_QMFB1D_VERT, x); } }
static void jpc_tsfbnode_synthesize(jpc_tsfbnode_t *node, int flags, jas_seq2d_t *x) { jpc_tsfbnodeband_t nodebands[JPC_TSFB_MAXBANDSPERNODE]; int numbands; jas_seq2d_t *y; int bandno; jpc_tsfbnodeband_t *band; if (node->numchildren > 0) { jas_matrix_t org; qmfb2d_getbands( node->hqmfb, node->vqmfb, jas_seq2d_xstart(x), jas_seq2d_ystart(x), jas_seq2d_xend(x), jas_seq2d_yend(x), JPC_TSFB_MAXBANDSPERNODE, &numbands, nodebands ); y = &org; memset( y, 0, sizeof(org)); for (bandno = 0, band = nodebands; bandno < numbands; ++bandno, ++band) { if (node->children[bandno]) { if (band->xstart != band->xend && band->ystart != band->yend) { jas_seq2d_bindsub( y, x, band->locxstart, band->locystart, band->locxend, band->locyend ); jas_seq2d_setshift( y, band->xstart, band->ystart ); jpc_tsfbnode_synthesize( node->children[bandno], flags, y ); } } } } if (node->hqmfb) { (*(node->hqmfb)->ops->synthesize)(node->hqmfb, flags, x); } if (node->vqmfb) { (*(node->vqmfb)->ops->synthesize)(node->vqmfb, flags | JPC_QMFB1D_VERT, x); } }