[MPlayer-cvslog] r28325 - in trunk: liba52/a52_internal.h liba52/bitstream.h liba52/downmix.c liba52/imdct.c liba52/resample.c liba52/resample_mmx.c libmpcodecs/dec_video.c libmpcodecs/pullup.c libmpcodecs/vd_libmp...

reimar subversion at mplayerhq.hu
Fri Jan 16 10:21:21 CET 2009


Author: reimar
Date: Fri Jan 16 10:21:21 2009
New Revision: 28325

Log:
Lots and lots of #ifdef ARCH_... -> #if ARCH_...
and #ifdef HAVE_MMX etc -> #if HAVE_MMX.
There might be still more that need to be fixed.

Modified:
   trunk/liba52/a52_internal.h
   trunk/liba52/bitstream.h
   trunk/liba52/downmix.c
   trunk/liba52/imdct.c
   trunk/liba52/resample.c
   trunk/liba52/resample_mmx.c
   trunk/libmpcodecs/dec_video.c
   trunk/libmpcodecs/pullup.c
   trunk/libmpcodecs/vd_libmpeg2.c
   trunk/libmpcodecs/vf_decimate.c
   trunk/libmpcodecs/vf_divtc.c
   trunk/libmpcodecs/vf_eq.c
   trunk/libmpcodecs/vf_eq2.c
   trunk/libmpcodecs/vf_fspp.c
   trunk/libmpcodecs/vf_halfpack.c
   trunk/libmpcodecs/vf_hue.c
   trunk/libmpcodecs/vf_ilpack.c
   trunk/libmpcodecs/vf_ivtc.c
   trunk/libmpcodecs/vf_noise.c
   trunk/libmpcodecs/vf_pp7.c
   trunk/libmpcodecs/vf_scale.c
   trunk/libmpcodecs/vf_spp.c
   trunk/libmpcodecs/vf_tfields.c
   trunk/libmpcodecs/vf_unsharp.c
   trunk/libmpcodecs/vf_uspp.c
   trunk/libmpdemux/asfguid.h
   trunk/libmpeg2/cpu_accel.c
   trunk/libmpeg2/cpu_state.c
   trunk/libmpeg2/idct.c
   trunk/libmpeg2/idct_alpha.c
   trunk/libmpeg2/idct_altivec.c
   trunk/libmpeg2/idct_mmx.c
   trunk/libmpeg2/motion_comp.c
   trunk/libmpeg2/motion_comp_alpha.c
   trunk/libmpeg2/motion_comp_altivec.c
   trunk/libmpeg2/motion_comp_arm.c
   trunk/libmpeg2/motion_comp_mmx.c
   trunk/libmpeg2/motion_comp_vis.c
   trunk/libmpeg2/mpeg2_internal.h
   trunk/libvo/aclib.c
   trunk/libvo/aclib_template.c
   trunk/libvo/osd.c
   trunk/libvo/osd_template.c
   trunk/mp3lib/decod386.c
   trunk/mp3lib/sr1.c
   trunk/vidix/dha.c

