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

core: Add SampleBuffer::samples_mut #147

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

FelixMcFelix
Copy link
Contributor

@FelixMcFelix FelixMcFelix commented Jul 25, 2022

Allows mutable access to exported samples, enabling in-place processing of output audio data.

Currently, to use functions like libopus's soft_clip (which take &mut [f32], interleaved) this can only be achieved on SampleBuffer with a significant memcopy (seemingly ~8us for 1920 f32 samples, relative to ~40us decode + ~80us encode). samples_mut removes this additional overhead.

Allows mutable access to exported samples, enabling in-place processing of output audio data.

Currently, to use functions like libopus's soft_clip (which take `&mut [f32]`, interleaved) this can only be achieved on `SampleBuffer` with a significant memcopy (seemingly ~80us for 1920 `f32` samples, relative to ~40us decode). `samples_mut` removes this additional overhead.
@pdeljanov pdeljanov merged commit d70a7f6 into pdeljanov:master Oct 11, 2022
@pdeljanov
Copy link
Owner

Thanks @FelixMcFelix, this change makes a lot of sense to me. Apologies for the delay in getting this merged, got a bit too busy!

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.

2 participants