diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2016-05-23 10:25:55 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2016-05-23 11:53:53 +0200 |
| commit | 93f7f907117675cf6af227b4d0243a58f6c3640a (patch) | |
| tree | bb9fbbfc4be8a34f6503b29ba7976b24bbc6f359 /src/lib/openjp2 | |
| parent | 1da397e94a4e441a7c9a1aa4c2debd1c06ba05e2 (diff) | |
opj_t1_decode_cblks(): tiny perf increase when loop unrolling
Diffstat (limited to 'src/lib/openjp2')
| -rw-r--r-- | src/lib/openjp2/t1.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/openjp2/t1.c b/src/lib/openjp2/t1.c index 9ad6ffd0..89a7ff85 100644 --- a/src/lib/openjp2/t1.c +++ b/src/lib/openjp2/t1.c @@ -1559,7 +1559,18 @@ OPJ_BOOL opj_t1_decode_cblks( opj_t1_t* t1, if (tccp->qmfbid == 1) { OPJ_INT32* restrict tiledp = &tilec->data[(OPJ_UINT32)y * tile_w + (OPJ_UINT32)x]; for (j = 0; j < cblk_h; ++j) { - for (i = 0; i < cblk_w; ++i) { + i = 0; + for (; i < (cblk_w & ~3); i += 4) { + OPJ_INT32 tmp0 = datap[(j * cblk_w) + i]; + OPJ_INT32 tmp1 = datap[(j * cblk_w) + i+1]; + OPJ_INT32 tmp2 = datap[(j * cblk_w) + i+2]; + OPJ_INT32 tmp3 = datap[(j * cblk_w) + i+3]; + ((OPJ_INT32*)tiledp)[(j * tile_w) + i] = tmp0/2; + ((OPJ_INT32*)tiledp)[(j * tile_w) + i+1] = tmp1/2; + ((OPJ_INT32*)tiledp)[(j * tile_w) + i+2] = tmp2/2; + ((OPJ_INT32*)tiledp)[(j * tile_w) + i+3] = tmp3/2; + } + for (; i < cblk_w; ++i) { OPJ_INT32 tmp = datap[(j * cblk_w) + i]; ((OPJ_INT32*)tiledp)[(j * tile_w) + i] = tmp/2; } |
