comparison dct-test.c @ 6543:948d9453432b libavcodec

check mm_flags for each DCT and skips the ones that can't be run patch by Alexander Strange %astrange A ithinksw P com%
author gpoirier
date Sun, 30 Mar 2008 10:29:28 +0000
parents d90bb7b51588
children 8a059debc2ba
comparison
equal deleted inserted replaced
6542:d90bb7b51588 6543:948d9453432b
72 char *name; 72 char *name;
73 enum { FDCT, IDCT } is_idct; 73 enum { FDCT, IDCT } is_idct;
74 void (* func) (DCTELEM *block); 74 void (* func) (DCTELEM *block);
75 void (* ref) (DCTELEM *block); 75 void (* ref) (DCTELEM *block);
76 enum formattag { NO_PERM,MMX_PERM, MMX_SIMPLE_PERM, SCALE_PERM } format; 76 enum formattag { NO_PERM,MMX_PERM, MMX_SIMPLE_PERM, SCALE_PERM } format;
77 int mm_support;
77 }; 78 };
78 79
79 #ifndef FAAN_POSTSCALE 80 #ifndef FAAN_POSTSCALE
80 #define FAAN_SCALE SCALE_PERM 81 #define FAAN_SCALE SCALE_PERM
81 #else 82 #else
91 {"REF-DBL", 1, idct, idct, NO_PERM}, 92 {"REF-DBL", 1, idct, idct, NO_PERM},
92 {"INT", 1, j_rev_dct, idct, MMX_PERM}, 93 {"INT", 1, j_rev_dct, idct, MMX_PERM},
93 {"SIMPLE-C", 1, ff_simple_idct, idct, NO_PERM}, 94 {"SIMPLE-C", 1, ff_simple_idct, idct, NO_PERM},
94 95
95 #ifdef HAVE_MMX 96 #ifdef HAVE_MMX
96 {"MMX", 0, ff_fdct_mmx, fdct, NO_PERM}, 97 {"MMX", 0, ff_fdct_mmx, fdct, NO_PERM, MM_MMX},
97 #ifdef HAVE_MMX2 98 #ifdef HAVE_MMX2
98 {"MMX2", 0, ff_fdct_mmx2, fdct, NO_PERM}, 99 {"MMX2", 0, ff_fdct_mmx2, fdct, NO_PERM, MM_MMXEXT},
99 #endif 100 #endif
100 101
101 #ifdef CONFIG_GPL 102 #ifdef CONFIG_GPL
102 {"LIBMPEG2-MMX", 1, ff_mmx_idct, idct, MMX_PERM}, 103 {"LIBMPEG2-MMX", 1, ff_mmx_idct, idct, MMX_PERM, MM_MMX},
103 {"LIBMPEG2-MMXEXT", 1, ff_mmxext_idct, idct, MMX_PERM}, 104 {"LIBMPEG2-MMXEXT", 1, ff_mmxext_idct, idct, MMX_PERM, MM_MMXEXT},
104 #endif 105 #endif
105 {"SIMPLE-MMX", 1, ff_simple_idct_mmx, idct, MMX_SIMPLE_PERM}, 106 {"SIMPLE-MMX", 1, ff_simple_idct_mmx, idct, MMX_SIMPLE_PERM, MM_MMX},
106 {"XVID-MMX", 1, ff_idct_xvid_mmx, idct, NO_PERM}, 107 {"XVID-MMX", 1, ff_idct_xvid_mmx, idct, NO_PERM, MM_MMX},
107 {"XVID-MMX2", 1, ff_idct_xvid_mmx2, idct, NO_PERM}, 108 {"XVID-MMX2", 1, ff_idct_xvid_mmx2, idct, NO_PERM, MM_MMXEXT},
108 #endif 109 #endif
109 110
110 #ifdef HAVE_ALTIVEC 111 #ifdef HAVE_ALTIVEC
111 {"altivecfdct", 0, fdct_altivec, fdct, NO_PERM}, 112 {"altivecfdct", 0, fdct_altivec, fdct, NO_PERM, MM_ALTIVEC},
112 #endif 113 #endif
113 114
114 #ifdef ARCH_BFIN 115 #ifdef ARCH_BFIN
115 {"BFINfdct", 0, ff_bfin_fdct, fdct, NO_PERM}, 116 {"BFINfdct", 0, ff_bfin_fdct, fdct, NO_PERM},
116 {"BFINidct", 1, ff_bfin_idct, idct, NO_PERM}, 117 {"BFINidct", 1, ff_bfin_idct, idct, NO_PERM},
560 561
561 if (test_248_dct) { 562 if (test_248_dct) {
562 idct248_error("SIMPLE-C", ff_simple_idct248_put); 563 idct248_error("SIMPLE-C", ff_simple_idct248_put);
563 } else { 564 } else {
564 for (i=0;algos[i].name;i++) 565 for (i=0;algos[i].name;i++)
565 if (algos[i].is_idct == test_idct) { 566 if (algos[i].is_idct == test_idct && !(~mm_flags & algos[i].mm_support)) {
566 dct_error (algos[i].name, algos[i].is_idct, algos[i].func, algos[i].ref, algos[i].format, test); 567 dct_error (algos[i].name, algos[i].is_idct, algos[i].func, algos[i].ref, algos[i].format, test);
567 } 568 }
568 } 569 }
569 return 0; 570 return 0;
570 } 571 }