From be34ba7a39fa9dfe50edb124a194156b4122145d Mon Sep 17 00:00:00 2001 From: aurel Date: Wed, 14 Jan 2009 00:13:56 +0000 Subject: Change semantic of CONFIG_*, HAVE_* and ARCH_*. They are now always defined to either 0 or 1. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28311 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/rgb2rgb.c | 32 +++++------ libswscale/rgb2rgb_template.c | 122 +++++++++++++++++++++--------------------- libswscale/swscale-example.c | 4 +- libswscale/swscale.c | 99 +++++++++++++++++++--------------- libswscale/swscale_internal.h | 10 ++-- libswscale/swscale_template.c | 86 ++++++++++++++--------------- libswscale/yuv2rgb.c | 22 ++++---- libswscale/yuv2rgb_template.c | 6 +-- 8 files changed, 195 insertions(+), 186 deletions(-) diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c index ac452a008a..5b79fea761 100644 --- a/libswscale/rgb2rgb.c +++ b/libswscale/rgb2rgb.c @@ -88,7 +88,7 @@ void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *sr long srcStride1, long srcStride2, long srcStride3, long dstStride); -#if defined(ARCH_X86) && defined(CONFIG_GPL) +#if ARCH_X86 && CONFIG_GPL DECLARE_ASM_CONST(8, uint64_t, mmx_null) = 0x0000000000000000ULL; DECLARE_ASM_CONST(8, uint64_t, mmx_one) = 0xFFFFFFFFFFFFFFFFULL; DECLARE_ASM_CONST(8, uint64_t, mask32b) = 0x000000FF000000FFULL; @@ -122,7 +122,7 @@ DECLARE_ASM_CONST(8, uint64_t, blue_16mask) = 0x0000001f0000001fULL; DECLARE_ASM_CONST(8, uint64_t, red_15mask) = 0x00007c0000007c00ULL; DECLARE_ASM_CONST(8, uint64_t, green_15mask) = 0x000003e0000003e0ULL; DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL; -#endif /* defined(ARCH_X86) */ +#endif /* ARCH_X86 */ #define RGB2YUV_SHIFT 8 #define BY ((int)( 0.098*(1<>1; for (y=0; y>1; for (y=0; y>1; for (y=0; y>1; for (y=0; y>1; -#ifdef HAVE_MMX +#if HAVE_MMX for (y=0; y>1); uint8_t* d=dst1+dstStride1*y; x=0; -#ifdef HAVE_MMX +#if HAVE_MMX for (;x>1); uint8_t* d=dst2+dstStride2*y; x=0; -#ifdef HAVE_MMX +#if HAVE_MMX for (;x>2); uint8_t* d=dst+dstStride*y; x=0; -#ifdef HAVE_MMX +#if HAVE_MMX for (;x #include "config.h" #include -#ifdef HAVE_SYS_MMAN_H +#if HAVE_SYS_MMAN_H #include #if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) #define MAP_ANONYMOUS MAP_ANON @@ -202,7 +202,7 @@ add BGR4 output support write special BGR->BGR scaler */ -#if defined(ARCH_X86) && defined (CONFIG_GPL) +#if ARCH_X86 && CONFIG_GPL DECLARE_ASM_CONST(8, uint64_t, bF8)= 0xF8F8F8F8F8F8F8F8LL; DECLARE_ASM_CONST(8, uint64_t, bFC)= 0xFCFCFCFCFCFCFCFCLL; DECLARE_ASM_CONST(8, uint64_t, w10)= 0x0010001000100010LL; @@ -257,7 +257,7 @@ DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUV[2][4]) = { DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUVOffset)= 0x0040400000404000ULL; -#endif /* defined(ARCH_X86) */ +#endif /* ARCH_X86 */ // clipping helper table for C implementations: static unsigned char clip_table[768]; @@ -947,27 +947,27 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t * //Note: we have C, X86, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one //Plain C versions -#if !defined (HAVE_MMX) || defined (RUNTIME_CPUDETECT) || !defined(CONFIG_GPL) +#if !HAVE_MMX || defined (RUNTIME_CPUDETECT) || !CONFIG_GPL #define COMPILE_C #endif -#ifdef ARCH_PPC -#if (defined (HAVE_ALTIVEC) || defined (RUNTIME_CPUDETECT)) && defined (CONFIG_GPL) +#if ARCH_PPC +#if (HAVE_ALTIVEC || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL #define COMPILE_ALTIVEC #endif //HAVE_ALTIVEC #endif //ARCH_PPC -#if defined(ARCH_X86) +#if ARCH_X86 -#if ((defined (HAVE_MMX) && !defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)) && defined (CONFIG_GPL) +#if ((HAVE_MMX && !HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL #define COMPILE_MMX #endif -#if (defined (HAVE_MMX2) || defined (RUNTIME_CPUDETECT)) && defined (CONFIG_GPL) +#if (HAVE_MMX2 || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL #define COMPILE_MMX2 #endif -#if ((defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)) && defined (CONFIG_GPL) +#if ((HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL #define COMPILE_3DNOW #endif #endif //ARCH_X86 || ARCH_X86_64 @@ -975,24 +975,26 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t * #undef HAVE_MMX #undef HAVE_MMX2 #undef HAVE_3DNOW +#undef HAVE_ALTIVEC +#define HAVE_MMX 0 +#define HAVE_MMX2 0 +#define HAVE_3DNOW 0 +#define HAVE_ALTIVEC 0 #ifdef COMPILE_C -#undef HAVE_MMX -#undef HAVE_MMX2 -#undef HAVE_3DNOW -#undef HAVE_ALTIVEC #define RENAME(a) a ## _C #include "swscale_template.c" #endif #ifdef COMPILE_ALTIVEC #undef RENAME -#define HAVE_ALTIVEC +#undef HAVE_ALTIVEC +#define HAVE_ALTIVEC 1 #define RENAME(a) a ## _altivec #include "swscale_template.c" #endif -#if defined(ARCH_X86) +#if ARCH_X86 //X86 versions /* @@ -1007,9 +1009,12 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t * //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 "swscale_template.c" #endif @@ -1017,9 +1022,12 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t * //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 "swscale_template.c" #endif @@ -1027,9 +1035,12 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t * //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 "swscale_template.c" #endif @@ -1061,7 +1072,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF int64_t *filter2=NULL; const int64_t fone= 1LL<<54; int ret= -1; -#if defined(ARCH_X86) +#if ARCH_X86 if (flags & SWS_CPU_CAPS_MMX) __asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions) #endif @@ -1617,8 +1628,8 @@ static void globalInit(void){ static SwsFunc getSwsFunc(int flags){ -#if defined(RUNTIME_CPUDETECT) && defined (CONFIG_GPL) -#if defined(ARCH_X86) +#if defined(RUNTIME_CPUDETECT) && CONFIG_GPL +#if ARCH_X86 // ordered per speed fastest first if (flags & SWS_CPU_CAPS_MMX2) return swScale_MMX2; @@ -1630,22 +1641,22 @@ static SwsFunc getSwsFunc(int flags){ return swScale_C; #else -#ifdef ARCH_PPC +#if ARCH_PPC if (flags & SWS_CPU_CAPS_ALTIVEC) return swScale_altivec; else return swScale_C; #endif return swScale_C; -#endif /* defined(ARCH_X86) */ +#endif /* ARCH_X86 */ #else //RUNTIME_CPUDETECT -#ifdef HAVE_MMX2 +#if HAVE_MMX2 return swScale_MMX2; -#elif defined (HAVE_3DNOW) +#elif HAVE_3DNOW return swScale_3DNow; -#elif defined (HAVE_MMX) +#elif HAVE_MMX return swScale_MMX; -#elif defined (HAVE_ALTIVEC) +#elif HAVE_ALTIVEC return swScale_altivec; #else return swScale_C; @@ -2169,22 +2180,22 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d int unscaled, needsDither; int srcRange, dstRange; SwsFilter dummyFilter= {NULL, NULL, NULL, NULL}; -#if defined(ARCH_X86) +#if ARCH_X86 if (flags & SWS_CPU_CAPS_MMX) __asm__ volatile("emms\n\t"::: "memory"); #endif -#if !defined(RUNTIME_CPUDETECT) || !defined (CONFIG_GPL) //ensure that the flags match the compiled variant if cpudetect is off +#if !defined(RUNTIME_CPUDETECT) || !CONFIG_GPL //ensure that the flags match the compiled variant if cpudetect is off flags &= ~(SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2|SWS_CPU_CAPS_3DNOW|SWS_CPU_CAPS_ALTIVEC|SWS_CPU_CAPS_BFIN); -#ifdef HAVE_MMX2 +#if HAVE_MMX2 flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2; -#elif defined (HAVE_3DNOW) +#elif HAVE_3DNOW flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_3DNOW; -#elif defined (HAVE_MMX) +#elif HAVE_MMX flags |= SWS_CPU_CAPS_MMX; -#elif defined (HAVE_ALTIVEC) +#elif HAVE_ALTIVEC flags |= SWS_CPU_CAPS_ALTIVEC; -#elif defined (ARCH_BFIN) +#elif ARCH_BFIN flags |= SWS_CPU_CAPS_BFIN; #endif #endif /* RUNTIME_CPUDETECT */ @@ -2311,7 +2322,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d { c->swScale= PlanarToNV12Wrapper; } -#ifdef CONFIG_GPL +#if CONFIG_GPL /* yuv2bgr */ if ((srcFormat==PIX_FMT_YUV420P || srcFormat==PIX_FMT_YUV422P) && (isBGR(dstFormat) || isRGB(dstFormat)) && !(flags & SWS_ACCURATE_RND) && !(dstH&1)) @@ -2410,7 +2421,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d c->swScale= gray16swap; } -#ifdef ARCH_BFIN +#if ARCH_BFIN if (flags & SWS_CPU_CAPS_BFIN) ff_bfin_get_unscaled_swscale (c); #endif @@ -2518,7 +2529,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d (flags&SWS_BICUBLIN) ? (flags|SWS_BILINEAR) : flags, srcFilter->chrV, dstFilter->chrV, c->param); -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC c->vYCoeffsBank = av_malloc(sizeof (vector signed short)*c->vLumFilterSize*c->dstH); c->vCCoeffsBank = av_malloc(sizeof (vector signed short)*c->vChrFilterSize*c->chrDstH); @@ -2648,7 +2659,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d } else { -#if defined(ARCH_X86) +#if ARCH_X86 av_log(c, AV_LOG_VERBOSE, "using X86-Asm scaler for horizontal scaling\n"); #else if (flags & SWS_FAST_BILINEAR) @@ -3115,7 +3126,7 @@ void sws_freeContext(SwsContext *c){ av_freep(&c->vChrFilter); av_freep(&c->hLumFilter); av_freep(&c->hChrFilter); -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC av_freep(&c->vYCoeffsBank); av_freep(&c->vCCoeffsBank); #endif @@ -3125,7 +3136,7 @@ void sws_freeContext(SwsContext *c){ av_freep(&c->hLumFilterPos); av_freep(&c->hChrFilterPos); -#if defined(ARCH_X86) && defined(CONFIG_GPL) +#if ARCH_X86 && CONFIG_GPL #ifdef MAP_ANONYMOUS if (c->funnyYCode) munmap(c->funnyYCode, MAX_FUNNY_CODE_SIZE); if (c->funnyUVCode) munmap(c->funnyUVCode, MAX_FUNNY_CODE_SIZE); @@ -3135,7 +3146,7 @@ void sws_freeContext(SwsContext *c){ #endif c->funnyYCode=NULL; c->funnyUVCode=NULL; -#endif /* defined(ARCH_X86) */ +#endif /* ARCH_X86 */ av_freep(&c->lumMmx2Filter); av_freep(&c->chrMmx2Filter); diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 48995571e0..b2505c0f7d 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -23,7 +23,7 @@ #include "config.h" -#ifdef HAVE_ALTIVEC_H +#if HAVE_ALTIVEC_H #include #endif @@ -42,7 +42,7 @@ #define ALT32_CORR 1 #endif -#ifdef ARCH_X86_64 +#if ARCH_X86_64 # define APCK_PTR2 8 # define APCK_COEF 16 # define APCK_SIZE 24 @@ -175,7 +175,7 @@ typedef struct SwsContext{ uint64_t u_temp __attribute__((aligned(8))); uint64_t v_temp __attribute__((aligned(8))); -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC vector signed short CY; vector signed short CRV; @@ -189,7 +189,7 @@ typedef struct SwsContext{ #endif -#ifdef ARCH_BFIN +#if ARCH_BFIN uint32_t oy __attribute__((aligned(4))); uint32_t oc __attribute__((aligned(4))); uint32_t zero __attribute__((aligned(4))); @@ -203,7 +203,7 @@ typedef struct SwsContext{ uint32_t gmask __attribute__((aligned(4))); #endif -#ifdef HAVE_VIS +#if HAVE_VIS uint64_t sparc_coeffs[10] __attribute__((aligned(8))); #endif diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 4c8bc6e066..2144b5a57c 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -29,17 +29,17 @@ #undef EMMS #undef SFENCE -#ifdef HAVE_3DNOW +#if HAVE_3DNOW /* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */ #define EMMS "femms" #else #define EMMS "emms" #endif -#ifdef HAVE_3DNOW +#if HAVE_3DNOW #define PREFETCH "prefetch" #define PREFETCHW "prefetchw" -#elif defined (HAVE_MMX2) +#elif HAVE_MMX2 #define PREFETCH "prefetchnta" #define PREFETCHW "prefetcht0" #else @@ -47,26 +47,26 @@ #define PREFETCHW " # nop" #endif -#ifdef HAVE_MMX2 +#if HAVE_MMX2 #define SFENCE "sfence" #else #define SFENCE " # nop" #endif -#ifdef HAVE_MMX2 +#if HAVE_MMX2 #define PAVGB(a,b) "pavgb " #a ", " #b " \n\t" -#elif defined (HAVE_3DNOW) +#elif HAVE_3DNOW #define PAVGB(a,b) "pavgusb " #a ", " #b " \n\t" #endif -#ifdef HAVE_MMX2 +#if HAVE_MMX2 #define REAL_MOVNTQ(a,b) "movntq " #a ", " #b " \n\t" #else #define REAL_MOVNTQ(a,b) "movq " #a ", " #b " \n\t" #endif #define MOVNTQ(a,b) REAL_MOVNTQ(a,b) -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC #include "swscale_altivec_template.c" #endif @@ -865,7 +865,7 @@ "cmp "#dstw", "#index" \n\t"\ " jb 1b \n\t" -#ifdef HAVE_MMX2 +#if HAVE_MMX2 #undef WRITEBGR24 #define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX2(dst, dstw, index) #else @@ -895,7 +895,7 @@ static inline void RENAME(yuv2yuvX)(SwsContext *c, int16_t *lumFilter, int16_t * int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, uint8_t *uDest, uint8_t *vDest, long dstW, long chrDstW) { -#ifdef HAVE_MMX +#if HAVE_MMX if(!(c->flags & SWS_BITEXACT)){ if (c->flags & SWS_ACCURATE_RND){ if (uDest){ @@ -915,7 +915,7 @@ static inline void RENAME(yuv2yuvX)(SwsContext *c, int16_t *lumFilter, int16_t * return; } #endif -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC yuv2yuvX_altivec_real(lumFilter, lumSrc, lumFilterSize, chrFilter, chrSrc, chrFilterSize, dest, uDest, vDest, dstW, chrDstW); @@ -939,7 +939,7 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chr uint8_t *dest, uint8_t *uDest, uint8_t *vDest, long dstW, long chrDstW) { int i; -#ifdef HAVE_MMX +#if HAVE_MMX if(!(c->flags & SWS_BITEXACT)){ long p= uDest ? 3 : 1; uint8_t *src[3]= {lumSrc + dstW, chrSrc + chrDstW, chrSrc + VOFW + chrDstW}; @@ -1006,7 +1006,7 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_ int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, long dstW, long dstY) { -#ifdef HAVE_MMX +#if HAVE_MMX long dummy=0; if(!(c->flags & SWS_BITEXACT)){ if (c->flags & SWS_ACCURATE_RND){ @@ -1133,7 +1133,7 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_ } } #endif /* HAVE_MMX */ -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC /* The following list of supported dstFormat values should match what's found in the body of altivec_yuv2packedX() */ if (c->dstFormat==PIX_FMT_ABGR || c->dstFormat==PIX_FMT_BGRA || @@ -1159,7 +1159,7 @@ static inline void RENAME(yuv2packed2)(SwsContext *c, uint16_t *buf0, uint16_t * int uvalpha1=4095-uvalpha; int i; -#ifdef HAVE_MMX +#if HAVE_MMX if(!(c->flags & SWS_BITEXACT)){ switch(c->dstFormat) { @@ -1270,7 +1270,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t * return; } -#ifdef HAVE_MMX +#if HAVE_MMX if(!(flags & SWS_BITEXACT)){ if (uvalpha < 2048) // note this is not correct (shifts chrominance by 0.5 pixels) but it is a bit faster { @@ -1464,7 +1464,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t * static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused) { -#ifdef HAVE_MMX +#if HAVE_MMX __asm__ volatile( "movq "MANGLE(bm01010101)", %%mm2 \n\t" "mov %0, %%"REG_a" \n\t" @@ -1489,7 +1489,7 @@ static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, long width, uint3 static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused) { -#ifdef HAVE_MMX +#if HAVE_MMX __asm__ volatile( "movq "MANGLE(bm01010101)", %%mm4 \n\t" "mov %0, %%"REG_a" \n\t" @@ -1526,7 +1526,7 @@ static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, * yuy2ToY/UV)(dst, src+1, ...) would have 100% unaligned accesses. */ static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused) { -#ifdef HAVE_MMX +#if HAVE_MMX __asm__ volatile( "mov %0, %%"REG_a" \n\t" "1: \n\t" @@ -1550,7 +1550,7 @@ static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, long width, uint3 static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused) { -#ifdef HAVE_MMX +#if HAVE_MMX __asm__ volatile( "movq "MANGLE(bm01010101)", %%mm4 \n\t" "mov %0, %%"REG_a" \n\t" @@ -1643,7 +1643,7 @@ BGR2UV(uint16_t, bgr15ToUV, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RU<<10, GU<<5, BU BGR2UV(uint16_t, rgb16ToUV, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RU , GU<<5, BU<<11, RV , GV<<5, BV<<11, RGB2YUV_SHIFT+8) BGR2UV(uint16_t, rgb15ToUV, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RU , GU<<5, BU<<10, RV , GV<<5, BV<<10, RGB2YUV_SHIFT+7) -#ifdef HAVE_MMX +#if HAVE_MMX static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, uint8_t *src, long width, int srcFormat) { @@ -1758,7 +1758,7 @@ static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, uint8_t * static inline void RENAME(bgr24ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused) { -#ifdef HAVE_MMX +#if HAVE_MMX RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_BGR24); #else int i; @@ -1775,7 +1775,7 @@ static inline void RENAME(bgr24ToY)(uint8_t *dst, uint8_t *src, long width, uint static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused) { -#ifdef HAVE_MMX +#if HAVE_MMX RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_BGR24); #else int i; @@ -1809,7 +1809,7 @@ static inline void RENAME(bgr24ToUV_half)(uint8_t *dstU, uint8_t *dstV, uint8_t static inline void RENAME(rgb24ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused) { -#ifdef HAVE_MMX +#if HAVE_MMX RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24); #else int i; @@ -1826,7 +1826,7 @@ static inline void RENAME(rgb24ToY)(uint8_t *dst, uint8_t *src, long width, uint static inline void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused) { -#ifdef HAVE_MMX +#if HAVE_MMX assert(src1==src2); RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_RGB24); #else @@ -1908,7 +1908,7 @@ static inline void RENAME(monoblack2Y)(uint8_t *dst, uint8_t *src, long width, u static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW, int xInc, int16_t *filter, int16_t *filterPos, long filterSize) { -#ifdef HAVE_MMX +#if HAVE_MMX assert(filterSize % 4 == 0 && filterSize>0); if (filterSize==4) // Always true for upscaling, sometimes for down, too. { @@ -2064,7 +2064,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW ); } #else -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC hScale_altivec_real(dst, dstW, src, srcW, xInc, filter, filterPos, filterSize); #else int i; @@ -2169,7 +2169,7 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, src= formatConvBuffer; } -#ifdef HAVE_MMX +#if HAVE_MMX // Use the new MMX scaler if the MMX2 one can't be used (it is faster than the x86 ASM one). if (!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed)) #else @@ -2180,8 +2180,8 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, } else // fast bilinear upscale / crap downscale { -#if defined(ARCH_X86) -#ifdef HAVE_MMX2 +#if ARCH_X86 +#if HAVE_MMX2 int i; #if defined(PIC) uint64_t ebxsave __attribute__((aligned(8))); @@ -2202,7 +2202,7 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, PREFETCH" 32(%%"REG_c") \n\t" PREFETCH" 64(%%"REG_c") \n\t" -#ifdef ARCH_X86_64 +#if ARCH_X86_64 #define FUNNY_Y_CODE \ "movl (%%"REG_b"), %%esi \n\t"\ @@ -2292,7 +2292,7 @@ FUNNY_Y_CODE :: "r" (src), "m" (dst), "m" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask) : "%"REG_a, "%"REG_d, "%ecx", "%"REG_D, "%esi" ); -#ifdef HAVE_MMX2 +#if HAVE_MMX2 } //if MMX2 can't be used #endif #else @@ -2305,7 +2305,7 @@ FUNNY_Y_CODE dst[i]= (src[xx]<<7) + (src[xx+1] - src[xx])*xalpha; xpos+=xInc; } -#endif /* defined(ARCH_X86) */ +#endif /* ARCH_X86 */ } if(c->srcRange != c->dstRange && !(isRGB(c->dstFormat) || isBGR(c->dstFormat))){ @@ -2441,7 +2441,7 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, src2= formatConvBuffer+VOFW; } -#ifdef HAVE_MMX +#if HAVE_MMX // Use the new MMX scaler if the MMX2 one can't be used (it is faster than the x86 ASM one). if (!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed)) #else @@ -2453,8 +2453,8 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, } else // fast bilinear upscale / crap downscale { -#if defined(ARCH_X86) -#ifdef HAVE_MMX2 +#if ARCH_X86 +#if HAVE_MMX2 int i; #if defined(PIC) uint64_t ebxsave __attribute__((aligned(8))); @@ -2475,7 +2475,7 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, PREFETCH" 32(%%"REG_c") \n\t" PREFETCH" 64(%%"REG_c") \n\t" -#ifdef ARCH_X86_64 +#if ARCH_X86_64 #define FUNNY_UV_CODE \ "movl (%%"REG_b"), %%esi \n\t"\ @@ -2573,7 +2573,7 @@ FUNNY_UV_CODE /* GCC 3.3 makes MPlayer crash on IA-32 machines when using "g" operand here, which is needed to support GCC 4.0. */ -#if defined(ARCH_X86_64) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +#if ARCH_X86_64 && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) :: "m" (src1), "m" (dst), "g" ((long)dstWidth), "m" (xInc_shr16), "m" (xInc_mask), #else :: "m" (src1), "m" (dst), "m" ((long)dstWidth), "m" (xInc_shr16), "m" (xInc_mask), @@ -2581,7 +2581,7 @@ FUNNY_UV_CODE "r" (src2) : "%"REG_a, "%"REG_d, "%ecx", "%"REG_D, "%esi" ); -#ifdef HAVE_MMX2 +#if HAVE_MMX2 } //if MMX2 can't be used #endif #else @@ -2599,7 +2599,7 @@ FUNNY_UV_CODE */ xpos+=xInc; } -#endif /* defined(ARCH_X86) */ +#endif /* ARCH_X86 */ } if(c->srcRange != c->dstRange && !(isRGB(c->dstFormat) || isBGR(c->dstFormat))){ int i; @@ -2821,7 +2821,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s break; //we can't output a dstY line so let's try with the next slice } -#ifdef HAVE_MMX +#if HAVE_MMX c->blueDither= ff_dither8[dstY&1]; if (c->dstFormat == PIX_FMT_RGB555 || c->dstFormat == PIX_FMT_BGR555) c->greenDither= ff_dither8[dstY&1]; @@ -2833,7 +2833,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s { int16_t **lumSrcPtr= lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize; int16_t **chrSrcPtr= chrPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize; -#ifdef HAVE_MMX +#if HAVE_MMX int i; if (flags & SWS_ACCURATE_RND){ int s= APCK_SIZE / 8; @@ -2987,7 +2987,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s } } -#ifdef HAVE_MMX +#if HAVE_MMX __asm__ volatile(SFENCE:::"memory"); __asm__ volatile(EMMS:::"memory"); #endif diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index d19430fd17..9dedd2a701 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -45,28 +45,26 @@ extern const uint8_t dither_8x8_32[8][8]; extern const uint8_t dither_8x8_73[8][8]; extern const uint8_t dither_8x8_220[8][8]; -#ifdef HAVE_MMX +#if HAVE_MMX /* hope these constant values are cache line aligned */ DECLARE_ASM_CONST(8, uint64_t, mmx_00ffw) = 0x00ff00ff00ff00ffULL; DECLARE_ASM_CONST(8, uint64_t, mmx_redmask) = 0xf8f8f8f8f8f8f8f8ULL; DECLARE_ASM_CONST(8, uint64_t, mmx_grnmask) = 0xfcfcfcfcfcfcfcfcULL; -#undef HAVE_MMX - //MMX versions #undef RENAME -#define HAVE_MMX #undef HAVE_MMX2 #undef HAVE_3DNOW +#define HAVE_MMX2 0 +#define HAVE_3DNOW 0 #define RENAME(a) a ## _MMX #include "yuv2rgb_template.c" //MMX2 versions #undef RENAME -#define HAVE_MMX -#define HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_MMX2 +#define HAVE_MMX2 1 #define RENAME(a) a ## _MMX2 #include "yuv2rgb_template.c" @@ -485,7 +483,7 @@ EPILOG(1) SwsFunc yuv2rgb_get_func_ptr (SwsContext *c) { -#if defined(HAVE_MMX2) || defined(HAVE_MMX) +#if HAVE_MMX2 || HAVE_MMX if (c->flags & SWS_CPU_CAPS_MMX2){ switch(c->dstFormat){ case PIX_FMT_RGB32: return yuv420_rgb32_MMX2; @@ -503,19 +501,19 @@ SwsFunc yuv2rgb_get_func_ptr (SwsContext *c) } } #endif -#ifdef HAVE_VIS +#if HAVE_VIS { SwsFunc t= yuv2rgb_init_vis(c); if (t) return t; } #endif -#ifdef CONFIG_MLIB +#if CONFIG_MLIB { SwsFunc t= yuv2rgb_init_mlib(c); if (t) return t; } #endif -#ifdef HAVE_ALTIVEC +#if HAVE_ALTIVEC if (c->flags & SWS_CPU_CAPS_ALTIVEC) { SwsFunc t = yuv2rgb_init_altivec(c); @@ -523,7 +521,7 @@ SwsFunc yuv2rgb_get_func_ptr (SwsContext *c) } #endif -#ifdef ARCH_BFIN +#if ARCH_BFIN if (c->flags & SWS_CPU_CAPS_BFIN) { SwsFunc t = ff_bfin_yuv2rgb_get_func_ptr (c); diff --git a/libswscale/yuv2rgb_template.c b/libswscale/yuv2rgb_template.c index e8b6ff30cf..c66f24edeb 100644 --- a/libswscale/yuv2rgb_template.c +++ b/libswscale/yuv2rgb_template.c @@ -30,14 +30,14 @@ #undef EMMS #undef SFENCE -#ifdef HAVE_3DNOW +#if HAVE_3DNOW /* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */ #define EMMS "femms" #else #define EMMS "emms" #endif -#ifdef HAVE_MMX2 +#if HAVE_MMX2 #define MOVNTQ "movntq" #define SFENCE "sfence" #else @@ -335,7 +335,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr "1: \n\t" YUV2RGB /* mm0=B, %%mm2=G, %%mm1=R */ -#ifdef HAVE_MMX2 +#if HAVE_MMX2 "movq "MANGLE(ff_M24A)", %%mm4 \n\t" "movq "MANGLE(ff_M24C)", %%mm7 \n\t" "pshufw $0x50, %%mm0, %%mm5 \n\t" /* B3 B2 B3 B2 B1 B0 B1 B0 */ -- cgit v1.2.3 From 7db7002523b03e81d7b9b104e7dbb75984ce94ee Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 15 Jan 2009 08:46:17 +0000 Subject: Update copyright year, patch by Zhou Zongyi, zhouzongyi pset.suntec net. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28312 b3059339-0415-0410-9bf9-f77b7e298cf2 --- osdep/mplayer.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osdep/mplayer.rc b/osdep/mplayer.rc index 3bcfdb2197..4b0c1cd74e 100644 --- a/osdep/mplayer.rc +++ b/osdep/mplayer.rc @@ -21,7 +21,7 @@ FILETYPE VFT_APP VALUE "FileDescription", "MPlayer - Movie Player\000" VALUE "FileVersion",VERSION VALUE "InternalName", "Counter Counter\000" - VALUE "LegalCopyright", " (C) 2000-2008 MPlayer Team\000" + VALUE "LegalCopyright", " (C) 2000-2009 MPlayer Team\000" //VALUE "LegalTrademarks"," \000"; VALUE "OriginalFilename", "mplayer.exe\000" VALUE "ProductName", "MPlayer - The Movie Player\000" -- cgit v1.2.3 From 16333e985a6f08758b1e7123472ed0e64f682162 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 15 Jan 2009 08:51:12 +0000 Subject: Mark internal libraries as such in the configure summary, fixes Bugzilla #1378. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28313 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/configure b/configure index c5196908e2..fcb8feabd8 100755 --- a/configure +++ b/configure @@ -6228,10 +6228,10 @@ if test "$_mp3lib" = auto ; then fi if test "$_mp3lib" = yes ; then _def_mp3lib='#define CONFIG_MP3LIB 1' - _codecmodules="mp3lib $_codecmodules" + _codecmodules="mp3lib(internal) $_codecmodules" else _def_mp3lib='#undef CONFIG_MP3LIB' - _nocodecmodules="mp3lib $_nocodecmodules" + _nocodecmodules="mp3lib(internal) $_nocodecmodules" fi echores "$_mp3lib" @@ -6276,10 +6276,10 @@ if test "$_libmpeg2" = auto ; then fi if test "$_libmpeg2" = yes ; then _def_libmpeg2='#define CONFIG_LIBMPEG2 1' - _codecmodules="libmpeg2 $_codecmodules" + _codecmodules="libmpeg2(internal) $_codecmodules" else _def_libmpeg2='#undef CONFIG_LIBMPEG2' - _nocodecmodules="libmpeg2 $_nocodecmodules" + _nocodecmodules="libmpeg2(internal) $_nocodecmodules" fi echores "$_libmpeg2" @@ -6410,7 +6410,11 @@ fi if test "$_faad" = yes ; then _def_faad='#define CONFIG_FAAD 1' - _codecmodules="faad2 $_codecmodules" + if test "$_faad_internal" = yes ; then + _codecmodules="faad2(internal) $_codecmodules" + else + _codecmodules="faad2 $_codecmodules" + fi else _faad=no _nocodecmodules="faad2 $_nocodecmodules" @@ -6692,7 +6696,7 @@ test "$_libavcodec_so" = yes && _def_libavcodec_so='#define CONFIG_LIBAVCODEC_SO test "$_libavcodec_mpegaudio_hp" = yes \ && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1' if test "$_libavcodec_a" = yes ; then - _codecmodules="libavcodec $_codecmodules" + _codecmodules="libavcodec(internal) $_codecmodules" elif test "$_libavcodec_so" = yes ; then _codecmodules="libavcodec.so $_codecmodules" else @@ -7809,11 +7813,12 @@ if test "$_dvdnav" = yes ; then _def_dvdnav='#define CONFIG_DVDNAV 1' if test "$dvdnav_internal" = yes ; then _inc_extra="$_inc_extra -Ilibdvdnav" + _inputmodules="dvdnav(internal) $_inputmodules" else _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`" _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`" + _inputmodules="dvdnav $_inputmodules" fi - _inputmodules="dvdnav $_inputmodules" else _def_dvdnav='#undef CONFIG_DVDNAV' _noinputmodules="dvdnav $_noinputmodules" -- cgit v1.2.3 From 5a1e1c63728c647fe8bdcf9d9b00d7c669eb3714 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 15 Jan 2009 15:40:12 +0000 Subject: SH4 is not a CPU extension mechanism. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28314 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index fcb8feabd8..764a6a1d6e 100755 --- a/configure +++ b/configure @@ -2611,7 +2611,7 @@ EOF echores "$_iwmmxt" fi -_cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP IWMMXT MLIB MMI SH4 VIS MVI' +_cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP IWMMXT MLIB MMI VIS MVI' test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts" test "$_mmx" = yes && _cpuexts="MMX $_cpuexts" test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts" -- cgit v1.2.3 From 2181a690e2d4962b91cbf29c9a30aeb1c8f971a3 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 15 Jan 2009 15:41:29 +0000 Subject: Treat SH architecture like SH4 like in FFmpeg, the only place it is used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28315 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 764a6a1d6e..96527c4298 100755 --- a/configure +++ b/configure @@ -1685,7 +1685,7 @@ EOF fi -_arch_all='X86 X86_32 X86_64 IA64 SPARC ARM SH PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC' +_arch_all='X86 X86_32 X86_64 IA64 SPARC ARM SH4 PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC' case "$host_arch" in i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) _arch='X86 X86_32' @@ -2044,10 +2044,10 @@ EOF iproc='arm' ;; - sh) - _arch='SH' - _target_arch='ARCH_SH = yes' - iproc='sh' + sh|sh4) + _arch='SH4' + _target_arch='ARCH_SH4 = yes' + iproc='sh4' ;; ppc|ppc64|powerpc|powerpc64) -- cgit v1.2.3 From 795372e836f5710fa33165a8da62d5030309aefb Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 15 Jan 2009 15:51:50 +0000 Subject: Treat mlib as a normal FFmpeg option, not a CPU extension. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28316 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 96527c4298..b7e1725979 100755 --- a/configure +++ b/configure @@ -2611,7 +2611,7 @@ EOF echores "$_iwmmxt" fi -_cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP IWMMXT MLIB MMI VIS MVI' +_cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP IWMMXT MMI VIS MVI' test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts" test "$_mmx" = yes && _cpuexts="MMX $_cpuexts" test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts" @@ -5532,6 +5532,7 @@ fi echores "$_sunaudio" +def_mlib='#define CONFIG_MLIB 0' if sunos; then echocheck "Sun mediaLib" if test "$_mlib" = auto ; then @@ -5540,9 +5541,8 @@ if test "$_mlib" = auto ; then #include int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; } EOF - cc_check -lmlib && _mlib=yes + cc_check -lmlib && _mlib=yes && def_mlib='#define CONFIG_MLIB 1' fi -test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts" echores "$_mlib" fi #if sunos @@ -8574,6 +8574,7 @@ $_def_libswscale_so $_def_dcbzl $def_fast_64bit $_def_fast_unaligned +$def_mlib $_def_mkstemp $_def_pthreads $_def_threads -- cgit v1.2.3 From f23a726b3631e028fd1df8e8f114a6e1a138f88c Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 15 Jan 2009 15:56:24 +0000 Subject: Sync with latest FFmpeg changes: #define disabled preprocessor directives used by FFmpeg to 0 instead of leaving them undefined. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28317 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure b/configure index b7e1725979..9949706ea3 100755 --- a/configure +++ b/configure @@ -2490,7 +2490,7 @@ if test $_yasm ; then _have_yasm="yes" echores "$_yasm" else - _def_yasm='#undef HAVE_YASM' + _def_yasm='#define HAVE_YASM 0' fft_mmx="no" _have_yasm="no" echores "no" @@ -8194,6 +8194,7 @@ for part in $1; do echo "#define ${_nprefix}_$part 1" echo "#define ENABLE_$part 1" else + echo "#define ${_nprefix}_$part 0" echo "#define ENABLE_$part 0" fi done -- cgit v1.2.3 From a41f7e04acfb2181f176a826f96fd540c31ada61 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 15 Jan 2009 15:57:19 +0000 Subject: Get rid of now unused FFmpeg ENABLE_ preprocessor directives. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28318 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/configure b/configure index 9949706ea3..1a9e35561c 100755 --- a/configure +++ b/configure @@ -8192,10 +8192,8 @@ test -z "$_nprefix" && _nprefix='CONFIG' for part in $1; do if ` echo $2 | grep -q -E "(^| )$part($| )" `; then echo "#define ${_nprefix}_$part 1" - echo "#define ENABLE_$part 1" else echo "#define ${_nprefix}_$part 0" - echo "#define ENABLE_$part 0" fi done } @@ -8579,26 +8577,17 @@ $def_mlib $_def_mkstemp $_def_pthreads $_def_threads -#ifdef HAVE_THREADS -#define ENABLE_THREADS 1 -#else -#define ENABLE_THREADS 0 -#endif $_def_yasm #define CONFIG_GPL 1 -#define ENABLE_SMALL 0 -#define ENABLE_GRAY 0 +#define CONFIG_SMALL 0 +#define CONFIG_GRAY 0 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */ #define CONFIG_AANDCT 1 -#define ENABLE_AANDCT 1 #define CONFIG_FFT 1 -#define ENABLE_FFT 1 #define CONFIG_GOLOMB 1 -#define ENABLE_GOLOMB 1 #define CONFIG_MDCT 1 -#define ENABLE_MDCT 1 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */ #define HAVE_EBX_AVAILABLE 1 @@ -8607,12 +8596,8 @@ $_def_yasm #endif #define CONFIG_DECODERS 1 -#define ENABLE_DECODERS 1 #define CONFIG_ENCODERS 1 -#define ENABLE_ENCODERS 1 - #define CONFIG_DEMUXERS 1 -#define ENABLE_DEMUXERS 1 $_def_muxers -- cgit v1.2.3 From 081281f39b9869cf50fb6c8b75a8afe1ff076e62 Mon Sep 17 00:00:00 2001 From: gpoirier Date: Thu, 15 Jan 2009 17:21:25 +0000 Subject: sync w/r28279 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28319 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/fr/mplayer.1 | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1 index 67e52a9c3a..1104d587a2 100644 --- a/DOCS/man/fr/mplayer.1 +++ b/DOCS/man/fr/mplayer.1 @@ -1,4 +1,4 @@ -.\" synced with r28126 +.\" synced with r28279 .\" Encoding: iso-8859-1 .\" MPlayer (C) 2000-2009 MPlayer Team .\" The English man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann @@ -33,7 +33,7 @@ .\" Titre .\" -------------------------------------------------------------------------- . -.TH MPlayer 1 "1er janvier 2008" "The MPlayer Project" "Le Lecteur Vidéo" +.TH MPlayer 1 "15 janvier 2009" "The MPlayer Project" "Le Lecteur Vidéo" . .SH NAME mplayer \- Lecteur vidéo @@ -624,6 +624,7 @@ alang=en profile-desc="profil pour les flux dvdnav://" profile=protocol.dvd mouse-movements=yes +nocache=yes [extension.flv] profile-desc="profil pour les fichiers .flv" @@ -1089,9 +1090,10 @@ Affiche le menu principal au lancement de MPlayer. .TP .B \-mouse\-movements Permet MPlayer de recevoir des évènements souris envoyés -par le pilote de sortie vidéo (seuls ceux dérivés de X11 sont gérés -pour le moment). +par le pilote de sortie vidéo. Utilisé pour sélectioner les boutons des menus DVDs. +Géré par par les VOs basés sur X11 (x11, xv, xvmc, etc.) ainsi que les VOs gl, +gl2, direct3d et macosx. . .TP .B \-noar @@ -1228,6 +1230,15 @@ Pour jouer des flux MPEG-TS, MPlayer/\:MEncoder utilisera le premier programme (si présent) avec le flux audio choisi. . .TP +.B \-ausid (voir aussi \-alang) +Sélectionne le canal du sous-flux audio. +L'intervalle des valeurs valides est 0x55..0x75 et s'applique uniquement au +démultiplexeur MPEG-TS natif (par celui de libavformat). +Le type de format peut ne pas être correctement identifié puisque cette information n'est pas présente dans le flux, mais le démultiplexage des flux audios se fera correctement en présence de sous-flux multiples. +MPlayer affiche tous les identifiants des sous-flux quand il est lancé avec +l'option \-identify. +. +.TP .B \-alang (voir aussi \-aid) Définit une liste de langues de pistes audio à jouer en priorité. Chaque format de conteneur utilise des codes de pays différents. @@ -2181,8 +2192,8 @@ sous-titres et ceux contenus dans les pistes Matroska. Fonctionne avec \-embeddedfonts. .br .I NOTE\ : -Quand fontconfig est activé à compilation, \-ass active \-fontconfig à moins -que vous l'empêchiez explicitement avec l'option \-nofontconfig. +Contrairement aux OSD normaux, libass utilise fontconfig par défaut. +Pour désactiver ceci, utiliser l'option \-nofontconfig. . .TP .B \-ass\-border\-color @@ -2367,8 +2378,8 @@ Avec Fontconfig, cette option d Active l'utilisation des polices gérées par fontconfig. .br .I NOTE\ : -\-ass active cette option automatiquement à moins que vous l'empêchiez -explicitement avec l'option \-nofontconfig. +Par défaut fontconfig est utilisé pour afficher les sous-titres rendus par libass. +Cette option active aussi le rendu de l'OSD avec fontconfig. . .TP .B \-forcedsubsonly @@ -2910,6 +2921,10 @@ Nom du client qui pass .IPs (no)estimate Estime le délai audio, supposé réduire les à-coups lors de la lecture vidéo (par défaut\ : activé). +.IPs (no)autostart +Démarre le serveur jackd si nécessaire (par défaut\ : désactivé) +Notez que cette option ne semble pas fiable et polluera la console avec plein +de messages du serveur jackd. .RE .PD 1 . @@ -3724,6 +3739,13 @@ pilote de sortie vid .RSs .IPs device_id= Choisir le moniteur à utiliser en plein-écran. +.IPs shared_buffer +Écrit la sortie dans un tampon partagé au lieu de l'afficher, et essaye +d'établir une NSConnection avec une IHM existante. +.IPs buffer_name= +Nom du tampon partagé créé avec shm_open pour effectuer la NSConnection avec +une IHM (defaut\ : "mplayerosx"). +Définir l'option buffer_name active shared_buffer implicitement. .RE .PD 1 . @@ -11707,7 +11729,7 @@ MPlayer Voir le fichier AUTHORS pour la liste de certains des nombreux autres contributeurs. .TP -MPlayer est (C) 2000\-2008 The MPlayer Team +MPlayer est (C) 2000\-2009 The MPlayer Team .TP Cette page de man est basée sur sa version en langue anglaise, écrite et maintenue par Gabucino, Jonas Jermann et Diego Biurrun -- cgit v1.2.3 From 1279c23834949532592b620890fa12273a42d4a3 Mon Sep 17 00:00:00 2001 From: diego Date: Fri, 16 Jan 2009 01:11:16 +0000 Subject: one more ARCH_ARMV4L --> ARCH_ARM, patch by Guillaume Lecerf, foxcore gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28320 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cpudetect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpudetect.c b/cpudetect.c index 3860cc9a17..79566cc57b 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -566,7 +566,7 @@ void GetCpuCaps( CpuCaps *caps) mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Sun Sparc\n"); #endif -#ifdef ARCH_ARMV4L +#ifdef ARCH_ARM mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: ARM\n"); #endif -- cgit v1.2.3 From 8ba39dcfcc738b1bca18a62d836d3ec7b843e850 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Fri, 16 Jan 2009 01:55:48 +0000 Subject: Disable upcoming MPEG_VDPAU_DECODER. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28321 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 1a9e35561c..664ea4b3d9 100755 --- a/configure +++ b/configure @@ -523,7 +523,7 @@ _libavcodec_a=auto _libamr_nb=auto _libamr_wb=auto _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` -_libavdecoders=` echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER// -e s/H264_VDPAU_DECODER// ` +_libavdecoders=` echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER// -e s/H264_VDPAU_DECODER// -e s/MPEG_VDPAU_DECODER//` _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` _libavencoders=` echo $_libavencoders_all | sed 's/ LIB[A-Z0-9_]*_ENCODER//g'` _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` -- cgit v1.2.3 From 285e30f1e477efee95cb13e8a4ac292d52a17125 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Fri, 16 Jan 2009 02:14:25 +0000 Subject: Add VDPAU hardware accelerated decoding for MPEG1 and MPEG2 which will be used by MPlayer. Original patch by NVIDIA corporation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28322 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 8ee363fafc..52b709aaa0 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -454,6 +454,10 @@ const char *sws_format_name(enum PixelFormat format) return "yuv440p"; case PIX_FMT_VDPAU_H264: return "vdpau_h264"; + case PIX_FMT_VDPAU_MPEG1: + return "vdpau_mpeg1"; + case PIX_FMT_VDPAU_MPEG2: + return "vdpau_mpeg2"; default: return "Unknown format"; } -- cgit v1.2.3 From cd1c4655b8dfe238c07bf0ef06e222000273b281 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 16 Jan 2009 08:43:05 +0000 Subject: Fix first handful of #if vs. #ifdef for ARCH_, HAVE_SSE etc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28323 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cpudetect.c | 44 ++++++++++++++++++++++---------------------- cpudetect.h | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/cpudetect.c b/cpudetect.c index 79566cc57b..bd9aa2c6b9 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -9,7 +9,7 @@ CpuCaps gCpuCaps; #endif #include -#ifdef ARCH_X86 +#if ARCH_X86 #include #include @@ -57,7 +57,7 @@ static int has_cpuid(void) long a, c; // code from libavcodec: -#ifdef ARCH_X86_64 +#if ARCH_X86_64 #define PUSHF "pushfq\n\t" #define POPF "popfq\n\t" #else @@ -212,27 +212,27 @@ void GetCpuCaps( CpuCaps *caps) // caps->hasMMX = 0; #ifndef RUNTIME_CPUDETECT -#ifndef HAVE_MMX +#if !HAVE_MMX if(caps->hasMMX) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"MMX supported but disabled\n"); caps->hasMMX=0; #endif -#ifndef HAVE_MMX2 +#if !HAVE_MMX2 if(caps->hasMMX2) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"MMX2 supported but disabled\n"); caps->hasMMX2=0; #endif -#ifndef HAVE_SSE +#if !HAVE_SSE if(caps->hasSSE) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"SSE supported but disabled\n"); caps->hasSSE=0; #endif -#ifndef HAVE_SSE2 +#if !HAVE_SSE2 if(caps->hasSSE2) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"SSE2 supported but disabled\n"); caps->hasSSE2=0; #endif -#ifndef HAVE_3DNOW +#if !HAVE_3DNOW if(caps->has3DNow) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"3DNow supported but disabled\n"); caps->has3DNow=0; #endif -#ifndef HAVE_3DNOWEX +#if !HAVE_3DNOWEX if(caps->has3DNowExt) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"3DNowExt supported but disabled\n"); caps->has3DNowExt=0; #endif @@ -304,7 +304,7 @@ char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]){ #undef CPUID_STEPPING -#if defined(__linux__) && defined(_POSIX_SOURCE) && !defined(ARCH_X86_64) +#if defined(__linux__) && defined(_POSIX_SOURCE) && ARCH_X86_64 static void sigill_handler_sse( int signal, struct sigcontext sc ) { mp_msg(MSGT_CPUDETECT,MSGL_V, "SIGILL, " ); @@ -371,7 +371,7 @@ ULONG _System os2_sig_handler_sse( PEXCEPTIONREPORTRECORD p1, static void check_os_katmai_support( void ) { -#ifdef ARCH_X86_64 +#if ARCH_X86_64 gCpuCaps.hasSSE=1; gCpuCaps.hasSSE2=1; #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__APPLE__) @@ -511,7 +511,7 @@ void GetCpuCaps( CpuCaps *caps) caps->hasSSE4a=0; caps->isX86=0; caps->hasAltiVec = 0; -#ifdef HAVE_ALTIVEC +#if !HAVE_ALTIVEC #ifdef __APPLE__ /* rip-off from ffmpeg altivec detection code. @@ -558,47 +558,47 @@ void GetCpuCaps( CpuCaps *caps) mp_msg(MSGT_CPUDETECT,MSGL_INFO,"AltiVec %sfound\n", (caps->hasAltiVec ? "" : "not ")); #endif /* HAVE_ALTIVEC */ -#ifdef ARCH_IA64 +#if ARCH_IA64 mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Intel Itanium\n"); #endif -#ifdef ARCH_SPARC +#if ARCH_SPARC mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Sun Sparc\n"); #endif -#ifdef ARCH_ARM +#if ARCH_ARM mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: ARM\n"); #endif -#ifdef ARCH_PPC +#if ARCH_PPC mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: PowerPC\n"); #endif -#ifdef ARCH_ALPHA +#if ARCH_ALPHA mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Digital Alpha\n"); #endif -#ifdef ARCH_SGI_MIPS +#if ARCH_SGI_MIPS mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: SGI MIPS\n"); #endif -#ifdef ARCH_PA_RISC +#if ARCH_PA_RISC mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Hewlett-Packard PA-RISC\n"); #endif -#ifdef ARCH_S390 +#if ARCH_S390 mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: IBM S/390\n"); #endif -#ifdef ARCH_S390X +#if ARCH_S390X mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: IBM S/390X\n"); #endif -#ifdef ARCH_VAX +#if ARCH_VAX mp_msg(MSGT_CPUDETECT,MSGL_INFO, "CPU: Digital VAX\n" ); #endif -#ifdef ARCH_XTENSA +#if ARCH_XTENSA mp_msg(MSGT_CPUDETECT,MSGL_INFO, "CPU: Tensilica Xtensa\n" ); #endif } diff --git a/cpudetect.h b/cpudetect.h index a98f97f0e4..3f91f05d1c 100644 --- a/cpudetect.h +++ b/cpudetect.h @@ -6,7 +6,7 @@ #define CPUTYPE_I586 5 #define CPUTYPE_I686 6 -#ifdef ARCH_X86_64 +#if ARCH_X86_64 # define REGa rax # define REGb rbx # define REGBP rbp -- cgit v1.2.3 From 452cda5332e48c77ae5a5594eff3f57d54ded30c Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 16 Jan 2009 08:45:35 +0000 Subject: More #ifdef -> #if git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28324 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mencoder.c | 14 +++++++------- mplayer.c | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mencoder.c b/mencoder.c index 6cc3406b7d..f3947b4840 100644 --- a/mencoder.c +++ b/mencoder.c @@ -425,7 +425,7 @@ user_correct_pts = 0; /* Test for cpu capabilities (and corresponding OS support) for optimizing */ GetCpuCaps(&gCpuCaps); -#ifdef ARCH_X86 +#if ARCH_X86 mp_msg(MSGT_CPLAYER,MSGL_INFO,"CPUflags: Type: %d MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n", gCpuCaps.cpuType,gCpuCaps.hasMMX,gCpuCaps.hasMMX2, gCpuCaps.has3DNow, gCpuCaps.has3DNowExt, @@ -434,22 +434,22 @@ user_correct_pts = 0; mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithRuntimeDetection); #else mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithCPUExtensions); -#ifdef HAVE_MMX +#if HAVE_MMX mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX"); #endif -#ifdef HAVE_MMX2 +#if HAVE_MMX2 mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX2"); #endif -#ifdef HAVE_3DNOW +#if HAVE_3DNOW mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNow"); #endif -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNowEx"); #endif -#ifdef HAVE_SSE +#if HAVE_SSE mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE"); #endif -#ifdef HAVE_SSE2 +#if HAVE_SSE2 mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2"); #endif mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n"); diff --git a/mplayer.c b/mplayer.c index 3b36c04235..e46143b763 100644 --- a/mplayer.c +++ b/mplayer.c @@ -2401,7 +2401,7 @@ void print_version(void){ /* Test for CPU capabilities (and corresponding OS support) for optimizing */ GetCpuCaps(&gCpuCaps); -#ifdef ARCH_X86 +#if ARCH_X86 mp_msg(MSGT_CPLAYER,MSGL_INFO,"CPUflags: MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n", gCpuCaps.hasMMX,gCpuCaps.hasMMX2, gCpuCaps.has3DNow, gCpuCaps.has3DNowExt, @@ -2410,22 +2410,22 @@ void print_version(void){ mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithRuntimeDetection); #else mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithCPUExtensions); -#ifdef HAVE_MMX +#if HAVE_MMX mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX"); #endif -#ifdef HAVE_MMX2 +#if HAVE_MMX2 mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX2"); #endif -#ifdef HAVE_3DNOW +#if HAVE_3DNOW mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNow"); #endif -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNowEx"); #endif -#ifdef HAVE_SSE +#if HAVE_SSE mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE"); #endif -#ifdef HAVE_SSE2 +#if HAVE_SSE2 mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2"); #endif mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n"); -- cgit v1.2.3 From 93d598c7b2d6f71fa6381829dc6ec3610ed322e8 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 16 Jan 2009 09:21:21 +0000 Subject: 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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28325 b3059339-0415-0410-9bf9-f77b7e298cf2 --- liba52/a52_internal.h | 2 +- liba52/bitstream.h | 2 +- liba52/downmix.c | 4 +- liba52/imdct.c | 22 ++++++----- liba52/resample.c | 8 ++-- liba52/resample_mmx.c | 2 +- libmpcodecs/dec_video.c | 2 +- libmpcodecs/pullup.c | 8 ++-- libmpcodecs/vd_libmpeg2.c | 4 +- libmpcodecs/vf_decimate.c | 4 +- libmpcodecs/vf_divtc.c | 4 +- libmpcodecs/vf_eq.c | 4 +- libmpcodecs/vf_eq2.c | 4 +- libmpcodecs/vf_fspp.c | 14 +++---- libmpcodecs/vf_halfpack.c | 4 +- libmpcodecs/vf_hue.c | 2 +- libmpcodecs/vf_ilpack.c | 12 +++--- libmpcodecs/vf_ivtc.c | 4 +- libmpcodecs/vf_noise.c | 14 +++---- libmpcodecs/vf_pp7.c | 8 ++-- libmpcodecs/vf_scale.c | 2 +- libmpcodecs/vf_spp.c | 10 ++--- libmpcodecs/vf_tfields.c | 12 +++--- libmpcodecs/vf_unsharp.c | 4 +- libmpcodecs/vf_uspp.c | 6 +-- libmpdemux/asfguid.h | 2 +- libmpeg2/cpu_accel.c | 12 +++--- libmpeg2/cpu_state.c | 10 ++--- libmpeg2/idct.c | 6 +-- libmpeg2/idct_alpha.c | 2 +- libmpeg2/idct_altivec.c | 2 +- libmpeg2/idct_mmx.c | 2 +- libmpeg2/motion_comp.c | 14 +++---- libmpeg2/motion_comp_alpha.c | 2 +- libmpeg2/motion_comp_altivec.c | 2 +- libmpeg2/motion_comp_arm.c | 2 +- libmpeg2/motion_comp_mmx.c | 2 +- libmpeg2/motion_comp_vis.c | 2 +- libmpeg2/mpeg2_internal.h | 2 +- libvo/aclib.c | 79 +++++++++++++++++++++++++++----------- libvo/aclib_template.c | 25 ++++++------ libvo/osd.c | 86 +++++++++++++++++++++++++----------------- libvo/osd_template.c | 42 ++++++++++----------- mp3lib/decod386.c | 4 +- mp3lib/sr1.c | 22 ++++++----- vidix/dha.c | 4 +- 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 @@ -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 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; diff --git a/libmpcodecs/vf_unsharp.c b/libmpcodecs/vf_unsharp.c index a2efd29b15..d5deebfafb 100644 --- a/libmpcodecs/vf_unsharp.c +++ b/libmpcodecs/vf_unsharp.c @@ -192,11 +192,11 @@ 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 diff --git a/libmpcodecs/vf_uspp.c b/libmpcodecs/vf_uspp.c index c1d100d5fa..a5882ffeca 100644 --- a/libmpcodecs/vf_uspp.c +++ b/libmpcodecs/vf_uspp.c @@ -291,10 +291,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 @@ -370,7 +370,7 @@ static int open(vf_instance_t *vf, char* args){ if(vf->priv->qp < 0) vf->priv->qp = 0; -// #ifdef HAVE_MMX +// #if HAVE_MMX // if(gCpuCaps.hasMMX){ // store_slice= store_slice_mmx; // } diff --git a/libmpdemux/asfguid.h b/libmpdemux/asfguid.h index e9b8b08567..f5a9989e9f 100644 --- a/libmpdemux/asfguid.h +++ b/libmpdemux/asfguid.h @@ -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) diff --git a/libmpeg2/cpu_accel.c b/libmpeg2/cpu_accel.c index 104ac2cfdf..f711f3282c 100644 --- a/libmpeg2/cpu_accel.c +++ b/libmpeg2/cpu_accel.c @@ -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 (uint32_t accel) } #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 #include @@ -169,7 +169,7 @@ static RETSIGTYPE sigill_handler (int sig) } #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 accel) } #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 accel) } #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 (uint32_t accel) 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; diff --git a/libmpeg2/cpu_state.c b/libmpeg2/cpu_state.c index 2f2f64a987..d82b6738a7 100644 --- a/libmpeg2/cpu_state.c +++ b/libmpeg2/cpu_state.c @@ -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_state_t * state) 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; diff --git a/libmpeg2/idct.c b/libmpeg2/idct.c index e753053354..09a81159eb 100644 --- a/libmpeg2/idct.c +++ b/libmpeg2/idct.c @@ -239,7 +239,7 @@ static void mpeg2_idct_add_c (const int last, int16_t * block, 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; diff --git a/libmpeg2/idct_alpha.c b/libmpeg2/idct_alpha.c index bc2f886492..e5886ed3ff 100644 --- a/libmpeg2/idct_alpha.c +++ b/libmpeg2/idct_alpha.c @@ -24,7 +24,7 @@ #include "config.h" -#ifdef ARCH_ALPHA +#if ARCH_ALPHA #include #include diff --git a/libmpeg2/idct_altivec.c b/libmpeg2/idct_altivec.c index b5b395a205..1403eeac87 100644 --- a/libmpeg2/idct_altivec.c +++ b/libmpeg2/idct_altivec.c @@ -23,7 +23,7 @@ #include "config.h" -#ifdef ARCH_PPC +#if ARCH_PPC #ifdef HAVE_ALTIVEC_H #include diff --git a/libmpeg2/idct_mmx.c b/libmpeg2/idct_mmx.c index 50f8f18c3e..fe6215b20d 100644 --- a/libmpeg2/idct_mmx.c +++ b/libmpeg2/idct_mmx.c @@ -23,7 +23,7 @@ #include "config.h" -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#if ARCH_X86 || ARCH_X86_64 #include diff --git a/libmpeg2/motion_comp.c b/libmpeg2/motion_comp.c index d5934cd53b..9ef39290e5 100644 --- a/libmpeg2/motion_comp.c +++ b/libmpeg2/motion_comp.c @@ -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 diff --git a/libmpeg2/motion_comp_alpha.c b/libmpeg2/motion_comp_alpha.c index 05cd550841..a7f33d3914 100644 --- a/libmpeg2/motion_comp_alpha.c +++ b/libmpeg2/motion_comp_alpha.c @@ -22,7 +22,7 @@ #include "config.h" -#ifdef ARCH_ALPHA +#if ARCH_ALPHA #include diff --git a/libmpeg2/motion_comp_altivec.c b/libmpeg2/motion_comp_altivec.c index 4356aa6e78..f98aaedc90 100644 --- a/libmpeg2/motion_comp_altivec.c +++ b/libmpeg2/motion_comp_altivec.c @@ -23,7 +23,7 @@ #include "config.h" -#ifdef ARCH_PPC +#if ARCH_PPC #ifdef HAVE_ALTIVEC_H #include diff --git a/libmpeg2/motion_comp_arm.c b/libmpeg2/motion_comp_arm.c index 0111f7f8d3..f783434a30 100644 --- a/libmpeg2/motion_comp_arm.c +++ b/libmpeg2/motion_comp_arm.c @@ -22,7 +22,7 @@ #include "config.h" -#ifdef ARCH_ARM +#if ARCH_ARM #include diff --git a/libmpeg2/motion_comp_mmx.c b/libmpeg2/motion_comp_mmx.c index fc265f4f99..b550f8c7c9 100644 --- a/libmpeg2/motion_comp_mmx.c +++ b/libmpeg2/motion_comp_mmx.c @@ -23,7 +23,7 @@ #include "config.h" -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#if ARCH_X86 || ARCH_X86_64 #include diff --git a/libmpeg2/motion_comp_vis.c b/libmpeg2/motion_comp_vis.c index 54c0f7e758..f6f3a315ee 100644 --- a/libmpeg2/motion_comp_vis.c +++ b/libmpeg2/motion_comp_vis.c @@ -22,7 +22,7 @@ #include "config.h" -#ifdef ARCH_SPARC +#if ARCH_SPARC #include diff --git a/libmpeg2/mpeg2_internal.h b/libmpeg2/mpeg2_internal.h index 2a651be571..73cbfb15ce 100644 --- a/libmpeg2/mpeg2_internal.h +++ b/libmpeg2/mpeg2_internal.h @@ -238,7 +238,7 @@ struct mpeg2dec_s { }; typedef struct { -#ifdef ARCH_PPC +#if ARCH_PPC uint8_t regv[12*16]; #endif int dummy; diff --git a/libvo/aclib.c b/libvo/aclib.c index 68548f579e..ca06b84ad5 100644 --- a/libvo/aclib.c +++ b/libvo/aclib.c @@ -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 * from, size_t len) #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 * from, size_t len) #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 diff --git a/libvo/aclib_template.c b/libvo/aclib_template.c index 7288831172..74f0371a63 100644 --- a/libvo/aclib_template.c +++ b/libvo/aclib_template.c @@ -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 with me: Nick Kurshev: nickols_k@mail.ru. #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 with me: Nick Kurshev: nickols_k@mail.ru. #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 * to, const void * from, size_t len) 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 * to, const void * from, size_t len) } #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 * to, const void * from, size_t len) 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"); diff --git a/libvo/osd.c b/libvo/osd.c index da7d61fb50..df91ffbae0 100644 --- a/libvo/osd.c +++ b/libvo/osd.c @@ -11,7 +11,7 @@ #include #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 __attribute__((aligned(8))) = 0x0000FF //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 __attribute__((aligned(8))) = 0x0000FF #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 __attribute__((aligned(8))) = 0x0000FF #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 __attribute__((aligned(8))) = 0x0000FF #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 __attribute__((aligned(8))) = 0x0000FF //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 __attribute__((aligned(8))) = 0x0000FF //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 __attribute__((aligned(8))) = 0x0000FF //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, unsigned char* src, unsigned char *srca, in 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, unsigned char* src, unsigned char *srca, in 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, unsigned char* src, unsigned char *srca, in 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, unsigned char* src, unsigned char *srca, i 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, unsigned char* src, unsigned char *srca, i 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"); diff --git a/libvo/osd_template.c b/libvo/osd_template.c index c44f060a5d..8700a176c6 100644 --- a/libvo/osd_template.c +++ b/libvo/osd_template.c @@ -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_yv12)(int w,int h, unsigned char* src, u #endif for(y=0;y>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_yuy2)(int w,int h, unsigned char* src, u #endif for(y=0;y=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"); diff --git a/vidix/dha.c b/vidix/dha.c index 638be29328..8a2d8fd1cd 100644 --- a/vidix/dha.c +++ b/vidix/dha.c @@ -43,7 +43,7 @@ #include #include #include -#ifdef ARCH_ALPHA +#if ARCH_ALPHA #include #endif #include @@ -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 -- cgit v1.2.3 From 4abf191c5dd22bf1617aee1e62c4917e84a949da Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 16 Jan 2009 09:29:20 +0000 Subject: More #ifdef -> #if fixes git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28326 b3059339-0415-0410-9bf9-f77b7e298cf2 --- liba52/imdct_3dnow.h | 28 ++++++++++++++-------------- liba52/srfftp_3dnow.h | 4 ++-- libaf/af.h | 2 +- libvo/fastmemcpy.h | 4 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/liba52/imdct_3dnow.h b/liba52/imdct_3dnow.h index 2291158950..eeab33b27c 100644 --- a/liba52/imdct_3dnow.h +++ b/liba52/imdct_3dnow.h @@ -26,7 +26,7 @@ #undef FFT_ASMB16_3DNOW #undef FFT_128P_3DNOW -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX #define FFT_4_3DNOW fft_4_3dnowex #define FFT_8_3DNOW fft_8_3dnowex #define FFT_ASMB_3DNOW fft_asmb_3dnowex @@ -52,7 +52,7 @@ static void FFT_4_3DNOW(complex_t *x) "pxor %3, %%mm1\n\t" /* -mm1.re | mm1.im */ "pfadd %%mm1, %%mm3\n\t" /* vi.im = x[3].re - x[1].re; */ "movq %%mm3, %%mm4\n\t" /* vi.re =-x[3].im + x[1].im; mm4 = vi */ -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX "pswapd %%mm4, %%mm4\n\t" #else "punpckldq %%mm4, %%mm5\n\t" @@ -129,7 +129,7 @@ static void FFT_8_3DNOW(complex_t *x) "movq (%1), %%mm1\n\t" "movq 16(%1), %%mm4\n\t" "movq %%mm1, %%mm2\n\t" -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX "pswapd %%mm3, %%mm3\n\t" #else "punpckldq %%mm3, %%mm6\n\t" @@ -160,7 +160,7 @@ static void FFT_8_3DNOW(complex_t *x) "movq %2, %%mm1\n\t" "movq 56(%3), %%mm3\n\t" "pfsub 40(%3), %%mm0\n\t" -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX "pswapd %%mm1, %%mm1\n\t" #else "punpckldq %%mm1, %%mm2\n\t" @@ -168,7 +168,7 @@ static void FFT_8_3DNOW(complex_t *x) #endif "pxor %%mm7, %%mm1\n\t" "pfadd %%mm1, %%mm0\n\t" -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX "pswapd %%mm3, %%mm3\n\t" #else "punpckldq %%mm3, %%mm2\n\t" @@ -182,7 +182,7 @@ static void FFT_8_3DNOW(complex_t *x) "pfmul %4, %%mm0\n\t" "movq 40(%3), %%mm5\n\t" -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX "pswapd %%mm5, %%mm5\n\t" #else "punpckldq %%mm5, %%mm1\n\t" @@ -205,7 +205,7 @@ static void FFT_8_3DNOW(complex_t *x) /* x[3] x[7] */ __asm__ volatile( "movq %1, %%mm0\n\t" -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX "pswapd %3, %%mm1\n\t" #else "movq %3, %%mm1\n\t" @@ -218,7 +218,7 @@ static void FFT_8_3DNOW(complex_t *x) "movq 56(%4), %%mm3\n\t" "pxor %%mm7, %%mm3\n\t" "pfadd %%mm3, %%mm2\n\t" -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX "pswapd %%mm2, %%mm2\n\t" #else "punpckldq %%mm2, %%mm5\n\t" @@ -331,7 +331,7 @@ static void FFT_128P_3DNOW(complex_t *a) } static void -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX imdct_do_512_3dnowex #else imdct_do_512_3dnow @@ -371,14 +371,14 @@ imdct_do_512_3dnow "punpckldq %4, %%mm1\n\t" /* mm1 = xcos[j] | xsin[j] */ "movq %%mm0, %%mm2\n\t" "pfmul %%mm1, %%mm0\n\t" -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX "pswapd %%mm1, %%mm1\n\t" #else "punpckldq %%mm1, %%mm5\n\t" "punpckhdq %%mm5, %%mm1\n\t" #endif "pfmul %%mm1, %%mm2\n\t" -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX "pfpnacc %%mm2, %%mm0\n\t" #else "pxor %%mm7, %%mm0\n\t" @@ -445,7 +445,7 @@ imdct_do_512_3dnow __asm__ volatile ( "movq %1, %%mm0\n\t" /* ac3_buf[i].re | ac3_buf[i].im */ "movq %%mm0, %%mm1\n\t" /* ac3_buf[i].re | ac3_buf[i].im */ -#ifndef HAVE_3DNOWEX +#if !HAVE_3DNOWEX "punpckldq %%mm1, %%mm2\n\t" "punpckhdq %%mm2, %%mm1\n\t" #else @@ -455,7 +455,7 @@ imdct_do_512_3dnow "punpckldq %2, %%mm3\n\t" /* ac3_xsin[i] | ac3_xcos[i] */ "pfmul %%mm3, %%mm0\n\t" "pfmul %%mm3, %%mm1\n\t" -#ifndef HAVE_3DNOWEX +#if !HAVE_3DNOWEX "pxor %%mm7, %%mm0\n\t" "pfacc %%mm1, %%mm0\n\t" "punpckldq %%mm0, %%mm1\n\t" @@ -543,7 +543,7 @@ imdct_do_512_3dnow "movd (%1), %%mm1\n\t" "punpckldq (%2), %%mm0\n\t" "punpckldq 508(%2), %%mm1\n\t" -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX "pswapd (%3), %%mm3\n\t" "pswapd -512(%3), %%mm4\n\t" #else diff --git a/liba52/srfftp_3dnow.h b/liba52/srfftp_3dnow.h index 9f26c59b43..1d66c5b89c 100644 --- a/liba52/srfftp_3dnow.h +++ b/liba52/srfftp_3dnow.h @@ -46,7 +46,7 @@ typedef struct "m"(x_minus_plus_3dnow)\ :"memory"); -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX #define PSWAP_MM(mm_base,mm_hlp) "pswapd "mm_base","mm_base"\n\t" #else #define PSWAP_MM(mm_base,mm_hlp)\ @@ -54,7 +54,7 @@ typedef struct "psrlq $32, "mm_base"\n\t"\ "punpckldq "mm_hlp","mm_base"\n\t" #endif -#ifdef HAVE_3DNOWEX +#if HAVE_3DNOWEX #define PFNACC_MM(mm_base,mm_hlp) "pfnacc "mm_base","mm_base"\n\t" #else #define PFNACC_MM(mm_base,mm_hlp)\ diff --git a/libaf/af.h b/libaf/af.h index 4696e51472..038aa729d2 100644 --- a/libaf/af.h +++ b/libaf/af.h @@ -93,7 +93,7 @@ extern int* af_cpu_speed; // Default init type #ifndef AF_INIT_TYPE -#if defined(HAVE_SSE) || defined(HAVE_3DNOW) +#if HAVE_SSE || HAVE_3DNOW #define AF_INIT_TYPE (af_cpu_speed?*af_cpu_speed:AF_INIT_FAST) #else #define AF_INIT_TYPE (af_cpu_speed?*af_cpu_speed:AF_INIT_SLOW) diff --git a/libvo/fastmemcpy.h b/libvo/fastmemcpy.h index be0b752558..69ded04bcf 100644 --- a/libvo/fastmemcpy.h +++ b/libvo/fastmemcpy.h @@ -24,8 +24,8 @@ #include #ifdef CONFIG_FASTMEMCPY -#if defined(HAVE_MMX) || defined(HAVE_MMX2) || defined(HAVE_3DNOW) \ -/* || defined(HAVE_SSE) || defined(HAVE_SSE2) */ +#if HAVE_MMX || HAVE_MMX2 || HAVE_3DNOW \ +/* || HAVE_SSE || HAVE_SSE2 */ #include void * fast_memcpy(void * to, const void * from, size_t len); -- cgit v1.2.3 From 97df2f91624249b8a93c1d8ba7b4857150200628 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 16 Jan 2009 09:32:54 +0000 Subject: More #ifdef HAVE_MMX etc. missed by earlier search. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28327 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af_resample.c | 2 +- libmpcodecs/vf_filmdint.c | 10 +++++----- libmpcodecs/vf_yadif.c | 8 ++++---- libvo/aclib.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libaf/af_resample.c b/libaf/af_resample.c index c2cfb4b74f..57335532c4 100644 --- a/libaf/af_resample.c +++ b/libaf/af_resample.c @@ -36,7 +36,7 @@ slow and to 16 if the machine is fast and has MMX. */ -#if !defined(HAVE_MMX) // This machine is slow +#if !HAVE_MMX // This machine is slow #define L8 #else #define L16 diff --git a/libmpcodecs/vf_filmdint.c b/libmpcodecs/vf_filmdint.c index 2658153c27..4313d50692 100644 --- a/libmpcodecs/vf_filmdint.c +++ b/libmpcodecs/vf_filmdint.c @@ -433,7 +433,7 @@ block_metrics_3dnow(unsigned char *a, unsigned char *b, int as, int bs, int lines, struct vf_priv_s *p, struct frame_stats *s) { struct metrics tm; -#ifndef HAVE_3DNOW +#if !HAVE_3DNOW mp_msg(MSGT_VFILTER, MSGL_FATAL, "block_metrics_3dnow: internal error\n"); #else static const unsigned long long ones = 0x0101010101010101ull; @@ -462,7 +462,7 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs, int lines, struct vf_priv_s *p, struct frame_stats *s) { struct metrics tm; -#ifndef HAVE_MMX +#if !HAVE_MMX mp_msg(MSGT_VFILTER, MSGL_FATAL, "block_metrics_mmx2: internal error\n"); #else static const unsigned long long ones = 0x0101010101010101ull; @@ -591,7 +591,7 @@ static inline int dint_copy_line_mmx2(unsigned char *dst, unsigned char *a, long bos, long cos, int ds, int ss, int w, int t) { -#ifndef HAVE_MMX +#if !HAVE_MMX mp_msg(MSGT_VFILTER, MSGL_FATAL, "dint_copy_line_mmx2: internal error\n"); return 0; #else @@ -1422,10 +1422,10 @@ static int open(vf_instance_t *vf, char* args) } if (p->mmx2 > 2) p->mmx2 = 0; -#ifndef HAVE_MMX +#if !HAVE_MMX p->mmx2 = 0; #endif -#ifndef HAVE_3DNOW +#if !HAVE_3DNOW p->mmx2 &= 1; #endif p->thres.odd = p->thres.even; diff --git a/libmpcodecs/vf_yadif.c b/libmpcodecs/vf_yadif.c index a8328d3f2a..5a36b3caea 100644 --- a/libmpcodecs/vf_yadif.c +++ b/libmpcodecs/vf_yadif.c @@ -68,7 +68,7 @@ static void store_ref(struct vf_priv_s *p, uint8_t *src[3], int src_stride[3], i } } -#if defined(HAVE_MMX) && defined(NAMED_ASM_ARGS) +#if HAVE_MMX && defined(NAMED_ASM_ARGS) #define LOAD4(mem,dst) \ "movd "mem", "#dst" \n\t"\ @@ -281,7 +281,7 @@ static void filter_line_mmx2(struct vf_priv_s *p, uint8_t *dst, uint8_t *prev, u #undef CHECK2 #undef FILTER -#endif /* defined(HAVE_MMX) && defined(NAMED_ASM_ARGS) */ +#endif /* HAVE_MMX && defined(NAMED_ASM_ARGS) */ static void filter_line_c(struct vf_priv_s *p, uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int refs, int parity){ int x; @@ -363,7 +363,7 @@ static void filter(struct vf_priv_s *p, uint8_t *dst[3], int dst_stride[3], int } } } -#if defined(HAVE_MMX) && defined(NAMED_ASM_ARGS) +#if HAVE_MMX && defined(NAMED_ASM_ARGS) if(gCpuCaps.hasMMX2) __asm__ volatile("emms \n\t" : : : "memory"); #endif } @@ -501,7 +501,7 @@ static int open(vf_instance_t *vf, char* args){ if (args) sscanf(args, "%d:%d", &vf->priv->mode, &vf->priv->parity); filter_line = filter_line_c; -#if defined(HAVE_MMX) && defined(NAMED_ASM_ARGS) +#if HAVE_MMX && defined(NAMED_ASM_ARGS) if(gCpuCaps.hasMMX2) filter_line = filter_line_mmx2; #endif diff --git a/libvo/aclib.c b/libvo/aclib.c index ca06b84ad5..024cf06a6b 100644 --- a/libvo/aclib.c +++ b/libvo/aclib.c @@ -24,7 +24,7 @@ //Note: we have MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one //Plain C versions -//#if !defined (HAVE_MMX) || defined (RUNTIME_CPUDETECT) +//#if !HAVE_MMX || defined (RUNTIME_CPUDETECT) //#define COMPILE_C //#endif -- cgit v1.2.3 From 398389873420bb225e7085a8dc3b1354dfbcb655 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 16 Jan 2009 09:35:05 +0000 Subject: Another missed #ifdef HAVE_MMX git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28328 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/native/rtjpegn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpcodecs/native/rtjpegn.c b/libmpcodecs/native/rtjpegn.c index de72e5bd8e..d14843d4a1 100644 --- a/libmpcodecs/native/rtjpegn.c +++ b/libmpcodecs/native/rtjpegn.c @@ -26,7 +26,7 @@ #include #include "config.h" -#ifdef HAVE_MMX +#if HAVE_MMX #define MMX #endif -- cgit v1.2.3 From 9dee994c239562cd0dc89aad73a977b033324969 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 16 Jan 2009 09:41:26 +0000 Subject: 100l, mixed up ao_data.samplerate and ao_data.bps when calculating sleep time. Fixes stuttering audio when playing audio-only files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28329 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mplayer.c b/mplayer.c index e46143b763..e78dcbb33e 100644 --- a/mplayer.c +++ b/mplayer.c @@ -2027,7 +2027,7 @@ static int fill_audio_out_buffers(void) // handle audio-only case: // this is where mplayer sleeps during audio-only playback // to avoid 100% CPU use - sleep_time = (ao_data.outburst - bytes_to_write) * 1000 / ao_data.samplerate; + sleep_time = (ao_data.outburst - bytes_to_write) * 1000 / ao_data.bps; if (sleep_time < 10) sleep_time = 10; // limit to 100 wakeups per second usec_sleep(sleep_time * 1000); } -- cgit v1.2.3 From 17923f688bf59f88ac9939a57afb51f45098ab7f Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 16 Jan 2009 09:44:36 +0000 Subject: Fix a wrongly converted !defined(ARCH_X86_64) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28330 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cpudetect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpudetect.c b/cpudetect.c index bd9aa2c6b9..de9692349c 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -304,7 +304,7 @@ char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]){ #undef CPUID_STEPPING -#if defined(__linux__) && defined(_POSIX_SOURCE) && ARCH_X86_64 +#if defined(__linux__) && defined(_POSIX_SOURCE) && !ARCH_X86_64 static void sigill_handler_sse( int signal, struct sigcontext sc ) { mp_msg(MSGT_CPUDETECT,MSGL_V, "SIGILL, " ); -- cgit v1.2.3 From 5538dcf03b6906810bfcd1d0688856b776b66edc Mon Sep 17 00:00:00 2001 From: gpoirier Date: Fri, 16 Jan 2009 10:07:14 +0000 Subject: fix compilation on non x86 machines (PPC here) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28331 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_hwac3.c | 4 ++-- libmpcodecs/native/rtjpegn.c | 44 ++++++++++++++++++++++---------------------- libmpcodecs/vd_ffmpeg.c | 2 +- libmpcodecs/vf.c | 2 +- libmpcodecs/vf_scale.c | 2 +- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/libmpcodecs/ad_hwac3.c b/libmpcodecs/ad_hwac3.c index 1757018796..c4b0e70b29 100644 --- a/libmpcodecs/ad_hwac3.c +++ b/libmpcodecs/ad_hwac3.c @@ -179,7 +179,7 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m buf16[2] = 0x0001; // data-type ac3 buf16[2] |= (sh_audio->a_in_buffer[5] & 0x7) << 8; // bsmod buf16[3] = len << 3; // number of bits in payload -#ifdef WORDS_BIGENDIAN +#if WORDS_BIGENDIAN memcpy(buf + 8, sh_audio->a_in_buffer, len); #else swab(sh_audio->a_in_buffer, buf + 8, len); @@ -523,7 +523,7 @@ static int decode_audio_dts(unsigned char *indata_ptr, int len, unsigned char *b buf16[3] = fsize << 3; if (!convert_16bits) { -#ifdef WORDS_BIGENDIAN +#if WORDS_BIGENDIAN /* BE stream */ if (indata_ptr[0] == 0x1f || indata_ptr[0] == 0x7f) #else diff --git a/libmpcodecs/native/rtjpegn.c b/libmpcodecs/native/rtjpegn.c index d14843d4a1..ff55dc94b6 100644 --- a/libmpcodecs/native/rtjpegn.c +++ b/libmpcodecs/native/rtjpegn.c @@ -33,7 +33,7 @@ #include "mpbswap.h" #include "rtjpegn.h" -#ifdef MMX +#if MMX #include "mmx.h" #endif @@ -88,7 +88,7 @@ static int RTjpeg_Ysize, RTjpeg_Csize; static __s16 *RTjpeg_old=NULL; -#ifdef MMX +#if MMX mmx_t RTjpeg_lmask; mmx_t RTjpeg_cmask; #else @@ -610,7 +610,7 @@ void RTjpeg_quant(__s16 *block, __s32 *qtbl) /* * Perform the forward DCT on one block of samples. */ -#ifdef MMX +#if MMX static mmx_t RTjpeg_C4 ={0x2D412D412D412D41LL}; static mmx_t RTjpeg_C6 ={0x187E187E187E187ELL}; static mmx_t RTjpeg_C2mC6={0x22A322A322A322A3LL}; @@ -1570,7 +1570,7 @@ void RTjpeg_idct_init(void) void RTjpeg_idct(__u8 *odata, __s16 *data, int rskip) { -#ifdef MMX +#if MMX static mmx_t fix_141 = {0x5a825a825a825a82LL}; static mmx_t fix_184n261 = {0xcf04cf04cf04cf04LL}; @@ -2864,7 +2864,7 @@ int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp) register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1); register int i, j, k; -#ifdef MMX +#if MMX emms(); #endif sb=sp; @@ -2904,7 +2904,7 @@ int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp) bp3+=RTjpeg_width<<2; } -#ifdef MMX +#if MMX emms(); #endif return (sp-sb); @@ -2917,7 +2917,7 @@ int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp) register __s8 * bp3 = bp2 + RTjpeg_Csize; register int i, j, k; -#ifdef MMX +#if MMX emms(); #endif sb=sp; @@ -2948,7 +2948,7 @@ int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp) bp3+=RTjpeg_width<<2; } -#ifdef MMX +#if MMX emms(); #endif return (sp-sb); @@ -2959,7 +2959,7 @@ int RTjpeg_compress8(__s8 *sp, unsigned char *bp) __s8 * sb; int i, j; -#ifdef MMX +#if MMX emms(); #endif @@ -2976,7 +2976,7 @@ int RTjpeg_compress8(__s8 *sp, unsigned char *bp) bp+=RTjpeg_width; } -#ifdef MMX +#if MMX emms(); #endif return (sp-sb); @@ -2988,7 +2988,7 @@ void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp) register __s8 * bp3 = bp2 + (RTjpeg_Csize); int i, j,k; -#ifdef MMX +#if MMX emms(); #endif @@ -3025,7 +3025,7 @@ void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp) bp2+=RTjpeg_width<<2; bp3+=RTjpeg_width<<2; } -#ifdef MMX +#if MMX emms(); #endif } @@ -3037,7 +3037,7 @@ void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp) register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1); int i, j,k; -#ifdef MMX +#if MMX emms(); #endif @@ -3087,7 +3087,7 @@ void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp) bp2+=RTjpeg_width<<2; bp3+=RTjpeg_width<<2; } -#ifdef MMX +#if MMX emms(); #endif } @@ -3096,7 +3096,7 @@ void RTjpeg_decompress8(__s8 *sp, __u8 *bp) { int i, j; -#ifdef MMX +#if MMX emms(); #endif @@ -3141,7 +3141,7 @@ void RTjpeg_init_mcompress(void) memset(RTjpeg_old, 0, ((4*RTjpeg_width*RTjpeg_height))); } -#ifdef MMX +#if MMX int RTjpeg_bcomp(__s16 *old, mmx_t *mask) { @@ -3218,7 +3218,7 @@ int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1); register int i, j, k; -#ifdef MMX +#if MMX emms(); RTjpeg_lmask.uq=((__u64)lmask<<48)|((__u64)lmask<<32)|((__u64)lmask<<16)|lmask; RTjpeg_cmask.uq=((__u64)cmask<<48)|((__u64)cmask<<32)|((__u64)cmask<<16)|cmask; @@ -3294,7 +3294,7 @@ int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask bp3+=RTjpeg_width<<2; } -#ifdef MMX +#if MMX emms(); #endif return (sp-sb); @@ -3309,7 +3309,7 @@ int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask register __s8 * bp3; register int i, j, k; -#ifdef MMX +#if MMX emms(); RTjpeg_lmask.uq=((__u64)lmask<<48)|((__u64)lmask<<32)|((__u64)lmask<<16)|lmask; RTjpeg_cmask.uq=((__u64)cmask<<48)|((__u64)cmask<<32)|((__u64)cmask<<16)|cmask; @@ -3371,7 +3371,7 @@ int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask bp3+=RTjpeg_width<<2; } printf ("%d\n", block - RTjpeg_old); -#ifdef MMX +#if MMX emms(); #endif return (sp-sb); @@ -3383,7 +3383,7 @@ int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask) __s16 *block; int i, j; -#ifdef MMX +#if MMX emms(); RTjpeg_lmask.uq=((__u64)lmask<<48)|((__u64)lmask<<32)|((__u64)lmask<<16)|lmask; #else @@ -3409,7 +3409,7 @@ int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask) } bp+=RTjpeg_width<<3; } -#ifdef MMX +#if MMX emms(); #endif return (sp-sb); diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index c59e9f1b8b..06862fef0c 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -892,7 +892,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ mpi->stride[2]*=2; } -#ifdef WORDS_BIGENDIAN +#if WORDS_BIGENDIAN // FIXME: this might cause problems for buffers with FF_BUFFER_HINTS_PRESERVE if (mpi->bpp == 8) swap_palette(mpi->planes[1]); diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index cd181156f4..812c4dca36 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -231,7 +231,7 @@ void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h){ unsigned int* p=(unsigned int*) dst; int size=(mpi->bpp>>3)*w/4; int i; -#ifdef WORDS_BIGENDIAN +#if WORDS_BIGENDIAN #define CLEAR_PACKEDYUV_PATTERN 0x00800080 #define CLEAR_PACKEDYUV_PATTERN_SWAPPED 0x80008000 #else diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c index b6c683c430..d0a87feecd 100644 --- a/libmpcodecs/vf_scale.c +++ b/libmpcodecs/vf_scale.c @@ -322,7 +322,7 @@ static void start_slice(struct vf_instance_s* vf, mp_image_t *mpi){ static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src[3], int src_stride[3], int y, int h, uint8_t *dst[3], int dst_stride[3], int interlaced){ uint8_t *src2[3]={src[0], src[1], src[2]}; -#ifdef WORDS_BIGENDIAN +#if WORDS_BIGENDIAN uint32_t pal2[256]; if (src[1] && !src[2]){ int i; -- cgit v1.2.3 From 1e030723596ba5973fa7868ed547cd694f198241 Mon Sep 17 00:00:00 2001 From: gpoirier Date: Fri, 16 Jan 2009 12:23:52 +0000 Subject: fix wrong #ifdef/#ifndef -> #if conversion in r28323 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28332 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cpudetect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpudetect.c b/cpudetect.c index de9692349c..9756dfb454 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -511,7 +511,7 @@ void GetCpuCaps( CpuCaps *caps) caps->hasSSE4a=0; caps->isX86=0; caps->hasAltiVec = 0; -#if !HAVE_ALTIVEC +#if HAVE_ALTIVEC #ifdef __APPLE__ /* rip-off from ffmpeg altivec detection code. -- cgit v1.2.3 From 707afbe9d6a1e1441b8b677a8ddb8e215afb2023 Mon Sep 17 00:00:00 2001 From: gpoirier Date: Fri, 16 Jan 2009 12:37:56 +0000 Subject: Completely get rid of MMX define, use HAVE_MMX define instead. Patch by Guillaume LECERF % foxcore A gmail P com % git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28333 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/native/rtjpegn.c | 53 +++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/libmpcodecs/native/rtjpegn.c b/libmpcodecs/native/rtjpegn.c index ff55dc94b6..538bff609a 100644 --- a/libmpcodecs/native/rtjpegn.c +++ b/libmpcodecs/native/rtjpegn.c @@ -26,14 +26,11 @@ #include #include "config.h" -#if HAVE_MMX -#define MMX -#endif #include "mpbswap.h" #include "rtjpegn.h" -#if MMX +#if HAVE_MMX #include "mmx.h" #endif @@ -68,7 +65,7 @@ static const __u64 RTjpeg_aan_tab[64]={ 1184891264ULL, 1643641088ULL, 1548224000ULL, 1393296000ULL, 1184891264ULL, 931136000ULL, 641204288ULL, 326894240ULL, }; -#ifndef MMX +#if !HAVE_MMX static __s32 RTjpeg_ws[64+31]; #endif __u8 RTjpeg_alldata[2*64+4*64+4*64+4*64+4*64+32]; @@ -88,7 +85,7 @@ static int RTjpeg_Ysize, RTjpeg_Csize; static __s16 *RTjpeg_old=NULL; -#if MMX +#if HAVE_MMX mmx_t RTjpeg_lmask; mmx_t RTjpeg_cmask; #else @@ -541,7 +538,7 @@ int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl) } #endif -#if defined(MMX) +#if HAVE_MMX void RTjpeg_quant_init(void) { int i; @@ -610,7 +607,7 @@ void RTjpeg_quant(__s16 *block, __s32 *qtbl) /* * Perform the forward DCT on one block of samples. */ -#if MMX +#if HAVE_MMX static mmx_t RTjpeg_C4 ={0x2D412D412D412D41LL}; static mmx_t RTjpeg_C6 ={0x187E187E187E187ELL}; static mmx_t RTjpeg_C2mC6={0x22A322A322A322A3LL}; @@ -642,7 +639,7 @@ void RTjpeg_dct_init(void) void RTjpeg_dctY(__u8 *idata, __s16 *odata, int rskip) { -#ifndef MMX +#if !HAVE_MMX __s32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; __s32 tmp10, tmp11, tmp12, tmp13; __s32 z1, z2, z3, z4, z5, z11, z13; @@ -1570,7 +1567,7 @@ void RTjpeg_idct_init(void) void RTjpeg_idct(__u8 *odata, __s16 *data, int rskip) { -#if MMX +#if HAVE_MMX static mmx_t fix_141 = {0x5a825a825a825a82LL}; static mmx_t fix_184n261 = {0xcf04cf04cf04cf04LL}; @@ -2864,7 +2861,7 @@ int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp) register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1); register int i, j, k; -#if MMX +#if HAVE_MMX emms(); #endif sb=sp; @@ -2904,7 +2901,7 @@ int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp) bp3+=RTjpeg_width<<2; } -#if MMX +#if HAVE_MMX emms(); #endif return (sp-sb); @@ -2917,7 +2914,7 @@ int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp) register __s8 * bp3 = bp2 + RTjpeg_Csize; register int i, j, k; -#if MMX +#if HAVE_MMX emms(); #endif sb=sp; @@ -2948,7 +2945,7 @@ int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp) bp3+=RTjpeg_width<<2; } -#if MMX +#if HAVE_MMX emms(); #endif return (sp-sb); @@ -2959,7 +2956,7 @@ int RTjpeg_compress8(__s8 *sp, unsigned char *bp) __s8 * sb; int i, j; -#if MMX +#if HAVE_MMX emms(); #endif @@ -2976,7 +2973,7 @@ int RTjpeg_compress8(__s8 *sp, unsigned char *bp) bp+=RTjpeg_width; } -#if MMX +#if HAVE_MMX emms(); #endif return (sp-sb); @@ -2988,7 +2985,7 @@ void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp) register __s8 * bp3 = bp2 + (RTjpeg_Csize); int i, j,k; -#if MMX +#if HAVE_MMX emms(); #endif @@ -3025,7 +3022,7 @@ void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp) bp2+=RTjpeg_width<<2; bp3+=RTjpeg_width<<2; } -#if MMX +#if HAVE_MMX emms(); #endif } @@ -3037,7 +3034,7 @@ void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp) register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1); int i, j,k; -#if MMX +#if HAVE_MMX emms(); #endif @@ -3087,7 +3084,7 @@ void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp) bp2+=RTjpeg_width<<2; bp3+=RTjpeg_width<<2; } -#if MMX +#if HAVE_MMX emms(); #endif } @@ -3096,7 +3093,7 @@ void RTjpeg_decompress8(__s8 *sp, __u8 *bp) { int i, j; -#if MMX +#if HAVE_MMX emms(); #endif @@ -3141,7 +3138,7 @@ void RTjpeg_init_mcompress(void) memset(RTjpeg_old, 0, ((4*RTjpeg_width*RTjpeg_height))); } -#if MMX +#if HAVE_MMX int RTjpeg_bcomp(__s16 *old, mmx_t *mask) { @@ -3218,7 +3215,7 @@ int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1); register int i, j, k; -#if MMX +#if HAVE_MMX emms(); RTjpeg_lmask.uq=((__u64)lmask<<48)|((__u64)lmask<<32)|((__u64)lmask<<16)|lmask; RTjpeg_cmask.uq=((__u64)cmask<<48)|((__u64)cmask<<32)|((__u64)cmask<<16)|cmask; @@ -3294,7 +3291,7 @@ int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask bp3+=RTjpeg_width<<2; } -#if MMX +#if HAVE_MMX emms(); #endif return (sp-sb); @@ -3309,7 +3306,7 @@ int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask register __s8 * bp3; register int i, j, k; -#if MMX +#if HAVE_MMX emms(); RTjpeg_lmask.uq=((__u64)lmask<<48)|((__u64)lmask<<32)|((__u64)lmask<<16)|lmask; RTjpeg_cmask.uq=((__u64)cmask<<48)|((__u64)cmask<<32)|((__u64)cmask<<16)|cmask; @@ -3371,7 +3368,7 @@ int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask bp3+=RTjpeg_width<<2; } printf ("%d\n", block - RTjpeg_old); -#if MMX +#if HAVE_MMX emms(); #endif return (sp-sb); @@ -3383,7 +3380,7 @@ int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask) __s16 *block; int i, j; -#if MMX +#if HAVE_MMX emms(); RTjpeg_lmask.uq=((__u64)lmask<<48)|((__u64)lmask<<32)|((__u64)lmask<<16)|lmask; #else @@ -3409,7 +3406,7 @@ int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask) } bp+=RTjpeg_width<<3; } -#if MMX +#if HAVE_MMX emms(); #endif return (sp-sb); -- cgit v1.2.3 From 0f224d32dcb47d393e9c935409bbebd485efdc10 Mon Sep 17 00:00:00 2001 From: gpoirier Date: Fri, 16 Jan 2009 13:19:29 +0000 Subject: revert #ifdef WORDS_BIGENDIAN => #if WORDS_BIGENDIAN changes from r28331 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28334 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_hwac3.c | 4 ++-- libmpcodecs/vd_ffmpeg.c | 2 +- libmpcodecs/vf.c | 2 +- libmpcodecs/vf_scale.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libmpcodecs/ad_hwac3.c b/libmpcodecs/ad_hwac3.c index c4b0e70b29..1757018796 100644 --- a/libmpcodecs/ad_hwac3.c +++ b/libmpcodecs/ad_hwac3.c @@ -179,7 +179,7 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m buf16[2] = 0x0001; // data-type ac3 buf16[2] |= (sh_audio->a_in_buffer[5] & 0x7) << 8; // bsmod buf16[3] = len << 3; // number of bits in payload -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN memcpy(buf + 8, sh_audio->a_in_buffer, len); #else swab(sh_audio->a_in_buffer, buf + 8, len); @@ -523,7 +523,7 @@ static int decode_audio_dts(unsigned char *indata_ptr, int len, unsigned char *b buf16[3] = fsize << 3; if (!convert_16bits) { -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN /* BE stream */ if (indata_ptr[0] == 0x1f || indata_ptr[0] == 0x7f) #else diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 06862fef0c..c59e9f1b8b 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -892,7 +892,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ mpi->stride[2]*=2; } -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN // FIXME: this might cause problems for buffers with FF_BUFFER_HINTS_PRESERVE if (mpi->bpp == 8) swap_palette(mpi->planes[1]); diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index 812c4dca36..cd181156f4 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -231,7 +231,7 @@ void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h){ unsigned int* p=(unsigned int*) dst; int size=(mpi->bpp>>3)*w/4; int i; -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN #define CLEAR_PACKEDYUV_PATTERN 0x00800080 #define CLEAR_PACKEDYUV_PATTERN_SWAPPED 0x80008000 #else diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c index d0a87feecd..b6c683c430 100644 --- a/libmpcodecs/vf_scale.c +++ b/libmpcodecs/vf_scale.c @@ -322,7 +322,7 @@ static void start_slice(struct vf_instance_s* vf, mp_image_t *mpi){ static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src[3], int src_stride[3], int y, int h, uint8_t *dst[3], int dst_stride[3], int interlaced){ uint8_t *src2[3]={src[0], src[1], src[2]}; -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN uint32_t pal2[256]; if (src[1] && !src[2]){ int i; -- cgit v1.2.3 From b2a8be81e6267488fc9aeef445f3a4a2a474e382 Mon Sep 17 00:00:00 2001 From: compn Date: Fri, 16 Jan 2009 19:09:57 +0000 Subject: add mimic in avi fourcc LM20 to ffmimic MidiVid3 binary decoder for MV30 Telegeny binary decoder for VDTZ git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28335 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index 5f3d13dff2..0a1371148a 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -38,6 +38,7 @@ videocodec ffmimic info "FFmpeg Mimic video" status working fourcc ML20 + fourcc LM20 ; mimic in avi out I420 driver ffmpeg dll "mimic" @@ -1717,6 +1718,14 @@ videocodec psiv dll "psiv.dll" out BGR32,BGR24 query,flip +videocodec midivid3 + info "www.midivid.com/codec/mv3codec.html" + status working + fourcc MV30 + driver vfw + dll "MV3.dll" + out BGR24,BGR16 + videocodec nsvideo info "Power VideoWorks video" status working @@ -2126,6 +2135,14 @@ videocodec tridvfw dll "TRICDC32.DRV" out BGR24 flip +videocodec vdtzvfw + info "Telegeny VDTZ" + status working + fourcc VDTZ + driver vfw + dll "VTZ32.DLL" + out BGR24 flip + videocodec vivd2 info "SoftMedia ViVD V2 codec VfW" status working -- cgit v1.2.3 From 88d4577180f86240287e4a64e3445db2022d30ea Mon Sep 17 00:00:00 2001 From: gpoirier Date: Fri, 16 Jan 2009 20:32:36 +0000 Subject: fix compilation without VDPAU decoders git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28336 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 664ea4b3d9..3f0f96d684 100755 --- a/configure +++ b/configure @@ -523,7 +523,7 @@ _libavcodec_a=auto _libamr_nb=auto _libamr_wb=auto _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` -_libavdecoders=` echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER// -e s/H264_VDPAU_DECODER// -e s/MPEG_VDPAU_DECODER//` +_libavdecoders=` echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER// -e s/H264_VDPAU_DECODER// -e s/MPEG_VDPAU_DECODER// -e s/MPEG1_VDPAU_DECODER//` _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` _libavencoders=` echo $_libavencoders_all | sed 's/ LIB[A-Z0-9_]*_ENCODER//g'` _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` -- cgit v1.2.3 From f14ff6d0544b38cd47aae891b61e0e0d85995e2d Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 16 Jan 2009 21:04:52 +0000 Subject: 100l, forgot to delete two defines left over from old HAVE_MMX handling code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28337 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/aclib.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libvo/aclib.c b/libvo/aclib.c index 024cf06a6b..4c51709b2a 100644 --- a/libvo/aclib.c +++ b/libvo/aclib.c @@ -102,8 +102,6 @@ #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 -- cgit v1.2.3 From 83c523f9ea76c556c1a8ee878ee91f15fe7ec1c6 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Sat, 17 Jan 2009 11:29:36 +0000 Subject: Fix compilation: s/ff_gcd/av_gcd. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28338 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af_resample.c | 4 ++-- libmpdemux/demux_lavf.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libaf/af_resample.c b/libaf/af_resample.c index 57335532c4..0953217c4c 100644 --- a/libaf/af_resample.c +++ b/libaf/af_resample.c @@ -201,7 +201,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg) } // Calculate up and down sampling factors - d=ff_gcd(af->data->rate,n->rate); + d=av_gcd(af->data->rate,n->rate); // If sloppy resampling is enabled limit the upsampling factor if(((s->setup & FREQ_MASK) == FREQ_SLOPPY) && (af->data->rate/d > 5000)){ @@ -209,7 +209,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg) int dn=n->rate/2; int m=2; while(af->data->rate/(d*m) > 5000){ - d=ff_gcd(up,dn); + d=av_gcd(up,dn); up/=2; dn/=2; m*=2; } d*=m; diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index c1b302381f..9749054a03 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -263,7 +263,7 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) { sh_audio->audio.dwScale= codec->block_align ? codec->block_align*8 : 8; sh_audio->audio.dwRate = codec->bit_rate; } - g= ff_gcd(sh_audio->audio.dwScale, sh_audio->audio.dwRate); + g= av_gcd(sh_audio->audio.dwScale, sh_audio->audio.dwRate); sh_audio->audio.dwScale /= g; sh_audio->audio.dwRate /= g; // printf("sca:%d rat:%d fs:%d sr:%d ba:%d\n", sh_audio->audio.dwScale, sh_audio->audio.dwRate, codec->frame_size, codec->sample_rate, codec->block_align); -- cgit v1.2.3 From 84784a50942a377c48d6bb2e33fa180c8cf21fd0 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Sat, 17 Jan 2009 11:31:12 +0000 Subject: MPlayer only supports latest libavutil. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28339 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 3f0f96d684..b36811de19 100755 --- a/configure +++ b/configure @@ -6633,7 +6633,7 @@ elif test "$_libavutil_so" = auto ; then _libavutil_so=no cat > $TMPC << EOF #include -int main(void) { ff_gcd(1,1); return 0; } +int main(void) { av_gcd(1,1); return 0; } EOF if $_pkg_config --exists libavutil ; then _inc_libavutil=`$_pkg_config --cflags libavutil` -- cgit v1.2.3 From cc52547eced860feda39254c98c226ebdc6bac9d Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 17 Jan 2009 21:33:30 +0000 Subject: Reduce QuickTime binary decoder verbosity. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28340 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loader/win32.c b/loader/win32.c index 96ab76f691..71072afaeb 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -3328,7 +3328,7 @@ static WIN_BOOL WINAPI expFindNextFileA(HANDLE h,LPWIN32_FIND_DATAA lpfd) strcpy(lpfd->cFileName,d->d_name); // sprintf(lpfd->cAlternateFileName,"%-8s.qtx",d->d_name); strcpy(lpfd->cAlternateFileName,"foobar.qtx"); - printf("### FindNext: %s\n",lpfd->cFileName); + dbgprintf("### FindNext: %s\n",lpfd->cFileName); return 1; } closedir(qtx_dir); qtx_dir=NULL; @@ -3345,7 +3345,7 @@ static HANDLE WINAPI expFindFirstFileA(LPCSTR s, LPWIN32_FIND_DATAA lpfd) #ifdef QTX if(strstr(s, "quicktime\\*.QTX")){ dbgprintf("FindFirstFileA(0x%x='%s', 0x%x) => QTX\n", s, s, lpfd); - printf("\n### Searching for QuickTime plugins (*.qtx) at %s...\n",def_path); + dbgprintf("\n### Searching for QuickTime plugins (*.qtx) at %s...\n",def_path); qtx_dir=opendir(def_path); if(!qtx_dir) return (HANDLE)-1; memset(lpfd,0,sizeof(*lpfd)); -- cgit v1.2.3 From 39cb032fd184a62416f1e62d26e05576cfd8dbe4 Mon Sep 17 00:00:00 2001 From: gpoirier Date: Sun, 18 Jan 2009 18:05:16 +0000 Subject: fix device_id option after r28165 patch by Adrian Stutz %adrian A sttz P ch% Original thread: date Fri, Jan 9, 2009 at 4:03 PM subject [MPlayer-dev-eng] [PATCH] vo_macosx: fix device_id option after r28165 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28341 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 3 ++- libvo/vo_macosx.m | 13 ++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 79f042d6a2..deccef7e73 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3560,7 +3560,8 @@ Mac OS X CoreVideo video output driver .PD 0 .RSs .IPs device_id= -Choose the display device to use in fullscreen. +Choose the display device to use for fullscreen or set it to \-1 to +always use the same screen the video window is on (default: \-1 \- auto). .IPs shared_buffer Write output to a shared memory buffer instead of displaying it and try to open an existing NSConnection for communication with a GUI. diff --git a/libvo/vo_macosx.m b/libvo/vo_macosx.m index b049cf080c..151a9fafe6 100644 --- a/libvo/vo_macosx.m +++ b/libvo/vo_macosx.m @@ -49,8 +49,7 @@ BOOL shared_buffer = false; static char *buffer_name; //Screen -int screen_id; -BOOL screen_force; +int screen_id = -1; NSRect screen_frame; NSScreen *screen_handle; NSArray *screen_array; @@ -111,13 +110,13 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ screen_array = [NSScreen screens]; if(screen_id < [screen_array count]) { - screen_handle = [screen_array objectAtIndex:screen_id]; + screen_handle = [screen_array objectAtIndex:(screen_id < 0 ? 0 : screen_id)]; } else { mp_msg(MSGT_VO, MSGL_FATAL, "Get device error: Device ID %d do not exist, falling back to main device.\n", screen_id); screen_handle = [screen_array objectAtIndex:0]; - screen_id = 0; + screen_id = -1; } screen_frame = [screen_handle frame]; vo_screenwidth = screen_frame.size.width; @@ -325,7 +324,7 @@ static void uninit(void) } static opt_t subopts[] = { -{"device_id", OPT_ARG_INT, &screen_id, (opt_test_f)int_non_neg}, +{"device_id", OPT_ARG_INT, &screen_id, NULL}, {"shared_buffer", OPT_ARG_BOOL, &shared_buffer, NULL}, {"buffer_name", OPT_ARG_MSTRZ,&buffer_name, NULL}, {NULL} @@ -335,7 +334,7 @@ static int preinit(const char *arg) { // set defaults - screen_id = 0; + screen_id = -1; shared_buffer = false; buffer_name = NULL; @@ -859,7 +858,7 @@ static int control(uint32_t request, void *data, ...) } old_frame = [window frame]; //save main window size & position - if(screen_force) + if(screen_id >= 0) screen_frame = [screen_handle frame]; else { screen_frame = [[window screen] frame]; -- cgit v1.2.3