]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dct-test.c
dca: Move data tables from a header to an object file
[ffmpeg] / libavcodec / dct-test.c
index 979fc0b1849f342ecce338180fda634147a3c5f9..f337576836edfccc1c0888d5cd3198a4554d7de8 100644 (file)
@@ -42,6 +42,7 @@
 #include "dct.h"
 #include "idctdsp.h"
 #include "simple_idct.h"
+#include "xvididct.h"
 #include "aandcttab.h"
 #include "faandct.h"
 #include "faanidct.h"
@@ -55,18 +56,25 @@ struct algo {
     int nonspec;
 };
 
-static const struct algo fdct_tab[4] = {
+static const struct algo fdct_tab[] = {
     { "REF-DBL",     ff_ref_fdct,          FF_IDCT_PERM_NONE },
-    { "FAAN",        ff_faandct,           FF_IDCT_PERM_NONE },
     { "IJG-AAN-INT", ff_fdct_ifast,        FF_IDCT_PERM_NONE },
     { "IJG-LLM-INT", ff_jpeg_fdct_islow_8, FF_IDCT_PERM_NONE },
+#if CONFIG_FAANDCT
+    { "FAAN",        ff_faandct,           FF_IDCT_PERM_NONE },
+#endif /* CONFIG_FAANDCT */
 };
 
-static const struct algo idct_tab[4] = {
-    { "FAANI",       ff_faanidct,          FF_IDCT_PERM_NONE },
+static const struct algo idct_tab[] = {
     { "REF-DBL",     ff_ref_idct,          FF_IDCT_PERM_NONE },
     { "INT",         ff_j_rev_dct,         FF_IDCT_PERM_LIBMPEG2 },
     { "SIMPLE-C",    ff_simple_idct_8,     FF_IDCT_PERM_NONE },
+#if CONFIG_FAANIDCT
+    { "FAANI",       ff_faanidct,          FF_IDCT_PERM_NONE },
+#endif /* CONFIG_FAANIDCT */
+#if CONFIG_MPEG4_DECODER
+    { "XVID",        ff_xvid_idct,         FF_IDCT_PERM_NONE, 0, 1 },
+#endif /* CONFIG_MPEG4_DECODER */
 };
 
 #if ARCH_ARM
@@ -223,7 +231,7 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed)
     init_block(block, test, is_idct, &prng);
     permute(block1, block, dct->perm_type);
 
-    ti = av_gettime();
+    ti = av_gettime_relative();
     it1 = 0;
     do {
         for (it = 0; it < NB_ITS_SPEED; it++) {
@@ -231,7 +239,7 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed)
             dct->func(block);
         }
         it1 += NB_ITS_SPEED;
-        ti1 = av_gettime() - ti;
+        ti1 = av_gettime_relative() - ti;
     } while (ti1 < 1000000);
     emms_c();
 
@@ -364,7 +372,7 @@ static void idct248_error(const char *name,
     if (!speed)
         return;
 
-    ti = av_gettime();
+    ti = av_gettime_relative();
     it1 = 0;
     do {
         for (it = 0; it < NB_ITS_SPEED; it++) {
@@ -373,7 +381,7 @@ static void idct248_error(const char *name,
             idct248_put(img_dest, 8, block);
         }
         it1 += NB_ITS_SPEED;
-        ti1 = av_gettime() - ti;
+        ti1 = av_gettime_relative() - ti;
     } while (ti1 < 1000000);
     emms_c();
 
@@ -443,7 +451,9 @@ int main(int argc, char **argv)
             for (i = 0; idct_tab_arch[i].name; i++)
                 if (!(~cpu_flags & idct_tab_arch[i].cpu_flag))
                     err |= dct_error(&idct_tab_arch[i], test, test_idct, speed);
-        } else {
+        }
+#if CONFIG_FDCTDSP
+        else {
             for (i = 0; i < FF_ARRAY_ELEMS(fdct_tab); i++)
                 err |= dct_error(&fdct_tab[i], test, test_idct, speed);
 
@@ -451,6 +461,7 @@ int main(int argc, char **argv)
                 if (!(~cpu_flags & fdct_tab_arch[i].cpu_flag))
                     err |= dct_error(&fdct_tab_arch[i], test, test_idct, speed);
         }
+#endif /* CONFIG_FDCTDSP */
     }
 
     if (err)