[FFmpeg-devel] [PATCH] Coremake support - ffmpeg_nommx.patch (1/1) - ffmpeg-nommx.patch (1/1)

Ronald S. Bultje rbultje
Mon May 21 15:40:19 CEST 2007


Hi,

In article <20070520202630.GU16391 at MichaelsNB>,
 Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, May 20, 2007 at 02:05:44PM -0400, Ronald S. Bultje wrote:
> [...]
> > Anyway, on to the relevant part of the patch for you. Attached, or if 
> > that doesn't work on 
> > http://people.freedesktop.org/~rbultje/ffmpeg_nommx.patch (still 
> > testing...), you'll find those parts of the patch that you referenced 
> > that I should submit separately. The patch does a bunch of things. First 
> > of all, the gains: it allows most of the tests to be compiled (by 
> > default, w/o mmx and w/o gpl). The changes that I made:
> > 
> > * most tests don't link to lav[ufc] and thus don't use av_log() but 
> > printf(). However, for utility macros, they do include avutil.h, and 
> > thus fail to compile b/c of the redefinition of av_log(). Thus, most 
> > tests need a #undef printf/fprintf to compile. Similar for malloc in 
> > swscale (last part of the patch).
> > * several tests reference mmx/gpl code w/o checking for whether this is 
> > enabled. Those parts have been marked with appropriate compile 
> > conditionals.
> > * as Mans suggested, emms -> emms_c
> > * in dsputil.c and dsputil_mmx.c/h264dsp_mmx.c, macros with the same 
> > names are used. dsptest.c in tests/ includes both of those, and thus the 
> > compile will give warnings. It's probably a good idea to #undef each of 
> > them or use similar names. Both already use #undefs internally several 
> > times for those variables (e.g. C[0-7]), since they're reused in various 
> > places with different values within the same files. I simply added 
> > #undefs at the end of where they're used also, so that multiple files 
> > can use the same macro names. H264_{WEIGHT,MC} same story.
> > * fastmemcpy buggage, see above, remove if unwanted (I don't care if it 
> > goes upstream, but I'll leave it in in my copy regardless).
> > * motion_test.c and dsptest.c had various API changes and I updated it 
> > for those API changes. Worksforme[tm].
> > 
> > It's various changes together, but all of it is needed to make the tests 
> > work, hence one big patch.
> 
> split it :)

Ok, how? I can submit several parts for the emms->emms_c, HAVE_GPL 
changes, those are very small, then the rest of the HAVE_MMX stuff and 
then API changes in various tests?

I took your comments for dct-test.c into account (less changes and not 
for tables / function declarations atop of the file). For the rest:

> > Index: ffmpeg/libavcodec/fft-test.c
> > ===================================================================
> > --- ffmpeg.orig/libavcodec/fft-test.c	2007-03-22 01:00:48.000000000 -0400
> > +++ ffmpeg/libavcodec/fft-test.c	2007-03-22 01:20:53.000000000 -0400
> > @@ -28,6 +28,9 @@
> >  #include <unistd.h>
> >  #include <sys/time.h>
> >  
> > +#undef fprintf
> > +#undef printf
> > +
> >  int mm_flags;
> >  
> >  /* reference fft */
> 
> there is no *printf in fft-test.c
> and ive not checked that the other undefs are needed but that must be checked
> before such changes can be accpeted also teh question remains why 
> HAVE_AV_CONFIG_H is defined at all for these files

In file included from dct-test.c:33:
dsputil.h: In function 'copy_block2':
dsputil.h:688: warning: implicit declaration of function 'ST16'
dsputil.h:688: warning: implicit declaration of function 'LD16'
dsputil.h: In function 'copy_block4':
dsputil.h:699: warning: implicit declaration of function 'ST32'
dsputil.h:699: warning: implicit declaration of function 'LD32'
dct-test.c: In function 'idct248_ref':
dct-test.c:333: warning: implicit declaration of function 'sqrt'
dct-test.c:333: warning: incompatible implicit declaration of built-in 
function 'sqrt'
dct-test.c:334: warning: implicit declaration of function 'cos'
dct-test.c:334: warning: incompatible implicit declaration of built-in 
function 'cos'
dct-test.c:334: error: 'M_PI' undeclared (first use in this function)
dct-test.c:334: error: (Each undeclared identifier is reported only once
dct-test.c:334: error: for each function it appears in.)
dct-test.c:342: warning: incompatible implicit declaration of built-in 
function 'sqrt'
dct-test.c:343: warning: incompatible implicit declaration of built-in 
function 'cos'
dct-test.c:350: warning: incompatible implicit declaration of built-in 
function 'sqrt'
dct-test.c:393: warning: implicit declaration of function 'rint'
dct-test.c:393: warning: incompatible implicit declaration of built-in 
function 'rint'

