diff options
| author | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2005-05-24 12:15:52 +0000 |
|---|---|---|
| committer | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2005-05-24 12:15:52 +0000 |
| commit | f9eb8f93c29679657d539b8d17e56d889d816a2e (patch) | |
| tree | abeb258d7d3afc005d30afa66b087ccaee00213d /libopenjpeg | |
| parent | d54925f777745b0f9389dfed90136088d84dc38b (diff) | |
Code optimization: t1_flags and t1_data set to zero with memset
Diffstat (limited to 'libopenjpeg')
| -rw-r--r-- | libopenjpeg/t1.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libopenjpeg/t1.c b/libopenjpeg/t1.c index be79c436..f5513ba4 100644 --- a/libopenjpeg/t1.c +++ b/libopenjpeg/t1.c @@ -37,6 +37,7 @@ #include <stdio.h> #include <math.h> #include <stdlib.h> +#include <memory.h> #define T1_MAXCBLKW 1024 #define T1_MAXCBLKH 1024 @@ -573,8 +574,8 @@ void t1_encode_cblk(tcd_cblk_t * cblk, int orient, int compno, int level, int qm cblk->numbps = max ? (int_floorlog2(max) + 1) - T1_NMSEDEC_FRACBITS : 0; - for (i = 0; i < sizeof(t1_flags) / sizeof(int); i++) - ((int *) t1_flags)[i] = 0; + memset(t1_flags,0,sizeof(t1_flags)); + bpno = cblk->numbps - 1; passtype = 2; @@ -677,16 +678,13 @@ void t1_encode_cblk(tcd_cblk_t * cblk, int orient, int compno, int level, int qm void t1_decode_cblk(tcd_cblk_t * cblk, int orient, int roishift, int cblksty) { - int i; int w, h; int bpno, passtype; int segno, passno; char type = T1_TYPE_MQ; //BYPASS mode - - for (i = 0; i < sizeof(t1_data) / sizeof(int); i++) - ((int *) t1_data)[i] = 0; - for (i = 0; i < sizeof(t1_flags) / sizeof(int); i++) - ((int *) t1_flags)[i] = 0; + + memset(t1_data,0,sizeof(t1_data)); + memset(t1_flags,0,sizeof(t1_flags)); w = cblk->x1 - cblk->x0; h = cblk->y1 - cblk->y0; |
