aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Uoti Urpala <uau@glyph.nonexistent.invalid>2009-01-19 00:04:43 +0200
committerGravatar Uoti Urpala <uau@glyph.nonexistent.invalid>2009-01-19 00:04:43 +0200
commit79e1aa7cc7a9ac695c3af361bca72013ef272885 (patch)
treecc52764dfa4fab2cfc74c6aee5d71b27edbf014b
parent3ba97da297e1e1a5ca9dabdda60cc6a62f77affc (diff)
parent39cb032fd184a62416f1e62d26e05576cfd8dbe4 (diff)
Merge svn changes up to r28341
Conflicts: configure libmpcodecs/native/rtjpegn.c
-rw-r--r--DOCS/man/en/mplayer.13
-rw-r--r--DOCS/man/fr/mplayer.140
-rwxr-xr-xconfigure62
-rw-r--r--cpudetect.c44
-rw-r--r--cpudetect.h2
-rw-r--r--etc/codecs.conf17
-rw-r--r--liba52/a52_internal.h2
-rw-r--r--liba52/bitstream.h2
-rw-r--r--liba52/downmix.c4
-rw-r--r--liba52/imdct.c22
-rw-r--r--liba52/imdct_3dnow.h28
-rw-r--r--liba52/resample.c8
-rw-r--r--liba52/resample_mmx.c2
-rw-r--r--liba52/srfftp_3dnow.h4
-rw-r--r--libaf/af.h2
-rw-r--r--libaf/af_resample.c6
-rw-r--r--libmpcodecs/dec_video.c2
-rw-r--r--libmpcodecs/native/rtjpegn.c53
-rw-r--r--libmpcodecs/pullup.c8
-rw-r--r--libmpcodecs/vd_libmpeg2.c4
-rw-r--r--libmpcodecs/vf_decimate.c4
-rw-r--r--libmpcodecs/vf_divtc.c4
-rw-r--r--libmpcodecs/vf_eq.c4
-rw-r--r--libmpcodecs/vf_eq2.c4
-rw-r--r--libmpcodecs/vf_filmdint.c10
-rw-r--r--libmpcodecs/vf_fspp.c14
-rw-r--r--libmpcodecs/vf_halfpack.c4
-rw-r--r--libmpcodecs/vf_hue.c2
-rw-r--r--libmpcodecs/vf_ilpack.c12
-rw-r--r--libmpcodecs/vf_ivtc.c4
-rw-r--r--libmpcodecs/vf_noise.c14
-rw-r--r--libmpcodecs/vf_pp7.c8
-rw-r--r--libmpcodecs/vf_scale.c2
-rw-r--r--libmpcodecs/vf_spp.c10
-rw-r--r--libmpcodecs/vf_tfields.c12
-rw-r--r--libmpcodecs/vf_unsharp.c4
-rw-r--r--libmpcodecs/vf_uspp.c6
-rw-r--r--libmpcodecs/vf_yadif.c8
-rw-r--r--libmpdemux/asfguid.h2
-rw-r--r--libmpdemux/demux_lavf.c2
-rw-r--r--libmpeg2/cpu_accel.c12
-rw-r--r--libmpeg2/cpu_state.c10
-rw-r--r--libmpeg2/idct.c6
-rw-r--r--libmpeg2/idct_alpha.c2
-rw-r--r--libmpeg2/idct_altivec.c2
-rw-r--r--libmpeg2/idct_mmx.c2
-rw-r--r--libmpeg2/motion_comp.c14
-rw-r--r--libmpeg2/motion_comp_alpha.c2
-rw-r--r--libmpeg2/motion_comp_altivec.c2
-rw-r--r--libmpeg2/motion_comp_arm.c2
-rw-r--r--libmpeg2/motion_comp_mmx.c2
-rw-r--r--libmpeg2/motion_comp_vis.c2
-rw-r--r--libmpeg2/mpeg2_internal.h2
-rw-r--r--libswscale/rgb2rgb.c32
-rw-r--r--libswscale/rgb2rgb_template.c122
-rw-r--r--libswscale/swscale-example.c4
-rw-r--r--libswscale/swscale.c103
-rw-r--r--libswscale/swscale_internal.h10
-rw-r--r--libswscale/swscale_template.c86
-rw-r--r--libswscale/yuv2rgb.c22
-rw-r--r--libswscale/yuv2rgb_template.c6
-rw-r--r--libvo/aclib.c79
-rw-r--r--libvo/aclib_template.c25
-rw-r--r--libvo/fastmemcpy.h4
-rw-r--r--libvo/osd.c86
-rw-r--r--libvo/osd_template.c42
-rw-r--r--libvo/vo_macosx.m13
-rw-r--r--loader/win32.c4
-rw-r--r--mencoder.c14
-rw-r--r--mp3lib/decod386.c4
-rw-r--r--mp3lib/sr1.c22
-rw-r--r--mplayer.c16
-rw-r--r--osdep/mplayer.rc2
-rw-r--r--vidix/dha.c4
74 files changed, 650 insertions, 555 deletions
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index d6fd64969a..785c4f8cf8 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -3560,7 +3560,8 @@ Mac OS X CoreVideo video output driver
.PD 0
.RSs
.IPs device_id=<number>
-Choose the display device to use in fullscreen.
+Choose the display device to use for fullscreen or set it to \-1 to
+always use the same screen the video window is on (default: \-1 \- auto).
.IPs shared_buffer
Write output to a shared memory buffer instead of displaying it and
try to open an existing NSConnection for communication with a GUI.
diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1
index cab727dd17..250f131ce3 100644
--- a/DOCS/man/fr/mplayer.1
+++ b/DOCS/man/fr/mplayer.1
@@ -1,4 +1,4 @@
-.\" synced with r28126
+.\" synced with r28279
.\" Encoding: iso-8859-1
.\" MPlayer (C) 2000-2009 MPlayer Team
.\" The English man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann
@@ -33,7 +33,7 @@
.\" Titre
.\" --------------------------------------------------------------------------
.
-.TH MPlayer 1 "1er janvier 2008" "The MPlayer Project" "Le Lecteur Vidéo"
+.TH MPlayer 1 "15 janvier 2009" "The MPlayer Project" "Le Lecteur Vidéo"
.
.SH NAME
mplayer \- Lecteur vidéo
@@ -624,6 +624,7 @@ alang=en
profile-desc="profil pour les flux dvdnav://"
profile=protocol.dvd
mouse-movements=yes
+nocache=yes
[extension.flv]
profile-desc="profil pour les fichiers .flv"
@@ -1089,9 +1090,10 @@ Affiche le menu principal au lancement de MPlayer.
.TP
.B \-mouse\-movements
Permet MPlayer de recevoir des évènements souris envoyés
-par le pilote de sortie vidéo (seuls ceux dérivés de X11 sont gérés
-pour le moment).
+par le pilote de sortie vidéo.
Utilisé pour sélectioner les boutons des menus DVDs.
+Géré par par les VOs basés sur X11 (x11, xv, xvmc, etc.) ainsi que les VOs gl,
+gl2, direct3d et macosx.
.
.TP
.B \-noar
@@ -1228,6 +1230,15 @@ Pour jouer des flux MPEG-TS, MPlayer/\:MEncoder utilisera le premier programme
(si présent) avec le flux audio choisi.
.
.TP
+.B \-ausid <ID> (voir aussi \-alang)
+Sélectionne le canal du sous-flux audio.
+L'intervalle des valeurs valides est 0x55..0x75 et s'applique uniquement au
+démultiplexeur MPEG-TS natif (par celui de libavformat).
+Le type de format peut ne pas être correctement identifié puisque cette information n'est pas présente dans le flux, mais le démultiplexage des flux audios se fera correctement en présence de sous-flux multiples.
+MPlayer affiche tous les identifiants des sous-flux quand il est lancé avec
+l'option \-identify.
+.
+.TP
.B \-alang <code de langue[,code de langue,...]> (voir aussi \-aid)
Définit une liste de langues de pistes audio à jouer en priorité.
Chaque format de conteneur utilise des codes de pays différents.
@@ -2181,8 +2192,8 @@ sous-titres et ceux contenus dans les pistes Matroska.
Fonctionne avec \-embeddedfonts.
.br
.I NOTE\ :
-Quand fontconfig est activé à compilation, \-ass active \-fontconfig à moins
-que vous l'empêchiez explicitement avec l'option \-nofontconfig.
+Contrairement aux OSD normaux, libass utilise fontconfig par défaut.
+Pour désactiver ceci, utiliser l'option \-nofontconfig.
.
.TP
.B \-ass\-border\-color <valeur>
@@ -2367,8 +2378,8 @@ Avec Fontconfig, cette option détermine le nom de police fontconfig.
Active l'utilisation des polices gérées par fontconfig.
.br
.I NOTE\ :
-\-ass active cette option automatiquement à moins que vous l'empêchiez
-explicitement avec l'option \-nofontconfig.
+Par défaut fontconfig est utilisé pour afficher les sous-titres rendus par libass.
+Cette option active aussi le rendu de l'OSD avec fontconfig.
.
.TP
.B \-forcedsubsonly
@@ -2910,6 +2921,10 @@ Nom du client qui passé à JACK (par défaut\ : MPlayer [<PID>]).
.IPs (no)estimate
Estime le délai audio, supposé réduire les à-coups lors de la lecture
vidéo (par défaut\ : activé).
+.IPs (no)autostart
+Démarre le serveur jackd si nécessaire (par défaut\ : désactivé)
+Notez que cette option ne semble pas fiable et polluera la console avec plein
+de messages du serveur jackd.
.RE
.PD 1
.
@@ -3724,6 +3739,13 @@ pilote de sortie vidéo CoreVideo pour Mac OS X
.RSs
.IPs device_id=<numéro>
Choisir le moniteur à utiliser en plein-écran.
+.IPs shared_buffer
+Écrit la sortie dans un tampon partagé au lieu de l'afficher, et essaye
+d'établir une NSConnection avec une IHM existante.
+.IPs buffer_name=<name>
+Nom du tampon partagé créé avec shm_open pour effectuer la NSConnection avec
+une IHM (defaut\ : "mplayerosx").
+Définir l'option buffer_name active shared_buffer implicitement.
.RE
.PD 1
.
@@ -11705,7 +11727,7 @@ MPlayer était écrit à l'origine par Arpad Gereoffy.
Voir le fichier AUTHORS pour la liste de certains des nombreux autres
contributeurs.
.TP
-MPlayer est (C) 2000\-2008 The MPlayer Team
+MPlayer est (C) 2000\-2009 The MPlayer Team
.TP
Cette page de man est basée sur sa version en langue anglaise, écrite et
maintenue par Gabucino, Jonas Jermann et Diego Biurrun
diff --git a/configure b/configure
index e588342227..ad1780c72a 100755
--- a/configure
+++ b/configure
@@ -523,7 +523,7 @@ _libavcodec_a=auto
_libamr_nb=auto
_libamr_wb=auto
_libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
-_libavdecoders=` echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER// -e s/H264_VDPAU_DECODER// `
+_libavdecoders=` echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER// -e s/H264_VDPAU_DECODER// -e s/MPEG_VDPAU_DECODER// -e s/MPEG1_VDPAU_DECODER//`
_libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
_libavencoders=` echo $_libavencoders_all | sed 's/ LIB[A-Z0-9_]*_ENCODER//g'`
_libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
@@ -1690,7 +1690,7 @@ EOF
fi
-_arch_all='X86 X86_32 X86_64 IA64 SPARC ARM SH PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC'
+_arch_all='X86 X86_32 X86_64 IA64 SPARC ARM SH4 PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC'
case "$host_arch" in
i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
_arch='X86 X86_32'
@@ -2049,10 +2049,10 @@ EOF
iproc='arm'
;;
- sh)
- _arch='SH'
- _target_arch='ARCH_SH = yes'
- iproc='sh'
+ sh|sh4)
+ _arch='SH4'
+ _target_arch='ARCH_SH4 = yes'
+ iproc='sh4'
;;
ppc|ppc64|powerpc|powerpc64)
@@ -2496,7 +2496,7 @@ if test $_yasm ; then
_have_yasm="yes"
echores "$_yasm"
else
- _def_yasm='#undef HAVE_YASM'
+ _def_yasm='#define HAVE_YASM 0'
fft_mmx="no"
_have_yasm="no"
echores "no"
@@ -2617,7 +2617,7 @@ EOF
echores "$_iwmmxt"
fi
-_cpuexts_all='ALTIVEC BSWAP MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP IWMMXT MLIB MMI SH4 VIS MVI'
+_cpuexts_all='ALTIVEC BSWAP MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP IWMMXT MMI VIS MVI'
test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
@@ -5541,6 +5541,7 @@ fi
echores "$_sunaudio"
+def_mlib='#define CONFIG_MLIB 0'
if sunos; then
echocheck "Sun mediaLib"
if test "$_mlib" = auto ; then
@@ -5549,9 +5550,8 @@ if test "$_mlib" = auto ; then
#include <mlib.h>
int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
EOF
- cc_check -lmlib && _mlib=yes
+ cc_check -lmlib && _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
fi
-test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
echores "$_mlib"
fi #if sunos
@@ -6240,10 +6240,10 @@ if test "$_mp3lib" = auto ; then
fi
if test "$_mp3lib" = yes ; then
_def_mp3lib='#define CONFIG_MP3LIB 1'
- _codecmodules="mp3lib $_codecmodules"
+ _codecmodules="mp3lib(internal) $_codecmodules"
else
_def_mp3lib='#undef CONFIG_MP3LIB'
- _nocodecmodules="mp3lib $_nocodecmodules"
+ _nocodecmodules="mp3lib(internal) $_nocodecmodules"
fi
echores "$_mp3lib"
@@ -6288,10 +6288,10 @@ if test "$_libmpeg2" = auto ; then
fi
if test "$_libmpeg2" = yes ; then
_def_libmpeg2='#define CONFIG_LIBMPEG2 1'
- _codecmodules="libmpeg2 $_codecmodules"
+ _codecmodules="libmpeg2(internal) $_codecmodules"
else
_def_libmpeg2='#undef CONFIG_LIBMPEG2'
- _nocodecmodules="libmpeg2 $_nocodecmodules"
+ _nocodecmodules="libmpeg2(internal) $_nocodecmodules"
fi
echores "$_libmpeg2"
@@ -6422,7 +6422,11 @@ fi
if test "$_faad" = yes ; then
_def_faad='#define CONFIG_FAAD 1'
- _codecmodules="faad2 $_codecmodules"
+ if test "$_faad_internal" = yes ; then
+ _codecmodules="faad2(internal) $_codecmodules"
+ else
+ _codecmodules="faad2 $_codecmodules"
+ fi
else
_faad=no
_nocodecmodules="faad2 $_nocodecmodules"
@@ -6641,7 +6645,7 @@ elif test "$_libavutil_so" = auto ; then
_libavutil_so=no
cat > $TMPC << EOF
#include <libavutil/common.h>
-int main(void) { ff_gcd(1,1); return 0; }
+int main(void) { av_gcd(1,1); return 0; }
EOF
if $_pkg_config --exists libavutil ; then
_inc_libavutil=`$_pkg_config --cflags libavutil`
@@ -6704,7 +6708,7 @@ test "$_libavcodec_so" = yes && _def_libavcodec_so='#define CONFIG_LIBAVCODEC_SO
test "$_libavcodec_mpegaudio_hp" = yes \
&& _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
if test "$_libavcodec_a" = yes ; then
- _codecmodules="libavcodec $_codecmodules"
+ _codecmodules="libavcodec(internal) $_codecmodules"
elif test "$_libavcodec_so" = yes ; then
_codecmodules="libavcodec.so $_codecmodules"
else
@@ -7824,11 +7828,12 @@ if test "$_dvdnav" = yes ; then
_def_dvdnav='#define CONFIG_DVDNAV 1'
if test "$dvdnav_internal" = yes ; then
_inc_extra="$_inc_extra -Ilibdvdnav"
+ _inputmodules="dvdnav(internal) $_inputmodules"
else
_inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
_ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
+ _inputmodules="dvdnav $_inputmodules"
fi
- _inputmodules="dvdnav $_inputmodules"
else
_def_dvdnav='#undef CONFIG_DVDNAV'
_noinputmodules="dvdnav $_noinputmodules"
@@ -8205,9 +8210,8 @@ test -z "$_nprefix" && _nprefix='CONFIG'
for part in $1; do
if ` echo $2 | grep -q -E "(^| )$part($| )" `; then
echo "#define ${_nprefix}_$part 1"
- echo "#define ENABLE_$part 1"
else
- echo "#define ENABLE_$part 0"
+ echo "#define ${_nprefix}_$part 0"
fi
done
}
@@ -8587,29 +8591,21 @@ $_def_libswscale_so
$_def_dcbzl
$def_fast_64bit
$_def_fast_unaligned
+$def_mlib
$_def_mkstemp
$_def_pthreads
$_def_threads
-#ifdef HAVE_THREADS
-#define ENABLE_THREADS 1
-#else
-#define ENABLE_THREADS 0
-#endif
$_def_yasm
#define CONFIG_GPL 1
-#define ENABLE_SMALL 0
-#define ENABLE_GRAY 0
+#define CONFIG_SMALL 0
+#define CONFIG_GRAY 0
/* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
#define CONFIG_AANDCT 1
-#define ENABLE_AANDCT 1
#define CONFIG_FFT 1
-#define ENABLE_FFT 1
#define CONFIG_GOLOMB 1
-#define ENABLE_GOLOMB 1
#define CONFIG_MDCT 1
-#define ENABLE_MDCT 1
/* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
#define HAVE_EBX_AVAILABLE 1
@@ -8618,12 +8614,8 @@ $_def_yasm
#endif
#define CONFIG_DECODERS 1
-#define ENABLE_DECODERS 1
#define CONFIG_ENCODERS 1
-#define ENABLE_ENCODERS 1
-
#define CONFIG_DEMUXERS 1
-#define ENABLE_DEMUXERS 1
$_def_muxers
diff --git a/cpudetect.c b/cpudetect.c
index 3860cc9a17..9756dfb454 100644
--- a/cpudetect.c
+++ b/cpudetect.c
@@ -9,7 +9,7 @@ CpuCaps gCpuCaps;
#endif
#include <stdlib.h>
-#ifdef ARCH_X86
+#if ARCH_X86
#include <stdio.h>
#include <string.h>
@@ -57,7 +57,7 @@ static int has_cpuid(void)
long a, c;
// code from libavcodec:
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
#define PUSHF "pushfq\n\t"
#define POPF "popfq\n\t"
#else
@@ -212,27 +212,27 @@ void GetCpuCaps( CpuCaps *caps)
// caps->hasMMX = 0;
#ifndef RUNTIME_CPUDETECT
-#ifndef HAVE_MMX
+#if !HAVE_MMX
if(caps->hasMMX) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"MMX supported but disabled\n");
caps->hasMMX=0;
#endif
-#ifndef HAVE_MMX2
+#if !HAVE_MMX2
if(caps->hasMMX2) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"MMX2 supported but disabled\n");
caps->hasMMX2=0;
#endif
-#ifndef HAVE_SSE
+#if !HAVE_SSE
if(caps->hasSSE) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"SSE supported but disabled\n");
caps->hasSSE=0;
#endif
-#ifndef HAVE_SSE2
+#if !HAVE_SSE2
if(caps->hasSSE2) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"SSE2 supported but disabled\n");
caps->hasSSE2=0;
#endif
-#ifndef HAVE_3DNOW
+#if !HAVE_3DNOW
if(caps->has3DNow) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"3DNow supported but disabled\n");
caps->has3DNow=0;
#endif
-#ifndef HAVE_3DNOWEX
+#if !HAVE_3DNOWEX
if(caps->has3DNowExt) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"3DNowExt supported but disabled\n");
caps->has3DNowExt=0;
#endif
@@ -304,7 +304,7 @@ char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]){
#undef CPUID_STEPPING
-#if defined(__linux__) && defined(_POSIX_SOURCE) && !defined(ARCH_X86_64)
+#if defined(__linux__) && defined(_POSIX_SOURCE) && !ARCH_X86_64
static void sigill_handler_sse( int signal, struct sigcontext sc )
{
mp_msg(MSGT_CPUDETECT,MSGL_V, "SIGILL, " );
@@ -371,7 +371,7 @@ ULONG _System os2_sig_handler_sse( PEXCEPTIONREPORTRECORD p1,
static void check_os_katmai_support( void )
{
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
gCpuCaps.hasSSE=1;
gCpuCaps.hasSSE2=1;
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__APPLE__)
@@ -511,7 +511,7 @@ void GetCpuCaps( CpuCaps *caps)
caps->hasSSE4a=0;
caps->isX86=0;
caps->hasAltiVec = 0;
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
#ifdef __APPLE__
/*
rip-off from ffmpeg altivec detection code.
@@ -558,47 +558,47 @@ void GetCpuCaps( CpuCaps *caps)
mp_msg(MSGT_CPUDETECT,MSGL_INFO,"AltiVec %sfound\n", (caps->hasAltiVec ? "" : "not "));
#endif /* HAVE_ALTIVEC */
-#ifdef ARCH_IA64
+#if ARCH_IA64
mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Intel Itanium\n");
#endif
-#ifdef ARCH_SPARC
+#if ARCH_SPARC
mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Sun Sparc\n");
#endif
-#ifdef ARCH_ARMV4L
+#if ARCH_ARM
mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: ARM\n");
#endif
-#ifdef ARCH_PPC
+#if ARCH_PPC
mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: PowerPC\n");
#endif
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Digital Alpha\n");
#endif
-#ifdef ARCH_SGI_MIPS
+#if ARCH_SGI_MIPS
mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: SGI MIPS\n");
#endif
-#ifdef ARCH_PA_RISC
+#if ARCH_PA_RISC
mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: Hewlett-Packard PA-RISC\n");
#endif
-#ifdef ARCH_S390
+#if ARCH_S390
mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: IBM S/390\n");
#endif
-#ifdef ARCH_S390X
+#if ARCH_S390X
mp_msg(MSGT_CPUDETECT,MSGL_INFO,"CPU: IBM S/390X\n");
#endif
-#ifdef ARCH_VAX
+#if ARCH_VAX
mp_msg(MSGT_CPUDETECT,MSGL_INFO, "CPU: Digital VAX\n" );
#endif
-#ifdef ARCH_XTENSA
+#if ARCH_XTENSA
mp_msg(MSGT_CPUDETECT,MSGL_INFO, "CPU: Tensilica Xtensa\n" );
#endif
}
diff --git a/cpudetect.h b/cpudetect.h
index a98f97f0e4..3f91f05d1c 100644
--- a/cpudetect.h
+++ b/cpudetect.h
@@ -6,7 +6,7 @@
#define CPUTYPE_I586 5
#define CPUTYPE_I686 6
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
# define REGa rax
# define REGb rbx
# define REGBP rbp
diff --git a/etc/codecs.conf b/etc/codecs.conf
index 5f3d13dff2..0a1371148a 100644
--- a/etc/codecs.conf
+++ b/etc/codecs.conf
@@ -38,6 +38,7 @@ videocodec ffmimic
info "FFmpeg Mimic video"
status working
fourcc ML20
+ fourcc LM20 ; mimic in avi
out I420
driver ffmpeg
dll "mimic"
@@ -1717,6 +1718,14 @@ videocodec psiv
dll "psiv.dll"
out BGR32,BGR24 query,flip
+videocodec midivid3
+ info "www.midivid.com/codec/mv3codec.html"
+ status working
+ fourcc MV30
+ driver vfw
+ dll "MV3.dll"
+ out BGR24,BGR16
+
videocodec nsvideo
info "Power VideoWorks video"
status working
@@ -2126,6 +2135,14 @@ videocodec tridvfw
dll "TRICDC32.DRV"
out BGR24 flip
+videocodec vdtzvfw
+ info "Telegeny VDTZ"
+ status working
+ fourcc VDTZ
+ driver vfw
+ dll "VTZ32.DLL"
+ out BGR24 flip
+
videocodec vivd2
info "SoftMedia ViVD V2 codec VfW"
status working
diff --git a/liba52/a52_internal.h b/liba52/a52_internal.h
index 3854c16707..1f6d205931 100644
--- a/liba52/a52_internal.h
+++ b/liba52/a52_internal.h
@@ -107,7 +107,7 @@ struct a52_state_s {
#define DELTA_BIT_NONE (2)
#define DELTA_BIT_RESERVED (3)
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
# define REG_a "rax"
# define REG_d "rdx"
# define REG_S "rsi"
diff --git a/liba52/bitstream.h b/liba52/bitstream.h
index 63b1823b17..fcf2e47390 100644
--- a/liba52/bitstream.h
+++ b/liba52/bitstream.h
@@ -37,7 +37,7 @@
#define ALT_BITSTREAM_READER
/* used to avoid misaligned exceptions on some archs (alpha, ...) */
-#if defined (ARCH_X86) || defined(HAVE_ARMV6)
+#if ARCH_X86 || defined(HAVE_ARMV6)
# define unaligned32(a) (*(uint32_t*)(a))
#else
# ifdef __GNUC__
diff --git a/liba52/downmix.c b/liba52/downmix.c
index ffb149b760..c44317fd6f 100644
--- a/liba52/downmix.c
+++ b/liba52/downmix.c
@@ -56,7 +56,7 @@ void downmix_accel_init(uint32_t mm_accel)
{
a52_upmix= upmix_C;
a52_downmix= downmix_C;
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
if(mm_accel & MM_ACCEL_X86_MMX) a52_upmix= upmix_MMX;
if(mm_accel & MM_ACCEL_X86_SSE) a52_downmix= downmix_SSE;
if(mm_accel & MM_ACCEL_X86_3DNOW) a52_downmix= downmix_3dnow;
@@ -686,7 +686,7 @@ void upmix_C (sample_t * samples, int acmod, int output)
}
}
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
static void mix2to1_SSE (sample_t * dest, sample_t * src, sample_t bias)
{
__asm__ volatile(
diff --git a/liba52/imdct.c b/liba52/imdct.c
index 325461c6fd..9ad36249d6 100644
--- a/liba52/imdct.c
+++ b/liba52/imdct.c
@@ -54,6 +54,7 @@ void (*a52_imdct_512) (sample_t * data, sample_t * delay, sample_t bias);
#ifdef RUNTIME_CPUDETECT
#undef HAVE_3DNOWEX
+#define HAVE_3DNOWEX 0
#endif
typedef struct complex_s {
@@ -118,7 +119,7 @@ static complex_t __attribute__((aligned(16))) * w[7] = {w_1, w_2, w_4, w_8, w_16
static sample_t __attribute__((aligned(16))) xcos1[128];
static sample_t __attribute__((aligned(16))) xsin1[128];
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
// NOTE: SSE needs 16byte alignment or it will segfault
//
static float __attribute__((aligned(16))) sseSinCos1c[256];
@@ -365,7 +366,7 @@ void imdct_do_512 (sample_t * data, sample_t * delay, sample_t bias)
}
}
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
#ifdef HAVE_ALTIVEC_H
#include <altivec.h>
@@ -710,10 +711,9 @@ imdct_do_512_altivec(sample_t data[],sample_t delay[], sample_t bias)
// Stuff below this line is borrowed from libac3
#include "srfftp.h"
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
-#ifndef HAVE_3DNOW
+#if ARCH_X86 || ARCH_X86_64
+#undef HAVE_3DNOW
#define HAVE_3DNOW 1
-#endif
#include "srfftp_3dnow.h"
const i_cmplx_t x_plus_minus_3dnow __attribute__ ((aligned (8))) = {{ 0x00000000UL, 0x80000000UL }};
@@ -721,8 +721,10 @@ const i_cmplx_t x_minus_plus_3dnow __attribute__ ((aligned (8))) = {{ 0x80000000
const complex_t HSQRT2_3DNOW __attribute__ ((aligned (8))) = { 0.707106781188, 0.707106781188 };
#undef HAVE_3DNOWEX
+#define HAVE_3DNOWEX 0
#include "imdct_3dnow.h"
-#define HAVE_3DNOWEX
+#undef HAVE_3DNOWEX
+#define HAVE_3DNOWEX 1
#include "imdct_3dnow.h"
void
@@ -1202,7 +1204,7 @@ void a52_imdct_init (uint32_t mm_accel)
w[i][k].imag = sin (-M_PI * k / j);
}
}
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
for (i = 0; i < 128; i++) {
sseSinCos1c[2*i+0]= xcos1[i];
sseSinCos1c[2*i+1]= -xcos1[i];
@@ -1256,7 +1258,7 @@ void a52_imdct_init (uint32_t mm_accel)
ifft128 = ifft128_c;
ifft64 = ifft64_c;
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
if(mm_accel & MM_ACCEL_X86_SSE)
{
fprintf (stderr, "Using SSE optimized IMDCT transform\n");
@@ -1276,7 +1278,7 @@ void a52_imdct_init (uint32_t mm_accel)
}
else
#endif // ARCH_X86 || ARCH_X86_64
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if (mm_accel & MM_ACCEL_PPC_ALTIVEC)
{
fprintf(stderr, "Using AltiVec optimized IMDCT transform\n");
@@ -1285,7 +1287,7 @@ void a52_imdct_init (uint32_t mm_accel)
else
#endif
-#ifdef LIBA52_DJBFFT
+#if LIBA52_DJBFFT
if (mm_accel & MM_ACCEL_DJBFFT) {
fprintf (stderr, "Using djbfft for IMDCT transform\n");
ifft128 = (void (*) (complex_t *)) fftc4_un128;
diff --git a/liba52/imdct_3dnow.h b/liba52/imdct_3dnow.h
index 2291158950..eeab33b27c 100644
--- a/liba52/imdct_3dnow.h
+++ b/liba52/imdct_3dnow.h
@@ -26,7 +26,7 @@
#undef FFT_ASMB16_3DNOW
#undef FFT_128P_3DNOW
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
#define FFT_4_3DNOW fft_4_3dnowex
#define FFT_8_3DNOW fft_8_3dnowex
#define FFT_ASMB_3DNOW fft_asmb_3dnowex
@@ -52,7 +52,7 @@ static void FFT_4_3DNOW(complex_t *x)
"pxor %3, %%mm1\n\t" /* -mm1.re | mm1.im */
"pfadd %%mm1, %%mm3\n\t" /* vi.im = x[3].re - x[1].re; */
"movq %%mm3, %%mm4\n\t" /* vi.re =-x[3].im + x[1].im; mm4 = vi */
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
"pswapd %%mm4, %%mm4\n\t"
#else
"punpckldq %%mm4, %%mm5\n\t"
@@ -129,7 +129,7 @@ static void FFT_8_3DNOW(complex_t *x)
"movq (%1), %%mm1\n\t"
"movq 16(%1), %%mm4\n\t"
"movq %%mm1, %%mm2\n\t"
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
"pswapd %%mm3, %%mm3\n\t"
#else
"punpckldq %%mm3, %%mm6\n\t"
@@ -160,7 +160,7 @@ static void FFT_8_3DNOW(complex_t *x)
"movq %2, %%mm1\n\t"
"movq 56(%3), %%mm3\n\t"
"pfsub 40(%3), %%mm0\n\t"
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
"pswapd %%mm1, %%mm1\n\t"
#else
"punpckldq %%mm1, %%mm2\n\t"
@@ -168,7 +168,7 @@ static void FFT_8_3DNOW(complex_t *x)
#endif
"pxor %%mm7, %%mm1\n\t"
"pfadd %%mm1, %%mm0\n\t"
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
"pswapd %%mm3, %%mm3\n\t"
#else
"punpckldq %%mm3, %%mm2\n\t"
@@ -182,7 +182,7 @@ static void FFT_8_3DNOW(complex_t *x)
"pfmul %4, %%mm0\n\t"
"movq 40(%3), %%mm5\n\t"
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
"pswapd %%mm5, %%mm5\n\t"
#else
"punpckldq %%mm5, %%mm1\n\t"
@@ -205,7 +205,7 @@ static void FFT_8_3DNOW(complex_t *x)
/* x[3] x[7] */
__asm__ volatile(
"movq %1, %%mm0\n\t"
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
"pswapd %3, %%mm1\n\t"
#else
"movq %3, %%mm1\n\t"
@@ -218,7 +218,7 @@ static void FFT_8_3DNOW(complex_t *x)
"movq 56(%4), %%mm3\n\t"
"pxor %%mm7, %%mm3\n\t"
"pfadd %%mm3, %%mm2\n\t"
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
"pswapd %%mm2, %%mm2\n\t"
#else
"punpckldq %%mm2, %%mm5\n\t"
@@ -331,7 +331,7 @@ static void FFT_128P_3DNOW(complex_t *a)
}
static void
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
imdct_do_512_3dnowex
#else
imdct_do_512_3dnow
@@ -371,14 +371,14 @@ imdct_do_512_3dnow
"punpckldq %4, %%mm1\n\t" /* mm1 = xcos[j] | xsin[j] */
"movq %%mm0, %%mm2\n\t"
"pfmul %%mm1, %%mm0\n\t"
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
"pswapd %%mm1, %%mm1\n\t"
#else
"punpckldq %%mm1, %%mm5\n\t"
"punpckhdq %%mm5, %%mm1\n\t"
#endif
"pfmul %%mm1, %%mm2\n\t"
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
"pfpnacc %%mm2, %%mm0\n\t"
#else
"pxor %%mm7, %%mm0\n\t"
@@ -445,7 +445,7 @@ imdct_do_512_3dnow
__asm__ volatile (
"movq %1, %%mm0\n\t" /* ac3_buf[i].re | ac3_buf[i].im */
"movq %%mm0, %%mm1\n\t" /* ac3_buf[i].re | ac3_buf[i].im */
-#ifndef HAVE_3DNOWEX
+#if !HAVE_3DNOWEX
"punpckldq %%mm1, %%mm2\n\t"
"punpckhdq %%mm2, %%mm1\n\t"
#else
@@ -455,7 +455,7 @@ imdct_do_512_3dnow
"punpckldq %2, %%mm3\n\t" /* ac3_xsin[i] | ac3_xcos[i] */
"pfmul %%mm3, %%mm0\n\t"
"pfmul %%mm3, %%mm1\n\t"
-#ifndef HAVE_3DNOWEX
+#if !HAVE_3DNOWEX
"pxor %%mm7, %%mm0\n\t"
"pfacc %%mm1, %%mm0\n\t"
"punpckldq %%mm0, %%mm1\n\t"
@@ -543,7 +543,7 @@ imdct_do_512_3dnow
"movd (%1), %%mm1\n\t"
"punpckldq (%2), %%mm0\n\t"
"punpckldq 508(%2), %%mm1\n\t"
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
"pswapd (%3), %%mm3\n\t"
"pswapd -512(%3), %%mm4\n\t"
#else
diff --git a/liba52/resample.c b/liba52/resample.c
index cd87f2050c..7284f567f7 100644
--- a/liba52/resample.c
+++ b/liba52/resample.c
@@ -38,18 +38,18 @@ int (* a52_resample) (float * _f, int16_t * s16)=NULL;
#include "resample_c.c"
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
#include "resample_mmx.c"
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
#include "resample_altivec.c"
#endif
void* a52_resample_init(uint32_t mm_accel,int flags,int chans){
void* tmp;
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
if(mm_accel&MM_ACCEL_X86_MMX){
tmp=a52_resample_MMX(flags,chans);
if(tmp){
@@ -59,7 +59,7 @@ void* tmp;
}
}
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if(mm_accel&MM_ACCEL_PPC_ALTIVEC){
tmp=a52_resample_altivec(flags,chans);
if(tmp){
diff --git a/liba52/resample_mmx.c b/liba52/resample_mmx.c
index 9a37fd4ad3..782d9cd3f0 100644
--- a/liba52/resample_mmx.c
+++ b/liba52/resample_mmx.c
@@ -76,7 +76,7 @@ static int a52_resample_MONO_to_5_MMX(float * _f, int16_t * s16){
static int a52_resample_STEREO_to_2_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
/* benchmark scores are 0.3% better with SSE but we would need to set bias=0 and premultiply it
-#ifdef HAVE_SSE
+#if HAVE_SSE
__asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"1: \n\t"
diff --git a/liba52/srfftp_3dnow.h b/liba52/srfftp_3dnow.h
index 9f26c59b43..1d66c5b89c 100644
--- a/liba52/srfftp_3dnow.h
+++ b/liba52/srfftp_3dnow.h
@@ -46,7 +46,7 @@ typedef struct
"m"(x_minus_plus_3dnow)\
:"memory");
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
#define PSWAP_MM(mm_base,mm_hlp) "pswapd "mm_base","mm_base"\n\t"
#else
#define PSWAP_MM(mm_base,mm_hlp)\
@@ -54,7 +54,7 @@ typedef struct
"psrlq $32, "mm_base"\n\t"\
"punpckldq "mm_hlp","mm_base"\n\t"
#endif
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
#define PFNACC_MM(mm_base,mm_hlp) "pfnacc "mm_base","mm_base"\n\t"
#else
#define PFNACC_MM(mm_base,mm_hlp)\
diff --git a/libaf/af.h b/libaf/af.h
index 1b2bde6ace..14c3accb12 100644
--- a/libaf/af.h
+++ b/libaf/af.h
@@ -93,7 +93,7 @@ extern int* af_cpu_speed;
// Default init type
#ifndef AF_INIT_TYPE
-#if defined(HAVE_SSE) || defined(HAVE_3DNOW)
+#if HAVE_SSE || HAVE_3DNOW
#define AF_INIT_TYPE (af_cpu_speed?*af_cpu_speed:AF_INIT_FAST)
#else
#define AF_INIT_TYPE (af_cpu_speed?*af_cpu_speed:AF_INIT_SLOW)
diff --git a/libaf/af_resample.c b/libaf/af_resample.c
index c2cfb4b74f..0953217c4c 100644
--- a/libaf/af_resample.c
+++ b/libaf/af_resample.c
@@ -36,7 +36,7 @@
slow and to 16 if the machine is fast and has MMX.
*/
-#if !defined(HAVE_MMX) // This machine is slow
+#if !HAVE_MMX // This machine is slow
#define L8
#else
#define L16
@@ -201,7 +201,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
}
// Calculate up and down sampling factors
- d=ff_gcd(af->data->rate,n->rate);
+ d=av_gcd(af->data->rate,n->rate);
// If sloppy resampling is enabled limit the upsampling factor
if(((s->setup & FREQ_MASK) == FREQ_SLOPPY) && (af->data->rate/d > 5000)){
@@ -209,7 +209,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
int dn=n->rate/2;
int m=2;
while(af->data->rate/(d*m) > 5000){
- d=ff_gcd(up,dn);
+ d=av_gcd(up,dn);
up/=2; dn/=2; m*=2;
}
d*=m;
diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c
index ef44399e82..49ee002bf4 100644
--- a/libmpcodecs/dec_video.c
+++ b/libmpcodecs/dec_video.c
@@ -419,7 +419,7 @@ void *decode_video(sh_video_t *sh_video, unsigned char *start, int in_size,
//------------------------ frame decoded. --------------------
-#ifdef HAVE_MMX
+#if HAVE_MMX
// some codecs are broken, and doesn't restore MMX state :(
// it happens usually with broken/damaged files.
if (gCpuCaps.has3DNow) {
diff --git a/libmpcodecs/native/rtjpegn.c b/libmpcodecs/native/rtjpegn.c
index be24f12851..b97e507817 100644
--- a/libmpcodecs/native/rtjpegn.c
+++ b/libmpcodecs/native/rtjpegn.c
@@ -26,14 +26,11 @@
#include <string.h>
#include "config.h"
-#ifdef HAVE_MMX
-#define MMX
-#endif
#include "mpbswap.h"
#include "rtjpegn.h"
-#ifdef MMX
+#if HAVE_MMX
#include "mmx.h"
#endif
@@ -68,7 +65,7 @@ static const __u64 RTjpeg_aan_tab[64]={
1184891264ULL, 1643641088ULL, 1548224000ULL, 1393296000ULL, 1184891264ULL, 931136000ULL, 641204288ULL, 326894240ULL,
};
-#ifndef MMX
+#if !HAVE_MMX
static __s32 RTjpeg_ws[64+31];
#endif
__u8 RTjpeg_alldata[2*64+4*64+4*64+4*64+4*64+32];
@@ -88,7 +85,7 @@ static int RTjpeg_Ysize, RTjpeg_Csize;
static __s16 *RTjpeg_old=NULL;
-#ifdef MMX
+#if HAVE_MMX
mmx_t RTjpeg_lmask;
mmx_t RTjpeg_cmask;
#else
@@ -541,7 +538,7 @@ static int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl)
}
#endif
-#if defined(MMX)
+#if HAVE_MMX
static void RTjpeg_quant_init(void)
{
int i;
@@ -610,7 +607,7 @@ static void RTjpeg_quant(__s16 *block, __s32 *qtbl)
/*
* Perform the forward DCT on one block of samples.
*/
-#ifdef MMX
+#if HAVE_MMX
static mmx_t RTjpeg_C4 ={0x2D412D412D412D41LL};
static mmx_t RTjpeg_C6 ={0x187E187E187E187ELL};
static mmx_t RTjpeg_C2mC6={0x22A322A322A322A3LL};
@@ -642,7 +639,7 @@ static void RTjpeg_dct_init(void)
static void RTjpeg_dctY(__u8 *idata, __s16 *odata, int rskip)
{
-#ifndef MMX
+#if !HAVE_MMX
__s32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
__s32 tmp10, tmp11, tmp12, tmp13;
__s32 z1, z2, z3, z4, z5, z11, z13;
@@ -1570,7 +1567,7 @@ static void RTjpeg_idct_init(void)
static void RTjpeg_idct(__u8 *odata, __s16 *data, int rskip)
{
-#ifdef MMX
+#if HAVE_MMX
static mmx_t fix_141 = {0x5a825a825a825a82LL};
static mmx_t fix_184n261 = {0xcf04cf04cf04cf04LL};
@@ -2864,7 +2861,7 @@ int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp)
register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1);
register int i, j, k;
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
sb=sp;
@@ -2904,7 +2901,7 @@ int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp)
bp3+=RTjpeg_width<<2;
}
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
return (sp-sb);
@@ -2917,7 +2914,7 @@ int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp)
register __s8 * bp3 = bp2 + RTjpeg_Csize;
register int i, j, k;
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
sb=sp;
@@ -2948,7 +2945,7 @@ int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp)
bp3+=RTjpeg_width<<2;
}
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
return (sp-sb);
@@ -2959,7 +2956,7 @@ int RTjpeg_compress8(__s8 *sp, unsigned char *bp)
__s8 * sb;
int i, j;
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
@@ -2976,7 +2973,7 @@ int RTjpeg_compress8(__s8 *sp, unsigned char *bp)
bp+=RTjpeg_width;
}
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
return (sp-sb);
@@ -2988,7 +2985,7 @@ void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp)
register __s8 * bp3 = bp2 + (RTjpeg_Csize);
int i, j,k;
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
@@ -3025,7 +3022,7 @@ void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp)
bp2+=RTjpeg_width<<2;
bp3+=RTjpeg_width<<2;
}
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
}
@@ -3037,7 +3034,7 @@ void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp)
register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1);
int i, j,k;
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
@@ -3087,7 +3084,7 @@ void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp)
bp2+=RTjpeg_width<<2;
bp3+=RTjpeg_width<<2;
}
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
}
@@ -3096,7 +3093,7 @@ void RTjpeg_decompress8(__s8 *sp, __u8 *bp)
{
int i, j;
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
@@ -3141,7 +3138,7 @@ void RTjpeg_init_mcompress(void)
memset(RTjpeg_old, 0, ((4*RTjpeg_width*RTjpeg_height)));
}
-#ifdef MMX
+#if HAVE_MMX
static int RTjpeg_bcomp(__s16 *old, mmx_t *mask)
{
@@ -3218,7 +3215,7 @@ int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask
register __s8 * bp3 = bp2 + (RTjpeg_Csize>>1);
register int i, j, k;
-#ifdef MMX
+#if HAVE_MMX
emms();
RTjpeg_lmask.uq=((__u64)lmask<<48)|((__u64)lmask<<32)|((__u64)lmask<<16)|lmask;
RTjpeg_cmask.uq=((__u64)cmask<<48)|((__u64)cmask<<32)|((__u64)cmask<<16)|cmask;
@@ -3294,7 +3291,7 @@ int RTjpeg_mcompressYUV420(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask
bp3+=RTjpeg_width<<2;
}
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
return (sp-sb);
@@ -3309,7 +3306,7 @@ int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask
register __s8 * bp3;
register int i, j, k;
-#ifdef MMX
+#if HAVE_MMX
emms();
RTjpeg_lmask.uq=((__u64)lmask<<48)|((__u64)lmask<<32)|((__u64)lmask<<16)|lmask;
RTjpeg_cmask.uq=((__u64)cmask<<48)|((__u64)cmask<<32)|((__u64)cmask<<16)|cmask;
@@ -3371,7 +3368,7 @@ int RTjpeg_mcompressYUV422(__s8 *sp, unsigned char *bp, __u16 lmask, __u16 cmask
bp3+=RTjpeg_width<<2;
}
printf ("%d\n", block - RTjpeg_old);
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
return (sp-sb);
@@ -3383,7 +3380,7 @@ int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask)
__s16 *block;
int i, j;
-#ifdef MMX
+#if HAVE_MMX
emms();
RTjpeg_lmask.uq=((__u64)lmask<<48)|((__u64)lmask<<32)|((__u64)lmask<<16)|lmask;
#else
@@ -3409,7 +3406,7 @@ int RTjpeg_mcompress8(__s8 *sp, unsigned char *bp, __u16 lmask)
}
bp+=RTjpeg_width<<3;
}
-#ifdef MMX
+#if HAVE_MMX
emms();
#endif
return (sp-sb);
diff --git a/libmpcodecs/pullup.c b/libmpcodecs/pullup.c
index f71bf790ce..b4b8f2c17d 100644
--- a/libmpcodecs/pullup.c
+++ b/libmpcodecs/pullup.c
@@ -9,8 +9,8 @@
-#ifdef ARCH_X86
-#ifdef HAVE_MMX
+#if ARCH_X86
+#if HAVE_MMX
static int diff_y_mmx(unsigned char *a, unsigned char *b, int s)
{
int ret;
@@ -767,8 +767,8 @@ void pullup_init_context(struct pullup_context *c)
c->diff = diff_y;
c->comb = licomb_y;
c->var = var_y;
-#ifdef ARCH_X86
-#ifdef HAVE_MMX
+#if ARCH_X86
+#if HAVE_MMX
if (c->cpu & PULLUP_CPU_MMX) {
c->diff = diff_y_mmx;
c->comb = licomb_y_mmx;
diff --git a/libmpcodecs/vd_libmpeg2.c b/libmpcodecs/vd_libmpeg2.c
index 7505768dee..ef7671e3ce 100644
--- a/libmpcodecs/vd_libmpeg2.c
+++ b/libmpcodecs/vd_libmpeg2.c
@@ -78,12 +78,12 @@ static int init(sh_video_t *sh){
accel |= MPEG2_ACCEL_X86_SSE2;
if(gCpuCaps.hasAltiVec)
accel |= MPEG2_ACCEL_PPC_ALTIVEC;
- #ifdef ARCH_ALPHA
+ #if ARCH_ALPHA
accel |= MPEG2_ACCEL_ALPHA;
#elif ARCH_ARM
accel |= MPEG2_ACCEL_ARM;
#endif
- #ifdef HAVE_MVI
+ #if HAVE_MVI
accel |= MPEG2_ACCEL_ALPHA_MVI;
#elif HAVE_VIS
accel |= MPEG2_ACCEL_SPARC_VIS;
diff --git a/libmpcodecs/vf_decimate.c b/libmpcodecs/vf_decimate.c
index 81b58cccb7..36afff3b7d 100644
--- a/libmpcodecs/vf_decimate.c
+++ b/libmpcodecs/vf_decimate.c
@@ -19,7 +19,7 @@ struct vf_priv_s {
int max, last, cnt;
};
-#ifdef HAVE_MMX
+#if HAVE_MMX
static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
{
volatile short out[4];
@@ -164,7 +164,7 @@ static int open(vf_instance_t *vf, char* args)
p->frac = 0.33;
if (args) sscanf(args, "%d:%d:%d:%f", &p->max, &p->hi, &p->lo, &p->frac);
diff = diff_C;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX) diff = diff_MMX;
#endif
return 1;
diff --git a/libmpcodecs/vf_divtc.c b/libmpcodecs/vf_divtc.c
index 307a14890d..f70d4802ec 100644
--- a/libmpcodecs/vf_divtc.c
+++ b/libmpcodecs/vf_divtc.c
@@ -33,7 +33,7 @@ struct vf_priv_s
* diff_MMX and diff_C stolen from vf_decimate.c
*/
-#ifdef HAVE_MMX
+#if HAVE_MMX
static int diff_MMX(unsigned char *old, unsigned char *new, int os, int ns)
{
volatile short out[4];
@@ -683,7 +683,7 @@ static int open(vf_instance_t *vf, char* args)
goto nomem;
diff=
-#ifdef HAVE_MMX
+#if HAVE_MMX
gCpuCaps.hasMMX?diff_MMX:
#endif
diff_C;
diff --git a/libmpcodecs/vf_eq.c b/libmpcodecs/vf_eq.c
index a0dc04ae39..d1183fc379 100644
--- a/libmpcodecs/vf_eq.c
+++ b/libmpcodecs/vf_eq.c
@@ -26,7 +26,7 @@ static struct vf_priv_s {
0
};
-#ifdef HAVE_MMX
+#if HAVE_MMX
static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, int sstride,
int w, int h, int brightness, int contrast)
{
@@ -215,7 +215,7 @@ static int open(vf_instance_t *vf, char* args)
if (args) sscanf(args, "%d:%d", &vf->priv->brightness, &vf->priv->contrast);
process = process_C;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX) process = process_MMX;
#endif
diff --git a/libmpcodecs/vf_eq2.c b/libmpcodecs/vf_eq2.c
index b3a501719f..ee66acde77 100644
--- a/libmpcodecs/vf_eq2.c
+++ b/libmpcodecs/vf_eq2.c
@@ -106,7 +106,7 @@ void create_lut (eq2_param_t *par)
par->lut_clean = 1;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
static
void affine_1d_MMX (eq2_param_t *par, unsigned char *dst, unsigned char *src,
unsigned w, unsigned h, unsigned dstride, unsigned sstride)
@@ -275,7 +275,7 @@ void check_values (eq2_param_t *par)
if ((par->c == 1.0) && (par->b == 0.0) && (par->g == 1.0)) {
par->adjust = NULL;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
else if (par->g == 1.0 && gCpuCaps.hasMMX) {
par->adjust = &affine_1d_MMX;
}
diff --git a/libmpcodecs/vf_filmdint.c b/libmpcodecs/vf_filmdint.c
index 5c022e5920..45e0907cc5 100644
--- a/libmpcodecs/vf_filmdint.c
+++ b/libmpcodecs/vf_filmdint.c
@@ -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;
-#ifndef HAVE_3DNOW
+#if !HAVE_3DNOW
mp_msg(MSGT_VFILTER, MSGL_FATAL, "block_metrics_3dnow: internal error\n");
#else
static const unsigned long long ones = 0x0101010101010101ull;
@@ -460,7 +460,7 @@ block_metrics_mmx2(unsigned char *a, unsigned char *b, int as, int bs,
int lines, struct vf_priv_s *p, struct frame_stats *s)
{
struct metrics tm;
-#ifndef HAVE_MMX
+#if !HAVE_MMX
mp_msg(MSGT_VFILTER, MSGL_FATAL, "block_metrics_mmx2: internal error\n");
#else
static const unsigned long long ones = 0x0101010101010101ull;
@@ -589,7 +589,7 @@ static inline int
dint_copy_line_mmx2(unsigned char *dst, unsigned char *a, long bos,
long cos, int ds, int ss, int w, int t)
{
-#ifndef HAVE_MMX
+#if !HAVE_MMX
mp_msg(MSGT_VFILTER, MSGL_FATAL, "dint_copy_line_mmx2: internal error\n");
return 0;
#else
@@ -1421,10 +1421,10 @@ static int open(vf_instance_t *vf, char* args)
}
if (p->mmx2 > 2)
p->mmx2 = 0;
-#ifndef HAVE_MMX
+#if !HAVE_MMX
p->mmx2 = 0;
#endif
-#ifndef HAVE_3DNOW
+#if !HAVE_3DNOW
p->mmx2 &= 1;
#endif
p->thres.odd = p->thres.even;
diff --git a/libmpcodecs/vf_fspp.c b/libmpcodecs/vf_fspp.c
index 46c8468745..7c42819d20 100644
--- a/libmpcodecs/vf_fspp.c
+++ b/libmpcodecs/vf_fspp.c
@@ -101,7 +101,7 @@ struct vf_priv_s { //align 16 !
};
-#ifndef HAVE_MMX
+#if !HAVE_MMX
//This func reads from 1 slice, 1 and clears 0 & 1
static void store_slice_c(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)
@@ -557,10 +557,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts)
}
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
return vf_next_put_image(vf,dmpi, pts);
@@ -702,7 +702,7 @@ const vf_info_t vf_info_fspp = {
#define THRESHOLD(r,x,t) if(((unsigned)((x)+t))>t*2) r=(x);else r=0;
#define DESCALE(x,n) (((x) + (1 << ((n)-1))) >> n)
-#ifdef HAVE_MMX
+#if HAVE_MMX
DECLARE_ASM_CONST(8, uint64_t, MM_FIX_0_382683433)=FIX64(0.382683433, 14);
DECLARE_ASM_CONST(8, uint64_t, MM_FIX_0_541196100)=FIX64(0.541196100, 14);
@@ -738,7 +738,7 @@ static const int16_t FIX_1_082392200=FIX(1.082392200, 13);
#endif
-#ifndef HAVE_MMX
+#if !HAVE_MMX
static void column_fidct_c(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt)
{
@@ -1598,7 +1598,7 @@ static void column_fidct_mmx(int16_t* thr_adr, DCTELEM *data, DCTELEM *output,
#endif // HAVE_MMX
-#ifndef HAVE_MMX
+#if !HAVE_MMX
static void row_idct_c(DCTELEM* workspace,
int16_t* output_adr, int output_stride, int cnt)
@@ -1867,7 +1867,7 @@ static void row_idct_mmx (DCTELEM* workspace,
#endif // HAVE_MMX
-#ifndef HAVE_MMX
+#if !HAVE_MMX
static void row_fdct_c(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt)
{
diff --git a/libmpcodecs/vf_halfpack.c b/libmpcodecs/vf_halfpack.c
index f15a9a439b..15997941f4 100644
--- a/libmpcodecs/vf_halfpack.c
+++ b/libmpcodecs/vf_halfpack.c
@@ -17,7 +17,7 @@ struct vf_priv_s {
int field;
};
-#ifdef HAVE_MMX
+#if HAVE_MMX
static void halfpack_MMX(unsigned char *dst, unsigned char *src[3],
int dststride, int srcstride[3],
int w, int h)
@@ -204,7 +204,7 @@ static int open(vf_instance_t *vf, char* args)
if (args) sscanf(args, "%d", &vf->priv->field);
halfpack = halfpack_C;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX) halfpack = halfpack_MMX;
#endif
return 1;
diff --git a/libmpcodecs/vf_hue.c b/libmpcodecs/vf_hue.c
index 04697ea537..b10626ddbc 100644
--- a/libmpcodecs/vf_hue.c
+++ b/libmpcodecs/vf_hue.c
@@ -160,7 +160,7 @@ static int open(vf_instance_t *vf, char* args)
vf->priv->hue *= M_PI / 180.0;
process = process_C;
-#ifdef HAVE_MMXX
+#if HAVE_MMXX
if(gCpuCaps.hasMMX) process = process_MMX;
#endif
diff --git a/libmpcodecs/vf_ilpack.c b/libmpcodecs/vf_ilpack.c
index 4b5612643d..f3ce051535 100644
--- a/libmpcodecs/vf_ilpack.c
+++ b/libmpcodecs/vf_ilpack.c
@@ -57,7 +57,7 @@ static void pack_li_1_C(unsigned char *dst, unsigned char *y,
}
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
unsigned char *u, unsigned char *v, int w)
{
@@ -93,7 +93,7 @@ static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
{
__asm__ volatile (""
"push %%"REG_BP" \n\t"
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
"mov %6, %%"REG_BP" \n\t"
#else
"movl 4(%%"REG_d"), %%"REG_BP" \n\t"
@@ -186,7 +186,7 @@ static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
"pop %%"REG_BP" \n\t"
:
: "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16),
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
"d" ((long)us), "r" ((long)vs)
#else
"d" (&us)
@@ -201,7 +201,7 @@ static void pack_li_1_MMX(unsigned char *dst, unsigned char *y,
{
__asm__ volatile (""
"push %%"REG_BP" \n\t"
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
"mov %6, %%"REG_BP" \n\t"
#else
"movl 4(%%"REG_d"), %%"REG_BP" \n\t"
@@ -298,7 +298,7 @@ static void pack_li_1_MMX(unsigned char *dst, unsigned char *y,
"pop %%"REG_BP" \n\t"
:
: "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16),
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
"d" ((long)us), "r" ((long)vs)
#else
"d" (&us)
@@ -396,7 +396,7 @@ static int open(vf_instance_t *vf, char* args)
pack_nn = (pack_func_t *)pack_nn_C;
pack_li_0 = pack_li_0_C;
pack_li_1 = pack_li_1_C;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX) {
pack_nn = (pack_func_t *)pack_nn_MMX;
pack_li_0 = pack_li_0_MMX;
diff --git a/libmpcodecs/vf_ivtc.c b/libmpcodecs/vf_ivtc.c
index 450ccb0a3c..222b9fec4e 100644
--- a/libmpcodecs/vf_ivtc.c
+++ b/libmpcodecs/vf_ivtc.c
@@ -40,7 +40,7 @@ enum {
F_SHOW
};
-#ifdef HAVE_MMX
+#if HAVE_MMX
static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char *new, int os, int ns)
{
int i;
@@ -516,7 +516,7 @@ static int open(vf_instance_t *vf, char* args)
p->first = 1;
if (args) sscanf(args, "%d", &p->drop);
block_diffs = block_diffs_C;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX) block_diffs = block_diffs_MMX;
#endif
return 1;
diff --git a/libmpcodecs/vf_noise.c b/libmpcodecs/vf_noise.c
index 02fe9d9e16..aab612c2b8 100644
--- a/libmpcodecs/vf_noise.c
+++ b/libmpcodecs/vf_noise.c
@@ -145,7 +145,7 @@ static int8_t *initNoise(FilterParam *fp){
/***************************************************************************/
-#ifdef HAVE_MMX
+#if HAVE_MMX
static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
long mmx_len= len&(~7);
noise+=shift;
@@ -174,7 +174,7 @@ static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int
#endif
//duplicate of previous except movntq
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
static inline void lineNoise_MMX2(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
long mmx_len= len&(~7);
noise+=shift;
@@ -216,7 +216,7 @@ static inline void lineNoise_C(uint8_t *dst, uint8_t *src, int8_t *noise, int le
/***************************************************************************/
-#ifdef HAVE_MMX
+#if HAVE_MMX
static inline void lineNoiseAvg_MMX(uint8_t *dst, uint8_t *src, int len, int8_t **shift){
long mmx_len= len&(~7);
@@ -356,10 +356,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
vf_clone_mpi_attributes(dmpi, mpi);
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
@@ -447,13 +447,13 @@ static int open(vf_instance_t *vf, char* args){
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX){
lineNoise= lineNoise_MMX;
lineNoiseAvg= lineNoiseAvg_MMX;
}
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
if(gCpuCaps.hasMMX2) lineNoise= lineNoise_MMX2;
// if(gCpuCaps.hasMMX) lineNoiseAvg= lineNoiseAvg_MMX2;
#endif
diff --git a/libmpcodecs/vf_pp7.c b/libmpcodecs/vf_pp7.c
index 4221625abf..31d6d653b4 100644
--- a/libmpcodecs/vf_pp7.c
+++ b/libmpcodecs/vf_pp7.c
@@ -155,7 +155,7 @@ static void dctB_c(DCTELEM *dst, DCTELEM *src){
}
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
static void dctB_mmx(DCTELEM *dst, DCTELEM *src){
__asm__ volatile (
"movq (%0), %%mm0 \n\t"
@@ -397,10 +397,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
@@ -464,7 +464,7 @@ static int open(vf_instance_t *vf, char* args){
case 2: requantize= mediumthresh_c; break;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX){
dctB= dctB_mmx;
}
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c
index 02cd1ac919..fd1c6ee7f3 100644
--- a/libmpcodecs/vf_scale.c
+++ b/libmpcodecs/vf_scale.c
@@ -555,7 +555,7 @@ void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, Sw
static int firstTime=1;
*flags=0;
-#ifdef ARCH_X86
+#if ARCH_X86
if(gCpuCaps.hasMMX)
__asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
#endif
diff --git a/libmpcodecs/vf_spp.c b/libmpcodecs/vf_spp.c
index 11a7cae1ff..50969c13fb 100644
--- a/libmpcodecs/vf_spp.c
+++ b/libmpcodecs/vf_spp.c
@@ -146,7 +146,7 @@ static void softthresh_c(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *perm
}
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
static void hardthresh_mmx(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation){
int bias= 0; //FIXME
unsigned int threshold1;
@@ -327,7 +327,7 @@ static void store_slice_c(uint8_t *dst, int16_t *src, int dst_stride, int src_st
}
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
static void store_slice_mmx(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale){
int y;
@@ -499,10 +499,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
}
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
@@ -589,7 +589,7 @@ static int open(vf_instance_t *vf, char* args){
case 1: requantize= softthresh_c; break;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX){
store_slice= store_slice_mmx;
switch(vf->priv->mode&3){
diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c
index 347cd4bb9e..0ebf41ddb2 100644
--- a/libmpcodecs/vf_tfields.c
+++ b/libmpcodecs/vf_tfields.c
@@ -47,7 +47,7 @@ static void deint(unsigned char *dest, int ds, unsigned char *src, int ss, int w
}
}
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
static void qpel_li_3DNOW(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
{
int i, j, ssd=ss;
@@ -83,7 +83,7 @@ static void qpel_li_3DNOW(unsigned char *d, unsigned char *s, int w, int h, int
}
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
static void qpel_li_MMX2(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
{
int i, j, ssd=ss;
@@ -120,7 +120,7 @@ static void qpel_li_MMX2(unsigned char *d, unsigned char *s, int w, int h, int d
}
#endif
-#ifdef HAVE_MMX
+#if HAVE_MMX
static void qpel_li_MMX(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
{
int i, j, ssd=ss;
@@ -480,14 +480,14 @@ static int open(vf_instance_t *vf, char* args)
if (args) sscanf(args, "%d:%d", &vf->priv->mode, &vf->priv->parity);
qpel_li = qpel_li_C;
qpel_4tap = qpel_4tap_C;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX) qpel_li = qpel_li_MMX;
if(gCpuCaps.hasMMX) qpel_4tap = qpel_4tap_MMX;
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
if(gCpuCaps.hasMMX2) qpel_li = qpel_li_MMX2;
#endif
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
if(gCpuCaps.has3DNow) qpel_li = qpel_li_3DNOW;
#endif
return 1;
diff --git a/libmpcodecs/vf_unsharp.c b/libmpcodecs/vf_unsharp.c
index 40111fafcc..9f2a7d4b98 100644
--- a/libmpcodecs/vf_unsharp.c
+++ b/libmpcodecs/vf_unsharp.c
@@ -192,11 +192,11 @@ static int put_image( struct vf_instance* vf, mp_image_t *mpi, double pts) {
vf_clone_mpi_attributes(dmpi, mpi);
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX)
__asm__ volatile ("emms\n\t");
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
if(gCpuCaps.hasMMX2)
__asm__ volatile ("sfence\n\t");
#endif
diff --git a/libmpcodecs/vf_uspp.c b/libmpcodecs/vf_uspp.c
index 04a42a2b9e..a0fca1503b 100644
--- a/libmpcodecs/vf_uspp.c
+++ b/libmpcodecs/vf_uspp.c
@@ -291,10 +291,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
}
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(gCpuCaps.hasMMX) __asm__ volatile ("emms\n\t");
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
if(gCpuCaps.hasMMX2) __asm__ volatile ("sfence\n\t");
#endif
@@ -370,7 +370,7 @@ static int open(vf_instance_t *vf, char* args){
if(vf->priv->qp < 0)
vf->priv->qp = 0;
-// #ifdef HAVE_MMX
+// #if HAVE_MMX
// if(gCpuCaps.hasMMX){
// store_slice= store_slice_mmx;
// }
diff --git a/libmpcodecs/vf_yadif.c b/libmpcodecs/vf_yadif.c
index 2c80a2ec5b..6f324dc4fa 100644
--- a/libmpcodecs/vf_yadif.c
+++ b/libmpcodecs/vf_yadif.c
@@ -69,7 +69,7 @@ static void store_ref(struct vf_priv_s *p, uint8_t *src[3], int src_stride[3], i
}
}
-#if defined(HAVE_MMX) && defined(NAMED_ASM_ARGS)
+#if HAVE_MMX && defined(NAMED_ASM_ARGS)
#define LOAD4(mem,dst) \
"movd "mem", "#dst" \n\t"\
@@ -282,7 +282,7 @@ static void filter_line_mmx2(struct vf_priv_s *p, uint8_t *dst, uint8_t *prev, u
#undef CHECK2
#undef FILTER
-#endif /* defined(HAVE_MMX) && defined(NAMED_ASM_ARGS) */
+#endif /* HAVE_MMX && defined(NAMED_ASM_ARGS) */
static void filter_line_c(struct vf_priv_s *p, uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int refs, int parity){
int x;
@@ -364,7 +364,7 @@ static void filter(struct vf_priv_s *p, uint8_t *dst[3], int dst_stride[3], int
}
}
}
-#if defined(HAVE_MMX) && defined(NAMED_ASM_ARGS)
+#if HAVE_MMX && defined(NAMED_ASM_ARGS)
if(gCpuCaps.hasMMX2) __asm__ volatile("emms \n\t" : : : "memory");
#endif
}
@@ -503,7 +503,7 @@ static int open(vf_instance_t *vf, char* args){
if (args) sscanf(args, "%d:%d", &vf->priv->mode, &vf->priv->parity);
filter_line = filter_line_c;
-#if defined(HAVE_MMX) && defined(NAMED_ASM_ARGS)
+#if HAVE_MMX && defined(NAMED_ASM_ARGS)
if(gCpuCaps.hasMMX2) filter_line = filter_line_mmx2;
#endif
diff --git a/libmpdemux/asfguid.h b/libmpdemux/asfguid.h
index e9b8b08567..f5a9989e9f 100644
--- a/libmpdemux/asfguid.h
+++ b/libmpdemux/asfguid.h
@@ -26,7 +26,7 @@
#include "mpbswap.h"
-#ifdef ARCH_X86
+#if ARCH_X86
#define ASF_LOAD_GUID_PREFIX(guid) (*(uint32_t *)(guid))
#else
#define ASF_LOAD_GUID_PREFIX(guid) AV_RL32(guid)
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index 1179369847..047315e74c 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -261,7 +261,7 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) {
sh_audio->audio.dwScale= codec->block_align ? codec->block_align*8 : 8;
sh_audio->audio.dwRate = codec->bit_rate;
}
- g= ff_gcd(sh_audio->audio.dwScale, sh_audio->audio.dwRate);
+ g= av_gcd(sh_audio->audio.dwScale, sh_audio->audio.dwRate);
sh_audio->audio.dwScale /= g;
sh_audio->audio.dwRate /= g;
// printf("sca:%d rat:%d fs:%d sr:%d ba:%d\n", sh_audio->audio.dwScale, sh_audio->audio.dwRate, codec->frame_size, codec->sample_rate, codec->block_align);
diff --git a/libmpeg2/cpu_accel.c b/libmpeg2/cpu_accel.c
index 104ac2cfdf..f711f3282c 100644
--- a/libmpeg2/cpu_accel.c
+++ b/libmpeg2/cpu_accel.c
@@ -35,7 +35,7 @@
#include "cpudetect.h"
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
static inline uint32_t arch_accel (uint32_t accel)
{
/* Use MPlayer CPU detection instead of libmpeg2 variant. */
@@ -150,7 +150,7 @@ static inline uint32_t arch_accel (uint32_t accel)
}
#endif /* ARCH_X86 || ARCH_X86_64 */
-#if defined(ACCEL_DETECT) && (defined(ARCH_PPC) || defined(ARCH_SPARC))
+#if defined(ACCEL_DETECT) && (ARCH_PPC || ARCH_SPARC)
#include <signal.h>
#include <setjmp.h>
@@ -169,7 +169,7 @@ static RETSIGTYPE sigill_handler (int sig)
}
#endif /* ACCEL_DETECT && (ARCH_PPC || ARCH_SPARC) */
-#ifdef ARCH_PPC
+#if ARCH_PPC
static uint32_t arch_accel (uint32_t accel)
{
#ifdef ACCEL_DETECT
@@ -206,7 +206,7 @@ static uint32_t arch_accel (uint32_t accel)
}
#endif /* ARCH_PPC */
-#ifdef ARCH_SPARC
+#if ARCH_SPARC
static uint32_t arch_accel (uint32_t accel)
{
if (accel & MPEG2_ACCEL_SPARC_VIS2)
@@ -252,7 +252,7 @@ static uint32_t arch_accel (uint32_t accel)
}
#endif /* ARCH_SPARC */
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
static inline uint32_t arch_accel (uint32_t accel)
{
if (accel & MPEG2_ACCEL_ALPHA_MVI)
@@ -276,7 +276,7 @@ static inline uint32_t arch_accel (uint32_t accel)
uint32_t mpeg2_detect_accel (uint32_t accel)
{
-#if defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC)
+#if ARCH_X86 || ARCH_X86_64 || ARCH_PPC || ARCH_ALPHA || ARCH_SPARC
accel = arch_accel (accel);
#endif
return accel;
diff --git a/libmpeg2/cpu_state.c b/libmpeg2/cpu_state.c
index 2f2f64a987..d82b6738a7 100644
--- a/libmpeg2/cpu_state.c
+++ b/libmpeg2/cpu_state.c
@@ -29,21 +29,21 @@
#include "mpeg2.h"
#include "attributes.h"
#include "mpeg2_internal.h"
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
#include "mmx.h"
#endif
void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL;
void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL;
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
static void state_restore_mmx (cpu_state_t * state)
{
emms ();
}
#endif
-#ifdef ARCH_PPC
+#if ARCH_PPC
#if defined(__APPLE_CC__) /* apple */
#define LI(a,b) "li r" #a "," #b "\n\t"
#define STVX0(a,b,c) "stvx v" #a ",0,r" #c "\n\t"
@@ -115,12 +115,12 @@ static void state_restore_altivec (cpu_state_t * state)
void mpeg2_cpu_state_init (uint32_t accel)
{
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
if (accel & MPEG2_ACCEL_X86_MMX) {
mpeg2_cpu_state_restore = state_restore_mmx;
}
#endif
-#ifdef ARCH_PPC
+#if ARCH_PPC
if (accel & MPEG2_ACCEL_PPC_ALTIVEC) {
mpeg2_cpu_state_save = state_save_altivec;
mpeg2_cpu_state_restore = state_restore_altivec;
diff --git a/libmpeg2/idct.c b/libmpeg2/idct.c
index e753053354..09a81159eb 100644
--- a/libmpeg2/idct.c
+++ b/libmpeg2/idct.c
@@ -239,7 +239,7 @@ static void mpeg2_idct_add_c (const int last, int16_t * block,
void mpeg2_idct_init (uint32_t accel)
{
-#ifdef HAVE_SSE2
+#if HAVE_SSE2
if (accel & MPEG2_ACCEL_X86_SSE2) {
mpeg2_idct_copy = mpeg2_idct_copy_sse2;
mpeg2_idct_add = mpeg2_idct_add_sse2;
@@ -258,14 +258,14 @@ void mpeg2_idct_init (uint32_t accel)
mpeg2_idct_mmx_init ();
} else
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if (accel & MPEG2_ACCEL_PPC_ALTIVEC) {
mpeg2_idct_copy = mpeg2_idct_copy_altivec;
mpeg2_idct_add = mpeg2_idct_add_altivec;
mpeg2_idct_altivec_init ();
} else
#endif
-#ifdef HAVE_MVI
+#if HAVE_MVI
if (accel & MPEG2_ACCEL_ALPHA_MVI) {
mpeg2_idct_copy = mpeg2_idct_copy_mvi;
mpeg2_idct_add = mpeg2_idct_add_mvi;
diff --git a/libmpeg2/idct_alpha.c b/libmpeg2/idct_alpha.c
index bc2f886492..e5886ed3ff 100644
--- a/libmpeg2/idct_alpha.c
+++ b/libmpeg2/idct_alpha.c
@@ -24,7 +24,7 @@
#include "config.h"
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
#include <stdlib.h>
#include <inttypes.h>
diff --git a/libmpeg2/idct_altivec.c b/libmpeg2/idct_altivec.c
index b5b395a205..1403eeac87 100644
--- a/libmpeg2/idct_altivec.c
+++ b/libmpeg2/idct_altivec.c
@@ -23,7 +23,7 @@
#include "config.h"
-#ifdef ARCH_PPC
+#if ARCH_PPC
#ifdef HAVE_ALTIVEC_H
#include <altivec.h>
diff --git a/libmpeg2/idct_mmx.c b/libmpeg2/idct_mmx.c
index 50f8f18c3e..fe6215b20d 100644
--- a/libmpeg2/idct_mmx.c
+++ b/libmpeg2/idct_mmx.c
@@ -23,7 +23,7 @@
#include "config.h"
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
#include <inttypes.h>
diff --git a/libmpeg2/motion_comp.c b/libmpeg2/motion_comp.c
index d5934cd53b..9ef39290e5 100644
--- a/libmpeg2/motion_comp.c
+++ b/libmpeg2/motion_comp.c
@@ -37,37 +37,37 @@ mpeg2_mc_t mpeg2_mc;
void mpeg2_mc_init (uint32_t accel)
{
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
if (accel & MPEG2_ACCEL_X86_MMXEXT)
mpeg2_mc = mpeg2_mc_mmxext;
else
#endif
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
if (accel & MPEG2_ACCEL_X86_3DNOW)
mpeg2_mc = mpeg2_mc_3dnow;
else
#endif
-#ifdef HAVE_MMX
+#if HAVE_MMX
if (accel & MPEG2_ACCEL_X86_MMX)
mpeg2_mc = mpeg2_mc_mmx;
else
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if (accel & MPEG2_ACCEL_PPC_ALTIVEC)
mpeg2_mc = mpeg2_mc_altivec;
else
#endif
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
if (accel & MPEG2_ACCEL_ALPHA)
mpeg2_mc = mpeg2_mc_alpha;
else
#endif
-#ifdef HAVE_VIS
+#if HAVE_VIS
if (accel & MPEG2_ACCEL_SPARC_VIS)
mpeg2_mc = mpeg2_mc_vis;
else
#endif
-#ifdef ARCH_ARM
+#if ARCH_ARM
if (accel & MPEG2_ACCEL_ARM)
mpeg2_mc = mpeg2_mc_arm;
else
diff --git a/libmpeg2/motion_comp_alpha.c b/libmpeg2/motion_comp_alpha.c
index 05cd550841..a7f33d3914 100644
--- a/libmpeg2/motion_comp_alpha.c
+++ b/libmpeg2/motion_comp_alpha.c
@@ -22,7 +22,7 @@
#include "config.h"
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
#include <inttypes.h>
diff --git a/libmpeg2/motion_comp_altivec.c b/libmpeg2/motion_comp_altivec.c
index 4356aa6e78..f98aaedc90 100644
--- a/libmpeg2/motion_comp_altivec.c
+++ b/libmpeg2/motion_comp_altivec.c
@@ -23,7 +23,7 @@
#include "config.h"
-#ifdef ARCH_PPC
+#if ARCH_PPC
#ifdef HAVE_ALTIVEC_H
#include <altivec.h>
diff --git a/libmpeg2/motion_comp_arm.c b/libmpeg2/motion_comp_arm.c
index 0111f7f8d3..f783434a30 100644
--- a/libmpeg2/motion_comp_arm.c
+++ b/libmpeg2/motion_comp_arm.c
@@ -22,7 +22,7 @@
#include "config.h"
-#ifdef ARCH_ARM
+#if ARCH_ARM
#include <inttypes.h>
diff --git a/libmpeg2/motion_comp_mmx.c b/libmpeg2/motion_comp_mmx.c
index fc265f4f99..b550f8c7c9 100644
--- a/libmpeg2/motion_comp_mmx.c
+++ b/libmpeg2/motion_comp_mmx.c
@@ -23,7 +23,7 @@
#include "config.h"
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if ARCH_X86 || ARCH_X86_64
#include <inttypes.h>
diff --git a/libmpeg2/motion_comp_vis.c b/libmpeg2/motion_comp_vis.c
index 54c0f7e758..f6f3a315ee 100644
--- a/libmpeg2/motion_comp_vis.c
+++ b/libmpeg2/motion_comp_vis.c
@@ -22,7 +22,7 @@
#include "config.h"
-#ifdef ARCH_SPARC
+#if ARCH_SPARC
#include <inttypes.h>
diff --git a/libmpeg2/mpeg2_internal.h b/libmpeg2/mpeg2_internal.h
index 2a651be571..73cbfb15ce 100644
--- a/libmpeg2/mpeg2_internal.h
+++ b/libmpeg2/mpeg2_internal.h
@@ -238,7 +238,7 @@ struct mpeg2dec_s {
};
typedef struct {
-#ifdef ARCH_PPC
+#if ARCH_PPC
uint8_t regv[12*16];
#endif
int dummy;
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index ac452a008a..5b79fea761 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -88,7 +88,7 @@ void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *sr
long srcStride1, long srcStride2,
long srcStride3, long dstStride);
-#if defined(ARCH_X86) && defined(CONFIG_GPL)
+#if ARCH_X86 && CONFIG_GPL
DECLARE_ASM_CONST(8, uint64_t, mmx_null) = 0x0000000000000000ULL;
DECLARE_ASM_CONST(8, uint64_t, mmx_one) = 0xFFFFFFFFFFFFFFFFULL;
DECLARE_ASM_CONST(8, uint64_t, mask32b) = 0x000000FF000000FFULL;
@@ -122,7 +122,7 @@ DECLARE_ASM_CONST(8, uint64_t, blue_16mask) = 0x0000001f0000001fULL;
DECLARE_ASM_CONST(8, uint64_t, red_15mask) = 0x00007c0000007c00ULL;
DECLARE_ASM_CONST(8, uint64_t, green_15mask) = 0x000003e0000003e0ULL;
DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
-#endif /* defined(ARCH_X86) */
+#endif /* ARCH_X86 */
#define RGB2YUV_SHIFT 8
#define BY ((int)( 0.098*(1<<RGB2YUV_SHIFT)+0.5))
@@ -141,35 +141,35 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
#undef HAVE_MMX2
#undef HAVE_3DNOW
#undef HAVE_SSE2
+#define HAVE_MMX 0
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
+#define HAVE_SSE2 0
#define RENAME(a) a ## _C
#include "rgb2rgb_template.c"
-#if defined(ARCH_X86) && defined(CONFIG_GPL)
+#if ARCH_X86 && CONFIG_GPL
//MMX versions
#undef RENAME
-#define HAVE_MMX
-#undef HAVE_MMX2
-#undef HAVE_3DNOW
-#undef HAVE_SSE2
+#undef HAVE_MMX
+#define HAVE_MMX 1
#define RENAME(a) a ## _MMX
#include "rgb2rgb_template.c"
//MMX2 versions
#undef RENAME
-#define HAVE_MMX
-#define HAVE_MMX2
-#undef HAVE_3DNOW
-#undef HAVE_SSE2
+#undef HAVE_MMX2
+#define HAVE_MMX2 1
#define RENAME(a) a ## _MMX2
#include "rgb2rgb_template.c"
//3DNOW versions
#undef RENAME
-#define HAVE_MMX
#undef HAVE_MMX2
-#define HAVE_3DNOW
-#undef HAVE_SSE2
+#undef HAVE_3DNOW
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 1
#define RENAME(a) a ## _3DNOW
#include "rgb2rgb_template.c"
@@ -183,7 +183,7 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
*/
void sws_rgb2rgb_init(int flags){
-#if (defined(HAVE_MMX2) || defined(HAVE_3DNOW) || defined(HAVE_MMX)) && defined(CONFIG_GPL)
+#if (HAVE_MMX2 || HAVE_3DNOW || HAVE_MMX) && CONFIG_GPL
if (flags & SWS_CPU_CAPS_MMX2)
rgb2rgb_init_MMX2();
else if (flags & SWS_CPU_CAPS_3DNOW)
@@ -191,7 +191,7 @@ void sws_rgb2rgb_init(int flags){
else if (flags & SWS_CPU_CAPS_MMX)
rgb2rgb_init_MMX();
else
-#endif /* defined(HAVE_MMX2) || defined(HAVE_3DNOW) || defined(HAVE_MMX) */
+#endif /* HAVE_MMX2 || HAVE_3DNOW || HAVE_MMX */
rgb2rgb_init_C();
}
diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c
index ce76c5eb7e..b988ca0465 100644
--- a/libswscale/rgb2rgb_template.c
+++ b/libswscale/rgb2rgb_template.c
@@ -37,17 +37,17 @@
#undef PREFETCHW
#undef PAVGB
-#ifdef HAVE_SSE2
+#if HAVE_SSE2
#define MMREG_SIZE 16
#else
#define MMREG_SIZE 8
#endif
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
#define PREFETCH "prefetch"
#define PREFETCHW "prefetchw"
#define PAVGB "pavgusb"
-#elif defined (HAVE_MMX2)
+#elif HAVE_MMX2
#define PREFETCH "prefetchnta"
#define PREFETCHW "prefetcht0"
#define PAVGB "pavgb"
@@ -56,14 +56,14 @@
#define PREFETCHW " # nop"
#endif
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
/* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */
#define EMMS "femms"
#else
#define EMMS "emms"
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
#define MOVNTQ "movntq"
#define SFENCE "sfence"
#else
@@ -76,11 +76,11 @@ static inline void RENAME(rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long s
uint8_t *dest = dst;
const uint8_t *s = src;
const uint8_t *end;
- #ifdef HAVE_MMX
+ #if HAVE_MMX
const uint8_t *mm_end;
#endif
end = s + src_size;
- #ifdef HAVE_MMX
+ #if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
mm_end = end - 23;
__asm__ volatile("movq %0, %%mm7"::"m"(mask32):"memory");
@@ -136,11 +136,11 @@ static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long s
uint8_t *dest = dst;
const uint8_t *s = src;
const uint8_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint8_t *mm_end;
#endif
end = s + src_size;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
mm_end = end - 31;
while (s < mm_end)
@@ -230,7 +230,7 @@ static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, long src_
register const uint8_t *end;
const uint8_t *mm_end;
end = s + src_size;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*s));
__asm__ volatile("movq %0, %%mm4"::"m"(mask15s));
mm_end = end - 15;
@@ -279,7 +279,7 @@ static inline void RENAME(rgb16to15)(const uint8_t *src, uint8_t *dst, long src_
register const uint8_t *end;
const uint8_t *mm_end;
end = s + src_size;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*s));
__asm__ volatile("movq %0, %%mm7"::"m"(mask15rg));
__asm__ volatile("movq %0, %%mm6"::"m"(mask15b));
@@ -332,12 +332,12 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long src_
{
const uint8_t *s = src;
const uint8_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint8_t *mm_end;
#endif
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
-#ifdef HAVE_MMX
+#if HAVE_MMX
mm_end = end - 15;
#if 1 //is faster only if multiplies are reasonably fast (FIXME figure out on which CPUs this is faster, on Athlon it is slightly faster)
__asm__ volatile(
@@ -430,12 +430,12 @@ static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long s
{
const uint8_t *s = src;
const uint8_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint8_t *mm_end;
#endif
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
@@ -491,12 +491,12 @@ static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_
{
const uint8_t *s = src;
const uint8_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint8_t *mm_end;
#endif
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
-#ifdef HAVE_MMX
+#if HAVE_MMX
mm_end = end - 15;
#if 1 //is faster only if multiplies are reasonably fast (FIXME figure out on which CPUs this is faster, on Athlon it is slightly faster)
__asm__ volatile(
@@ -589,12 +589,12 @@ static inline void RENAME(rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long s
{
const uint8_t *s = src;
const uint8_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint8_t *mm_end;
#endif
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
@@ -650,12 +650,12 @@ static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long s
{
const uint8_t *s = src;
const uint8_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint8_t *mm_end;
#endif
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
@@ -713,12 +713,12 @@ static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, long src_
{
const uint8_t *s = src;
const uint8_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint8_t *mm_end;
#endif
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
@@ -776,12 +776,12 @@ static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long s
{
const uint8_t *s = src;
const uint8_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint8_t *mm_end;
#endif
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
@@ -839,12 +839,12 @@ static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, long src_
{
const uint8_t *s = src;
const uint8_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint8_t *mm_end;
#endif
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
"movq %0, %%mm7 \n\t"
@@ -922,13 +922,13 @@ static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, long src_
static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long src_size)
{
const uint16_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint16_t *mm_end;
#endif
uint8_t *d = dst;
const uint16_t *s = (const uint16_t*)src;
end = s + src_size/2;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
mm_end = end - 7;
while (s < mm_end)
@@ -1064,13 +1064,13 @@ static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long s
static inline void RENAME(rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long src_size)
{
const uint16_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint16_t *mm_end;
#endif
uint8_t *d = (uint8_t *)dst;
const uint16_t *s = (const uint16_t *)src;
end = s + src_size/2;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
mm_end = end - 7;
while (s < mm_end)
@@ -1205,13 +1205,13 @@ static inline void RENAME(rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long s
static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, long src_size)
{
const uint16_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint16_t *mm_end;
#endif
uint8_t *d = dst;
const uint16_t *s = (const uint16_t *)src;
end = s + src_size/2;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
__asm__ volatile("pxor %%mm7,%%mm7 \n\t":::"memory");
mm_end = end - 3;
@@ -1283,13 +1283,13 @@ static inline void RENAME(rgb15to32)(const uint8_t *src, uint8_t *dst, long src_
static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, long src_size)
{
const uint16_t *end;
-#ifdef HAVE_MMX
+#if HAVE_MMX
const uint16_t *mm_end;
#endif
uint8_t *d = dst;
const uint16_t *s = (const uint16_t*)src;
end = s + src_size/2;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*s):"memory");
__asm__ volatile("pxor %%mm7,%%mm7 \n\t":::"memory");
mm_end = end - 3;
@@ -1357,7 +1357,7 @@ static inline void RENAME(rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long s
long idx = 15 - src_size;
const uint8_t *s = src-idx;
uint8_t *d = dst-idx;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
"test %0, %0 \n\t"
"jns 2f \n\t"
@@ -1371,7 +1371,7 @@ static inline void RENAME(rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long s
PREFETCH" 32(%1, %0) \n\t"
"movq (%1, %0), %%mm0 \n\t"
"movq 8(%1, %0), %%mm1 \n\t"
-# ifdef HAVE_MMX2
+# if HAVE_MMX2
"pshufw $177, %%mm0, %%mm3 \n\t"
"pshufw $177, %%mm1, %%mm5 \n\t"
"pand %%mm7, %%mm0 \n\t"
@@ -1419,7 +1419,7 @@ static inline void RENAME(rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long s
static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size)
{
unsigned i;
-#ifdef HAVE_MMX
+#if HAVE_MMX
long mmx_size= 23 - src_size;
__asm__ volatile (
"test %%"REG_a", %%"REG_a" \n\t"
@@ -1494,7 +1494,7 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u
const long chromWidth= width>>1;
for (y=0; y<height; y++)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
//FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway)
__asm__ volatile(
"xor %%"REG_a", %%"REG_a" \n\t"
@@ -1531,7 +1531,7 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u
);
#else
-#if defined ARCH_ALPHA && defined HAVE_MVI
+#if ARCH_ALPHA && HAVE_MVI
#define pl2yuy2(n) \
y1 = yc[n]; \
y2 = yc2[n]; \
@@ -1619,7 +1619,7 @@ static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *u
ysrc += lumStride;
dst += dstStride;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__( EMMS" \n\t"
SFENCE" \n\t"
:::"memory");
@@ -1646,7 +1646,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u
const long chromWidth= width>>1;
for (y=0; y<height; y++)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
//FIXME handle 2 lines at once (fewer prefetches, reuse some chroma, but very likely memory-limited anyway)
__asm__ volatile(
"xor %%"REG_a", %%"REG_a" \n\t"
@@ -1725,7 +1725,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u
ysrc += lumStride;
dst += dstStride;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__( EMMS" \n\t"
SFENCE" \n\t"
:::"memory");
@@ -1776,7 +1776,7 @@ static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
const long chromWidth= width>>1;
for (y=0; y<height; y+=2)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
"xor %%"REG_a", %%"REG_a" \n\t"
"pcmpeqw %%mm7, %%mm7 \n\t"
@@ -1881,7 +1881,7 @@ static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
ydst += lumStride;
src += srcStride;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile( EMMS" \n\t"
SFENCE" \n\t"
:::"memory");
@@ -1914,7 +1914,7 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWi
dst+= dstStride;
for (y=1; y<srcHeight; y++){
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
+#if HAVE_MMX2 || HAVE_3DNOW
const long mmxSize= srcWidth&~15;
__asm__ volatile(
"mov %4, %%"REG_a" \n\t"
@@ -1993,7 +1993,7 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, long srcWi
}
#endif
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile( EMMS" \n\t"
SFENCE" \n\t"
:::"memory");
@@ -2014,7 +2014,7 @@ static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
const long chromWidth= width>>1;
for (y=0; y<height; y+=2)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
"xor %%"REG_a", %%"REG_a" \n\t"
"pcmpeqw %%mm7, %%mm7 \n\t"
@@ -2119,7 +2119,7 @@ static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t
ydst += lumStride;
src += srcStride;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile( EMMS" \n\t"
SFENCE" \n\t"
:::"memory");
@@ -2139,7 +2139,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
{
long y;
const long chromWidth= width>>1;
-#ifdef HAVE_MMX
+#if HAVE_MMX
for (y=0; y<height-2; y+=2)
{
long i;
@@ -2229,7 +2229,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
"1: \n\t"
PREFETCH" 64(%0, %%"REG_d") \n\t"
PREFETCH" 64(%1, %%"REG_d") \n\t"
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
+#if HAVE_MMX2 || HAVE_3DNOW
"movq (%0, %%"REG_d"), %%mm0 \n\t"
"movq (%1, %%"REG_d"), %%mm1 \n\t"
"movq 6(%0, %%"REG_d"), %%mm2 \n\t"
@@ -2290,7 +2290,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
"packssdw %%mm1, %%mm0 \n\t" // V1 V0 U1 U0
"psraw $7, %%mm0 \n\t"
-#if defined (HAVE_MMX2) || defined (HAVE_3DNOW)
+#if HAVE_MMX2 || HAVE_3DNOW
"movq 12(%0, %%"REG_d"), %%mm4 \n\t"
"movq 12(%1, %%"REG_d"), %%mm1 \n\t"
"movq 18(%0, %%"REG_d"), %%mm2 \n\t"
@@ -2438,8 +2438,8 @@ static void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
{
long w;
-#ifdef HAVE_MMX
-#ifdef HAVE_SSE2
+#if HAVE_MMX
+#if HAVE_SSE2
__asm__(
"xor %%"REG_a", %%"REG_a" \n\t"
"1: \n\t"
@@ -2501,7 +2501,7 @@ static void RENAME(interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dest,
src1 += src1Stride;
src2 += src2Stride;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__(
EMMS" \n\t"
SFENCE" \n\t"
@@ -2518,7 +2518,7 @@ static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
{
long y,x,w,h;
w=width/2; h=height/2;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
PREFETCH" %0 \n\t"
PREFETCH" %1 \n\t"
@@ -2528,7 +2528,7 @@ static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
const uint8_t* s1=src1+srcStride1*(y>>1);
uint8_t* d=dst1+dstStride1*y;
x=0;
-#ifdef HAVE_MMX
+#if HAVE_MMX
for (;x<w-31;x+=32)
{
__asm__ volatile(
@@ -2568,7 +2568,7 @@ static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
const uint8_t* s2=src2+srcStride2*(y>>1);
uint8_t* d=dst2+dstStride2*y;
x=0;
-#ifdef HAVE_MMX
+#if HAVE_MMX
for (;x<w-31;x+=32)
{
__asm__ volatile(
@@ -2604,7 +2604,7 @@ static inline void RENAME(vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
#endif
for (;x<w;x++) d[2*x]=d[2*x+1]=s2[x];
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__(
EMMS" \n\t"
SFENCE" \n\t"
@@ -2627,7 +2627,7 @@ static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2
const uint8_t* vp=src3+srcStride3*(y>>2);
uint8_t* d=dst+dstStride*y;
x=0;
-#ifdef HAVE_MMX
+#if HAVE_MMX
for (;x<w-7;x+=8)
{
__asm__ volatile(
@@ -2695,7 +2695,7 @@ static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2
d[8*x+7] = vp[x];
}
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__(
EMMS" \n\t"
SFENCE" \n\t"
diff --git a/libswscale/swscale-example.c b/libswscale/swscale-example.c
index d1189b2745..90c3ce39ab 100644
--- a/libswscale/swscale-example.c
+++ b/libswscale/swscale-example.c
@@ -118,7 +118,7 @@ static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat
sws_scale(dstContext, src, srcStride, 0, srcH, dst, dstStride);
sws_scale(outContext, dst, dstStride, 0, dstH, out, refStride);
-#if defined(ARCH_X86)
+#if ARCH_X86
__asm__ volatile ("emms\n\t");
#endif
@@ -208,7 +208,7 @@ int main(int argc, char **argv){
}
sws_scale(sws, rgb_src, rgb_stride, 0, H, src, stride);
-#if defined(ARCH_X86)
+#if ARCH_X86
__asm__ volatile ("emms\n\t");
#endif
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index cfa3580cbc..52b709aaa0 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -62,7 +62,7 @@ untested special converters
#include <unistd.h>
#include "config.h"
#include <assert.h>
-#ifdef HAVE_SYS_MMAN_H
+#if HAVE_SYS_MMAN_H
#include <sys/mman.h>
#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
#define MAP_ANONYMOUS MAP_ANON
@@ -202,7 +202,7 @@ add BGR4 output support
write special BGR->BGR scaler
*/
-#if defined(ARCH_X86) && defined (CONFIG_GPL)
+#if ARCH_X86 && CONFIG_GPL
DECLARE_ASM_CONST(8, uint64_t, bF8)= 0xF8F8F8F8F8F8F8F8LL;
DECLARE_ASM_CONST(8, uint64_t, bFC)= 0xFCFCFCFCFCFCFCFCLL;
DECLARE_ASM_CONST(8, uint64_t, w10)= 0x0010001000100010LL;
@@ -257,7 +257,7 @@ DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUV[2][4]) = {
DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUVOffset)= 0x0040400000404000ULL;
-#endif /* defined(ARCH_X86) */
+#endif /* ARCH_X86 */
// clipping helper table for C implementations:
static unsigned char clip_table[768];
@@ -454,6 +454,10 @@ const char *sws_format_name(enum PixelFormat format)
return "yuv440p";
case PIX_FMT_VDPAU_H264:
return "vdpau_h264";
+ case PIX_FMT_VDPAU_MPEG1:
+ return "vdpau_mpeg1";
+ case PIX_FMT_VDPAU_MPEG2:
+ return "vdpau_mpeg2";
default:
return "Unknown format";
}
@@ -947,27 +951,27 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
//Note: we have C, X86, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one
//Plain C versions
-#if !defined (HAVE_MMX) || defined (RUNTIME_CPUDETECT) || !defined(CONFIG_GPL)
+#if !HAVE_MMX || defined (RUNTIME_CPUDETECT) || !CONFIG_GPL
#define COMPILE_C
#endif
-#ifdef ARCH_PPC
-#if (defined (HAVE_ALTIVEC) || defined (RUNTIME_CPUDETECT)) && defined (CONFIG_GPL)
+#if ARCH_PPC
+#if (HAVE_ALTIVEC || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL
#define COMPILE_ALTIVEC
#endif //HAVE_ALTIVEC
#endif //ARCH_PPC
-#if defined(ARCH_X86)
+#if ARCH_X86
-#if ((defined (HAVE_MMX) && !defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)) && defined (CONFIG_GPL)
+#if ((HAVE_MMX && !HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL
#define COMPILE_MMX
#endif
-#if (defined (HAVE_MMX2) || defined (RUNTIME_CPUDETECT)) && defined (CONFIG_GPL)
+#if (HAVE_MMX2 || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL
#define COMPILE_MMX2
#endif
-#if ((defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)) && defined (CONFIG_GPL)
+#if ((HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL
#define COMPILE_3DNOW
#endif
#endif //ARCH_X86 || ARCH_X86_64
@@ -975,24 +979,26 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
#undef HAVE_MMX
#undef HAVE_MMX2
#undef HAVE_3DNOW
+#undef HAVE_ALTIVEC
+#define HAVE_MMX 0
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
+#define HAVE_ALTIVEC 0
#ifdef COMPILE_C
-#undef HAVE_MMX
-#undef HAVE_MMX2
-#undef HAVE_3DNOW
-#undef HAVE_ALTIVEC
#define RENAME(a) a ## _C
#include "swscale_template.c"
#endif
#ifdef COMPILE_ALTIVEC
#undef RENAME
-#define HAVE_ALTIVEC
+#undef HAVE_ALTIVEC
+#define HAVE_ALTIVEC 1
#define RENAME(a) a ## _altivec
#include "swscale_template.c"
#endif
-#if defined(ARCH_X86)
+#if ARCH_X86
//X86 versions
/*
@@ -1007,9 +1013,12 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
//MMX versions
#ifdef COMPILE_MMX
#undef RENAME
-#define HAVE_MMX
+#undef HAVE_MMX
#undef HAVE_MMX2
#undef HAVE_3DNOW
+#define HAVE_MMX 1
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
#define RENAME(a) a ## _MMX
#include "swscale_template.c"
#endif
@@ -1017,9 +1026,12 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
//MMX2 versions
#ifdef COMPILE_MMX2
#undef RENAME
-#define HAVE_MMX
-#define HAVE_MMX2
+#undef HAVE_MMX
+#undef HAVE_MMX2
#undef HAVE_3DNOW
+#define HAVE_MMX 1
+#define HAVE_MMX2 1
+#define HAVE_3DNOW 0
#define RENAME(a) a ## _MMX2
#include "swscale_template.c"
#endif
@@ -1027,9 +1039,12 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
//3DNOW versions
#ifdef COMPILE_3DNOW
#undef RENAME
-#define HAVE_MMX
+#undef HAVE_MMX
#undef HAVE_MMX2
-#define HAVE_3DNOW
+#undef HAVE_3DNOW
+#define HAVE_MMX 1
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 1
#define RENAME(a) a ## _3DNow
#include "swscale_template.c"
#endif
@@ -1061,7 +1076,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
int64_t *filter2=NULL;
const int64_t fone= 1LL<<54;
int ret= -1;
-#if defined(ARCH_X86)
+#if ARCH_X86
if (flags & SWS_CPU_CAPS_MMX)
__asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
#endif
@@ -1617,8 +1632,8 @@ static void globalInit(void){
static SwsFunc getSwsFunc(int flags){
-#if defined(RUNTIME_CPUDETECT) && defined (CONFIG_GPL)
-#if defined(ARCH_X86)
+#if defined(RUNTIME_CPUDETECT) && CONFIG_GPL
+#if ARCH_X86
// ordered per speed fastest first
if (flags & SWS_CPU_CAPS_MMX2)
return swScale_MMX2;
@@ -1630,22 +1645,22 @@ static SwsFunc getSwsFunc(int flags){
return swScale_C;
#else
-#ifdef ARCH_PPC
+#if ARCH_PPC
if (flags & SWS_CPU_CAPS_ALTIVEC)
return swScale_altivec;
else
return swScale_C;
#endif
return swScale_C;
-#endif /* defined(ARCH_X86) */
+#endif /* ARCH_X86 */
#else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
return swScale_MMX2;
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
return swScale_3DNow;
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
return swScale_MMX;
-#elif defined (HAVE_ALTIVEC)
+#elif HAVE_ALTIVEC
return swScale_altivec;
#else
return swScale_C;
@@ -2169,22 +2184,22 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
int unscaled, needsDither;
int srcRange, dstRange;
SwsFilter dummyFilter= {NULL, NULL, NULL, NULL};
-#if defined(ARCH_X86)
+#if ARCH_X86
if (flags & SWS_CPU_CAPS_MMX)
__asm__ volatile("emms\n\t"::: "memory");
#endif
-#if !defined(RUNTIME_CPUDETECT) || !defined (CONFIG_GPL) //ensure that the flags match the compiled variant if cpudetect is off
+#if !defined(RUNTIME_CPUDETECT) || !CONFIG_GPL //ensure that the flags match the compiled variant if cpudetect is off
flags &= ~(SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2|SWS_CPU_CAPS_3DNOW|SWS_CPU_CAPS_ALTIVEC|SWS_CPU_CAPS_BFIN);
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2;
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_3DNOW;
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
flags |= SWS_CPU_CAPS_MMX;
-#elif defined (HAVE_ALTIVEC)
+#elif HAVE_ALTIVEC
flags |= SWS_CPU_CAPS_ALTIVEC;
-#elif defined (ARCH_BFIN)
+#elif ARCH_BFIN
flags |= SWS_CPU_CAPS_BFIN;
#endif
#endif /* RUNTIME_CPUDETECT */
@@ -2311,7 +2326,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
{
c->swScale= PlanarToNV12Wrapper;
}
-#ifdef CONFIG_GPL
+#if CONFIG_GPL
/* yuv2bgr */
if ((srcFormat==PIX_FMT_YUV420P || srcFormat==PIX_FMT_YUV422P) && (isBGR(dstFormat) || isRGB(dstFormat))
&& !(flags & SWS_ACCURATE_RND) && !(dstH&1))
@@ -2410,7 +2425,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
c->swScale= gray16swap;
}
-#ifdef ARCH_BFIN
+#if ARCH_BFIN
if (flags & SWS_CPU_CAPS_BFIN)
ff_bfin_get_unscaled_swscale (c);
#endif
@@ -2518,7 +2533,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
(flags&SWS_BICUBLIN) ? (flags|SWS_BILINEAR) : flags,
srcFilter->chrV, dstFilter->chrV, c->param);
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
c->vYCoeffsBank = av_malloc(sizeof (vector signed short)*c->vLumFilterSize*c->dstH);
c->vCCoeffsBank = av_malloc(sizeof (vector signed short)*c->vChrFilterSize*c->chrDstH);
@@ -2648,7 +2663,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
}
else
{
-#if defined(ARCH_X86)
+#if ARCH_X86
av_log(c, AV_LOG_VERBOSE, "using X86-Asm scaler for horizontal scaling\n");
#else
if (flags & SWS_FAST_BILINEAR)
@@ -3115,7 +3130,7 @@ void sws_freeContext(SwsContext *c){
av_freep(&c->vChrFilter);
av_freep(&c->hLumFilter);
av_freep(&c->hChrFilter);
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
av_freep(&c->vYCoeffsBank);
av_freep(&c->vCCoeffsBank);
#endif
@@ -3125,7 +3140,7 @@ void sws_freeContext(SwsContext *c){
av_freep(&c->hLumFilterPos);
av_freep(&c->hChrFilterPos);
-#if defined(ARCH_X86) && defined(CONFIG_GPL)
+#if ARCH_X86 && CONFIG_GPL
#ifdef MAP_ANONYMOUS
if (c->funnyYCode) munmap(c->funnyYCode, MAX_FUNNY_CODE_SIZE);
if (c->funnyUVCode) munmap(c->funnyUVCode, MAX_FUNNY_CODE_SIZE);
@@ -3135,7 +3150,7 @@ void sws_freeContext(SwsContext *c){
#endif
c->funnyYCode=NULL;
c->funnyUVCode=NULL;
-#endif /* defined(ARCH_X86) */
+#endif /* ARCH_X86 */
av_freep(&c->lumMmx2Filter);
av_freep(&c->chrMmx2Filter);
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 48995571e0..b2505c0f7d 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -23,7 +23,7 @@
#include "config.h"
-#ifdef HAVE_ALTIVEC_H
+#if HAVE_ALTIVEC_H
#include <altivec.h>
#endif
@@ -42,7 +42,7 @@
#define ALT32_CORR 1
#endif
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
# define APCK_PTR2 8
# define APCK_COEF 16
# define APCK_SIZE 24
@@ -175,7 +175,7 @@ typedef struct SwsContext{
uint64_t u_temp __attribute__((aligned(8)));
uint64_t v_temp __attribute__((aligned(8)));
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
vector signed short CY;
vector signed short CRV;
@@ -189,7 +189,7 @@ typedef struct SwsContext{
#endif
-#ifdef ARCH_BFIN
+#if ARCH_BFIN
uint32_t oy __attribute__((aligned(4)));
uint32_t oc __attribute__((aligned(4)));
uint32_t zero __attribute__((aligned(4)));
@@ -203,7 +203,7 @@ typedef struct SwsContext{
uint32_t gmask __attribute__((aligned(4)));
#endif
-#ifdef HAVE_VIS
+#if HAVE_VIS
uint64_t sparc_coeffs[10] __attribute__((aligned(8)));
#endif
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index 4c8bc6e066..2144b5a57c 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -29,17 +29,17 @@
#undef EMMS
#undef SFENCE
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
/* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */
#define EMMS "femms"
#else
#define EMMS "emms"
#endif
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
#define PREFETCH "prefetch"
#define PREFETCHW "prefetchw"
-#elif defined (HAVE_MMX2)
+#elif HAVE_MMX2
#define PREFETCH "prefetchnta"
#define PREFETCHW "prefetcht0"
#else
@@ -47,26 +47,26 @@
#define PREFETCHW " # nop"
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
#define SFENCE "sfence"
#else
#define SFENCE " # nop"
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
#define PAVGB(a,b) "pavgb " #a ", " #b " \n\t"
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
#define PAVGB(a,b) "pavgusb " #a ", " #b " \n\t"
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
#define REAL_MOVNTQ(a,b) "movntq " #a ", " #b " \n\t"
#else
#define REAL_MOVNTQ(a,b) "movq " #a ", " #b " \n\t"
#endif
#define MOVNTQ(a,b) REAL_MOVNTQ(a,b)
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
#include "swscale_altivec_template.c"
#endif
@@ -865,7 +865,7 @@
"cmp "#dstw", "#index" \n\t"\
" jb 1b \n\t"
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
#undef WRITEBGR24
#define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX2(dst, dstw, index)
#else
@@ -895,7 +895,7 @@ static inline void RENAME(yuv2yuvX)(SwsContext *c, int16_t *lumFilter, int16_t *
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, long dstW, long chrDstW)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(!(c->flags & SWS_BITEXACT)){
if (c->flags & SWS_ACCURATE_RND){
if (uDest){
@@ -915,7 +915,7 @@ static inline void RENAME(yuv2yuvX)(SwsContext *c, int16_t *lumFilter, int16_t *
return;
}
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
yuv2yuvX_altivec_real(lumFilter, lumSrc, lumFilterSize,
chrFilter, chrSrc, chrFilterSize,
dest, uDest, vDest, dstW, chrDstW);
@@ -939,7 +939,7 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chr
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, long dstW, long chrDstW)
{
int i;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(!(c->flags & SWS_BITEXACT)){
long p= uDest ? 3 : 1;
uint8_t *src[3]= {lumSrc + dstW, chrSrc + chrDstW, chrSrc + VOFW + chrDstW};
@@ -1006,7 +1006,7 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, long dstW, long dstY)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
long dummy=0;
if(!(c->flags & SWS_BITEXACT)){
if (c->flags & SWS_ACCURATE_RND){
@@ -1133,7 +1133,7 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_
}
}
#endif /* HAVE_MMX */
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
/* The following list of supported dstFormat values should
match what's found in the body of altivec_yuv2packedX() */
if (c->dstFormat==PIX_FMT_ABGR || c->dstFormat==PIX_FMT_BGRA ||
@@ -1159,7 +1159,7 @@ static inline void RENAME(yuv2packed2)(SwsContext *c, uint16_t *buf0, uint16_t *
int uvalpha1=4095-uvalpha;
int i;
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(!(c->flags & SWS_BITEXACT)){
switch(c->dstFormat)
{
@@ -1270,7 +1270,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
return;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
if(!(flags & SWS_BITEXACT)){
if (uvalpha < 2048) // note this is not correct (shifts chrominance by 0.5 pixels) but it is a bit faster
{
@@ -1464,7 +1464,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
"movq "MANGLE(bm01010101)", %%mm2 \n\t"
"mov %0, %%"REG_a" \n\t"
@@ -1489,7 +1489,7 @@ static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, long width, uint3
static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
"mov %0, %%"REG_a" \n\t"
@@ -1526,7 +1526,7 @@ static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1,
* yuy2ToY/UV)(dst, src+1, ...) would have 100% unaligned accesses. */
static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
"mov %0, %%"REG_a" \n\t"
"1: \n\t"
@@ -1550,7 +1550,7 @@ static inline void RENAME(uyvyToY)(uint8_t *dst, uint8_t *src, long width, uint3
static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
"mov %0, %%"REG_a" \n\t"
@@ -1643,7 +1643,7 @@ BGR2UV(uint16_t, bgr15ToUV, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RU<<10, GU<<5, BU
BGR2UV(uint16_t, rgb16ToUV, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RU , GU<<5, BU<<11, RV , GV<<5, BV<<11, RGB2YUV_SHIFT+8)
BGR2UV(uint16_t, rgb15ToUV, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RU , GU<<5, BU<<10, RV , GV<<5, BV<<10, RGB2YUV_SHIFT+7)
-#ifdef HAVE_MMX
+#if HAVE_MMX
static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, uint8_t *src, long width, int srcFormat)
{
@@ -1758,7 +1758,7 @@ static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, uint8_t *
static inline void RENAME(bgr24ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_BGR24);
#else
int i;
@@ -1775,7 +1775,7 @@ static inline void RENAME(bgr24ToY)(uint8_t *dst, uint8_t *src, long width, uint
static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_BGR24);
#else
int i;
@@ -1809,7 +1809,7 @@ static inline void RENAME(bgr24ToUV_half)(uint8_t *dstU, uint8_t *dstV, uint8_t
static inline void RENAME(rgb24ToY)(uint8_t *dst, uint8_t *src, long width, uint32_t *unused)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24);
#else
int i;
@@ -1826,7 +1826,7 @@ static inline void RENAME(rgb24ToY)(uint8_t *dst, uint8_t *src, long width, uint
static inline void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, long width, uint32_t *unused)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
assert(src1==src2);
RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_RGB24);
#else
@@ -1908,7 +1908,7 @@ static inline void RENAME(monoblack2Y)(uint8_t *dst, uint8_t *src, long width, u
static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW, int xInc,
int16_t *filter, int16_t *filterPos, long filterSize)
{
-#ifdef HAVE_MMX
+#if HAVE_MMX
assert(filterSize % 4 == 0 && filterSize>0);
if (filterSize==4) // Always true for upscaling, sometimes for down, too.
{
@@ -2064,7 +2064,7 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW
);
}
#else
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
hScale_altivec_real(dst, dstW, src, srcW, xInc, filter, filterPos, filterSize);
#else
int i;
@@ -2169,7 +2169,7 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth,
src= formatConvBuffer;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
// Use the new MMX scaler if the MMX2 one can't be used (it is faster than the x86 ASM one).
if (!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed))
#else
@@ -2180,8 +2180,8 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth,
}
else // fast bilinear upscale / crap downscale
{
-#if defined(ARCH_X86)
-#ifdef HAVE_MMX2
+#if ARCH_X86
+#if HAVE_MMX2
int i;
#if defined(PIC)
uint64_t ebxsave __attribute__((aligned(8)));
@@ -2202,7 +2202,7 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth,
PREFETCH" 32(%%"REG_c") \n\t"
PREFETCH" 64(%%"REG_c") \n\t"
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
#define FUNNY_Y_CODE \
"movl (%%"REG_b"), %%esi \n\t"\
@@ -2292,7 +2292,7 @@ FUNNY_Y_CODE
:: "r" (src), "m" (dst), "m" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask)
: "%"REG_a, "%"REG_d, "%ecx", "%"REG_D, "%esi"
);
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
} //if MMX2 can't be used
#endif
#else
@@ -2305,7 +2305,7 @@ FUNNY_Y_CODE
dst[i]= (src[xx]<<7) + (src[xx+1] - src[xx])*xalpha;
xpos+=xInc;
}
-#endif /* defined(ARCH_X86) */
+#endif /* ARCH_X86 */
}
if(c->srcRange != c->dstRange && !(isRGB(c->dstFormat) || isBGR(c->dstFormat))){
@@ -2441,7 +2441,7 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth,
src2= formatConvBuffer+VOFW;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
// Use the new MMX scaler if the MMX2 one can't be used (it is faster than the x86 ASM one).
if (!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed))
#else
@@ -2453,8 +2453,8 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth,
}
else // fast bilinear upscale / crap downscale
{
-#if defined(ARCH_X86)
-#ifdef HAVE_MMX2
+#if ARCH_X86
+#if HAVE_MMX2
int i;
#if defined(PIC)
uint64_t ebxsave __attribute__((aligned(8)));
@@ -2475,7 +2475,7 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth,
PREFETCH" 32(%%"REG_c") \n\t"
PREFETCH" 64(%%"REG_c") \n\t"
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
#define FUNNY_UV_CODE \
"movl (%%"REG_b"), %%esi \n\t"\
@@ -2573,7 +2573,7 @@ FUNNY_UV_CODE
/* GCC 3.3 makes MPlayer crash on IA-32 machines when using "g" operand here,
which is needed to support GCC 4.0. */
-#if defined(ARCH_X86_64) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#if ARCH_X86_64 && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
:: "m" (src1), "m" (dst), "g" ((long)dstWidth), "m" (xInc_shr16), "m" (xInc_mask),
#else
:: "m" (src1), "m" (dst), "m" ((long)dstWidth), "m" (xInc_shr16), "m" (xInc_mask),
@@ -2581,7 +2581,7 @@ FUNNY_UV_CODE
"r" (src2)
: "%"REG_a, "%"REG_d, "%ecx", "%"REG_D, "%esi"
);
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
} //if MMX2 can't be used
#endif
#else
@@ -2599,7 +2599,7 @@ FUNNY_UV_CODE
*/
xpos+=xInc;
}
-#endif /* defined(ARCH_X86) */
+#endif /* ARCH_X86 */
}
if(c->srcRange != c->dstRange && !(isRGB(c->dstFormat) || isBGR(c->dstFormat))){
int i;
@@ -2821,7 +2821,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
break; //we can't output a dstY line so let's try with the next slice
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
c->blueDither= ff_dither8[dstY&1];
if (c->dstFormat == PIX_FMT_RGB555 || c->dstFormat == PIX_FMT_BGR555)
c->greenDither= ff_dither8[dstY&1];
@@ -2833,7 +2833,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
{
int16_t **lumSrcPtr= lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize;
int16_t **chrSrcPtr= chrPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
-#ifdef HAVE_MMX
+#if HAVE_MMX
int i;
if (flags & SWS_ACCURATE_RND){
int s= APCK_SIZE / 8;
@@ -2987,7 +2987,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
}
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(SFENCE:::"memory");
__asm__ volatile(EMMS:::"memory");
#endif
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index d19430fd17..9dedd2a701 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -45,28 +45,26 @@ extern const uint8_t dither_8x8_32[8][8];
extern const uint8_t dither_8x8_73[8][8];
extern const uint8_t dither_8x8_220[8][8];
-#ifdef HAVE_MMX
+#if HAVE_MMX
/* hope these constant values are cache line aligned */
DECLARE_ASM_CONST(8, uint64_t, mmx_00ffw) = 0x00ff00ff00ff00ffULL;
DECLARE_ASM_CONST(8, uint64_t, mmx_redmask) = 0xf8f8f8f8f8f8f8f8ULL;
DECLARE_ASM_CONST(8, uint64_t, mmx_grnmask) = 0xfcfcfcfcfcfcfcfcULL;
-#undef HAVE_MMX
-
//MMX versions
#undef RENAME
-#define HAVE_MMX
#undef HAVE_MMX2
#undef HAVE_3DNOW
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
#define RENAME(a) a ## _MMX
#include "yuv2rgb_template.c"
//MMX2 versions
#undef RENAME
-#define HAVE_MMX
-#define HAVE_MMX2
-#undef HAVE_3DNOW
+#undef HAVE_MMX2
+#define HAVE_MMX2 1
#define RENAME(a) a ## _MMX2
#include "yuv2rgb_template.c"
@@ -485,7 +483,7 @@ EPILOG(1)
SwsFunc yuv2rgb_get_func_ptr (SwsContext *c)
{
-#if defined(HAVE_MMX2) || defined(HAVE_MMX)
+#if HAVE_MMX2 || HAVE_MMX
if (c->flags & SWS_CPU_CAPS_MMX2){
switch(c->dstFormat){
case PIX_FMT_RGB32: return yuv420_rgb32_MMX2;
@@ -503,19 +501,19 @@ SwsFunc yuv2rgb_get_func_ptr (SwsContext *c)
}
}
#endif
-#ifdef HAVE_VIS
+#if HAVE_VIS
{
SwsFunc t= yuv2rgb_init_vis(c);
if (t) return t;
}
#endif
-#ifdef CONFIG_MLIB
+#if CONFIG_MLIB
{
SwsFunc t= yuv2rgb_init_mlib(c);
if (t) return t;
}
#endif
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if (c->flags & SWS_CPU_CAPS_ALTIVEC)
{
SwsFunc t = yuv2rgb_init_altivec(c);
@@ -523,7 +521,7 @@ SwsFunc yuv2rgb_get_func_ptr (SwsContext *c)
}
#endif
-#ifdef ARCH_BFIN
+#if ARCH_BFIN
if (c->flags & SWS_CPU_CAPS_BFIN)
{
SwsFunc t = ff_bfin_yuv2rgb_get_func_ptr (c);
diff --git a/libswscale/yuv2rgb_template.c b/libswscale/yuv2rgb_template.c
index e8b6ff30cf..c66f24edeb 100644
--- a/libswscale/yuv2rgb_template.c
+++ b/libswscale/yuv2rgb_template.c
@@ -30,14 +30,14 @@
#undef EMMS
#undef SFENCE
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
/* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */
#define EMMS "femms"
#else
#define EMMS "emms"
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
#define MOVNTQ "movntq"
#define SFENCE "sfence"
#else
@@ -335,7 +335,7 @@ static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStr
"1: \n\t"
YUV2RGB
/* mm0=B, %%mm2=G, %%mm1=R */
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
"movq "MANGLE(ff_M24A)", %%mm4 \n\t"
"movq "MANGLE(ff_M24C)", %%mm7 \n\t"
"pshufw $0x50, %%mm0, %%mm5 \n\t" /* B3 B2 B3 B2 B1 B0 B1 B0 */
diff --git a/libvo/aclib.c b/libvo/aclib.c
index 68548f579e..4c51709b2a 100644
--- a/libvo/aclib.c
+++ b/libvo/aclib.c
@@ -18,31 +18,31 @@
//Feel free to fine-tune the above 2, it might be possible to get some speedup with them :)
//#define STATISTICS
-#ifdef ARCH_X86
+#if ARCH_X86
#define CAN_COMPILE_X86_ASM
#endif
//Note: we have MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one
//Plain C versions
-//#if !defined (HAVE_MMX) || defined (RUNTIME_CPUDETECT)
+//#if !HAVE_MMX || defined (RUNTIME_CPUDETECT)
//#define COMPILE_C
//#endif
#ifdef CAN_COMPILE_X86_ASM
-#if (defined (HAVE_MMX) && !defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)
+#if (HAVE_MMX && !HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
#define COMPILE_MMX
#endif
-#if (defined (HAVE_MMX2) && !defined (HAVE_SSE2)) || defined (RUNTIME_CPUDETECT)
+#if (HAVE_MMX2 && !HAVE_SSE2) || defined (RUNTIME_CPUDETECT)
#define COMPILE_MMX2
#endif
-#if (defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)
+#if (HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
#define COMPILE_3DNOW
#endif
-#if defined (HAVE_SSE2) || defined (RUNTIME_CPUDETECT)
+#if HAVE_SSE2 || defined (RUNTIME_CPUDETECT)
#define COMPILE_SSE
#endif
@@ -51,12 +51,23 @@
#undef HAVE_3DNOW
#undef HAVE_SSE
#undef HAVE_SSE2
+#define HAVE_MMX 0
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
/*
#ifdef COMPILE_C
#undef HAVE_MMX
#undef HAVE_MMX2
#undef HAVE_3DNOW
-#undef ARCH_X86
+#undef HAVE_SSE
+#undef HAVE_SSE2
+#define HAVE_MMX 0
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
#define RENAME(a) a ## _C
#include "aclib_template.c"
#endif
@@ -64,11 +75,16 @@
//MMX versions
#ifdef COMPILE_MMX
#undef RENAME
-#define HAVE_MMX
+#undef HAVE_MMX
#undef HAVE_MMX2
#undef HAVE_3DNOW
#undef HAVE_SSE
#undef HAVE_SSE2
+#define HAVE_MMX 1
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
#define RENAME(a) a ## _MMX
#include "aclib_template.c"
#endif
@@ -76,11 +92,16 @@
//MMX2 versions
#ifdef COMPILE_MMX2
#undef RENAME
-#define HAVE_MMX
-#define HAVE_MMX2
+#undef HAVE_MMX
+#undef HAVE_MMX2
#undef HAVE_3DNOW
#undef HAVE_SSE
#undef HAVE_SSE2
+#define HAVE_MMX 1
+#define HAVE_MMX2 1
+#define HAVE_3DNOW 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
#define RENAME(a) a ## _MMX2
#include "aclib_template.c"
#endif
@@ -88,11 +109,16 @@
//3DNOW versions
#ifdef COMPILE_3DNOW
#undef RENAME
-#define HAVE_MMX
+#undef HAVE_MMX
#undef HAVE_MMX2
-#define HAVE_3DNOW
+#undef HAVE_3DNOW
#undef HAVE_SSE
#undef HAVE_SSE2
+#define HAVE_MMX 1
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 1
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
#define RENAME(a) a ## _3DNow
#include "aclib_template.c"
#endif
@@ -100,11 +126,16 @@
//SSE versions (only used on SSE2 cpus)
#ifdef COMPILE_SSE
#undef RENAME
-#define HAVE_MMX
-#define HAVE_MMX2
+#undef HAVE_MMX
+#undef HAVE_MMX2
#undef HAVE_3DNOW
-#define HAVE_SSE
-#define HAVE_SSE2
+#undef HAVE_SSE
+#undef HAVE_SSE2
+#define HAVE_MMX 1
+#define HAVE_MMX2 1
+#define HAVE_3DNOW 0
+#define HAVE_SSE 1
+#define HAVE_SSE2 1
#define RENAME(a) a ## _SSE
#include "aclib_template.c"
#endif
@@ -130,13 +161,13 @@ void * fast_memcpy(void * to, const void * from, size_t len)
#endif //CAN_COMPILE_X86_ASM
memcpy(to, from, len); // prior to mmx we use the standart memcpy
#else
-#ifdef HAVE_SSE2
+#if HAVE_SSE2
fast_memcpy_SSE(to, from, len);
-#elif defined (HAVE_MMX2)
+#elif HAVE_MMX2
fast_memcpy_MMX2(to, from, len);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
fast_memcpy_3DNow(to, from, len);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
fast_memcpy_MMX(to, from, len);
#else
memcpy(to, from, len); // prior to mmx we use the standart memcpy
@@ -164,13 +195,13 @@ void * mem2agpcpy(void * to, const void * from, size_t len)
#endif //CAN_COMPILE_X86_ASM
memcpy(to, from, len); // prior to mmx we use the standart memcpy
#else
-#ifdef HAVE_SSE2
+#if HAVE_SSE2
mem2agpcpy_SSE(to, from, len);
-#elif defined (HAVE_MMX2)
+#elif HAVE_MMX2
mem2agpcpy_MMX2(to, from, len);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
mem2agpcpy_3DNow(to, from, len);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
mem2agpcpy_MMX(to, from, len);
#else
memcpy(to, from, len); // prior to mmx we use the standart memcpy
diff --git a/libvo/aclib_template.c b/libvo/aclib_template.c
index 7288831172..74f0371a63 100644
--- a/libvo/aclib_template.c
+++ b/libvo/aclib_template.c
@@ -3,7 +3,7 @@
This file contains functions which improve and expand standard C-library
*/
-#ifndef HAVE_SSE2
+#if !HAVE_SSE2
/*
P3 processor has only one SSE decoder so can execute only 1 sse insn per
cpu clock, but it has 3 mmx decoders (include load/store unit)
@@ -13,6 +13,7 @@
I have doubts. Anyway SSE2 version of this code can be written better.
*/
#undef HAVE_SSE
+#define HAVE_SSE 0
#endif
@@ -65,7 +66,7 @@ If you have questions please contact with me: Nick Kurshev: nickols_k@mail.ru.
#undef HAVE_ONLY_MMX1
-#if defined(HAVE_MMX) && !defined(HAVE_MMX2) && !defined(HAVE_3DNOW) && !defined(HAVE_SSE)
+#if HAVE_MMX && !HAVE_MMX2 && !HAVE_3DNOW && !HAVE_SSE
/* means: mmx v.1. Note: Since we added alignment of destinition it speedups
of memory copying on PentMMX, Celeron-1 and P2 upto 12% versus
standard (non MMX-optimized) version.
@@ -76,7 +77,7 @@ If you have questions please contact with me: Nick Kurshev: nickols_k@mail.ru.
#undef HAVE_K6_2PLUS
-#if !defined( HAVE_MMX2) && defined( HAVE_3DNOW)
+#if !HAVE_MMX2 && HAVE_3DNOW
#define HAVE_K6_2PLUS
#endif
@@ -95,7 +96,7 @@ __asm__ volatile(\
}
#undef MMREG_SIZE
-#ifdef HAVE_SSE
+#if HAVE_SSE
#define MMREG_SIZE 16
#else
#define MMREG_SIZE 64 //8
@@ -104,23 +105,23 @@ __asm__ volatile(\
#undef PREFETCH
#undef EMMS
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
#define PREFETCH "prefetchnta"
-#elif defined ( HAVE_3DNOW )
+#elif HAVE_3DNOW
#define PREFETCH "prefetch"
#else
#define PREFETCH " # nop"
#endif
/* On K6 femms is faster of emms. On K7 femms is directly mapped on emms. */
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
#define EMMS "femms"
#else
#define EMMS "emms"
#endif
#undef MOVNTQ
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
#define MOVNTQ "movntq"
#else
#define MOVNTQ "movq"
@@ -183,7 +184,7 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
perform reading and writing to be multiple to a number of
processor's decoders, but it's not always possible.
*/
-#ifdef HAVE_SSE /* Only P3 (may be Cyrix3) */
+#if HAVE_SSE /* Only P3 (may be Cyrix3) */
if(((unsigned long)from) & 15)
/* if SRC is misaligned */
for(; i>0; i--)
@@ -343,12 +344,12 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
}
#endif /* Have SSE */
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
/* since movntq is weakly-ordered, a "sfence"
* is needed to become ordered again. */
__asm__ volatile ("sfence":::"memory");
#endif
-#ifndef HAVE_SSE
+#if !HAVE_SSE
/* enables to use FPU */
__asm__ volatile (EMMS:::"memory");
#endif
@@ -427,7 +428,7 @@ static void * RENAME(mem2agpcpy)(void * to, const void * from, size_t len)
from=((const unsigned char *)from)+64;
to=((unsigned char *)to)+64;
}
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
/* since movntq is weakly-ordered, a "sfence"
* is needed to become ordered again. */
__asm__ volatile ("sfence":::"memory");
diff --git a/libvo/fastmemcpy.h b/libvo/fastmemcpy.h
index be0b752558..69ded04bcf 100644
--- a/libvo/fastmemcpy.h
+++ b/libvo/fastmemcpy.h
@@ -24,8 +24,8 @@
#include <string.h>
#ifdef CONFIG_FASTMEMCPY
-#if defined(HAVE_MMX) || defined(HAVE_MMX2) || defined(HAVE_3DNOW) \
-/* || defined(HAVE_SSE) || defined(HAVE_SSE2) */
+#if HAVE_MMX || HAVE_MMX2 || HAVE_3DNOW \
+/* || HAVE_SSE || HAVE_SSE2 */
#include <stddef.h>
void * fast_memcpy(void * to, const void * from, size_t len);
diff --git a/libvo/osd.c b/libvo/osd.c
index da7d61fb50..df91ffbae0 100644
--- a/libvo/osd.c
+++ b/libvo/osd.c
@@ -11,7 +11,7 @@
#include <inttypes.h>
#include "cpudetect.h"
-#ifdef ARCH_X86
+#if ARCH_X86
#define CAN_COMPILE_X86_ASM
#endif
@@ -23,21 +23,21 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF
//Note: we have C, X86-nommx, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one
//Plain C versions
-#if !defined (HAVE_MMX) || defined (RUNTIME_CPUDETECT)
+#if !HAVE_MMX || defined (RUNTIME_CPUDETECT)
#define COMPILE_C
#endif
#ifdef CAN_COMPILE_X86_ASM
-#if (defined (HAVE_MMX) && !defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)
+#if (HAVE_MMX && !HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
#define COMPILE_MMX
#endif
-#if defined (HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
+#if HAVE_MMX2 || defined (RUNTIME_CPUDETECT)
#define COMPILE_MMX2
#endif
-#if (defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)
+#if (HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
#define COMPILE_3DNOW
#endif
#endif //CAN_COMPILE_X86_ASM
@@ -45,6 +45,9 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF
#undef HAVE_MMX
#undef HAVE_MMX2
#undef HAVE_3DNOW
+#define HAVE_MMX 0
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
#ifndef CAN_COMPILE_X86_ASM
@@ -52,6 +55,9 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF
#undef HAVE_MMX
#undef HAVE_MMX2
#undef HAVE_3DNOW
+#define HAVE_MMX 0
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
#define RENAME(a) a ## _C
#include "osd_template.c"
#endif
@@ -64,6 +70,9 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF
#undef HAVE_MMX
#undef HAVE_MMX2
#undef HAVE_3DNOW
+#define HAVE_MMX 0
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
#define RENAME(a) a ## _X86
#include "osd_template.c"
#endif
@@ -71,9 +80,12 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF
//MMX versions
#ifdef COMPILE_MMX
#undef RENAME
-#define HAVE_MMX
+#undef HAVE_MMX
#undef HAVE_MMX2
#undef HAVE_3DNOW
+#define HAVE_MMX 1
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 0
#define RENAME(a) a ## _MMX
#include "osd_template.c"
#endif
@@ -81,9 +93,12 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF
//MMX2 versions
#ifdef COMPILE_MMX2
#undef RENAME
-#define HAVE_MMX
-#define HAVE_MMX2
+#undef HAVE_MMX
+#undef HAVE_MMX2
#undef HAVE_3DNOW
+#define HAVE_MMX 1
+#define HAVE_MMX2 1
+#define HAVE_3DNOW 0
#define RENAME(a) a ## _MMX2
#include "osd_template.c"
#endif
@@ -91,9 +106,12 @@ static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FF
//3DNOW versions
#ifdef COMPILE_3DNOW
#undef RENAME
-#define HAVE_MMX
+#undef HAVE_MMX
#undef HAVE_MMX2
-#define HAVE_3DNOW
+#undef HAVE_3DNOW
+#define HAVE_MMX 1
+#define HAVE_MMX2 0
+#define HAVE_3DNOW 1
#define RENAME(a) a ## _3DNow
#include "osd_template.c"
#endif
@@ -116,13 +134,13 @@ void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, in
vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride);
#endif
#else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined(ARCH_X86)
+#elif ARCH_X86
vo_draw_alpha_yv12_X86(w, h, src, srca, srcstride, dstbase, dststride);
#else
vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride);
@@ -146,13 +164,13 @@ void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, in
vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride);
#endif
#else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined(ARCH_X86)
+#elif ARCH_X86
vo_draw_alpha_yuy2_X86(w, h, src, srca, srcstride, dstbase, dststride);
#else
vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride);
@@ -176,13 +194,13 @@ void vo_draw_alpha_uyvy(int w,int h, unsigned char* src, unsigned char *srca, in
vo_draw_alpha_uyvy_C(w, h, src, srca, srcstride, dstbase, dststride);
#endif
#else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
vo_draw_alpha_uyvy_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
vo_draw_alpha_uyvy_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
vo_draw_alpha_uyvy_MMX(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined(ARCH_X86)
+#elif ARCH_X86
vo_draw_alpha_uyvy_X86(w, h, src, srca, srcstride, dstbase, dststride);
#else
vo_draw_alpha_uyvy_C(w, h, src, srca, srcstride, dstbase, dststride);
@@ -206,13 +224,13 @@ void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, i
vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride);
#endif
#else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined(ARCH_X86)
+#elif ARCH_X86
vo_draw_alpha_rgb24_X86(w, h, src, srca, srcstride, dstbase, dststride);
#else
vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride);
@@ -236,13 +254,13 @@ void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, i
vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride);
#endif
#else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride);
-#elif defined(ARCH_X86)
+#elif ARCH_X86
vo_draw_alpha_rgb32_X86(w, h, src, srca, srcstride, dstbase, dststride);
#else
vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride);
@@ -281,13 +299,13 @@ void vo_draw_alpha_init(void){
mp_msg(MSGT_OSD,MSGL_INFO,"Using Unoptimized OnScreenDisplay\n");
#endif
#else //RUNTIME_CPUDETECT
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay\n");
-#elif defined (HAVE_3DNOW)
+#elif HAVE_3DNOW
mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX (with tiny bit 3DNow) Optimized OnScreenDisplay\n");
-#elif defined (HAVE_MMX)
+#elif HAVE_MMX
mp_msg(MSGT_OSD,MSGL_INFO,"Using MMX Optimized OnScreenDisplay\n");
-#elif defined(ARCH_X86)
+#elif ARCH_X86
mp_msg(MSGT_OSD,MSGL_INFO,"Using X86 Optimized OnScreenDisplay\n");
#else
mp_msg(MSGT_OSD,MSGL_INFO,"Using Unoptimized OnScreenDisplay\n");
diff --git a/libvo/osd_template.c b/libvo/osd_template.c
index c44f060a5d..8700a176c6 100644
--- a/libvo/osd_template.c
+++ b/libvo/osd_template.c
@@ -7,11 +7,11 @@
#undef PREFETCHW
#undef PAVGB
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
#define PREFETCH "prefetch"
#define PREFETCHW "prefetchw"
#define PAVGB "pavgusb"
-#elif defined ( HAVE_MMX2 )
+#elif HAVE_MMX2
#define PREFETCH "prefetchnta"
#define PREFETCHW "prefetcht0"
#define PAVGB "pavgb"
@@ -20,7 +20,7 @@
#define PREFETCHW " # nop"
#endif
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
/* On K6 femms is faster of emms. On K7 femms is directly mapped on emms. */
#define EMMS "femms"
#else
@@ -29,10 +29,10 @@
static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
int y;
-#if defined(FAST_OSD) && !defined(HAVE_MMX)
+#if defined(FAST_OSD) && !HAVE_MMX
w=w>>1;
#endif
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
"pcmpeqb %%mm5, %%mm5\n\t" // F..F
"movq %%mm5, %%mm4\n\t"
@@ -43,7 +43,7 @@ static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, u
#endif
for(y=0;y<h;y++){
register int x;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
PREFETCHW" %0\n\t"
PREFETCH" %1\n\t"
@@ -91,7 +91,7 @@ static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, u
srca+=srcstride;
dstbase+=dststride;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(EMMS:::"memory");
#endif
return;
@@ -99,10 +99,10 @@ static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, u
static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
int y;
-#if defined(FAST_OSD) && !defined(HAVE_MMX)
+#if defined(FAST_OSD) && !HAVE_MMX
w=w>>1;
#endif
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
"pxor %%mm7, %%mm7\n\t"
"pcmpeqb %%mm5, %%mm5\n\t" // F..F
@@ -114,7 +114,7 @@ static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, unsigned char* src, u
#endif
for(y=0;y<h;y++){
register int x;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
PREFETCHW" %0\n\t"
PREFETCH" %1\n\t"
@@ -163,7 +163,7 @@ static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, unsigned char* src, u
srca+=srcstride;
dstbase+=dststride;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(EMMS:::"memory");
#endif
return;
@@ -195,7 +195,7 @@ static inline void RENAME(vo_draw_alpha_uyvy)(int w,int h, unsigned char* src, u
static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
int y;
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(
"pxor %%mm7, %%mm7\n\t"
"pcmpeqb %%mm6, %%mm6\n\t" // F..F
@@ -204,8 +204,8 @@ static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src,
for(y=0;y<h;y++){
register unsigned char *dst = dstbase;
register int x;
-#if defined(ARCH_X86) && (!defined(ARCH_X86_64) || defined(HAVE_MMX))
-#ifdef HAVE_MMX
+#if ARCH_X86 && (!ARCH_X86_64 || HAVE_MMX)
+#if HAVE_MMX
__asm__ volatile(
PREFETCHW" %0\n\t"
PREFETCH" %1\n\t"
@@ -295,7 +295,7 @@ static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src,
srca+=srcstride;
dstbase+=dststride;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(EMMS:::"memory");
#endif
return;
@@ -306,8 +306,8 @@ static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src,
#ifdef WORDS_BIGENDIAN
dstbase++;
#endif
-#ifdef HAVE_MMX
-#ifdef HAVE_3DNOW
+#if HAVE_MMX
+#if HAVE_3DNOW
__asm__ volatile(
"pxor %%mm7, %%mm7\n\t"
"pcmpeqb %%mm6, %%mm6\n\t" // F..F
@@ -324,9 +324,9 @@ static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src,
#endif /* HAVE_MMX */
for(y=0;y<h;y++){
register int x;
-#if defined(ARCH_X86) && (!defined(ARCH_X86_64) || defined(HAVE_MMX))
-#ifdef HAVE_MMX
-#ifdef HAVE_3DNOW
+#if ARCH_X86 && (!ARCH_X86_64 || HAVE_MMX)
+#if HAVE_MMX
+#if HAVE_3DNOW
__asm__ volatile(
PREFETCHW" %0\n\t"
PREFETCH" %1\n\t"
@@ -460,7 +460,7 @@ static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src,
srca+=srcstride;
dstbase+=dststride;
}
-#ifdef HAVE_MMX
+#if HAVE_MMX
__asm__ volatile(EMMS:::"memory");
#endif
return;
diff --git a/libvo/vo_macosx.m b/libvo/vo_macosx.m
index dcce691354..38a9c9dbe9 100644
--- a/libvo/vo_macosx.m
+++ b/libvo/vo_macosx.m
@@ -50,8 +50,7 @@ BOOL shared_buffer = false;
static char *buffer_name;
//Screen
-int screen_id;
-BOOL screen_force;
+int screen_id = -1;
NSRect screen_frame;
NSScreen *screen_handle;
NSArray *screen_array;
@@ -110,13 +109,13 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_
screen_array = [NSScreen screens];
if(screen_id < [screen_array count])
{
- screen_handle = [screen_array objectAtIndex:screen_id];
+ screen_handle = [screen_array objectAtIndex:(screen_id < 0 ? 0 : screen_id)];
}
else
{
mp_msg(MSGT_VO, MSGL_FATAL, "Get device error: Device ID %d do not exist, falling back to main device.\n", screen_id);
screen_handle = [screen_array objectAtIndex:0];
- screen_id = 0;
+ screen_id = -1;
}
screen_frame = [screen_handle frame];
vo_screenwidth = screen_frame.size.width;
@@ -324,7 +323,7 @@ static void uninit(void)
}
static opt_t subopts[] = {
-{"device_id", OPT_ARG_INT, &screen_id, (opt_test_f)int_non_neg},
+{"device_id", OPT_ARG_INT, &screen_id, NULL},
{"shared_buffer", OPT_ARG_BOOL, &shared_buffer, NULL},
{"buffer_name", OPT_ARG_MSTRZ,&buffer_name, NULL},
{NULL}
@@ -334,7 +333,7 @@ static int preinit(const char *arg)
{
// set defaults
- screen_id = 0;
+ screen_id = -1;
shared_buffer = false;
buffer_name = NULL;
@@ -858,7 +857,7 @@ static int control(uint32_t request, void *data)
}
old_frame = [window frame]; //save main window size & position
- if(screen_force)
+ if(screen_id >= 0)
screen_frame = [screen_handle frame];
else {
screen_frame = [[window screen] frame];
diff --git a/loader/win32.c b/loader/win32.c
index 96ab76f691..71072afaeb 100644
--- a/loader/win32.c
+++ b/loader/win32.c
@@ -3328,7 +3328,7 @@ static WIN_BOOL WINAPI expFindNextFileA(HANDLE h,LPWIN32_FIND_DATAA lpfd)
strcpy(lpfd->cFileName,d->d_name);
// sprintf(lpfd->cAlternateFileName,"%-8s.qtx",d->d_name);
strcpy(lpfd->cAlternateFileName,"foobar.qtx");
- printf("### FindNext: %s\n",lpfd->cFileName);
+ dbgprintf("### FindNext: %s\n",lpfd->cFileName);
return 1;
}
closedir(qtx_dir); qtx_dir=NULL;
@@ -3345,7 +3345,7 @@ static HANDLE WINAPI expFindFirstFileA(LPCSTR s, LPWIN32_FIND_DATAA lpfd)
#ifdef QTX
if(strstr(s, "quicktime\\*.QTX")){
dbgprintf("FindFirstFileA(0x%x='%s', 0x%x) => QTX\n", s, s, lpfd);
- printf("\n### Searching for QuickTime plugins (*.qtx) at %s...\n",def_path);
+ dbgprintf("\n### Searching for QuickTime plugins (*.qtx) at %s...\n",def_path);
qtx_dir=opendir(def_path);
if(!qtx_dir) return (HANDLE)-1;
memset(lpfd,0,sizeof(*lpfd));
diff --git a/mencoder.c b/mencoder.c
index f397090e0f..11b40b49f1 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -427,7 +427,7 @@ audio_encoder_t *aencoder = NULL;
/* Test for cpu capabilities (and corresponding OS support) for optimizing */
GetCpuCaps(&gCpuCaps);
-#ifdef ARCH_X86
+#if ARCH_X86
mp_msg(MSGT_CPLAYER,MSGL_INFO,"CPUflags: Type: %d MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
gCpuCaps.cpuType,gCpuCaps.hasMMX,gCpuCaps.hasMMX2,
gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
@@ -436,22 +436,22 @@ audio_encoder_t *aencoder = NULL;
mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithRuntimeDetection);
#else
mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithCPUExtensions);
-#ifdef HAVE_MMX
+#if HAVE_MMX
mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX");
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX2");
#endif
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNow");
#endif
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNowEx");
#endif
-#ifdef HAVE_SSE
+#if HAVE_SSE
mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE");
#endif
-#ifdef HAVE_SSE2
+#if HAVE_SSE2
mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2");
#endif
mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n");
diff --git a/mp3lib/decod386.c b/mp3lib/decod386.c
index bda2a94bb6..50485cdc20 100644
--- a/mp3lib/decod386.c
+++ b/mp3lib/decod386.c
@@ -102,7 +102,7 @@ static int synth_1to1_mono2stereo(real *bandPtr,unsigned char *samples,int *pnt)
static synth_func_t synth_func;
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
#define dct64_base(a,b,c) if(gCpuCaps.hasAltiVec) dct64_altivec(a,b,c); else dct64(a,b,c)
#else /* HAVE_ALTIVEC */
#define dct64_base(a,b,c) dct64(a,b,c)
@@ -121,7 +121,7 @@ static int synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt)
*pnt += 128;
/* optimized for x86 */
-#ifdef ARCH_X86
+#if ARCH_X86
if ( synth_func )
{
// printf("Calling %p, bandPtr=%p channel=%d samples=%p\n",synth_func,bandPtr,channel,samples);
diff --git a/mp3lib/sr1.c b/mp3lib/sr1.c
index d31998f586..31a4a99a49 100644
--- a/mp3lib/sr1.c
+++ b/mp3lib/sr1.c
@@ -27,10 +27,12 @@
#include "libvo/fastmemcpy.h"
-#ifdef ARCH_X86_64
+#if ARCH_X86_64
// 3DNow! and 3DNow!Ext routines don't compile under AMD64
#undef HAVE_3DNOW
#undef HAVE_3DNOWEX
+#define HAVE_3DNOW 0
+#define HAVE_3DNOWEX 0
#endif
//static FILE* mp3_file=NULL;
@@ -134,7 +136,7 @@ LOCAL unsigned int getbits_fast(short number_of_bits)
// if(MP3_frames>=7741) printf("getbits_fast: bits=%d bitsleft=%d wordptr=%x\n",number_of_bits,bitsleft,wordpointer);
if((bitsleft-=number_of_bits)<0) return 0;
if(!number_of_bits) return 0;
-#ifdef ARCH_X86
+#if ARCH_X86
rval = bswap_16(*((uint16_t *)wordpointer));
#else
/*
@@ -177,7 +179,7 @@ LOCAL void set_pointer(int backstep)
LOCAL int stream_head_read(unsigned char *hbuf,uint32_t *newhead){
if(mp3_read(hbuf,4) != 4) return FALSE;
-#ifdef ARCH_X86
+#if ARCH_X86
*newhead = bswap_32(*((uint32_t*)hbuf));
#else
/*
@@ -413,7 +415,7 @@ void MP3_Init(void){
make_decode_tables(outscale);
-#ifdef HAVE_MMX
+#if HAVE_MMX
if (gCpuCaps.hasMMX)
{
_has_mmx = 1;
@@ -421,7 +423,7 @@ void MP3_Init(void){
}
#endif
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
if (gCpuCaps.has3DNowExt)
{
dct36_func=dct36_3dnowex;
@@ -430,7 +432,7 @@ void MP3_Init(void){
}
else
#endif
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
if (gCpuCaps.has3DNow)
{
dct36_func = dct36_3dnow;
@@ -439,7 +441,7 @@ void MP3_Init(void){
}
else
#endif
-#ifdef HAVE_SSE
+#if HAVE_SSE
if (gCpuCaps.hasSSE)
{
dct64_MMX_func = dct64_sse;
@@ -447,8 +449,8 @@ void MP3_Init(void){
}
else
#endif
-#ifdef ARCH_X86_32
-#ifdef HAVE_MMX
+#if ARCH_X86_32
+#if HAVE_MMX
if (gCpuCaps.hasMMX)
{
dct64_MMX_func = dct64_MMX;
@@ -463,7 +465,7 @@ void MP3_Init(void){
}
else
#endif /* ARCH_X86_32 */
-#ifdef HAVE_ALTIVEC
+#if HAVE_ALTIVEC
if (gCpuCaps.hasAltiVec)
{
mp_msg(MSGT_DECAUDIO,MSGL_V,"mp3lib: using AltiVec optimized decore!\n");
diff --git a/mplayer.c b/mplayer.c
index 955c143786..e5594f8a7d 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -1947,7 +1947,7 @@ static int fill_audio_out_buffers(struct MPContext *mpctx)
// handle audio-only case:
// this is where mplayer sleeps during audio-only playback
// to avoid 100% CPU use
- sleep_time = (ao_data.outburst - bytes_to_write) * 1000 / ao_data.samplerate;
+ sleep_time = (ao_data.outburst - bytes_to_write) * 1000 / ao_data.bps;
if (sleep_time < 10) sleep_time = 10; // limit to 100 wakeups per second
usec_sleep(sleep_time * 1000);
}
@@ -2412,7 +2412,7 @@ static void print_version(void){
/* Test for CPU capabilities (and corresponding OS support) for optimizing */
GetCpuCaps(&gCpuCaps);
-#ifdef ARCH_X86
+#if ARCH_X86
mp_msg(MSGT_CPLAYER,MSGL_INFO,"CPUflags: MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
gCpuCaps.hasMMX,gCpuCaps.hasMMX2,
gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
@@ -2421,22 +2421,22 @@ static void print_version(void){
mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithRuntimeDetection);
#else
mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithCPUExtensions);
-#ifdef HAVE_MMX
+#if HAVE_MMX
mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX");
#endif
-#ifdef HAVE_MMX2
+#if HAVE_MMX2
mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX2");
#endif
-#ifdef HAVE_3DNOW
+#if HAVE_3DNOW
mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNow");
#endif
-#ifdef HAVE_3DNOWEX
+#if HAVE_3DNOWEX
mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNowEx");
#endif
-#ifdef HAVE_SSE
+#if HAVE_SSE
mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE");
#endif
-#ifdef HAVE_SSE2
+#if HAVE_SSE2
mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2");
#endif
mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n");
diff --git a/osdep/mplayer.rc b/osdep/mplayer.rc
index 3bcfdb2197..4b0c1cd74e 100644
--- a/osdep/mplayer.rc
+++ b/osdep/mplayer.rc
@@ -21,7 +21,7 @@ FILETYPE VFT_APP
VALUE "FileDescription", "MPlayer - Movie Player\000"
VALUE "FileVersion",VERSION
VALUE "InternalName", "Counter Counter\000"
- VALUE "LegalCopyright", " (C) 2000-2008 MPlayer Team\000"
+ VALUE "LegalCopyright", " (C) 2000-2009 MPlayer Team\000"
//VALUE "LegalTrademarks"," \000";
VALUE "OriginalFilename", "mplayer.exe\000"
VALUE "ProductName", "MPlayer - The Movie Player\000"
diff --git a/vidix/dha.c b/vidix/dha.c
index 638be29328..8a2d8fd1cd 100644
--- a/vidix/dha.c
+++ b/vidix/dha.c
@@ -43,7 +43,7 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
#include <sys/io.h>
#endif
#include <unistd.h>
@@ -91,7 +91,7 @@ static int mem_fd = -1;
void *map_phys_mem(unsigned long base, unsigned long size)
{
-#ifdef ARCH_ALPHA
+#if ARCH_ALPHA
/* TODO: move it into sysdep */
base += bus_base();
#endif