diff options
| author | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-04-05 14:24:19 +0000 |
|---|---|---|
| committer | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-04-05 14:24:19 +0000 |
| commit | 0930d9886b52a4d4f46162cc0c7c292cfd393ebd (patch) | |
| tree | 797451546350afcc39411a2af7dd514d58b3232b /libopenjpeg/t1.c | |
| parent | dd18811600365adc935a5f72d985bac43a01377f (diff) | |
fix.h, dwt.c and t1.c optimized. Thanks a lot to Dzonatas <dzonatas at dzonux.net> and Callum Lerwick <seg at haxxed.com> for these great patches !
Diffstat (limited to 'libopenjpeg/t1.c')
| -rw-r--r-- | libopenjpeg/t1.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/libopenjpeg/t1.c b/libopenjpeg/t1.c index 85e5bbcf..2fbdd54a 100644 --- a/libopenjpeg/t1.c +++ b/libopenjpeg/t1.c @@ -543,12 +543,9 @@ static void t1_encode_cblk(opj_t1_t *t1, opj_tcd_cblk_t * cblk, int orient, int cblk->numbps = max ? (int_floorlog2(max) + 1) - T1_NMSEDEC_FRACBITS : 0; - /* Changed by Dmitry Kolyadin */ - for (i = 0; i <= w; i++) { - for (j = 0; j <= h; j++) { - t1->flags[j][i] = 0; - } - } + for (i = 0; i <= h; ++i) { + memset(&t1->flags[i], 0, (w+1) * sizeof(int)); + } bpno = cblk->numbps - 1; passtype = 2; @@ -653,7 +650,7 @@ static void t1_encode_cblk(opj_t1_t *t1, opj_tcd_cblk_t * cblk, int orient, int } static void t1_decode_cblk(opj_t1_t *t1, opj_tcd_cblk_t * cblk, int orient, int roishift, int cblksty) { - int i, j, w, h; + int i, w, h; int bpno, passtype; int segno, passno; char type = T1_TYPE_MQ; /* BYPASS mode */ @@ -664,19 +661,13 @@ static void t1_decode_cblk(opj_t1_t *t1, opj_tcd_cblk_t * cblk, int orient, int w = cblk->x1 - cblk->x0; h = cblk->y1 - cblk->y0; - /* Changed by Dmitry Kolyadin */ - for (j = 0; j <= h; j++) { - for (i = 0; i <= w; i++) { - t1->flags[j][i] = 0; - } - } + for (i = 0; i <= h; ++i) { + memset(&t1->flags[i], 0, (w + 1) * sizeof(int)); + } - /* Changed by Dmitry Kolyadin */ - for (i = 0; i < w; i++) { - for (j = 0; j < h; j++){ - t1->data[j][i] = 0; - } - } + for (i = 0; i < h; ++i) { + memset(&t1->data[i], 0, w * sizeof(int)); + } bpno = roishift + cblk->numbps - 1; passtype = 2; |
