From a0dab6c1c0199756a00c6adfbcf4376baeff07fc Mon Sep 17 00:00:00 2001 From: cehoyos Date: Tue, 31 Mar 2009 22:06:40 +0000 Subject: Prefer vo vdpau over vo xv where available. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29118 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/video_out.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libvo/video_out.c b/libvo/video_out.c index fac5ed90c9..81f938b301 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -174,12 +174,12 @@ const vo_functions_t* const video_out_drivers[] = #ifdef CONFIG_3DFX &video_out_3dfx, #endif -#ifdef CONFIG_XV - &video_out_xv, -#endif #if CONFIG_VDPAU &video_out_vdpau, #endif +#ifdef CONFIG_XV + &video_out_xv, +#endif #ifdef CONFIG_X11 &video_out_x11, &video_out_xover, -- cgit v1.2.3 From 32739e5d34b7d6bfdc148051c7feb9aaf22d6f71 Mon Sep 17 00:00:00 2001 From: mru Date: Wed, 1 Apr 2009 00:54:23 +0000 Subject: Make examples and test progs depend on libraries git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29119 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libswscale/Makefile b/libswscale/Makefile index bf75b64959..ce0f7cebc1 100644 --- a/libswscale/Makefile +++ b/libswscale/Makefile @@ -24,8 +24,3 @@ TESTPROGS = colorspace DIRS = bfin mlib ppc sparc x86 include $(SUBDIR)../subdir.mak - -$(SUBDIR)colorspace-test$(EXESUF): $(SUBDIR)colorspace-test.o $(SUBDIR)$(LIBNAME) - -$(SUBDIR)swscale-example$(EXESUF): $(SUBDIR)swscale-example.o $(SUBDIR)$(LIBNAME) -$(SUBDIR)swscale-example$(EXESUF): EXTRALIBS += -lm -- cgit v1.2.3 From 49ed91fa23f7703b3946481afc6aba4027e2d23d Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 1 Apr 2009 08:46:03 +0000 Subject: At least direct3d vo supports -xineramascreen, too git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29120 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 930ce5a4af..fe823548f2 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3296,7 +3296,7 @@ This option is not suitable to only set the startup screen (because it will always display on the given screen in fullscreen mode), \-geometry is the best that is available for that purpose currently. -Supported by the gl, gl2, x11, and xv video output drivers. +Supported by at least the direct3d, gl, gl2, x11 and xv video output drivers. . .TP .B \-zrbw (\-vo zr only) -- cgit v1.2.3 From b5fcf45f119afc9239070596f846dfa18903d1c4 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 1 Apr 2009 09:24:46 +0000 Subject: Increase probe buffer size to 32kB, this makes ac3 auto-detection far more reliable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29121 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_lavf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index 9749054a03..5383e161c8 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -41,7 +41,7 @@ #include "mp_taglists.h" -#define PROBE_BUF_SIZE 2048 +#define PROBE_BUF_SIZE (32*1024) extern char *audio_lang; extern char *dvdsub_lang; -- cgit v1.2.3 From a38ca08ca019c5289d5968652344797534364d34 Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 1 Apr 2009 16:27:03 +0000 Subject: Remove unused variable along with the related warning. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29122 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 70a94303e6..a170bcc1b1 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -1094,7 +1094,6 @@ fail: static int ifo_stream_open (stream_t *stream, int mode, void *opts, int *file_format) { - char *ext; char* filename; struct stream_priv_s *spriv; int len = strlen(stream->url); -- cgit v1.2.3 From df53cdd57da2b96121c0874adbd12d8c52cc8e56 Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 1 Apr 2009 16:28:25 +0000 Subject: Add config.h #include, necessary for HAVE_MALLOC_H check. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29123 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/parse_mp4.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libmpdemux/parse_mp4.c b/libmpdemux/parse_mp4.c index 79770f821c..ed801d73e5 100644 --- a/libmpdemux/parse_mp4.c +++ b/libmpdemux/parse_mp4.c @@ -21,6 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "config.h" #include #include #if HAVE_MALLOC_H -- cgit v1.2.3 From b578fedf779477d0036d0400d76ba066bf77d9da Mon Sep 17 00:00:00 2001 From: bcoudurier Date: Thu, 2 Apr 2009 02:31:17 +0000 Subject: override codec tag for pcm s32le and s32be, used in mov git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29124 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/mp_taglists.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmpdemux/mp_taglists.c b/libmpdemux/mp_taglists.c index 98564b5916..eda322d210 100644 --- a/libmpdemux/mp_taglists.c +++ b/libmpdemux/mp_taglists.c @@ -60,6 +60,8 @@ static const AVCodecTag mp_wav_override_tags[] = { { CODEC_ID_PCM_S16LE, 1}, { CODEC_ID_PCM_S24BE, MKTAG('i', 'n', '2', '4')}, { CODEC_ID_PCM_S24LE, 1}, + { CODEC_ID_PCM_S32BE, MKTAG('i', 'n', '3', '2')}, + { CODEC_ID_PCM_S32LE, 1}, { 0, 0 }, }; -- cgit v1.2.3 From 77416e41cf8cad188b10004e8145963e6294e61d Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 2 Apr 2009 08:42:16 +0000 Subject: Add recently added FFmpeg subdirs to DIRS variable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29125 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile b/Makefile index 263f3cd839..663fb0b9f6 100644 --- a/Makefile +++ b/Makefile @@ -745,6 +745,12 @@ DIRS = . \ libavcodec/x86 \ libavformat \ libavutil \ + libavutil/arm \ + libavutil/bfin \ + libavutil/bfin \ + libavutil/ppc \ + libavutil/sh4 \ + libavutil/x86 \ libdvdcss \ libdvdnav \ libdvdnav/vm \ @@ -757,6 +763,11 @@ DIRS = . \ libmpeg2 \ libpostproc \ libswscale \ + libswscale/bfin \ + libswscale/mlib \ + libswscale/ppc \ + libswscale/sparc \ + libswscale/x86 \ libvo \ loader \ loader/dshow \ -- cgit v1.2.3 From 2e903f7c752dceb15988ac04f81a5de12a7a0a13 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 2 Apr 2009 09:20:48 +0000 Subject: Remove unnecessary malloc.h #includes and related #ifdeffery. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29126 b3059339-0415-0410-9bf9-f77b7e298cf2 --- cpudetect.c | 3 --- libaf/af.c | 4 ---- libmenu/vf_menu.c | 4 ---- libmpcodecs/dec_audio.c | 4 ---- libmpcodecs/dec_video.c | 3 --- libmpcodecs/vd.c | 4 ---- libmpcodecs/vf_boxblur.c | 6 ------ libmpcodecs/vf_delogo.c | 6 ------ libmpcodecs/vf_denoise3d.c | 6 ------ libmpcodecs/vf_fspp.c | 5 ----- libmpcodecs/vf_hqdn3d.c | 6 ------ libmpcodecs/vf_il.c | 6 ------ libmpcodecs/vf_kerndeint.c | 6 ------ libmpcodecs/vf_mcdeint.c | 6 ------ libmpcodecs/vf_ow.c | 7 ------- libmpcodecs/vf_qp.c | 6 ------ libmpcodecs/vf_smartblur.c | 6 ------ libmpcodecs/vf_spp.c | 4 ---- libmpcodecs/vf_swapuv.c | 6 ------ libmpcodecs/vf_uspp.c | 4 ---- libmpcodecs/vf_yadif.c | 5 ----- libmpdemux/parse_mp4.c | 4 ---- libvo/vo_dxr3.c | 3 --- loader/drv.c | 3 --- loader/ext.c | 3 --- loader/win32.c | 3 --- 26 files changed, 123 deletions(-) diff --git a/cpudetect.c b/cpudetect.c index 62afe5895e..b5eb47e970 100644 --- a/cpudetect.c +++ b/cpudetect.c @@ -4,9 +4,6 @@ CpuCaps gCpuCaps; -#if HAVE_MALLOC_H -#include -#endif #include #if ARCH_X86 diff --git a/libaf/af.c b/libaf/af.c index 33819c71a5..ca25e44a9e 100644 --- a/libaf/af.c +++ b/libaf/af.c @@ -21,10 +21,6 @@ #include #include -#if HAVE_MALLOC_H -#include -#endif - #include "af.h" // Static list of filters diff --git a/libmenu/vf_menu.c b/libmenu/vf_menu.c index 7f93b1a840..8fe82b351c 100644 --- a/libmenu/vf_menu.c +++ b/libmenu/vf_menu.c @@ -24,10 +24,6 @@ #include #include -#if HAVE_MALLOC_H -#include -#endif - #include "mplayer.h" #include "mp_msg.h" diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c index 79073d03e3..a15640c552 100644 --- a/libmpcodecs/dec_audio.c +++ b/libmpcodecs/dec_audio.c @@ -19,10 +19,6 @@ #include "libaf/af.h" -#if HAVE_MALLOC_H -#include -#endif - #ifdef CONFIG_DYNAMIC_PLUGINS #include #endif diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index 4186bd5e72..d5137e5fa8 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -2,9 +2,6 @@ #include "config.h" #include -#if HAVE_MALLOC_H -#include -#endif #include #include diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c index fa2f74ef00..9f1b2ee2c8 100644 --- a/libmpcodecs/vd.c +++ b/libmpcodecs/vd.c @@ -6,10 +6,6 @@ #include "mp_msg.h" #include "help_mp.h" -#if HAVE_MALLOC_H -#include -#endif - #include "codec-cfg.h" //#include "mp_image.h" diff --git a/libmpcodecs/vf_boxblur.c b/libmpcodecs/vf_boxblur.c index f322619104..e830841027 100644 --- a/libmpcodecs/vf_boxblur.c +++ b/libmpcodecs/vf_boxblur.c @@ -24,13 +24,7 @@ #include #include -#include "config.h" #include "mp_msg.h" - -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpcodecs/vf_delogo.c b/libmpcodecs/vf_delogo.c index 3ab2ab5f8f..c6396d4aa0 100644 --- a/libmpcodecs/vf_delogo.c +++ b/libmpcodecs/vf_delogo.c @@ -26,14 +26,8 @@ #include #include -#include "config.h" #include "mp_msg.h" #include "cpudetect.h" - -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpcodecs/vf_denoise3d.c b/libmpcodecs/vf_denoise3d.c index 6899045611..0958305936 100644 --- a/libmpcodecs/vf_denoise3d.c +++ b/libmpcodecs/vf_denoise3d.c @@ -24,13 +24,7 @@ #include #include -#include "config.h" #include "mp_msg.h" - -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpcodecs/vf_fspp.c b/libmpcodecs/vf_fspp.c index 5acdfb3602..55b28c7439 100644 --- a/libmpcodecs/vf_fspp.c +++ b/libmpcodecs/vf_fspp.c @@ -42,11 +42,6 @@ #include "mp_msg.h" #include "cpudetect.h" - -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpcodecs/vf_hqdn3d.c b/libmpcodecs/vf_hqdn3d.c index e0b6f78bb1..348e731449 100644 --- a/libmpcodecs/vf_hqdn3d.c +++ b/libmpcodecs/vf_hqdn3d.c @@ -24,13 +24,7 @@ #include #include -#include "config.h" #include "mp_msg.h" - -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpcodecs/vf_il.c b/libmpcodecs/vf_il.c index cd6ba0490b..9a38d2ac33 100644 --- a/libmpcodecs/vf_il.c +++ b/libmpcodecs/vf_il.c @@ -24,13 +24,7 @@ #include #include -#include "config.h" #include "mp_msg.h" - -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpcodecs/vf_kerndeint.c b/libmpcodecs/vf_kerndeint.c index ac51acfb3b..a2bc0ed0c0 100644 --- a/libmpcodecs/vf_kerndeint.c +++ b/libmpcodecs/vf_kerndeint.c @@ -25,13 +25,7 @@ #include #include -#include "config.h" #include "mp_msg.h" - -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpcodecs/vf_mcdeint.c b/libmpcodecs/vf_mcdeint.c index aae4872537..ecb79957be 100644 --- a/libmpcodecs/vf_mcdeint.c +++ b/libmpcodecs/vf_mcdeint.c @@ -51,8 +51,6 @@ Known Issues: #include #include -#include "config.h" - #include "mp_msg.h" #include "cpudetect.h" @@ -65,10 +63,6 @@ Known Issues: #undef free #undef malloc -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpcodecs/vf_ow.c b/libmpcodecs/vf_ow.c index 59c4e22852..81ad5fbc77 100644 --- a/libmpcodecs/vf_ow.c +++ b/libmpcodecs/vf_ow.c @@ -32,14 +32,7 @@ #include #include -#include "config.h" - #include "mp_msg.h" - -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpcodecs/vf_qp.c b/libmpcodecs/vf_qp.c index 8a345a9f03..bd8e561d76 100644 --- a/libmpcodecs/vf_qp.c +++ b/libmpcodecs/vf_qp.c @@ -24,8 +24,6 @@ #include #include -#include "config.h" - #include "mp_msg.h" #include "cpudetect.h" #include "img_format.h" @@ -36,10 +34,6 @@ #include "libavcodec/avcodec.h" #include "libavcodec/eval.h" -#if HAVE_MALLOC_H -#include -#endif - struct vf_priv_s { char eq[200]; diff --git a/libmpcodecs/vf_smartblur.c b/libmpcodecs/vf_smartblur.c index b18f54436a..ebe18dc840 100644 --- a/libmpcodecs/vf_smartblur.c +++ b/libmpcodecs/vf_smartblur.c @@ -24,13 +24,7 @@ #include #include -#include "config.h" #include "mp_msg.h" - -#if HAVE_MALLOC_H -#include -#endif - #include "libavutil/avutil.h" #include "img_format.h" #include "mp_image.h" diff --git a/libmpcodecs/vf_spp.c b/libmpcodecs/vf_spp.c index ebce63601f..6d478e92ae 100644 --- a/libmpcodecs/vf_spp.c +++ b/libmpcodecs/vf_spp.c @@ -46,10 +46,6 @@ #undef free #undef malloc -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpcodecs/vf_swapuv.c b/libmpcodecs/vf_swapuv.c index db32686c40..2ac52a39aa 100644 --- a/libmpcodecs/vf_swapuv.c +++ b/libmpcodecs/vf_swapuv.c @@ -24,13 +24,7 @@ #include #include -#include "config.h" #include "mp_msg.h" - -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpcodecs/vf_uspp.c b/libmpcodecs/vf_uspp.c index 57186698c7..64e08749fa 100644 --- a/libmpcodecs/vf_uspp.c +++ b/libmpcodecs/vf_uspp.c @@ -32,10 +32,6 @@ #include "libavcodec/avcodec.h" -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpcodecs/vf_yadif.c b/libmpcodecs/vf_yadif.c index 0eecb7fb82..4b408a2e21 100644 --- a/libmpcodecs/vf_yadif.c +++ b/libmpcodecs/vf_yadif.c @@ -28,11 +28,6 @@ #include "cpudetect.h" #include "mp_msg.h" - -#if HAVE_MALLOC_H -#include -#endif - #include "img_format.h" #include "mp_image.h" #include "vf.h" diff --git a/libmpdemux/parse_mp4.c b/libmpdemux/parse_mp4.c index ed801d73e5..f2a39abe6e 100644 --- a/libmpdemux/parse_mp4.c +++ b/libmpdemux/parse_mp4.c @@ -21,12 +21,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "config.h" #include #include -#if HAVE_MALLOC_H -#include -#endif #include #include "parse_mp4.h" #include "mp_msg.h" diff --git a/libvo/vo_dxr3.c b/libvo/vo_dxr3.c index c5fa8a970d..de1f2b47ac 100644 --- a/libvo/vo_dxr3.c +++ b/libvo/vo_dxr3.c @@ -37,9 +37,6 @@ #include "config.h" #include "mp_msg.h" #include "help_mp.h" -#if HAVE_MALLOC_H -#include -#endif #include "fastmemcpy.h" #include "video_out.h" diff --git a/loader/drv.c b/loader/drv.c index e3fb4da116..43d9485646 100644 --- a/loader/drv.c +++ b/loader/drv.c @@ -7,9 +7,6 @@ #include "debug.h" #include -#if HAVE_MALLOC_H -#include -#endif #include #ifdef __FreeBSD__ #include diff --git a/loader/ext.c b/loader/ext.c index 0486f7c09b..b57eed674b 100644 --- a/loader/ext.c +++ b/loader/ext.c @@ -14,9 +14,6 @@ #include "config.h" #include #include -#if HAVE_MALLOC_H -#include -#endif #include #ifdef HAVE_SYS_MMAN_H #include diff --git a/loader/win32.c b/loader/win32.c index 3aded84674..4287c5b0b1 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -53,9 +53,6 @@ for DLL to know too much about its environment. #include #include #include -#if HAVE_MALLOC_H -#include -#endif #include #include #include -- cgit v1.2.3 From 755c96e95306fc0f48a6da4c13486db8f593fcdf Mon Sep 17 00:00:00 2001 From: ramiro Date: Thu, 2 Apr 2009 18:31:22 +0000 Subject: swscale: Execute sfence and emms depending on runtime flags. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29127 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index ecf5c10131..04e9d17a64 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -26,15 +26,6 @@ #undef PAVGB #undef PREFETCH #undef PREFETCHW -#undef EMMS -#undef SFENCE - -#if HAVE_AMD3DNOW -/* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */ -#define EMMS "femms" -#else -#define EMMS "emms" -#endif #if HAVE_AMD3DNOW #define PREFETCH "prefetch" @@ -47,12 +38,6 @@ #define PREFETCHW " # nop" #endif -#if HAVE_MMX2 -#define SFENCE "sfence" -#else -#define SFENCE " # nop" -#endif - #if HAVE_MMX2 #define PAVGB(a,b) "pavgb " #a ", " #b " \n\t" #elif HAVE_AMD3DNOW @@ -3209,8 +3194,10 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s fillPlane(dst[3], dstStride[3], dstW, dstY-lastDstY, lastDstY, 255); #if HAVE_MMX - __asm__ volatile(SFENCE:::"memory"); - __asm__ volatile(EMMS:::"memory"); + if (flags & SWS_CPU_CAPS_MMX2 ) __asm__ volatile("sfence":::"memory"); + /* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */ + if (flags & SWS_CPU_CAPS_3DNOW) __asm__ volatile("femms" :::"memory"); + else __asm__ volatile("emms" :::"memory"); #endif /* store changed local vars back in the context */ c->dstY= dstY; -- cgit v1.2.3 From 9574441a1cf640c96ad41ac389c8fc0e34d77127 Mon Sep 17 00:00:00 2001 From: ramiro Date: Thu, 2 Apr 2009 18:32:49 +0000 Subject: swscale: Split h[yc]scale_fast() into their own functions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29128 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 61 +++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 04e9d17a64..28b023ea98 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2243,6 +2243,22 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW #endif /* HAVE_ALTIVEC */ #endif /* HAVE_MMX */ } + +static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, + int dstWidth, uint8_t *src, int srcW, + int xInc) +{ + int i; + unsigned int xpos=0; + for (i=0;i>16; + register unsigned int xalpha=(xpos&0xFFFF)>>9; + dst[i]= (src[xx]<<7) + (src[xx+1] - src[xx])*xalpha; + xpos+=xInc; + } +} + // *** horizontal scale Y line to temp buffer static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, uint8_t *src, int srcW, int xInc, int flags, int canMMX2BeUsed, int16_t *hLumFilter, @@ -2465,15 +2481,7 @@ FUNNY_Y_CODE } //if MMX2 can't be used #endif #else - int i; - unsigned int xpos=0; - for (i=0;i>16; - register unsigned int xalpha=(xpos&0xFFFF)>>9; - dst[i]= (src[xx]<<7) + (src[xx+1] - src[xx])*xalpha; - xpos+=xInc; - } + RENAME(hyscale_fast)(c, dst, dstWidth, src, srcW, xInc); #endif /* ARCH_X86 */ } @@ -2491,6 +2499,26 @@ FUNNY_Y_CODE } } +static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst, + int dstWidth, uint8_t *src1, + uint8_t *src2, int srcW, int xInc) +{ + int i; + unsigned int xpos=0; + for (i=0;i>16; + register unsigned int xalpha=(xpos&0xFFFF)>>9; + dst[i]=(src1[xx]*(xalpha^127)+src1[xx+1]*xalpha); + dst[i+VOFW]=(src2[xx]*(xalpha^127)+src2[xx+1]*xalpha); + /* slower + dst[i]= (src1[xx]<<7) + (src1[xx+1] - src1[xx])*xalpha; + dst[i+VOFW]=(src2[xx]<<7) + (src2[xx+1] - src2[xx])*xalpha; + */ + xpos+=xInc; + } +} + inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, uint8_t *src1, uint8_t *src2, int srcW, int xInc, int flags, int canMMX2BeUsed, int16_t *hChrFilter, int16_t *hChrFilterPos, int hChrFilterSize, void *funnyUVCode, @@ -2754,20 +2782,7 @@ FUNNY_UV_CODE } //if MMX2 can't be used #endif #else - int i; - unsigned int xpos=0; - for (i=0;i>16; - register unsigned int xalpha=(xpos&0xFFFF)>>9; - dst[i]=(src1[xx]*(xalpha^127)+src1[xx+1]*xalpha); - dst[i+VOFW]=(src2[xx]*(xalpha^127)+src2[xx+1]*xalpha); - /* slower - dst[i]= (src1[xx]<<7) + (src1[xx+1] - src1[xx])*xalpha; - dst[i+VOFW]=(src2[xx]<<7) + (src2[xx+1] - src2[xx])*xalpha; - */ - xpos+=xInc; - } + RENAME(hcscale_fast)(c, dst, dstWidth, src1, src2, srcW, xInc); #endif /* ARCH_X86 */ } if(c->srcRange != c->dstRange && !(isRGB(c->dstFormat) || isBGR(c->dstFormat))){ -- cgit v1.2.3 From 96323d1d5dbdca7383405a075a9979720bb0a4b0 Mon Sep 17 00:00:00 2001 From: ramiro Date: Thu, 2 Apr 2009 18:34:11 +0000 Subject: swscale: Remove mmx2 params from h[yc]scale(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29129 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 65 ++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 28b023ea98..4562866b7b 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2261,11 +2261,16 @@ static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, // *** horizontal scale Y line to temp buffer static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, uint8_t *src, int srcW, int xInc, - int flags, int canMMX2BeUsed, int16_t *hLumFilter, - int16_t *hLumFilterPos, int hLumFilterSize, void *funnyYCode, - int srcFormat, uint8_t *formatConvBuffer, int16_t *mmx2Filter, - int32_t *mmx2FilterPos, uint32_t *pal, int isAlpha) + int flags, int16_t *hLumFilter, + int16_t *hLumFilterPos, int hLumFilterSize, + int srcFormat, uint8_t *formatConvBuffer, + uint32_t *pal, int isAlpha) { + int32_t *mmx2FilterPos = c->lumMmx2FilterPos; + int16_t *mmx2Filter = c->lumMmx2Filter; + int canMMX2BeUsed = c->canMMX2BeUsed; + void *funnyYCode = c->funnyYCode; + if (srcFormat==PIX_FMT_YUYV422 || srcFormat==PIX_FMT_GRAY16BE) { RENAME(yuy2ToY)(formatConvBuffer, src, srcW, pal); @@ -2520,11 +2525,16 @@ static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst, } inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, uint8_t *src1, uint8_t *src2, - int srcW, int xInc, int flags, int canMMX2BeUsed, int16_t *hChrFilter, - int16_t *hChrFilterPos, int hChrFilterSize, void *funnyUVCode, - int srcFormat, uint8_t *formatConvBuffer, int16_t *mmx2Filter, - int32_t *mmx2FilterPos, uint32_t *pal) + int srcW, int xInc, int flags, int16_t *hChrFilter, + int16_t *hChrFilterPos, int hChrFilterSize, + int srcFormat, uint8_t *formatConvBuffer, + uint32_t *pal) { + int32_t *mmx2FilterPos = c->chrMmx2FilterPos; + int16_t *mmx2Filter = c->chrMmx2Filter; + int canMMX2BeUsed = c->canMMX2BeUsed; + void *funnyUVCode = c->funnyUVCode; + if (srcFormat==PIX_FMT_YUYV422) { RENAME(yuy2ToUV)(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal); @@ -2817,7 +2827,6 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s const int dstFormat= c->dstFormat; const int srcFormat= c->srcFormat; const int flags= c->flags; - const int canMMX2BeUsed= c->canMMX2BeUsed; int16_t *vLumFilterPos= c->vLumFilterPos; int16_t *vChrFilterPos= c->vChrFilterPos; int16_t *hLumFilterPos= c->hLumFilterPos; @@ -2838,8 +2847,6 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s int16_t **alpPixBuf= c->alpPixBuf; const int vLumBufSize= c->vLumBufSize; const int vChrBufSize= c->vChrBufSize; - uint8_t *funnyYCode= c->funnyYCode; - uint8_t *funnyUVCode= c->funnyUVCode; uint8_t *formatConvBuffer= c->formatConvBuffer; const int chrSrcSliceY= srcSliceY >> c->chrSrcVSubSample; const int chrSrcSliceH= -((-srcSliceH) >> c->chrSrcVSubSample); @@ -2942,14 +2949,14 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s assert(lastInLumBuf + 1 - srcSliceY >= 0); //printf("%d %d\n", lumBufIndex, vLumBufSize); RENAME(hyscale)(c, lumPixBuf[ lumBufIndex ], dstW, src1, srcW, lumXInc, - flags, canMMX2BeUsed, hLumFilter, hLumFilterPos, hLumFilterSize, - funnyYCode, c->srcFormat, formatConvBuffer, - c->lumMmx2Filter, c->lumMmx2FilterPos, pal, 0); + flags, hLumFilter, hLumFilterPos, hLumFilterSize, + c->srcFormat, formatConvBuffer, + pal, 0); if (CONFIG_SWSCALE_ALPHA && alpPixBuf) RENAME(hyscale)(c, alpPixBuf[ lumBufIndex ], dstW, src2, srcW, lumXInc, - flags, canMMX2BeUsed, hLumFilter, hLumFilterPos, hLumFilterSize, - funnyYCode, c->srcFormat, formatConvBuffer, - c->lumMmx2Filter, c->lumMmx2FilterPos, pal, 1); + flags, hLumFilter, hLumFilterPos, hLumFilterSize, + c->srcFormat, formatConvBuffer, + pal, 1); lastInLumBuf++; } while(lastInChrBuf < lastChrSrcY) @@ -2964,9 +2971,9 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s if (!(isGray(srcFormat) || isGray(dstFormat))) RENAME(hcscale)(c, chrPixBuf[ chrBufIndex ], chrDstW, src1, src2, chrSrcW, chrXInc, - flags, canMMX2BeUsed, hChrFilter, hChrFilterPos, hChrFilterSize, - funnyUVCode, c->srcFormat, formatConvBuffer, - c->chrMmx2Filter, c->chrMmx2FilterPos, pal); + flags, hChrFilter, hChrFilterPos, hChrFilterSize, + c->srcFormat, formatConvBuffer, + pal); lastInChrBuf++; } //wrap buf index around to stay inside the ring buffer @@ -2990,14 +2997,14 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s assert(lastInLumBuf + 1 - srcSliceY < srcSliceH); assert(lastInLumBuf + 1 - srcSliceY >= 0); RENAME(hyscale)(c, lumPixBuf[ lumBufIndex ], dstW, src1, srcW, lumXInc, - flags, canMMX2BeUsed, hLumFilter, hLumFilterPos, hLumFilterSize, - funnyYCode, c->srcFormat, formatConvBuffer, - c->lumMmx2Filter, c->lumMmx2FilterPos, pal, 0); + flags, hLumFilter, hLumFilterPos, hLumFilterSize, + c->srcFormat, formatConvBuffer, + pal, 0); if (CONFIG_SWSCALE_ALPHA && alpPixBuf) RENAME(hyscale)(c, alpPixBuf[ lumBufIndex ], dstW, src2, srcW, lumXInc, - flags, canMMX2BeUsed, hLumFilter, hLumFilterPos, hLumFilterSize, - funnyYCode, c->srcFormat, formatConvBuffer, - c->lumMmx2Filter, c->lumMmx2FilterPos, pal, 1); + flags, hLumFilter, hLumFilterPos, hLumFilterSize, + c->srcFormat, formatConvBuffer, + pal, 1); lastInLumBuf++; } while(lastInChrBuf+1 < (chrSrcSliceY + chrSrcSliceH)) @@ -3011,9 +3018,9 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s if (!(isGray(srcFormat) || isGray(dstFormat))) RENAME(hcscale)(c, chrPixBuf[ chrBufIndex ], chrDstW, src1, src2, chrSrcW, chrXInc, - flags, canMMX2BeUsed, hChrFilter, hChrFilterPos, hChrFilterSize, - funnyUVCode, c->srcFormat, formatConvBuffer, - c->chrMmx2Filter, c->chrMmx2FilterPos, pal); + flags, hChrFilter, hChrFilterPos, hChrFilterSize, + c->srcFormat, formatConvBuffer, + pal); lastInChrBuf++; } //wrap buf index around to stay inside the ring buffer -- cgit v1.2.3 From 06c07eb5c0eb81fe511f7e811518ac53723f6eae Mon Sep 17 00:00:00 2001 From: cehoyos Date: Thu, 2 Apr 2009 18:38:15 +0000 Subject: Fix compilation with libavcodec's HWACCEL. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29130 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure b/configure index b341984112..98a39e7b09 100755 --- a/configure +++ b/configure @@ -8819,6 +8819,11 @@ $def_xvid_lavc `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"` `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"` +#define CONFIG_H263_VAAPI_HWACCEL 0 +#define CONFIG_MPEG2_VAAPI_HWACCEL 0 +#define CONFIG_MPEG4_VAAPI_HWACCEL 0 +#define CONFIG_H264_VAAPI_HWACCEL 0 + #endif /* MPLAYER_CONFIG_H */ EOF -- cgit v1.2.3 From a4861528c64049f52dd743bcbbdc76eef3171303 Mon Sep 17 00:00:00 2001 From: bircoph Date: Thu, 2 Apr 2009 19:01:23 +0000 Subject: Support for libbs2b audio filter. Add auto detection and selection routines to configure. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29131 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/configure b/configure index 98a39e7b09..c7c5aaa6b5 100755 --- a/configure +++ b/configure @@ -326,6 +326,7 @@ Codecs: --disable-faac disable support for FAAC (AAC encoder) [autodetect] --disable-faac-lavc disable support for FAAC in libavcodec [autodetect] --disable-ladspa disable LADSPA plugin support [autodetect] + --disable-libbs2b disable libbs2b audio filter support [autodetect] --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect] --disable-mad disable libmad (MPEG audio) support [autodetect] --disable-mp3lame disable LAME MP3 encoding support [autodetect] @@ -616,6 +617,7 @@ _faad_fixed=no _faac=auto _faac_lavc=auto _ladspa=auto +_libbs2b=auto _xmms=no _dvdnav=auto _dvdnavconfig=dvdnav-config @@ -1013,6 +1015,8 @@ for ac_option do --disable-faac-lavc) _faac_lavc=no ;; --enable-ladspa) _ladspa=yes ;; --disable-ladspa) _ladspa=no ;; + --enable-libbs2b) _libbs2b=yes ;; + --disable-libbs2b) _libbs2b=no ;; --enable-xmms) _xmms=yes ;; --disable-xmms) _xmms=no ;; --enable-dvdread) _dvdread=yes ;; @@ -6597,6 +6601,43 @@ fi echores "$_ladspa" +echocheck "libbs2b audio filter support" +if test "$_libbs2b" = auto ; then + cat > $TMPC < +#if BS2B_VERSION_MAJOR < 3 +#error Please use libbs2b >= 3.0.0, older versions are not supported. +#endif +int main(void) { + t_bs2bdp filter; + filter=bs2b_open(); + bs2b_close(filter); + return 0; +} +EOF + _libbs2b=no + if $_pkg_config --exists libbs2b ; then + _inc_tmp=$($_pkg_config --cflags libbs2b) + _ld_tmp=$($_pkg_config --libs libbs2b) + cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && + extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes + else + for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \ + -I/usr/local/include/bs2b ; do + if cc_check $_inc_tmp $_ld_lm -lbs2b ; then + extra_ldflags="$extra_ldflags -lbs2b" + extra_cflags="$extra_cflags $_inc_tmp" + _libbs2b=yes + break + fi + done + fi +fi +def_libbs2b="#undef CONFIG_LIBBS2B" +test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B" +echores "$_libbs2b" + + if test -z "$_codecsdir" ; then for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \ /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do @@ -8183,6 +8224,7 @@ LADSPA = $_ladspa LIBA52 = $_liba52 LIBA52_INTERNAL = $_liba52_internal LIBASS = $_ass +LIBBS2B = $_libbs2b LIBDCA = $_libdca LIBDV = $_libdv LIBDVDCSS_INTERNAL = $_libdvdcss_internal @@ -8604,6 +8646,7 @@ $def_sunaudio $def_win32waveout $def_ladspa +$def_libbs2b /* input */ -- cgit v1.2.3 From e3b6f71b2d2a83d65b3cc7a7aaa8a9db5cf9e397 Mon Sep 17 00:00:00 2001 From: bircoph Date: Thu, 2 Apr 2009 19:01:57 +0000 Subject: Add libbs2b audio filter itself. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29132 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 1 + libaf/af.c | 4 ++ libaf/af_bs2b.c | 215 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 220 insertions(+) create mode 100644 libaf/af_bs2b.c diff --git a/Makefile b/Makefile index 663fb0b9f6..fdc4d229f0 100644 --- a/Makefile +++ b/Makefile @@ -341,6 +341,7 @@ SRCS_COMMON-$(LIBAVCODEC_A) += libaf/af_lavcac3enc.c \ libmpcodecs/vf_uspp.c \ SRCS_COMMON-$(LIBAVFORMAT) += libmpdemux/demux_lavf.c +SRCS_COMMON-$(LIBBS2B) += libaf/af_bs2b.c SRCS_COMMON-$(LIBDCA) += libmpcodecs/ad_libdca.c SRCS_COMMON-$(LIBDV) += libmpcodecs/ad_libdv.c \ libmpcodecs/vd_libdv.c \ diff --git a/libaf/af.c b/libaf/af.c index ca25e44a9e..987b7e548f 100644 --- a/libaf/af.c +++ b/libaf/af.c @@ -49,6 +49,7 @@ extern af_info_t af_info_sinesuppress; extern af_info_t af_info_karaoke; extern af_info_t af_info_scaletempo; extern af_info_t af_info_stats; +extern af_info_t af_info_bs2b; static af_info_t* filter_list[]={ &af_info_dummy, @@ -84,6 +85,9 @@ static af_info_t* filter_list[]={ &af_info_karaoke, &af_info_scaletempo, &af_info_stats, +#ifdef CONFIG_LIBBS2B + &af_info_bs2b, +#endif NULL }; diff --git a/libaf/af_bs2b.c b/libaf/af_bs2b.c new file mode 100644 index 0000000000..e47e669635 --- /dev/null +++ b/libaf/af_bs2b.c @@ -0,0 +1,215 @@ +/* + * The Bauer stereophonic-to-binaural DSP using bs2b library: + * http://bs2b.sourceforge.net/ + * + * Copyright (c) 2009 Andrew Savchenko + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include + +#include "af.h" +#include "subopt-helper.h" + +/// Internal specific data of the filter +struct af_bs2b { + int level; ///< crossfeed level + int profile; ///< profile (easy or normal) + t_bs2bdp filter; ///< instance of a library filter +}; + +#define PLAY(name,type) \ +static af_data_t *play_##name(struct af_instance_s *af, af_data_t *data) \ +{ \ + /* filter is called for all pairs of samples available in the buffer */ \ + bs2b_cross_feed_##name(((struct af_bs2b*)(af->setup))->filter, \ + (type*)(data->audio), data->len/data->bps/2); \ +\ + return data; \ +} + +PLAY(fbe,float) +PLAY(fle,float) +PLAY(s32be,int32_t) +PLAY(s32le,int32_t) +PLAY(s24be,bs2b_int24_t) +PLAY(s24le,bs2b_int24_t) +PLAY(s16be,int16_t) +PLAY(s16le,int16_t) +PLAY(s8,int8_t) +PLAY(u8,uint8_t) + +/// Sanity check for level value +static int test_level(void *par) +{ + const int val = *(int*)par; + if (val >= 1 && val <= BS2B_CLEVELS) + return 1; + + mp_msg(MSGT_AFILTER,MSGL_ERR, "[bs2b] Level must be in range 1..%i, but " + "current value is %i.\n", BS2B_CLEVELS, val); + return 0; +} + +/// Sanity check for profile value +static int test_profile(void *par) +{ + const int val = *(int*)par; + if (val >= 0 && val <= 1) + return 1; + + mp_msg(MSGT_AFILTER,MSGL_ERR, "[bs2b] Profile must be either 0 or 1, but " + "current value is %i.\n", val); + return 0; +} + +/// Initialization and runtime control +static int control(struct af_instance_s *af, int cmd, void *arg) +{ + struct af_bs2b *s = af->setup; + + switch (cmd) { + case AF_CONTROL_REINIT: { + int format; + char buf[256]; + // Sanity check + if (!arg) return AF_ERROR; + + format = ((af_data_t*)arg)->format; + af->data->rate = ((af_data_t*)arg)->rate; + af->data->nch = 2; // bs2b is useful only for 2ch audio + af->data->bps = ((af_data_t*)arg)->bps; + af->data->format = format; + + /* check for formats supported by libbs2b + and assign corresponding handlers */ + switch (format) { + case AF_FORMAT_FLOAT_BE: + af->play = play_fbe; + break; + case AF_FORMAT_FLOAT_LE: + af->play = play_fle; + break; + case AF_FORMAT_S32_BE: + af->play = play_s32be; + break; + case AF_FORMAT_S32_LE: + af->play = play_s32le; + break; + case AF_FORMAT_S24_BE: + af->play = play_s24be; + break; + case AF_FORMAT_S24_LE: + af->play = play_s24le; + break; + case AF_FORMAT_S16_BE: + af->play = play_s16be; + break; + case AF_FORMAT_S16_LE: + af->play = play_s16le; + break; + case AF_FORMAT_S8: + af->play = play_s8; + break; + case AF_FORMAT_U8: + af->play = play_u8; + break; + default: +#ifdef WORDS_BIGENDIAN + af->play = play_fbe; +#else + af->play = play_fle; +#endif //WORDS_BIGENDIAN + af->data->format = AF_FORMAT_FLOAT_NE; + af->data->bps=4; + break; + } + + bs2b_set_srate(s->filter, (long)af->data->rate); + mp_msg(MSGT_AFILTER,MSGL_V, "[bs2b] using format %s\n", + af_fmt2str(af->data->format,buf,256)); + + return af_test_output(af,(af_data_t*)arg); + } + case AF_CONTROL_COMMAND_LINE: { + const opt_t subopts[] = { + {"level", OPT_ARG_INT, &s->level, test_level}, + {"profile", OPT_ARG_INT, &s->profile, test_profile}, + {NULL} + }; + if (subopt_parse(arg, subopts) != 0) { + mp_msg(MSGT_AFILTER,MSGL_ERR, "[bs2b] Invalid option specified.\n"); + return AF_ERROR; + } + + bs2b_set_level(s->filter, s->level + s->profile ? BS2B_CLEVELS : 0); + mp_msg(MSGT_AFILTER,MSGL_V, "[bs2b] using profile %i, level %i\n", + s->profile, s->level); + return AF_OK; + } + } + return AF_UNKNOWN; +} + +/// Deallocate memory and close library +static void uninit(struct af_instance_s *af) +{ + struct af_bs2b *s = af->setup; + free(af->data); + if (s && s->filter) + bs2b_close(s->filter); + free(s); +} + +/// Allocate memory, set function pointers and init library +static int af_open(af_instance_t *af) +{ + struct af_bs2b *s; + af->control = control; + af->uninit = uninit; + af->mul = 1; + if (!(af->data = calloc(1,sizeof(af_data_t)))) + return AF_ERROR; + if (!(af->setup = s = calloc(1,sizeof(struct af_bs2b)))) { + free(af->data); + return AF_ERROR; + } + + // NULL means failed initialization + if (!(s->filter = bs2b_open())) { + free(af->data); + free(af->setup); + return AF_ERROR; + } + // Set defaults the same as in the library: + s->level = 3; + s->profile = 1; + return AF_OK; +} + +/// Description of this filter +af_info_t af_info_bs2b = { + "Bauer stereophonic-to-binaural audio filter", + "bs2b", + "Andrew Savchenko", + "", + AF_FLAGS_REENTRANT, + af_open +}; -- cgit v1.2.3 From 12a6f0c0568d396d6c156b3a9a6b602c0a861972 Mon Sep 17 00:00:00 2001 From: bircoph Date: Thu, 2 Apr 2009 19:02:59 +0000 Subject: Add documentation for libbs2b audio filter. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29133 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index fe823548f2..b64537adf8 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -5058,6 +5058,23 @@ Reasonable values are around 0.001. .PD 1 . .TP +.B bs2b[=option1:option2] +Bauer stereophonic to binaural transformation using libbs2b. +Improves the headphone listening experience by making the sound +similar to that from loudspeakers, allowing each ear to hear both +channels and taking into account the distance difference and the +head shadowing effect. +It is applicable only to 2 channel audio. +.PD 0 +.RSs +.IPs level=<1\-3> +Set cross feed level, higher level means stronger effect (default: 3). +.IPs profile=<0\-1> +Select cross feed profile to use, 1 provides softer sound than 0 (default: 1). +.RE +.PD 1 +. +.TP .B hrtf[=flag] Head-related transfer function: Converts multichannel audio to 2 channel output for headphones, preserving the spatiality of the sound. -- cgit v1.2.3 From 83c2df3565c19931b01c3ed75a0e08aca1fb24f2 Mon Sep 17 00:00:00 2001 From: bircoph Date: Thu, 2 Apr 2009 20:49:47 +0000 Subject: Use native endian float filter provided by libbs2b instead of selection based on WORDS_ENDIAN. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29134 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af_bs2b.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libaf/af_bs2b.c b/libaf/af_bs2b.c index e47e669635..4899fcc070 100644 --- a/libaf/af_bs2b.c +++ b/libaf/af_bs2b.c @@ -45,6 +45,7 @@ static af_data_t *play_##name(struct af_instance_s *af, af_data_t *data) \ return data; \ } +PLAY(f,float) PLAY(fbe,float) PLAY(fle,float) PLAY(s32be,int32_t) @@ -132,11 +133,7 @@ static int control(struct af_instance_s *af, int cmd, void *arg) af->play = play_u8; break; default: -#ifdef WORDS_BIGENDIAN - af->play = play_fbe; -#else - af->play = play_fle; -#endif //WORDS_BIGENDIAN + af->play = play_f; af->data->format = AF_FORMAT_FLOAT_NE; af->data->bps=4; break; -- cgit v1.2.3