mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 13:01:07 +00:00
audiorrnoise: Use correct value range for the samples
The nnnoiseless crate wants all samples in the range [-32767,32767] instead of the [-1,1] range we're using for floating point samples. Scale before/after processing while (de)interleaving the samples. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/276 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1003>
This commit is contained in:
parent
08c716d110
commit
1ffadbc270
1 changed files with 2 additions and 2 deletions
|
@ -92,7 +92,7 @@ impl State {
|
||||||
let channel_index = index % channels;
|
let channel_index = index % channels;
|
||||||
let channel_denoiser = &mut self.denoisers[channel_index];
|
let channel_denoiser = &mut self.denoisers[channel_index];
|
||||||
let pos = index / channels;
|
let pos = index / channels;
|
||||||
channel_denoiser.frame_chunk[pos] = *item;
|
channel_denoiser.frame_chunk[pos] = *item * 32767.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for i in (in_frame.len() / channels)..(size / channels) {
|
for i in (in_frame.len() / channels)..(size / channels) {
|
||||||
|
@ -115,7 +115,7 @@ impl State {
|
||||||
let channel_index = index % channels;
|
let channel_index = index % channels;
|
||||||
let channel_denoiser = &self.denoisers[channel_index];
|
let channel_denoiser = &self.denoisers[channel_index];
|
||||||
let pos = index / channels;
|
let pos = index / channels;
|
||||||
*item = channel_denoiser.out_chunk[pos];
|
*item = channel_denoiser.out_chunk[pos] / 32767.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue