Set range of GetLinearAecOutput to [-1, 1]

The output of GetLinearAecOutput is changed to have the range [-1, 1]
instead of [-2^15, 2^15] to be more similar to other Audio Processing
Module API functions.

The "--linear_aec_output" of audioproc_f has been tested for
bit-exactness.

Bug: webrtc:12185
Change-Id: Id50d93fcfaee5c239f3eb73f99d0bd3533319518
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/193062
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32604}
This commit is contained in:
Gustaf Ullberg
2020-11-13 14:30:30 +01:00
committed by Commit Bot
parent bee6408d7b
commit 4543697b37
2 changed files with 4 additions and 5 deletions

View File

@ -59,7 +59,6 @@ EchoCanceller3Config ReadAec3ConfigFromJsonFile(const std::string& filename) {
return cfg;
}
std::string GetIndexedOutputWavFilename(const std::string& wav_name,
int counter) {
rtc::StringBuilder ss;
@ -260,8 +259,8 @@ void AudioProcessingSimulator::ProcessStream(bool fixed_interface) {
for (size_t k = 0; k < linear_aec_output_buf_[0].size(); ++k) {
for (size_t ch = 0; ch < linear_aec_output_buf_.size(); ++ch) {
RTC_CHECK_EQ(linear_aec_output_buf_[ch].size(), 160);
linear_aec_output_file_writer_->WriteSamples(
&linear_aec_output_buf_[ch][k], 1);
float sample = FloatToFloatS16(linear_aec_output_buf_[ch][k]);
linear_aec_output_file_writer_->WriteSamples(&sample, 1);
}
}
}