Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Set range of GetLinearAecOutput to [-1, 1]
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
Gustaf Ullberg authored and Commit Bot committed Nov 13, 2020
1 parent bee6408 commit 4543697
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/audio_processing/audio_processing_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1476,8 +1476,8 @@ bool AudioProcessingImpl::GetLinearAecOutput(
rtc::ArrayView<const float> channel_view =
rtc::ArrayView<const float>(linear_aec_buffer->channels_const()[ch],
linear_aec_buffer->num_frames());
std::copy(channel_view.begin(), channel_view.end(),
linear_output[ch].begin());
FloatS16ToFloat(channel_view.data(), channel_view.size(),
linear_output[ch].data());
}
return true;
}
Expand Down
5 changes: 2 additions & 3 deletions modules/audio_processing/test/audio_processing_simulator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 4543697

Please sign in to comment.