Mercurial > libavcodec.hg
comparison dsputil.c @ 860:a5f228481000 libavcodec
* init table once
author | kabi |
---|---|
date | Tue, 12 Nov 2002 10:01:27 +0000 |
parents | 9512471dec40 |
children | 243cc33da3eb |
comparison
equal
deleted
inserted
replaced
859:9512471dec40 | 860:a5f228481000 |
---|---|
1342 memset(blocks, 0, sizeof(DCTELEM)*6*64); | 1342 memset(blocks, 0, sizeof(DCTELEM)*6*64); |
1343 } | 1343 } |
1344 | 1344 |
1345 void dsputil_init(DSPContext* c, unsigned mask) | 1345 void dsputil_init(DSPContext* c, unsigned mask) |
1346 { | 1346 { |
1347 static int init_done = 0; | |
1347 int i; | 1348 int i; |
1348 | 1349 |
1349 for(i=0;i<256;i++) cropTbl[i + MAX_NEG_CROP] = i; | 1350 if (!init_done) { |
1350 for(i=0;i<MAX_NEG_CROP;i++) { | 1351 for(i=0;i<256;i++) cropTbl[i + MAX_NEG_CROP] = i; |
1351 cropTbl[i] = 0; | 1352 for(i=0;i<MAX_NEG_CROP;i++) { |
1352 cropTbl[i + MAX_NEG_CROP + 256] = 255; | 1353 cropTbl[i] = 0; |
1353 } | 1354 cropTbl[i + MAX_NEG_CROP + 256] = 255; |
1354 | 1355 } |
1355 for(i=0;i<512;i++) { | 1356 |
1356 squareTbl[i] = (i - 256) * (i - 256); | 1357 for(i=0;i<512;i++) { |
1358 squareTbl[i] = (i - 256) * (i - 256); | |
1359 } | |
1360 init_done = 1; | |
1357 } | 1361 } |
1358 | 1362 |
1359 c->get_pixels = get_pixels_c; | 1363 c->get_pixels = get_pixels_c; |
1360 c->diff_pixels = diff_pixels_c; | 1364 c->diff_pixels = diff_pixels_c; |
1361 c->put_pixels_clamped = put_pixels_clamped_c; | 1365 c->put_pixels_clamped = put_pixels_clamped_c; |