Ensured that all files in APM are using the webrtc namespace
This CL adds namespaces to those files remaining within APM that do not
have any such.
BUG=webrtc:5298
Change-Id: I710b3d2a3644bea9d4bdffef0d77883b30303338
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171111
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30850}
diff --git a/modules/audio_processing/aec_dump/aec_dump_unittest.cc b/modules/audio_processing/aec_dump/aec_dump_unittest.cc
index f4b0908..62f896f 100644
--- a/modules/audio_processing/aec_dump/aec_dump_unittest.cc
+++ b/modules/audio_processing/aec_dump/aec_dump_unittest.cc
@@ -16,6 +16,8 @@
#include "test/gtest.h"
#include "test/testsupport/file_utils.h"
+namespace webrtc {
+
TEST(AecDumper, APICallsDoNotCrash) {
// Note order of initialization: Task queue has to be initialized
// before AecDump.
@@ -81,3 +83,5 @@
ASSERT_EQ(0, fclose(fid));
ASSERT_EQ(0, remove(filename.c_str()));
}
+
+} // namespace webrtc
diff --git a/modules/audio_processing/agc/gain_map_internal.h b/modules/audio_processing/agc/gain_map_internal.h
index 63d9b51..547f0f3 100644
--- a/modules/audio_processing/agc/gain_map_internal.h
+++ b/modules/audio_processing/agc/gain_map_internal.h
@@ -11,6 +11,8 @@
#ifndef MODULES_AUDIO_PROCESSING_AGC_GAIN_MAP_INTERNAL_H_
#define MODULES_AUDIO_PROCESSING_AGC_GAIN_MAP_INTERNAL_H_
+namespace webrtc {
+
static const int kGainMapSize = 256;
// Uses parameters: si = 2, sf = 0.25, D = 8/256
static const int kGainMap[kGainMapSize] = {
@@ -33,4 +35,6 @@
60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63,
64};
+} // namespace webrtc
+
#endif // MODULES_AUDIO_PROCESSING_AGC_GAIN_MAP_INTERNAL_H_
diff --git a/modules/audio_processing/agc/utility.cc b/modules/audio_processing/agc/utility.cc
index 554a837..2a87e5c 100644
--- a/modules/audio_processing/agc/utility.cc
+++ b/modules/audio_processing/agc/utility.cc
@@ -12,6 +12,8 @@
#include <math.h>
+namespace webrtc {
+
static const double kLog10 = 2.30258509299;
static const double kLinear2DbScale = 20.0 / kLog10;
static const double kLinear2LoudnessScale = 13.4 / kLog10;
@@ -33,3 +35,5 @@
double Dbfs2Loudness(double dbfs) {
return Db2Loudness(90 + dbfs);
}
+
+} // namespace webrtc
diff --git a/modules/audio_processing/agc/utility.h b/modules/audio_processing/agc/utility.h
index 8ba87b6..56eec24 100644
--- a/modules/audio_processing/agc/utility.h
+++ b/modules/audio_processing/agc/utility.h
@@ -11,6 +11,8 @@
#ifndef MODULES_AUDIO_PROCESSING_AGC_UTILITY_H_
#define MODULES_AUDIO_PROCESSING_AGC_UTILITY_H_
+namespace webrtc {
+
// TODO(turajs): Add description of function.
double Loudness2Db(double loudness);
@@ -20,4 +22,6 @@
double Dbfs2Loudness(double dbfs);
+} // namespace webrtc
+
#endif // MODULES_AUDIO_PROCESSING_AGC_UTILITY_H_
diff --git a/modules/audio_processing/transient/windows_private.h b/modules/audio_processing/transient/windows_private.h
index 767bcd8..54e3c25 100644
--- a/modules/audio_processing/transient/windows_private.h
+++ b/modules/audio_processing/transient/windows_private.h
@@ -11,6 +11,8 @@
#ifndef MODULES_AUDIO_PROCESSING_TRANSIENT_WINDOWS_PRIVATE_H_
#define MODULES_AUDIO_PROCESSING_TRANSIENT_WINDOWS_PRIVATE_H_
+namespace webrtc {
+
// Hanning window for 4ms 16kHz
static const float kHanning64w128[128] = {
0.00000000000000f, 0.02454122852291f, 0.04906767432742f, 0.07356456359967f,
@@ -550,4 +552,6 @@
0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f,
0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f};
+} // namespace webrtc
+
#endif // MODULES_AUDIO_PROCESSING_TRANSIENT_WINDOWS_PRIVATE_H_
diff --git a/modules/audio_processing/utility/delay_estimator.cc b/modules/audio_processing/utility/delay_estimator.cc
index fe750f5..73c70b0 100644
--- a/modules/audio_processing/utility/delay_estimator.cc
+++ b/modules/audio_processing/utility/delay_estimator.cc
@@ -17,6 +17,10 @@
#include "rtc_base/checks.h"
+namespace webrtc {
+
+namespace {
+
// Number of right shifts for scaling is linearly depending on number of bits in
// the far-end binary spectrum.
static const int kShiftsAtZero = 13; // Right shifts at zero binary spectrum.
@@ -38,6 +42,8 @@
static const float kMinFractionWhenPossiblyCausal = 0.5f;
static const float kMinFractionWhenPossiblyNonCausal = 0.25f;
+} // namespace
+
// Counts and returns number of bits of a 32-bit word.
static int BitCount(uint32_t u32) {
uint32_t tmp =
@@ -698,3 +704,5 @@
}
*mean_value += diff;
}
+
+} // namespace webrtc
diff --git a/modules/audio_processing/utility/delay_estimator.h b/modules/audio_processing/utility/delay_estimator.h
index 2f47e26..df281bc 100644
--- a/modules/audio_processing/utility/delay_estimator.h
+++ b/modules/audio_processing/utility/delay_estimator.h
@@ -16,6 +16,8 @@
#include <stdint.h>
+namespace webrtc {
+
static const int32_t kMaxBitCountsQ9 = (32 << 9); // 32 matching bits in Q9.
typedef struct {
@@ -250,4 +252,6 @@
int factor,
int32_t* mean_value);
+} // namespace webrtc
+
#endif // MODULES_AUDIO_PROCESSING_UTILITY_DELAY_ESTIMATOR_H_
diff --git a/modules/audio_processing/utility/delay_estimator_internal.h b/modules/audio_processing/utility/delay_estimator_internal.h
index e99fe21..fce95d8 100644
--- a/modules/audio_processing/utility/delay_estimator_internal.h
+++ b/modules/audio_processing/utility/delay_estimator_internal.h
@@ -15,6 +15,8 @@
#include "modules/audio_processing/utility/delay_estimator.h"
+namespace webrtc {
+
typedef union {
float float_;
int32_t int32_;
@@ -44,4 +46,6 @@
BinaryDelayEstimator* binary_handle;
} DelayEstimator;
+} // namespace webrtc
+
#endif // MODULES_AUDIO_PROCESSING_UTILITY_DELAY_ESTIMATOR_INTERNAL_H_
diff --git a/modules/audio_processing/utility/delay_estimator_unittest.cc b/modules/audio_processing/utility/delay_estimator_unittest.cc
index d3463aa..65d8e14 100644
--- a/modules/audio_processing/utility/delay_estimator_unittest.cc
+++ b/modules/audio_processing/utility/delay_estimator_unittest.cc
@@ -14,6 +14,8 @@
#include "modules/audio_processing/utility/delay_estimator_wrapper.h"
#include "test/gtest.h"
+namespace webrtc {
+
namespace {
enum { kSpectrumSize = 65 };
@@ -615,3 +617,5 @@
// TODO(bjornv): Add tests for SoftReset...(...).
} // namespace
+
+} // namespace webrtc
diff --git a/modules/audio_processing/utility/delay_estimator_wrapper.cc b/modules/audio_processing/utility/delay_estimator_wrapper.cc
index 27c2a3a..8eac2f6 100644
--- a/modules/audio_processing/utility/delay_estimator_wrapper.cc
+++ b/modules/audio_processing/utility/delay_estimator_wrapper.cc
@@ -17,6 +17,8 @@
#include "modules/audio_processing/utility/delay_estimator_internal.h"
#include "rtc_base/checks.h"
+namespace webrtc {
+
// Only bit |kBandFirst| through bit |kBandLast| are processed and
// |kBandFirst| - |kBandLast| must be < 32.
enum { kBandFirst = 12 };
@@ -483,3 +485,5 @@
RTC_DCHECK(self);
return WebRtc_binary_last_delay_quality(self->binary_handle);
}
+
+} // namespace webrtc
diff --git a/modules/audio_processing/utility/delay_estimator_wrapper.h b/modules/audio_processing/utility/delay_estimator_wrapper.h
index 995470f..dbcafaf 100644
--- a/modules/audio_processing/utility/delay_estimator_wrapper.h
+++ b/modules/audio_processing/utility/delay_estimator_wrapper.h
@@ -16,6 +16,8 @@
#include <stdint.h>
+namespace webrtc {
+
// Releases the memory allocated by WebRtc_CreateDelayEstimatorFarend(...)
void WebRtc_FreeDelayEstimatorFarend(void* handle);
@@ -241,4 +243,6 @@
// - delay_quality : >= 0 - Estimation quality of last calculated delay.
float WebRtc_last_delay_quality(void* handle);
+} // namespace webrtc
+
#endif // MODULES_AUDIO_PROCESSING_UTILITY_DELAY_ESTIMATOR_WRAPPER_H_
diff --git a/modules/audio_processing/vad/noise_gmm_tables.h b/modules/audio_processing/vad/noise_gmm_tables.h
index 1556277..944a540 100644
--- a/modules/audio_processing/vad/noise_gmm_tables.h
+++ b/modules/audio_processing/vad/noise_gmm_tables.h
@@ -13,6 +13,8 @@
#ifndef MODULES_AUDIO_PROCESSING_VAD_NOISE_GMM_TABLES_H_
#define MODULES_AUDIO_PROCESSING_VAD_NOISE_GMM_TABLES_H_
+namespace webrtc {
+
static const int kNoiseGmmNumMixtures = 12;
static const int kNoiseGmmDim = 3;
@@ -74,4 +76,7 @@
-1.79789356118641e+01, -1.42830169160894e+01, -1.56500228061379e+01,
-1.83124990950113e+01, -1.69979436177477e+01, -1.12329424387828e+01,
-1.41311785780639e+01, -1.47171861448585e+01, -1.35963362781839e+01};
+
+} // namespace webrtc
+
#endif // MODULES_AUDIO_PROCESSING_VAD_NOISE_GMM_TABLES_H_
diff --git a/modules/audio_processing/vad/pitch_based_vad.h b/modules/audio_processing/vad/pitch_based_vad.h
index 22bc0f2..e005e23 100644
--- a/modules/audio_processing/vad/pitch_based_vad.h
+++ b/modules/audio_processing/vad/pitch_based_vad.h
@@ -53,4 +53,5 @@
};
} // namespace webrtc
+
#endif // MODULES_AUDIO_PROCESSING_VAD_PITCH_BASED_VAD_H_
diff --git a/modules/audio_processing/vad/pitch_internal.cc b/modules/audio_processing/vad/pitch_internal.cc
index 7e6bd3e..8f86918 100644
--- a/modules/audio_processing/vad/pitch_internal.cc
+++ b/modules/audio_processing/vad/pitch_internal.cc
@@ -12,6 +12,8 @@
#include <cmath>
+namespace webrtc {
+
// A 4-to-3 linear interpolation.
// The interpolation constants are derived as following:
// Input pitch parameters are updated every 7.5 ms. Within a 30-ms interval
@@ -49,3 +51,5 @@
pitch_lag_hz[n] = (sampling_rate_hz) / (pitch_lag_hz[n]);
}
}
+
+} // namespace webrtc
diff --git a/modules/audio_processing/vad/pitch_internal.h b/modules/audio_processing/vad/pitch_internal.h
index 67e0522..938745d 100644
--- a/modules/audio_processing/vad/pitch_internal.h
+++ b/modules/audio_processing/vad/pitch_internal.h
@@ -11,6 +11,8 @@
#ifndef MODULES_AUDIO_PROCESSING_VAD_PITCH_INTERNAL_H_
#define MODULES_AUDIO_PROCESSING_VAD_PITCH_INTERNAL_H_
+namespace webrtc {
+
// TODO(turajs): Write a description of this function. Also be consistent with
// usage of |sampling_rate_hz| vs |kSamplingFreqHz|.
void GetSubframesPitchParameters(int sampling_rate_hz,
@@ -23,4 +25,6 @@
double* log_pitch_gain,
double* pitch_lag_hz);
+} // namespace webrtc
+
#endif // MODULES_AUDIO_PROCESSING_VAD_PITCH_INTERNAL_H_
diff --git a/modules/audio_processing/vad/pitch_internal_unittest.cc b/modules/audio_processing/vad/pitch_internal_unittest.cc
index 19c2e1a..c851421 100644
--- a/modules/audio_processing/vad/pitch_internal_unittest.cc
+++ b/modules/audio_processing/vad/pitch_internal_unittest.cc
@@ -14,6 +14,8 @@
#include "test/gtest.h"
+namespace webrtc {
+
TEST(PitchInternalTest, test) {
const int kSamplingRateHz = 8000;
const int kNumInputParameters = 4;
@@ -48,3 +50,5 @@
EXPECT_NEAR(old_lag, expected_old_lag, 1e-6);
EXPECT_NEAR(log_old_gain, expected_log_old_gain, 1e-8);
}
+
+} // namespace webrtc