From b998f491d1958f0121492ec87c7fa9fc682d6c54 Mon Sep 17 00:00:00 2001 From: Antoine Cellerier Date: Mon, 4 Jan 2010 23:38:34 +0100 Subject: [PATCH] Correctly handle YUV 422 packed in ripple and wave It's a bit blocky but a lot easier than a pixel perfect fix. --- modules/video_filter/ripple.c | 12 ++++++++++-- modules/video_filter/wave.c | 7 +++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/modules/video_filter/ripple.c b/modules/video_filter/ripple.c index a8ce70fcc4..55d78625f4 100644 --- a/modules/video_filter/ripple.c +++ b/modules/video_filter/ripple.c @@ -143,7 +143,15 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) i_num_lines = p_pic->p[i_index].i_visible_lines; i_pixel_pitch = p_pic->p[i_index].i_pixel_pitch; - i_visible_pixels = p_pic->p[i_index].i_visible_pitch/p_pic->p[i_index].i_pixel_pitch; + switch( p_filter->fmt_in.video.i_chroma ) + { + CASE_PACKED_YUV_422 + // Quick hack to fix u/v inversion occuring with 2 byte pixel pitch + i_pixel_pitch *= 2; + break; + } + + i_visible_pixels = p_pic->p[i_index].i_visible_pitch/i_pixel_pitch; i_first_line = i_num_lines * 4 / 5; @@ -167,7 +175,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) - i_first_line) ) * (double)(i_line - i_first_line) / (double)i_num_lines - / 8.0 )*p_pic->p[i_index].i_pixel_pitch; + / 8.0 )*i_pixel_pitch; if( i_offset ) { diff --git a/modules/video_filter/wave.c b/modules/video_filter/wave.c index 0c281231d8..6ad3ac2717 100644 --- a/modules/video_filter/wave.c +++ b/modules/video_filter/wave.c @@ -145,6 +145,13 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) i_num_lines = p_pic->p[i_index].i_visible_lines; i_visible_pitch = p_pic->p[i_index].i_visible_pitch; i_pixel_pitch = p_pic->p[i_index].i_pixel_pitch; + switch( p_filter->fmt_in.video.i_chroma ) + { + CASE_PACKED_YUV_422 + // Quick hack to fix u/v inversion occuring with 2 byte pixel pitch + i_pixel_pitch *= 2; + break; + } i_visible_pixels = i_visible_pitch/i_pixel_pitch; black_pixel = ( p_pic->i_planes > 1 && i_index == Y_PLANE ) ? 0x00 -- 2.39.2