chromaprint icon indicating copy to clipboard operation
chromaprint copied to clipboard

Improve SRC performance

Open agentsim opened this issue 8 years ago • 7 comments

Reduce the precision of internal SRC computations to improve resampler performance (by about 20-25%) especially on embedded platforms.

Has no effect on the likelihood of finding a fingerprint match.

Some benchmarks for 120s of audio running on a 1gHz ARM7 CPU: 44.1kHz (before): 2.4s 44.1kHz (after): 2s 176.4kHz (before): 7s 176.4kHz (after): 5.6s

agentsim avatar Feb 17 '17 21:02 agentsim

Thanks, using integers for the resampling is why I actually included a copy of the old resampling code from FFmpeg in the repo, so having avresample/swresample using floating point was definitely not intentional.

However, this should be also done for libavresample, not just libswresample, to make sure these are consistent. It's probably better to use the full internal_sample_fmt option name for both.

I'm also not sure about the planar format. We want non-planar format out of it in the end. Can you try if it's not even after with AV_SAMPLE_FMT_S16?

lalinsky avatar Feb 18 '17 07:02 lalinsky

AV_SAMPLE_FMT_S16 isn't supported. I think this is because internally the resampler works on a single channel at a time, so it makes sense that it wouldn't support an interleaved format as the internal format.

I'll do the rename and make the change in libavresample.

agentsim avatar Feb 18 '17 20:02 agentsim

Hey there, any chances of this ever being merged?

geecko86 avatar Feb 16 '18 12:02 geecko86

Yes, but there are still some changes to be made. And it needs to be properly tested with both ffmpeg and libav.

lalinsky avatar Feb 16 '18 13:02 lalinsky

@agentsim ping ?

Seluj78 avatar Apr 09 '19 16:04 Seluj78

@Seluj78 The project I'm working on moved to beefier hardware where this fix is not important, so I have not had the time to finish it up.

agentsim avatar Apr 09 '19 17:04 agentsim

@agentsim sure thing, I was just wondering :)

Seluj78 avatar Apr 10 '19 07:04 Seluj78