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}
This commit is contained in:
Per Åhgren 2020-03-20 16:43:34 +01:00 committed by Commit Bot
parent be36db1024
commit e7175c9a09
16 changed files with 66 additions and 0 deletions

View file

@ -16,6 +16,8 @@
#include "test/gtest.h" #include "test/gtest.h"
#include "test/testsupport/file_utils.h" #include "test/testsupport/file_utils.h"
namespace webrtc {
TEST(AecDumper, APICallsDoNotCrash) { TEST(AecDumper, APICallsDoNotCrash) {
// Note order of initialization: Task queue has to be initialized // Note order of initialization: Task queue has to be initialized
// before AecDump. // before AecDump.
@ -81,3 +83,5 @@ TEST(AecDumper, WriteToFile) {
ASSERT_EQ(0, fclose(fid)); ASSERT_EQ(0, fclose(fid));
ASSERT_EQ(0, remove(filename.c_str())); ASSERT_EQ(0, remove(filename.c_str()));
} }
} // namespace webrtc

View file

@ -11,6 +11,8 @@
#ifndef MODULES_AUDIO_PROCESSING_AGC_GAIN_MAP_INTERNAL_H_ #ifndef MODULES_AUDIO_PROCESSING_AGC_GAIN_MAP_INTERNAL_H_
#define MODULES_AUDIO_PROCESSING_AGC_GAIN_MAP_INTERNAL_H_ #define MODULES_AUDIO_PROCESSING_AGC_GAIN_MAP_INTERNAL_H_
namespace webrtc {
static const int kGainMapSize = 256; static const int kGainMapSize = 256;
// Uses parameters: si = 2, sf = 0.25, D = 8/256 // Uses parameters: si = 2, sf = 0.25, D = 8/256
static const int kGainMap[kGainMapSize] = { 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, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63,
64}; 64};
} // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_AGC_GAIN_MAP_INTERNAL_H_ #endif // MODULES_AUDIO_PROCESSING_AGC_GAIN_MAP_INTERNAL_H_

View file