I can work around this by adding an include for math.h.

In file included from fft-test.c:26:
dsputil.h: In function 'copy_block2':
dsputil.h:688: warning: implicit declaration of function 'ST16'
dsputil.h:688: warning: implicit declaration of function 'LD16'
dsputil.h: In function 'copy_block4':
dsputil.h:699: warning: implicit declaration of function 'ST32'
dsputil.h:699: warning: implicit declaration of function 'LD32'
fft-test.c: In function 'frandom':
fft-test.c:129: warning: implicit declaration of function 'random'
fft-test.c: In function 'help':
fft-test.c:161: warning: implicit declaration of function 'exit'
fft-test.c:161: warning: incompatible implicit declaration of built-in 
function 'exit'
fft-test.c: In function 'main':
fft-test.c:198: warning: implicit declaration of function 'atoi'
fft-test.c:249: warning: implicit declaration of function 'memcpy'
fft-test.c:249: warning: incompatible implicit declaration of built-in 
function 'memcpy'
fft-test.c:276: warning: incompatible implicit declaration of built-in 
function 'memcpy'

I can work around this by adding includes for stdlib.h and string.h to 
fft-test.c.

apiexample / motion_test give the dsputil warnings for ST/LD16/32 but 
compile fine otherwise. I don't really know how to prevent the warnings, 
since dsputil.h is clearly a file that is internal and supposed to be 
used only internally (or well, such is my impression). So the fact that 
it used internal API seems normal. You probably don't want to obfuscate 
it with all sort of #ifdef HAVE_AV_CONFIG_H, do you? (I mean, I can just 
protect all copy_blockx() functions with it to make the warnings go 
away, but that's not a good idea.)

libswscale's cs_test compiles fine without, so removed that also. For 
all of the above, I could remove it.

dsptest in tests/ and cputest in lavc/i386/ can't be compiled, since 
they use internaly API (dsptest is about ten pages of warnings, so 
nevermind there), cputest is below:

cputest.c: In function 'mm_support':
cputest.c:83: error: 'MM_MMX' undeclared (first use in this function)
cputest.c:83: error: (Each undeclared identifier is reported only once
cputest.c:83: error: for each function it appears in.)
cputest.c:85: error: 'MM_MMXEXT' undeclared (first use in this function)
cputest.c:85: error: 'MM_SSE' undeclared (first use in this function)
cputest.c:87: error: 'MM_SSE2' undeclared (first use in this function)
cputest.c:89: error: 'MM_SSE3' undeclared (first use in this function)
cputest.c:91: error: 'MM_SSSE3' undeclared (first use in this function)
cputest.c:99: error: 'MM_3DNOW' undeclared (first use in this function)
cputest.c:101: error: 'MM_3DNOWEXT' undeclared (first use in this 
function)
cputest.c: In function 'main':
cputest.c:128: warning: implicit declaration of function 'printf'
cputest.c:128: warning: incompatible implicit declaration of built-in 
function 'printf'

I left those as-is.

> > Index: ffmpeg/libavcodec/i386/fdct_mmx.c
> > ===================================================================
> > --- ffmpeg.orig/libavcodec/i386/fdct_mmx.c	2007-03-22 01:00:40.000000000 
> > -0400
> > +++ ffmpeg/libavcodec/i386/fdct_mmx.c	2007-05-20 12:02:36.000000000 -0400
> > @@ -281,6 +281,13 @@
> >  #define C6 12299
> >  #define C7 6270
> >  TABLE_SSE2
> > +#undef C1
> > +#undef C2
> > +#undef C3
> > +#undef C4
> > +#undef C5
> > +#undef C6
> > +#undef C7
> >  }};
> 
> these dont seem to be #defined after the undef so what is this good for?

dsptest.c includes several .c files, each of which has these macros 
without undef'ing them the first time, i.e. assuming they're yet 
undeclared. This means if you include two such files, the second causes 
warnings because of redeclarations of all of those variables. undef'ing 
them at the end of the source file seems the right thing to do, at least 
in one of them. The same is true for the undef of the dspfunc, H264_MC 
and H264_WEIGHT elsewhere also. They all cause compile problems in 
dcttest.c.

> > Index: ffmpeg/libavcodec/imgresample.c
> > ===================================================================
> > --- ffmpeg.orig/libavcodec/imgresample.c	2007-03-22 01:00:47.000000000 
> > -0400
> > +++ ffmpeg/libavcodec/imgresample.c	2007-03-22 01:20:53.000000000 -0400
> > @@ -28,8 +28,10 @@
> >  #include "swscale.h"
> >  #include "dsputil.h"
> >  
> > -#ifdef USE_FASTMEMCPY
> > -#include "libvo/fastmemcpy.h"
> > +#ifdef TEST
> > +#undef printf
> > +#undef fprintf
> > +#define av_log(p,l,...) fprintf(stderr,__VA_ARGS__)
> 
> ugly

This is old, actually, I think imgresample.c is no longer used. This can 
probably be removed.

For reference, new patch attached. If you like it, I'll split it in 
whatever way you prefer and submit parts.

Ronald
Index: ffmpeg/libavcodec/dct-test.c
===================================================================
--- ffmpeg.orig/libavcodec/dct-test.c	2007-03-22 01:00:46.000000000 -0400
+++ ffmpeg/libavcodec/dct-test.c	2007-05-21 09:28:31.000000000 -0400
@@ -29,6 +29,7 @@
 #include <string.h>
 #include <sys/time.h>
 #include <unistd.h>
+#include <math.h>
 
 #include "dsputil.h"
 
@@ -39,8 +40,6 @@
 #define MAX(a, b)  (((a) > (b)) ? (a) : (b))
 #endif
 
-#undef printf
-
 void *fast_memcpy(void *a, const void *b, size_t c){return memcpy(a,b,c);};
 
 /* reference fdct/idct */
@@ -162,6 +161,11 @@
         for(i=0; i<64; i++)
             block_org[i]= block1[i];
 
