1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-20 22:02:59 +00:00

Merge svn changes up to r28403

This commit is contained in:
Uoti Urpala 2009-01-31 04:52:15 +02:00
commit ccf4d9e96c
53 changed files with 579 additions and 299 deletions

View File

@ -389,10 +389,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
@ -842,8 +842,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
@ -1032,13 +1032,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)

View File

@ -2492,6 +2492,8 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
break;
case MP_CMD_SWITCH_RATIO:
if (!sh_video)
break;
if (cmd->nargs == 0 || cmd->args[0].v.f == -1)
opts->movie_aspect = (float) sh_video->disp_w / sh_video->disp_h;
else
@ -2996,6 +2998,8 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
break;
case MP_CMD_VF_CHANGE_RECTANGLE:
if (!sh_video)
break;
set_rectangle(sh_video, cmd->args[0].v.i, cmd->args[1].v.i);
break;

19
configure vendored
View File

@ -2617,12 +2617,12 @@ EOF
echores "$_iwmmxt"
fi
_cpuexts_all='ALTIVEC BSWAP MMX MMX2 3DNOW 3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP IWMMXT MMI VIS MVI'
_cpuexts_all='ALTIVEC BSWAP 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"
@ -4245,7 +4245,7 @@ if test "$_xvmc" = yes ; then
_vomodules="xvmc $_vomodules"
_res_comment="using $_xvmclib"
else
_def_xvmc='#undef CONFIG_XVMC'
_def_xvmc='#define CONFIG_XVMC 0'
_novomodules="xvmc $_novomodules"
_libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
fi
@ -5632,7 +5632,7 @@ if test "$_dvdread_internal" = auto ; then
if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
&& (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
|| darwin || win32; then
|| darwin || win32 || os2; then
_dvdread_internal=yes
_dvdread=yes
_inc_extra="$_inc_extra -Ilibdvdread4"
@ -7898,6 +7898,7 @@ if test "$cc_vendor" = "gnu" ; then
cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
else
CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
fi
@ -8169,6 +8170,7 @@ CONFIG_FFT=yes
CONFIG_FFT_MMX=$fft_mmx
CONFIG_GOLOMB=yes
CONFIG_MDCT=yes
CONFIG_RDFT=yes
CONFIG_ENCODERS=yes
CONFIG_GPL=yes
@ -8270,6 +8272,11 @@ $_def_fast_inttypes
/* libfaad2 + libdvdread */
#define STDC_HEADERS 1
#define HAVE_MEMCPY 1
/* libfaad2 */
#define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
/* libdvdread */
#define HAVE_UINTPTR_T 1
@ -8599,6 +8606,7 @@ $_def_yasm
#define CONFIG_GPL 1
#define CONFIG_SMALL 0
#define CONFIG_SWSCALE 1
#define CONFIG_GRAY 0
/* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
@ -8606,6 +8614,7 @@ $_def_yasm
#define CONFIG_FFT 1
#define CONFIG_GOLOMB 1
#define CONFIG_MDCT 1
#define CONFIG_RDFT 1
/* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
#define HAVE_EBX_AVAILABLE 1

View File

@ -18,27 +18,17 @@ CpuCaps gCpuCaps;
#include <sys/param.h>
#include <sys/sysctl.h>
#include <machine/cpu.h>
#endif
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__APPLE__)
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__APPLE__)
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
#ifdef __linux__
#elif defined(__linux__)
#include <signal.h>
#endif
#if defined(__MINGW32__) || defined(__CYGWIN__)
#elif defined(__MINGW32__) || defined(__CYGWIN__)
#include <windows.h>
#endif
#ifdef __OS2__
#elif defined(__OS2__)
#define INCL_DOS
#include <os2.h>
#endif
#ifdef __AMIGAOS4__
#elif defined(__AMIGAOS4__)
#include <proto/exec.h>
#endif
@ -228,11 +218,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
@ -475,7 +465,7 @@ static void check_os_katmai_support( void )
#ifdef __APPLE__
#include <sys/sysctl.h>
#elif __AMIGAOS4__
#elif defined(__AMIGAOS4__)
/* nothing */
#else
#include <signal.h>
@ -529,7 +519,7 @@ void GetCpuCaps( CpuCaps *caps)
if (has_vu != 0)
caps->hasAltiVec = 1;
}
#elif __AMIGAOS4__
#elif defined(__AMIGAOS4__)
ULONG result = 0;
GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE);
@ -558,48 +548,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 */

