# HG changeset patch
# User Diego 'Flameeyes' Pettenò <[EMAIL PROTECTED]>
# Date 1181397802 -7200
# Node ID fb2c63b1438ee6ca875aa64ec4d1800cc36e57ea
# Parent  069fd231ce517980033ee11696f09bcb2a35be1f
Update also deinterlace plugins.

diff -r fb2c63b1438ee6ca875aa64ec4d1800cc36e57ea -r 
069fd231ce517980033ee11696f09bcb2a35be1f src/post/deinterlace/plugins/greedy.c
--- a/src/post/deinterlace/plugins/greedy.c     Sat Jun 09 16:03:22 2007 +0200
+++ b/src/post/deinterlace/plugins/greedy.c     Sat Jun 09 15:44:54 2007 +0200
@@ -34,10 +34,13 @@
 
 #include "attributes.h"
 #include "xineutils.h"
+#include "cpu_accel.h"
 #include "deinterlace.h"
 #include "speedtools.h"
 #include "speedy.h"
 #include "plugins.h"
+
+#ifdef BUILD_MMXEXT_MAYBE
 
 // This is a simple lightweight DeInterlace method that uses little CPU time
 // but gives very good results for low or intermedite motion.
@@ -64,7 +67,6 @@ static void deinterlace_greedy_packed422
                                                           
deinterlace_scanline_data_t *data,
                                                           int width )
 {
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
     mmx_t MaxComb;
     uint8_t *m0 = data->m0;
     uint8_t *t1 = data->t1;
@@ -161,7 +163,6 @@ static void deinterlace_greedy_packed422
     }
     sfence();
     emms();
