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-20 12:53:45.000000000 -0400 @@ -39,6 +39,7 @@ #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #endif +#undef fprintf #undef printf void *fast_memcpy(void *a, const void *b, size_t c){return memcpy(a,b,c);}; @@ -46,13 +47,17 @@ /* reference fdct/idct */ extern void fdct(DCTELEM *block); extern void idct(DCTELEM *block); +#if defined(HAVE_MMX) && defined(CONFIG_GPL) extern void ff_idct_xvid_mmx(DCTELEM *block); extern void ff_idct_xvid_mmx2(DCTELEM *block); +#endif extern void init_fdct(); extern void j_rev_dct(DCTELEM *data); +#ifdef HAVE_MMX extern void ff_mmx_idct(DCTELEM *data); extern void ff_mmxext_idct(DCTELEM *data); +#endif extern void odivx_idct_c (short *block); @@ -83,6 +88,7 @@ static short idct_mmx_perm[64]; +#ifdef HAVE_MMX static short idct_simple_mmx_perm[64]={ 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D, 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D, @@ -93,6 +99,7 @@ 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F, 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F, }; +#endif void idct_mmx_init(void) { @@ -162,14 +169,19 @@ for(i=0; i<64; i++) block_org[i]= block1[i]; +#ifdef HAVE_MMX if (fdct_func == ff_mmx_idct || fdct_func == j_rev_dct || fdct_func == ff_mmxext_idct) { +#else + if (fdct_func == j_rev_dct) { +#endif for(i=0;i<64;i++) block[idct_mmx_perm[i]] = block1[i]; +#ifdef HAVE_MMX } else if(fdct_func == ff_simple_idct_mmx ) { for(i=0;i<64;i++) block[idct_simple_mmx_perm[i]] = block1[i]; - +#endif } else { for(i=0; i<64; i++) block[i]= block1[i]; @@ -184,7 +196,7 @@ #endif fdct_func(block); - emms(); /* for ff_mmx_idct */ + emms_c(); /* for ff_mmx_idct */ if (fdct_func == fdct_ifast #ifndef FAAN_POSTSCALE @@ -261,13 +273,19 @@ }break; } +#ifdef HAVE_MMX if (fdct_func == ff_mmx_idct || fdct_func == j_rev_dct || fdct_func == ff_mmxext_idct) { +#else + if (fdct_func == j_rev_dct) { +#endif for(i=0;i<64;i++) block[idct_mmx_perm[i]] = block1[i]; +#ifdef HAVE_MMX } else if(fdct_func == ff_simple_idct_mmx ) { for(i=0;i<64;i++) block[idct_simple_mmx_perm[i]] = block1[i]; +#endif } else { for(i=0; i<64; i++) block[i]= block1[i]; @@ -286,7 +304,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 +464,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 +526,26 @@ 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); +#ifdef HAVE_MMX dct_error("LIBMPEG2-MMX", 1, ff_mmx_idct, idct, test); dct_error("LIBMPEG2-MMXEXT", 1, ff_mmxext_idct, idct, test); +#endif dct_error("SIMPLE-C", 1, simple_idct, idct, test); +#ifdef HAVE_MMX 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 +#endif // 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-03-22 01:20:53.000000000 -0400 @@ -28,6 +28,9 @@ #include #include +#undef fprintf +#undef printf + int mm_flags; /* reference fft */ 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 12:11:02.000000000 -0400 @@ -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/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__) #endif #define NB_COMPONENTS 3 @@ -835,7 +837,9 @@ fprintf(f,"P5\n%d %d\n%d\n", xsize, ysize, 255); fwrite(img,1, xsize * ysize,f); fclose(f); +#ifndef TEST #define fprintf please_use_av_log +#endif } static void dump_filter(int16_t *filter) 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-20 12:55:02.000000000 -0400 @@ -31,24 +31,27 @@ #include "dsputil.h" +#ifdef HAVE_MMX #include "i386/mmx.h" +#endif #undef printf +#undef fprintf -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 +106,15 @@ for(y=0;yframe_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-03-22 09:03:57.000000000 -0400 @@ -23,7 +23,9 @@ #include #include #include +#ifdef HAVE_MALLOC_H #include +#endif #include "swscale.h" #include "rgb2rgb.h" @@ -34,6 +36,7 @@ #ifdef __APPLE_CC__ #define memalign(x,y) malloc(y) +#undef malloc #endif static int cpu_caps;