sdroege / ebur128

Implementation of the EBU R128 loudness standard
MIT License
98 stars 16 forks source link

Port C code to Rust #1

Closed sdroege closed 4 years ago

sdroege commented 4 years ago

This should be possible to do incrementally

jneem commented 4 years ago

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

sdroege commented 4 years ago

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.

sdroege commented 4 years ago

Actually I have most of it done already, just the actual input code is missing and plumbing.

sdroege commented 4 years ago

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.

sdroege commented 4 years ago

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.

sdroege commented 4 years ago

Also overall around -1000 SLOC for the whole implementation if ignoring the tests and bindgen generated FFI part.