Mercurial > libavcodec.hg
changeset 1201:e0fc95a6eb4e libavcodec
fixed static init
author | bellard |
---|---|
date | Sun, 20 Apr 2003 16:16:52 +0000 |
parents | b448d7c17215 |
children | 8b49a7ee4e4e |
files | dsputil.c dsputil.h utils.c |
diffstat | 3 files changed, 19 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/dsputil.c Sun Apr 20 16:15:43 2003 +0000 +++ b/dsputil.c Sun Apr 20 16:16:52 2003 +0000 @@ -2489,26 +2489,28 @@ add_pixels_clamped_c(block, dest, line_size); } -void dsputil_init(DSPContext* c, AVCodecContext *avctx) +/* init static data */ +void dsputil_static_init(void) { - static int init_done = 0; int i; - 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<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<64; i++) inv_zigzag_direct16[ff_zigzag_direct[i]]= i+1; +} - for(i=0;i<512;i++) { - squareTbl[i] = (i - 256) * (i - 256); - } - for(i=0; i<64; i++) inv_zigzag_direct16[ff_zigzag_direct[i]]= i+1; - - init_done = 1; - } +void dsputil_init(DSPContext* c, AVCodecContext *avctx) +{ + int i; #ifdef CONFIG_ENCODERS if(avctx->dct_algo==FF_DCT_FASTINT)