]> git.sesse.net Git - vlc/commitdiff
+ video_chroma/i420_yuy2.c : fixed conversion for non-multiple-of-8
authorEric Petit <titer@videolan.org>
Tue, 4 May 2004 13:57:48 +0000 (13:57 +0000)
committerEric Petit <titer@videolan.org>
Tue, 4 May 2004 13:57:48 +0000 (13:57 +0000)
                              widths (MMX untested)

modules/video_chroma/i420_yuy2.c

index 03ec04215df0c5ba05c8089b861cad73caabd10d..16c72e7ef3547cdd22714befd659c3d9c8d3c693 100644 (file)
@@ -262,17 +262,21 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source,
         p_y1 = p_y2;
         p_y2 += p_source->p[Y_PLANE].i_pitch;
 
-        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; )
-        {
 #if !defined (MODULE_NAME_IS_i420_yuy2_mmx)
+        for( i_x = p_vout->render.i_width / 2 ; i_x-- ; )
+        {
             C_YUV420_YUYV( );
-            C_YUV420_YUYV( );
-            C_YUV420_YUYV( );
-            C_YUV420_YUYV( );
+        }
 #else
+        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; )
+        {
             MMX_CALL( MMX_YUV420_YUYV );
-#endif
         }
+        for( i_x = ( p_vout->render.i_width % 8 ) / 2; i_x-- ; )
+        {
+            C_YUV420_YUYV( );
+        }
+#endif
 
         p_y1 += i_source_margin;
         p_y2 += i_source_margin;