Mercurial > libavcodec.hg
comparison dct-test.c @ 8223:d2a146706bc5 libavcodec
Do not duplicate AAN DCT tables in dct-test.c.
author | diego |
---|---|
date | Fri, 28 Nov 2008 00:32:24 +0000 |
parents | b95fd961d507 |
children | cf4d575b1982 |
comparison
equal
deleted
inserted
replaced
8222:f7f2d7a2f611 | 8223:d2a146706bc5 |
---|---|
33 #include <math.h> | 33 #include <math.h> |
34 | 34 |
35 #include "libavutil/common.h" | 35 #include "libavutil/common.h" |
36 | 36 |
37 #include "simple_idct.h" | 37 #include "simple_idct.h" |
38 #include "aandcttab.h" | |
38 #include "faandct.h" | 39 #include "faandct.h" |
39 #include "faanidct.h" | 40 #include "faanidct.h" |
40 #include "i386/idct_xvid.h" | 41 #include "i386/idct_xvid.h" |
41 | 42 |
42 #undef printf | 43 #undef printf |
118 | 119 |
119 { 0 } | 120 { 0 } |
120 }; | 121 }; |
121 | 122 |
122 #define AANSCALE_BITS 12 | 123 #define AANSCALE_BITS 12 |
123 static const unsigned short aanscales[64] = { | |
124 /* precomputed values scaled up by 14 bits */ | |
125 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, | |
126 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, | |
127 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, | |
128 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, | |
129 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, | |
130 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, | |
131 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, | |
132 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 | |
133 }; | |
134 | 124 |
135 uint8_t cropTbl[256 + 2 * MAX_NEG_CROP]; | 125 uint8_t cropTbl[256 + 2 * MAX_NEG_CROP]; |
136 | 126 |
137 int64_t gettime(void) | 127 int64_t gettime(void) |
138 { | 128 { |
261 fdct_func(block); | 251 fdct_func(block); |
262 mmx_emms(); | 252 mmx_emms(); |
263 | 253 |
264 if (form == SCALE_PERM) { | 254 if (form == SCALE_PERM) { |
265 for(i=0; i<64; i++) { | 255 for(i=0; i<64; i++) { |
266 scale = 8*(1 << (AANSCALE_BITS + 11)) / aanscales[i]; | 256 scale = 8*(1 << (AANSCALE_BITS + 11)) / ff_aanscales[i]; |
267 block[i] = (block[i] * scale /*+ (1<<(AANSCALE_BITS-1))*/) >> AANSCALE_BITS; | 257 block[i] = (block[i] * scale /*+ (1<<(AANSCALE_BITS-1))*/) >> AANSCALE_BITS; |
268 } | 258 } |
269 } | 259 } |
270 | 260 |
271 fdct_ref(block1); | 261 fdct_ref(block1); |