@ -12,6 +12,8 @@
#include <math.h> #include <math.h>
namespace webrtc {
static const double kLog10 = 2.30258509299; static const double kLog10 = 2.30258509299;
static const double kLinear2DbScale = 20.0 / kLog10; static const double kLinear2DbScale = 20.0 / kLog10;
static const double kLinear2LoudnessScale = 13.4 / kLog10; static const double kLinear2LoudnessScale = 13.4 / kLog10;
@ -33,3 +35,5 @@ double Db2Loudness(double db) {
double Dbfs2Loudness(double dbfs) { double Dbfs2Loudness(double dbfs) {
return Db2Loudness(90 + dbfs); return Db2Loudness(90 + dbfs);
} }
} // namespace webrtc

View file

@ -11,6 +11,8 @@
#ifndef MODULES_AUDIO_PROCESSING_AGC_UTILITY_H_ #ifndef MODULES_AUDIO_PROCESSING_AGC_UTILITY_H_
#define MODULES_AUDIO_PROCESSING_AGC_UTILITY_H_ #define MODULES_AUDIO_PROCESSING_AGC_UTILITY_H_
namespace webrtc {
// TODO(turajs): Add description of function. // TODO(turajs): Add description of function.
double Loudness2Db(double loudness); double Loudness2Db(double loudness);
@ -20,4 +22,6 @@ double Db2Loudness(double db);
double Dbfs2Loudness(double dbfs); double Dbfs2Loudness(double dbfs);
} // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_AGC_UTILITY_H_ #endif // MODULES_AUDIO_PROCESSING_AGC_UTILITY_H_

View file

@ -11,6 +11,8 @@
#ifndef MODULES_AUDIO_PROCESSING_TRANSIENT_WINDOWS_PRIVATE_H_ #ifndef MODULES_AUDIO_PROCESSING_TRANSIENT_WINDOWS_PRIVATE_H_
#define MODULES_AUDIO_PROCESSING_TRANSIENT_WINDOWS_PRIVATE_H_ #define MODULES_AUDIO_PROCESSING_TRANSIENT_WINDOWS_PRIVATE_H_
namespace webrtc {
// Hanning window for 4ms 16kHz // Hanning window for 4ms 16kHz
static const float kHanning64w128[128] = { static const float kHanning64w128[128] = {
0.00000000000000f, 0.02454122852291f, 0.04906767432742f, 0.07356456359967f, 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, 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_ #endif // MODULES_AUDIO_PROCESSING_TRANSIENT_WINDOWS_PRIVATE_H_

View file

@ -17,6 +17,10 @@
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
namespace webrtc {
namespace {
// Number of right shifts for scaling is linearly depending on number of bits in // Number of right shifts for scaling is linearly depending on number of bits in
// the far-end binary spectrum. // the far-end binary spectrum.
static const int kShiftsAtZero = 13; // Right shifts at zero 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 kMinFractionWhenPossiblyCausal = 0.5f;
static const float kMinFractionWhenPossiblyNonCausal = 0.25f; static const float kMinFractionWhenPossiblyNonCausal = 0.25f;
} // namespace
// Counts and returns number of bits of a 32-bit word. // Counts and returns number of bits of a 32-bit word.
static int BitCount(uint32_t u32) { static int BitCount(uint32_t u32) {
uint32_t tmp = uint32_t tmp =
@ -698,3 +704,5 @@ void WebRtc_MeanEstimatorFix(int32_t new_value,
} }
*mean_value += diff; *mean_value += diff;
} }
} // namespace webrtc

View file

@ -16,6 +16,8 @@
#include <stdint.h> #include <stdint.h>
namespace webrtc {
static const int32_t kMaxBitCountsQ9 = (32 << 9); // 32 matching bits in Q9. static const int32_t kMaxBitCountsQ9 = (32 << 9); // 32 matching bits in Q9.
typedef struct { typedef struct {
@ -250,4 +252,6 @@ void WebRtc_MeanEstimatorFix(int32_t new_value,
int factor, int factor,
int32_t* mean_value); int32_t* mean_value);
} // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_UTILITY_DELAY_ESTIMATOR_H_ #endif // MODULES_AUDIO_PROCESSING_UTILITY_DELAY_ESTIMATOR_H_

View file

@ -15,6 +15,8 @@
#include "modules/audio_processing/utility/delay_estimator.h" #include "modules/audio_processing/utility/delay_estimator.h"
namespace webrtc {
typedef union { typedef union {
float float_; float float_;
int32_t int32_; int32_t int32_;
@ -44,4 +46,6 @@ typedef struct {
BinaryDelayEstimator* binary_handle; BinaryDelayEstimator* binary_handle;
} DelayEstimator; } DelayEstimator;
} // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_UTILITY_DELAY_ESTIMATOR_INTERNAL_H_ #endif // MODULES_AUDIO_PROCESSING_UTILITY_DELAY_ESTIMATOR_INTERNAL_H_

View file

@ -14,6 +14,8 @@
#include "modules/audio_processing/utility/delay_estimator_wrapper.h" #include "modules/audio_processing/utility/delay_estimator_wrapper.h"
#include "test/gtest.h" #include "test/gtest.h"
namespace webrtc {
namespace { namespace {
enum { kSpectrumSize = 65 }; enum { kSpectrumSize = 65 };
@ -615,3 +617,5 @@ TEST_F(DelayEstimatorTest, VerifyHistorySizeIsSetAndKeptAfterInit) {
// TODO(bjornv): Add tests for SoftReset...(...). // TODO(bjornv): Add tests for SoftReset...(...).
} // namespace } // namespace
} // namespace webrtc

View file

@ -17,6 +17,8 @@
#include "modules/audio_processing/utility/delay_estimator_internal.h" #include "modules/audio_processing/utility/delay_estimator_internal.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
namespace webrtc {
// Only bit |kBandFirst| through bit |kBandLast| are processed and // Only bit |kBandFirst| through bit |kBandLast| are processed and
// |kBandFirst| - |kBandLast| must be < 32. // |kBandFirst| - |kBandLast| must be < 32.
enum { kBandFirst = 12 }; enum { kBandFirst = 12 };
@ -483,3 +485,5 @@ float WebRtc_last_delay_quality(void* handle) {
RTC_DCHECK(self); RTC_DCHECK(self);
return WebRtc_binary_last_delay_quality(self->binary_handle); return WebRtc_binary_last_delay_quality(self->binary_handle);
} }
} // namespace webrtc

View file

@ -16,6 +16,8 @@
#include <stdint.h> #include <stdint.h>
namespace webrtc {
// Releases the memory allocated by WebRtc_CreateDelayEstimatorFarend(...) // Releases the memory allocated by WebRtc_CreateDelayEstimatorFarend(...)
void WebRtc_FreeDelayEstimatorFarend(void* handle); void WebRtc_FreeDelayEstimatorFarend(void* handle);
@ -241,4 +243,6 @@ int WebRtc_last_delay(void* handle);
// - delay_quality : >= 0 - Estimation quality of last calculated delay. // - delay_quality : >= 0 - Estimation quality of last calculated delay.
float WebRtc_last_delay_quality(void* handle); float WebRtc_last_delay_quality(void* handle);
} // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_UTILITY_DELAY_ESTIMATOR_WRAPPER_H_ #endif // MODULES_AUDIO_PROCESSING_UTILITY_DELAY_ESTIMATOR_WRAPPER_H_

View file

@ -13,6 +13,8 @@
#ifndef MODULES_AUDIO_PROCESSING_VAD_NOISE_GMM_TABLES_H_ #ifndef MODULES_AUDIO_PROCESSING_VAD_NOISE_GMM_TABLES_H_
#define 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 kNoiseGmmNumMixtures = 12;
static const int kNoiseGmmDim = 3; static const int kNoiseGmmDim = 3;
@ -74,4 +76,7 @@ static const double kNoiseGmmWeights[kNoiseGmmNumMixtures] = {
-1.79789356118641e+01, -1.42830169160894e+01, -1.56500228061379e+01, -1.79789356118641e+01, -1.42830169160894e+01, -1.56500228061379e+01,
-1.83124990950113e+01, -1.69979436177477e+01, -1.12329424387828e+01, -1.83124990950113e+01, -1.69979436177477e+01, -1.12329424387828e+01,
-1.41311785780639e+01, -1.47171861448585e+01, -1.35963362781839e+01}; -1.41311785780639e+01, -1.47171861448585e+01, -1.35963362781839e+01};
} // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_VAD_NOISE_GMM_TABLES_H_ #endif // MODULES_AUDIO_PROCESSING_VAD_NOISE_GMM_TABLES_H_

View file

@ -53,4 +53,5 @@ class PitchBasedVad {
}; };
} // namespace webrtc } // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_VAD_PITCH_BASED_VAD_H_ #endif // MODULES_AUDIO_PROCESSING_VAD_PITCH_BASED_VAD_H_

View file

@ -12,6 +12,8 @@
#include <cmath> #include <cmath>
namespace webrtc {
// A 4-to-3 linear interpolation. // A 4-to-3 linear interpolation.
// The interpolation constants are derived as following: // The interpolation constants are derived as following:
// Input pitch parameters are updated every 7.5 ms. Within a 30-ms interval // 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]); pitch_lag_hz[n] = (sampling_rate_hz) / (pitch_lag_hz[n]);
} }
} }
} // namespace webrtc

