diff options
46 files changed, 271 insertions, 215 deletions
diff --git a/liba52/a52_internal.h b/liba52/a52_internal.h index 3854c16707..1f6d205931 100644 --- a/liba52/a52_internal.h +++ b/liba52/a52_internal.h @@ -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" diff --git a/liba52/bitstream.h b/liba52/bitstream.h index 63b1823b17..fcf2e47390 100644 --- a/liba52/bitstream.h +++ b/liba52/bitstream.h @@ -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__ diff --git a/liba52/downmix.c b/liba52/downmix.c index ffb149b760..c44317fd6f 100644 --- a/liba52/downmix.c +++ b/liba52/downmix.c @@ -56,7 +56,7 @@ void downmix_accel_init(uint32_t mm_accel) { 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 acmod, int output) } } -#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( diff --git a/liba52/imdct.c b/liba52/imdct.c index 325461c6fd..9ad36249d6 100644 --- a/liba52/imdct.c +++ b/liba52/imdct.c @@ -54,6 +54,7 @@ void (*a52_imdct_512) (sample_t * data, sample_t * delay, sample_t bias); #ifdef RUNTIME_CPUDETECT #undef HAVE_3DNOWEX +#define HAVE_3DNOWEX 0 #endif typedef struct complex_s { @@ -118,7 +119,7 @@ static complex_t __attribute__((aligned(16))) * w[7] = {w_1, w_2, w_4, w_8, w_16 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, sample_t * delay, sample_t bias) } } -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC #ifdef HAVE_ALTIVEC_H #include <altivec.h> @@ -710,10 +711,9 @@ imdct_do_512_altivec(sample_t data[],sample_t delay[], sample_t bias) // 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 __attribute__ ((aligned (8))) = {{ 0x80000000 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; diff --git a/liba52/resample.c b/liba52/resample.c index cd87f2050c..7284f567f7 100644 --- a/liba52/resample.c +++ b/liba52/resample.c @@ -38,18 +38,18 @@ int (* a52_resample) (float * _f, int16_t * s16)=NULL; #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){ diff --git a/liba52/resample_mmx.c b/liba52/resample_mmx.c index 9a37fd4ad3..782d9cd3f0 100644 --- a/liba52/resample_mmx.c +++ b/liba52/resample_mmx.c @@ -76,7 +76,7 @@ static int a52_resample_MONO_to_5_MMX(float * _f, int16_t * s16){ 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" diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index 7d38891c1a..59c67b83db 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -370,7 +370,7 @@ void *decode_video(sh_video_t *sh_video, unsigned char *start, int in_size, //------------------------ 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) { diff --git a/libmpcodecs/pullup.c b/libmpcodecs/pullup.c index f71bf790ce..b4b8f2c17d 100644 --- a/libmpcodecs/pullup.c +++ b/libmpcodecs/pullup.c @@ -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_context *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; diff --git a/libmpcodecs/vd_libmpeg2.c b/libmpcodecs/vd_libmpeg2.c index 811701d837..fdcb5cd2e3 100644 --- a/libmpcodecs/vd_libmpeg2.c +++ b/libmpcodecs/vd_libmpeg2.c @@ -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; diff --git a/libmpcodecs/vf_decimate.c b/libmpcodecs/vf_decimate.c index 72d7e8ad19..e1cea34ae3 100644 --- a/libmpcodecs/vf_decimate.c +++ b/libmpcodecs/vf_decimate.c @@ -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* args) 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; diff --git a/libmpcodecs/vf_divtc.c b/libmpcodecs/vf_divtc.c index d06169cac0..1d55dc1eed 100644 --- a/libmpcodecs/vf_divtc.c +++ b/libmpcodecs/vf_divtc.c @@ -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* args) goto nomem; diff= -#ifdef HAVE_MMX +#if HAVE_MMX gCpuCaps.hasMMX?diff_MMX: #endif diff_C; diff --git a/libmpcodecs/vf_eq.c b/libmpcodecs/vf_eq.c index 97d4270af6..ea9efdf30f 100644 --- a/libmpcodecs/vf_eq.c +++ b/libmpcodecs/vf_eq.c @@ -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* args) 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 diff --git a/libmpcodecs/vf_eq2.c b/libmpcodecs/vf_eq2.c index b3a501719f..ee66acde77 100644 --- a/libmpcodecs/vf_eq2.c +++ b/libmpcodecs/vf_eq2.c @@ -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; } diff --git a/libmpcodecs/vf_fspp.c b/libmpcodecs/vf_fspp.c index d865d7210c..a5e360306f 100644 --- a/libmpcodecs/vf_fspp.c +++ b/libmpcodecs/vf_fspp.c @@ -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_s* vf, mp_image_t *mpi, double pts) } } -#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(1.082392200, 13); #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* thr_adr, DCTELEM *data, DCTELEM *output, #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* workspace, #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) { diff --git a/libmpcodecs/vf_halfpack.c b/libmpcodecs/vf_halfpack.c index 344de2f0fb..44854d7948 100644 --- a/libmpcodecs/vf_halfpack.c +++ b/libmpcodecs/vf_halfpack.c @@ -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* args) 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; diff --git a/libmpcodecs/vf_hue.c b/libmpcodecs/vf_hue.c index 317d3b027d..f9f53cfcf6 100644 --- a/libmpcodecs/vf_hue.c +++ b/libmpcodecs/vf_hue.c @@ -160,7 +160,7 @@ static int open(vf_instance_t *vf, char* args) vf->priv->hue *= M_PI / 180.0; process = process_C; -#ifdef HAVE_MMXX +#if HAVE_MMXX if(gCpuCaps.hasMMX) process = process_MMX; #endif diff --git a/libmpcodecs/vf_ilpack.c b/libmpcodecs/vf_ilpack.c index 8b5fe1ceb4..b9e6bbcb2f 100644 --- a/libmpcodecs/vf_ilpack.c +++ b/libmpcodecs/vf_ilpack.c @@ -57,7 +57,7 @@ static void pack_li_1_C(unsigned char *dst, unsigned char *y, } } -#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 *dst, unsigned char *y, { __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 *dst, unsigned char *y, "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 *dst, unsigned char *y, { __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 *dst, unsigned char *y, "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* args) 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; diff --git a/libmpcodecs/vf_ivtc.c b/libmpcodecs/vf_ivtc.c index 5d9859068f..8efd79a225 100644 --- a/libmpcodecs/vf_ivtc.c +++ b/libmpcodecs/vf_ivtc.c @@ -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* args) 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; diff --git a/libmpcodecs/vf_noise.c b/libmpcodecs/vf_noise.c index 88c577a32e..4704e8fa1b 100644 --- a/libmpcodecs/vf_noise.c +++ b/libmpcodecs/vf_noise.c @@ -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 *dst, uint8_t *src, int8_t *noise, int #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 *dst, uint8_t *src, int8_t *noise, int le /***************************************************************************/ -#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_s* vf, mp_image_t *mpi, double pts){ 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* args){ } -#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 diff --git a/libmpcodecs/vf_pp7.c b/libmpcodecs/vf_pp7.c index 2e3fe3d61e..88b9d9261d 100644 --- a/libmpcodecs/vf_pp7.c +++ b/libmpcodecs/vf_pp7.c @@ -155,7 +155,7 @@ static void dctB_c(DCTELEM *dst, DCTELEM *src){ } } -#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_s* vf, mp_image_t *mpi, double pts){ 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* args){ case 2: requantize= mediumthresh_c; break; } -#ifdef HAVE_MMX +#if HAVE_MMX if(gCpuCaps.hasMMX){ dctB= dctB_mmx; } diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c index 6ed49901c3..b6c683c430 100644 --- a/libmpcodecs/vf_scale.c +++ b/libmpcodecs/vf_scale.c @@ -556,7 +556,7 @@ void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, Sw 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 diff --git a/libmpcodecs/vf_spp.c b/libmpcodecs/vf_spp.c index 0f6867473a..24ace868e2 100644 --- a/libmpcodecs/vf_spp.c +++ b/libmpcodecs/vf_spp.c @@ -146,7 +146,7 @@ static void softthresh_c(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *perm } } -#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, int16_t *src, int dst_stride, int src_st } } -#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_s* vf, mp_image_t *mpi, double pts){ } } -#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* args){ 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){ diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c index df341cea59..3cc027913b 100644 --- a/libmpcodecs/vf_tfields.c +++ b/libmpcodecs/vf_tfields.c @@ -46,7 +46,7 @@ static void deint(unsigned char *dest, int ds, unsigned char *src, int ss, int w } } -#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 *d, unsigned char *s, int w, int h, int } #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 *d, unsigned char *s, int w, int h, int d } #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* args) 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 |