RustAudio / dasp

The fundamentals for Digital Audio Signal Processing. Formerly `sample`.
Other
883 stars 64 forks source link

Feature Request: Support for Planar Sample-layouts #154

Open rawler opened 3 years ago

rawler commented 3 years ago

As far as I can tell, dasp::slice currently assumes Interleaved frame-layouts. (LRLRLRLRLRLRLRLR) In some cases (for example when working with FFmpeg), I get audio in Planar layout (LLLLLLLLRRRRRRRR). Currently I cannot use large parts of DASP due to this, and are instead forced to write my own functionality for iteration over sequences of Frames. It would be awesome if DASP instead could support it.

mitchmindtree commented 3 years ago

Thanks for the issue! Totally agreed w.r.t. supporting different slice layouts.

I've never seen the term Planar used to refer to this layout before, normally just Noninterleaved. I'm curious, do you have some references for this term being used in the wild?

rawler commented 3 years ago

Planar is the term used by FFmpeg (which I'm using together with DASP). It seems to have leaked out into other products using it, like Shotcut, but also to Gstreamer and WebAudio. The term is also used in Qt, but for video.

Be-ing commented 2 years ago

write my own functionality for iteration over sequences of Frames

@rawler maybe that code could be the basis for implementing this upstream?