[MPlayer-dev-eng] [PATCH] AF Pitch filter

Charlie Brej mplayer at brej.org
Mon May 28 19:07:38 CEST 2007


Reimar Doeffinger wrote:
> Hello,
> On Mon, May 28, 2007 at 03:44:36PM +0100, Charlie Brej wrote:
>> The problem with the lavc FFT code was that it uses pow2 sized data 
>> arrays. I rewrote the filter to use this but the resultant sound is not 
>> as good as with the kiss code. This can be corrected by tweaking with 
>> the wave offsets. The 1x and 2x ones sound pretty good but the others 
>> have a bit of echoing. This can be tuned later.
> 
> At least for mdct there was some discussion on ffmpeg-dev of how to do
> non-pow2 transforms which might help here as well...
> Which dimension exactly would you be interested in most?

All of them? ;) I use KissFFT which allows any size but only factors of 
2,3,4 and 5 are properly accelerated. I pick a fast size which is close 
to the size I want. So say I have windows size 1000 and if the scaler is 
1.7 I pick a "fast size" close to 1700 (1728). The fast sizes are ones 
with only FFT accelerated factors of 2, 3 and 5 (as opposed to just with 
factors of 2 for the current implementation). Current implementation 
allows 14 different sizes between 1 and 10,000. Adding a 3 gives 67. 
Adding also a 5 gives 174.

2,3 and 5 gives a "good enough" coverage with consecutive points being 
generally separated by less than 5%. The fallback of doing a general 
implementation might also be an idea.

I was looking at adding this feature to the libavcodec FFT but the pow2 
is quite implicit in the design (the init function takes the size as a 
power of 2). If more generic FFTs are desired then this would mean a 
second set of functions to implement them.




More information about the MPlayer-dev-eng mailing list