[vlc-devel] [PATCH] swscale: use x and y offsets when rescaling

Rémi Denis-Courmont remi at remlab.net
Sat Sep 20 11:28:55 CEST 2014


Looks OK. Cannot test it at the moment though

-- 
Rémi Denis-Courmont
Sent from my NVIDIA Tegra-powered device

----- Reply message -----
De : "Felix Abecassis" <felix.abecassis at gmail.com>
Pour : <vlc-devel at videolan.org>
Objet : [vlc-devel] [PATCH] swscale: use x and y offsets when rescaling
Date : ven., sept. 19, 2014 20:09

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:
https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140920/97e60847/attachment.html>


More information about the vlc-devel mailing list