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

Clément Bœsch u at pkh.me
Fri May 9 00:01:06 CEST 2014


On Sat, May 03, 2014 at 10:48:30PM +0200, Clément Bœsch wrote:
> ---
>  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];

I dropped this one before applying the patchset: I'm unsure how this will
behave when used with a pad filter typically.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140509/7d9bd321/attachment.asc>


More information about the ffmpeg-devel mailing list