aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2003-04-20 16:16:52 +0000
committerFabrice Bellard <fabrice@bellard.org>2003-04-20 16:16:52 +0000
commit59cf08ce90abec5a5f88cc077e7ade5f89c4c18c (patch)
treead3008c2e1f87f2848804b7220eefa23221354fc
parentfab219971e9d532bb9aac0134331b760bc90cb69 (diff)
downloadffmpeg-59cf08ce90abec5a5f88cc077e7ade5f89c4c18c.tar.gz
fixed static init
Originally committed as revision 1799 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/dsputil.c32
-rw-r--r--libavcodec/dsputil.h1
-rw-r--r--libavcodec/utils.c2
3 files changed, 19 insertions, 16 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 146a657dd6..b9a5f1382c 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -2489,26 +2489,28 @@ static void ff_jref_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
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<512;i++) {
- squareTbl[i] = (i - 256) * (i - 256);
- }
+ 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<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)
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index cb539545c3..376e06293f 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -245,6 +245,7 @@ typedef struct DSPContext {
} DSPContext;
+void dsputil_static_init(void);
void dsputil_init(DSPContext* p, AVCodecContext *avctx);
/**
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 5e1fbee173..156ceddd20 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -555,7 +555,7 @@ void avcodec_init(void)
return;
inited = 1;
- //dsputil_init();
+ dsputil_static_init();
}
/* this can be called after seeking and before trying to decode the next keyframe */