-#endif
 }
 
 /**
@@ -202,3 +203,4 @@ deinterlace_method_t *greedy_get_method(
     return &greedymethod;
 }
 
+#endif
diff -r fb2c63b1438ee6ca875aa64ec4d1800cc36e57ea -r 
069fd231ce517980033ee11696f09bcb2a35be1f 
src/post/deinterlace/plugins/kdetv_greedyh.c
--- a/src/post/deinterlace/plugins/kdetv_greedyh.c      Sat Jun 09 16:03:22 
2007 +0200
+++ b/src/post/deinterlace/plugins/kdetv_greedyh.c      Sat Jun 09 15:44:54 
2007 +0200
@@ -33,12 +33,13 @@
 
 #include "attributes.h"
 #include "xineutils.h"
+#include "cpu_accel.h"
 #include "deinterlace.h"
 #include "speedtools.h"
 #include "speedy.h"
 #include "plugins.h"
 
-#if defined (ARCH_X86) || defined (ARCH_X86_64)
+#if defined(BUILD_SSE_MAYBE) || defined(BUILD_3DNOW_MAYBE) || 
defined(BUILD_MMX_MAYBE)
 
 #include "greedyhmacros.h"
 
@@ -51,6 +52,7 @@ static unsigned int GreedyMotionSense = 
 static unsigned int GreedyMotionSense = MOTIONSENSE_DEFAULT;
 
 
+#ifdef BUILD_SSE_MAYBE
 #define IS_SSE
 #define SSE_TYPE SSE
 #define FUNCT_NAME greedyh_filter_sse
@@ -58,7 +60,9 @@ static unsigned int GreedyMotionSense = 
 #undef SSE_TYPE
 #undef IS_SSE
 #undef FUNCT_NAME
+#endif
 
+#ifdef BUILD_3DNOW_MAYBE
 #define IS_3DNOW
 #define FUNCT_NAME greedyh_filter_3dnow
 #define SSE_TYPE 3DNOW
@@ -66,7 +70,9 @@ static unsigned int GreedyMotionSense = 
 #undef SSE_TYPE
 #undef IS_3DNOW
 #undef FUNCT_NAME
+#endif
 
+#ifdef BUILD_MMX_MAYBE
 #define IS_MMX
 #define SSE_TYPE MMX
 #define FUNCT_NAME greedyh_filter_mmx
@@ -74,7 +80,6 @@ static unsigned int GreedyMotionSense = 
 #undef SSE_TYPE
 #undef IS_MMX
 #undef FUNCT_NAME
-
 #endif
 
 static void deinterlace_frame_di_greedyh( uint8_t *output, int outstride,
@@ -82,20 +87,29 @@ static void deinterlace_frame_di_greedyh
                                           int bottom_field, int second_field,
                                           int width, int height )
 {
-#if defined (ARCH_X86) || defined (ARCH_X86_64)
-    if( xine_mm_accel() & MM_ACCEL_X86_MMXEXT ) {
+#ifdef BUILD_SSE_MAYBE
+  if ( CHECK_SSE ) {
         greedyh_filter_sse( output, outstride, data,
                             bottom_field, second_field,
                             width, height );
-    } else if( xine_mm_accel() & MM_ACCEL_X86_3DNOW ) {
+       return;
+  }
+#endif
+#ifdef BUILD_3DNOW_MAYBE
+  if ( CHECK_3DNOW ) {
         greedyh_filter_3dnow( output, outstride, data,
                               bottom_field, second_field,
                               width, height );
-    } else {
+       return;
+  }
+#endif
+#ifdef BUILD_MMX_MAYBE
+  if ( CHECK_MMX ) {
         greedyh_filter_mmx( output, outstride, data,
                             bottom_field, second_field,
                             width, height );
-    }
+       return;
+  }
 #endif
 }
 
@@ -130,3 +144,5 @@ deinterlace_method_t *dscaler_greedyh_ge
     return &greedymethod;
 }
 
+#endif
+
diff -r fb2c63b1438ee6ca875aa64ec4d1800cc36e57ea -r 
069fd231ce517980033ee11696f09bcb2a35be1f src/post/deinterlace/plugins/plugins.h
--- a/src/post/deinterlace/plugins/plugins.h    Sat Jun 09 16:03:22 2007 +0200
+++ b/src/post/deinterlace/plugins/plugins.h    Sat Jun 09 15:44:54 2007 +0200
@@ -19,6 +19,8 @@
 #ifndef TVTIME_PLUGINS_H_INCLUDED
 #define TVTIME_PLUGINS_H_INCLUDED
 
+#include "cpu_accel.h"
+
 /**
  * tvtime was going to have a plugin system, but there
  * was never any interest in it outside of tvtime, so instead
@@ -28,7 +30,10 @@
 
 #include <deinterlace.h>
 
+#ifdef BUILD_MMXEXT_MAYBE
 deinterlace_method_t *greedy_get_method( void );
+#endif
+
 deinterlace_method_t *greedy2frame_get_method( void );
 deinterlace_method_t *weave_get_method( void );
 deinterlace_method_t *double_get_method( void );
@@ -37,7 +42,9 @@ deinterlace_method_t *linearblend_get_me
 deinterlace_method_t *linearblend_get_method( void );
 deinterlace_method_t *vfir_get_method( void );
 deinterlace_method_t *dscaler_tomsmocomp_get_method( void );
+#if defined(BUILD_SSE_MAYBE) || defined(BUILD_3DNOW_MAYBE) || 
defined(BUILD_MMX_MAYBE)
 deinterlace_method_t *dscaler_greedyh_get_method( void );
+#endif
 deinterlace_method_t *greedy_get_method( void );
 deinterlace_method_t *weave_get_method( void );
 deinterlace_method_t *weavetff_get_method( void );
diff -r fb2c63b1438ee6ca875aa64ec4d1800cc36e57ea -r 
069fd231ce517980033ee11696f09bcb2a35be1f src/post/deinterlace/speedy.c
--- a/src/post/deinterlace/speedy.c     Sat Jun 09 16:03:22 2007 +0200
+++ b/src/post/deinterlace/speedy.c     Sat Jun 09 15:44:54 2007 +0200
@@ -178,7 +178,7 @@ static inline __attribute__ ((always_inl
 
 static unsigned long CombJaggieThreshold = 73;
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMX_MAYBE
 static unsigned int comb_factor_packed422_scanline_mmx( uint8_t *top, uint8_t 
*mid,
                                                         uint8_t *bot, int 
width )
 {
@@ -304,7 +304,7 @@ static unsigned int diff_factor_packed42
 }
 */
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMX_MAYBE
 static unsigned int diff_factor_packed422_scanline_mmx( uint8_t *cur, uint8_t 
*old, int width )
 {
     const mmx_t qwYMask = { 0x00ff00ff00ff00ffULL };
@@ -345,7 +345,7 @@ static unsigned int diff_factor_packed42
 
 #define ABS(a) (((a) < 0)?-(a):(a))
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMX_MAYBE
 static void diff_packed422_block8x8_mmx( pulldown_metrics_t *m, uint8_t *old,
                                          uint8_t *new, int os, int ns )
 {
@@ -586,7 +586,7 @@ static void packed422_to_packed444_rec60
     }
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMX_MAYBE
 static void vfilter_chroma_121_packed422_scanline_mmx( uint8_t *output, int 
width,
                                                        uint8_t *m, uint8_t *t, 
uint8_t *b )
 {
@@ -652,7 +652,7 @@ static void vfilter_chroma_121_packed422
     }
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMX_MAYBE
 static void vfilter_chroma_332_packed422_scanline_mmx( uint8_t *output, int 
width,
                                                        uint8_t *m, uint8_t *t, 
uint8_t *b )
 {
@@ -726,7 +726,7 @@ static void vfilter_chroma_332_packed422
     }
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMX_MAYBE
 static void kill_chroma_packed422_inplace_scanline_mmx( uint8_t *data, int 
width )
 {
     const mmx_t ymask = { 0x00ff00ff00ff00ffULL };
@@ -758,7 +758,7 @@ static void kill_chroma_packed422_inplac
     }
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMX_MAYBE
 static void invert_colour_packed422_inplace_scanline_mmx( uint8_t *data, int 
width )
 {
     const mmx_t allones = { 0xffffffffffffffffULL };
@@ -885,7 +885,7 @@ static void interpolate_packed422_scanli
     }
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMX_MAYBE
 static void interpolate_packed422_scanline_mmx( uint8_t *output, uint8_t *top,
                                                 uint8_t *bot, int width )
 {
@@ -955,7 +955,7 @@ static void interpolate_packed422_scanli
 }
 #endif
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMXEXT_MAYBE
 static void interpolate_packed422_scanline_mmxext( uint8_t *output, uint8_t 
*top,
                                                    uint8_t *bot, int width )
 {
@@ -1015,7 +1015,7 @@ static void blit_colour_packed422_scanli
     }
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMX_MAYBE
 static void blit_colour_packed422_scanline_mmx( uint8_t *output, int width, 
int y, int cb, int cr )
 {
     uint32_t colour = cr << 24 | y << 16 | cb << 8 | y;
@@ -1055,7 +1055,7 @@ static void blit_colour_packed422_scanli
 }
 #endif
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMXEXT_MAYBE
 static void blit_colour_packed422_scanline_mmxext( uint8_t *output, int width, 
int y, int cb, int cr )
 {
     uint32_t colour = cr << 24 | y << 16 | cb << 8 | y;
@@ -1109,7 +1109,7 @@ static void blit_colour_packed4444_scanl
     }
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMX_MAYBE
 static void blit_colour_packed4444_scanline_mmx( uint8_t *output, int width,
                                                  int alpha, int luma,
                                                  int cb, int cr )
@@ -1146,7 +1146,7 @@ static void blit_colour_packed4444_scanl
 }
 #endif
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMXEXT_MAYBE
 static void blit_colour_packed4444_scanline_mmxext( uint8_t *output, int width,
                                                     int alpha, int luma,
                                                     int cb, int cr )
