[vlc-commits] deinterlace: u_cpu is used only if MMXEXT can be compiled

Rémi Denis-Courmont git at videolan.org
Sun May 1 11:45:22 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May  1 12:44:37 2011 +0300| [cbad172ff6c98bacf969be6e63135fe2185a212c] | committer: Rémi Denis-Courmont

deinterlace: u_cpu is used only if MMXEXT can be compiled

This restores commit 45b7ce9e7c88574157157ecba9bdfd7310e14990.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cbad172ff6c98bacf969be6e63135fe2185a212c
---

 modules/video_filter/deinterlace/algo_phosphor.c |    3 +--
 modules/video_filter/deinterlace/algo_x.c        |    2 ++
 modules/video_filter/deinterlace/helpers.c       |    4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/video_filter/deinterlace/algo_phosphor.c b/modules/video_filter/deinterlace/algo_phosphor.c
index 979c871..70bb595 100644
--- a/modules/video_filter/deinterlace/algo_phosphor.c
+++ b/modules/video_filter/deinterlace/algo_phosphor.c
@@ -75,11 +75,10 @@ static void DarkenField( picture_t *p_dst, const int i_field,
     assert( i_field == 0 || i_field == 1 );
     assert( i_strength >= 1 && i_strength <= 3 );
 
-    unsigned u_cpu = vlc_CPU();
-
     /* Bitwise ANDing with this clears the i_strength highest bits
        of each byte */
 #ifdef CAN_COMPILE_MMXEXT
+    unsigned u_cpu = vlc_CPU();
     uint64_t i_strength_u64 = i_strength; /* for MMX version (needs to know
                                              number of bits) */
 #endif
diff --git a/modules/video_filter/deinterlace/algo_x.c b/modules/video_filter/deinterlace/algo_x.c
index 7a39177..f68b122 100644
--- a/modules/video_filter/deinterlace/algo_x.c
+++ b/modules/video_filter/deinterlace/algo_x.c
@@ -535,7 +535,9 @@ static inline void XDeintBand8x8MMXEXT( uint8_t *dst, int i_dst,
 void RenderX( picture_t *p_outpic, picture_t *p_pic )
 {
     int i_plane;
+#ifdef CAN_COMPILE_MMXEXT
     unsigned u_cpu = vlc_CPU();
+#endif
 
     /* Copy image and skip lines */
     for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
diff --git a/modules/video_filter/deinterlace/helpers.c b/modules/video_filter/deinterlace/helpers.c
index b6ef5f6..cbb4589 100644
--- a/modules/video_filter/deinterlace/helpers.c
+++ b/modules/video_filter/deinterlace/helpers.c
@@ -467,13 +467,13 @@ int CalculateInterlaceScore( const picture_t* p_pic_top,
     if( p_pic_top->i_planes != p_pic_bot->i_planes )
         return -1;
 
-    unsigned u_cpu = vlc_CPU();
-
     /* Amount of bits must be known for MMX, thus int32_t.
        Doesn't hurt the C implementation. */
     int32_t i_score = 0;
 
 #ifdef CAN_COMPILE_MMXEXT
+    unsigned u_cpu = vlc_CPU();
+
     if( u_cpu & CPU_CAPABILITY_MMXEXT )
         pxor_r2r( mm7, mm7 ); /* we will keep score in mm7 */
 #endif



More information about the vlc-commits mailing list