[FFmpeg-devel] [PATCH 5/5] avfilter/phase: remove useless context linesizes.

Clément Bœsch u at pkh.me
Sat May 3 22:48:30 CEST 2014


---
 libavfilter/vf_phase.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/libavfilter/vf_phase.c b/libavfilter/vf_phase.c
index 0e23e81..21ca936 100644
--- a/libavfilter/vf_phase.c
+++ b/libavfilter/vf_phase.c
@@ -19,7 +19,6 @@
  */
 
 #include "libavutil/avassert.h"
-#include "libavutil/imgutils.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/opt.h"
 #include "avfilter.h"
@@ -45,7 +44,6 @@ typedef struct PhaseContext {
     AVFrame *frame; /* previous frame */
     int nb_planes;
     int planeheight[4];
-    int linesize[4];
 } PhaseContext;
 
 #define OFFSET(x) offsetof(PhaseContext, x)
@@ -85,10 +83,6 @@ static int config_input(AVFilterLink *inlink)
 {
     PhaseContext *s = inlink->dst->priv;
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
-    int ret;
-
-    if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0)
-        return ret;
 
     s->planeheight[1] = s->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
     s->planeheight[0] = s->planeheight[3] = inlink->h;
@@ -269,7 +263,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         uint8_t *to = out->data[plane];
 
         for (y = 0, top = 1; y < s->planeheight[plane]; y++, top ^= 1) {
-            memcpy(to, mode == (top ? BOTTOM_FIRST : TOP_FIRST) ? buf : from, s->linesize[plane]);
+            memcpy(to, mode == (top ? BOTTOM_FIRST : TOP_FIRST) ? buf : from, out->linesize[plane]);
 
             buf += s->frame->linesize[plane];
             from += in->linesize[plane];
-- 
1.9.2



More information about the ffmpeg-devel mailing list