View File

@ -1984,6 +1984,7 @@ videocodec ffduck
info "Duck Truemotion1"
status working
fourcc DUCK
fourcc PVEZ
driver ffmpeg
dll "truemotion1"
out BGR15,BGR16,BGR24,BGR32 query

View File

@ -18,12 +18,12 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#elif __MINGW32__
#elif defined(__MINGW32__)
#include <windows.h>
#elif __CYGWIN__
#elif defined(__CYGWIN__)
#include <windows.h>
#include <sys/cygwin.h>
#elif __OS2__
#elif defined(__OS2__)
#define INCL_DOS
#include <os2.h>
#endif

View File

@ -20,11 +20,10 @@
#include <lirc/lirc_client.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <stdlib.h>
#include "mp_msg.h"
@ -39,6 +38,7 @@ static char* cmd_buf = NULL;
int
mp_input_lirc_init(void) {
int lirc_sock;
int mode;
mp_msg(MSGT_LIRC,MSGL_V,MSGTR_SettingUpLIRC);
if((lirc_sock=lirc_init("mplayer",1))==-1){
@ -46,6 +46,14 @@ mp_input_lirc_init(void) {
return -1;
}
mode = fcntl(lirc_sock, F_GETFL);
if (mode < 0 || fcntl(lirc_sock, F_SETFL, mode | O_NONBLOCK) < 0) {
mp_msg(MSGT_LIRC, MSGL_ERR, "setting non-blocking mode failed: %s\n",
strerror(errno));
lirc_deinit();
return -1;
}
if(lirc_readconfig( lirc_configfile,&lirc_config,NULL )!=0 ){
mp_msg(MSGT_LIRC,MSGL_ERR,MSGTR_LIRCcfgerr,
lirc_configfile == NULL ? "~/.lircrc" : lirc_configfile);
@ -57,8 +65,6 @@ mp_input_lirc_init(void) {
}
int mp_input_lirc_read(int fd,char* dest, int s) {
fd_set fds;
struct timeval tv;
int r,cl = 0;
char *code = NULL,*c = NULL;
@ -77,22 +83,8 @@ int mp_input_lirc_read(int fd,char* dest, int s) {
}
// Nothing in the buffer, poll the lirc fd
FD_ZERO(&fds);
FD_SET(fd,&fds);
memset(&tv,0,sizeof(tv));
while((r = select(fd+1,&fds,NULL,NULL,&tv)) <= 0) {
if(r < 0) {
if(errno == EINTR)
continue;
mp_msg(MSGT_INPUT,MSGL_ERR,"Select error : %s\n",strerror(errno));
return MP_INPUT_ERROR;
} else
return MP_INPUT_NOTHING;
}
// There's something to read
if(lirc_nextcode(&code) != 0) {
mp_msg(MSGT_INPUT,MSGL_ERR,"Lirc error :(\n");
mp_msg(MSGT_LIRC,MSGL_ERR,"Lirc error :(\n");
return MP_INPUT_DEAD;
}

View File

@ -37,7 +37,7 @@
#define ALT_BITSTREAM_READER
/* used to avoid misaligned exceptions on some archs (alpha, ...) */
#if ARCH_X86 || defined(HAVE_ARMV6)
#if ARCH_X86 || HAVE_ARMV6
# define unaligned32(a) (*(uint32_t*)(a))
#else
# ifdef __GNUC__

View File

@ -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
@ -1287,7 +1287,7 @@ void a52_imdct_init (uint32_t mm_accel)
else
#endif
#if LIBA52_DJBFFT
#ifdef LIBA52_DJBFFT
if (mm_accel & MM_ACCEL_DJBFFT) {
fprintf (stderr, "Using djbfft for IMDCT transform\n");
ifft128 = (void (*) (complex_t *)) fftc4_un128;

View File

@ -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

View File

@ -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

View File

@ -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)\

View File

@ -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)

View File

@ -25,16 +25,9 @@
#include <string.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include "config.h"
// Integer to float conversion through lrintf()
#if HAVE_LRINTF
#include <math.h>
long int lrintf(float);
#else
#define lrintf(x) ((int)(x))
#endif
#include "af.h"
#include "mpbswap.h"
#include "libvo/fastmemcpy.h"
@ -339,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);
@ -351,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;

View File

@ -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

View File

@ -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 <joy@streamminister.de>
additional AC3 passthrough support by Andy Lo A Foe <andy@alsaplayer.org>
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 <joy@streamminister.de>
* additional AC-3 passthrough support by Andy Lo A Foe <andy@alsaplayer.org>
* 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 <errno.h>
#include <sys/time.h>
@ -30,9 +44,9 @@
#define ALSA_PCM_NEW_HW_PARAMS_API
#define ALSA_PCM_NEW_SW_PARAMS_API
#if HAVE_SYS_ASOUNDLIB_H
#ifdef HAVE_SYS_ASOUNDLIB_H
#include <sys/asoundlib.h>
#elif HAVE_ALSA_ASOUNDLIB_H
#elif defined(HAVE_ALSA_ASOUNDLIB_H)
#include <alsa/asoundlib.h>
#else
#error "asoundlib.h is not in sys/ or alsa/ - please bugreport"

View File

@ -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 <errno.h>
#include <sys/asoundlib.h>

View File

@ -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 <math.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -54,7 +54,8 @@
#include "help_mp.h"
#undef ESD_DEBUG
#define ESD_RESAMPLES 0
#define ESD_DEBUG 0
#if ESD_DEBUG
#define dprintf(...) printf(__VA_ARGS__)

View File

@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -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 <ranma@gmx.at>
*
* 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.

View File

@ -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 <stdio.h>
#include <stdlib.h>
#include <sys/time.h>

View File

@ -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 <stdio.h>
#include <stdlib.h>

View File

@ -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 <stdio.h>

View File

@ -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 <stdio.h>
#include <stdlib.h>

View File

@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -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

View File

@ -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

View File

@ -41,8 +41,8 @@
#include "ass_fontconfig.h"
#include "ass_library.h"
#define MAX_GLYPHS 1000
#define MAX_LINES 100
#define MAX_GLYPHS 3000
#define MAX_LINES 300
static int last_render_id = 0;

View File

@ -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 <math.h>
#ifdef HAVE_LRINTF
#if HAVE_LRINTF
# define HAS_LRINTF
# define _ISOC9X_SOURCE 1
# define _ISOC99_SOURCE 1

View File

@ -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 <math.h>
+
#ifdef HAVE_LRINTF
-#ifdef HAVE_LRINTF
-#if HAVE_LRINTF
# define HAS_LRINTF
# define _ISOC9X_SOURCE 1
@@ -338,8 +370,6 @@

View File

@ -136,6 +136,7 @@ static void fixup(audio_encoder_t *encoder)
// fixup CBR mp3 audio header:
if(!lame_param_vbr) {
encoder->stream->h.dwSampleSize=1;
if (encoder->stream->h.dwLength)
((MPEGLAYER3WAVEFORMAT*)(encoder->stream->wf))->nBlockSize=
(encoder->stream->size+(encoder->stream->h.dwLength>>1))/encoder->stream->h.dwLength;
encoder->stream->h.dwLength=encoder->stream->size;

View File

@ -246,8 +246,8 @@ m_option_t lavcopts_conf[]={
{"preme", &lavc_param_pre_me, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL},
{"subq", &lavc_param_me_subpel_quality, CONF_TYPE_INT, CONF_RANGE, 0, 8, NULL},
{"me_range", &lavc_param_me_range, CONF_TYPE_INT, CONF_RANGE, 0, 16000, NULL},
#ifdef CODEC_FLAG_H263P_AIC
{"aic", &lavc_param_aic, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC, NULL},
#ifdef CODEC_FLAG_AC_PRED
{"aic", &lavc_param_aic, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED, NULL},
{"umv", &lavc_param_umv, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV, NULL},
#endif
#ifdef CODEC_FLAG_H263P_AIV

View File

@ -431,7 +431,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;
@ -1424,7 +1424,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;

View File

@ -47,7 +47,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;
@ -487,7 +487,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;

View File

@ -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;

View File

@ -151,7 +151,7 @@ typedef struct demuxer_info {
#define MAX_A_STREAMS 256
#define MAX_V_STREAMS 256
#define MAX_S_STREAMS 32
#define MAX_S_STREAMS 256
struct demuxer;
@ -364,7 +364,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';

View File

@ -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)

View File

@ -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

View File

@ -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);

View File

@ -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"

View File

@ -24,7 +24,7 @@
#include <string.h>
#ifdef CONFIG_FASTMEMCPY
#if HAVE_MMX || HAVE_MMX2 || HAVE_3DNOW \
#if HAVE_MMX || HAVE_MMX2 || HAVE_AMD3DNOW \
/* || HAVE_SSE || HAVE_SSE2 */
#include <stddef.h>

View File

@ -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");

View File

@ -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<h;y++){
register int x;
#if ARCH_X86 && (!ARCH_X86_64 || HAVE_MMX)
#if HAVE_MMX
#if HAVE_3DNOW
#if HAVE_AMD3DNOW
__asm__ volatile(
PREFETCHW" %0\n\t"
PREFETCH" %1\n\t"

View File

@ -213,7 +213,7 @@ const struct vo_driver *video_out_drivers[] =
#endif
&video_out_null,
// should not be auto-selected
#ifdef CONFIG_XVMC
#if CONFIG_XVMC
&video_out_xvmc,
#endif
&video_out_mpegpes,

View File

@ -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, "<vo_direct3d><INFO>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, "<vo_direct3d>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,
"<vo_direct3d><INFO>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,
"<vo_direct3d><INFO>Could not reset the D3D device\n");
return 0;
}
mp_msg(MSGT_VO, MSGL_V,
"<vo_direct3d><INFO>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, "<vo_direct3d><INFO>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,
"<vo_direct3d><INFO>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, "<vo_direct3d>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, "<vo_direct3d><INFO>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, "<vo_direct3d><INFO>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/height.
*/
fill_d3d_presentparams(&present_params);
if (FAILED(IDirect3DDevice9_Reset(priv->d3d_device, &present_params))) {
mp_msg(MSGT_VO, MSGL_ERR,
"<vo_direct3d><INFO>Could not reset the D3D device\n");
return 0;
if (vo_dwidth > priv->cur_backbuf_width ||
vo_dheight > priv->cur_backbuf_height) {
change_d3d_backbuffer (BACKBUFFER_RESET);
}
/* Destroy the OSD textures. They should always match the new dimensions
* of the onscreen window, so on each resize we need new OSD dimensions.
*/
if (priv->d3d_texture_osd)
IDirect3DTexture9_Release(priv->d3d_texture_osd);
priv->d3d_texture_osd = NULL;
if (priv->d3d_texture_system)
IDirect3DTexture9_Release(priv->d3d_texture_system);
priv->d3d_texture_system = NULL;
/* Recreate the OSD. The function will observe that the offscreen plain
* surface and the backbuffer are not destroyed and will skip their creation,
* effectively recreating only the OSD.
*/
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, "<vo_direct3d>Unable to set the viewport\n");
return VO_ERROR;
}
calc_fs_rect();
@ -644,8 +711,10 @@ static int preinit(const char *arg)
/* Store in priv->desktop_fmt the user desktop's colorspace. Usually XRGB. */
priv->desktop_fmt = disp_mode.Format;
priv->cur_backbuf_width = disp_mode.Width;
priv->cur_backbuf_height = disp_mode.Height;
mp_msg(MSGT_VO, MSGL_V, "disp_mode.Width %d, disp_mode.Height %d\n",
mp_msg(MSGT_VO, MSGL_V, "Setting backbuffer to the screen width: %d, height: %d\n",
disp_mode.Width, disp_mode.Height);
if (FAILED(IDirect3D9_GetDeviceCaps(priv->d3d_handle,
@ -787,7 +856,8 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
*/
static void flip_page(void)
{
if (FAILED(IDirect3DDevice9_Present(priv->d3d_device, 0, 0, 0, 0))) {
RECT rect = {0, 0, vo_dwidth, vo_dheight};
if (FAILED(IDirect3DDevice9_Present(priv->d3d_device, &rect, 0, 0, 0))) {
mp_msg(MSGT_VO, MSGL_V,
"<vo_direct3d>Video adapter became uncooperative.\n");
mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Trying to reinitialize it...\n");
@ -795,7 +865,7 @@ static void flip_page(void)
mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Reinitialization Failed.\n");
return;
}
if (FAILED(IDirect3DDevice9_Present(priv->d3d_device, 0, 0, 0, 0))) {
if (FAILED(IDirect3DDevice9_Present(priv->d3d_device, &rect, 0, 0, 0))) {
mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Reinitialization Failed.\n");
return;
}

View File

@ -63,7 +63,6 @@ for DLL to know too much about its environment.
#include <sys/types.h>
#include <dirent.h>
#include <sys/time.h>
#include <sys/timeb.h>
#ifdef HAVE_KSTAT
#include <kstat.h>
#endif

View File

@ -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

View File

@ -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;

View File

@ -47,30 +47,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_3DNOW
if (HAVE_AMD3DNOW)
mp_msg(MSGT_CPLAYER,MSGL_V," 3DNow");
#endif
#if HAVE_3DNOWEXT
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 */

View File

@ -9,10 +9,12 @@ 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
echo "$NEW_REVISION" > version.h
echo "$TITLE" >> version.h
cat <<EOF > version.h
$NEW_REVISION
$TITLE
EOF
fi

View File

@ -38,7 +38,7 @@
/* No irq support in userspace implemented yet, do not enable this! */
/* disable irq */
#undef MGA_ALLOW_IRQ
#define MGA_ALLOW_IRQ 0
#define MGA_VSYNC_POS 2
@ -565,7 +565,7 @@ if(!restore){
#endif
}
#ifdef MGA_ALLOW_IRQ
#if MGA_ALLOW_IRQ
static void enable_irq(void)
{
long int cc;
@ -1056,7 +1056,7 @@ static int mga_playback_on(void)
regs.besctl |= 1;
mga_vid_write_regs(0);
}
#ifdef MGA_ALLOW_IRQ
#if MGA_ALLOW_IRQ
if (mga_irq != -1)
enable_irq();
#endif
@ -1070,7 +1070,7 @@ static int mga_playback_off(void)
if (mga_verbose) printf("[mga] playback off\n");
vid_src_ready = 0;
#ifdef MGA_ALLOW_IRQ
#if MGA_ALLOW_IRQ
if (mga_irq != -1)
disable_irq();
#endif
@ -1240,7 +1240,7 @@ static int mga_init(void)
mga_mmio_base, mga_irq, mga_mem_base);
err = mtrr_set_type(pci_info.base0,mga_ram_size*1024*1024,MTRR_TYPE_WRCOMB);
if(!err) printf("[mga] Set write-combining type of video memory\n");
#ifdef MGA_ALLOW_IRQ
#if MGA_ALLOW_IRQ
if (mga_irq != -1)
{
int tmp = request_irq(mga_irq, mga_handle_irq, SA_INTERRUPT | SA_SHIRQ, "Syncfb Time Base", &mga_irq);
@ -1278,7 +1278,7 @@ static void mga_destroy(void)
mga_vid_write_regs(1);
mga_vid_in_use = 0;
#ifdef MGA_ALLOW_IRQ
#if MGA_ALLOW_IRQ
if (mga_irq != -1)
free_irq(mga_irq, &mga_irq);
#endif