X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_chroma%2Fi420_yuy2.c;h=57a7af6de059360a458a136885b2d805da2ebf01;hb=6478c429a2700d129485b13069d964a202fdded9;hp=70a6c96593c5430477b3ef20f2c2262a76227410;hpb=3561b9b28f58eb7a4183e158a8fd973800d31ceb;p=vlc diff --git a/modules/video_chroma/i420_yuy2.c b/modules/video_chroma/i420_yuy2.c index 70a6c96593..57a7af6de0 100644 --- a/modules/video_chroma/i420_yuy2.c +++ b/modules/video_chroma/i420_yuy2.c @@ -32,7 +32,7 @@ #include #include -#include +#include #if defined (MODULE_NAME_IS_i420_yuy2_altivec) && defined(HAVE_ALTIVEC_H) # include @@ -57,15 +57,21 @@ *****************************************************************************/ static int Activate ( vlc_object_t * ); -static void I420_YUY2 ( vout_thread_t *, picture_t *, picture_t * ); -static void I420_YVYU ( vout_thread_t *, picture_t *, picture_t * ); -static void I420_UYVY ( vout_thread_t *, picture_t *, picture_t * ); +static void I420_YUY2 ( filter_t *, picture_t *, picture_t * ); +static void I420_YVYU ( filter_t *, picture_t *, picture_t * ); +static void I420_UYVY ( filter_t *, picture_t *, picture_t * ); +static picture_t *I420_YUY2_Filter ( filter_t *, picture_t * ); +static picture_t *I420_YVYU_Filter ( filter_t *, picture_t * ); +static picture_t *I420_UYVY_Filter ( filter_t *, picture_t * ); #if !defined (MODULE_NAME_IS_i420_yuy2_altivec) -static void I420_IUYV ( vout_thread_t *, picture_t *, picture_t * ); -static void I420_cyuv ( vout_thread_t *, picture_t *, picture_t * ); +static void I420_IUYV ( filter_t *, picture_t *, picture_t * ); +static void I420_cyuv ( filter_t *, picture_t *, picture_t * ); +static picture_t *I420_IUYV_Filter ( filter_t *, picture_t * ); +static picture_t *I420_cyuv_Filter ( filter_t *, picture_t * ); #endif #if defined (MODULE_NAME_IS_i420_yuy2) -static void I420_Y211 ( vout_thread_t *, picture_t *, picture_t * ); +static void I420_Y211 ( filter_t *, picture_t *, picture_t * ); +static picture_t *I420_Y211_Filter ( filter_t *, picture_t * ); #endif #ifdef MODULE_NAME_IS_i420_yuy2_mmx @@ -77,26 +83,23 @@ static const uint64_t i_80w = 0x0000000080808080ULL; /***************************************************************************** * Module descriptor. *****************************************************************************/ -vlc_module_begin(); +vlc_module_begin () #if defined (MODULE_NAME_IS_i420_yuy2) - set_description( N_("Conversions from " SRC_FOURCC " to " DEST_FOURCC) ); - set_capability( "chroma", 80 ); + set_description( N_("Conversions from " SRC_FOURCC " to " DEST_FOURCC) ) + set_capability( "video filter2", 80 ) #elif defined (MODULE_NAME_IS_i420_yuy2_mmx) - set_description( N_("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) ); - set_capability( "chroma", 100 ); - add_requirement( MMX ); + set_description( N_("MMX conversions from " SRC_FOURCC " to " DEST_FOURCC) ) + set_capability( "video filter2", 160 ) #elif defined (MODULE_NAME_IS_i420_yuy2_sse2) - set_description( N_("SSE2 conversions from " SRC_FOURCC " to " DEST_FOURCC) ); - set_capability( "chroma", 120 ); - add_requirement( SSE2 ); + set_description( N_("SSE2 conversions from " SRC_FOURCC " to " DEST_FOURCC) ) + set_capability( "video filter2", 250 ) #elif defined (MODULE_NAME_IS_i420_yuy2_altivec) set_description( _("AltiVec conversions from " SRC_FOURCC " to " DEST_FOURCC) ); - set_capability( "chroma", 100 ); - add_requirement( ALTIVEC ); + set_capability( "video filter2", 250 ) #endif - set_callbacks( Activate, NULL ); -vlc_module_end(); + set_callbacks( Activate, NULL ) +vlc_module_end () /***************************************************************************** * Activate: allocate a chroma function @@ -105,47 +108,48 @@ vlc_module_end(); *****************************************************************************/ static int Activate( vlc_object_t *p_this ) { - vout_thread_t *p_vout = (vout_thread_t *)p_this; + filter_t *p_filter = (filter_t *)p_this; - if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 ) + if( p_filter->fmt_in.video.i_width & 1 + || p_filter->fmt_in.video.i_height & 1 ) { return -1; } - switch( p_vout->render.i_chroma ) + if( p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width + || p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height ) + return -1; + + switch( p_filter->fmt_in.video.i_chroma ) { - case VLC_FOURCC('Y','V','1','2'): - case VLC_FOURCC('I','4','2','0'): - case VLC_FOURCC('I','Y','U','V'): - switch( p_vout->output.i_chroma ) + case VLC_CODEC_YV12: + case VLC_CODEC_I420: + switch( p_filter->fmt_out.video.i_chroma ) { - case VLC_FOURCC('Y','U','Y','2'): - case VLC_FOURCC('Y','U','N','V'): - p_vout->chroma.pf_convert = I420_YUY2; + case VLC_CODEC_YUYV: + p_filter->pf_video_filter = I420_YUY2_Filter; break; - case VLC_FOURCC('Y','V','Y','U'): - p_vout->chroma.pf_convert = I420_YVYU; + case VLC_CODEC_YVYU: + p_filter->pf_video_filter = I420_YVYU_Filter; break; - case VLC_FOURCC('U','Y','V','Y'): - case VLC_FOURCC('U','Y','N','V'): - case VLC_FOURCC('Y','4','2','2'): - p_vout->chroma.pf_convert = I420_UYVY; + case VLC_CODEC_UYVY: + p_filter->pf_video_filter = I420_UYVY_Filter; break; #if !defined (MODULE_NAME_IS_i420_yuy2_altivec) case VLC_FOURCC('I','U','Y','V'): - p_vout->chroma.pf_convert = I420_IUYV; + p_filter->pf_video_filter = I420_IUYV_Filter; break; - case VLC_FOURCC('c','y','u','v'): - p_vout->chroma.pf_convert = I420_cyuv; + case VLC_CODEC_CYUV: + p_filter->pf_video_filter = I420_cyuv_Filter; break; #endif #if defined (MODULE_NAME_IS_i420_yuy2) - case VLC_FOURCC('Y','2','1','1'): - p_vout->chroma.pf_convert = I420_Y211; + case VLC_CODEC_Y211: + p_filter->pf_video_filter = I420_Y211_Filter; break; #endif @@ -172,11 +176,23 @@ static inline unsigned long long read_cycles(void) #endif /* Following functions are local */ + +VIDEO_FILTER_WRAPPER( I420_YUY2 ) +VIDEO_FILTER_WRAPPER( I420_YVYU ) +VIDEO_FILTER_WRAPPER( I420_UYVY ) +#if !defined (MODULE_NAME_IS_i420_yuy2_altivec) +VIDEO_FILTER_WRAPPER( I420_IUYV ) +VIDEO_FILTER_WRAPPER( I420_cyuv ) +#endif +#if defined (MODULE_NAME_IS_i420_yuy2) +VIDEO_FILTER_WRAPPER( I420_Y211 ) +#endif + /***************************************************************************** * I420_YUY2: planar YUV 4:2:0 to packed YUYV 4:2:2 *****************************************************************************/ -static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source, - picture_t *p_dest ) +static void I420_YUY2( filter_t *p_filter, picture_t *p_source, + picture_t *p_dest ) { uint8_t *p_line1, *p_line2 = p_dest->p->p_pixels; uint8_t *p_y1, *p_y2 = p_source->Y_PIXELS; @@ -210,14 +226,14 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source, vector unsigned char uv_vec; vector unsigned char y_vec; - if( !( ( p_vout->render.i_width % 32 ) | - ( p_vout->render.i_height % 2 ) ) ) + if( !( ( p_filter->fmt_in.video.i_width % 32 ) | + ( p_filter->fmt_in.video.i_height % 2 ) ) ) { /* Width is a multiple of 32, we take 2 lines at a time */ - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { VEC_NEXT_LINES( ); - for( i_x = p_vout->render.i_width / 32 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 32 ; i_x-- ; ) { VEC_LOAD_UV( ); VEC_MERGE( vec_mergeh ); @@ -225,15 +241,15 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source, } } } - else if( !( ( p_vout->render.i_width % 16 ) | - ( p_vout->render.i_height % 4 ) ) ) + else if( !( ( p_filter->fmt_in.video.i_width % 16 ) | + ( p_filter->fmt_in.video.i_height % 4 ) ) ) { /* Width is only a multiple of 16, we take 4 lines at a time */ - for( i_y = p_vout->render.i_height / 4 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 4 ; i_y-- ; ) { /* Line 1 and 2, pixels 0 to ( width - 16 ) */ VEC_NEXT_LINES( ); - for( i_x = p_vout->render.i_width / 32 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 32 ; i_x-- ; ) { VEC_LOAD_UV( ); VEC_MERGE( vec_mergeh ); @@ -249,7 +265,7 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source, VEC_MERGE( vec_mergel ); /* Line 3 and 4, pixels 16 to ( width ) */ - for( i_x = p_vout->render.i_width / 32 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 32 ; i_x-- ; ) { VEC_LOAD_UV( ); VEC_MERGE( vec_mergeh ); @@ -273,7 +289,7 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source, - p_dest->p->i_visible_pitch; #if !defined(MODULE_NAME_IS_i420_yuy2_sse2) - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 = p_line2; p_line2 += p_dest->p->i_pitch; @@ -282,7 +298,7 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source, p_y2 += p_source->p[Y_PLANE].i_pitch; #if !defined (MODULE_NAME_IS_i420_yuy2_mmx) - for( i_x = p_vout->render.i_width / 8; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 8; i_x-- ; ) { C_YUV420_YUYV( ); C_YUV420_YUYV( ); @@ -290,12 +306,12 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source, C_YUV420_YUYV( ); } #else - for( i_x = p_vout->render.i_width / 8 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 8 ; i_x-- ; ) { MMX_CALL( MMX_YUV420_YUYV ); } #endif - for( i_x = ( p_vout->render.i_width % 8 ) / 2; i_x-- ; ) + for( i_x = ( p_filter->fmt_in.video.i_width % 8 ) / 2; i_x-- ; ) { C_YUV420_YUYV( ); } @@ -327,7 +343,7 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source, ((intptr_t)p_line2|(intptr_t)p_y2))) ) { /* use faster SSE2 aligned fetch and store */ - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 = p_line2; p_line2 += p_dest->p->i_pitch; @@ -335,11 +351,11 @@ 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 / 16 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 16 ; i_x-- ; ) { SSE2_CALL( SSE2_YUV420_YUYV_ALIGNED ); } - for( i_x = ( p_vout->render.i_width % 16 ) / 2; i_x-- ; ) + for( i_x = ( p_filter->fmt_in.video.i_width % 16 ) / 2; i_x-- ; ) { C_YUV420_YUYV( ); } @@ -355,7 +371,7 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source, else { /* use slower SSE2 unaligned fetch and store */ - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 = p_line2; p_line2 += p_dest->p->i_pitch; @@ -363,11 +379,11 @@ 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 / 16 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 16 ; i_x-- ; ) { SSE2_CALL( SSE2_YUV420_YUYV_UNALIGNED ); } - for( i_x = ( p_vout->render.i_width % 16 ) / 2; i_x-- ; ) + for( i_x = ( p_filter->fmt_in.video.i_width % 16 ) / 2; i_x-- ; ) { C_YUV420_YUYV( ); } @@ -389,8 +405,8 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source, /***************************************************************************** * I420_YVYU: planar YUV 4:2:0 to packed YVYU 4:2:2 *****************************************************************************/ -static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source, - picture_t *p_dest ) +static void I420_YVYU( filter_t *p_filter, picture_t *p_source, + picture_t *p_dest ) { uint8_t *p_line1, *p_line2 = p_dest->p->p_pixels; uint8_t *p_y1, *p_y2 = p_source->Y_PIXELS; @@ -424,14 +440,14 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source, vector unsigned char vu_vec; vector unsigned char y_vec; - if( !( ( p_vout->render.i_width % 32 ) | - ( p_vout->render.i_height % 2 ) ) ) + if( !( ( p_filter->fmt_in.video.i_width % 32 ) | + ( p_filter->fmt_in.video.i_height % 2 ) ) ) { /* Width is a multiple of 32, we take 2 lines at a time */ - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { VEC_NEXT_LINES( ); - for( i_x = p_vout->render.i_width / 32 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 32 ; i_x-- ; ) { VEC_LOAD_UV( ); VEC_MERGE( vec_mergeh ); @@ -439,15 +455,15 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source, } } } - else if( !( ( p_vout->render.i_width % 16 ) | - ( p_vout->render.i_height % 4 ) ) ) + else if( !( ( p_filter->fmt_in.video.i_width % 16 ) | + ( p_filter->fmt_in.video.i_height % 4 ) ) ) { /* Width is only a multiple of 16, we take 4 lines at a time */ - for( i_y = p_vout->render.i_height / 4 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 4 ; i_y-- ; ) { /* Line 1 and 2, pixels 0 to ( width - 16 ) */ VEC_NEXT_LINES( ); - for( i_x = p_vout->render.i_width / 32 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 32 ; i_x-- ; ) { VEC_LOAD_UV( ); VEC_MERGE( vec_mergeh ); @@ -463,7 +479,7 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source, VEC_MERGE( vec_mergel ); /* Line 3 and 4, pixels 16 to ( width ) */ - for( i_x = p_vout->render.i_width / 32 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 32 ; i_x-- ; ) { VEC_LOAD_UV( ); VEC_MERGE( vec_mergeh ); @@ -487,7 +503,7 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source, - p_dest->p->i_visible_pitch; #if !defined(MODULE_NAME_IS_i420_yuy2_sse2) - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 = p_line2; p_line2 += p_dest->p->i_pitch; @@ -495,7 +511,7 @@ static void I420_YVYU( 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-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 8 ; i_x-- ; ) { #if !defined (MODULE_NAME_IS_i420_yuy2_mmx) C_YUV420_YVYU( ); @@ -506,7 +522,7 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source, MMX_CALL( MMX_YUV420_YVYU ); #endif } - for( i_x = ( p_vout->render.i_width % 8 ) / 2; i_x-- ; ) + for( i_x = ( p_filter->fmt_in.video.i_width % 8 ) / 2; i_x-- ; ) { C_YUV420_YVYU( ); } @@ -537,7 +553,7 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source, ((intptr_t)p_line2|(intptr_t)p_y2))) ) { /* use faster SSE2 aligned fetch and store */ - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 = p_line2; p_line2 += p_dest->p->i_pitch; @@ -545,11 +561,11 @@ static void I420_YVYU( 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 / 16 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 16 ; i_x-- ; ) { SSE2_CALL( SSE2_YUV420_YVYU_ALIGNED ); } - for( i_x = ( p_vout->render.i_width % 16 ) / 2; i_x-- ; ) + for( i_x = ( p_filter->fmt_in.video.i_width % 16 ) / 2; i_x-- ; ) { C_YUV420_YVYU( ); } @@ -565,7 +581,7 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source, else { /* use slower SSE2 unaligned fetch and store */ - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 = p_line2; p_line2 += p_dest->p->i_pitch; @@ -573,11 +589,11 @@ static void I420_YVYU( 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 / 16 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 16 ; i_x-- ; ) { SSE2_CALL( SSE2_YUV420_YVYU_UNALIGNED ); } - for( i_x = ( p_vout->render.i_width % 16 ) / 2; i_x-- ; ) + for( i_x = ( p_filter->fmt_in.video.i_width % 16 ) / 2; i_x-- ; ) { C_YUV420_YVYU( ); } @@ -598,8 +614,8 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source, /***************************************************************************** * I420_UYVY: planar YUV 4:2:0 to packed UYVY 4:2:2 *****************************************************************************/ -static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source, - picture_t *p_dest ) +static void I420_UYVY( filter_t *p_filter, picture_t *p_source, + picture_t *p_dest ) { uint8_t *p_line1, *p_line2 = p_dest->p->p_pixels; uint8_t *p_y1, *p_y2 = p_source->Y_PIXELS; @@ -633,14 +649,14 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source, vector unsigned char uv_vec; vector unsigned char y_vec; - if( !( ( p_vout->render.i_width % 32 ) | - ( p_vout->render.i_height % 2 ) ) ) + if( !( ( p_filter->fmt_in.video.i_width % 32 ) | + ( p_filter->fmt_in.video.i_height % 2 ) ) ) { /* Width is a multiple of 32, we take 2 lines at a time */ - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { VEC_NEXT_LINES( ); - for( i_x = p_vout->render.i_width / 32 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 32 ; i_x-- ; ) { VEC_LOAD_UV( ); VEC_MERGE( vec_mergeh ); @@ -648,15 +664,15 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source, } } } - else if( !( ( p_vout->render.i_width % 16 ) | - ( p_vout->render.i_height % 4 ) ) ) + else if( !( ( p_filter->fmt_in.video.i_width % 16 ) | + ( p_filter->fmt_in.video.i_height % 4 ) ) ) { /* Width is only a multiple of 16, we take 4 lines at a time */ - for( i_y = p_vout->render.i_height / 4 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 4 ; i_y-- ; ) { /* Line 1 and 2, pixels 0 to ( width - 16 ) */ VEC_NEXT_LINES( ); - for( i_x = p_vout->render.i_width / 32 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 32 ; i_x-- ; ) { VEC_LOAD_UV( ); VEC_MERGE( vec_mergeh ); @@ -672,7 +688,7 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source, VEC_MERGE( vec_mergel ); /* Line 3 and 4, pixels 16 to ( width ) */ - for( i_x = p_vout->render.i_width / 32 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 32 ; i_x-- ; ) { VEC_LOAD_UV( ); VEC_MERGE( vec_mergeh ); @@ -696,7 +712,7 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source, - p_dest->p->i_visible_pitch; #if !defined(MODULE_NAME_IS_i420_yuy2_sse2) - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 = p_line2; p_line2 += p_dest->p->i_pitch; @@ -704,7 +720,7 @@ static void I420_UYVY( 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-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 8 ; i_x-- ; ) { #if !defined (MODULE_NAME_IS_i420_yuy2_mmx) C_YUV420_UYVY( ); @@ -715,7 +731,7 @@ 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--; ) + for( i_x = ( p_filter->fmt_in.video.i_width % 8 ) / 2; i_x--; ) { C_YUV420_UYVY( ); } @@ -746,7 +762,7 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source, ((intptr_t)p_line2|(intptr_t)p_y2))) ) { /* use faster SSE2 aligned fetch and store */ - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 = p_line2; p_line2 += p_dest->p->i_pitch; @@ -754,11 +770,11 @@ static void I420_UYVY( 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 / 16 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 16 ; i_x-- ; ) { SSE2_CALL( SSE2_YUV420_UYVY_ALIGNED ); } - for( i_x = ( p_vout->render.i_width % 16 ) / 2; i_x-- ; ) + for( i_x = ( p_filter->fmt_in.video.i_width % 16 ) / 2; i_x-- ; ) { C_YUV420_UYVY( ); } @@ -774,7 +790,7 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source, else { /* use slower SSE2 unaligned fetch and store */ - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 = p_line2; p_line2 += p_dest->p->i_pitch; @@ -782,11 +798,11 @@ static void I420_UYVY( 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 / 16 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 16 ; i_x-- ; ) { SSE2_CALL( SSE2_YUV420_UYVY_UNALIGNED ); } - for( i_x = ( p_vout->render.i_width % 16 ) / 2; i_x-- ; ) + for( i_x = ( p_filter->fmt_in.video.i_width % 16 ) / 2; i_x-- ; ) { C_YUV420_UYVY( ); } @@ -808,19 +824,19 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source, /***************************************************************************** * I420_IUYV: planar YUV 4:2:0 to interleaved packed UYVY 4:2:2 *****************************************************************************/ -static void I420_IUYV( vout_thread_t *p_vout, picture_t *p_source, - picture_t *p_dest ) +static void I420_IUYV( filter_t *p_filter, picture_t *p_source, + picture_t *p_dest ) { VLC_UNUSED(p_source); VLC_UNUSED(p_dest); /* FIXME: TODO ! */ - msg_Err( p_vout, "I420_IUYV unimplemented, please harass " ); + msg_Err( p_filter, "I420_IUYV unimplemented, please harass " ); } /***************************************************************************** * I420_cyuv: planar YUV 4:2:0 to upside-down packed UYVY 4:2:2 *****************************************************************************/ -static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source, - picture_t *p_dest ) +static void I420_cyuv( filter_t *p_filter, picture_t *p_source, + picture_t *p_dest ) { uint8_t *p_line1 = p_dest->p->p_pixels + p_dest->p->i_visible_lines * p_dest->p->i_pitch @@ -841,7 +857,7 @@ static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source, - p_dest->p->i_visible_pitch; #if !defined(MODULE_NAME_IS_i420_yuy2_sse2) - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 -= 3 * p_dest->p->i_pitch; p_line2 -= 3 * p_dest->p->i_pitch; @@ -849,7 +865,7 @@ static void I420_cyuv( 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-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 8 ; i_x-- ; ) { #if !defined (MODULE_NAME_IS_i420_yuy2_mmx) C_YUV420_UYVY( ); @@ -860,7 +876,7 @@ static void I420_cyuv( 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-- ; ) + for( i_x = ( p_filter->fmt_in.video.i_width % 8 ) / 2; i_x-- ; ) { C_YUV420_UYVY( ); } @@ -887,7 +903,7 @@ static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source, ((intptr_t)p_line2|(intptr_t)p_y2))) ) { /* use faster SSE2 aligned fetch and store */ - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 = p_line2; p_line2 += p_dest->p->i_pitch; @@ -895,11 +911,11 @@ static void I420_cyuv( 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 / 16 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 16 ; i_x-- ; ) { SSE2_CALL( SSE2_YUV420_UYVY_ALIGNED ); } - for( i_x = ( p_vout->render.i_width % 16 ) / 2; i_x-- ; ) + for( i_x = ( p_filter->fmt_in.video.i_width % 16 ) / 2; i_x-- ; ) { C_YUV420_UYVY( ); } @@ -915,7 +931,7 @@ static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source, else { /* use slower SSE2 unaligned fetch and store */ - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 = p_line2; p_line2 += p_dest->p->i_pitch; @@ -923,11 +939,11 @@ static void I420_cyuv( 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 / 16 ; i_x-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 16 ; i_x-- ; ) { SSE2_CALL( SSE2_YUV420_UYVY_UNALIGNED ); } - for( i_x = ( p_vout->render.i_width % 16 ) / 2; i_x-- ; ) + for( i_x = ( p_filter->fmt_in.video.i_width % 16 ) / 2; i_x-- ; ) { C_YUV420_UYVY( ); } @@ -950,8 +966,8 @@ static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source, * I420_Y211: planar YUV 4:2:0 to packed YUYV 2:1:1 *****************************************************************************/ #if defined (MODULE_NAME_IS_i420_yuy2) -static void I420_Y211( vout_thread_t *p_vout, picture_t *p_source, - picture_t *p_dest ) +static void I420_Y211( filter_t *p_filter, picture_t *p_source, + picture_t *p_dest ) { uint8_t *p_line1, *p_line2 = p_dest->p->p_pixels; uint8_t *p_y1, *p_y2 = p_source->Y_PIXELS; @@ -967,7 +983,7 @@ static void I420_Y211( vout_thread_t *p_vout, picture_t *p_source, const int i_dest_margin = p_dest->p->i_pitch - p_dest->p->i_visible_pitch; - for( i_y = p_vout->render.i_height / 2 ; i_y-- ; ) + for( i_y = p_filter->fmt_in.video.i_height / 2 ; i_y-- ; ) { p_line1 = p_line2; p_line2 += p_dest->p->i_pitch; @@ -975,7 +991,7 @@ static void I420_Y211( 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-- ; ) + for( i_x = p_filter->fmt_in.video.i_width / 8 ; i_x-- ; ) { C_YUV420_Y211( ); C_YUV420_Y211( );