+#ifndef HAVE_MMX
+#define ff_mmx_idct NULL
+#define ff_mmxext_idct NULL
+#define ff_simple_idct_mmx NULL
+#endif
         if (fdct_func == ff_mmx_idct ||
             fdct_func == j_rev_dct || fdct_func == ff_mmxext_idct) {
             for(i=0;i<64;i++)
@@ -169,7 +173,6 @@
         } else if(fdct_func == ff_simple_idct_mmx ) {
             for(i=0;i<64;i++)
                 block[idct_simple_mmx_perm[i]] = block1[i];
-
         } else {
             for(i=0; i<64; i++)
                 block[i]= block1[i];
@@ -184,7 +187,7 @@
 #endif
 
         fdct_func(block);
-        emms(); /* for ff_mmx_idct */
+        emms_c(); /* for ff_mmx_idct */
 
         if (fdct_func == fdct_ifast
 #ifndef FAAN_POSTSCALE
@@ -286,7 +289,7 @@
         it1 += NB_ITS_SPEED;
         ti1 = gettime() - ti;
     } while (ti1 < 1000000);
-    emms();
+    emms_c();
 
     printf("%s %s: %0.1f kdct/s\n",
            is_idct ? "IDCT" : "DCT",
@@ -446,7 +449,7 @@
         it1 += NB_ITS_SPEED;
         ti1 = gettime() - ti;
     } while (ti1 < 1000000);
-    emms();
+    emms_c();
 
     printf("%s %s: %0.1f kdct/s\n",
            1 ? "IDCT248" : "DCT248",
@@ -508,18 +511,24 @@
             dct_error("REF-DBL", 0, fdct, fdct, test); /* only to verify code ! */
             dct_error("IJG-AAN-INT", 0, fdct_ifast, fdct, test);
             dct_error("IJG-LLM-INT", 0, ff_jpeg_fdct_islow, fdct, test);
+#ifdef HAVE_MMX
             dct_error("MMX", 0, ff_fdct_mmx, fdct, test);
             dct_error("MMX2", 0, ff_fdct_mmx2, fdct, test);
+#endif
             dct_error("FAAN", 0, ff_faandct, fdct, test);
         } else {
             dct_error("REF-DBL", 1, idct, idct, test);
             dct_error("INT", 1, j_rev_dct, idct, test);
+            dct_error("SIMPLE-C", 1, simple_idct, idct, test);
+#ifdef HAVE_MMX
             dct_error("LIBMPEG2-MMX", 1, ff_mmx_idct, idct, test);
             dct_error("LIBMPEG2-MMXEXT", 1, ff_mmxext_idct, idct, test);
-            dct_error("SIMPLE-C", 1, simple_idct, idct, test);
             dct_error("SIMPLE-MMX", 1, ff_simple_idct_mmx, idct, test);
+#ifdef CONFIG_GPL
             dct_error("XVID-MMX", 1, ff_idct_xvid_mmx, idct, test);
             dct_error("XVID-MMX2", 1, ff_idct_xvid_mmx2, idct, test);
+#endif /* CONFIG_GPL */
+#endif /* HAVE_MMX */
             //        dct_error("ODIVX-C", 1, odivx_idct_c, idct);
             //printf(" test against odivx idct\n");
             //        dct_error("REF", 1, idct, odivx_idct_c);
Index: ffmpeg/libavcodec/fft-test.c
===================================================================
--- ffmpeg.orig/libavcodec/fft-test.c	2007-03-22 01:00:48.000000000 -0400
+++ ffmpeg/libavcodec/fft-test.c	2007-05-21 09:13:59.000000000 -0400
@@ -27,6 +27,8 @@
 #include <math.h>
 #include <unistd.h>
 #include <sys/time.h>
+#include <stdlib.h>
+#include <string.h>
 
 int mm_flags;
 
Index: ffmpeg/libavcodec/i386/cputest.c
===================================================================
--- ffmpeg.orig/libavcodec/i386/cputest.c	2007-03-22 01:00:40.000000000 -0400
+++ ffmpeg/libavcodec/i386/cputest.c	2007-03-22 01:20:53.000000000 -0400
@@ -120,6 +120,7 @@
 }
 
 #ifdef __TEST__
+#undef printf
 int main ( void )
 {
   int mm_flags;
Index: ffmpeg/libavcodec/i386/dsputil_mmx.c
===================================================================
--- ffmpeg.orig/libavcodec/i386/dsputil_mmx.c	2007-03-22 01:00:40.000000000 -0400
+++ ffmpeg/libavcodec/i386/dsputil_mmx.c	2007-05-20 @@ -3457,6 +3457,7 @@
             dspfunc(put_2tap_qpel, 1, 8);
             dspfunc(avg_2tap_qpel, 0, 16);
             dspfunc(avg_2tap_qpel, 1, 8);
+#undef dspfunc
 
             c->avg_h264_chroma_pixels_tab[0]= avg_h264_chroma_mc8_3dnow;
             c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_3dnow;
Index: ffmpeg/libavcodec/i386/fdct_mmx.c
===================================================================
--- ffmpeg.orig/libavcodec/i386/fdct_mmx.c	2007-03-22 01:00:40.000000000 -0400
+++ ffmpeg/libavcodec/i386/fdct_mmx.c	2007-05-20 12:02:36.000000000 -0400
@@ -281,6 +281,13 @@
 #define C6 12299
 #define C7 6270
 TABLE_SSE2
+#undef C1
+#undef C2
+#undef C3
+#undef C4
+#undef C5
+#undef C6
+#undef C7
 }};
 
 
Index: ffmpeg/libavcodec/i386/simple_idct_mmx.c
===================================================================
--- ffmpeg.orig/libavcodec/i386/simple_idct_mmx.c	2007-03-22 01:00:40.000000000 -0400
+++ ffmpeg/libavcodec/i386/simple_idct_mmx.c	2007-05-20 12:09:00.000000000 -0400
@@ -77,6 +77,14 @@
 
  C7, -C5,  C7, -C5,
  C3, -C1,  C3, -C1
+#undef C0
+#undef C1
+#undef C2
+#undef C3
+#undef C4
+#undef C5
+#undef C6
+#undef C7
 };
 
 #if 0
@@ -87,14 +95,6 @@
 
 static void inline idctCol (int16_t * col, int16_t *input)
 {
-#undef C0
-#undef C1
-#undef C2
-#undef C3
-#undef C4
-#undef C5
-#undef C6
-#undef C7
         int a0, a1, a2, a3, b0, b1, b2, b3;
         const int C0 = 23170; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
         const int C1 = 22725; //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
Index: ffmpeg/libavcodec/motion_test.c
===================================================================
--- ffmpeg.orig/libavcodec/motion_test.c	2007-03-22 01:00:50.000000000 -0400
+++ ffmpeg/libavcodec/motion_test.c	2007-05-21 09:06:35.000000000 -0400
@@ -31,24 +31,24 @@
 
 #include "dsputil.h"
 
+#ifdef HAVE_MMX
 #include "i386/mmx.h"
+#endif
 
-#undef printf
-
-int pix_abs16x16_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
-int pix_abs16x16_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
-int pix_abs16x16_c(uint8_t *blk1, uint8_t *blk2, int lx);
-int pix_abs16x16_x2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
-int pix_abs16x16_x2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
-int pix_abs16x16_x2_c(uint8_t *blk1, uint8_t *blk2, int lx);
-int pix_abs16x16_y2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
-int pix_abs16x16_y2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
-int pix_abs16x16_y2_c(uint8_t *blk1, uint8_t *blk2, int lx);
-int pix_abs16x16_xy2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
-int pix_abs16x16_xy2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
-int pix_abs16x16_xy2_c(uint8_t *blk1, uint8_t *blk2, int lx);
+int pix_abs16x16_mmx(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
+int pix_abs16x16_mmx1(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
+int pix_abs16x16_c(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
+int pix_abs16x16_x2_mmx(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
+int pix_abs16x16_x2_mmx1(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
+int pix_abs16x16_x2_c(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
+int pix_abs16x16_y2_mmx(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
+int pix_abs16x16_y2_mmx1(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
+int pix_abs16x16_y2_c(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
+int pix_abs16x16_xy2_mmx(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
+int pix_abs16x16_xy2_mmx1(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
+int pix_abs16x16_xy2_c(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
 
-typedef int motion_func(uint8_t *blk1, uint8_t *blk2, int lx);
+typedef int motion_func(void *v, uint8_t *blk1, uint8_t *blk2, int lx, int h);
 
 #define WIDTH 64
 #define HEIGHT 64
@@ -103,15 +103,15 @@
         for(y=0;y<HEIGHT-17;y++) {
             for(x=0;x<WIDTH-17;x++) {
                 ptr = img2 + y * WIDTH + x;
-                d1 = test_func(img1, ptr, WIDTH);
-                d2 = ref_func(img1, ptr, WIDTH);
+                d1 = test_func(NULL, img1, ptr, WIDTH, 1);
+                d2 = ref_func(NULL, img1, ptr, WIDTH, 1);
                 if (d1 != d2) {
                     printf("error: mmx=%d c=%d\n", d1, d2);
                 }
             }
         }
     }
-    emms();
+    emms_c();
 
     /* speed test */
     ti = gettime();
@@ -120,11 +120,11 @@
         for(y=0;y<HEIGHT-17;y++) {
             for(x=0;x<WIDTH-17;x++) {
                 ptr = img2 + y * WIDTH + x;
-                d1 += test_func(img1, ptr, WIDTH);
+                d1 += test_func(NULL, img1, ptr, WIDTH, 1);
             }
         }
     }
-    emms();
+    emms_c();
     dummy = d1; /* avoid optimisation */
     ti = gettime() - ti;
 
@@ -136,13 +136,17 @@
 
 int main(int argc, char **argv)
 {
-    int c;
+    int n;
+#ifdef HAVE_MMX
+    AVCodecContext *ctx;
+    DSPContext c, mmx;
+#endif
 
     for(;;) {
-        c = getopt(argc, argv, "h");
-        if (c == -1)
+        n = getopt(argc, argv, "h");
+        if (n == -1)
             break;
-        switch(c) {
+        switch(n) {
         case 'h':
             help();
             break;
@@ -151,9 +155,25 @@
 
     printf("ffmpeg motion test\n");
 
-    test_motion("mmx", pix_abs16x16_mmx, pix_abs16x16_c);
-    test_motion("mmx_x2", pix_abs16x16_x2_mmx, pix_abs16x16_x2_c);
-    test_motion("mmx_y2", pix_abs16x16_y2_mmx, pix_abs16x16_y2_c);
-    test_motion("mmx_xy2", pix_abs16x16_xy2_mmx, pix_abs16x16_xy2_c);
+#ifdef HAVE_MMX
+    ctx = avcodec_alloc_context();
+    mm_flags = 0;
+    dsputil_init(&c, ctx);
+    mm_flags = MM_MMX;
+    dsputil_init(&mmx, ctx);
+
+    test_motion("mmx/16",     mmx.pix_abs[0][0], c.pix_abs[0][0]);
+    test_motion("mmx_x2/16",  mmx.pix_abs[0][1], c.pix_abs[0][1]);
+    test_motion("mmx_y2/16",  mmx.pix_abs[0][2], c.pix_abs[0][2]);
+    test_motion("mmx_xy2/16", mmx.pix_abs[0][3], c.pix_abs[0][3]);
+
+    test_motion("mmx/8",      mmx.pix_abs[1][0], c.pix_abs[1][0]);
+    test_motion("mmx_x2/8",   mmx.pix_abs[1][1], c.pix_abs[1][1]);
+    test_motion("mmx_y2/8",   mmx.pix_abs[1][2], c.pix_abs[1][2]);
+    test_motion("mmx_xy2/8",  mmx.pix_abs[1][3], c.pix_abs[1][3]);
+
+    av_free(ctx);
+#endif
+
     return 0;
 }
Index: ffmpeg/libavformat/grab.c
===================================================================
--- ffmpeg.orig/libavformat/grab.c	2007-03-22 01:00:54.000000000 -0400
+++ ffmpeg/libavformat/grab.c	2007-05-20 12:55:11.000000000 -0400
@@ -846,9 +846,7 @@
                 DEINT_LINE_LUM(12)
                 }
     }
-#ifdef HAVE_MMX
-    emms();
-#endif
+    emms_c();
     return s->frame_size;
 }
 
Index: ffmpeg/tests/dsptest.c
===================================================================
--- ffmpeg.orig/tests/dsptest.c	2007-03-22 01:00:52.000000000 -0400
+++ ffmpeg/tests/dsptest.c	2007-05-20 12:50:47.000000000 -0400
@@ -20,18 +20,18 @@
 #include "avcodec.h"
 #include "dsputil.h"
 #include "mpegvideo.h"
-#include "mpeg12data.h"
-#include "mpeg4data.h"
-#include "../libavcodec/i386/cputest.c"
-#include "../libavcodec/i386/dsputil_mmx.c"
-
-#include "../libavcodec/i386/fdct_mmx.c"
-#include "../libavcodec/i386/idct_mmx.c"
-#include "../libavcodec/i386/motion_est_mmx.c"
-#include "../libavcodec/i386/simple_idct_mmx.c"
-#include "../libavcodec/dsputil.c"
-#include "../libavcodec/simple_idct.c"
-#include "../libavcodec/jfdctfst.c"
+//#include "mpeg12data.h"
+//#include "mpeg4data.h"
+#include "i386/cputest.c"
+#include "i386/dsputil_mmx.c"
+
+#include "i386/fdct_mmx.c"
+#include "i386/idct_mmx.c"
+#include "i386/motion_est_mmx.c"
+#include "i386/simple_idct_mmx.c"
+#include "dsputil.c"
+#include "simple_idct.c"
+#include "jfdctfst.c"
 
 #undef TESTCPU_MAIN
 
@@ -73,27 +73,27 @@
     int mm_flags;
 } pix_func[] = {
 
-    PIX_FUNC_MMX(put_pixels),
+    PIX_FUNC_MMX(put_pixels8),
     //PIX_FUNC_MMX(get_pixels),
     //PIX_FUNC_MMX(put_pixels_clamped),
 #if 1
-    PIX_FUNC(put_pixels_x2),
-    PIX_FUNC(put_pixels_y2),
-    PIX_FUNC_MMX(put_pixels_xy2),
-
-    PIX_FUNC(put_no_rnd_pixels_x2),
-    PIX_FUNC(put_no_rnd_pixels_y2),
-    PIX_FUNC_MMX(put_no_rnd_pixels_xy2),
-
-    PIX_FUNC(avg_pixels),
-    PIX_FUNC(avg_pixels_x2),
-    PIX_FUNC(avg_pixels_y2),
-    PIX_FUNC(avg_pixels_xy2),
-
-    PIX_FUNC_MMX(avg_no_rnd_pixels),
-    PIX_FUNC_MMX(avg_no_rnd_pixels_x2),
-    PIX_FUNC_MMX(avg_no_rnd_pixels_y2),
-    PIX_FUNC_MMX(avg_no_rnd_pixels_xy2),
+    PIX_FUNC(put_pixels8_x2),
+    PIX_FUNC(put_pixels8_y2),
+    PIX_FUNC_MMX(put_pixels8_xy2),
+
+    PIX_FUNC(put_no_rnd_pixels8_x2),
+    PIX_FUNC(put_no_rnd_pixels8_y2),
+    PIX_FUNC_MMX(put_no_rnd_pixels8_xy2),
+
+    PIX_FUNC(avg_pixels8),
+    PIX_FUNC(avg_pixels8_x2),
+    PIX_FUNC(avg_pixels8_y2),
+    PIX_FUNC(avg_pixels8_xy2),
+
+    PIX_FUNC_MMX(avg_no_rnd_pixels8),
+    PIX_FUNC_MMX(avg_no_rnd_pixels8_x2),
+    PIX_FUNC_MMX(avg_no_rnd_pixels8_y2),
+    PIX_FUNC_MMX(avg_no_rnd_pixels8_xy2),
 #endif
     { 0, 0 }
 };
Index: ffmpeg/libavcodec/i386/h264dsp_mmx.c
===================================================================
--- ffmpeg.orig/libavcodec/i386/h264dsp_mmx.c	2007-03-22 01:00:40.000000000 -0400
+++ ffmpeg/libavcodec/i386/h264dsp_mmx.c	2007-05-20 12:13:28.000000000 -0400
@@ -1374,7 +1374,7 @@
 H264_MC(avg_, 4, mmx2)
 H264_MC(avg_, 8, mmx2)
 H264_MC(avg_, 16,mmx2)
-
+#undef H264_MC
 
 #define H264_CHROMA_OP(S,D)
 #define H264_CHROMA_OP4(S,D,T)
@@ -1514,4 +1514,4 @@
 H264_WEIGHT( 4, 8)
 H264_WEIGHT( 4, 4)
 H264_WEIGHT( 4, 2)
-
+#undef H264_WEIGHT
Index: ffmpeg/libswscale/rgb2rgb.c
===================================================================
--- ffmpeg.orig/libswscale/rgb2rgb.c	2007-03-22 01:00:59.000000000 -0400
+++ ffmpeg/libswscale/rgb2rgb.c	2007-03-22 01:20:53.000000000 -0400
@@ -33,9 +33,6 @@
 #include "swscale_internal.h"
 #include "x86_cpu.h"
 #include "bswap.h"
-#ifdef USE_FASTMEMCPY
-#include "libvo/fastmemcpy.h"
-#endif
 
 #define FAST_BGR2YV12 // use 7 bit coeffs instead of 15bit
 
Index: ffmpeg/libswscale/cs_test.c
===================================================================
--- ffmpeg.orig/libswscale/cs_test.c	2007-03-22 01:00:59.000000000 -0400
+++ ffmpeg/libswscale/cs_test.c	2007-05-21 09:08:34.000000000 -0400
@@ -23,7 +23,9 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <inttypes.h>
+#ifdef HAVE_MALLOC_H
 #include <malloc.h>
+#endif
 
 #include "swscale.h"
 #include "rgb2rgb.h"




More information about the ffmpeg-devel mailing list