<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head></head><body><div style="font-size: 12pt; font-family: Calibri,sans-serif;"><div>Looks OK. Cannot test it at the moment though</div><div><br></div><div>-- </div><div>Rémi Denis-Courmont</div><div>Sent from my NVIDIA Tegra-powered device</div><br><div id="htc_header">----- Reply message -----<br>De : "Felix Abecassis" <felix.abecassis@gmail.com><br>Pour : <vlc-devel@videolan.org><br>Objet : [vlc-devel] [PATCH] swscale: use x and y offsets when rescaling<br>Date : ven., sept. 19, 2014 20:09</div></div><br><pre style="word-wrap: break-word; white-space: pre-wrap;">Fix #12085
---
 modules/video_chroma/swscale.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/video_chroma/swscale.c b/modules/video_chroma/swscale.c
index 8ce512c..164a0d5 100644
--- a/modules/video_chroma/swscale.c
+++ b/modules/video_chroma/swscale.c
@@ -504,12 +504,16 @@ static void GetPixels( uint8_t *pp_pixel[4], int pi_pitch[4],
                        bool b_swap_uv )
 {
     assert( !b_swap_uv || i_plane_count >= 3 );
+    const int i_x_offset = p_picture->format.i_x_offset;
+    const int i_y_offset = p_picture->format.i_y_offset;
     int n;
     for( n = 0; n < __MIN(i_plane_count, p_picture->i_planes-i_plane_start ); n++ )
     {
         const int nd = ( b_swap_uv && n >= 1 && n <= 2 ) ? (3 - n) : n;
         pp_pixel[nd] = p_picture->p[i_plane_start+n].p_pixels;
         pi_pitch[nd] = p_picture->p[i_plane_start+n].i_pitch;
+        pp_pixel[nd] += pi_pitch[nd] * i_y_offset
+            + p_picture->p[i_plane_start+n].i_pixel_pitch * i_x_offset;
     }
     for( ; n < 4; n++ )
     {
-- 
1.9.1

_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
<a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a>

</pre></body></html>