base64-test: Remove posibility of returning restricted exit codes
[libav.git] / libavcodec / dct-test.c
CommitLineData
04d7f601
DB
1/*
2 * (c) 2001 Fabrice Bellard
3ac35bdb 3 * 2007 Marc Hoffman <marc.hoffman@analog.com>
04d7f601 4 *
2912e87a 5 * This file is part of Libav.
b78e7197 6 *
2912e87a 7 * Libav is free software; you can redistribute it and/or
04d7f601
DB
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
b78e7197 10 * version 2.1 of the License, or (at your option) any later version.
04d7f601 11 *
2912e87a 12 * Libav is distributed in the hope that it will be useful,
04d7f601
DB
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
2912e87a 18 * License along with Libav; if not, write to the Free Software
04d7f601
DB
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
983e3246 22/**
ba87f080 23 * @file
94f694a4 24 * DCT test (c) 2001 Fabrice Bellard
983e3246
MN
25 * Started from sample code by Juan J. Sierralta P.
26 */
27
667fb97a 28#include "config.h"
de6d9b64
FB
29#include <stdlib.h>
30#include <stdio.h>
31#include <string.h>
667fb97a 32#if HAVE_UNISTD_H
de6d9b64 33#include <unistd.h>
667fb97a 34#endif
12807c8d 35#include <math.h>
de6d9b64 36
c6c98d08 37#include "libavutil/cpu.h"
ae32e509 38#include "libavutil/common.h"
294eaa26 39#include "libavutil/lfg.h"
980f81d9 40#include "libavutil/time.h"
de6d9b64 41
5d3d39c7 42#include "dct.h"
86748dbc 43#include "simple_idct.h"
10ac3618 44#include "aandcttab.h"
65e4c8c9 45#include "faandct.h"
6f08c541 46#include "faanidct.h"
a6493a8f 47#include "x86/idct_xvid.h"
6a813295 48#include "dctref.h"
9e1586fc 49
434df899
MN
50#undef printf
51
3ac35bdb 52// BFIN
88bd7fdc
DB
53void ff_bfin_idct(int16_t *block);
54void ff_bfin_fdct(int16_t *block);
3ac35bdb
MH
55
56// ALTIVEC
88bd7fdc 57void ff_fdct_altivec(int16_t *block);
3ac35bdb 58
479044ce 59// ARM
88bd7fdc
DB
60void ff_j_rev_dct_arm(int16_t *data);
61void ff_simple_idct_arm(int16_t *data);
62void ff_simple_idct_armv5te(int16_t *data);
63void ff_simple_idct_armv6(int16_t *data);
64void ff_simple_idct_neon(int16_t *data);
3ac35bdb 65
88bd7fdc 66void ff_simple_idct_axp(int16_t *data);
2a839eeb 67
3ac35bdb 68struct algo {
36fa9ef3 69 const char *name;
88bd7fdc 70 void (*func)(int16_t *block);
36fa9ef3
MR
71 enum formattag { NO_PERM, MMX_PERM, MMX_SIMPLE_PERM, SCALE_PERM,
72 SSE2_PERM, PARTTRANS_PERM } format;
73 int mm_support;
dbf396d4 74 int nonspec;
3ac35bdb
MH
75};
76
aadd27cd
MN
77static int cpu_flags;
78
4b357756 79static const struct algo fdct_tab[] = {
74965f26 80 { "REF-DBL", ff_ref_fdct, NO_PERM },
856c8e0a 81 { "FAAN", ff_faandct, NO_PERM },
3e2efacd 82 { "IJG-AAN-INT", ff_fdct_ifast, SCALE_PERM },
0a72533e 83 { "IJG-LLM-INT", ff_jpeg_fdct_islow_8, NO_PERM },
3ac35bdb 84
17337f54 85#if HAVE_MMX_INLINE
74965f26 86 { "MMX", ff_fdct_mmx, NO_PERM, AV_CPU_FLAG_MMX },
0b8b2ae5
DB
87#endif
88#if HAVE_MMXEXT_INLINE
d8eda370 89 { "MMXEXT", ff_fdct_mmxext, NO_PERM, AV_CPU_FLAG_MMXEXT },
0b8b2ae5
DB
90#endif
91#if HAVE_SSE2_INLINE
74965f26 92 { "SSE2", ff_fdct_sse2, NO_PERM, AV_CPU_FLAG_SSE2 },
94254fc0 93#endif
3ac35bdb 94
4b357756 95#if HAVE_ALTIVEC
07333750 96 { "altivecfdct", ff_fdct_altivec, NO_PERM, AV_CPU_FLAG_ALTIVEC },
4b357756
MR
97#endif
98
99#if ARCH_BFIN
74965f26 100 { "BFINfdct", ff_bfin_fdct, NO_PERM },
4b357756
MR
101#endif
102
103 { 0 }
104};
105
106static const struct algo idct_tab[] = {
74965f26
MR
107 { "FAANI", ff_faanidct, NO_PERM },
108 { "REF-DBL", ff_ref_idct, NO_PERM },
c8e1b2fb 109 { "INT", ff_j_rev_dct, MMX_PERM },
e7a972e1 110 { "SIMPLE-C", ff_simple_idct_8, NO_PERM },
4b357756 111
17337f54 112#if HAVE_MMX_INLINE
74965f26
MR
113 { "SIMPLE-MMX", ff_simple_idct_mmx, MMX_SIMPLE_PERM, AV_CPU_FLAG_MMX },
114 { "XVID-MMX", ff_idct_xvid_mmx, NO_PERM, AV_CPU_FLAG_MMX, 1 },
0b8b2ae5
DB
115#endif
116#if HAVE_MMXEXT_INLINE
d8eda370 117 { "XVID-MMXEXT", ff_idct_xvid_mmxext, NO_PERM, AV_CPU_FLAG_MMXEXT, 1 },
0b8b2ae5
DB
118#endif
119#if HAVE_SSE2_INLINE
74965f26 120 { "XVID-SSE2", ff_idct_xvid_sse2, SSE2_PERM, AV_CPU_FLAG_SSE2, 1 },
3ac35bdb
MH
121#endif
122
b250f9c6 123#if ARCH_BFIN
74965f26 124 { "BFINidct", ff_bfin_idct, NO_PERM },
3ac35bdb
MH
125#endif
126
b250f9c6 127#if ARCH_ARM
74965f26
MR
128 { "SIMPLE-ARM", ff_simple_idct_arm, NO_PERM },
129 { "INT-ARM", ff_j_rev_dct_arm, MMX_PERM },
4b357756 130#endif
b250f9c6 131#if HAVE_ARMV5TE
c29d49c1 132 { "SIMPLE-ARMV5TE", ff_simple_idct_armv5te,NO_PERM, AV_CPU_FLAG_ARMV5TE },
479044ce 133#endif
b250f9c6 134#if HAVE_ARMV6
c29d49c1 135 { "SIMPLE-ARMV6", ff_simple_idct_armv6, MMX_PERM, AV_CPU_FLAG_ARMV6 },
479044ce 136#endif
b250f9c6 137#if HAVE_NEON
c29d49c1 138 { "SIMPLE-NEON", ff_simple_idct_neon, PARTTRANS_PERM, AV_CPU_FLAG_NEON },
479044ce 139#endif
479044ce 140
2a839eeb 141#if ARCH_ALPHA
74965f26 142 { "SIMPLE-ALPHA", ff_simple_idct_axp, NO_PERM },
2a839eeb
MR
143#endif
144
36fa9ef3 145 { 0 }
3ac35bdb
MH
146};
147
de6d9b64 148#define AANSCALE_BITS 12
de6d9b64 149
de6d9b64
FB
150#define NB_ITS 20000
151#define NB_ITS_SPEED 50000
152
9e1586fc
FB
153static short idct_mmx_perm[64];
154
36fa9ef3
MR
155static short idct_simple_mmx_perm[64] = {
156 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
157 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D,
158 0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D,
159 0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F,
160 0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F,
161 0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D,
162 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F,
163 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
86748dbc
MN
164};
165
36fa9ef3 166static const uint8_t idct_sse2_row_perm[8] = { 0, 4, 1, 5, 2, 6, 3, 7 };
ad246860 167
504ffed1 168static void idct_mmx_init(void)
9e1586fc
FB
169{
170 int i;
171
172 /* the mmx/mmxext idct uses a reordered input, so we patch scan tables */
173 for (i = 0; i < 64; i++) {
bb270c08 174 idct_mmx_perm[i] = (i & 0x38) | ((i & 6) >> 1) | ((i & 1) << 2);
9e1586fc
FB
175 }
176}
177
88bd7fdc
DB
178DECLARE_ALIGNED(16, static int16_t, block)[64];
179DECLARE_ALIGNED(8, static int16_t, block1)[64];
9e1586fc 180
88bd7fdc 181static void init_block(int16_t block[64], int test, int is_idct, AVLFG *prng)
ae2e8971
MR
182{
183 int i, j;
184
185 memset(block, 0, 64 * sizeof(*block));
186
187 switch (test) {
188 case 0:
189 for (i = 0; i < 64; i++)
190 block[i] = (av_lfg_get(prng) % 512) - 256;
191 if (is_idct) {
192 ff_ref_fdct(block);
193 for (i = 0; i < 64; i++)
194 block[i] >>= 3;
195 }
196 break;
197 case 1:
198 j = av_lfg_get(prng) % 10 + 1;
199 for (i = 0; i < j; i++)
200 block[av_lfg_get(prng) % 64] = av_lfg_get(prng) % 512 - 256;
201 break;
202 case 2:
203 block[ 0] = av_lfg_get(prng) % 4096 - 2048;
204 block[63] = (block[0] & 1) ^ 1;
205 break;
206 }
207}
208
88bd7fdc 209static void permute(int16_t dst[64], const int16_t src[64], int perm)
ae2e8971
MR
210{
211 int i;
212
213 if (perm == MMX_PERM) {
214 for (i = 0; i < 64; i++)
215 dst[idct_mmx_perm[i]] = src[i];
216 } else if (perm == MMX_SIMPLE_PERM) {
217 for (i = 0; i < 64; i++)
218 dst[idct_simple_mmx_perm[i]] = src[i];
219 } else if (perm == SSE2_PERM) {
220 for (i = 0; i < 64; i++)
221 dst[(i & 0x38) | idct_sse2_row_perm[i & 7]] = src[i];
222 } else if (perm == PARTTRANS_PERM) {
223 for (i = 0; i < 64; i++)
224 dst[(i & 0x24) | ((i & 3) << 3) | ((i >> 3) & 3)] = src[i];
225 } else {
226 for (i = 0; i < 64; i++)
227 dst[i] = src[i];
228 }
229}
230
dbf396d4 231static int dct_error(const struct algo *dct, int test, int is_idct, int speed)
de6d9b64 232{
88bd7fdc 233 void (*ref)(int16_t *block) = is_idct ? ff_ref_idct : ff_ref_fdct;
de6d9b64 234 int it, i, scale;
de6d9b64 235 int err_inf, v;
dbf396d4 236 int64_t err2, ti, ti1, it1, err_sum = 0;
36fa9ef3
MR
237 int64_t sysErr[64], sysErrMax = 0;
238 int maxout = 0;
239 int blockSumErrMax = 0, blockSumErr;
64bde197 240 AVLFG prng;
dbf396d4
MR
241 double omse, ome;
242 int spec_err;
de6d9b64 243
64bde197 244 av_lfg_init(&prng, 1);
de6d9b64
FB
245
246 err_inf = 0;
247 err2 = 0;
36fa9ef3
MR
248 for (i = 0; i < 64; i++)
249 sysErr[i] = 0;
250 for (it = 0; it < NB_ITS; it++) {
ae2e8971
MR
251 init_block(block1, test, is_idct, &prng);
252 permute(block, block1, dct->format);
9e1586fc 253
4f905a65 254 dct->func(block);
db7d8fb4 255 emms_c();
9e1586fc 256
4f905a65 257 if (dct->format == SCALE_PERM) {
36fa9ef3
MR
258 for (i = 0; i < 64; i++) {
259 scale = 8 * (1 << (AANSCALE_BITS + 11)) / ff_aanscales[i];
260 block[i] = (block[i] * scale) >> AANSCALE_BITS;
86748dbc
MN
261 }
262 }
263
74965f26 264 ref(block1);
de6d9b64 265
36fa9ef3
MR
266 blockSumErr = 0;
267 for (i = 0; i < 64; i++) {
dbf396d4
MR
268 int err = block[i] - block1[i];
269 err_sum += err;
270 v = abs(err);
de6d9b64
FB
271 if (v > err_inf)
272 err_inf = v;
273 err2 += v * v;
bb270c08
DB
274 sysErr[i] += block[i] - block1[i];
275 blockSumErr += v;
36fa9ef3
MR
276 if (abs(block[i]) > maxout)
277 maxout = abs(block[i]);
de6d9b64 278 }
36fa9ef3
MR
279 if (blockSumErrMax < blockSumErr)
280 blockSumErrMax = blockSumErr;
86748dbc 281 }
36fa9ef3
MR
282 for (i = 0; i < 64; i++)
283 sysErrMax = FFMAX(sysErrMax, FFABS(sysErr[i]));
115329f1 284
36fa9ef3
MR
285 for (i = 0; i < 64; i++) {
286 if (i % 8 == 0)
287 printf("\n");
288 printf("%7d ", (int) sysErr[i]);
de6d9b64 289 }
86748dbc 290 printf("\n");
115329f1 291
dbf396d4
MR
292 omse = (double) err2 / NB_ITS / 64;
293 ome = (double) err_sum / NB_ITS / 64;
294
295 spec_err = is_idct && (err_inf > 1 || omse > 0.02 || fabs(ome) > 0.0015);
296
297 printf("%s %s: ppe=%d omse=%0.8f ome=%0.8f syserr=%0.8f maxout=%d blockSumErr=%d\n",
cf2b4f88 298 is_idct ? "IDCT" : "DCT", dct->name, err_inf,
dbf396d4 299 omse, ome, (double) sysErrMax / NB_ITS,
36fa9ef3 300 maxout, blockSumErrMax);
e6ff0648 301
dbf396d4
MR
302 if (spec_err && !dct->nonspec)
303 return 1;
304
7fd2c138 305 if (!speed)
dbf396d4 306 return 0;
7fd2c138 307
de6d9b64 308 /* speed test */
ae2e8971
MR
309 init_block(block, test, is_idct, &prng);
310 permute(block1, block, dct->format);
9e1586fc 311
980f81d9 312 ti = av_gettime();
de6d9b64
FB
313 it1 = 0;
314 do {
36fa9ef3 315 for (it = 0; it < NB_ITS_SPEED; it++) {
ae2e8971 316 memcpy(block, block1, sizeof(block));
4f905a65 317 dct->func(block);
de6d9b64
FB
318 }
319 it1 += NB_ITS_SPEED;
980f81d9 320 ti1 = av_gettime() - ti;
de6d9b64 321 } while (ti1 < 1000000);
db7d8fb4 322 emms_c();
de6d9b64 323
cf2b4f88 324 printf("%s %s: %0.1f kdct/s\n", is_idct ? "IDCT" : "DCT", dct->name,
36fa9ef3 325 (double) it1 * 1000.0 / (double) ti1);
dbf396d4
MR
326
327 return 0;
de6d9b64
FB
328}
329
c6727809
MR
330DECLARE_ALIGNED(8, static uint8_t, img_dest)[64];
331DECLARE_ALIGNED(8, static uint8_t, img_dest1)[64];
a46a3ce4 332
504ffed1 333static void idct248_ref(uint8_t *dest, int linesize, int16_t *block)
a46a3ce4
FB
334{
335 static int init;
336 static double c8[8][8];
337 static double c4[4][4];
338 double block1[64], block2[64], block3[64];
339 double s, sum, v;
340 int i, j, k;
341
342 if (!init) {
343 init = 1;
344
36fa9ef3 345 for (i = 0; i < 8; i++) {
a46a3ce4 346 sum = 0;
36fa9ef3
MR
347 for (j = 0; j < 8; j++) {
348 s = (i == 0) ? sqrt(1.0 / 8.0) : sqrt(1.0 / 4.0);
a46a3ce4
FB
349 c8[i][j] = s * cos(M_PI * i * (j + 0.5) / 8.0);
350 sum += c8[i][j] * c8[i][j];
351 }
352 }
115329f1 353
36fa9ef3 354 for (i = 0; i < 4; i++) {
a46a3ce4 355 sum = 0;
36fa9ef3
MR
356 for (j = 0; j < 4; j++) {
357 s = (i == 0) ? sqrt(1.0 / 4.0) : sqrt(1.0 / 2.0);
a46a3ce4
FB
358 c4[i][j] = s * cos(M_PI * i * (j + 0.5) / 4.0);
359 sum += c4[i][j] * c4[i][j];
360 }
361 }
362 }
363
364 /* butterfly */
652f0197 365 s = 0.5 * sqrt(2.0);
36fa9ef3
MR
366 for (i = 0; i < 4; i++) {
367 for (j = 0; j < 8; j++) {
368 block1[8 * (2 * i) + j] =
369 (block[8 * (2 * i) + j] + block[8 * (2 * i + 1) + j]) * s;
370 block1[8 * (2 * i + 1) + j] =
371 (block[8 * (2 * i) + j] - block[8 * (2 * i + 1) + j]) * s;
a46a3ce4
FB
372 }
373 }
374
375 /* idct8 on lines */
36fa9ef3
MR
376 for (i = 0; i < 8; i++) {
377 for (j = 0; j < 8; j++) {
a46a3ce4 378 sum = 0;
36fa9ef3
MR
379 for (k = 0; k < 8; k++)
380 sum += c8[k][j] * block1[8 * i + k];
381 block2[8 * i + j] = sum;
a46a3ce4
FB
382 }
383 }
384
385 /* idct4 */
36fa9ef3
MR
386 for (i = 0; i < 8; i++) {
387 for (j = 0; j < 4; j++) {
a46a3ce4
FB
388 /* top */
389 sum = 0;
36fa9ef3
MR
390 for (k = 0; k < 4; k++)
391 sum += c4[k][j] * block2[8 * (2 * k) + i];
392 block3[8 * (2 * j) + i] = sum;
a46a3ce4
FB
393
394 /* bottom */
395 sum = 0;
36fa9ef3
MR
396 for (k = 0; k < 4; k++)
397 sum += c4[k][j] * block2[8 * (2 * k + 1) + i];
398 block3[8 * (2 * j + 1) + i] = sum;
a46a3ce4
FB
399 }
400 }
401
402 /* clamp and store the result */
36fa9ef3
MR
403 for (i = 0; i < 8; i++) {
404 for (j = 0; j < 8; j++) {
405 v = block3[8 * i + j];
406 if (v < 0) v = 0;
407 else if (v > 255) v = 255;
408 dest[i * linesize + j] = (int) rint(v);
a46a3ce4
FB
409 }
410 }
411}
412
504ffed1 413static void idct248_error(const char *name,
36fa9ef3 414 void (*idct248_put)(uint8_t *dest, int line_size,
7fd2c138
MR
415 int16_t *block),
416 int speed)
a46a3ce4
FB
417{
418 int it, i, it1, ti, ti1, err_max, v;
64bde197 419 AVLFG prng;
294eaa26 420
64bde197 421 av_lfg_init(&prng, 1);
115329f1 422
a46a3ce4
FB
423 /* just one test to see if code is correct (precision is less
424 important here) */
425 err_max = 0;
36fa9ef3 426 for (it = 0; it < NB_ITS; it++) {
652f0197 427 /* XXX: use forward transform to generate values */
36fa9ef3 428 for (i = 0; i < 64; i++)
64bde197 429 block1[i] = av_lfg_get(&prng) % 256 - 128;
652f0197
FB
430 block1[0] += 1024;
431
36fa9ef3
MR
432 for (i = 0; i < 64; i++)
433 block[i] = block1[i];
a46a3ce4 434 idct248_ref(img_dest1, 8, block);
115329f1 435
36fa9ef3
MR
436 for (i = 0; i < 64; i++)
437 block[i] = block1[i];
652f0197 438 idct248_put(img_dest, 8, block);
115329f1 439
36fa9ef3
MR
440 for (i = 0; i < 64; i++) {
441 v = abs((int) img_dest[i] - (int) img_dest1[i]);
652f0197
FB
442 if (v == 255)
443 printf("%d %d\n", img_dest[i], img_dest1[i]);
444 if (v > err_max)
445 err_max = v;
446 }
a46a3ce4 447 }
36fa9ef3 448 printf("%s %s: err_inf=%d\n", 1 ? "IDCT248" : "DCT248", name, err_max);
a46a3ce4 449
7fd2c138
MR
450 if (!speed)
451 return;
452
980f81d9 453 ti = av_gettime();
a46a3ce4
FB
454 it1 = 0;
455 do {
36fa9ef3
MR
456 for (it = 0; it < NB_ITS_SPEED; it++) {
457 for (i = 0; i < 64; i++)
458 block[i] = block1[i];
a46a3ce4
FB
459 idct248_put(img_dest, 8, block);
460 }
461 it1 += NB_ITS_SPEED;
980f81d9 462 ti1 = av_gettime() - ti;
a46a3ce4 463 } while (ti1 < 1000000);
db7d8fb4 464 emms_c();
a46a3ce4 465
36fa9ef3
MR
466 printf("%s %s: %0.1f kdct/s\n", 1 ? "IDCT248" : "DCT248", name,
467 (double) it1 * 1000.0 / (double) ti1);
a46a3ce4
FB
468}
469
504ffed1 470static void help(void)
9e1586fc 471{
86748dbc
MN
472 printf("dct-test [-i] [<test-number>]\n"
473 "test-number 0 -> test with random matrixes\n"
474 " 1 -> test with random sparse matrixes\n"
475 " 2 -> do 3. test from mpeg4 std\n"
a46a3ce4 476 "-i test IDCT implementations\n"
7fd2c138
MR
477 "-4 test IDCT248 implementations\n"
478 "-t speed test\n");
9e1586fc
FB
479}
480
667fb97a
RB
481#if !HAVE_GETOPT
482#include "compat/getopt.c"
483#endif
484
de6d9b64
FB
485int main(int argc, char **argv)
486{
a46a3ce4 487 int test_idct = 0, test_248_dct = 0;
36fa9ef3
MR
488 int c, i;
489 int test = 1;
7fd2c138 490 int speed = 0;
dbf396d4 491 int err = 0;
36fa9ef3 492
c6c98d08 493 cpu_flags = av_get_cpu_flags();
9e1586fc 494
0de74546 495 ff_ref_dct_init();
9e1586fc 496 idct_mmx_init();
f67a10cd 497
36fa9ef3 498 for (;;) {
7fd2c138 499 c = getopt(argc, argv, "ih4t");
9e1586fc
FB
500 if (c == -1)
501 break;
36fa9ef3 502 switch (c) {
9e1586fc
FB
503 case 'i':
504 test_idct = 1;
505 break;
a46a3ce4
FB
506 case '4':
507 test_248_dct = 1;
508 break;
7fd2c138
MR
509 case 't':
510 speed = 1;
511 break;
36fa9ef3 512 default:
9e1586fc
FB
513 case 'h':
514 help();
c6bdc908 515 return 0;
9e1586fc
FB
516 }
517 }
115329f1 518
36fa9ef3
MR
519 if (optind < argc)
520 test = atoi(argv[optind]);
115329f1 521
f36b3902 522 printf("Libav DCT/IDCT test\n");
9e1586fc 523
a46a3ce4 524 if (test_248_dct) {
7fd2c138 525 idct248_error("SIMPLE-C", ff_simple_idct248_put, speed);
9e1586fc 526 } else {
4b357756 527 const struct algo *algos = test_idct ? idct_tab : fdct_tab;
36fa9ef3 528 for (i = 0; algos[i].name; i++)
4b357756 529 if (!(~cpu_flags & algos[i].mm_support)) {
dbf396d4 530 err |= dct_error(&algos[i], test, test_idct, speed);
36fa9ef3 531 }
9e1586fc 532 }
dbf396d4
MR
533
534 return err;
de6d9b64 535}