Add tests and modify tools for new float deinterleaved interface.
- Add an Initialize() overload to allow specification of format
parameters. This is mainly useful for testing, but could be used in
the cases where a consumer knows the format before the streams arrive.
- Add a reverse_sample_rate_hz_ parameter to prepare for mismatched
capture and render rates. There is no functional change as it is
currently constrained to match the capture rate.
- Fix a bug in the float dump: we need to use add_ rather than set_.
- Add a debug dump test for both int and float interfaces.
- Enable unpacking of float dumps.
- Enable audioproc to read float dumps.
- Move more shared functionality to test_utils.h, and generally tidy up
a bit by consolidating repeated code.
BUG=2894
TESTED=Verified that the output produced by the float debug dump test is
correct. Processed the resulting debug dump file with audioproc and
ensured that we get identical output. (This is crucial, as we need to
be able to exactly reproduce online results offline.)
R=aluebs@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/9489004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5676 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.h b/webrtc/modules/audio_processing/audio_processing_impl.h
index 2f6385f..95af8f5 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.h
+++ b/webrtc/modules/audio_processing/audio_processing_impl.h
@@ -46,6 +46,11 @@
// AudioProcessing methods.
virtual int Initialize() OVERRIDE;
+ virtual int Initialize(int sample_rate_hz,
+ int reverse_sample_rate_hz,
+ int num_input_channels,
+ int num_output_channels,
+ int num_reverse_channels) OVERRIDE;
virtual void SetExtraOptions(const Config& config) OVERRIDE;
virtual int EnableExperimentalNs(bool enable) OVERRIDE;
virtual bool experimental_ns_enabled() const OVERRIDE {
@@ -93,11 +98,20 @@
virtual VoiceDetection* voice_detection() const OVERRIDE;
protected:
+ // Overridden in a mock.
virtual int InitializeLocked();
private:
- int MaybeInitializeLocked(int sample_rate_hz, int num_input_channels,
- int num_output_channels, int num_reverse_channels);
+ int InitializeLocked(int sample_rate_hz,
+ int reverse_sample_rate_hz,
+ int num_input_channels,
+ int num_output_channels,
+ int num_reverse_channels);
+ int MaybeInitializeLocked(int sample_rate_hz,
+ int reverse_sample_rate_hz,
+ int num_input_channels,
+ int num_output_channels,
+ int num_reverse_channels);
int ProcessStreamLocked();
int AnalyzeReverseStreamLocked();
@@ -129,8 +143,10 @@
#endif
int sample_rate_hz_;
+ int reverse_sample_rate_hz_;
int split_sample_rate_hz_;
int samples_per_channel_;
+ int reverse_samples_per_channel_;
int stream_delay_ms_;
int delay_offset_ms_;
bool was_stream_delay_set_;