[FFmpeg-soc] [soc]: r291 - in libavfilter: avfilter.c avfilter.h vf_crop.c vo_sdl.c vsrc_dummy.c

koorogi subversion at mplayerhq.hu
Sat Jun 30 18:15:14 CEST 2007


Author: koorogi
Date: Sat Jun 30 18:15:14 2007
New Revision: 291

Log:
Make linesize a per-reference property


Modified:
   libavfilter/avfilter.c
   libavfilter/avfilter.h
   libavfilter/vf_crop.c
   libavfilter/vo_sdl.c
   libavfilter/vsrc_dummy.c

Modified: libavfilter/avfilter.c
==============================================================================
--- libavfilter/avfilter.c	(original)
+++ libavfilter/avfilter.c	Sat Jun 30 18:15:14 2007
@@ -56,6 +56,7 @@ AVFilterPicRef *avfilter_default_get_vid
     avpicture_alloc((AVPicture *)pic, pic->format, ref->w, ref->h);
 
     memcpy(ref->data, pic->data, sizeof(int *) * 4);
+    memcpy(ref->linesize, pic->linesize, sizeof(int *) * 4);
 
     return ref;
 }

Modified: libavfilter/avfilter.h
==============================================================================
--- libavfilter/avfilter.h	(original)
+++ libavfilter/avfilter.h	Sat Jun 30 18:15:14 2007
@@ -50,7 +50,8 @@ typedef struct AVFilterPic
 /**
  * A reference to an AVFilterPic.  Since filters can manipulate the origin of
  * a picture to, for example, crop image without any memcpy, the picture origin
- * and dimensions are per-reference properties.
+ * and dimensions are per-reference properties.  Linesize is also useful for
+ * image flipping, frame to field filters, etc, and so is also per-reference.
  *
  * TODO: add pts, and anything necessary for frame reordering
  */
@@ -58,6 +59,7 @@ typedef struct AVFilterPicRef
 {
     AVFilterPic *pic;
     uint8_t *data[4];
+    int linesize[4];
     int w, h;
 
     int perms;                  ///< permissions

Modified: libavfilter/vf_crop.c
==============================================================================
--- libavfilter/vf_crop.c	(original)
+++ libavfilter/vf_crop.c	Sat Jun 30 18:15:14 2007
@@ -84,7 +84,7 @@ static void end_frame(AVFilterLink *link
 static void draw_slice(AVFilterLink *link, uint8_t *data[4], int y, int h)
 {
     AVFilterContext *ctx = link->dst;
-    AVFilterPic *pic = link->cur_pic->pic;
+    AVFilterPicRef *pic = link->cur_pic;
     CropContext *crop = ctx->priv;
 
     uint8_t *src[4];

Modified: libavfilter/vo_sdl.c
==============================================================================
--- libavfilter/vo_sdl.c	(original)
+++ libavfilter/vo_sdl.c	Sat Jun 30 18:15:14 2007
@@ -79,7 +79,7 @@ static void draw_slice(AVFilterLink *lin
 
     for(i = 0; i < h; i ++) {
         memcpy(dst, src, copysize);
-        src += picref->pic->linesize[0];
+        src += picref->linesize[0];
         dst += sdl->surface->pitch;
     }
 

Modified: libavfilter/vsrc_dummy.c
==============================================================================
--- libavfilter/vsrc_dummy.c	(original)
+++ libavfilter/vsrc_dummy.c	Sat Jun 30 18:15:14 2007
@@ -54,7 +54,7 @@ static void request_frame(AVFilterLink *
             *cur ++ = GREEN;
             *cur ++ = RED;
         }
-        row += pic->pic->linesize[0];
+        row += pic->linesize[0];
     }
 
     avfilter_draw_slice(link, pic->data, 0, pic->h);



More information about the FFmpeg-soc mailing list