sdroege / ebur128

Implementation of the EBU R128 loudness standard
MIT License
93 stars 15 forks source link

interp:Use new const-generics to simplify code #48

Closed rawler closed 1 year ago

rawler commented 1 year ago

In particular, we can avoid macros, the ArrayBuf-hack, and associated PhantomData. The net result should be code with less indirections, that is slightly easier to read and understand. (But performs the same)

rawler commented 1 year ago

I tried doing the same to the true_peak-code, but hit problems like "Frame" is not implemented for all N of [Sample; N]. Hopefully, when const-generics mature a little bit throughout the Rust ecosystem, it will be worth revisiting.

sdroege commented 1 year ago

Can you create an issue so that the Frame type is updated to const generics and link it here?

Also clippy seems unhappy :)

rawler commented 1 year ago

Clippy is appeased, but I notice I forgot about the C-interface. Will fix and come back :)

sdroege commented 1 year ago

Well, now we have clippy warnings :) Do you want to handle those in a separate commit as part of this PR? Otherwise I can also take care of them before.

sdroege commented 1 year ago

See https://github.com/sdroege/ebur128/pull/49

sdroege commented 1 year ago

Now it's only the tests related to this PR failing

rawler commented 1 year ago

Alright. Accidentally swapped parameter order for the test. Now everything should be in order.

sdroege commented 1 year ago

Thanks!