]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dct-test.c
dct-test: perform emms before gettime().
[ffmpeg] / libavcodec / dct-test.c
index 3a6ab96e3987a206baebdd6e60a325214138bd88..f85bccb4206379f35174020f23eeda067e51986f 100644 (file)
@@ -74,17 +74,11 @@ struct algo {
     int nonspec;
 };
 
-#ifndef FAAN_POSTSCALE
-#define FAAN_SCALE SCALE_PERM
-#else
-#define FAAN_SCALE NO_PERM
-#endif
-
 static int cpu_flags;
 
 static const struct algo fdct_tab[] = {
     { "REF-DBL",        ff_ref_fdct,           NO_PERM    },
-    { "FAAN",           ff_faandct,            FAAN_SCALE },
+    { "FAAN",           ff_faandct,            NO_PERM    },
     { "IJG-AAN-INT",    ff_fdct_ifast,         SCALE_PERM },
     { "IJG-LLM-INT",    ff_jpeg_fdct_islow_8,  NO_PERM    },
 
@@ -105,11 +99,11 @@ static const struct algo fdct_tab[] = {
     { 0 }
 };
 
-#if HAVE_MMX
+#if HAVE_MMX && HAVE_YASM
 void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
                                 DCTELEM *block, int16_t *qmat);
 
-static void ff_prores_idct_put_10_sse2_wrap(uint16_t *dst){
+static void ff_prores_idct_put_10_sse2_wrap(DCTELEM *dst){
     int16_t qmat[64]; int i;
     int16_t tmp[64];
 
@@ -136,7 +130,7 @@ static const struct algo idct_tab[] = {
     { "XVID-MMX",       ff_idct_xvid_mmx,      NO_PERM,   AV_CPU_FLAG_MMX,  1 },
     { "XVID-MMX2",      ff_idct_xvid_mmx2,     NO_PERM,   AV_CPU_FLAG_MMX2, 1 },
     { "XVID-SSE2",      ff_idct_xvid_sse2,     SSE2_PERM, AV_CPU_FLAG_SSE2, 1 },
-#if ARCH_X86_64
+#if ARCH_X86_64 && HAVE_YASM
     { "PR-SSE2",        ff_prores_idct_put_10_sse2_wrap,     TRANSPOSE_PERM, AV_CPU_FLAG_SSE2, 1 },
 #endif
 #endif
@@ -357,10 +351,10 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c
             memcpy(block, block1, sizeof(block));
             dct->func(block);
         }
+        mmx_emms();
         it1 += NB_ITS_SPEED;
         ti1 = gettime() - ti;
     } while (ti1 < 1000000);
-    mmx_emms();
 
     printf("%s %s: %0.1f kdct/s\n", is_idct ? "IDCT" : "DCT", dct->name,
            (double) it1 * 1000.0 / (double) ti1);
@@ -518,10 +512,10 @@ static void idct248_error(const char *name,
                 block[i] = block1[i];
             idct248_put(img_dest, 8, block);
         }
+        mmx_emms();
         it1 += NB_ITS_SPEED;
         ti1 = gettime() - ti;
     } while (ti1 < 1000000);
-    mmx_emms();
 
     printf("%s %s: %0.1f kdct/s\n", 1 ? "IDCT248" : "DCT248", name,
            (double) it1 * 1000.0 / (double) ti1);