From 418ce8eb059d44594b02c8e94d5a0a7ab28350e2 Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 26 Jan 2009 09:11:23 +0000 Subject: version.h depends on version.sh. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28369 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bfc09d0345..7c72dc1590 100644 --- a/Makefile +++ b/Makefile @@ -838,8 +838,8 @@ help_mp.h: help/help_mp-en.h $(HELP_FILE) ifeq ($(wildcard .svn/entries),.svn/entries) version.h: .svn/entries endif -version.h: - ./version.sh `$(CC) -dumpversion` +version.h: version.sh + ./$< `$(CC) -dumpversion` %(EXESUF): %.c -- cgit v1.2.3 From eb4a4604c099fa7c656b30d3edb759cb4c58661c Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 26 Jan 2009 09:29:53 +0000 Subject: HAVE_3DNOW --> HAVE_AMD3DNOW git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28370 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 20 ++++++++++---------- configure | 6 +++--- cpudetect.c | 4 ++-- liba52/imdct.c | 16 ++++++++-------- liba52/imdct_3dnow.h | 28 ++++++++++++++-------------- liba52/liba52_changes.diff | 10 +++++----- liba52/srfftp_3dnow.h | 4 ++-- libaf/af.h | 2 +- libmpcodecs/vf_filmdint.c | 4 ++-- libmpcodecs/vf_tfields.c | 4 ++-- libmpeg2/libmpeg2_changes.diff | 2 +- libmpeg2/motion_comp.c | 2 +- libvo/aclib.c | 32 ++++++++++++++++---------------- libvo/aclib_template.c | 8 ++++---- libvo/fastmemcpy.h | 2 +- libvo/osd.c | 40 ++++++++++++++++++++-------------------- libvo/osd_template.c | 12 ++++++------ mpcommon.c | 4 ++-- 18 files changed, 100 insertions(+), 100 deletions(-) diff --git a/Makefile b/Makefile index 7c72dc1590..ccac3e058e 100644 --- a/Makefile +++ b/Makefile @@ -387,10 +387,10 @@ SRCS_COMMON-$(MACOSX_FINDER) += osdep/macosx_finder_args.c SRCS_COMMON-$(MNG) += libmpdemux/demux_mng.c SRCS_COMMON-$(MP3LIB) += libmpcodecs/ad_mp3lib.c mp3lib/sr1.c SRCS_COMMON-$(MP3LIB)-$(ARCH_X86_32) += mp3lib/decode_i586.c -SRCS_COMMON-$(MP3LIB)-$(ARCH_X86_32)-$(HAVE_3DNOW) += mp3lib/dct36_3dnow.c \ - mp3lib/dct64_3dnow.c -SRCS_COMMON-$(MP3LIB)-$(ARCH_X86_32)-$(HAVE_3DNOWEXT) += mp3lib/dct36_k7.c \ - mp3lib/dct64_k7.c +SRCS_COMMON-$(MP3LIB)-$(ARCH_X86_32)-$(HAVE_AMD3DNOW) += mp3lib/dct36_3dnow.c \ + mp3lib/dct64_3dnow.c +SRCS_COMMON-$(MP3LIB)-$(ARCH_X86_32)-$(HAVE_AMD3DNOWEXT) += mp3lib/dct36_k7.c \ + mp3lib/dct64_k7.c SRCS_COMMON-$(MP3LIB)-$(ARCH_X86_32)-$(HAVE_MMX) += mp3lib/dct64_mmx.c SRCS_COMMON-$(MP3LIB)-$(HAVE_ALTIVEC) += mp3lib/dct64_altivec.c SRCS_COMMON-$(MP3LIB)-$(HAVE_MMX) += mp3lib/decode_mmx.c @@ -1026,13 +1026,13 @@ TOOLS/netstream$(EXESUF) TOOLS/vivodump$(EXESUF): $(subst mplayer.o,mplayer-noma fastmemcpybench: TOOLS/fastmemcpybench.c $(CC) $(CFLAGS) $< -o TOOLS/fastmem-mmx$(EXESUF) -DNAME=\"mmx\" -DHAVE_MMX - $(CC) $(CFLAGS) $< -o TOOLS/fastmem-k6$(EXESUF) -DNAME=\"k6\ \" -DHAVE_MMX -DHAVE_3DNOW - $(CC) $(CFLAGS) $< -o TOOLS/fastmem-k7$(EXESUF) -DNAME=\"k7\ \" -DHAVE_MMX -DHAVE_3DNOW -DHAVE_MMX2 - $(CC) $(CFLAGS) $< -o TOOLS/fastmem-sse$(EXESUF) -DNAME=\"sse\" -DHAVE_MMX -DHAVE_SSE -DHAVE_MMX2 + $(CC) $(CFLAGS) $< -o TOOLS/fastmem-k6$(EXESUF) -DNAME=\"k6\ \" -DHAVE_MMX -DHAVE_AMD3DNOW + $(CC) $(CFLAGS) $< -o TOOLS/fastmem-k7$(EXESUF) -DNAME=\"k7\ \" -DHAVE_MMX -DHAVE_AMD3DNOW -DHAVE_MMX2 + $(CC) $(CFLAGS) $< -o TOOLS/fastmem-sse$(EXESUF) -DNAME=\"sse\" -DHAVE_MMX -DHAVE_SSE -DHAVE_MMX2 $(CC) $(CFLAGS) $< -o TOOLS/fastmem2-mmx$(EXESUF) -DNAME=\"mga-mmx\" -DCONFIG_MGA -DHAVE_MMX - $(CC) $(CFLAGS) $< -o TOOLS/fastmem2-k6$(EXESUF) -DNAME=\"mga-k6\ \" -DCONFIG_MGA -DHAVE_MMX -DHAVE_3DNOW - $(CC) $(CFLAGS) $< -o TOOLS/fastmem2-k7$(EXESUF) -DNAME=\"mga-k7\ \" -DCONFIG_MGA -DHAVE_MMX -DHAVE_3DNOW -DHAVE_MMX2 - $(CC) $(CFLAGS) $< -o TOOLS/fastmem2-sse$(EXESUF) -DNAME=\"mga-sse\" -DCONFIG_MGA -DHAVE_MMX -DHAVE_SSE -DHAVE_MMX2 + $(CC) $(CFLAGS) $< -o TOOLS/fastmem2-k6$(EXESUF) -DNAME=\"mga-k6\ \" -DCONFIG_MGA -DHAVE_MMX -DHAVE_AMD3DNOW + $(CC) $(CFLAGS) $< -o TOOLS/fastmem2-k7$(EXESUF) -DNAME=\"mga-k7\ \" -DCONFIG_MGA -DHAVE_MMX -DHAVE_AMD3DNOW -DHAVE_MMX2 + $(CC) $(CFLAGS) $< -o TOOLS/fastmem2-sse$(EXESUF) -DNAME=\"mga-sse\" -DCONFIG_MGA -DHAVE_MMX -DHAVE_SSE -DHAVE_MMX2 REAL_SRCS = $(wildcard TOOLS/realcodecs/*.c) REAL_TARGETS = $(REAL_SRCS:.c=.so.6.0) diff --git a/configure b/configure index 64069ddced..5fb5f28333 100755 --- a/configure +++ b/configure @@ -2611,12 +2611,12 @@ EOF echores "$_iwmmxt" fi -_cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP IWMMXT MMI VIS MVI' +_cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT 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" -test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts" -test "$_3dnowext" = yes && _cpuexts="3DNOWEXT $_cpuexts" +test "$_3dnow" = yes && _cpuexts="AMD3DNOW $_cpuexts" +test "$_3dnowext" = yes && _cpuexts="AMD3DNOWEXT $_cpuexts" test "$_sse" = yes && _cpuexts="SSE $_cpuexts" test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts" test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts" diff --git a/cpudetect.c b/cpudetect.c index fee0c8fc1f..14540842be 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -228,11 +228,11 @@ void GetCpuCaps( CpuCaps *caps) if(caps->hasSSE2) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"SSE2 supported but disabled\n"); caps->hasSSE2=0; #endif -#if !HAVE_3DNOW +#if !HAVE_AMD3DNOW if(caps->has3DNow) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"3DNow supported but disabled\n"); caps->has3DNow=0; #endif -#if !HAVE_3DNOWEXT +#if !HAVE_AMD3DNOWEXT if(caps->has3DNowExt) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"3DNowExt supported but disabled\n"); caps->has3DNowExt=0; #endif diff --git a/liba52/imdct.c b/liba52/imdct.c index c6253b672d..e3c6ca912d 100644 --- a/liba52/imdct.c +++ b/liba52/imdct.c @@ -53,8 +53,8 @@ void (*a52_imdct_512) (sample_t * data, sample_t * delay, sample_t bias); #ifdef RUNTIME_CPUDETECT -#undef HAVE_3DNOWEXT -#define HAVE_3DNOWEXT 0 +#undef HAVE_AMD3DNOWEXT +#define HAVE_AMD3DNOWEXT 0 #endif typedef struct complex_s { @@ -712,19 +712,19 @@ 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 ARCH_X86 || ARCH_X86_64 -#undef HAVE_3DNOW -#define HAVE_3DNOW 1 +#undef HAVE_AMD3DNOW +#define HAVE_AMD3DNOW 1 #include "srfftp_3dnow.h" const i_cmplx_t x_plus_minus_3dnow __attribute__ ((aligned (8))) = {{ 0x00000000UL, 0x80000000UL }}; const i_cmplx_t x_minus_plus_3dnow __attribute__ ((aligned (8))) = {{ 0x80000000UL, 0x00000000UL }}; const complex_t HSQRT2_3DNOW __attribute__ ((aligned (8))) = { 0.707106781188, 0.707106781188 }; -#undef HAVE_3DNOWEXT -#define HAVE_3DNOWEXT 0 +#undef HAVE_AMD3DNOWEXT +#define HAVE_AMD3DNOWEXT 0 #include "imdct_3dnow.h" -#undef HAVE_3DNOWEXT -#define HAVE_3DNOWEXT 1 +#undef HAVE_AMD3DNOWEXT +#define HAVE_AMD3DNOWEXT 1 #include "imdct_3dnow.h" void diff --git a/liba52/imdct_3dnow.h b/liba52/imdct_3dnow.h index 048aa7baa7..1c13f06870 100644 --- a/liba52/imdct_3dnow.h +++ b/liba52/imdct_3dnow.h @@ -26,7 +26,7 @@ #undef FFT_ASMB16_3DNOW #undef FFT_128P_3DNOW -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT #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 */ -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT "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" -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT "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" -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT "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" -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT "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" -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT "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" -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT "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" -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT "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 -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT 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" -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT "pswapd %%mm1, %%mm1\n\t" #else "punpckldq %%mm1, %%mm5\n\t" "punpckhdq %%mm5, %%mm1\n\t" #endif "pfmul %%mm1, %%mm2\n\t" -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT "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 */ -#if !HAVE_3DNOWEXT +#if !HAVE_AMD3DNOWEXT "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" -#if !HAVE_3DNOWEXT +#if !HAVE_AMD3DNOWEXT "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" -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT "pswapd (%3), %%mm3\n\t" "pswapd -512(%3), %%mm4\n\t" #else diff --git a/liba52/liba52_changes.diff b/liba52/liba52_changes.diff index 9840a05f02..9a559a5036 100644 --- a/liba52/liba52_changes.diff +++ b/liba52/liba52_changes.diff @@ -1412,7 +1412,7 @@ +void (*a52_imdct_512) (sample_t * data, sample_t * delay, sample_t bias); + +#ifdef RUNTIME_CPUDETECT -+#undef HAVE_3DNOWEXT ++#undef HAVE_AMD3DNOWEXT +#endif typedef struct complex_s { @@ -1853,8 +1853,8 @@ +// Stuff below this line is borrowed from libac3 +#include "srfftp.h" +#if defined(ARCH_X86) || defined(ARCH_X86_64) -+#ifndef HAVE_3DNOW -+#define HAVE_3DNOW 1 ++#ifndef HAVE_AMD3DNOW ++#define HAVE_AMD3DNOW 1 +#endif +#include "srfftp_3dnow.h" + @@ -1862,9 +1862,9 @@ +const i_cmplx_t x_minus_plus_3dnow __attribute__ ((aligned (8))) = {{ 0x80000000UL, 0x00000000UL }}; +const complex_t HSQRT2_3DNOW __attribute__ ((aligned (8))) = { 0.707106781188, 0.707106781188 }; + -+#undef HAVE_3DNOWEXT ++#undef HAVE_AMD3DNOWEXT +#include "imdct_3dnow.h" -+#define HAVE_3DNOWEXT ++#define HAVE_AMD3DNOWEXT +#include "imdct_3dnow.h" + +void diff --git a/liba52/srfftp_3dnow.h b/liba52/srfftp_3dnow.h index 7d05d9e09f..fb4badc60c 100644 --- a/liba52/srfftp_3dnow.h +++ b/liba52/srfftp_3dnow.h @@ -46,7 +46,7 @@ typedef struct "m"(x_minus_plus_3dnow)\ :"memory"); -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT #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 -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT #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 038aa729d2..71dd023fa5 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 HAVE_SSE || HAVE_3DNOW +#if HAVE_SSE || HAVE_AMD3DNOW #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/libmpcodecs/vf_filmdint.c b/libmpcodecs/vf_filmdint.c index 4313d50692..477530e5f1 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; -#if !HAVE_3DNOW +#if !HAVE_AMD3DNOW mp_msg(MSGT_VFILTER, MSGL_FATAL, "block_metrics_3dnow: internal error\n"); #else static const unsigned long long ones = 0x0101010101010101ull; @@ -1425,7 +1425,7 @@ static int open(vf_instance_t *vf, char* args) #if !HAVE_MMX p->mmx2 = 0; #endif -#if !HAVE_3DNOW +#if !HAVE_AMD3DNOW p->mmx2 &= 1; #endif p->thres.odd = p->thres.even; diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c index 3cc027913b..1118484cc5 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 } } -#if HAVE_3DNOW +#if HAVE_AMD3DNOW 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; @@ -485,7 +485,7 @@ static int open(vf_instance_t *vf, char* args) #if HAVE_MMX2 if(gCpuCaps.hasMMX2) qpel_li = qpel_li_MMX2; #endif -#if HAVE_3DNOW +#if HAVE_AMD3DNOW if(gCpuCaps.has3DNow) qpel_li = qpel_li_3DNOW; #endif return 1; diff --git a/libmpeg2/libmpeg2_changes.diff b/libmpeg2/libmpeg2_changes.diff index 6220b61f03..64cfd3cee1 100644 --- a/libmpeg2/libmpeg2_changes.diff +++ b/libmpeg2/libmpeg2_changes.diff @@ -136,7 +136,7 @@ - else if (accel & MPEG2_ACCEL_X86_3DNOW) + else +#endif -+#ifdef HAVE_3DNOW ++#ifdef HAVE_AMD3DNOW + if (accel & MPEG2_ACCEL_X86_3DNOW) mpeg2_mc = mpeg2_mc_3dnow; - else if (accel & MPEG2_ACCEL_X86_MMX) diff --git a/libmpeg2/motion_comp.c b/libmpeg2/motion_comp.c index 9ef39290e5..f056176e92 100644 --- a/libmpeg2/motion_comp.c +++ b/libmpeg2/motion_comp.c @@ -42,7 +42,7 @@ void mpeg2_mc_init (uint32_t accel) mpeg2_mc = mpeg2_mc_mmxext; else #endif -#if HAVE_3DNOW +#if HAVE_AMD3DNOW if (accel & MPEG2_ACCEL_X86_3DNOW) mpeg2_mc = mpeg2_mc_3dnow; else diff --git a/libvo/aclib.c b/libvo/aclib.c index 4c51709b2a..bc9bb2e55c 100644 --- a/libvo/aclib.c +++ b/libvo/aclib.c @@ -30,7 +30,7 @@ #ifdef CAN_COMPILE_X86_ASM -#if (HAVE_MMX && !HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) +#if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) #define COMPILE_MMX #endif @@ -38,7 +38,7 @@ #define COMPILE_MMX2 #endif -#if (HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) +#if (HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) #define COMPILE_3DNOW #endif @@ -48,24 +48,24 @@ #undef HAVE_MMX #undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_AMD3DNOW #undef HAVE_SSE #undef HAVE_SSE2 #define HAVE_MMX 0 #define HAVE_MMX2 0 -#define HAVE_3DNOW 0 +#define HAVE_AMD3DNOW 0 #define HAVE_SSE 0 #define HAVE_SSE2 0 /* #ifdef COMPILE_C #undef HAVE_MMX #undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_AMD3DNOW #undef HAVE_SSE #undef HAVE_SSE2 #define HAVE_MMX 0 #define HAVE_MMX2 0 -#define HAVE_3DNOW 0 +#define HAVE_AMD3DNOW 0 #define HAVE_SSE 0 #define HAVE_SSE2 0 #define RENAME(a) a ## _C @@ -77,12 +77,12 @@ #undef RENAME #undef HAVE_MMX #undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_AMD3DNOW #undef HAVE_SSE #undef HAVE_SSE2 #define HAVE_MMX 1 #define HAVE_MMX2 0 -#define HAVE_3DNOW 0 +#define HAVE_AMD3DNOW 0 #define HAVE_SSE 0 #define HAVE_SSE2 0 #define RENAME(a) a ## _MMX @@ -94,12 +94,12 @@ #undef RENAME #undef HAVE_MMX #undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_AMD3DNOW #undef HAVE_SSE #undef HAVE_SSE2 #define HAVE_MMX 1 #define HAVE_MMX2 1 -#define HAVE_3DNOW 0 +#define HAVE_AMD3DNOW 0 #define HAVE_SSE 0 #define HAVE_SSE2 0 #define RENAME(a) a ## _MMX2 @@ -111,12 +111,12 @@ #undef RENAME #undef HAVE_MMX #undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_AMD3DNOW #undef HAVE_SSE #undef HAVE_SSE2 #define HAVE_MMX 1 #define HAVE_MMX2 0 -#define HAVE_3DNOW 1 +#define HAVE_AMD3DNOW 1 #define HAVE_SSE 0 #define HAVE_SSE2 0 #define RENAME(a) a ## _3DNow @@ -128,12 +128,12 @@ #undef RENAME #undef HAVE_MMX #undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_AMD3DNOW #undef HAVE_SSE #undef HAVE_SSE2 #define HAVE_MMX 1 #define HAVE_MMX2 1 -#define HAVE_3DNOW 0 +#define HAVE_AMD3DNOW 0 #define HAVE_SSE 1 #define HAVE_SSE2 1 #define RENAME(a) a ## _SSE @@ -165,7 +165,7 @@ void * fast_memcpy(void * to, const void * from, size_t len) fast_memcpy_SSE(to, from, len); #elif HAVE_MMX2 fast_memcpy_MMX2(to, from, len); -#elif HAVE_3DNOW +#elif HAVE_AMD3DNOW fast_memcpy_3DNow(to, from, len); #elif HAVE_MMX fast_memcpy_MMX(to, from, len); @@ -199,7 +199,7 @@ void * mem2agpcpy(void * to, const void * from, size_t len) mem2agpcpy_SSE(to, from, len); #elif HAVE_MMX2 mem2agpcpy_MMX2(to, from, len); -#elif HAVE_3DNOW +#elif HAVE_AMD3DNOW mem2agpcpy_3DNow(to, from, len); #elif HAVE_MMX mem2agpcpy_MMX(to, from, len); diff --git a/libvo/aclib_template.c b/libvo/aclib_template.c index 74f0371a63..ab2ed6e5f5 100644 --- a/libvo/aclib_template.c +++ b/libvo/aclib_template.c @@ -66,7 +66,7 @@ If you have questions please contact with me: Nick Kurshev: nickols_k@mail.ru. #undef HAVE_ONLY_MMX1 -#if HAVE_MMX && !HAVE_MMX2 && !HAVE_3DNOW && !HAVE_SSE +#if HAVE_MMX && !HAVE_MMX2 && !HAVE_AMD3DNOW && !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. @@ -77,7 +77,7 @@ If you have questions please contact with me: Nick Kurshev: nickols_k@mail.ru. #undef HAVE_K6_2PLUS -#if !HAVE_MMX2 && HAVE_3DNOW +#if !HAVE_MMX2 && HAVE_AMD3DNOW #define HAVE_K6_2PLUS #endif @@ -107,14 +107,14 @@ __asm__ volatile(\ #if HAVE_MMX2 #define PREFETCH "prefetchnta" -#elif HAVE_3DNOW +#elif HAVE_AMD3DNOW #define PREFETCH "prefetch" #else #define PREFETCH " # nop" #endif /* On K6 femms is faster of emms. On K7 femms is directly mapped on emms. */ -#if HAVE_3DNOW +#if HAVE_AMD3DNOW #define EMMS "femms" #else #define EMMS "emms" diff --git a/libvo/fastmemcpy.h b/libvo/fastmemcpy.h index 69ded04bcf..fa736b62f0 100644 --- a/libvo/fastmemcpy.h +++ b/libvo/fastmemcpy.h @@ -24,7 +24,7 @@ #include #ifdef CONFIG_FASTMEMCPY -#if HAVE_MMX || HAVE_MMX2 || HAVE_3DNOW \ +#if HAVE_MMX || HAVE_MMX2 || HAVE_AMD3DNOW \ /* || HAVE_SSE || HAVE_SSE2 */ #include diff --git a/libvo/osd.c b/libvo/osd.c index df91ffbae0..80a8da7f1c 100644 --- a/libvo/osd.c +++ b/libvo/osd.c @@ -29,7 +29,7 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF #ifdef CAN_COMPILE_X86_ASM -#if (HAVE_MMX && !HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) +#if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) #define COMPILE_MMX #endif @@ -37,27 +37,27 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF #define COMPILE_MMX2 #endif -#if (HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) +#if (HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) #define COMPILE_3DNOW #endif #endif //CAN_COMPILE_X86_ASM #undef HAVE_MMX #undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_AMD3DNOW #define HAVE_MMX 0 #define HAVE_MMX2 0 -#define HAVE_3DNOW 0 +#define HAVE_AMD3DNOW 0 #ifndef CAN_COMPILE_X86_ASM #ifdef COMPILE_C #undef HAVE_MMX #undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_AMD3DNOW #define HAVE_MMX 0 #define HAVE_MMX2 0 -#define HAVE_3DNOW 0 +#define HAVE_AMD3DNOW 0 #define RENAME(a) a ## _C #include "osd_template.c" #endif @@ -69,10 +69,10 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF #undef RENAME #undef HAVE_MMX #undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_AMD3DNOW #define HAVE_MMX 0 #define HAVE_MMX2 0 -#define HAVE_3DNOW 0 +#define HAVE_AMD3DNOW 0 #define RENAME(a) a ## _X86 #include "osd_template.c" #endif @@ -82,10 +82,10 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF #undef RENAME #undef HAVE_MMX #undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_AMD3DNOW #define HAVE_MMX 1 #define HAVE_MMX2 0 -#define HAVE_3DNOW 0 +#define HAVE_AMD3DNOW 0 #define RENAME(a) a ## _MMX #include "osd_template.c" #endif @@ -95,10 +95,10 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF #undef RENAME #undef HAVE_MMX #undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_AMD3DNOW #define HAVE_MMX 1 #define HAVE_MMX2 1 -#define HAVE_3DNOW 0 +#define HAVE_AMD3DNOW 0 #define RENAME(a) a ## _MMX2 #include "osd_template.c" #endif @@ -108,10 +108,10 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF #undef RENAME #undef HAVE_MMX #undef HAVE_MMX2 -#undef HAVE_3DNOW +#undef HAVE_AMD3DNOW #define HAVE_MMX 1 #define HAVE_MMX2 0 -#define HAVE_3DNOW 1 +#define HAVE_AMD3DNOW 1 #define RENAME(a) a ## _3DNow #include "osd_template.c" #endif @@ -136,7 +136,7 @@ void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, in #else //RUNTIME_CPUDETECT #if HAVE_MMX2 vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride); -#elif HAVE_3DNOW +#elif HAVE_AMD3DNOW vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride); #elif HAVE_MMX vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride); @@ -166,7 +166,7 @@ void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, in #else //RUNTIME_CPUDETECT #if HAVE_MMX2 vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride); -#elif HAVE_3DNOW +#elif HAVE_AMD3DNOW vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride); #elif HAVE_MMX vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride); @@ -196,7 +196,7 @@ void vo_draw_alpha_uyvy(int w,int h, unsigned char* src, unsigned char *srca, in #else //RUNTIME_CPUDETECT #if HAVE_MMX2 vo_draw_alpha_uyvy_MMX2(w, h, src, srca, srcstride, dstbase, dststride); -#elif HAVE_3DNOW +#elif HAVE_AMD3DNOW vo_draw_alpha_uyvy_3DNow(w, h, src, srca, srcstride, dstbase, dststride); #elif HAVE_MMX vo_draw_alpha_uyvy_MMX(w, h, src, srca, srcstride, dstbase, dststride); @@ -226,7 +226,7 @@ void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, i #else //RUNTIME_CPUDETECT #if HAVE_MMX2 vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride); -#elif HAVE_3DNOW +#elif HAVE_AMD3DNOW vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride); #elif HAVE_MMX vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride); @@ -256,7 +256,7 @@ void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, i #else //RUNTIME_CPUDETECT #if HAVE_MMX2 vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride); -#elif HAVE_3DNOW +#elif HAVE_AMD3DNOW vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride); #elif HAVE_MMX vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride); @@ -301,7 +301,7 @@ void vo_draw_alpha_init(void){ #else //RUNTIME_CPUDETECT #if HAVE_MMX2 mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay\n"); -#elif HAVE_3DNOW +#elif HAVE_AMD3DNOW mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit 3DNow) Optimized OnScreenDisplay\n"); #elif HAVE_MMX mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX Optimized OnScreenDisplay\n"); diff --git a/libvo/osd_template.c b/libvo/osd_template.c index 8700a176c6..bc37b9d460 100644 --- a/libvo/osd_template.c +++ b/libvo/osd_template.c @@ -7,7 +7,7 @@ #undef PREFETCHW #undef PAVGB -#if HAVE_3DNOW +#if HAVE_AMD3DNOW #define PREFETCH "prefetch" #define PREFETCHW "prefetchw" #define PAVGB "pavgusb" @@ -20,7 +20,7 @@ #define PREFETCHW " # nop" #endif -#if HAVE_3DNOW +#if HAVE_AMD3DNOW /* On K6 femms is faster of emms. On K7 femms is directly mapped on emms. */ #define EMMS "femms" #else @@ -307,12 +307,12 @@ static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src, dstbase++; #endif #if HAVE_MMX -#if HAVE_3DNOW +#if HAVE_AMD3DNOW __asm__ volatile( "pxor %%mm7, %%mm7\n\t" "pcmpeqb %%mm6, %%mm6\n\t" // F..F ::); -#else /* HAVE_3DNOW */ +#else /* HAVE_AMD3DNOW */ __asm__ volatile( "pxor %%mm7, %%mm7\n\t" "pcmpeqb %%mm5, %%mm5\n\t" // F..F @@ -320,13 +320,13 @@ static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src, "psllw $8, %%mm5\n\t" //FF00FF00FF00 "psrlw $8, %%mm4\n\t" //00FF00FF00FF ::); -#endif /* HAVE_3DNOW */ +#endif /* HAVE_AMD3DNOW */ #endif /* HAVE_MMX */ for(y=0;y Date: Mon, 26 Jan 2009 09:40:04 +0000 Subject: HAVE_LRINTF is now always defined to either 0 or 1, not defined/undefined. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28371 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libfaad2/common.h | 6 +++--- libfaad2/local_changes.diff | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libfaad2/common.h b/libfaad2/common.h index 6fb5a12b08..29a30d089e 100644 --- a/libfaad2/common.h +++ b/libfaad2/common.h @@ -305,7 +305,7 @@ char *strchr(), *strrchr(); } - #if defined(_WIN32) && !defined(__MINGW32__) && !defined(HAVE_LRINTF) + #if defined(_WIN32) && !defined(__MINGW32__) && !HAVE_LRINTF #define HAS_LRINTF static INLINE int lrintf(float f) { @@ -317,7 +317,7 @@ char *strchr(), *strrchr(); } return i; } - #elif (defined(__i386__) && defined(__GNUC__)) && !defined(HAVE_LRINTF) + #elif (defined(__i386__) && defined(__GNUC__)) && !HAVE_LRINTF #define HAS_LRINTF // from http://www.stereopsis.com/FPU.html static INLINE int lrintf(float f) @@ -348,7 +348,7 @@ char *strchr(), *strrchr(); #include -#ifdef HAVE_LRINTF +#if HAVE_LRINTF # define HAS_LRINTF # define _ISOC9X_SOURCE 1 # define _ISOC99_SOURCE 1 diff --git a/libfaad2/local_changes.diff b/libfaad2/local_changes.diff index d7b1a7b081..a6400eb0b8 100644 --- a/libfaad2/local_changes.diff +++ b/libfaad2/local_changes.diff @@ -89,7 +89,7 @@ - #if defined(_WIN32) && !defined(__MINGW32__) -+ #if defined(_WIN32) && !defined(__MINGW32__) && !defined(HAVE_LRINTF) ++ #if defined(_WIN32) && !defined(__MINGW32__) && !HAVE_LRINTF #define HAS_LRINTF static INLINE int lrintf(float f) { @@ -98,17 +98,18 @@ return i; } - #elif (defined(__i386__) && defined(__GNUC__)) -+ #elif (defined(__i386__) && defined(__GNUC__)) && !defined(HAVE_LRINTF) ++ #elif (defined(__i386__) && defined(__GNUC__)) && !HAVE_LRINTF #define HAS_LRINTF // from http://www.stereopsis.com/FPU.html static INLINE int lrintf(float f) -@@ -330,6 +360,8 @@ +@@ -330,7 +360,7 @@ #else +#include + - #ifdef HAVE_LRINTF +-#ifdef HAVE_LRINTF +-#if HAVE_LRINTF # define HAS_LRINTF # define _ISOC9X_SOURCE 1 @@ -338,8 +370,6 @@ -- cgit v1.2.3 From 65ea2d93f8dfe29facf88c4e00ffe995ac0ec8c3 Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 26 Jan 2009 09:54:14 +0000 Subject: Drop HAVE_LRINTF check, lrintf is used without checking in other places. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28372 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af_format.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libaf/af_format.c b/libaf/af_format.c index 5e53c1ae99..264198f4f1 100644 --- a/libaf/af_format.c +++ b/libaf/af_format.c @@ -25,16 +25,9 @@ #include #include #include - -#include "config.h" -// Integer to float conversion through lrintf() -#if HAVE_LRINTF #include -long int lrintf(float); -#else -#define lrintf(x) ((int)(x)) -#endif +#include "config.h" #include "af.h" #include "mpbswap.h" #include "libvo/fastmemcpy.h" -- cgit v1.2.3 From e1c20a72f0fcaf36a04a6e3f674d1e2be016cc9e Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 26 Jan 2009 09:55:59 +0000 Subject: some more HAVE_3DNOW --> HAVE_AMD3DNOW git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28373 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mp3lib/sr1.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mp3lib/sr1.c b/mp3lib/sr1.c index 6606ed3429..aadb22c388 100644 --- a/mp3lib/sr1.c +++ b/mp3lib/sr1.c @@ -33,10 +33,10 @@ #if ARCH_X86_64 // 3DNow! and 3DNow!Ext routines don't compile under AMD64 -#undef HAVE_3DNOW -#undef HAVE_3DNOWEXT -#define HAVE_3DNOW 0 -#define HAVE_3DNOWEXT 0 +#undef HAVE_AMD3DNOW +#undef HAVE_AMD3DNOWEXT +#define HAVE_AMD3DNOW 0 +#define HAVE_AMD3DNOWEXT 0 #endif //static FILE* mp3_file=NULL; @@ -427,7 +427,7 @@ void MP3_Init(void){ } #endif -#if HAVE_3DNOWEXT +#if HAVE_AMD3DNOWEXT if (gCpuCaps.has3DNowExt) { dct36_func=dct36_3dnowex; @@ -436,7 +436,7 @@ void MP3_Init(void){ } else #endif -#if HAVE_3DNOW +#if HAVE_AMD3DNOW if (gCpuCaps.has3DNow) { dct36_func = dct36_3dnow; -- cgit v1.2.3 From 0c3d542dc75343725f23a855ee9f59f3aa1dcc74 Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 26 Jan 2009 09:56:27 +0000 Subject: WORDS_BIGENDIAN is defined/undefined, not 0/1. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28374 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af_format.c | 4 ++-- libaf/af_format.h | 2 +- libmpdemux/demux_xmms.c | 2 +- libmpdemux/demuxer.h | 2 +- mp3lib/decod386.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libaf/af_format.c b/libaf/af_format.c index 264198f4f1..df4dac2841 100644 --- a/libaf/af_format.c +++ b/libaf/af_format.c @@ -332,7 +332,7 @@ af_info_t af_info_format = { }; static inline uint32_t load24bit(void* data, int pos) { -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN return (((uint32_t)((uint8_t*)data)[3*pos])<<24) | (((uint32_t)((uint8_t*)data)[3*pos+1])<<16) | (((uint32_t)((uint8_t*)data)[3*pos+2])<<8); @@ -344,7 +344,7 @@ static inline uint32_t load24bit(void* data, int pos) { } static inline void store24bit(void* data, int pos, uint32_t expanded_value) { -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN ((uint8_t*)data)[3*pos]=expanded_value>>24; ((uint8_t*)data)[3*pos+1]=expanded_value>>16; ((uint8_t*)data)[3*pos+2]=expanded_value>>8; diff --git a/libaf/af_format.h b/libaf/af_format.h index 49a25374ae..553d18d962 100644 --- a/libaf/af_format.h +++ b/libaf/af_format.h @@ -30,7 +30,7 @@ #define AF_FORMAT_LE (1<<0) // Little Endian #define AF_FORMAT_END_MASK (1<<0) -#if WORDS_BIGENDIAN // Native endian of cpu +#ifdef WORDS_BIGENDIAN // Native endian of cpu #define AF_FORMAT_NE AF_FORMAT_BE #else #define AF_FORMAT_NE AF_FORMAT_LE diff --git a/libmpdemux/demux_xmms.c b/libmpdemux/demux_xmms.c index b7b2e72d66..9263621a0b 100644 --- a/libmpdemux/demux_xmms.c +++ b/libmpdemux/demux_xmms.c @@ -101,7 +101,7 @@ static int disk_open(AFormat fmt, int rate, int nch) { xmms_afmt=AF_FORMAT_U16_LE; break; case FMT_U16_NE: -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN xmms_afmt=AF_FORMAT_U16_BE; #else xmms_afmt=AF_FORMAT_U16_LE; diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h index 6d986fcffd..d794533dad 100644 --- a/libmpdemux/demuxer.h +++ b/libmpdemux/demuxer.h @@ -367,7 +367,7 @@ stream_t* new_ds_stream(demux_stream_t *ds); static inline int avi_stream_id(unsigned int id){ unsigned char *p=(unsigned char *)&id; unsigned char a,b; -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN a=p[3]-'0'; b=p[2]-'0'; #else a=p[0]-'0'; b=p[1]-'0'; diff --git a/mp3lib/decod386.c b/mp3lib/decod386.c index 50485cdc20..841cf6981d 100644 --- a/mp3lib/decod386.c +++ b/mp3lib/decod386.c @@ -54,7 +54,7 @@ * layouts of double floating point values an all cpu architectures. If * it doesn't work for you, just enable the "old WRITE_SAMPLE" macro. */ -#if WORDS_BIGENDIAN +#ifdef WORDS_BIGENDIAN #define MANTISSA_OFFSET 1 #else #define MANTISSA_OFFSET 0 -- cgit v1.2.3 From 4d72948eb6505eaab4a3afa668c873276bbad41b Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 26 Jan 2009 11:24:05 +0000 Subject: Replace a bunch of '#if HAVE_FOO' preprocessor checks by 'if (HAVE_FOO)'. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28375 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mpcommon.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/mpcommon.c b/mpcommon.c index 3d87f11c95..1165fc45ee 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -45,30 +45,22 @@ void print_version(const char* name) mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithRuntimeDetection); #else mp_msg(MSGT_CPLAYER,MSGL_V, MSGTR_CompiledWithCPUExtensions); -#if HAVE_MMX +if (HAVE_MMX) mp_msg(MSGT_CPLAYER,MSGL_V," MMX"); -#endif -#if HAVE_MMX2 +if (HAVE_MMX2) mp_msg(MSGT_CPLAYER,MSGL_V," MMX2"); -#endif -#if HAVE_AMD3DNOW +if (HAVE_AMD3DNOW) mp_msg(MSGT_CPLAYER,MSGL_V," 3DNow"); -#endif -#if HAVE_AMD3DNOWEXT +if (HAVE_AMD3DNOWEXT) mp_msg(MSGT_CPLAYER,MSGL_V," 3DNowExt"); -#endif -#if HAVE_SSE +if (HAVE_SSE) mp_msg(MSGT_CPLAYER,MSGL_V," SSE"); -#endif -#if HAVE_SSE2 +if (HAVE_SSE2) mp_msg(MSGT_CPLAYER,MSGL_V," SSE2"); -#endif -#if HAVE_SSSE3 +if (HAVE_SSSE3) mp_msg(MSGT_CPLAYER,MSGL_V," SSSE3"); -#endif -#if HAVE_CMOV +if (HAVE_CMOV) mp_msg(MSGT_CPLAYER,MSGL_V," CMOV"); -#endif mp_msg(MSGT_CPLAYER,MSGL_V,"\n"); #endif /* RUNTIME_CPUDETECT */ #endif /* ARCH_X86 */ -- cgit v1.2.3 From 91c6bb02412a1c3aeb0467a65e21ac0e2d3fee8d Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 26 Jan 2009 11:29:28 +0000 Subject: Do not duplicate VERSION string. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28376 b3059339-0415-0410-9bf9-f77b7e298cf2 --- version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sh b/version.sh index 34c65a34ed..37bdb79097 100755 --- a/version.sh +++ b/version.sh @@ -9,7 +9,7 @@ test $svn_revision || svn_revision=UNKNOWN NEW_REVISION="#define VERSION \"SVN-r${svn_revision}${extra}\"" OLD_REVISION=`cat version.h 2> /dev/null` -TITLE="#define MP_TITLE \"%s SVN-r${svn_revision}${extra} (C) 2000-2009 MPlayer Team\\\n\"" +TITLE="#define MP_TITLE \"%s \"VERSION\" (C) 2000-2009 MPlayer Team\\\n\"" # Update version.h only on revision changes to avoid spurious rebuilds if test "$NEW_REVISION" != "$OLD_REVISION"; then -- cgit v1.2.3 From 5afe13e12a7c559cc032eaf483d83c4e36718fe5 Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 26 Jan 2009 14:36:31 +0000 Subject: Replace another bunch of '#if HAVE_FOO' preprocessor checks by 'if (HAVE_FOO)'. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28377 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cpudetect.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/cpudetect.c b/cpudetect.c index 14540842be..30af3ab09b 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -558,48 +558,37 @@ void GetCpuCaps( CpuCaps *caps) mp_msg(MSGT_CPUDETECT,MSGL_INFO,"AltiVec %sfound\n", (caps->hasAltiVec ? "" : "not ")); #endif /* HAVE_ALTIVEC */ -#if ARCH_IA64 +if (ARCH_IA64) mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Intel Itanium\n"); -#endif -#if ARCH_SPARC +if (ARCH_SPARC) mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Sun Sparc\n"); -#endif -#if ARCH_ARM +if (ARCH_ARM) mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: ARM\n"); -#endif -#if ARCH_PPC +if (ARCH_PPC) mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: PowerPC\n"); -#endif -#if ARCH_ALPHA +if (ARCH_ALPHA) mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Digital Alpha\n"); -#endif -#if ARCH_SGI_MIPS +if (ARCH_SGI_MIPS) mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: SGI MIPS\n"); -#endif -#if ARCH_PA_RISC +if (ARCH_PA_RISC) mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Hewlett-Packard PA-RISC\n"); -#endif -#if ARCH_S390 +if (ARCH_S390) mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: IBM S/390\n"); -#endif -#if ARCH_S390X +if (ARCH_S390X) mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: IBM S/390X\n"); -#endif -#if ARCH_VAX +if (ARCH_VAX) mp_msg(MSGT_CPUDETECT,MSGL_INFO, "CPU: Digital VAX\n" ); -#endif -#if ARCH_XTENSA +if (ARCH_XTENSA) mp_msg(MSGT_CPUDETECT,MSGL_INFO, "CPU: Tensilica Xtensa\n" ); -#endif } #endif /* !ARCH_X86 */ -- cgit v1.2.3 From c1cd81818a068386943775089f893e8cf848c7ea Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 26 Jan 2009 15:06:44 +0000 Subject: Add standard license headers. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28378 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_alsa.c | 38 ++++++++++++++++++++++++++------------ libao2/ao_alsa5.c | 26 ++++++++++++++++++++------ libao2/ao_dxr2.c | 20 ++++++++++++++++++++ libao2/ao_mpegpes.c | 20 ++++++++++++++++++++ libao2/ao_nas.c | 31 +++++++++++++++++++++++++------ libao2/ao_null.c | 20 ++++++++++++++++++++ libao2/ao_oss.c | 20 ++++++++++++++++++++ libao2/ao_pcm.c | 20 ++++++++++++++++++++ libao2/ao_sgi.c | 25 ++++++++++++++++++++----- libao2/ao_sun.c | 20 ++++++++++++++++++++ libao2/audio_out.c | 18 ++++++++++++++++++ libao2/audio_out.h | 18 ++++++++++++++++++ libao2/audio_out_internal.h | 18 ++++++++++++++++++ 13 files changed, 265 insertions(+), 29 deletions(-) diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index f7eeb7ddd9..8e32b7fb49 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -1,16 +1,30 @@ /* - ao_alsa9/1.x - ALSA-0.9.x-1.x output plugin for MPlayer - - (C) Alex Beregszaszi - - modified for real alsa-0.9.0-support by Zsolt Barat - additional AC3 passthrough support by Andy Lo A Foe - 08/22/2002 iec958-init rewritten and merged with common init, zsolt - 04/13/2004 merged with ao_alsa1.x, fixes provided by Jindrich Makovicka - 04/25/2004 printfs converted to mp_msg, Zsolt. - - Any bugreports regarding to this driver are welcome. -*/ + * ALSA 0.9.x-1.x audio output driver + * + * Copyright (C) 2004 Alex Beregszaszi + * + * modified for real ALSA 0.9.0 support by Zsolt Barat + * additional AC-3 passthrough support by Andy Lo A Foe + * 08/22/2002 iec958-init rewritten and merged with common init, zsolt + * 04/13/2004 merged with ao_alsa1.x, fixes provided by Jindrich Makovicka + * 04/25/2004 printfs converted to mp_msg, Zsolt. + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #include #include diff --git a/libao2/ao_alsa5.c b/libao2/ao_alsa5.c index 7bec0371e6..abf2eff827 100644 --- a/libao2/ao_alsa5.c +++ b/libao2/ao_alsa5.c @@ -1,10 +1,24 @@ /* - ao_alsa5 - ALSA-0.5.x output plugin for MPlayer - - (C) Alex Beregszaszi - - Thanks to Arpi for helping me ;) -*/ + * ALSA 0.5.x audio output driver + * + * Copyright (C) 2001 Alex Beregszaszi + * + * Thanks to Arpi for helping me ;) + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #include #include diff --git a/libao2/ao_dxr2.c b/libao2/ao_dxr2.c index b58323613d..cd92ea325c 100644 --- a/libao2/ao_dxr2.c +++ b/libao2/ao_dxr2.c @@ -1,3 +1,23 @@ +/* + * DXR2 audio output driver + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #include #include diff --git a/libao2/ao_mpegpes.c b/libao2/ao_mpegpes.c index 14918d467e..38f30b1c16 100644 --- a/libao2/ao_mpegpes.c +++ b/libao2/ao_mpegpes.c @@ -1,3 +1,23 @@ +/* + * MPEG-PES audio output driver + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #include #include diff --git a/libao2/ao_nas.c b/libao2/ao_nas.c index 92ca56a35f..9394649cc0 100644 --- a/libao2/ao_nas.c +++ b/libao2/ao_nas.c @@ -1,15 +1,34 @@ /* - * NAS output plugin for mplayer + * NAS audio output driver * - * based on the libaudiooss parts rewritten by me, which were - * originally based on the NAS output plugin for xmms. + * copyright (c) 2001 Tobias Diedrich * - * xmms plugin by Willem Monsuwe + * Based on the libaudiooss parts rewritten by me, which were + * originally based on the NAS output plugin for XMMS. + * + * XMMS plugin by Willem Monsuwe * adapted for libaudiooss by Jon Trulson * further modified by Erik Inge Bolsø - * largely rewritten and used for this - * plugin by Tobias Diedrich + * largely rewritten and used for this ao driver by Tobias Diedrich + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* * Theory of operation: * * The NAS consists of two parts, a server daemon and a client. diff --git a/libao2/ao_null.c b/libao2/ao_null.c index fc81af6588..2e28b8f1e8 100644 --- a/libao2/ao_null.c +++ b/libao2/ao_null.c @@ -1,3 +1,23 @@ +/* + * null audio output driver + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #include #include diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c index ed70152077..44f0c7d857 100644 --- a/libao2/ao_oss.c +++ b/libao2/ao_oss.c @@ -1,3 +1,23 @@ +/* + * OSS audio output driver + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #include diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c index ad0e0626b1..bd66ed0dab 100644 --- a/libao2/ao_pcm.c +++ b/libao2/ao_pcm.c @@ -1,3 +1,23 @@ +/* + * PCM audio output driver + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include "config.h" #include diff --git a/libao2/ao_sgi.c b/libao2/ao_sgi.c index 1ca52ee8e4..db7c486c83 100644 --- a/libao2/ao_sgi.c +++ b/libao2/ao_sgi.c @@ -1,9 +1,24 @@ /* - ao_sgi - sgi/irix output plugin for MPlayer - - 22oct2001 oliver.schoenbrunner@jku.at - -*/ + * SGI/IRIX audio output driver + * + * copyright (c) 2001 oliver.schoenbrunner@jku.at + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #include #include diff --git a/libao2/ao_sun.c b/libao2/ao_sun.c index 55691705bd..ebe17c7926 100644 --- a/libao2/ao_sun.c +++ b/libao2/ao_sun.c @@ -1,3 +1,23 @@ +/* + * SUN audio output driver + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #include #include diff --git a/libao2/audio_out.c b/libao2/audio_out.c index 38fad281be..7fc9fdb6b4 100644 --- a/libao2/audio_out.c +++ b/libao2/audio_out.c @@ -1,3 +1,21 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #include #include diff --git a/libao2/audio_out.h b/libao2/audio_out.h index 5fad397313..3312ab0aa7 100644 --- a/libao2/audio_out.h +++ b/libao2/audio_out.h @@ -1,3 +1,21 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #ifndef MPLAYER_AUDIO_OUT_H #define MPLAYER_AUDIO_OUT_H diff --git a/libao2/audio_out_internal.h b/libao2/audio_out_internal.h index b0385411b1..e702430cc5 100644 --- a/libao2/audio_out_internal.h +++ b/libao2/audio_out_internal.h @@ -1,3 +1,21 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #ifndef MPLAYER_AUDIO_OUT_INTERNAL_H #define MPLAYER_AUDIO_OUT_INTERNAL_H -- cgit v1.2.3 From 7fcf438a2f3b169dac45f609571275336ce958f5 Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 27 Jan 2009 10:02:47 +0000 Subject: Allocate a larger backbuffer to allow resizing without reinit. Patch by Georgi Petrov [gogothebee gmail com] and Jim Hauxwell [james (at) dattrax co uk] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28379 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_direct3d.c | 156 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 113 insertions(+), 43 deletions(-) diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c index 83ddedeeea..e212b966fd 100644 --- a/libvo/vo_direct3d.c +++ b/libvo/vo_direct3d.c @@ -78,6 +78,8 @@ static struct global_priv { cannot lock a normal texture. Uses RGBA */ IDirect3DSurface9 *d3d_backbuf; /**< Video card's back buffer (used to display next frame) */ + int cur_backbuf_width; /**< Current backbuffer width */ + int cur_backbuf_height; /**< Current backbuffer height */ int is_osd_populated; /**< 1 = OSD texture has something to display, 0 = OSD texture is clear */ int device_caps_power2_only; /**< 1 = texture sizes have to be power 2 @@ -126,6 +128,10 @@ typedef struct { float tu, tv; /* Texture coordinates */ } struct_vertex; +typedef enum back_buffer_action { + BACKBUFFER_CREATE, + BACKBUFFER_RESET +} back_buffer_action_e; /**************************************************************************** * * * * @@ -224,7 +230,8 @@ static void destroy_d3d_surfaces(void) priv->d3d_backbuf = NULL; } -/** @brief Create D3D Offscreen and Backbuffer surfaces. +/** @brief Create D3D Offscreen and Backbuffer surfaces. Each + * surface is created only if it's not already present. * @return 1 on success, 0 on failure */ static int create_d3d_surfaces(void) @@ -233,7 +240,8 @@ static int create_d3d_surfaces(void) int tex_width = osd_width, tex_height = osd_height; mp_msg(MSGT_VO, MSGL_V, "create_d3d_surfaces called.\n"); - if (FAILED(IDirect3DDevice9_CreateOffscreenPlainSurface( + if (!priv->d3d_surface && + FAILED(IDirect3DDevice9_CreateOffscreenPlainSurface( priv->d3d_device, priv->src_width, priv->src_height, priv->movie_src_fmt, D3DPOOL_DEFAULT, &priv->d3d_surface, NULL))) { mp_msg(MSGT_VO, MSGL_ERR, @@ -241,7 +249,8 @@ static int create_d3d_surfaces(void) return 0; } - if (FAILED(IDirect3DDevice9_GetBackBuffer(priv->d3d_device, 0, 0, + if (!priv->d3d_backbuf && + FAILED(IDirect3DDevice9_GetBackBuffer(priv->d3d_device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &priv->d3d_backbuf))) { mp_msg(MSGT_VO, MSGL_ERR, "Back Buffer address get failed\n"); @@ -279,7 +288,8 @@ static int create_d3d_surfaces(void) vo_dwidth, vo_dheight, priv->osd_texture_width, priv->osd_texture_height); /* create OSD */ - if (FAILED(IDirect3DDevice9_CreateTexture(priv->d3d_device, + if (!priv->d3d_texture_system && + FAILED(IDirect3DDevice9_CreateTexture(priv->d3d_device, priv->osd_texture_width, priv->osd_texture_height, 1, @@ -295,7 +305,8 @@ static int create_d3d_surfaces(void) if (!priv->device_texture_sys) { /* only create if we need a shadow version on the external device */ - if (FAILED(IDirect3DDevice9_CreateTexture(priv->d3d_device, + if (!priv->d3d_texture_osd && + FAILED(IDirect3DDevice9_CreateTexture(priv->d3d_device, priv->osd_texture_width, priv->osd_texture_height, 1, @@ -332,27 +343,78 @@ static void fill_d3d_presentparams(D3DPRESENT_PARAMETERS *present_params) present_params->SwapEffect = D3DSWAPEFFECT_COPY; present_params->Flags = D3DPRESENTFLAG_VIDEO; present_params->hDeviceWindow = vo_w32_window; /* w32_common var */ - present_params->BackBufferWidth = 0; /* Fill up window Width */ - present_params->BackBufferHeight = 0; /* Fill up window Height */ + present_params->BackBufferWidth = priv->cur_backbuf_width; + present_params->BackBufferHeight = priv->cur_backbuf_height; present_params->MultiSampleType = D3DMULTISAMPLE_NONE; - /* D3DPRESENT_INTERVAL_ONE = vsync */ present_params->PresentationInterval = D3DPRESENT_INTERVAL_ONE; present_params->BackBufferFormat = priv->desktop_fmt; present_params->BackBufferCount = 1; present_params->EnableAutoDepthStencil = FALSE; } + +/** @brief Create a new backbuffer. Create or Reset the D3D + * device. + * @return 1 on success, 0 on failure + */ +static int change_d3d_backbuffer(back_buffer_action_e action) +{ + D3DPRESENT_PARAMETERS present_params; + + destroy_d3d_surfaces(); + + /* Grow the backbuffer in the required dimension. */ + if (vo_dwidth > priv->cur_backbuf_width) + priv->cur_backbuf_width = vo_dwidth; + + if (vo_dheight > priv->cur_backbuf_height) + priv->cur_backbuf_height = vo_dheight; + + /* The grown backbuffer dimensions are ready and fill_d3d_presentparams + * will use them, so we can reset the device. + */ + fill_d3d_presentparams(&present_params); + + /* vo_w32_window is w32_common variable. It's a handle to the window. */ + if (action == BACKBUFFER_CREATE && + FAILED(IDirect3D9_CreateDevice(priv->d3d_handle, + D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, vo_w32_window, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, + &present_params, &priv->d3d_device))) { + mp_msg(MSGT_VO, MSGL_ERR, + "Could not create the D3D device\n"); + return 0; + } + + if (action == BACKBUFFER_RESET && + FAILED(IDirect3DDevice9_Reset(priv->d3d_device, &present_params))) { + mp_msg(MSGT_VO, MSGL_ERR, + "Could not reset the D3D device\n"); + return 0; + } + + mp_msg(MSGT_VO, MSGL_V, + "New backbuffer: Width: %d, Height:%d. VO Dest Width:%d, Height: %d\n", + present_params.BackBufferWidth, present_params.BackBufferHeight, + vo_dwidth, vo_dheight); + + return 1; +} + /** @brief Configure initial Direct3D context. The first * function called to initialize the D3D context. * @return 1 on success, 0 on failure */ static int configure_d3d(void) { - D3DPRESENT_PARAMETERS present_params; D3DDISPLAYMODE disp_mode; + D3DVIEWPORT9 vp = {0, 0, vo_dwidth, vo_dheight, 0, 1}; mp_msg(MSGT_VO, MSGL_V, "configure_d3d called\n"); + destroy_d3d_surfaces(); + /* Get the current desktop display mode, so we can set up a back buffer * of the same format. */ if (FAILED(IDirect3D9_GetAdapterDisplayMode(priv->d3d_handle, @@ -366,26 +428,17 @@ static int configure_d3d(void) /* Write current Desktop's colorspace format in the global storage. */ priv->desktop_fmt = disp_mode.Format; - fill_d3d_presentparams(&present_params); - - /* vo_w32_window is w32_common variable. It's a handle to the window. */ - if (FAILED(IDirect3D9_CreateDevice(priv->d3d_handle, - D3DADAPTER_DEFAULT, - D3DDEVTYPE_HAL, vo_w32_window, - D3DCREATE_SOFTWARE_VERTEXPROCESSING, - &present_params, &priv->d3d_device))) { - mp_msg(MSGT_VO, MSGL_ERR, - "Could not create the D3D device\n"); + if (!change_d3d_backbuffer(BACKBUFFER_CREATE)) return 0; - } if (!create_d3d_surfaces()) return 0; - mp_msg(MSGT_VO, MSGL_V, - "New BackBuffer: Width: %d, Height:%d. VO Dest Width:%d, Height: %d\n", - present_params.BackBufferWidth, present_params.BackBufferHeight, - vo_dwidth, vo_dheight); + if (FAILED(IDirect3DDevice9_SetViewport(priv->d3d_device, + &vp))) { + mp_msg(MSGT_VO, MSGL_ERR, "Unable to set the viewport\n"); + return VO_ERROR; + } calc_fs_rect(); @@ -400,7 +453,7 @@ static int reconfigure_d3d(void) { mp_msg(MSGT_VO, MSGL_V, "reconfigure_d3d called.\n"); - /* Destroy the Offscreen and Backbuffer surfaces */ + /* Destroy the offscreen, OSD and backbuffer surfaces */ destroy_d3d_surfaces(); /* Destroy the D3D Device */ @@ -425,35 +478,49 @@ static int reconfigure_d3d(void) return 1; } - /** @brief Resize Direct3D context on window resize. * @return 1 on success, 0 on failure */ static int resize_d3d(void) { - D3DPRESENT_PARAMETERS present_params; + D3DVIEWPORT9 vp = {0, 0, vo_dwidth, vo_dheight, 0, 1}; mp_msg(MSGT_VO, MSGL_V, "resize_d3d called.\n"); - destroy_d3d_surfaces(); + /* Make sure that backbuffer is large enough to accomodate the new + viewport dimensions. Grow it if necessary. */ - /* Reset the D3D Device with all parameters the same except the new - * width/heigh