[FFmpeg-soc] [soc]: r4272 - libavfilter/vf_overlay.c

vitor subversion at mplayerhq.hu
Sat May 16 12:20:11 CEST 2009


Author: vitor
Date: Sat May 16 12:20:11 2009
New Revision: 4272

Log:
Fix offsetting of the data pointers in copy_image in 
the overlay filter, so a fourth plane (alpha?) isn't offsetted as a 
subsampled plane.

Patch by Martin Storsjö - $firstname@$firstname.st

Modified:
   libavfilter/vf_overlay.c

Modified: libavfilter/vf_overlay.c
==============================================================================
--- libavfilter/vf_overlay.c	Fri May 15 01:16:47 2009	(r4271)
+++ libavfilter/vf_overlay.c	Sat May 16 12:20:11 2009	(r4272)
@@ -186,12 +186,16 @@ static void copy_image(AVFilterPicRef *d
     int i;
 
     memcpy(&pic, &dst->data, sizeof(AVPicture));
-    pic.data[0] += x * bpp;
-    pic.data[0] += y * pic.linesize[0];
-    for(i = 1; i < 4; i ++) {
+    for(i = 0; i < 4; i ++) {
         if(pic.data[i]) {
-            pic.data[i] +=  x >> hsub;
-            pic.data[i] += (y >> vsub) * pic.linesize[i];
+            int x_off = x;
+            int y_off = y;
+            if (i == 1 || i == 2) {
+                x_off >>= hsub;
+                y_off >>= vsub;
+            }
+            pic.data[i] += x_off * bpp;
+            pic.data[i] += y_off * pic.linesize[i];
         }
     }
 


More information about the FFmpeg-soc mailing list