diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/liba52/Makefile.am | 2 | ||||
-rw-r--r-- | src/libffmpeg/Makefile.am | 2 | ||||
-rw-r--r-- | src/libffmpeg/diff_to_ffmpeg_cvs.txt | 32 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/mlib/dsputil_mlib.c | 4 | ||||
-rw-r--r-- | src/libmpeg2/Makefile.am | 2 | ||||
-rw-r--r-- | src/video_out/Makefile.am | 9 | ||||
-rw-r--r-- | src/video_out/yuv2rgb.c | 7 | ||||
-rw-r--r-- | src/xine-utils/cpu_accel.c | 39 |
8 files changed, 68 insertions, 29 deletions
diff --git a/src/liba52/Makefile.am b/src/liba52/Makefile.am index cee608e1d..6857bcea3 100644 --- a/src/liba52/Makefile.am +++ b/src/liba52/Makefile.am @@ -1,7 +1,5 @@ include $(top_srcdir)/misc/Makefile.common -AM_CFLAGS = $(LIBA52_CFLAGS) - libdir = $(XINE_PLUGINDIR) lib_LTLIBRARIES = xineplug_decode_a52.la diff --git a/src/libffmpeg/Makefile.am b/src/libffmpeg/Makefile.am index f92828aeb..9bccb7589 100644 --- a/src/libffmpeg/Makefile.am +++ b/src/libffmpeg/Makefile.am @@ -23,6 +23,6 @@ xineplug_decode_ff_la_SOURCES = xine_decoder.c xineplug_decode_ff_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ endif -xineplug_decode_ff_la_LIBADD = $(XINE_LIB) \ +xineplug_decode_ff_la_LIBADD = $(MLIB_LIBS) $(XINE_LIB) \ $(top_builddir)/src/libffmpeg/libavcodec/libavcodec.la \ $(top_builddir)/src/libffmpeg/libavcodec/libpostproc/libpostprocess.la diff --git a/src/libffmpeg/diff_to_ffmpeg_cvs.txt b/src/libffmpeg/diff_to_ffmpeg_cvs.txt index adbaf0d43..627cb4750 100644 --- a/src/libffmpeg/diff_to_ffmpeg_cvs.txt +++ b/src/libffmpeg/diff_to_ffmpeg_cvs.txt @@ -692,3 +692,35 @@ diff -u -r1.8 motion_est_mmx.c static inline void sad8_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h) { +Index: libavcodec/mlib/dsputil_mlib.c +=================================================================== +RCS file: /cvsroot/xine/xine-lib/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c,v +--- dsputil_mlib,c 2003-10-19 13:06:27.560738000 +0100 ++++ dsputil_mlib.c 2003-10-19 13:01:50.427851000 +0100 +@@ -414,6 +414,7 @@ + + void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx) + { ++ if (xine_mm_accel() & MM_ACCEL_MLIB) { + c->get_pixels = get_pixels_mlib; + c->diff_pixels = diff_pixels_mlib; + c->add_pixels_clamped = add_pixels_clamped_mlib; +@@ -440,10 +441,12 @@ + c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mlib; + + c->bswap_buf = bswap_buf_mlib; ++ } + } + + void MPV_common_init_mlib(MpegEncContext *s) + { ++ if (xine_mm_accel() & MM_ACCEL_MLIB) { + if(s->avctx->dct_algo==FF_DCT_AUTO || s->avctx->dct_algo==FF_DCT_MLIB){ + s->dsp.fdct = ff_fdct_mlib; + } +@@ -453,4 +456,5 @@ + s->dsp.idct_add = ff_idct_add_mlib; + s->dsp.idct_permutation_type= FF_NO_IDCT_PERM; + } ++ } + } diff --git a/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c b/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c index f4ad328f0..19c9e6c19 100644 --- a/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c +++ b/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c @@ -414,6 +414,7 @@ static void ff_fdct_mlib(DCTELEM *data) void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx) { + if (xine_mm_accel() & MM_ACCEL_MLIB) { c->get_pixels = get_pixels_mlib; c->diff_pixels = diff_pixels_mlib; c->add_pixels_clamped = add_pixels_clamped_mlib; @@ -440,10 +441,12 @@ void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx) c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mlib; c->bswap_buf = bswap_buf_mlib; + } } void MPV_common_init_mlib(MpegEncContext *s) { + if (xine_mm_accel() & MM_ACCEL_MLIB) { if(s->avctx->dct_algo==FF_DCT_AUTO || s->avctx->dct_algo==FF_DCT_MLIB){ s->dsp.fdct = ff_fdct_mlib; } @@ -453,4 +456,5 @@ void MPV_common_init_mlib(MpegEncContext *s) s->dsp.idct_add = ff_idct_add_mlib; s->dsp.idct_permutation_type= FF_NO_IDCT_PERM; } + } } diff --git a/src/libmpeg2/Makefile.am b/src/libmpeg2/Makefile.am index 7e5dbeb15..417bc33cf 100644 --- a/src/libmpeg2/Makefile.am +++ b/src/libmpeg2/Makefile.am @@ -25,7 +25,7 @@ xineplug_decode_mpeg2_la_SOURCES = \ stats.c \ xine_decoder.c -xineplug_decode_mpeg2_la_LIBADD = $(XINE_LIB) +xineplug_decode_mpeg2_la_LIBADD = $(MLIB_LIBS) $(XINE_LIB) xineplug_decode_mpeg2_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ noinst_HEADERS = vlc.h mpeg2.h mpeg2_internal.h diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am index 03bd3dd2a..48333bd83 100644 --- a/src/video_out/Makefile.am +++ b/src/video_out/Makefile.am @@ -85,14 +85,13 @@ xineplug_vo_out_xvmc_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ xineplug_vo_out_xshm_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \ alphablend.c video_out_xshm.c -xineplug_vo_out_xshm_la_LIBADD = $(X_LIBS) -lXext \ - $(XINE_LIB) +xineplug_vo_out_xshm_la_LIBADD = $(MLIB_LIBS) $(X_LIBS) -lXext $(XINE_LIB) xineplug_vo_out_xshm_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ #xineplug_vo_out_opengl_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \ # alphablend.c video_out_opengl.c -#xineplug_vo_out_opengl_la_LIBADD = $(OPENGL_LIBS) $(GLUT_LIBS) $(GLU_LIBS) $(X_LIBS) \ -# $(XINE_LIB) +#xineplug_vo_out_opengl_la_LIBADD = $(MLIB_LIBS) $(OPENGL_LIBS) $(GLUT_LIBS) \ +# $(GLU_LIBS) $(X_LIBS) $(XINE_LIB) #xineplug_vo_out_opengl_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ xineplug_vo_out_syncfb_la_SOURCES = alphablend.c video_out_syncfb.c @@ -105,7 +104,7 @@ xineplug_vo_out_aa_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ xineplug_vo_out_fb_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \ alphablend.c video_out_fb.c -xineplug_vo_out_fb_la_LIBADD = $(XINE_LIB) +xineplug_vo_out_fb_la_LIBADD = $(MLIB_LIBS) $(XINE_LIB) xineplug_vo_out_fb_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ xineplug_vo_out_directfb_la_SOURCES = alphablend.c video_out_directfb.c diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c index d60b57dbb..ac7a55b2b 100644 --- a/src/video_out/yuv2rgb.c +++ b/src/video_out/yuv2rgb.c @@ -23,7 +23,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: yuv2rgb.c,v 1.44 2003/08/25 21:51:50 f1rmb Exp $ + * $Id: yuv2rgb.c,v 1.45 2003/10/20 00:33:29 komadori Exp $ */ #include "config.h" @@ -3156,10 +3156,7 @@ yuv2rgb_factory_t* yuv2rgb_factory_init (int mode, int swapped, uint8_t *cmap) { yuv2rgb_factory_t *this; - -#if defined(ARCH_X86) || defined(ARCH_X86_64) uint32_t mm = xine_mm_accel(); -#endif this = malloc (sizeof (yuv2rgb_factory_t)); @@ -3204,7 +3201,7 @@ yuv2rgb_factory_t* yuv2rgb_factory_init (int mode, int swapped, } #endif #if HAVE_MLIB - if (this->yuv2rgb_fun == NULL) { + if ((this->yuv2rgb_fun == NULL) && (mm & MM_ACCEL_MLIB)) { yuv2rgb_init_mlib (this); diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c index 6794143f7..d0f328112 100644 --- a/src/xine-utils/cpu_accel.c +++ b/src/xine-utils/cpu_accel.c @@ -26,6 +26,7 @@ #include <inttypes.h> #include <signal.h> #include <setjmp.h> +#include <dlfcn.h> #include "xineutils.h" @@ -174,16 +175,32 @@ static uint32_t arch_accel (void) uint32_t xine_mm_accel (void) { -#if defined (ARCH_X86) || (defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)) + static int initialized = 0; static uint32_t accel; - static int initialized; if (!initialized) { +#if defined (ARCH_X86) || (defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)) accel = arch_accel (); +#elif defined (HAVE_MLIB) +#ifdef MLIB_LAZYLOAD + void *hndl; + + if ((hndl = dlopen("libmlib.so.2", RTLD_LAZY | RTLD_GLOBAL | RTLD_NODELETE)) == NULL) { + accel = 0; + } + else { + dlclose(hndl); + accel = MM_ACCEL_MLIB; + } +#else + accel = MM_ACCEL_MLIB; +#endif +#else + accel = 0; +#endif #if defined(ARCH_X86) || defined(ARCH_X86_64) #ifndef _MSC_VER - /* test OS support for SSE */ if( accel & MM_ACCEL_X86_SSE ) { void (*old_sigill_handler)(int); @@ -202,22 +219,14 @@ uint32_t xine_mm_accel (void) signal (SIGILL, old_sigill_handler); } #endif /* _MSC_VER */ -#endif /* ARCH_X86 */ +#endif /* ARCH_X86 || ARCH_X86_64 */ - if( getenv("XINE_NO_ACCEL") ) + if(getenv("XINE_NO_ACCEL")) { accel = 0; + } - initialized++; + initialized = 1; } return accel; - -#else /* !ARCH_X86 && !ARCH_PPC/ENABLE_ALTIVEC */ -#ifdef HAVE_MLIB - return MM_ACCEL_MLIB; -#else - return 0; -#endif -#endif /* !ARCH_X86 && !ARCH_PPC/ENABLE_ALTIVEC */ } - |