Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve SRC performance #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

agentsim
Copy link

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

performance especially on embedded platforms. Has no effect on the
likelihood of finding a fingerprint match.
@lalinsky
Copy link
Member

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?

@agentsim
Copy link
Author

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.

@geecko86
Copy link

Hey there, any chances of this ever being merged?

@lalinsky
Copy link
Member

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

@Seluj78
Copy link

Seluj78 commented Apr 9, 2019

@agentsim ping ?

@agentsim
Copy link
Author

agentsim commented Apr 9, 2019

@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.

@Seluj78
Copy link

Seluj78 commented Apr 10, 2019

@agentsim sure thing, I was just wondering :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants