Commit f5f0a1cd authored by Sam Hocevar's avatar Sam Hocevar

* ./plugins/chroma/i420_yuy2.c: margin support for the 420 planar to 422

    packed chroma transformations.
parent 6eb7dd20
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* i420_yuy2.c : YUV to YUV conversion module for vlc * i420_yuy2.c : YUV to YUV conversion module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * 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> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -179,6 +179,11 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source, ...@@ -179,6 +179,11 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source,
int i_x, i_y; 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-- ; ) for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
{ {
p_line1 = p_line2; p_line1 = p_line2;
...@@ -198,6 +203,11 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source, ...@@ -198,6 +203,11 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source,
MMX_CALL( MMX_YUV420_YUYV ); MMX_CALL( MMX_YUV420_YUYV );
#endif #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, ...@@ -214,6 +224,11 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source,
int i_x, i_y; 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-- ; ) for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
{ {
p_line1 = p_line2; p_line1 = p_line2;
...@@ -233,6 +248,11 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source, ...@@ -233,6 +248,11 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source,
MMX_CALL( MMX_YUV420_YVYU ); MMX_CALL( MMX_YUV420_YVYU );
#endif #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, ...@@ -249,6 +269,11 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source,
int i_x, i_y; 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-- ; ) for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
{ {
p_line1 = p_line2; p_line1 = p_line2;
...@@ -268,6 +293,11 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source, ...@@ -268,6 +293,11 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source,
MMX_CALL( MMX_YUV420_UYVY ); MMX_CALL( MMX_YUV420_UYVY );
#endif #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, ...@@ -297,6 +327,11 @@ static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source,
int i_x, i_y; 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-- ; ) for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
{ {
p_line1 -= 3 * p_dest->p->i_pitch; 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, ...@@ -316,6 +351,11 @@ static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source,
MMX_CALL( MMX_YUV420_UYVY ); MMX_CALL( MMX_YUV420_UYVY );
#endif #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, ...@@ -333,6 +373,11 @@ static void I420_Y211( vout_thread_t *p_vout, picture_t *p_source,
int i_x, i_y; 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-- ; ) for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
{ {
p_line1 = p_line2; p_line1 = p_line2;
...@@ -346,6 +391,11 @@ static void I420_Y211( vout_thread_t *p_vout, picture_t *p_source, ...@@ -346,6 +391,11 @@ static void I420_Y211( vout_thread_t *p_vout, picture_t *p_source,
C_YUV420_Y211( ); C_YUV420_Y211( );
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 #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment