Make I420_UYVY/MMX support widths non multiple of 8
authorEric Petit <titer@videolan.org>
Wed, 26 Jul 2006 22:48:34 +0000 (22:48 +0000)
committerEric Petit <titer@videolan.org>
Wed, 26 Jul 2006 22:48:34 +0000 (22:48 +0000)
modules/video_chroma/i420_yuy2.c
modules/video_chroma/i420_yuy2.h

index 507a971..9079438 100644 (file)
@@ -382,6 +382,10 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source,
             MMX_CALL( MMX_YUV420_UYVY );
 #endif
         }
+        for( i_x = ( p_vout->render.i_width % 8 ) / 2; i_x--; )
+        {
+            C_YUV420_UYVY( );
+        }
 
         p_y1 += i_source_margin;
         p_y2 += i_source_margin;
index daf9429..c5bcf9b 100644 (file)
@@ -119,12 +119,6 @@ movq      %%mm1, (%1)   # Store YUYV                                      \n\
     *(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++;                     \
     *(p_line1)++ =            *(p_line2)++ = *(p_u)++;                      \
 
-#define C_YUV420_UYVY( )                                                    \
-    *(p_line1)++ =            *(p_line2)++ = *(p_u)++;                      \
-    *(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++;                     \
-    *(p_line1)++ =            *(p_line2)++ = *(p_v)++;                      \
-    *(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++;                     \
-
 #define C_YUV420_Y211( )                                                    \
     *(p_line1)++ = *(p_y1); p_y1 += 2;                                      \
     *(p_line2)++ = *(p_y2); p_y2 += 2;                                      \
@@ -142,3 +136,9 @@ movq      %%mm1, (%1)   # Store YUYV                                      \n\
     *(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++;                     \
     *(p_line1)++ =            *(p_line2)++ = *(p_v)++;                      \
 
+#define C_YUV420_UYVY( )                                                    \
+    *(p_line1)++ =            *(p_line2)++ = *(p_u)++;                      \
+    *(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++;                     \
+    *(p_line1)++ =            *(p_line2)++ = *(p_v)++;                      \
+    *(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++;                     \
+