diff --git a/modules/audio_processing/aec_dump/aec_dump_unittest.cc b/modules/audio_processing/aec_dump/aec_dump_unittest.cc index f4b0908c20..62f896fe14 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 @@ TEST(AecDumper, WriteToFile) { 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 63d9b510ca..547f0f312e 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 @@ static const int kGainMap[kGainMapSize] = { 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 554a8377aa..2a87e5ce74 100644 --- a/modules/audio_processing/agc/utility.cc +++ b/modules/audio_processing/agc/utility.cc @@ -12,6 +12,8 @@ #include +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 Db2Loudness(double db) { 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 8ba87b6d55..56eec244a7 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 Db2Loudness(double db); 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 767bcd8b7d..54e3c25785 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 @@ static const float kBlocks480w1024[1024] = { 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 fe750f5a68..73c70b0c34 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 kFractionSlope = 0.05f; 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 @@ void WebRtc_MeanEstimatorFix(int32_t new_value, } *mean_value += diff; } + +} // namespace webrtc diff --git a/modules/audio_processing/utility/delay_estimator.h b/modules/audio_processing/utility/delay_estimator.h index 2f47e26f36..df281bcfdb 100644 --- a/modules/audio_processing/utility/delay_estimator.h +++ b/modules/audio_processing/utility/delay_estimator.h @@ -16,6 +16,8 @@ #include +namespace webrtc { + static const int32_t kMaxBitCountsQ9 = (32 << 9); // 32 matching bits in Q9. typedef struct { @@ -250,4 +252,6 @@ void WebRtc_MeanEstimatorFix(int32_t new_value, 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 e99fe21a85..fce95d80d7 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 @@ typedef struct { 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 d3463aa6de..65d8e147fd 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 @@ TEST_F(DelayEstimatorTest, VerifyHistorySizeIsSetAndKeptAfterInit) { // 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 27c2a3a1a2..8eac2f6974 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 @@ float WebRtc_last_delay_quality(void* handle) { 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 995470f99d..dbcafaf013 100644 --- a/modules/audio_processing/utility/delay_estimator_wrapper.h +++ b/modules/audio_processing/utility/delay_estimator_wrapper.h @@ -16,6 +16,8 @@ #include +namespace webrtc { + // Releases the memory allocated by WebRtc_CreateDelayEstimatorFarend(...) void WebRtc_FreeDelayEstimatorFarend(void* handle); @@ -241,4 +243,6 @@ int WebRtc_last_delay(void* handle); // - 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 15562776e9..944a5401cc 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 @@ static const double kNoiseGmmWeights[kNoiseGmmNumMixtures] = { -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 22bc0f2263..e005e23aa5 100644 --- a/modules/audio_processing/vad/pitch_based_vad.h +++ b/modules/audio_processing/vad/pitch_based_vad.h @@ -53,4 +53,5 @@ class PitchBasedVad { }; } // 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 7e6bd3e616..8f86918644 100644 --- a/modules/audio_processing/vad/pitch_internal.cc +++ b/modules/audio_processing/vad/pitch_internal.cc @@ -12,6 +12,8 @@ #include +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 @@ void GetSubframesPitchParameters(int sampling_rate_hz, 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 67e0522328..938745d2a3 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 @@ void GetSubframesPitchParameters(int sampling_rate_hz, 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 19c2e1a271..c851421ba7 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 @@ TEST(PitchInternalTest, test) { EXPECT_NEAR(old_lag, expected_old_lag, 1e-6); EXPECT_NEAR(log_old_gain, expected_log_old_gain, 1e-8); } + +} // namespace webrtc