]> git.sesse.net Git - vlc/commitdiff
* ./plugins/chroma/i420_yuy2.c: margin support for the 420 planar to 422
authorSam Hocevar <sam@videolan.org>
Tue, 21 May 2002 03:37:17 +0000 (03:37 +0000)
committerSam Hocevar <sam@videolan.org>
Tue, 21 May 2002 03:37:17 +0000 (03:37 +0000)
    packed chroma transformations.

plugins/chroma/i420_yuy2.c

index cc2d0f8d5b7b04b215e52a7c455b8e337c216529..2996814b40b0dfdefc41239036fb575c34cb46dd 100644 (file)
@@ -2,7 +2,7 @@
  * i420_yuy2.c : YUV to YUV conversion module for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_yuy2.c,v 1.6 2002/04/23 13:47:30 sam Exp $
+ * $Id: i420_yuy2.c,v 1.7 2002/05/21 03:37:17 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -179,6 +179,11 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source,
 
     int i_x, i_y;
 
+    const int i_source_margin = p_source->p->b_margin ?
+        p_source->p->i_pitch - p_source->p->i_visible_bytes : 0;
+    const int i_dest_margin = p_dest->p->b_margin ?
+        p_dest->p->i_pitch - p_dest->p->i_visible_bytes : 0;
+
     for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
     {
         p_line1 = p_line2;
@@ -198,6 +203,11 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source,
             MMX_CALL( MMX_YUV420_YUYV );
 #endif
         }
+
+        p_y1 += i_source_margin;
+        p_y2 += i_source_margin;
+        p_line1 += i_dest_margin;
+        p_line2 += i_dest_margin;
     }
 }
 
@@ -214,6 +224,11 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source,
 
     int i_x, i_y;
 
+    const int i_source_margin = p_source->p->b_margin ?
+        p_source->p->i_pitch - p_source->p->i_visible_bytes : 0;
+    const int i_dest_margin = p_dest->p->b_margin ?
+        p_dest->p->i_pitch - p_dest->p->i_visible_bytes : 0;
+
     for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
     {
         p_line1 = p_line2;
@@ -233,6 +248,11 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source,
             MMX_CALL( MMX_YUV420_YVYU );
 #endif
         }
+
+        p_y1 += i_source_margin;
+        p_y2 += i_source_margin;
+        p_line1 += i_dest_margin;
+        p_line2 += i_dest_margin;
     }
 }
 
@@ -249,6 +269,11 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source,
 
     int i_x, i_y;
 
+    const int i_source_margin = p_source->p->b_margin ?
+        p_source->p->i_pitch - p_source->p->i_visible_bytes : 0;
+    const int i_dest_margin = p_dest->p->b_margin ?
+        p_dest->p->i_pitch - p_dest->p->i_visible_bytes : 0;
+
     for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
     {
         p_line1 = p_line2;
@@ -268,6 +293,11 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source,
             MMX_CALL( MMX_YUV420_UYVY );
 #endif
         }
+
+        p_y1 += i_source_margin;
+        p_y2 += i_source_margin;
+        p_line1 += i_dest_margin;
+        p_line2 += i_dest_margin;
     }
 }
 
@@ -297,6 +327,11 @@ static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source,
 
     int i_x, i_y;
 
+    const int i_source_margin = p_source->p->b_margin ?
+        p_source->p->i_pitch - p_source->p->i_visible_bytes : 0;
+    const int i_dest_margin = p_dest->p->b_margin ?
+        p_dest->p->i_pitch - p_dest->p->i_visible_bytes : 0;
+
     for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
     {
         p_line1 -= 3 * p_dest->p->i_pitch;
@@ -316,6 +351,11 @@ static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source,
             MMX_CALL( MMX_YUV420_UYVY );
 #endif
         }
+
+        p_y1 += i_source_margin;
+        p_y2 += i_source_margin;
+        p_line1 += i_dest_margin;
+        p_line2 += i_dest_margin;
     }
 }
 
@@ -333,6 +373,11 @@ static void I420_Y211( vout_thread_t *p_vout, picture_t *p_source,
 
     int i_x, i_y;
 
+    const int i_source_margin = p_source->p->b_margin ?
+        p_source->p->i_pitch - p_source->p->i_visible_bytes : 0;
+    const int i_dest_margin = p_dest->p->b_margin ?
+        p_dest->p->i_pitch - p_dest->p->i_visible_bytes : 0;
+
     for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
     {
         p_line1 = p_line2;
@@ -346,6 +391,11 @@ static void I420_Y211( vout_thread_t *p_vout, picture_t *p_source,
             C_YUV420_Y211( );
             C_YUV420_Y211( );
         }
+
+        p_y1 += i_source_margin;
+        p_y2 += i_source_margin;
+        p_line1 += i_dest_margin;
+        p_line2 += i_dest_margin;
     }
 }
 #endif