[FFmpeg-devel] [PATCH] lavfi: port mcdeint filter from libmpcodecs

Grozdan neutrino8 at gmail.com
Thu May 30 15:44:15 CEST 2013


On Thu, May 30, 2013 at 3:36 PM, Stefano Sabatini <stefasab at gmail.com>wrote:

> On date Tuesday 2013-05-28 15:40:43 +0200, Stefano Sabatini encoded:
> [...]
> > From b9f77bf3e9b51a3bdc093eca363e56a817bdfa75 Mon Sep 17 00:00:00 2001
> > From: Stefano Sabatini <stefasab at gmail.com>
> > Date: Tue, 28 May 2013 13:40:39 +0200
> > Subject: [PATCH] lavfi: port mcdeint filter from libmpcodecs
> >
> > TODO: bump minor, update changelog
> > ---
> >  LICENSE                  |    1 +
> >  configure                |    1 +
> >  doc/filters.texi         |   44 +++++++
> >  libavfilter/Makefile     |    2 +
> >  libavfilter/allfilters.c |    1 +
> >  libavfilter/vf_mcdeint.c |  298
> ++++++++++++++++++++++++++++++++++++++++++++++
> >  6 files changed, 347 insertions(+)
> >  create mode 100644 libavfilter/vf_mcdeint.c
>
> Updated mcdeint patch. I tracked the inconsistent output to
> uninitialiazed buffer reading which happens in the CHECK(j) macro:
>
> #define CHECK(j)\
>     {   int score = FFABS(srcp[-srcs-1+(j)] - srcp[+srcs-1-(j)]) +\
>                     FFABS(srcp[-srcs  +(j)] - srcp[+srcs  -(j)]) +\
>                     FFABS(srcp[-srcs+1+(j)] - srcp[+srcs+1-(j)]);\
>         if (score < spatial_score) {\
>             spatial_score = score;\
>             diff0 = filp[-fils+(j)] - srcp[-srcs+(j)];\
>             diff1 = filp[+fils-(j)] - srcp[+srcs-(j)];
>
> which is reading padded data if x<2 && x>=w-2, and out-of-buffer data
> in case x=2 and y=1 or x=w-3 and y=h-1.
>
> A possible way to fix it would be to change:
> -                    if((x-2)+(y-1)*w>=0 && (x+2)+(y+1)*w<w*h){ //FIXME
> either alloc larger images or optimize this
> +                    if(y>0 && y<h-1 && x>2 && x<w-3){
>
> but Michael suggested to adopt the same logic used in yadif. I suspend
> my port of mcdeint until the problem is fixed in libmpcodecs.
>

And how long is this going to take? I mean fixing the problem in
libmpcodecs. AFAIK, very few people work on libmpcodecs and Michael is
often busy with other things


>
> Note: CHECK(j) macro restored to initial form for consistency with
> yadif code.
> --
> FFmpeg = Fundamental and Fantastic Mastodontic Perennial EnGine
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>


More information about the ffmpeg-devel mailing list