-
Notifications
You must be signed in to change notification settings - Fork 15
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
Port C code to Rust #1
Comments
I don't have much bandwidth to spare for this right now, but if you put a branch somewhere then I could probably port a function or two when I have a minute... |
Thanks, will do :) I have basic infrastructure (also for comparing correctness and performance) done and some functions ported, but need to clean things up a bit more first. |
Actually I have most of it done already, just the actual input code is missing and plumbing. |
Oh I forgot to link to the branch: https://github.com/sdroege/ebur128/tree/rustify I have the filter almost done too, after that the next step would be to delete all remaining C code as that's mostly plumbing at that point. |
The remaining audio processing function (calc_gating_block) is about 1.5% faster in its Rust version than the C version. Overall the Rust version is currently - 9% slower with all features enabled but not histogram mode - 2% slower with all features enabled in histogram mode - 1% to 2.5% slower in M/S/I modes (with and without histogram) There are various obvious optimizations to do. Fixes #1
Ok, this is all done now. Some obvious further optimizations to do but overall the two implementations are very close in performance (Rust is a bit slower, usually around 2%). On my machine they both give the same results (difference is less than 2 ULP), on travis tests are failing though which I'll have to investigate. |
Also overall around -1000 SLOC for the whole implementation if ignoring the tests and bindgen generated FFI part. |
This should be possible to do incrementally
The text was updated successfully, but these errors were encountered: