This CL introduces namespaces in the aec c++ files
(the ones that were recently moved from c) There are many files changed but most changes just consist of adding namespaces. In aec_common.h an C++-specific #ifdef needed to be added as that file is both included from C and C++. I could see no way around that but please let me know if there is a better way around that. BUG=webrtc:5201 Review URL: https://codereview.webrtc.org/1766663002 Cr-Commit-Position: refs/heads/master@{#11883}
This commit is contained in:
parent
f472c5b672
commit
50e21bd40b
@ -21,6 +21,10 @@
|
||||
#define ALIGN16_END __attribute__((aligned(16)))
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace webrtc {
|
||||
#endif
|
||||
|
||||
extern ALIGN16_BEG const float ALIGN16_END WebRtcAec_sqrtHanning[65];
|
||||
extern ALIGN16_BEG const float ALIGN16_END WebRtcAec_weightCurve[65];
|
||||
extern ALIGN16_BEG const float ALIGN16_END WebRtcAec_overDriveCurve[65];
|
||||
@ -28,4 +32,8 @@ extern const float WebRtcAec_kExtendedSmoothingCoefficients[2][2];
|
||||
extern const float WebRtcAec_kNormalSmoothingCoefficients[2][2];
|
||||
extern const float WebRtcAec_kMinFarendPSD;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // namespace webrtc
|
||||
#endif
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_COMMON_H_
|
||||
|
||||
@ -40,6 +40,8 @@ extern "C" {
|
||||
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Buffer size (samples)
|
||||
static const size_t kBufSizePartitions = 250; // 1 second of audio in 16 kHz.
|
||||
|
||||
@ -1901,3 +1903,4 @@ void WebRtcAec_SetSystemDelay(AecCore* self, int delay) {
|
||||
assert(delay >= 0);
|
||||
self->system_delay = delay;
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
#define FRAME_LEN 80
|
||||
#define PART_LEN 64 // Length of partition
|
||||
#define PART_LEN1 (PART_LEN + 1) // Unique fft coefficients
|
||||
@ -132,4 +134,6 @@ int WebRtcAec_system_delay(AecCore* self);
|
||||
// care.
|
||||
void WebRtcAec_SetSystemDelay(AecCore* self, int delay);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_H_
|
||||
|
||||
@ -19,6 +19,8 @@ extern "C" {
|
||||
#include "webrtc/modules/audio_processing/aec/aec_core.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Number of partitions for the extended filter mode. The first one is an enum
|
||||
// to be used in array declarations, as it represents the maximum filter length.
|
||||
enum { kExtendedNumPartitions = 32 };
|
||||
@ -227,4 +229,6 @@ extern WebRtcAecStoreAsComplex WebRtcAec_StoreAsComplex;
|
||||
typedef void (*WebRtcAecWindowData)(float* x_windowed, const float* x);
|
||||
extern WebRtcAecWindowData WebRtcAec_WindowData;
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_CORE_INTERNAL_H_
|
||||
|
||||
@ -24,6 +24,8 @@ extern "C" {
|
||||
#include "webrtc/modules/audio_processing/aec/aec_rdft.h"
|
||||
}
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
extern const float WebRtcAec_weightCurve[65];
|
||||
extern const float WebRtcAec_overDriveCurve[65];
|
||||
|
||||
@ -781,3 +783,4 @@ void WebRtcAec_InitAec_mips(void) {
|
||||
WebRtcAec_ComfortNoise = WebRtcAec_ComfortNoise_mips;
|
||||
WebRtcAec_OverdriveAndSuppress = WebRtcAec_OverdriveAndSuppress_mips;
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
||||
@ -27,6 +27,8 @@ extern "C" {
|
||||
#include "webrtc/modules/audio_processing/aec/aec_rdft.h"
|
||||
}
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
enum { kShiftExponentIntoTopMantissa = 8 };
|
||||
enum { kFloatExponentShift = 23 };
|
||||
|
||||
@ -728,3 +730,4 @@ void WebRtcAec_InitAec_neon(void) {
|
||||
WebRtcAec_PartitionDelay = PartitionDelayNEON;
|
||||
WebRtcAec_WindowData = WindowDataNEON;
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
||||
@ -25,6 +25,8 @@ extern "C" {
|
||||
#include "webrtc/modules/audio_processing/aec/aec_rdft.h"
|
||||
}
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
__inline static float MulRe(float aRe, float aIm, float bRe, float bIm) {
|
||||
return aRe * bRe - aIm * bIm;
|
||||
}
|
||||
@ -742,3 +744,4 @@ void WebRtcAec_InitAec_SSE2(void) {
|
||||
WebRtcAec_PartitionDelay = PartitionDelaySSE2;
|
||||
WebRtcAec_WindowData = WindowDataSSE2;
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
|
||||
#include "webrtc/modules/audio_processing/aec/aec_core.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
enum { kEstimateLengthFrames = 400 };
|
||||
|
||||
typedef struct {
|
||||
@ -202,3 +204,4 @@ int EstimateSkew(const int* rawSkew,
|
||||
*skewEst = skew;
|
||||
return 0;
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
|
||||
#include "webrtc/modules/audio_processing/aec/aec_core.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
enum { kResamplingDelay = 1 };
|
||||
enum { kResamplerBufferSize = FRAME_LEN * 4 };
|
||||
|
||||
@ -32,4 +34,6 @@ void WebRtcAec_ResampleLinear(void* resampInst,
|
||||
float* outspeech,
|
||||
size_t* size_out);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_AEC_RESAMPLER_H_
|
||||
|
||||
@ -29,6 +29,8 @@ extern "C" {
|
||||
#include "webrtc/modules/audio_processing/aec/echo_cancellation_internal.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Measured delays [ms]
|
||||
// Device Chrome GTP
|
||||
// MacBook Air 10
|
||||
@ -881,3 +883,4 @@ static void EstBufDelayExtended(Aec* self) {
|
||||
self->knownDelay = WEBRTC_SPL_MAX((int)self->filtDelay - 256, 0);
|
||||
}
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Errors
|
||||
#define AEC_UNSPECIFIED_ERROR 12000
|
||||
#define AEC_UNSUPPORTED_FUNCTION_ERROR 12001
|
||||
@ -234,4 +236,6 @@ int WebRtcAec_GetDelayMetrics(void* handle,
|
||||
//
|
||||
struct AecCore* WebRtcAec_aec_core(void* handle);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_ECHO_CANCELLATION_H_
|
||||
|
||||
@ -16,6 +16,8 @@ extern "C" {
|
||||
}
|
||||
#include "webrtc/modules/audio_processing/aec/aec_core.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
typedef struct {
|
||||
int delayCtr;
|
||||
int sampFreq;
|
||||
@ -64,4 +66,6 @@ typedef struct {
|
||||
AecCore* aec;
|
||||
} Aec;
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_ECHO_CANCELLATION_INTERNAL_H_
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
#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 {
|
||||
namespace {
|
||||
|
||||
class SystemDelayTest : public ::testing::Test {
|
||||
@ -597,3 +597,4 @@ TEST_F(SystemDelayTest, CorrectImpactWhenTogglingDeviceBufferValues) {
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace webrtc
|
||||
|
||||
@ -25,10 +25,10 @@
|
||||
#include "webrtc/modules/audio_processing/beamformer/array_util.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
struct AecCore;
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
struct AecCore;
|
||||
|
||||
class AudioFrame;
|
||||
|
||||
template<typename T>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user