avfilter/vf_fftfilt: increase RDFT length by 10%
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 10 Mar 2015 02:32:38 +0000 (03:32 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 10 Mar 2015 02:32:38 +0000 (03:32 +0100)
This fixes artifacts when the dimensions are exact powers of 2

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/vf_fftfilt.c

index 86acc62..dff279c 100644 (file)
@@ -208,14 +208,14 @@ static int config_props(AVFilterLink *inlink)
         int h = inlink->h;
 
         /* RDFT - Array initialization for Horizontal pass*/
-        for (rdft_hbits = 1; 1 << rdft_hbits < w; rdft_hbits++);
+        for (rdft_hbits = 1; 1 << rdft_hbits < w*10/9; rdft_hbits++);
         fftfilt->rdft_hbits[i] = rdft_hbits;
         fftfilt->rdft_hlen[i] = 1 << rdft_hbits;
         if (!(fftfilt->rdft_hdata[i] = av_malloc_array(h, fftfilt->rdft_hlen[i] * sizeof(FFTSample))))
             return AVERROR(ENOMEM);
 
         /* RDFT - Array initialization for Vertical pass*/
-        for (rdft_vbits = 1; 1 << rdft_vbits < h; rdft_vbits++);
+        for (rdft_vbits = 1; 1 << rdft_vbits < h*10/9; rdft_vbits++);
         fftfilt->rdft_vbits[i] = rdft_vbits;
         fftfilt->rdft_vlen[i] = 1 << rdft_vbits;
         if (!(fftfilt->rdft_vdata[i] = av_malloc_array(fftfilt->rdft_hlen[i], fftfilt->rdft_vlen[i] * sizeof(FFTSample))))