View file

@ -11,6 +11,8 @@
#ifndef MODULES_AUDIO_PROCESSING_VAD_PITCH_INTERNAL_H_ #ifndef MODULES_AUDIO_PROCESSING_VAD_PITCH_INTERNAL_H_
#define 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 // TODO(turajs): Write a description of this function. Also be consistent with
// usage of |sampling_rate_hz| vs |kSamplingFreqHz|. // usage of |sampling_rate_hz| vs |kSamplingFreqHz|.
void GetSubframesPitchParameters(int sampling_rate_hz, void GetSubframesPitchParameters(int sampling_rate_hz,
@ -23,4 +25,6 @@ void GetSubframesPitchParameters(int sampling_rate_hz,
double* log_pitch_gain, double* log_pitch_gain,
double* pitch_lag_hz); double* pitch_lag_hz);
} // namespace webrtc
#endif // MODULES_AUDIO_PROCESSING_VAD_PITCH_INTERNAL_H_ #endif // MODULES_AUDIO_PROCESSING_VAD_PITCH_INTERNAL_H_

View file

@ -14,6 +14,8 @@
#include "test/gtest.h" #include "test/gtest.h"
namespace webrtc {
TEST(PitchInternalTest, test) { TEST(PitchInternalTest, test) {
const int kSamplingRateHz = 8000; const int kSamplingRateHz = 8000;
const int kNumInputParameters = 4; const int kNumInputParameters = 4;
@ -48,3 +50,5 @@ TEST(PitchInternalTest, test) {
EXPECT_NEAR(old_lag, expected_old_lag, 1e-6); EXPECT_NEAR(old_lag, expected_old_lag, 1e-6);
EXPECT_NEAR(log_old_gain, expected_log_old_gain, 1e-8); EXPECT_NEAR(log_old_gain, expected_log_old_gain, 1e-8);
} }
} // namespace webrtc