Commit 5abd509a authored by Zdenek Kabelac's avatar Zdenek Kabelac

* init table once

Originally committed as revision 1203 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 45553457
...@@ -1344,8 +1344,10 @@ static void clear_blocks_c(DCTELEM *blocks) ...@@ -1344,8 +1344,10 @@ static void clear_blocks_c(DCTELEM *blocks)
void dsputil_init(DSPContext* c, unsigned mask) void dsputil_init(DSPContext* c, unsigned mask)
{ {
static int init_done = 0;
int i; int i;
if (!init_done) {
for(i=0;i<256;i++) cropTbl[i + MAX_NEG_CROP] = i; for(i=0;i<256;i++) cropTbl[i + MAX_NEG_CROP] = i;
for(i=0;i<MAX_NEG_CROP;i++) { for(i=0;i<MAX_NEG_CROP;i++) {
cropTbl[i] = 0; cropTbl[i] = 0;
...@@ -1355,6 +1357,8 @@ void dsputil_init(DSPContext* c, unsigned mask) ...@@ -1355,6 +1357,8 @@ void dsputil_init(DSPContext* c, unsigned mask)
for(i=0;i<512;i++) { for(i=0;i<512;i++) {
squareTbl[i] = (i - 256) * (i - 256); squareTbl[i] = (i - 256) * (i - 256);
} }
init_done = 1;
}
c->get_pixels = get_pixels_c; c->get_pixels = get_pixels_c;
c->diff_pixels = diff_pixels_c; c->diff_pixels = diff_pixels_c;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment