Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h

Issue 2320833002: Compensate for the IntelligibilityEnhancer processing delay in high bands (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h
index 3af1190cf0c167f0ab53e16e157f6df5ae916fbc..a87313a37c0c16425b0ed22f3707eee902c34069 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h
@@ -16,8 +16,10 @@
#include <vector>
#include "webrtc/base/swap_queue.h"
-#include "webrtc/common_audio/lapped_transform.h"
+#include "webrtc/common_audio/audio_ring_buffer.h"
#include "webrtc/common_audio/channel_buffer.h"
+#include "webrtc/common_audio/lapped_transform.h"
+#include "webrtc/modules/audio_processing/audio_buffer.h"
#include "webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h"
#include "webrtc/modules/audio_processing/render_queue_item_verifier.h"
#include "webrtc/modules/audio_processing/vad/voice_activity_detector.h"
@@ -41,9 +43,7 @@ class IntelligibilityEnhancer : public LappedTransform::Callback {
void SetCaptureNoiseEstimate(std::vector<float> noise, float gain);
// Reads chunk of speech in time domain and updates with modified signal.
- void ProcessRenderAudio(float* const* audio,
- int sample_rate_hz,
- size_t num_channels);
+ void ProcessRenderAudio(AudioBuffer* audio, int sample_rate_hz);
bool active() const;
protected:
@@ -84,6 +84,10 @@ class IntelligibilityEnhancer : public LappedTransform::Callback {
// Returns true if the audio is speech.
bool IsSpeech(const float* audio);
+ // Delays the high bands to compensate for the processing delay in the low
+ // band.
+ void DelayHighBands(AudioBuffer* audio);
+
static const size_t kMaxNumNoiseEstimatesToBuffer = 5;
const size_t freqs_; // Num frequencies in frequency domain.
@@ -120,6 +124,8 @@ class IntelligibilityEnhancer : public LappedTransform::Callback {
std::vector<float> noise_estimation_buffer_;
SwapQueue<std::vector<float>, RenderQueueItemVerifier<float>>
noise_estimation_queue_;
+
+ std::vector<std::unique_ptr<AudioRingBuffer>> high_bands_buffers_;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698