diff options
author | Zdenek Kabelac <kabi@informatics.muni.cz> | 2002-11-12 10:01:27 +0000 |
---|---|---|
committer | Zdenek Kabelac <kabi@informatics.muni.cz> | 2002-11-12 10:01:27 +0000 |
commit | 5abd509acd8db563899847588932864c975fb1cf (patch) | |
tree | e9f81e383417d42132ce087f2410d1cd10f74266 /libavcodec | |
parent | 4555345704bf51847077624868f7522b4561e86d (diff) | |
download | ffmpeg-5abd509acd8db563899847588932864c975fb1cf.tar.gz |
* init table once
Originally committed as revision 1203 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dsputil.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index e5ff56903f..62051e467f 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -1344,16 +1344,20 @@ static void clear_blocks_c(DCTELEM *blocks) void dsputil_init(DSPContext* c, unsigned mask) { + static int init_done = 0; int i; - for(i=0;i<256;i++) cropTbl[i + MAX_NEG_CROP] = i; - for(i=0;i<MAX_NEG_CROP;i++) { - cropTbl[i] = 0; - cropTbl[i + MAX_NEG_CROP + 256] = 255; - } + if (!init_done) { + for(i=0;i<256;i++) cropTbl[i + MAX_NEG_CROP] = i; + for(i=0;i<MAX_NEG_CROP;i++) { + cropTbl[i] = 0; + cropTbl[i + MAX_NEG_CROP + 256] = 255; + } - for(i=0;i<512;i++) { - squareTbl[i] = (i - 256) * (i - 256); + for(i=0;i<512;i++) { + squareTbl[i] = (i - 256) * (i - 256); + } + init_done = 1; } c->get_pixels = get_pixels_c; |