]> git.sesse.net Git - vlc/commitdiff
Correctly handle YUV 422 packed in ripple and wave
authorAntoine Cellerier <dionoea@videolan.org>
Mon, 4 Jan 2010 22:38:34 +0000 (23:38 +0100)
committerAntoine Cellerier <dionoea@videolan.org>
Mon, 4 Jan 2010 22:40:06 +0000 (23:40 +0100)
It's a bit blocky but a lot easier than a pixel perfect fix.

modules/video_filter/ripple.c
modules/video_filter/wave.c

index a8ce70fcc42ec3522648c5bf69b69b6c4f8d6a9a..55d78625f4ec1546ded3d48f92542a2e9a5606a7 100644 (file)
@@ -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 )
             {
index 0c281231d87f64ca8f198167152cadc1adf77b69..6ad3ac27171ea742ab29c72cf651cb756075b283 100644 (file)
@@ -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