Modified: trunk/liba52/a52_internal.h
==============================================================================
--- trunk/liba52/a52_internal.h	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/liba52/a52_internal.h	Fri Jan 16 10:21:21 2009	(r28325)
@@ -107,7 +107,7 @@ struct a52_state_s {
 #define DELTA_BIT_NONE (2)
 #define DELTA_BIT_RESERVED (3)
 
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
 # define REG_a "rax"
 # define REG_d "rdx"
 # define REG_S "rsi"

Modified: trunk/liba52/bitstream.h
==============================================================================
--- trunk/liba52/bitstream.h	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/liba52/bitstream.h	Fri Jan 16 10:21:21 2009	(r28325)
@@ -37,7 +37,7 @@
 #define ALT_BITSTREAM_READER
 
 /* used to avoid misaligned exceptions on some archs (alpha, ...) */
-#if defined (ARCH_X86) || defined(HAVE_ARMV6)
+#if ARCH_X86 || defined(HAVE_ARMV6)
 #    define unaligned32(a) (*(uint32_t*)(a))
 #else
 #    ifdef __GNUC__

Modified: trunk/liba52/downmix.c
==============================================================================
--- trunk/liba52/downmix.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/liba52/downmix.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -56,7 +56,7 @@ void downmix_accel_init(uint32_t mm_acce
 {
     a52_upmix= upmix_C;
     a52_downmix= downmix_C;
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
     if(mm_accel & MM_ACCEL_X86_MMX) a52_upmix= upmix_MMX;
     if(mm_accel & MM_ACCEL_X86_SSE) a52_downmix= downmix_SSE;
     if(mm_accel & MM_ACCEL_X86_3DNOW) a52_downmix= downmix_3dnow;
@@ -686,7 +686,7 @@ void upmix_C (sample_t * samples, int ac
     }
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
 static void mix2to1_SSE (sample_t * dest, sample_t * src, sample_t bias)
 {
 	__asm__ volatile(

Modified: trunk/liba52/imdct.c
==============================================================================
--- trunk/liba52/imdct.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/liba52/imdct.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -54,6 +54,7 @@ void (*a52_imdct_512) (sample_t * data, 
 
 #ifdef RUNTIME_CPUDETECT
 #undef HAVE_3DNOWEX
+#define HAVE_3DNOWEX 0
 #endif
 
 typedef struct complex_s {
@@ -118,7 +119,7 @@ static complex_t __attribute__((aligned(
 static sample_t __attribute__((aligned(16))) xcos1[128];
 static sample_t __attribute__((aligned(16))) xsin1[128];
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
 // NOTE: SSE needs 16byte alignment or it will segfault 
 // 
 static float __attribute__((aligned(16))) sseSinCos1c[256];
@@ -365,7 +366,7 @@ void imdct_do_512 (sample_t * data, samp
     }
 }
 
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
 
 #ifdef HAVE_ALTIVEC_H
 #include <altivec.h>
@@ -710,10 +711,9 @@ imdct_do_512_altivec(sample_t data[],sam
 
 // Stuff below this line is borrowed from libac3
 #include "srfftp.h"
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
-#ifndef HAVE_3DNOW
+#if ARCH_X86 || ARCH_X86_64
+#undef HAVE_3DNOW
 #define HAVE_3DNOW 1
-#endif
 #include "srfftp_3dnow.h"
 
 const i_cmplx_t x_plus_minus_3dnow __attribute__ ((aligned (8))) = {{ 0x00000000UL, 0x80000000UL }}; 
@@ -721,8 +721,10 @@ const i_cmplx_t x_minus_plus_3dnow __att
 const complex_t HSQRT2_3DNOW __attribute__ ((aligned (8))) = { 0.707106781188, 0.707106781188 };
 
 #undef HAVE_3DNOWEX
+#define HAVE_3DNOWEX 0
 #include "imdct_3dnow.h"
-#define HAVE_3DNOWEX
+#undef HAVE_3DNOWEX
+#define HAVE_3DNOWEX 1
 #include "imdct_3dnow.h"
 
 void
@@ -1202,7 +1204,7 @@ void a52_imdct_init (uint32_t mm_accel)
 	    w[i][k].imag = sin (-M_PI * k / j);
 	}
     }
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
 	for (i = 0; i < 128; i++) {
 	    sseSinCos1c[2*i+0]= xcos1[i];
 	    sseSinCos1c[2*i+1]= -xcos1[i];
@@ -1256,7 +1258,7 @@ void a52_imdct_init (uint32_t mm_accel)
 	ifft128 = ifft128_c;
 	ifft64 = ifft64_c;
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
 	if(mm_accel & MM_ACCEL_X86_SSE)
 	{
 	  fprintf (stderr, "Using SSE optimized IMDCT transform\n");
@@ -1276,7 +1278,7 @@ void a52_imdct_init (uint32_t mm_accel)
 	}
 	else
 #endif // ARCH_X86 || ARCH_X86_64
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
         if (mm_accel & MM_ACCEL_PPC_ALTIVEC)
 	{
 	  fprintf(stderr, "Using AltiVec optimized IMDCT transform\n");
@@ -1285,7 +1287,7 @@ void a52_imdct_init (uint32_t mm_accel)
 	else
 #endif
 
-#ifdef LIBA52_DJBFFT
+#if LIBA52_DJBFFT
     if (mm_accel & MM_ACCEL_DJBFFT) {
 	fprintf (stderr, "Using djbfft for IMDCT transform\n");
 	ifft128 = (void (*) (complex_t *)) fftc4_un128;

Modified: trunk/liba52/resample.c
==============================================================================
--- trunk/liba52/resample.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/liba52/resample.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -38,18 +38,18 @@ int (* a52_resample) (float * _f, int16_
 
 #include "resample_c.c"
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
 #include "resample_mmx.c"
 #endif
 
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
 #include "resample_altivec.c"
 #endif
 
 void* a52_resample_init(uint32_t mm_accel,int flags,int chans){
 void* tmp;
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
     if(mm_accel&MM_ACCEL_X86_MMX){
 	tmp=a52_resample_MMX(flags,chans);
 	if(tmp){
@@ -59,7 +59,7 @@ void* tmp;
 	}
     }
 #endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
     if(mm_accel&MM_ACCEL_PPC_ALTIVEC){
       tmp=a52_resample_altivec(flags,chans);
       if(tmp){

Modified: trunk/liba52/resample_mmx.c
==============================================================================
--- trunk/liba52/resample_mmx.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/liba52/resample_mmx.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -76,7 +76,7 @@ static int a52_resample_MONO_to_5_MMX(fl
 static int a52_resample_STEREO_to_2_MMX(float * _f, int16_t * s16){
     int32_t * f = (int32_t *) _f;
 /* benchmark scores are 0.3% better with SSE but we would need to set bias=0 and premultiply it
-#ifdef HAVE_SSE
+#if HAVE_SSE
 	__asm__ volatile(
 		"mov $-1024, %%"REG_S"		\n\t"
 		"1:				\n\t"

Modified: trunk/libmpcodecs/dec_video.c
==============================================================================
--- trunk/libmpcodecs/dec_video.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/dec_video.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -370,7 +370,7 @@ void *decode_video(sh_video_t *sh_video,
 
     //------------------------ frame decoded. --------------------
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
     // some codecs are broken, and doesn't restore MMX state :(
     // it happens usually with broken/damaged files.
     if (gCpuCaps.has3DNow) {

Modified: trunk/libmpcodecs/pullup.c
==============================================================================
--- trunk/libmpcodecs/pullup.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/pullup.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -9,8 +9,8 @@
 
 
 
-#ifdef ARCH_X86
-#ifdef HAVE_MMX
+#if ARCH_X86
+#if HAVE_MMX
 static int diff_y_mmx(unsigned char *a, unsigned char *b, int s)
 {
 	int ret;
@@ -767,8 +767,8 @@ void pullup_init_context(struct pullup_c
 		c->diff = diff_y;
 		c->comb = licomb_y;
 		c->var = var_y;
-#ifdef ARCH_X86
-#ifdef HAVE_MMX
+#if ARCH_X86
+#if HAVE_MMX
 		if (c->cpu & PULLUP_CPU_MMX) {
 			c->diff = diff_y_mmx;
 			c->comb = licomb_y_mmx;

Modified: trunk/libmpcodecs/vd_libmpeg2.c
==============================================================================
--- trunk/libmpcodecs/vd_libmpeg2.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vd_libmpeg2.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -78,12 +78,12 @@ static int init(sh_video_t *sh){
        accel |= MPEG2_ACCEL_X86_SSE2;
     if(gCpuCaps.hasAltiVec)
        accel |= MPEG2_ACCEL_PPC_ALTIVEC;
-    #ifdef ARCH_ALPHA
+    #if ARCH_ALPHA
        accel |= MPEG2_ACCEL_ALPHA;
     #elif ARCH_ARM
        accel |= MPEG2_ACCEL_ARM;
     #endif
-    #ifdef HAVE_MVI
+    #if HAVE_MVI
        accel |= MPEG2_ACCEL_ALPHA_MVI;
     #elif HAVE_VIS
        accel |= MPEG2_ACCEL_SPARC_VIS;

Modified: trunk/libmpcodecs/vf_decimate.c
==============================================================================
--- trunk/libmpcodecs/vf_decimate.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_decimate.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -19,7 +19,7 @@ struct vf_priv_s {
 	int max, last, cnt;
 };
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
 {
 	volatile short out[4];
@@ -164,7 +164,7 @@ static int open(vf_instance_t *vf, char*
 	p->frac = 0.33;
 	if (args) sscanf(args, "%d:%d:%d:%f", &p->max, &p->hi, &p->lo, &p->frac);
 	diff = diff_C;
-#ifdef HAVE_MMX
+#if HAVE_MMX
 	if(gCpuCaps.hasMMX) diff = diff_MMX;
 #endif
 	return 1;

Modified: trunk/libmpcodecs/vf_divtc.c
==============================================================================
--- trunk/libmpcodecs/vf_divtc.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_divtc.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -33,7 +33,7 @@ struct vf_priv_s
  * diff_MMX and diff_C stolen from vf_decimate.c
  */
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
    {
    volatile short out[4];
@@ -683,7 +683,7 @@ static int open(vf_instance_t *vf, char*
       goto nomem;
 
    diff=
-#ifdef HAVE_MMX
+#if HAVE_MMX
       gCpuCaps.hasMMX?diff_MMX:
 #endif
       diff_C;

Modified: trunk/libmpcodecs/vf_eq.c
==============================================================================
--- trunk/libmpcodecs/vf_eq.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_eq.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -26,7 +26,7 @@ static struct vf_priv_s {
   0
 };
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, int sstride,
 		    int w, int h, int brightness, int contrast)
 {
@@ -215,7 +215,7 @@ static int open(vf_instance_t *vf, char*
 	if (args) sscanf(args, "%d:%d", &vf->priv->brightness, &vf->priv->contrast);
 
 	process = process_C;
-#ifdef HAVE_MMX
+#if HAVE_MMX
 	if(gCpuCaps.hasMMX) process = process_MMX;
 #endif
 	

Modified: trunk/libmpcodecs/vf_eq2.c
==============================================================================
--- trunk/libmpcodecs/vf_eq2.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_eq2.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -106,7 +106,7 @@ void create_lut (eq2_param_t *par)
   par->lut_clean = 1;
 }
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static
 void affine_1d_MMX (eq2_param_t *par, unsigned char *dst, unsigned char *src,
   unsigned w, unsigned h, unsigned dstride, unsigned sstride)
@@ -275,7 +275,7 @@ void check_values (eq2_param_t *par)
   if ((par->c == 1.0) && (par->b == 0.0) && (par->g == 1.0)) {
     par->adjust = NULL;
   }
-#ifdef HAVE_MMX
+#if HAVE_MMX
   else if (par->g == 1.0 && gCpuCaps.hasMMX) {
     par->adjust = &affine_1d_MMX;
   }

Modified: trunk/libmpcodecs/vf_fspp.c
==============================================================================
--- trunk/libmpcodecs/vf_fspp.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_fspp.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -101,7 +101,7 @@ struct vf_priv_s { //align 16 !
 };
 
 
-#ifndef HAVE_MMX
+#if !HAVE_MMX
 
 //This func reads from 1 slice, 1 and clears 0 & 1
 static void store_slice_c(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)
@@ -557,10 +557,10 @@ static int put_image(struct vf_instance_
 	}
     }
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
     if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
     if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
     return vf_next_put_image(vf,dmpi, pts);
@@ -702,7 +702,7 @@ const vf_info_t vf_info_fspp = {
 #define THRESHOLD(r,x,t) if(((unsigned)((x)+t))>t*2) r=(x);else r=0;
 #define DESCALE(x,n)  (((x) + (1 << ((n)-1))) >> n)
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 
 DECLARE_ASM_CONST(8, uint64_t, MM_FIX_0_382683433)=FIX64(0.382683433, 14); 
 DECLARE_ASM_CONST(8, uint64_t, MM_FIX_0_541196100)=FIX64(0.541196100, 14); 
@@ -738,7 +738,7 @@ static const int16_t FIX_1_082392200=FIX
 
 #endif
 
-#ifndef HAVE_MMX
+#if !HAVE_MMX
 
 static void column_fidct_c(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt)
 {
@@ -1598,7 +1598,7 @@ static void column_fidct_mmx(int16_t* th
 
 #endif // HAVE_MMX
 
-#ifndef HAVE_MMX
+#if !HAVE_MMX
 
 static void row_idct_c(DCTELEM* workspace,
 		       int16_t* output_adr, int output_stride, int cnt)
@@ -1867,7 +1867,7 @@ static void row_idct_mmx (DCTELEM* works
 
 #endif // HAVE_MMX
 
-#ifndef HAVE_MMX
+#if !HAVE_MMX
 
 static void row_fdct_c(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt)
 {

Modified: trunk/libmpcodecs/vf_halfpack.c
==============================================================================
--- trunk/libmpcodecs/vf_halfpack.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_halfpack.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -17,7 +17,7 @@ struct vf_priv_s {
 	int field;
 };
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static void halfpack_MMX(unsigned char *dst, unsigned char *src[3],
 		     int dststride, int srcstride[3],
 		     int w, int h)
@@ -204,7 +204,7 @@ static int open(vf_instance_t *vf, char*
 	if (args) sscanf(args, "%d", &vf->priv->field);
 	
 	halfpack = halfpack_C;
-#ifdef HAVE_MMX
+#if HAVE_MMX
 	if(gCpuCaps.hasMMX) halfpack = halfpack_MMX;
 #endif
 	return 1;

Modified: trunk/libmpcodecs/vf_hue.c
==============================================================================
--- trunk/libmpcodecs/vf_hue.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_hue.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -160,7 +160,7 @@ static int open(vf_instance_t *vf, char*
         vf->priv->hue *= M_PI / 180.0;
 
 	process = process_C;
-#ifdef HAVE_MMXX
+#if HAVE_MMXX
 	if(gCpuCaps.hasMMX) process = process_MMX;
 #endif
 	

Modified: trunk/libmpcodecs/vf_ilpack.c
==============================================================================
--- trunk/libmpcodecs/vf_ilpack.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_ilpack.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -57,7 +57,7 @@ static void pack_li_1_C(unsigned char *d
 	}
 }
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
 	unsigned char *u, unsigned char *v, int w)
 {
@@ -93,7 +93,7 @@ static void pack_li_0_MMX(unsigned char 
 {
 	__asm__ volatile (""
 		"push %%"REG_BP" \n\t"
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
 		"mov %6, %%"REG_BP" \n\t"
 #else
 		"movl 4(%%"REG_d"), %%"REG_BP" \n\t"
@@ -186,7 +186,7 @@ static void pack_li_0_MMX(unsigned char 
 		"pop %%"REG_BP" \n\t"
 		: 
 		: "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16),
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
 		"d" ((long)us), "r" ((long)vs)
 #else
 		"d" (&us)
@@ -201,7 +201,7 @@ static void pack_li_1_MMX(unsigned char 
 {
 	__asm__ volatile (""
 		"push %%"REG_BP" \n\t"
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
 		"mov %6, %%"REG_BP" \n\t"
 #else
 		"movl 4(%%"REG_d"), %%"REG_BP" \n\t"
@@ -298,7 +298,7 @@ static void pack_li_1_MMX(unsigned char 
 		"pop %%"REG_BP" \n\t"
 		: 
 		: "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16),
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
 		"d" ((long)us), "r" ((long)vs)
 #else
 		"d" (&us)
@@ -396,7 +396,7 @@ static int open(vf_instance_t *vf, char*
 	pack_nn = (pack_func_t *)pack_nn_C;
 	pack_li_0 = pack_li_0_C;
 	pack_li_1 = pack_li_1_C;
-#ifdef HAVE_MMX
+#if HAVE_MMX
 	if(gCpuCaps.hasMMX) {
 		pack_nn = (pack_func_t *)pack_nn_MMX;
 		pack_li_0 = pack_li_0_MMX;

Modified: trunk/libmpcodecs/vf_ivtc.c
==============================================================================
--- trunk/libmpcodecs/vf_ivtc.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_ivtc.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -40,7 +40,7 @@ enum {
 	F_SHOW
 };
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char *new, int os, int ns)
 {
 	int i;
@@ -516,7 +516,7 @@ static int open(vf_instance_t *vf, char*
 	p->first = 1;
 	if (args) sscanf(args, "%d", &p->drop);
 	block_diffs = block_diffs_C;
-#ifdef HAVE_MMX
+#if HAVE_MMX
 	if(gCpuCaps.hasMMX) block_diffs = block_diffs_MMX;
 #endif
 	return 1;

Modified: trunk/libmpcodecs/vf_noise.c
==============================================================================
--- trunk/libmpcodecs/vf_noise.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_noise.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -145,7 +145,7 @@ static int8_t *initNoise(FilterParam *fp
 
 /***************************************************************************/
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
 	long mmx_len= len&(~7);
 	noise+=shift;
@@ -174,7 +174,7 @@ static inline void lineNoise_MMX(uint8_t
 #endif
 
 //duplicate of previous except movntq
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 static inline void lineNoise_MMX2(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
 	long mmx_len= len&(~7);
 	noise+=shift;
@@ -216,7 +216,7 @@ static inline void lineNoise_C(uint8_t *
 
 /***************************************************************************/
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static inline void lineNoiseAvg_MMX(uint8_t *dst, uint8_t *src, int len, int8_t **shift){
 	long mmx_len= len&(~7);
 
@@ -356,10 +356,10 @@ static int put_image(struct vf_instance_
 
         vf_clone_mpi_attributes(dmpi, mpi);
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 	if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 	if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
 
@@ -447,13 +447,13 @@ static int open(vf_instance_t *vf, char*
     }
 
  
-#ifdef HAVE_MMX
+#if HAVE_MMX
     if(gCpuCaps.hasMMX){
         lineNoise= lineNoise_MMX;
         lineNoiseAvg= lineNoiseAvg_MMX;
     }
 #endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
     if(gCpuCaps.hasMMX2) lineNoise= lineNoise_MMX2;
 //    if(gCpuCaps.hasMMX) lineNoiseAvg= lineNoiseAvg_MMX2;
 #endif

Modified: trunk/libmpcodecs/vf_pp7.c
==============================================================================
--- trunk/libmpcodecs/vf_pp7.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_pp7.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -155,7 +155,7 @@ static void dctB_c(DCTELEM *dst, DCTELEM
     }
 }
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static void dctB_mmx(DCTELEM *dst, DCTELEM *src){
     __asm__ volatile (
         "movq  (%0), %%mm0      \n\t"
@@ -397,10 +397,10 @@ static int put_image(struct vf_instance_
         memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
     }
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
     if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
     if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
 
@@ -464,7 +464,7 @@ static int open(vf_instance_t *vf, char*
 	case 2: requantize= mediumthresh_c; break;
     }
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
     if(gCpuCaps.hasMMX){
         dctB= dctB_mmx;
     }

Modified: trunk/libmpcodecs/vf_scale.c
==============================================================================
--- trunk/libmpcodecs/vf_scale.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_scale.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -556,7 +556,7 @@ void sws_getFlagsAndFilterFromCmdLine(in
 	static int firstTime=1;
 	*flags=0;
 
-#ifdef ARCH_X86
+#if ARCH_X86
 	if(gCpuCaps.hasMMX)
 		__asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
 #endif

Modified: trunk/libmpcodecs/vf_spp.c
==============================================================================
--- trunk/libmpcodecs/vf_spp.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_spp.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -146,7 +146,7 @@ static void softthresh_c(DCTELEM dst[64]
 	}
 }
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static void hardthresh_mmx(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation){
 	int bias= 0; //FIXME
 	unsigned int threshold1;
@@ -327,7 +327,7 @@ static void store_slice_c(uint8_t *dst, 
 	}
 }
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static void store_slice_mmx(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale){
 	int y;
 
@@ -499,10 +499,10 @@ static int put_image(struct vf_instance_
 	    }
 	}
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 	if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 	if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
 
@@ -589,7 +589,7 @@ static int open(vf_instance_t *vf, char*
 	case 1: requantize= softthresh_c; break;
     }
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
     if(gCpuCaps.hasMMX){
 	store_slice= store_slice_mmx;
 	switch(vf->priv->mode&3){

Modified: trunk/libmpcodecs/vf_tfields.c
==============================================================================
--- trunk/libmpcodecs/vf_tfields.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_tfields.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -46,7 +46,7 @@ static void deint(unsigned char *dest, i
 	}
 }
 
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
 static void qpel_li_3DNOW(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
 {
 	int i, j, ssd=ss;
@@ -82,7 +82,7 @@ static void qpel_li_3DNOW(unsigned char 
 }
 #endif
 
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 static void qpel_li_MMX2(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
 {
 	int i, j, ssd=ss;
@@ -119,7 +119,7 @@ static void qpel_li_MMX2(unsigned char *
 }
 #endif
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
 static void qpel_li_MMX(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
 {
 	int i, j, ssd=ss;
@@ -478,14 +478,14 @@ static int open(vf_instance_t *vf, char*
 	if (args) sscanf(args, "%d:%d", &vf->priv->mode, &vf->priv->parity);
 	qpel_li = qpel_li_C;
 	qpel_4tap = qpel_4tap_C;
-#ifdef HAVE_MMX
+#if HAVE_MMX
 	if(gCpuCaps.hasMMX) qpel_li = qpel_li_MMX;
 	if(gCpuCaps.hasMMX) qpel_4tap = qpel_4tap_MMX;
 #endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 	if(gCpuCaps.hasMMX2) qpel_li = qpel_li_MMX2;
 #endif
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
 	if(gCpuCaps.has3DNow) qpel_li = qpel_li_3DNOW;
 #endif
 	return 1;

Modified: trunk/libmpcodecs/vf_unsharp.c
==============================================================================
--- trunk/libmpcodecs/vf_unsharp.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_unsharp.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -192,11 +192,11 @@ static int put_image( struct vf_instance
     
     vf_clone_mpi_attributes(dmpi, mpi);
     
-#ifdef HAVE_MMX
+#if HAVE_MMX
     if(gCpuCaps.hasMMX)
 	__asm__ volatile ("emms\n\t");
 #endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
     if(gCpuCaps.hasMMX2)
 	__asm__ volatile ("sfence\n\t");
 #endif

Modified: trunk/libmpcodecs/vf_uspp.c
==============================================================================
--- trunk/libmpcodecs/vf_uspp.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpcodecs/vf_uspp.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -291,10 +291,10 @@ static int put_image(struct vf_instance_
         }
     }
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
     if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
 #endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
     if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
 #endif
 
@@ -370,7 +370,7 @@ static int open(vf_instance_t *vf, char*
     if(vf->priv->qp < 0)
         vf->priv->qp = 0;
 
-// #ifdef HAVE_MMX
+// #if HAVE_MMX
 //     if(gCpuCaps.hasMMX){
 // 	store_slice= store_slice_mmx;
 //     }

Modified: trunk/libmpdemux/asfguid.h
==============================================================================
--- trunk/libmpdemux/asfguid.h	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpdemux/asfguid.h	Fri Jan 16 10:21:21 2009	(r28325)
@@ -26,7 +26,7 @@
 #include "mpbswap.h"
 
 
-#ifdef ARCH_X86
+#if ARCH_X86
 #define	ASF_LOAD_GUID_PREFIX(guid)	(*(uint32_t *)(guid))
 #else
 #define	ASF_LOAD_GUID_PREFIX(guid)	AV_RL32(guid)

Modified: trunk/libmpeg2/cpu_accel.c
==============================================================================
--- trunk/libmpeg2/cpu_accel.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/cpu_accel.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -35,7 +35,7 @@
 
 #include "cpudetect.h"
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
 static inline uint32_t arch_accel (uint32_t accel)
 {
 /* Use MPlayer CPU detection instead of libmpeg2 variant. */
@@ -150,7 +150,7 @@ static inline uint32_t arch_accel (uint3
 }
 #endif /* ARCH_X86 || ARCH_X86_64 */
 
-#if defined(ACCEL_DETECT) && (defined(ARCH_PPC) || defined(ARCH_SPARC))
+#if defined(ACCEL_DETECT) && (ARCH_PPC || ARCH_SPARC)
 #include <signal.h>
 #include <setjmp.h>
 
@@ -169,7 +169,7 @@ static RETSIGTYPE sigill_handler (int si
 }
 #endif /* ACCEL_DETECT && (ARCH_PPC || ARCH_SPARC) */
 
-#ifdef ARCH_PPC
+#if ARCH_PPC
 static uint32_t arch_accel (uint32_t accel)
 {
 #ifdef ACCEL_DETECT
@@ -206,7 +206,7 @@ static uint32_t arch_accel (uint32_t acc
 }
 #endif /* ARCH_PPC */
 
-#ifdef ARCH_SPARC
+#if ARCH_SPARC
 static uint32_t arch_accel (uint32_t accel)
 {
     if (accel & MPEG2_ACCEL_SPARC_VIS2)
@@ -252,7 +252,7 @@ static uint32_t arch_accel (uint32_t acc
 }
 #endif /* ARCH_SPARC */
 
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
 static inline uint32_t arch_accel (uint32_t accel)
 {
     if (accel & MPEG2_ACCEL_ALPHA_MVI)
@@ -276,7 +276,7 @@ static inline uint32_t arch_accel (uint3
 
 uint32_t mpeg2_detect_accel (uint32_t accel)
 {
-#if defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC)
+#if ARCH_X86 || ARCH_X86_64 || ARCH_PPC || ARCH_ALPHA || ARCH_SPARC
     accel = arch_accel (accel);
 #endif
     return accel;

Modified: trunk/libmpeg2/cpu_state.c
==============================================================================
--- trunk/libmpeg2/cpu_state.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/cpu_state.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -29,21 +29,21 @@
 #include "mpeg2.h"
 #include "attributes.h"
 #include "mpeg2_internal.h"
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
 #include "mmx.h"
 #endif
 
 void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL;
 void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL;
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
 static void state_restore_mmx (cpu_state_t * state)
 {
     emms ();
 }
 #endif
 
-#ifdef ARCH_PPC
+#if ARCH_PPC
 #if defined(__APPLE_CC__)	/* apple */
 #define LI(a,b) "li r" #a "," #b "\n\t"
 #define STVX0(a,b,c) "stvx v" #a ",0,r" #c "\n\t"
@@ -115,12 +115,12 @@ static void state_restore_altivec (cpu_s
 
 void mpeg2_cpu_state_init (uint32_t accel)
 {
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
     if (accel & MPEG2_ACCEL_X86_MMX) {
 	mpeg2_cpu_state_restore = state_restore_mmx;
     }
 #endif
-#ifdef ARCH_PPC
+#if ARCH_PPC
     if (accel & MPEG2_ACCEL_PPC_ALTIVEC) {
 	mpeg2_cpu_state_save = state_save_altivec;
 	mpeg2_cpu_state_restore = state_restore_altivec;

Modified: trunk/libmpeg2/idct.c
==============================================================================
--- trunk/libmpeg2/idct.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/idct.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -239,7 +239,7 @@ static void mpeg2_idct_add_c (const int 
 
 void mpeg2_idct_init (uint32_t accel)
 {
-#ifdef HAVE_SSE2
+#if HAVE_SSE2
     if (accel & MPEG2_ACCEL_X86_SSE2) {
 	mpeg2_idct_copy = mpeg2_idct_copy_sse2;
 	mpeg2_idct_add = mpeg2_idct_add_sse2;
@@ -258,14 +258,14 @@ void mpeg2_idct_init (uint32_t accel)
 	mpeg2_idct_mmx_init ();
     } else
 #endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
     if (accel & MPEG2_ACCEL_PPC_ALTIVEC) {
 	mpeg2_idct_copy = mpeg2_idct_copy_altivec;
 	mpeg2_idct_add = mpeg2_idct_add_altivec;
 	mpeg2_idct_altivec_init ();
     } else
 #endif
-#ifdef HAVE_MVI
+#if HAVE_MVI
     if (accel & MPEG2_ACCEL_ALPHA_MVI) {
 	mpeg2_idct_copy = mpeg2_idct_copy_mvi;
 	mpeg2_idct_add = mpeg2_idct_add_mvi;

Modified: trunk/libmpeg2/idct_alpha.c
==============================================================================
--- trunk/libmpeg2/idct_alpha.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/idct_alpha.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -24,7 +24,7 @@
 
 #include "config.h"
 
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
 
 #include <stdlib.h>
 #include <inttypes.h>

Modified: trunk/libmpeg2/idct_altivec.c
==============================================================================
--- trunk/libmpeg2/idct_altivec.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/idct_altivec.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -23,7 +23,7 @@
 
 #include "config.h"
 
-#ifdef ARCH_PPC
+#if ARCH_PPC
 
 #ifdef HAVE_ALTIVEC_H
 #include <altivec.h>

Modified: trunk/libmpeg2/idct_mmx.c
==============================================================================
--- trunk/libmpeg2/idct_mmx.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/idct_mmx.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -23,7 +23,7 @@
 
 #include "config.h"
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
 
 #include <inttypes.h>
 

Modified: trunk/libmpeg2/motion_comp.c
==============================================================================
--- trunk/libmpeg2/motion_comp.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/motion_comp.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -37,37 +37,37 @@ mpeg2_mc_t mpeg2_mc;
 
 void mpeg2_mc_init (uint32_t accel)
 {
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
     if (accel & MPEG2_ACCEL_X86_MMXEXT)
 	mpeg2_mc = mpeg2_mc_mmxext;
     else
 #endif
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
     if (accel & MPEG2_ACCEL_X86_3DNOW)
 	mpeg2_mc = mpeg2_mc_3dnow;
     else
 #endif
-#ifdef HAVE_MMX
+#if HAVE_MMX
     if (accel & MPEG2_ACCEL_X86_MMX)
 	mpeg2_mc = mpeg2_mc_mmx;
     else
 #endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
     if (accel & MPEG2_ACCEL_PPC_ALTIVEC)
 	mpeg2_mc = mpeg2_mc_altivec;
     else
 #endif
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
     if (accel & MPEG2_ACCEL_ALPHA)
 	mpeg2_mc = mpeg2_mc_alpha;
     else
 #endif
-#ifdef HAVE_VIS
+#if HAVE_VIS
     if (accel & MPEG2_ACCEL_SPARC_VIS)
 	mpeg2_mc = mpeg2_mc_vis;
     else
 #endif
-#ifdef ARCH_ARM
+#if ARCH_ARM
     if (accel & MPEG2_ACCEL_ARM)
 	mpeg2_mc = mpeg2_mc_arm;
     else

Modified: trunk/libmpeg2/motion_comp_alpha.c
==============================================================================
--- trunk/libmpeg2/motion_comp_alpha.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/motion_comp_alpha.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -22,7 +22,7 @@
 
 #include "config.h"
 
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
 
 #include <inttypes.h>
 

Modified: trunk/libmpeg2/motion_comp_altivec.c
==============================================================================
--- trunk/libmpeg2/motion_comp_altivec.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/motion_comp_altivec.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -23,7 +23,7 @@
 
 #include "config.h"
 
-#ifdef ARCH_PPC
+#if ARCH_PPC
 
 #ifdef HAVE_ALTIVEC_H
 #include <altivec.h>

Modified: trunk/libmpeg2/motion_comp_arm.c
==============================================================================
--- trunk/libmpeg2/motion_comp_arm.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/motion_comp_arm.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -22,7 +22,7 @@
 
 #include "config.h"
 
-#ifdef ARCH_ARM
+#if ARCH_ARM
 
 #include <inttypes.h>
 

Modified: trunk/libmpeg2/motion_comp_mmx.c
==============================================================================
--- trunk/libmpeg2/motion_comp_mmx.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/motion_comp_mmx.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -23,7 +23,7 @@
 
 #include "config.h"
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
 
 #include <inttypes.h>
 

Modified: trunk/libmpeg2/motion_comp_vis.c
==============================================================================
--- trunk/libmpeg2/motion_comp_vis.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/motion_comp_vis.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -22,7 +22,7 @@
 
 #include "config.h"
 
-#ifdef ARCH_SPARC
+#if ARCH_SPARC
 
 #include <inttypes.h>
 

Modified: trunk/libmpeg2/mpeg2_internal.h
==============================================================================
--- trunk/libmpeg2/mpeg2_internal.h	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libmpeg2/mpeg2_internal.h	Fri Jan 16 10:21:21 2009	(r28325)
@@ -238,7 +238,7 @@ struct mpeg2dec_s {
 };
 
 typedef struct {
-#ifdef ARCH_PPC
+#if ARCH_PPC
     uint8_t regv[12*16];
 #endif
     int dummy;

Modified: trunk/libvo/aclib.c
==============================================================================
--- trunk/libvo/aclib.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libvo/aclib.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -18,7 +18,7 @@
 //Feel free to fine-tune the above 2, it might be possible to get some speedup with them :)
 
 //#define STATISTICS
-#ifdef ARCH_X86
+#if ARCH_X86
 #define CAN_COMPILE_X86_ASM
 #endif
 
@@ -30,19 +30,19 @@
 
 #ifdef CAN_COMPILE_X86_ASM
 
-#if (defined (HAVE_MMX) && !defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)
+#if (HAVE_MMX && !HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
 #define COMPILE_MMX
 #endif
 
-#if (defined (HAVE_MMX2) && !defined (HAVE_SSE2)) || defined (RUNTIME_CPUDETECT)
+#if (HAVE_MMX2 && !HAVE_SSE2) || defined (RUNTIME_CPUDETECT)
 #define COMPILE_MMX2
 #endif
 
-#if (defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)
+#if (HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
 #define COMPILE_3DNOW
 #endif
 
-#if defined (HAVE_SSE2) || defined (RUNTIME_CPUDETECT)
+#if HAVE_SSE2 || defined (RUNTIME_CPUDETECT)
 #define COMPILE_SSE
 #endif
 
@@ -51,12 +51,23 @@
 #undef HAVE_3DNOW
 #undef HAVE_SSE
 #undef HAVE_SSE2
+#define HAVE_MMX 0
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
 /*
 #ifdef COMPILE_C
 #undef HAVE_MMX
 #undef HAVE_MMX2
 #undef HAVE_3DNOW
-#undef ARCH_X86
+#undef HAVE_SSE
+#undef HAVE_SSE2
+#define HAVE_MMX 0
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
 #define RENAME(a) a ## _C
 #include "aclib_template.c"
 #endif
@@ -64,11 +75,16 @@
 //MMX versions
 #ifdef COMPILE_MMX
 #undef RENAME
-#define HAVE_MMX
+#undef HAVE_MMX
 #undef HAVE_MMX2
 #undef HAVE_3DNOW
 #undef HAVE_SSE
 #undef HAVE_SSE2
+#define HAVE_MMX 1
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
 #define RENAME(a) a ## _MMX
 #include "aclib_template.c"
 #endif
@@ -76,11 +92,18 @@
 //MMX2 versions
 #ifdef COMPILE_MMX2
 #undef RENAME
-#define HAVE_MMX
-#define HAVE_MMX2
+#undef HAVE_MMX
+#undef HAVE_MMX2
 #undef HAVE_3DNOW
 #undef HAVE_SSE
 #undef HAVE_SSE2
+#define HAVE_MMX 1
+#define HAVE_MMX2 1
+#define HAVE_3DNOW 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
+#define HAVE_MMX
+#define HAVE_MMX2
 #define RENAME(a) a ## _MMX2
 #include "aclib_template.c"
 #endif
@@ -88,11 +111,16 @@
 //3DNOW versions
 #ifdef COMPILE_3DNOW
 #undef RENAME
-#define HAVE_MMX
+#undef HAVE_MMX
 #undef HAVE_MMX2
-#define HAVE_3DNOW
+#undef HAVE_3DNOW
 #undef HAVE_SSE
 #undef HAVE_SSE2
+#define HAVE_MMX 1
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 1
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
 #define RENAME(a) a ## _3DNow
 #include "aclib_template.c"
 #endif
@@ -100,11 +128,16 @@
 //SSE versions (only used on SSE2 cpus)
 #ifdef COMPILE_SSE
 #undef RENAME
-#define HAVE_MMX
-#define HAVE_MMX2
+#undef HAVE_MMX
+#undef HAVE_MMX2
 #undef HAVE_3DNOW
-#define HAVE_SSE
-#define HAVE_SSE2
+#undef HAVE_SSE
+#undef HAVE_SSE2
+#define HAVE_MMX 1
+#define HAVE_MMX2 1
+#define HAVE_3DNOW 0
+#define HAVE_SSE 1
+#define HAVE_SSE2 1
 #define RENAME(a) a ## _SSE
 #include "aclib_template.c"
 #endif
@@ -130,13 +163,13 @@ void * fast_memcpy(void * to, const void
 #endif //CAN_COMPILE_X86_ASM
 		memcpy(to, from, len); // prior to mmx we use the standart memcpy
 #else
-#ifdef HAVE_SSE2
+#if HAVE_SSE2
 		fast_memcpy_SSE(to, from, len);
-#elif defined (HAVE_MMX2)
+#elif HAVE_MMX2
 		fast_memcpy_MMX2(to, from, len);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
 		fast_memcpy_3DNow(to, from, len);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
 		fast_memcpy_MMX(to, from, len);
 #else
 		memcpy(to, from, len); // prior to mmx we use the standart memcpy
@@ -164,13 +197,13 @@ void * mem2agpcpy(void * to, const void 
 #endif //CAN_COMPILE_X86_ASM
 		memcpy(to, from, len); // prior to mmx we use the standart memcpy
 #else
-#ifdef HAVE_SSE2
+#if HAVE_SSE2
 		mem2agpcpy_SSE(to, from, len);
-#elif defined (HAVE_MMX2)
+#elif HAVE_MMX2
 		mem2agpcpy_MMX2(to, from, len);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
 		mem2agpcpy_3DNow(to, from, len);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
 		mem2agpcpy_MMX(to, from, len);
 #else
 		memcpy(to, from, len); // prior to mmx we use the standart memcpy

Modified: trunk/libvo/aclib_template.c
==============================================================================
--- trunk/libvo/aclib_template.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libvo/aclib_template.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -3,7 +3,7 @@
   This file contains functions which improve and expand standard C-library
 */
 
-#ifndef HAVE_SSE2
+#if !HAVE_SSE2
 /*
    P3 processor has only one SSE decoder so can execute only 1 sse insn per
    cpu clock, but it has 3 mmx decoders (include load/store unit)
@@ -13,6 +13,7 @@
    I have doubts. Anyway SSE2 version of this code can be written better.
 */
 #undef HAVE_SSE
+#define HAVE_SSE 0
 #endif
 
 
@@ -65,7 +66,7 @@ If you have questions please contact wit
 
 
 #undef HAVE_ONLY_MMX1
-#if defined(HAVE_MMX) && !defined(HAVE_MMX2) && !defined(HAVE_3DNOW) && !defined(HAVE_SSE)
+#if HAVE_MMX && !HAVE_MMX2 && !HAVE_3DNOW && !HAVE_SSE
 /*  means: mmx v.1. Note: Since we added alignment of destinition it speedups
     of memory copying on PentMMX, Celeron-1 and P2 upto 12% versus
     standard (non MMX-optimized) version.
@@ -76,7 +77,7 @@ If you have questions please contact wit
 
 
 #undef HAVE_K6_2PLUS
-#if !defined( HAVE_MMX2) && defined( HAVE_3DNOW)
+#if !HAVE_MMX2 && HAVE_3DNOW
 #define HAVE_K6_2PLUS
 #endif
 
@@ -95,7 +96,7 @@ __asm__ volatile(\
 }
 
 #undef MMREG_SIZE
-#ifdef HAVE_SSE
+#if HAVE_SSE
 #define MMREG_SIZE 16
 #else
 #define MMREG_SIZE 64 //8
@@ -104,23 +105,23 @@ __asm__ volatile(\
 #undef PREFETCH
 #undef EMMS
 
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 #define PREFETCH "prefetchnta"
-#elif defined ( HAVE_3DNOW )
+#elif HAVE_3DNOW
 #define PREFETCH  "prefetch"
 #else
 #define PREFETCH " # nop"
 #endif
 
 /* On K6 femms is faster of emms. On K7 femms is directly mapped on emms. */
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
 #define EMMS     "femms"
 #else
 #define EMMS     "emms"
 #endif
 
 #undef MOVNTQ
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 #define MOVNTQ "movntq"
 #else
 #define MOVNTQ "movq"
@@ -183,7 +184,7 @@ static void * RENAME(fast_memcpy)(void *
            perform reading and writing to be multiple to a number of
            processor's decoders, but it's not always possible.
         */
-#ifdef HAVE_SSE /* Only P3 (may be Cyrix3) */
+#if HAVE_SSE /* Only P3 (may be Cyrix3) */
 	if(((unsigned long)from) & 15)
 	/* if SRC is misaligned */
 	for(; i>0; i--)
@@ -343,12 +344,12 @@ static void * RENAME(fast_memcpy)(void *
 	}
 
 #endif /* Have SSE */
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
                 /* since movntq is weakly-ordered, a "sfence"
 		 * is needed to become ordered again. */
 		__asm__ volatile ("sfence":::"memory");
 #endif
-#ifndef HAVE_SSE
+#if !HAVE_SSE
 		/* enables to use FPU */
 		__asm__ volatile (EMMS:::"memory");
 #endif
@@ -427,7 +428,7 @@ static void * RENAME(mem2agpcpy)(void * 
 		from=((const unsigned char *)from)+64;
 		to=((unsigned char *)to)+64;
 	}
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
                 /* since movntq is weakly-ordered, a "sfence"
 		 * is needed to become ordered again. */
 		__asm__ volatile ("sfence":::"memory");

Modified: trunk/libvo/osd.c
==============================================================================
--- trunk/libvo/osd.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libvo/osd.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -11,7 +11,7 @@
 #include <inttypes.h>
 #include "cpudetect.h"
 
-#ifdef ARCH_X86
+#if ARCH_X86
 #define CAN_COMPILE_X86_ASM
 #endif
 
@@ -23,21 +23,21 @@ static const unsigned long long mask24hl
 
 //Note: we have C, X86-nommx, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one
 //Plain C versions
-#if !defined (HAVE_MMX) || defined (RUNTIME_CPUDETECT)
+#if !HAVE_MMX || defined (RUNTIME_CPUDETECT)
 #define COMPILE_C
 #endif
 
 #ifdef CAN_COMPILE_X86_ASM
 
-#if (defined (HAVE_MMX) && !defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)
+#if (HAVE_MMX && !HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
 #define COMPILE_MMX
 #endif
 
-#if defined (HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
+#if HAVE_MMX2 || defined (RUNTIME_CPUDETECT)
 #define COMPILE_MMX2
 #endif
 
-#if (defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)
+#if (HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
 #define COMPILE_3DNOW
 #endif
 #endif //CAN_COMPILE_X86_ASM
@@ -45,6 +45,9 @@ static const unsigned long long mask24hl
 #undef HAVE_MMX
 #undef HAVE_MMX2
 #undef HAVE_3DNOW
+#define HAVE_MMX 0
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
 
 #ifndef CAN_COMPILE_X86_ASM
 
@@ -52,6 +55,9 @@ static const unsigned long long mask24hl
 #undef HAVE_MMX
 #undef HAVE_MMX2
 #undef HAVE_3DNOW
+#define HAVE_MMX 0
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
 #define RENAME(a) a ## _C
 #include "osd_template.c"
 #endif
@@ -64,6 +70,9 @@ static const unsigned long long mask24hl
 #undef HAVE_MMX
 #undef HAVE_MMX2
 #undef HAVE_3DNOW
+#define HAVE_MMX 0
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
 #define RENAME(a) a ## _X86
 #include "osd_template.c"
 #endif
@@ -71,9 +80,12 @@ static const unsigned long long mask24hl
 //MMX versions
 #ifdef COMPILE_MMX
 #undef RENAME
-#define HAVE_MMX
+#undef HAVE_MMX
 #undef HAVE_MMX2
 #undef HAVE_3DNOW
+#define HAVE_MMX 1
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
 #define RENAME(a) a ## _MMX
 #include "osd_template.c"
 #endif
@@ -81,9 +93,12 @@ static const unsigned long long mask24hl
 //MMX2 versions
 #ifdef COMPILE_MMX2
 #undef RENAME
-#define HAVE_MMX
-#define HAVE_MMX2
+#undef HAVE_MMX
+#undef HAVE_MMX2
 #undef HAVE_3DNOW
+#define HAVE_MMX 1
+#define HAVE_MMX2 1
+#define HAVE_3DNOW 0
 #define RENAME(a) a ## _MMX2
 #include "osd_template.c"
 #endif
@@ -91,9 +106,12 @@ static const unsigned long long mask24hl
 //3DNOW versions
 #ifdef COMPILE_3DNOW
 #undef RENAME
-#define HAVE_MMX
+#undef HAVE_MMX
 #undef HAVE_MMX2
-#define HAVE_3DNOW
+#undef HAVE_3DNOW
+#define HAVE_MMX 1
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 1
 #define RENAME(a) a ## _3DNow
 #include "osd_template.c"
 #endif
@@ -116,13 +134,13 @@ void vo_draw_alpha_yv12(int w,int h, uns
 		vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride);
 #endif
 #else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 		vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
 		vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
 		vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined(ARCH_X86)
+#elif ARCH_X86
 		vo_draw_alpha_yv12_X86(w, h, src, srca, srcstride, dstbase, dststride);
 #else
 		vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride);
@@ -146,13 +164,13 @@ void vo_draw_alpha_yuy2(int w,int h, uns
 		vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride);
 #endif
 #else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 		vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
 		vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
 		vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined(ARCH_X86)
+#elif ARCH_X86
 		vo_draw_alpha_yuy2_X86(w, h, src, srca, srcstride, dstbase, dststride);
 #else
 		vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride);
@@ -176,13 +194,13 @@ void vo_draw_alpha_uyvy(int w,int h, uns
 		vo_draw_alpha_uyvy_C(w, h, src, srca, srcstride, dstbase, dststride);
 #endif
 #else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 		vo_draw_alpha_uyvy_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
 		vo_draw_alpha_uyvy_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
 		vo_draw_alpha_uyvy_MMX(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined(ARCH_X86)
+#elif ARCH_X86
 		vo_draw_alpha_uyvy_X86(w, h, src, srca, srcstride, dstbase, dststride);
 #else
 		vo_draw_alpha_uyvy_C(w, h, src, srca, srcstride, dstbase, dststride);
@@ -206,13 +224,13 @@ void vo_draw_alpha_rgb24(int w,int h, un
 		vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride);
 #endif
 #else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 		vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
 		vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
 		vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined(ARCH_X86)
+#elif ARCH_X86
 		vo_draw_alpha_rgb24_X86(w, h, src, srca, srcstride, dstbase, dststride);
 #else
 		vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride);
@@ -236,13 +254,13 @@ void vo_draw_alpha_rgb32(int w,int h, un
 		vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride);
 #endif
 #else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 		vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
 		vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
 		vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined(ARCH_X86)
+#elif ARCH_X86
 		vo_draw_alpha_rgb32_X86(w, h, src, srca, srcstride, dstbase, dststride);
 #else
 		vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride);
@@ -281,13 +299,13 @@ void vo_draw_alpha_init(void){
 			mp_msg(MSGT_OSD,MSGL_INFO,"Using Unoptimized OnScreenDisplay\n");
 #endif
 #else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
 			mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay\n");
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
 			mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit 3DNow) Optimized OnScreenDisplay\n");
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
 			mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX Optimized OnScreenDisplay\n");
-#elif defined(ARCH_X86)
+#elif ARCH_X86
 			mp_msg(MSGT_OSD,MSGL_INFO,"Using X86 Optimized OnScreenDisplay\n");
 #else
 			mp_msg(MSGT_OSD,MSGL_INFO,"Using Unoptimized OnScreenDisplay\n");

Modified: trunk/libvo/osd_template.c
==============================================================================
--- trunk/libvo/osd_template.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/libvo/osd_template.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -7,11 +7,11 @@
 #undef PREFETCHW
 #undef PAVGB
 
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
 #define PREFETCH  "prefetch"
 #define PREFETCHW "prefetchw"
 #define PAVGB	  "pavgusb"
-#elif defined ( HAVE_MMX2 )
+#elif HAVE_MMX2
 #define PREFETCH "prefetchnta"
 #define PREFETCHW "prefetcht0"
 #define PAVGB	  "pavgb"
@@ -20,7 +20,7 @@
 #define PREFETCHW " # nop"
 #endif
 
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
 /* On K6 femms is faster of emms. On K7 femms is directly mapped on emms. */
 #define EMMS     "femms"
 #else
@@ -29,10 +29,10 @@
 
 static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
     int y;
-#if defined(FAST_OSD) && !defined(HAVE_MMX)
+#if defined(FAST_OSD) && !HAVE_MMX
     w=w>>1;
 #endif
-#ifdef HAVE_MMX
+#if HAVE_MMX
     __asm__ volatile(
         "pcmpeqb %%mm5, %%mm5\n\t" // F..F
         "movq %%mm5, %%mm4\n\t"
@@ -43,7 +43,7 @@ static inline void RENAME(vo_draw_alpha_
 #endif
     for(y=0;y<h;y++){
         register int x;
-#ifdef HAVE_MMX
+#if HAVE_MMX
     __asm__ volatile(
 	PREFETCHW" %0\n\t"
 	PREFETCH" %1\n\t"
@@ -91,7 +91,7 @@ static inline void RENAME(vo_draw_alpha_
         srca+=srcstride;
         dstbase+=dststride;
     }
-#ifdef HAVE_MMX
+#if HAVE_MMX
 	__asm__ volatile(EMMS:::"memory");
 #endif
     return;
@@ -99,10 +99,10 @@ static inline void RENAME(vo_draw_alpha_
 
 static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
     int y;
-#if defined(FAST_OSD) && !defined(HAVE_MMX)
+#if defined(FAST_OSD) && !HAVE_MMX
     w=w>>1;
 #endif
-#ifdef HAVE_MMX
+#if HAVE_MMX
     __asm__ volatile(
         "pxor %%mm7, %%mm7\n\t"
         "pcmpeqb %%mm5, %%mm5\n\t" // F..F
@@ -114,7 +114,7 @@ static inline void RENAME(vo_draw_alpha_
 #endif
     for(y=0;y<h;y++){
         register int x;
-#ifdef HAVE_MMX
+#if HAVE_MMX
     __asm__ volatile(
 	PREFETCHW" %0\n\t"
 	PREFETCH" %1\n\t"
@@ -163,7 +163,7 @@ static inline void RENAME(vo_draw_alpha_
         srca+=srcstride;
         dstbase+=dststride;
     }
-#ifdef HAVE_MMX
+#if HAVE_MMX
 	__asm__ volatile(EMMS:::"memory");
 #endif
     return;
@@ -195,7 +195,7 @@ static inline void RENAME(vo_draw_alpha_
 
 static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
     int y;
-#ifdef HAVE_MMX
+#if HAVE_MMX
     __asm__ volatile(
         "pxor %%mm7, %%mm7\n\t"
         "pcmpeqb %%mm6, %%mm6\n\t" // F..F
@@ -204,8 +204,8 @@ static inline void RENAME(vo_draw_alpha_
     for(y=0;y<h;y++){
         register unsigned char *dst = dstbase;
         register int x;
-#if defined(ARCH_X86) && (!defined(ARCH_X86_64) || defined(HAVE_MMX))
-#ifdef HAVE_MMX
+#if ARCH_X86 && (!ARCH_X86_64 || HAVE_MMX)
+#if HAVE_MMX
     __asm__ volatile(
 	PREFETCHW" %0\n\t"
 	PREFETCH" %1\n\t"
@@ -295,7 +295,7 @@ static inline void RENAME(vo_draw_alpha_
         srca+=srcstride;
         dstbase+=dststride;
     }
-#ifdef HAVE_MMX
+#if HAVE_MMX
 	__asm__ volatile(EMMS:::"memory");
 #endif
     return;
@@ -306,8 +306,8 @@ static inline void RENAME(vo_draw_alpha_
 #ifdef WORDS_BIGENDIAN
     dstbase++;
 #endif
-#ifdef HAVE_MMX
-#ifdef HAVE_3DNOW
+#if HAVE_MMX
+#if HAVE_3DNOW
     __asm__ volatile(
         "pxor %%mm7, %%mm7\n\t"
         "pcmpeqb %%mm6, %%mm6\n\t" // F..F
@@ -324,9 +324,9 @@ static inline void RENAME(vo_draw_alpha_
 #endif /* HAVE_MMX */
     for(y=0;y<h;y++){
         register int x;
-#if defined(ARCH_X86) && (!defined(ARCH_X86_64) || defined(HAVE_MMX))
-#ifdef HAVE_MMX
-#ifdef HAVE_3DNOW
+#if ARCH_X86 && (!ARCH_X86_64 || HAVE_MMX)
+#if HAVE_MMX
+#if HAVE_3DNOW
     __asm__ volatile(
 	PREFETCHW" %0\n\t"
 	PREFETCH" %1\n\t"
@@ -460,7 +460,7 @@ static inline void RENAME(vo_draw_alpha_
         srca+=srcstride;
         dstbase+=dststride;
     }
-#ifdef HAVE_MMX
+#if HAVE_MMX
 	__asm__ volatile(EMMS:::"memory");
 #endif
     return;

Modified: trunk/mp3lib/decod386.c
==============================================================================
--- trunk/mp3lib/decod386.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/mp3lib/decod386.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -102,7 +102,7 @@ static int synth_1to1_mono2stereo(real *
 
 static synth_func_t synth_func;
 
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
 #define dct64_base(a,b,c) if(gCpuCaps.hasAltiVec) dct64_altivec(a,b,c); else dct64(a,b,c)
 #else /* HAVE_ALTIVEC */
 #define dct64_base(a,b,c) dct64(a,b,c)
@@ -121,7 +121,7 @@ static int synth_1to1(real *bandPtr,int 
   *pnt += 128;
 
 /* optimized for x86 */
-#ifdef ARCH_X86
+#if ARCH_X86
   if ( synth_func )
    {
 //    printf("Calling %p, bandPtr=%p channel=%d samples=%p\n",synth_func,bandPtr,channel,samples);

Modified: trunk/mp3lib/sr1.c
==============================================================================
--- trunk/mp3lib/sr1.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/mp3lib/sr1.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -27,10 +27,12 @@
 
 #include "libvo/fastmemcpy.h"
 
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
 // 3DNow! and 3DNow!Ext routines don't compile under AMD64
 #undef HAVE_3DNOW
 #undef HAVE_3DNOWEX
+#define HAVE_3DNOW 0
+#define HAVE_3DNOWEX 0
 #endif
 
 //static FILE* mp3_file=NULL;
@@ -134,7 +136,7 @@ LOCAL unsigned int getbits_fast(short nu
 //  if(MP3_frames>=7741) printf("getbits_fast: bits=%d  bitsleft=%d  wordptr=%x\n",number_of_bits,bitsleft,wordpointer);
   if((bitsleft-=number_of_bits)<0) return 0;
   if(!number_of_bits) return 0;
-#ifdef ARCH_X86
+#if ARCH_X86
   rval = bswap_16(*((uint16_t *)wordpointer));
 #else
   /*
@@ -177,7 +179,7 @@ LOCAL void set_pointer(int backstep)
 
 LOCAL int stream_head_read(unsigned char *hbuf,uint32_t *newhead){
   if(mp3_read(hbuf,4) != 4) return FALSE;
-#ifdef ARCH_X86
+#if ARCH_X86
   *newhead = bswap_32(*((uint32_t*)hbuf));
 #else
   /*
@@ -413,7 +415,7 @@ void MP3_Init(void){
 
     make_decode_tables(outscale);
 
-#ifdef HAVE_MMX
+#if HAVE_MMX
     if (gCpuCaps.hasMMX)
     {
 	_has_mmx = 1;
@@ -421,7 +423,7 @@ void MP3_Init(void){
     }
 #endif
 
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
     if (gCpuCaps.has3DNowExt)
     {
 	dct36_func=dct36_3dnowex;
@@ -430,7 +432,7 @@ void MP3_Init(void){
     }
     else
 #endif
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
     if (gCpuCaps.has3DNow)
     {
 	dct36_func = dct36_3dnow;
@@ -439,7 +441,7 @@ void MP3_Init(void){
     }
     else
 #endif
-#ifdef HAVE_SSE
+#if HAVE_SSE
     if (gCpuCaps.hasSSE)
     {
 	dct64_MMX_func = dct64_sse;
@@ -447,8 +449,8 @@ void MP3_Init(void){
     }
     else
 #endif
-#ifdef ARCH_X86_32
-#ifdef HAVE_MMX
+#if ARCH_X86_32
+#if HAVE_MMX
     if (gCpuCaps.hasMMX)
     {
 	dct64_MMX_func = dct64_MMX;
@@ -463,7 +465,7 @@ void MP3_Init(void){
     }
     else
 #endif /* ARCH_X86_32 */
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
     if (gCpuCaps.hasAltiVec)
     {
 	mp_msg(MSGT_DECAUDIO,MSGL_V,"mp3lib: using AltiVec optimized decore!\n");

Modified: trunk/vidix/dha.c
==============================================================================
--- trunk/vidix/dha.c	Fri Jan 16 09:45:35 2009	(r28324)
+++ trunk/vidix/dha.c	Fri Jan 16 10:21:21 2009	(r28325)
@@ -43,7 +43,7 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
 #include <sys/io.h>
 #endif
 #include <unistd.h>
@@ -91,7 +91,7 @@ static int mem_fd = -1;
 
 void *map_phys_mem(unsigned long base, unsigned long size)
 {    
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
 /* TODO: move it into sysdep */
   base += bus_base();
 #endif



More information about the MPlayer-cvslog mailing list