From 44c8a373a52a5d20ed5470204a9324885dfe5f6c Mon Sep 17 00:00:00 2001 From: peah Date: Thu, 5 May 2016 13:34:29 -0700 Subject: [PATCH] Removed the file echo_cancellation_internal.h and moved the file content to echo_cancellation.h. The purpose of this CL is to simplify upcoming AEC algorithm changes. The changes should be bitexact. BUG=webrtc:5298, webrtc:5201 Review-Url: https://codereview.webrtc.org/1947743004 Cr-Commit-Position: refs/heads/master@{#12638} --- webrtc/modules/audio_processing/BUILD.gn | 1 - .../audio_processing/aec/echo_cancellation.cc | 1 - .../audio_processing/aec/echo_cancellation.h | 54 ++++++++++++++ .../aec/echo_cancellation_internal.h | 73 ------------------- .../aec/system_delay_unittest.cc | 1 - .../audio_processing/audio_processing.gypi | 1 - 6 files changed, 54 insertions(+), 77 deletions(-) delete mode 100644 webrtc/modules/audio_processing/aec/echo_cancellation_internal.h diff --git a/webrtc/modules/audio_processing/BUILD.gn b/webrtc/modules/audio_processing/BUILD.gn index c18c1d80cf..b4afb16dab 100644 --- a/webrtc/modules/audio_processing/BUILD.gn +++ b/webrtc/modules/audio_processing/BUILD.gn @@ -31,7 +31,6 @@ source_set("audio_processing") { "aec/aec_resampler.h", "aec/echo_cancellation.cc", "aec/echo_cancellation.h", - "aec/echo_cancellation_internal.h", "aecm/aecm_core.cc", "aecm/aecm_core.h", "aecm/echo_control_mobile.cc", diff --git a/webrtc/modules/audio_processing/aec/echo_cancellation.cc b/webrtc/modules/audio_processing/aec/echo_cancellation.cc index e1dba6e84e..716da38ab8 100644 --- a/webrtc/modules/audio_processing/aec/echo_cancellation.cc +++ b/webrtc/modules/audio_processing/aec/echo_cancellation.cc @@ -23,7 +23,6 @@ extern "C" { } #include "webrtc/modules/audio_processing/aec/aec_core.h" #include "webrtc/modules/audio_processing/aec/aec_resampler.h" -#include "webrtc/modules/audio_processing/aec/echo_cancellation_internal.h" #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" #include "webrtc/typedefs.h" diff --git a/webrtc/modules/audio_processing/aec/echo_cancellation.h b/webrtc/modules/audio_processing/aec/echo_cancellation.h index f4b1f20ab7..8e5e52c32b 100644 --- a/webrtc/modules/audio_processing/aec/echo_cancellation.h +++ b/webrtc/modules/audio_processing/aec/echo_cancellation.h @@ -11,8 +11,14 @@ #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_ECHO_CANCELLATION_H_ #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_ECHO_CANCELLATION_H_ +#include + #include +extern "C" { +#include "webrtc/common_audio/ring_buffer.h" +} +#include "webrtc/modules/audio_processing/aec/aec_core.h" #include "webrtc/typedefs.h" namespace webrtc { @@ -56,6 +62,54 @@ typedef struct { struct AecCore; +class ApmDataDumper; + +typedef struct Aec { + std::unique_ptr data_dumper; + + int delayCtr; + int sampFreq; + int splitSampFreq; + int scSampFreq; + float sampFactor; // scSampRate / sampFreq + short skewMode; + int bufSizeStart; + int knownDelay; + int rate_factor; + + short initFlag; // indicates if AEC has been initialized + + // Variables used for averaging far end buffer size + short counter; + int sum; + short firstVal; + short checkBufSizeCtr; + + // Variables used for delay shifts + short msInSndCardBuf; + short filtDelay; // Filtered delay estimate. + int timeForDelayChange; + int startup_phase; + int checkBuffSize; + short lastDelayDiff; + + // Structures + void* resampler; + + int skewFrCtr; + int resample; // if the skew is small enough we don't resample + int highSkewCtr; + float skew; + + RingBuffer* far_pre_buf; // Time domain far-end pre-buffer. + + int farend_started; + + // Aec instance counter. + static int instance_count; + AecCore* aec; +} Aec; + /* * Allocates the memory needed by the AEC. The memory needs to be initialized * separately using the WebRtcAec_Init() function. Returns a pointer to the diff --git a/webrtc/modules/audio_processing/aec/echo_cancellation_internal.h b/webrtc/modules/audio_processing/aec/echo_cancellation_internal.h deleted file mode 100644 index 5e79626d6f..0000000000 --- a/webrtc/modules/audio_processing/aec/echo_cancellation_internal.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_ECHO_CANCELLATION_INTERNAL_H_ -#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_ECHO_CANCELLATION_INTERNAL_H_ - -#include - -extern "C" { -#include "webrtc/common_audio/ring_buffer.h" -} -#include "webrtc/modules/audio_processing/aec/aec_core.h" - -namespace webrtc { - -class ApmDataDumper; - -typedef struct Aec { - std::unique_ptr data_dumper; - - int delayCtr; - int sampFreq; - int splitSampFreq; - int scSampFreq; - float sampFactor; // scSampRate / sampFreq - short skewMode; - int bufSizeStart; - int knownDelay; - int rate_factor; - - short initFlag; // indicates if AEC has been initialized - - // Variables used for averaging far end buffer size - short counter; - int sum; - short firstVal; - short checkBufSizeCtr; - - // Variables used for delay shifts - short msInSndCardBuf; - short filtDelay; // Filtered delay estimate. - int timeForDelayChange; - int startup_phase; - int checkBuffSize; - short lastDelayDiff; - - // Structures - void* resampler; - - int skewFrCtr; - int resample; // if the skew is small enough we don't resample - int highSkewCtr; - float skew; - - RingBuffer* far_pre_buf; // Time domain far-end pre-buffer. - - int farend_started; - - // Aec instance counter. - static int instance_count; - AecCore* aec; -} Aec; - -} // namespace webrtc - -#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_ECHO_CANCELLATION_INTERNAL_H_ diff --git a/webrtc/modules/audio_processing/aec/system_delay_unittest.cc b/webrtc/modules/audio_processing/aec/system_delay_unittest.cc index be145898b5..51a4df2b78 100644 --- a/webrtc/modules/audio_processing/aec/system_delay_unittest.cc +++ b/webrtc/modules/audio_processing/aec/system_delay_unittest.cc @@ -10,7 +10,6 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/modules/audio_processing/aec/aec_core.h" -#include "webrtc/modules/audio_processing/aec/echo_cancellation_internal.h" #include "webrtc/modules/audio_processing/aec/echo_cancellation.h" #include "webrtc/typedefs.h" namespace webrtc { diff --git a/webrtc/modules/audio_processing/audio_processing.gypi b/webrtc/modules/audio_processing/audio_processing.gypi index 4ee6c5c3c1..225dffdd4c 100644 --- a/webrtc/modules/audio_processing/audio_processing.gypi +++ b/webrtc/modules/audio_processing/audio_processing.gypi @@ -41,7 +41,6 @@ 'aec/aec_resampler.cc', 'aec/aec_resampler.h', 'aec/echo_cancellation.cc', - 'aec/echo_cancellation_internal.h', 'aec/echo_cancellation.h', 'aecm/aecm_core.cc', 'aecm/aecm_core.h',