From 7ecd47eeebf87332a4892d167baff959f0f6a11a Mon Sep 17 00:00:00 2001 From: ddennedy Date: Fri, 12 Dec 2008 07:53:04 +0000 Subject: [PATCH] xine/Makefile, xine/xineutils.h, xine/deinterlace.c: respect mmx compilation flag instead of using own detection xine/configure: remove, no longer necessary git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1260 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/xine/Makefile | 5 ++- src/modules/xine/configure | 23 --------------- src/modules/xine/deinterlace.c | 16 +++++----- src/modules/xine/xineutils.h | 60 ++++++++++++++++++++-------------------- 4 files changed, 42 insertions(+), 62 deletions(-) delete mode 100755 src/modules/xine/configure diff --git a/src/modules/xine/Makefile b/src/modules/xine/Makefile index d173983..fdbe0c6 100644 --- a/src/modules/xine/Makefile +++ b/src/modules/xine/Makefile @@ -4,9 +4,12 @@ TARGET = ../libmltxine$(LIBSUF) OBJS = factory.o \ deinterlace.o \ - cpu_accel.o \ filter_deinterlace.o +ifdef MMX_FLAGS +OBJS += cpu_accel.o +endif + CFLAGS += -I../../ -DARCH_X86 LDFLAGS+=-L../../framework -lmlt diff --git a/src/modules/xine/configure b/src/modules/xine/configure deleted file mode 100755 index a1a25a4..0000000 --- a/src/modules/xine/configure +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -if [ "$help" != "1" ] -then - - bits=$(uname -m) - case $bits in - ppc|ppc64) - disable_xine="1" - ;; - *) - disable_xine="0" - ;; - esac - - if [ "$disable_xine" != "0" ] - then - echo "- MMX Capabalities not found: disabling xine deinterlacing module" - touch ../disable-xine - fi - exit 0 -fi - diff --git a/src/modules/xine/deinterlace.c b/src/modules/xine/deinterlace.c index 9444964..3e14007 100644 --- a/src/modules/xine/deinterlace.c +++ b/src/modules/xine/deinterlace.c @@ -47,7 +47,7 @@ static void deinterlace_bob_yuv_mmx( uint8_t *pdst, uint8_t *psrc[], int width, int height ) { -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#ifdef USE_MMX int Line; uint64_t *YVal1; uint64_t *YVal2; @@ -191,7 +191,7 @@ static void deinterlace_bob_yuv_mmx( uint8_t *pdst, uint8_t *psrc[], static int deinterlace_weave_yuv_mmx( uint8_t *pdst, uint8_t *psrc[], int width, int height ) { -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#ifdef USE_MMX int Line; uint64_t *YVal1; @@ -390,7 +390,7 @@ static int deinterlace_weave_yuv_mmx( uint8_t *pdst, uint8_t *psrc[], static int deinterlace_greedy_yuv_mmx( uint8_t *pdst, uint8_t *psrc[], int width, int height ) { -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#ifdef USE_MMX int Line; int LoopCtr; uint64_t *L1; // ptr to Line1, of 3 @@ -553,7 +553,7 @@ static int deinterlace_greedy_yuv_mmx( uint8_t *pdst, uint8_t *psrc[], static void deinterlace_onefield_yuv_mmx( uint8_t *pdst, uint8_t *psrc[], int width, int height ) { -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#ifdef USE_MMX int Line; uint64_t *YVal1; uint64_t *YVal3; @@ -634,7 +634,7 @@ static void deinterlace_onefield_yuv_mmx( uint8_t *pdst, uint8_t *psrc[], static void deinterlace_linearblend_yuv_mmx( uint8_t *pdst, uint8_t *psrc[], int width, int height ) { -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#ifdef USE_MMX int Line; uint64_t *YVal1; uint64_t *YVal2; @@ -754,7 +754,7 @@ static void deinterlace_linearblend_yuv( uint8_t *pdst, uint8_t *psrc[], static int check_for_mmx(void) { -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#ifdef USE_MMX static int config_flags = -1; if ( config_flags == -1 ) @@ -821,7 +821,7 @@ void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc[], deinterlace_linearblend_yuv(pdst,psrc,width,height); break; default: - lprintf("unknow method %d.\n",method); + lprintf("unknown method %d.\n",method); break; } } @@ -847,7 +847,7 @@ int deinterlace_yuv_supported ( int method ) } char *deinterlace_methods[] = { - "none", + "none", "bob", "weave", "greedy", diff --git a/src/modules/xine/xineutils.h b/src/modules/xine/xineutils.h index c278f34..d4dba64 100644 --- a/src/modules/xine/xineutils.h +++ b/src/modules/xine/xineutils.h @@ -1,18 +1,18 @@ /* * Copyright (C) 2000-2004 the xine project - * + * * This file is part of xine, a free video player. - * + * * xine 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. - * + * * xine 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA @@ -54,7 +54,7 @@ extern "C" { //#ifdef HAVE_CONFIG_H //#include "config.h" //#endif - + #include #include @@ -70,7 +70,7 @@ extern "C" { int xine_mutex_init (xine_mutex_t *mutex, const pthread_mutexattr_t *mutexattr, char *id); - + int xine_mutex_lock (xine_mutex_t *mutex, char *who); int xine_mutex_unlock (xine_mutex_t *mutex, char *who); int xine_mutex_destroy (xine_mutex_t *mutex); @@ -84,7 +84,7 @@ extern "C" { * long constant values MUST be suffixed by LL and unsigned long long * values by ULL, lest they be truncated by the compiler) */ - + /* generic accelerations */ #define MM_ACCEL_MLIB 0x00000001 @@ -105,7 +105,7 @@ extern "C" { uint32_t xine_mm_accel (void); -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#ifdef USE_MMX typedef union { int64_t q; /* Quadword (64-bit) value */ @@ -570,7 +570,7 @@ typedef union { __asm__ __volatile__ ("ldmxcsr %0" \ : /* nothing */ \ : "X" (mem)) -#endif /*ARCH_X86 */ +#endif /* USE_MMX */ @@ -624,7 +624,7 @@ void *xine_xmalloc(size_t size) __attribute__ ((__malloc__)); */ void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base); -/* +/* * Get user home directory. */ const char *xine_get_homedir(void); @@ -679,14 +679,14 @@ static inline char *_private_strpbrk(const char *s, const char *accept) { #else static inline char *_private_strsep(char **stringp, const char *delim) { char *begin, *end; - + begin = *stringp; if(begin == NULL) return NULL; - + if(delim[0] == '\0' || delim[1] == '\0') { char ch = delim[0]; - + if(ch == '\0') end = NULL; else { @@ -700,14 +700,14 @@ static inline char *_private_strsep(char **stringp, const char *delim) { } else end = xine_strpbrk(begin, delim); - + if(end) { *end++ = '\0'; *stringp = end; } else *stringp = NULL; - + return begin; } #define xine_strsep _private_strsep @@ -720,7 +720,7 @@ static inline char *_private_strsep(char **stringp, const char *delim) { static inline void _private_setenv(const char *name, const char *val, int _xx) { int len = strlen(name) + strlen(val) + 2; char env[len]; - + sprintf(env, "%s%c%s", name, '=', val); putenv(env); } @@ -730,8 +730,8 @@ static inline void _private_setenv(const char *name, const char *val, int _xx) { /* * Color Conversion Utility Functions * The following data structures and functions facilitate the conversion - * of RGB images to packed YUV (YUY2) images. There are also functions to - * convert from YUV9 -> YV12. All of the meaty details are written in + * of RGB images to packed YUV (YUY2) images. There are also functions to + * convert from YUV9 -> YV12. All of the meaty details are written in * color.c. */ @@ -762,16 +762,16 @@ extern void (*yuv411_to_yv12) unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch, int width, int height); extern void (*yv12_to_yuy2) - (unsigned char *y_src, int y_src_pitch, - unsigned char *u_src, int u_src_pitch, - unsigned char *v_src, int v_src_pitch, + (unsigned char *y_src, int y_src_pitch, + unsigned char *u_src, int u_src_pitch, + unsigned char *v_src, int v_src_pitch, unsigned char *yuy2_map, int yuy2_pitch, int width, int height, int progressive); extern void (*yuy2_to_yv12) (unsigned char *yuy2_map, int yuy2_pitch, - unsigned char *y_dst, int y_dst_pitch, - unsigned char *u_dst, int u_dst_pitch, - unsigned char *v_dst, int v_dst_pitch, + unsigned char *y_dst, int y_dst_pitch, + unsigned char *u_dst, int u_dst_pitch, + unsigned char *v_dst, int v_dst_pitch, int width, int height); #define SCALEFACTOR 65536 @@ -829,7 +829,7 @@ extern void yuy2_to_yuy2 (unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch, int width, int height); - + /* print a hexdump of the given data */ void xine_hexdump (const char *buf, int length); @@ -844,7 +844,7 @@ void xine_hexdump (const char *buf, int length); # define EXPECT_TRUE(x) __builtin_expect((x),1) # define EXPECT_FALSE(x) __builtin_expect((x),0) #endif - + #ifdef NDEBUG #define _x_assert(exp) \ do { \ @@ -937,7 +937,7 @@ void xine_hexdump (const char *buf, int length); printf( "%s", fmtargs ); \ } \ }while(0) -#else +#else #define llprintf(cat, ...) \ do{ \ if(cat){ \ @@ -963,7 +963,7 @@ void xine_hexdump (const char *buf, int length); xine_log(xine, XINE_LOG_TRACE, fmtargs); \ } \ } while(0) -#else +#else #define xprintf(xine, verbose, ...) \ do { \ if((xine) && (xine)->verbosity >= verbose){ \ @@ -1011,11 +1011,11 @@ void xine_hexdump (const char *buf, int length); typedef struct xine_node_s { struct xine_node_s *next, *prev; - + void *content; int priority; - + } xine_node_t; -- 1.7.4.4