summaryrefslogtreecommitdiff
path: root/src/lib/openjp2/t1.c
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-08-18 15:08:51 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-08-18 15:08:51 +0200
commit5d403250561398f7ba3041d9eb8c893bd680dd72 (patch)
treef0da191cd421b212901c8e982d021649f9d60e2c /src/lib/openjp2/t1.c
parent028c504a43e962a725c4fd73d6642ee73c653e1b (diff)
Subtile decoding: only do 5x3 IDWT computations on relevant areas of tile-component buffer.
This lowers 'bin/opj_decompress -i ../MAPA.jp2 -o out.tif -d 0,0,256,256' down to 0.860s
Diffstat (limited to 'src/lib/openjp2/t1.c')
-rw-r--r--src/lib/openjp2/t1.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/openjp2/t1.c b/src/lib/openjp2/t1.c
index 760b9ab1..15e166f2 100644
--- a/src/lib/openjp2/t1.c
+++ b/src/lib/openjp2/t1.c
@@ -1802,7 +1802,7 @@ void opj_t1_decode_cblks(opj_tcd_t* tcd,
/* TODO: remove this once we don't iterate over */
/* tile pixels that are not in the subwindow of interest */
- OPJ_UINT32 j, i;
+ OPJ_UINT32 j;
OPJ_INT32 x = cblk->x0 - band->x0;
OPJ_INT32 y = cblk->y0 - band->y0;
OPJ_INT32* OPJ_RESTRICT tiledp;
@@ -1823,9 +1823,7 @@ void opj_t1_decode_cblks(opj_tcd_t* tcd,
(OPJ_UINT32)x];
for (j = 0; j < cblk_h; ++j) {
- for (i = 0; i < cblk_w; ++i) {
- ((OPJ_INT32*)tiledp)[(j * tile_w) + i] = 0;
- }
+ memset(tiledp + j * tile_w, 0, cblk_w * sizeof(OPJ_INT32));
}
continue;
}