[vlc-commits] ripple: fix green output

Lyndon Brown git at videolan.org
Wed Mar 20 15:34:41 CET 2019


vlc | branch: master | Lyndon Brown <jnqnfe at gmail.com> | Sun Mar 17 19:46:38 2019 +0000| [eb47fbbadc0e4277b4a051ab31188bb3cae193e7] | committer: Thomas Guillem

ripple: fix green output

same flaw as with wave:

right-hand indentations were partially or fully green, depending upon
the resolution of the video, for videos where pitch != visible_pitch

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eb47fbbadc0e4277b4a051ab31188bb3cae193e7
---

 modules/video_filter/ripple.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/modules/video_filter/ripple.c b/modules/video_filter/ripple.c
index 446fa45a4d..a190c35003 100644
--- a/modules/video_filter/ripple.c
+++ b/modules/video_filter/ripple.c
@@ -139,7 +139,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
 
     for( int i_index = 0; i_index < p_pic->i_planes; i_index++ )
     {
-        int i_first_line, i_num_lines, i_offset, i_pixel_pitch,
+        int i_first_line, i_visible_pitch, i_num_lines, i_offset, i_pixel_pitch,
             i_visible_pixels;
         uint16_t black_pixel;
         uint8_t *p_in, *p_out;
@@ -148,6 +148,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
                                                                     : 0x80;
 
         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 )
@@ -168,7 +169,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
                 black_pixel = 0x00;
         }
 
-        i_visible_pixels = p_pic->p[i_index].i_visible_pitch/i_pixel_pitch;
+        i_visible_pixels = i_visible_pitch/i_pixel_pitch;
 
         i_first_line = i_num_lines * 4 / 5;
 
@@ -177,7 +178,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
 
         for( int i_line = 0; i_line < i_first_line; i_line++ )
         {
-            memcpy( p_out, p_in, p_pic->p[i_index].i_visible_pitch );
+            memcpy( p_out, p_in, i_visible_pitch );
             p_in += p_pic->p[i_index].i_pitch;
             p_out += p_outpic->p[i_index].i_pitch;
         }
@@ -200,19 +201,15 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
                 if( i_offset < 0 )
                 {
                     memcpy( p_out, p_in - i_offset,
-                                p_pic->p[i_index].i_visible_pitch + i_offset );
-                    p_in -= p_pic->p[i_index].i_pitch;
-                    p_out += p_outpic->p[i_index].i_pitch;
-                    p_black_out = &p_out[i_offset];
+                                i_visible_pitch + i_offset );
+                    p_black_out = &p_out[i_visible_pitch + i_offset];
                     i_offset = -i_offset;
                 }
                 else
                 {
                     memcpy( p_out + i_offset, p_in,
-                                p_pic->p[i_index].i_visible_pitch - i_offset );
+                                i_visible_pitch - i_offset );
                     p_black_out = p_out;
-                    p_in -= p_pic->p[i_index].i_pitch;
-                    p_out += p_outpic->p[i_index].i_pitch;
                 }
                 if (black_pixel > 0xFF)
                 {
@@ -225,11 +222,10 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
             }
             else
             {
-                memcpy( p_out, p_in, p_pic->p[i_index].i_visible_pitch );
-                p_in -= p_pic->p[i_index].i_pitch;
-                p_out += p_outpic->p[i_index].i_pitch;
+                memcpy( p_out, p_in, i_visible_pitch );
             }
-
+            p_in -= p_pic->p[i_index].i_pitch;
+            p_out += p_outpic->p[i_index].i_pitch;
         }
     }
 



More information about the vlc-commits mailing list