@@ -1195,14 +1195,14 @@ static void blit_packed422_scanline_c( u
     speedy_memcpy_c( dest, src, width*2 );
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMX_MAYBE
 static void blit_packed422_scanline_mmx( uint8_t *dest, const uint8_t *src, 
int width )
 {
     speedy_memcpy_mmx( dest, src, width*2 );
 }
 #endif
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMXEXT_MAYBE
 static void blit_packed422_scanline_mmxext( uint8_t *dest, const uint8_t *src, 
int width )
 {
     speedy_memcpy_mmxext( dest, src, width*2 );
@@ -1267,7 +1267,7 @@ static void composite_packed4444_alpha_t
     }
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMXEXT_MAYBE
 static void composite_packed4444_alpha_to_packed422_scanline_mmxext( uint8_t 
*output,
                                                                      uint8_t 
*input,
                                                                      uint8_t 
*foreground,
@@ -1409,7 +1409,7 @@ static void composite_packed4444_to_pack
 }
 
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMXEXT_MAYBE
 static void composite_packed4444_to_packed422_scanline_mmxext( uint8_t 
*output, uint8_t *input,
                                                                uint8_t 
*foreground, int width )
 {
@@ -1543,7 +1543,7 @@ static void composite_alphamask_to_packe
     }
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMXEXT_MAYBE
 static void composite_alphamask_to_packed4444_scanline_mmxext( uint8_t *output,
                                                                uint8_t *input,
                                                                uint8_t *mask,
@@ -1691,7 +1691,7 @@ static void premultiply_packed4444_scanl
     }
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMXEXT_MAYBE
 static void premultiply_packed4444_scanline_mmxext( uint8_t *output, uint8_t 
*input, int width )
 {
     const mmx_t round  = { 0x0080008000800080ULL };
@@ -1747,7 +1747,7 @@ static void blend_packed422_scanline_c( 
     }
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMXEXT_MAYBE
 static void blend_packed422_scanline_mmxext( uint8_t *output, uint8_t *src1,
                                              uint8_t *src2, int width, int pos 
)
 {
@@ -1792,7 +1792,7 @@ static void blend_packed422_scanline_mmx
 }
 #endif
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef BUILD_MMXEXT_MAYBE
 static void quarter_blit_vertical_packed422_scanline_mmxext( uint8_t *output, 
uint8_t *one,
                                                              uint8_t *three, 
int width )
 {
@@ -2414,8 +2414,8 @@ void setup_speedy_calls( uint32_t accel,
     vfilter_chroma_121_packed422_scanline = 
vfilter_chroma_121_packed422_scanline_c;
     vfilter_chroma_332_packed422_scanline = 
vfilter_chroma_332_packed422_scanline_c;
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
-    if( speedy_accel & MM_ACCEL_X86_MMXEXT ) {
+#if defined(BUILD_MMXEXT_MAYBE) && defined(BUILD_MMX_MAYBE)
+    if( CHECK_MMXEXT ) {
         if( verbose ) {
             printf( "speedycode: Using MMXEXT optimized functions.\n" );
         }
@@ -2437,7 +2437,10 @@ void setup_speedy_calls( uint32_t accel,
         vfilter_chroma_121_packed422_scanline = 
vfilter_chroma_121_packed422_scanline_mmx;
         vfilter_chroma_332_packed422_scanline = 
vfilter_chroma_332_packed422_scanline_mmx;
         speedy_memcpy = speedy_memcpy_mmxext;
-    } else if( speedy_accel & MM_ACCEL_X86_MMX ) {
+    } else
+#endif
+#ifdef BUILD_MMX_MAYBE
+    if( CHECK_MMX ) {
         if( verbose ) {
             printf( "speedycode: Using MMX optimized functions.\n" );
         }
@@ -2453,12 +2456,11 @@ void setup_speedy_calls( uint32_t accel,
         vfilter_chroma_121_packed422_scanline = 
vfilter_chroma_121_packed422_scanline_mmx;
         vfilter_chroma_332_packed422_scanline = 
vfilter_chroma_332_packed422_scanline_mmx;
         speedy_memcpy = speedy_memcpy_mmx;
-    } else {
-        if( verbose ) {
-            printf( "speedycode: No MMX or MMXEXT support detected, using C 
fallbacks.\n" );
-        }
-    }
-#endif
+    }
+#endif
+    if( verbose ) {
+      printf( "speedycode: No MMX or MMXEXT support detected, using C 
fallbacks.\n" );
+    }
 }
 
 uint32_t speedy_get_accel( void )
diff -r fb2c63b1438ee6ca875aa64ec4d1800cc36e57ea -r 
069fd231ce517980033ee11696f09bcb2a35be1f src/post/deinterlace/xine_plugin.c
--- a/src/post/deinterlace/xine_plugin.c        Sat Jun 09 16:03:22 2007 +0200
+++ b/src/post/deinterlace/xine_plugin.c        Sat Jun 09 15:44:54 2007 +0200
@@ -310,13 +310,17 @@ static void *deinterlace_init_plugin(xin
 
   register_deinterlace_method( linear_get_method() );
   register_deinterlace_method( linearblend_get_method() );
+#ifdef BUILD_MMXEXT_MAYBE
   register_deinterlace_method( greedy_get_method() );
+#endif
   register_deinterlace_method( greedy2frame_get_method() );
   register_deinterlace_method( weave_get_method() );
   register_deinterlace_method( double_get_method() );
   register_deinterlace_method( vfir_get_method() );
   register_deinterlace_method( scalerbob_get_method() );
+#if defined(BUILD_SSE_MAYBE) || defined(BUILD_3DNOW_MAYBE) || 
defined(BUILD_MMX_MAYBE)
   register_deinterlace_method( dscaler_greedyh_get_method() );
+#endif
   register_deinterlace_method( dscaler_tomsmocomp_get_method() );
 
   filter_deinterlace_methods( config_flags, 5 /*fieldsavailable*/ );

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Xine-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-cvslog

Reply via email to