Browse Source

fixed static init

Originally committed as revision 1799 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Fabrice Bellard 23 years ago
parent
commit
59cf08ce90
3 changed files with 19 additions and 16 deletions
  1. +17
    -15
      libavcodec/dsputil.c
  2. +1
    -0
      libavcodec/dsputil.h
  3. +1
    -1
      libavcodec/utils.c

+ 17
- 15
libavcodec/dsputil.c View File

@@ -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)


+ 1
- 0
libavcodec/dsputil.h View File

@@ -245,6 +245,7 @@ typedef struct DSPContext {

} DSPContext;

void dsputil_static_init(void);
void dsputil_init(DSPContext* p, AVCodecContext *avctx);

/**


+ 1
- 1
libavcodec/utils.c View File

@@ -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 */


Loading…
Cancel
Save