Revert of Add aecdump support to audioproc_f. (patchset #8 id:200001 of https://codereview.webrtc.org/1409943002/ )
This is the second revert. The first attempt in https://codereview.webrtc.org/1423693008/
was missing a subtle curly brace caused by a merge conflict.
I'm going to let this one go through the CQ.
Reason for revert:
This breaks iOS GYP generation as described on http://www.webrtc.org/native-code/ios
I'm going to drive getting the build_with_libjingle=1 setting removed from the bots to match the official instructions.
See https://code.google.com/p/webrtc/issues/detail?id=4653 for more context, as this is exactly what that issue tries to solve.
Original issue's description:
> Add aecdump support to audioproc_f.
>
> Add a new interface to abstract away file operations. This CL temporarily
> removes support for dumping the output of reverse streams. It will be easy to
> restore in the new framework, although we may decide to only allow it with
> the aecdump format.
>
> We also now require the user to specify the output format, rather than
> defaulting to the input format.
>
> TEST=Bit-exact output to the previous audioproc_f version using an input wav
> file, and to the legacy audioproc using an aecdump file.
>
> Committed: https://crrev.com/bdafe31b86e9819b0adb9041f87e6194b7422b08
> Cr-Commit-Position: refs/heads/master@{#10460}
TBR=aluebs@webrtc.org,peah@webrtc.org,andrew@webrtc.org
BUG=
Review URL: https://codereview.webrtc.org/1412963007
Cr-Commit-Position: refs/heads/master@{#10532}
diff --git a/webrtc/modules/audio_processing/test/test_utils.cc b/webrtc/modules/audio_processing/test/test_utils.cc
index 47bd314..1b9ac3c 100644
--- a/webrtc/modules/audio_processing/test/test_utils.cc
+++ b/webrtc/modules/audio_processing/test/test_utils.cc
@@ -31,35 +31,6 @@
fwrite(samples, sizeof(*samples), num_samples, file_handle_);
}
-ChannelBufferWavReader::ChannelBufferWavReader(rtc::scoped_ptr<WavReader> file)
- : file_(file.Pass()) {}
-
-bool ChannelBufferWavReader::Read(ChannelBuffer<float>* buffer) {
- RTC_CHECK_EQ(file_->num_channels(), buffer->num_channels());
- interleaved_.resize(buffer->size());
- if (file_->ReadSamples(interleaved_.size(), &interleaved_[0]) !=
- interleaved_.size()) {
- return false;
- }
-
- FloatS16ToFloat(&interleaved_[0], interleaved_.size(), &interleaved_[0]);
- Deinterleave(&interleaved_[0], buffer->num_frames(), buffer->num_channels(),
- buffer->channels());
- return true;
-}
-
-ChannelBufferWavWriter::ChannelBufferWavWriter(rtc::scoped_ptr<WavWriter> file)
- : file_(file.Pass()) {}
-
-void ChannelBufferWavWriter::Write(const ChannelBuffer<float>& buffer) {
- RTC_CHECK_EQ(file_->num_channels(), buffer.num_channels());
- interleaved_.resize(buffer.size());
- Interleave(buffer.channels(), buffer.num_frames(), buffer.num_channels(),
- &interleaved_[0]);
- FloatToFloatS16(&interleaved_[0], interleaved_.size(), &interleaved_[0]);
- file_->WriteSamples(&interleaved_[0], interleaved_.size());
-}
-
void WriteIntData(const int16_t* data,
size_t length,
WavWriter* wav_file,
@@ -121,32 +92,28 @@
case 2:
return AudioProcessing::kStereo;
default:
- RTC_CHECK(false);
+ assert(false);
return AudioProcessing::kMono;
}
}
-std::vector<Point> ParseArrayGeometry(const std::string& mic_positions) {
+std::vector<Point> ParseArrayGeometry(const std::string& mic_positions,
+ size_t num_mics) {
const std::vector<float> values = ParseList<float>(mic_positions);
- const size_t num_mics =
- rtc::CheckedDivExact(values.size(), static_cast<size_t>(3));
- RTC_CHECK_GT(num_mics, 0u) << "mic_positions is not large enough.";
+ RTC_CHECK_EQ(values.size(), 3 * num_mics)
+ << "Could not parse mic_positions or incorrect number of points.";
std::vector<Point> result;
result.reserve(num_mics);
for (size_t i = 0; i < values.size(); i += 3) {
- result.push_back(Point(values[i + 0], values[i + 1], values[i + 2]));
+ double x = values[i + 0];
+ double y = values[i + 1];
+ double z = values[i + 2];
+ result.push_back(Point(x, y, z));
}
return result;
}
-std::vector<Point> ParseArrayGeometry(const std::string& mic_positions,
- size_t num_mics) {
- std::vector<Point> result = ParseArrayGeometry(mic_positions);
- RTC_CHECK_EQ(result.size(), num_mics)
- << "Could not parse mic_positions or incorrect number of points.";
- return result;
-}
} // namespace webrtc