Update code to current Chromium master
This corresponds to: Chromium: 6555f9456074c0c0e5f7713564b978588ac04a5d webrtc: c8b569e0a7ad0b369e15f0197b3a558699ec8efa
This commit is contained in:
parent
9bc60d3e10
commit
34abadd258
@ -5,8 +5,10 @@ pkgconfig_DATA = webrtc-audio-processing.pc
|
||||
|
||||
webrtcincludedir = $(includedir)/webrtc_audio_processing
|
||||
nobase_webrtcinclude_HEADERS = webrtc/base/arraysize.h \
|
||||
webrtc/base/checks.h \
|
||||
webrtc/base/constructormagic.h \
|
||||
webrtc/base/basictypes.h \
|
||||
webrtc/base/maybe.h \
|
||||
webrtc/base/platform_file.h \
|
||||
webrtc/common.h \
|
||||
webrtc/common_types.h \
|
||||
@ -14,7 +16,7 @@ nobase_webrtcinclude_HEADERS = webrtc/base/arraysize.h \
|
||||
webrtc/modules/audio_processing/beamformer/array_util.h \
|
||||
webrtc/modules/audio_processing/include/audio_processing.h \
|
||||
webrtc/modules/interface/module_common_types.h \
|
||||
webrtc/system_wrappers/interface/trace.h
|
||||
webrtc/system_wrappers/include/trace.h
|
||||
|
||||
EXTRA_DIST = NEWS \
|
||||
README.md \
|
||||
|
@ -94,6 +94,7 @@ static_library("rtc_base_approved") {
|
||||
public_configs = [ "..:common_inherited_config" ]
|
||||
|
||||
sources = [
|
||||
"array_view.h",
|
||||
"atomicops.h",
|
||||
"bitbuffer.cc",
|
||||
"bitbuffer.h",
|
||||
@ -114,6 +115,7 @@ static_library("rtc_base_approved") {
|
||||
"event_tracer.h",
|
||||
"exp_filter.cc",
|
||||
"exp_filter.h",
|
||||
"maybe.h",
|
||||
"md5.cc",
|
||||
"md5.h",
|
||||
"md5digest.cc",
|
||||
@ -237,6 +239,8 @@ static_library("rtc_base") {
|
||||
"nethelpers.h",
|
||||
"network.cc",
|
||||
"network.h",
|
||||
"networkmonitor.cc",
|
||||
"networkmonitor.h",
|
||||
"nullsocketserver.h",
|
||||
"pathutils.cc",
|
||||
"pathutils.h",
|
||||
|
@ -164,6 +164,7 @@ DEFINE_RTC_CHECK_OP_IMPL(GT, > )
|
||||
// code in debug builds. It does reference the condition parameter in all cases,
|
||||
// though, so callers won't risk getting warnings about unused variables.
|
||||
#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON))
|
||||
#define RTC_DCHECK_IS_ON 1
|
||||
#define RTC_DCHECK(condition) RTC_CHECK(condition)
|
||||
#define RTC_DCHECK_EQ(v1, v2) RTC_CHECK_EQ(v1, v2)
|
||||
#define RTC_DCHECK_NE(v1, v2) RTC_CHECK_NE(v1, v2)
|
||||
@ -172,6 +173,7 @@ DEFINE_RTC_CHECK_OP_IMPL(GT, > )
|
||||
#define RTC_DCHECK_GE(v1, v2) RTC_CHECK_GE(v1, v2)
|
||||
#define RTC_DCHECK_GT(v1, v2) RTC_CHECK_GT(v1, v2)
|
||||
#else
|
||||
#define RTC_DCHECK_IS_ON 0
|
||||
#define RTC_DCHECK(condition) RTC_EAT_STREAM_PARAMETERS(condition)
|
||||
#define RTC_DCHECK_EQ(v1, v2) RTC_EAT_STREAM_PARAMETERS((v1) == (v2))
|
||||
#define RTC_DCHECK_NE(v1, v2) RTC_EAT_STREAM_PARAMETERS((v1) != (v2))
|
||||
|
110
webrtc/base/maybe.h
Normal file
110
webrtc/base/maybe.h
Normal file
@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright 2015 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_BASE_MAYBE_H_
|
||||
#define WEBRTC_BASE_MAYBE_H_
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
|
||||
namespace rtc {
|
||||
|
||||
// Simple std::experimental::optional-wannabe. It either contains a T or not.
|
||||
// In order to keep the implementation simple and portable, this implementation
|
||||
// actually contains a (default-constructed) T even when it supposedly doesn't
|
||||
// contain a value; use e.g. rtc::scoped_ptr<T> instead if that's too
|
||||
// expensive.
|
||||
//
|
||||
// A moved-from Maybe<T> may only be destroyed, and assigned to if T allows
|
||||
// being assigned to after having been moved from. Specifically, you may not
|
||||
// assume that it just doesn't contain a value anymore.
|
||||
//
|
||||
// TODO(kwiberg): Get rid of this class when the standard library has
|
||||
// std::optional (and we're allowed to use it).
|
||||
template <typename T>
|
||||
class Maybe final {
|
||||
public:
|
||||
// Construct an empty Maybe.
|
||||
Maybe() : has_value_(false) {}
|
||||
|
||||
// Construct a Maybe that contains a value.
|
||||
explicit Maybe(const T& val) : value_(val), has_value_(true) {}
|
||||
explicit Maybe(T&& val) : value_(static_cast<T&&>(val)), has_value_(true) {}
|
||||
|
||||
// Copy and move constructors.
|
||||
// TODO(kwiberg): =default the move constructor when MSVC supports it.
|
||||
Maybe(const Maybe&) = default;
|
||||
Maybe(Maybe&& m)
|
||||
: value_(static_cast<T&&>(m.value_)), has_value_(m.has_value_) {}
|
||||
|
||||
// Assignment.
|
||||
// TODO(kwiberg): =default the move assignment op when MSVC supports it.
|
||||
Maybe& operator=(const Maybe&) = default;
|
||||
Maybe& operator=(Maybe&& m) {
|
||||
value_ = static_cast<T&&>(m.value_);
|
||||
has_value_ = m.has_value_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
friend void swap(Maybe& m1, Maybe& m2) {
|
||||
using std::swap;
|
||||
swap(m1.value_, m2.value_);
|
||||
swap(m1.has_value_, m2.has_value_);
|
||||
}
|
||||
|
||||
// Conversion to bool to test if we have a value.
|
||||
explicit operator bool() const { return has_value_; }
|
||||
|
||||
// Dereferencing. Only allowed if we have a value.
|
||||
const T* operator->() const {
|
||||
RTC_DCHECK(has_value_);
|
||||
return &value_;
|
||||
}
|
||||
T* operator->() {
|
||||
RTC_DCHECK(has_value_);
|
||||
return &value_;
|
||||
}
|
||||
const T& operator*() const {
|
||||
RTC_DCHECK(has_value_);
|
||||
return value_;
|
||||
}
|
||||
T& operator*() {
|
||||
RTC_DCHECK(has_value_);
|
||||
return value_;
|
||||
}
|
||||
|
||||
// Dereference with a default value in case we don't have a value.
|
||||
const T& value_or(const T& default_val) const {
|
||||
return has_value_ ? value_ : default_val;
|
||||
}
|
||||
|
||||
// Equality tests. Two Maybes are equal if they contain equivalent values, or
|
||||
// if they're both empty.
|
||||
friend bool operator==(const Maybe& m1, const Maybe& m2) {
|
||||
return m1.has_value_ && m2.has_value_ ? m1.value_ == m2.value_
|
||||
: m1.has_value_ == m2.has_value_;
|
||||
}
|
||||
friend bool operator!=(const Maybe& m1, const Maybe& m2) {
|
||||
return m1.has_value_ && m2.has_value_ ? m1.value_ != m2.value_
|
||||
: m1.has_value_ != m2.has_value_;
|
||||
}
|
||||
|
||||
private:
|
||||
// Invariant: Unless *this has been moved from, value_ is default-initialized
|
||||
// (or copied or moved from a default-initialized T) if !has_value_.
|
||||
T value_;
|
||||
bool has_value_;
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
||||
#endif // WEBRTC_BASE_MAYBE_H_
|
@ -77,11 +77,11 @@ size_t asccpyn(wchar_t* buffer, size_t buflen,
|
||||
} else if (srclen >= buflen) {
|
||||
srclen = buflen - 1;
|
||||
}
|
||||
#if _DEBUG
|
||||
#if !defined(NDEBUG)
|
||||
// Double check that characters are not UTF-8
|
||||
for (size_t pos = 0; pos < srclen; ++pos)
|
||||
RTC_DCHECK_LT(static_cast<unsigned char>(source[pos]), 128);
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
std::copy(source, source + srclen, buffer);
|
||||
buffer[srclen] = 0;
|
||||
return srclen;
|
||||
|
@ -48,6 +48,19 @@ template <class T> struct is_non_const_reference<const T&> : false_type {};
|
||||
template <class T> struct is_void : false_type {};
|
||||
template <> struct is_void<void> : true_type {};
|
||||
|
||||
template <class T>
|
||||
struct remove_reference {
|
||||
typedef T type;
|
||||
};
|
||||
template <class T>
|
||||
struct remove_reference<T&> {
|
||||
typedef T type;
|
||||
};
|
||||
template <class T>
|
||||
struct remove_reference<T&&> {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
namespace internal {
|
||||
|
||||
// Types YesType and NoType are guaranteed such that sizeof(YesType) <
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "webrtc/base/safe_conversions.h"
|
||||
#include "webrtc/common_audio/channel_buffer.h"
|
||||
#include "webrtc/common_audio/resampler/push_sinc_resampler.h"
|
||||
#include "webrtc/system_wrappers/interface/scoped_vector.h"
|
||||
#include "webrtc/system_wrappers/include/scoped_vector.h"
|
||||
|
||||
using rtc::checked_cast;
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/common_audio/fir_filter_neon.h"
|
||||
#include "webrtc/common_audio/fir_filter_sse.h"
|
||||
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "webrtc/system_wrappers/interface/aligned_malloc.h"
|
||||
#include "webrtc/system_wrappers/include/aligned_malloc.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/common_audio/fir_filter.h"
|
||||
#include "webrtc/system_wrappers/interface/aligned_malloc.h"
|
||||
#include "webrtc/system_wrappers/include/aligned_malloc.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <string.h>
|
||||
#include <xmmintrin.h>
|
||||
|
||||
#include "webrtc/system_wrappers/interface/aligned_malloc.h"
|
||||
#include "webrtc/system_wrappers/include/aligned_malloc.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/common_audio/fir_filter.h"
|
||||
#include "webrtc/system_wrappers/interface/aligned_malloc.h"
|
||||
#include "webrtc/system_wrappers/include/aligned_malloc.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/common_audio/blocker.h"
|
||||
#include "webrtc/common_audio/real_fourier.h"
|
||||
#include "webrtc/system_wrappers/interface/aligned_array.h"
|
||||
#include "webrtc/system_wrappers/include/aligned_array.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <complex>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/system_wrappers/interface/aligned_malloc.h"
|
||||
#include "webrtc/system_wrappers/include/aligned_malloc.h"
|
||||
|
||||
// Uniform interface class for the real DFT and its inverse, for power-of-2
|
||||
// input lengths. Also contains helper functions for buffer allocation, taking
|
||||
|
@ -93,7 +93,7 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
#include "webrtc/base/constructormagic.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/system_wrappers/interface/aligned_malloc.h"
|
||||
#include "webrtc/system_wrappers/include/aligned_malloc.h"
|
||||
#ifndef WEBRTC_AUDIO_PROCESSING_ONLY_BUILD
|
||||
#include "webrtc/test/testsupport/gtest_prod_util.h"
|
||||
#endif
|
||||
|
@ -12,7 +12,7 @@
|
||||
@ for ARMv5 platforms.
|
||||
@ Reference C code is in file complex_bit_reverse.c. Bit-exact.
|
||||
|
||||
#include "webrtc/system_wrappers/interface/asm_defines.h"
|
||||
#include "webrtc/system_wrappers/include/asm_defines.h"
|
||||
|
||||
GLOBAL_FUNCTION WebRtcSpl_ComplexBitReverse
|
||||
.align 2
|
||||
|
@ -35,7 +35,7 @@
|
||||
@ r11: Scratch
|
||||
@ r12: &coefficients[j]
|
||||
|
||||
#include "webrtc/system_wrappers/interface/asm_defines.h"
|
||||
#include "webrtc/system_wrappers/include/asm_defines.h"
|
||||
|
||||
GLOBAL_FUNCTION WebRtcSpl_FilterARFastQ12
|
||||
.align 2
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
|
||||
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
|
||||
|
||||
/* Declare function pointers. */
|
||||
MaxAbsValueW16 WebRtcSpl_MaxAbsValueW16;
|
||||
|
@ -32,7 +32,7 @@
|
||||
@ Output: r0 = INT (SQRT (r0)), precision is 16 bits
|
||||
@ Registers touched: r1, r2
|
||||
|
||||
#include "webrtc/system_wrappers/interface/asm_defines.h"
|
||||
#include "webrtc/system_wrappers/include/asm_defines.h"
|
||||
|
||||
GLOBAL_FUNCTION WebRtcSpl_SqrtFloor
|
||||
.align 2
|
||||
|
@ -37,9 +37,17 @@ class ReadableWavFile : public ReadableWav {
|
||||
FILE* file_;
|
||||
};
|
||||
|
||||
std::string WavFile::FormatAsString() const {
|
||||
std::ostringstream s;
|
||||
s << "Sample rate: " << sample_rate() << " Hz, Channels: " << num_channels()
|
||||
<< ", Duration: "
|
||||
<< (1.f * num_samples()) / (num_channels() * sample_rate()) << " s";
|
||||
return s.str();
|
||||
}
|
||||
|
||||
WavReader::WavReader(const std::string& filename)
|
||||
: file_handle_(fopen(filename.c_str(), "rb")) {
|
||||
RTC_CHECK(file_handle_ && "Could not open wav file for reading.");
|
||||
RTC_CHECK(file_handle_) << "Could not open wav file for reading.";
|
||||
|
||||
ReadableWavFile readable(file_handle_);
|
||||
WavFormat format;
|
||||
@ -96,7 +104,7 @@ WavWriter::WavWriter(const std::string& filename, int sample_rate,
|
||||
num_channels_(num_channels),
|
||||
num_samples_(0),
|
||||
file_handle_(fopen(filename.c_str(), "wb")) {
|
||||
RTC_CHECK(file_handle_ && "Could not open wav file for writing.");
|
||||
RTC_CHECK(file_handle_) << "Could not open wav file for writing.";
|
||||
RTC_CHECK(CheckWavParameters(num_channels_, sample_rate_, kWavFormat,
|
||||
kBytesPerSample, num_samples_));
|
||||
|
||||
|
@ -29,6 +29,9 @@ class WavFile {
|
||||
virtual int sample_rate() const = 0;
|
||||
virtual int num_channels() const = 0;
|
||||
virtual uint32_t num_samples() const = 0;
|
||||
|
||||
// Returns a human-readable string containing the audio format.
|
||||
std::string FormatAsString() const;
|
||||
};
|
||||
|
||||
// Simple C++ class for writing 16-bit PCM WAV files. All error handling is
|
||||
|
@ -156,13 +156,12 @@ enum ProcessingTypes
|
||||
kRecordingPreprocessing
|
||||
};
|
||||
|
||||
enum FrameType
|
||||
{
|
||||
kFrameEmpty = 0,
|
||||
enum FrameType {
|
||||
kEmptyFrame = 0,
|
||||
kAudioFrameSpeech = 1,
|
||||
kAudioFrameCN = 2,
|
||||
kVideoFrameKey = 3, // independent frame
|
||||
kVideoFrameDelta = 4, // depends on the previus frame
|
||||
kVideoFrameKey = 3,
|
||||
kVideoFrameDelta = 4,
|
||||
};
|
||||
|
||||
// Statistics for an RTCP channel
|
||||
@ -548,6 +547,7 @@ enum RawVideoType
|
||||
enum { kConfigParameterSize = 128};
|
||||
enum { kPayloadNameSize = 32};
|
||||
enum { kMaxSimulcastStreams = 4};
|
||||
enum { kMaxSpatialLayers = 5 };
|
||||
enum { kMaxTemporalStreams = 4};
|
||||
|
||||
enum VideoCodecComplexity
|
||||
@ -677,6 +677,13 @@ struct SimulcastStream {
|
||||
}
|
||||
};
|
||||
|
||||
struct SpatialLayer {
|
||||
int scaling_factor_num;
|
||||
int scaling_factor_den;
|
||||
int target_bitrate_bps;
|
||||
// TODO(ivica): Add max_quantizer and min_quantizer?
|
||||
};
|
||||
|
||||
enum VideoCodecMode {
|
||||
kRealtimeVideo,
|
||||
kScreensharing
|
||||
@ -703,6 +710,7 @@ struct VideoCodec {
|
||||
unsigned int qpMax;
|
||||
unsigned char numberOfSimulcastStreams;
|
||||
SimulcastStream simulcastStream[kMaxSimulcastStreams];
|
||||
SpatialLayer spatialLayers[kMaxSpatialLayers];
|
||||
|
||||
VideoCodecMode mode;
|
||||
|
||||
|
@ -9,17 +9,48 @@
|
||||
import("//build/config/arm.gni")
|
||||
import("../../build/webrtc.gni")
|
||||
|
||||
source_set("rent_a_codec") {
|
||||
sources = [
|
||||
"main/acm2/acm_codec_database.cc",
|
||||
"main/acm2/acm_codec_database.h",
|
||||
"main/acm2/rent_a_codec.cc",
|
||||
"main/acm2/rent_a_codec.h",
|
||||
]
|
||||
configs += [ "../..:common_config" ]
|
||||
public_configs = [ "../..:common_inherited_config" ]
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
]
|
||||
|
||||
defines = []
|
||||
if (rtc_include_opus) {
|
||||
defines += [ "WEBRTC_CODEC_OPUS" ]
|
||||
}
|
||||
if (!build_with_mozilla) {
|
||||
if (current_cpu == "arm") {
|
||||
defines += [ "WEBRTC_CODEC_ISACFX" ]
|
||||
} else {
|
||||
defines += [ "WEBRTC_CODEC_ISAC" ]
|
||||
}
|
||||
defines += [ "WEBRTC_CODEC_G722" ]
|
||||
}
|
||||
if (!build_with_mozilla && !build_with_chromium) {
|
||||
defines += [
|
||||
"WEBRTC_CODEC_ILBC",
|
||||
"WEBRTC_CODEC_RED",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
config("audio_coding_config") {
|
||||
include_dirs = [
|
||||
"main/interface",
|
||||
"main/include",
|
||||
"../interface",
|
||||
]
|
||||
}
|
||||
|
||||
source_set("audio_coding") {
|
||||
sources = [
|
||||
"main/acm2/acm_codec_database.cc",
|
||||
"main/acm2/acm_codec_database.h",
|
||||
"main/acm2/acm_common_defs.h",
|
||||
"main/acm2/acm_receiver.cc",
|
||||
"main/acm2/acm_receiver.h",
|
||||
@ -36,10 +67,8 @@ source_set("audio_coding") {
|
||||
"main/acm2/codec_owner.h",
|
||||
"main/acm2/initial_delay_manager.cc",
|
||||
"main/acm2/initial_delay_manager.h",
|
||||
"main/acm2/nack.cc",
|
||||
"main/acm2/nack.h",
|
||||
"main/interface/audio_coding_module.h",
|
||||
"main/interface/audio_coding_module_typedefs.h",
|
||||
"main/include/audio_coding_module.h",
|
||||
"main/include/audio_coding_module_typedefs.h",
|
||||
]
|
||||
|
||||
defines = []
|
||||
@ -69,6 +98,7 @@ source_set("audio_coding") {
|
||||
":g711",
|
||||
":neteq",
|
||||
":pcm16b",
|
||||
":rent_a_codec",
|
||||
"../..:rtc_event_log",
|
||||
"../..:webrtc_common",
|
||||
"../../common_audio",
|
||||
@ -245,7 +275,7 @@ source_set("g722") {
|
||||
config("ilbc_config") {
|
||||
include_dirs = [
|
||||
"../../..",
|
||||
"codecs/ilbc/interface",
|
||||
"codecs/ilbc/include",
|
||||
]
|
||||
}
|
||||
|
||||
@ -323,6 +353,7 @@ source_set("ilbc") {
|
||||
"codecs/ilbc/ilbc.c",
|
||||
"codecs/ilbc/include/audio_decoder_ilbc.h",
|
||||
"codecs/ilbc/include/audio_encoder_ilbc.h",
|
||||
"codecs/ilbc/include/ilbc.h",
|
||||
"codecs/ilbc/index_conv_dec.c",
|
||||
"codecs/ilbc/index_conv_dec.h",
|
||||
"codecs/ilbc/index_conv_enc.c",
|
||||
@ -331,7 +362,6 @@ source_set("ilbc") {
|
||||
"codecs/ilbc/init_decode.h",
|
||||
"codecs/ilbc/init_encode.c",
|
||||
"codecs/ilbc/init_encode.h",
|
||||
"codecs/ilbc/interface/ilbc.h",
|
||||
"codecs/ilbc/interpolate.c",
|
||||
"codecs/ilbc/interpolate.h",
|
||||
"codecs/ilbc/interpolate_samples.c",
|
||||
@ -422,15 +452,15 @@ source_set("isac_common") {
|
||||
config("isac_config") {
|
||||
include_dirs = [
|
||||
"../../..",
|
||||
"codecs/isac/main/interface",
|
||||
"codecs/isac/main/include",
|
||||
]
|
||||
}
|
||||
|
||||
source_set("isac") {
|
||||
sources = [
|
||||
"codecs/isac/main/interface/audio_decoder_isac.h",
|
||||
"codecs/isac/main/interface/audio_encoder_isac.h",
|
||||
"codecs/isac/main/interface/isac.h",
|
||||
"codecs/isac/main/include/audio_decoder_isac.h",
|
||||
"codecs/isac/main/include/audio_encoder_isac.h",
|
||||
"codecs/isac/main/include/isac.h",
|
||||
"codecs/isac/main/source/arith_routines.c",
|
||||
"codecs/isac/main/source/arith_routines.h",
|
||||
"codecs/isac/main/source/arith_routines_hist.c",
|
||||
@ -506,15 +536,15 @@ source_set("isac") {
|
||||
config("isac_fix_config") {
|
||||
include_dirs = [
|
||||
"../../..",
|
||||
"codecs/isac/fix/interface",
|
||||
"codecs/isac/fix/include",
|
||||
]
|
||||
}
|
||||
|
||||
source_set("isac_fix") {
|
||||
sources = [
|
||||
"codecs/isac/fix/interface/audio_decoder_isacfix.h",
|
||||
"codecs/isac/fix/interface/audio_encoder_isacfix.h",
|
||||
"codecs/isac/fix/interface/isacfix.h",
|
||||
"codecs/isac/fix/include/audio_decoder_isacfix.h",
|
||||
"codecs/isac/fix/include/audio_encoder_isacfix.h",
|
||||
"codecs/isac/fix/include/isacfix.h",
|
||||
"codecs/isac/fix/source/arith_routines.c",
|
||||
"codecs/isac/fix/source/arith_routines_hist.c",
|
||||
"codecs/isac/fix/source/arith_routines_logist.c",
|
||||
@ -694,9 +724,9 @@ source_set("webrtc_opus") {
|
||||
sources = [
|
||||
"codecs/opus/audio_decoder_opus.cc",
|
||||
"codecs/opus/audio_encoder_opus.cc",
|
||||
"codecs/opus/interface/audio_decoder_opus.h",
|
||||
"codecs/opus/interface/audio_encoder_opus.h",
|
||||
"codecs/opus/interface/opus_interface.h",
|
||||
"codecs/opus/include/audio_decoder_opus.h",
|
||||
"codecs/opus/include/audio_encoder_opus.h",
|
||||
"codecs/opus/include/opus_interface.h",
|
||||
"codecs/opus/opus_inst.h",
|
||||
"codecs/opus/opus_interface.c",
|
||||
]
|
||||
@ -764,9 +794,11 @@ source_set("neteq") {
|
||||
"neteq/dtmf_tone_generator.h",
|
||||
"neteq/expand.cc",
|
||||
"neteq/expand.h",
|
||||
"neteq/interface/neteq.h",
|
||||
"neteq/include/neteq.h",
|
||||
"neteq/merge.cc",
|
||||
"neteq/merge.h",
|
||||
"neteq/nack.cc",
|
||||
"neteq/nack.h",
|
||||
"neteq/neteq.cc",
|
||||
"neteq/neteq_impl.cc",
|
||||
"neteq/neteq_impl.h",
|
||||
|
@ -1,6 +1,6 @@
|
||||
noinst_LTLIBRARIES = libaudio_coding.la
|
||||
|
||||
libaudio_coding_la_SOURCES = codecs/isac/main/interface/isac.h \
|
||||
libaudio_coding_la_SOURCES = codecs/isac/main/include/isac.h \
|
||||
codecs/isac/main/source/arith_routines.c \
|
||||
codecs/isac/main/source/arith_routines.h \
|
||||
codecs/isac/main/source/arith_routines_hist.c \
|
||||
|
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INTERFACE_ISAC_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INTERFACE_ISAC_H_
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INCLUDE_ISAC_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INCLUDE_ISAC_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@ -721,4 +721,4 @@ extern "C" {
|
||||
|
||||
|
||||
|
||||
#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INTERFACE_ISAC_H_ */
|
||||
#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INCLUDE_ISAC_H_ */
|
@ -440,7 +440,7 @@ WebRtcIsac_CorrelateInterVec(
|
||||
int16_t rowCntr;
|
||||
int16_t colCntr;
|
||||
int16_t interVecDim;
|
||||
double myVec[UB16_LPC_VEC_PER_FRAME];
|
||||
double myVec[UB16_LPC_VEC_PER_FRAME] = {0.0};
|
||||
const double* interVecDecorrMat;
|
||||
|
||||
switch(bandwidth)
|
||||
|
@ -17,10 +17,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
|
||||
#include "entropy_coding.h"
|
||||
#include "settings.h"
|
||||
#include "arith_routines.h"
|
||||
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
|
||||
#include "spectrum_ar_model_tables.h"
|
||||
#include "lpc_tables.h"
|
||||
#include "pitch_gain_tables.h"
|
||||
|
@ -168,8 +168,6 @@ enum IsacSamplingRate {kIsacWideband = 16, kIsacSuperWideband = 32};
|
||||
#define RCU_TRANSCODING_SCALE_UB 0.50f
|
||||
#define RCU_TRANSCODING_SCALE_UB_INVERSE 2.0f
|
||||
|
||||
#define SIZE_RESAMPLER_STATE 6
|
||||
|
||||
/* Define Error codes */
|
||||
/* 6000 General */
|
||||
#define ISAC_MEMORY_ALLOCATION_FAILED 6010
|
||||
|
@ -19,7 +19,7 @@
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_STRUCTS_H_
|
||||
|
||||
#include "webrtc/modules/audio_coding/codecs/isac/bandwidth_info.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/isac/main/interface/isac.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/isac/main/include/isac.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/isac/main/source/settings.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
@ -484,12 +484,9 @@ typedef struct {
|
||||
int16_t maxRateBytesPer30Ms;
|
||||
// Maximum allowed payload-size, measured in Bytes.
|
||||
int16_t maxPayloadSizeBytes;
|
||||
/* The expected sampling rate of the input signal. Valid values are 16000,
|
||||
* 32000 and 48000. This is not the operation sampling rate of the codec.
|
||||
* Input signals at 48 kHz are resampled to 32 kHz, then encoded. */
|
||||
/* The expected sampling rate of the input signal. Valid values are 16000
|
||||
* and 32000. This is not the operation sampling rate of the codec. */
|
||||
uint16_t in_sample_rate_hz;
|
||||
/* State for the input-resampler. It is only used for 48 kHz input signals. */
|
||||
int16_t state_in_resampler[SIZE_RESAMPLER_STATE];
|
||||
|
||||
// Trig tables for WebRtcIsac_Time2Spec and WebRtcIsac_Spec2time.
|
||||
TransformTables transform_tables;
|
||||
|
@ -54,6 +54,8 @@ source_set("audio_processing") {
|
||||
"audio_buffer.h",
|
||||
"audio_processing_impl.cc",
|
||||
"audio_processing_impl.h",
|
||||
"beamformer/array_util.cc",
|
||||
"beamformer/array_util.h",
|
||||
"beamformer/beamformer.h",
|
||||
"beamformer/complex_matrix.h",
|
||||
"beamformer/covariance_matrix_generator.cc",
|
||||
|
@ -39,6 +39,7 @@ libwebrtc_audio_processing_la_SOURCES = include/audio_processing.h \
|
||||
beamformer/matrix.h \
|
||||
beamformer/matrix_test_helpers.h \
|
||||
beamformer/nonlinear_beamformer.h \
|
||||
beamformer/array_util.cc \
|
||||
beamformer/covariance_matrix_generator.cc \
|
||||
beamformer/nonlinear_beamformer.cc \
|
||||
intelligibility/intelligibility_enhancer.h \
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "webrtc/modules/audio_processing/aec/aec_rdft.h"
|
||||
#include "webrtc/modules/audio_processing/logging/aec_logging.h"
|
||||
#include "webrtc/modules/audio_processing/utility/delay_estimator_wrapper.h"
|
||||
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
// These tables used to be computed at run-time. For example, refer to:
|
||||
|
@ -18,8 +18,8 @@
|
||||
#include "webrtc/common_audio/signal_processing/include/real_fft.h"
|
||||
#include "webrtc/modules/audio_processing/aecm/include/echo_control_mobile.h"
|
||||
#include "webrtc/modules/audio_processing/utility/delay_estimator_wrapper.h"
|
||||
#include "webrtc/system_wrappers/interface/compile_assert_c.h"
|
||||
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/compile_assert_c.h"
|
||||
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
#ifdef AEC_DEBUG
|
||||
|
@ -18,8 +18,8 @@
|
||||
#include "webrtc/common_audio/signal_processing/include/real_fft.h"
|
||||
#include "webrtc/modules/audio_processing/aecm/include/echo_control_mobile.h"
|
||||
#include "webrtc/modules/audio_processing/utility/delay_estimator_wrapper.h"
|
||||
#include "webrtc/system_wrappers/interface/compile_assert_c.h"
|
||||
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/compile_assert_c.h"
|
||||
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
// Square root of Hanning window in Q14.
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "webrtc/modules/audio_processing/agc/gain_map_internal.h"
|
||||
#include "webrtc/modules/audio_processing/gain_control_impl.h"
|
||||
#include "webrtc/modules/interface/module_common_types.h"
|
||||
#include "webrtc/system_wrappers/interface/logging.h"
|
||||
#include "webrtc/system_wrappers/include/logging.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "webrtc/modules/audio_processing/include/audio_processing.h"
|
||||
#include "webrtc/modules/audio_processing/splitting_filter.h"
|
||||
#include "webrtc/modules/interface/module_common_types.h"
|
||||
#include "webrtc/system_wrappers/interface/scoped_vector.h"
|
||||
#include "webrtc/system_wrappers/include/scoped_vector.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -37,10 +37,10 @@ extern "C" {
|
||||
#include "webrtc/modules/audio_processing/transient/transient_suppressor.h"
|
||||
#include "webrtc/modules/audio_processing/voice_detection_impl.h"
|
||||
#include "webrtc/modules/interface/module_common_types.h"
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/interface/file_wrapper.h"
|
||||
#include "webrtc/system_wrappers/interface/logging.h"
|
||||
#include "webrtc/system_wrappers/interface/metrics.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/file_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/logging.h"
|
||||
#include "webrtc/system_wrappers/include/metrics.h"
|
||||
|
||||
#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
|
||||
// Files generated at build-time by the protobuf compiler.
|
||||
@ -225,6 +225,7 @@ AudioProcessingImpl::AudioProcessingImpl(const Config& config,
|
||||
beamformer_enabled_(config.Get<Beamforming>().enabled),
|
||||
beamformer_(beamformer),
|
||||
array_geometry_(config.Get<Beamforming>().array_geometry),
|
||||
target_direction_(config.Get<Beamforming>().target_direction),
|
||||
intelligibility_enabled_(config.Get<Intelligibility>().enabled) {
|
||||
echo_cancellation_ = new EchoCancellationImpl(this, crit_);
|
||||
component_list_.push_back(echo_cancellation_);
|
||||
@ -1099,7 +1100,8 @@ void AudioProcessingImpl::InitializeTransient() {
|
||||
void AudioProcessingImpl::InitializeBeamformer() {
|
||||
if (beamformer_enabled_) {
|
||||
if (!beamformer_) {
|
||||
beamformer_.reset(new NonlinearBeamformer(array_geometry_));
|
||||
beamformer_.reset(
|
||||
new NonlinearBeamformer(array_geometry_, target_direction_));
|
||||
}
|
||||
beamformer_->Initialize(kChunkSizeMs, split_rate_);
|
||||
}
|
||||
|
@ -208,6 +208,7 @@ class AudioProcessingImpl : public AudioProcessing {
|
||||
const bool beamformer_enabled_;
|
||||
rtc::scoped_ptr<Beamformer<float>> beamformer_;
|
||||
const std::vector<Point> array_geometry_;
|
||||
const SphericalPointf target_direction_;
|
||||
|
||||
bool intelligibility_enabled_;
|
||||
rtc::scoped_ptr<IntelligibilityEnhancer> intelligibility_enhancer_;
|
||||
|
118
webrtc/modules/audio_processing/beamformer/array_util.cc
Normal file
118
webrtc/modules/audio_processing/beamformer/array_util.cc
Normal file
@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright (c) 2015 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.
|
||||
*/
|
||||
|
||||
#include "webrtc/modules/audio_processing/beamformer/array_util.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
|
||||
const float kMaxDotProduct = 1e-6f;
|
||||
|
||||
} // namespace
|
||||
|
||||
float GetMinimumSpacing(const std::vector<Point>& array_geometry) {
|
||||
RTC_CHECK_GT(array_geometry.size(), 1u);
|
||||
float mic_spacing = std::numeric_limits<float>::max();
|
||||
for (size_t i = 0; i < (array_geometry.size() - 1); ++i) {
|
||||
for (size_t j = i + 1; j < array_geometry.size(); ++j) {
|
||||
mic_spacing =
|
||||
std::min(mic_spacing, Distance(array_geometry[i], array_geometry[j]));
|
||||
}
|
||||
}
|
||||
return mic_spacing;
|
||||
}
|
||||
|
||||
Point PairDirection(const Point& a, const Point& b) {
|
||||
return {b.x() - a.x(), b.y() - a.y(), b.z() - a.z()};
|
||||
}
|
||||
|
||||
float DotProduct(const Point& a, const Point& b) {
|
||||
return a.x() * b.x() + a.y() * b.y() + a.z() * b.z();
|
||||
}
|
||||
|
||||
Point CrossProduct(const Point& a, const Point& b) {
|
||||
return {a.y() * b.z() - a.z() * b.y(), a.z() * b.x() - a.x() * b.z(),
|
||||
a.x() * b.y() - a.y() * b.x()};
|
||||
}
|
||||
|
||||
bool AreParallel(const Point& a, const Point& b) {
|
||||
Point cross_product = CrossProduct(a, b);
|
||||
return DotProduct(cross_product, cross_product) < kMaxDotProduct;
|
||||
}
|
||||
|
||||
bool ArePerpendicular(const Point& a, const Point& b) {
|
||||
return std::abs(DotProduct(a, b)) < kMaxDotProduct;
|
||||
}
|
||||
|
||||
rtc::Maybe<Point> GetDirectionIfLinear(
|
||||
const std::vector<Point>& array_geometry) {
|
||||
RTC_DCHECK_GT(array_geometry.size(), 1u);
|
||||
const Point first_pair_direction =
|
||||
PairDirection(array_geometry[0], array_geometry[1]);
|
||||
for (size_t i = 2u; i < array_geometry.size(); ++i) {
|
||||
const Point pair_direction =
|
||||
PairDirection(array_geometry[i - 1], array_geometry[i]);
|
||||
if (!AreParallel(first_pair_direction, pair_direction)) {
|
||||
return rtc::Maybe<Point>();
|
||||
}
|
||||
}
|
||||
return rtc::Maybe<Point>(first_pair_direction);
|
||||
}
|
||||
|
||||
rtc::Maybe<Point> GetNormalIfPlanar(const std::vector<Point>& array_geometry) {
|
||||
RTC_DCHECK_GT(array_geometry.size(), 1u);
|
||||
const Point first_pair_direction =
|
||||
PairDirection(array_geometry[0], array_geometry[1]);
|
||||
Point pair_direction(0.f, 0.f, 0.f);
|
||||
size_t i = 2u;
|
||||
bool is_linear = true;
|
||||
for (; i < array_geometry.size() && is_linear; ++i) {
|
||||
pair_direction = PairDirection(array_geometry[i - 1], array_geometry[i]);
|
||||
if (!AreParallel(first_pair_direction, pair_direction)) {
|
||||
is_linear = false;
|
||||
}
|
||||
}
|
||||
if (is_linear) {
|
||||
return rtc::Maybe<Point>();
|
||||
}
|
||||
const Point normal_direction =
|
||||
CrossProduct(first_pair_direction, pair_direction);
|
||||
for (; i < array_geometry.size(); ++i) {
|
||||
pair_direction = PairDirection(array_geometry[i - 1], array_geometry[i]);
|
||||
if (!ArePerpendicular(normal_direction, pair_direction)) {
|
||||
return rtc::Maybe<Point>();
|
||||
}
|
||||
}
|
||||
return rtc::Maybe<Point>(normal_direction);
|
||||
}
|
||||
|
||||
rtc::Maybe<Point> GetArrayNormalIfExists(
|
||||
const std::vector<Point>& array_geometry) {
|
||||
const rtc::Maybe<Point> direction = GetDirectionIfLinear(array_geometry);
|
||||
if (direction) {
|
||||
return rtc::Maybe<Point>(Point(direction->y(), -direction->x(), 0.f));
|
||||
}
|
||||
const rtc::Maybe<Point> normal = GetNormalIfPlanar(array_geometry);
|
||||
if (normal && normal->z() < kMaxDotProduct) {
|
||||
return normal;
|
||||
}
|
||||
return rtc::Maybe<Point>();
|
||||
}
|
||||
|
||||
Point AzimuthToPoint(float azimuth) {
|
||||
return Point(std::cos(azimuth), std::sin(azimuth), 0.f);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
@ -12,12 +12,25 @@
|
||||
#define WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_ARRAY_UTIL_H_
|
||||
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/maybe.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Coordinates in meters.
|
||||
// Coordinates in meters. The convention used is:
|
||||
// x: the horizontal dimension, with positive to the right from the camera's
|
||||
// perspective.
|
||||
// y: the depth dimension, with positive forward from the camera's
|
||||
// perspective.
|
||||
// z: the vertical dimension, with positive upwards.
|
||||
template<typename T>
|
||||
struct CartesianPoint {
|
||||
CartesianPoint() {
|
||||
c[0] = 0;
|
||||
c[1] = 0;
|
||||
c[2] = 0;
|
||||
}
|
||||
CartesianPoint(T x, T y, T z) {
|
||||
c[0] = x;
|
||||
c[1] = y;
|
||||
@ -31,6 +44,35 @@ struct CartesianPoint {
|
||||
|
||||
using Point = CartesianPoint<float>;
|
||||
|
||||
// Calculates the direction from a to b.
|
||||
Point PairDirection(const Point& a, const Point& b);
|
||||
|
||||
float DotProduct(const Point& a, const Point& b);
|
||||
Point CrossProduct(const Point& a, const Point& b);
|
||||
|
||||
bool AreParallel(const Point& a, const Point& b);
|
||||
bool ArePerpendicular(const Point& a, const Point& b);
|
||||
|
||||
// Returns the minimum distance between any two Points in the given
|
||||
// |array_geometry|.
|
||||
float GetMinimumSpacing(const std::vector<Point>& array_geometry);
|
||||
|
||||
// If the given array geometry is linear it returns the direction without
|
||||
// normalizing.
|
||||
rtc::Maybe<Point> GetDirectionIfLinear(
|
||||
const std::vector<Point>& array_geometry);
|
||||
|
||||
// If the given array geometry is planar it returns the normal without
|
||||
// normalizing.
|
||||
rtc::Maybe<Point> GetNormalIfPlanar(const std::vector<Point>& array_geometry);
|
||||
|
||||
// Returns the normal of an array if it has one and it is in the xy-plane.
|
||||
rtc::Maybe<Point> GetArrayNormalIfExists(
|
||||
const std::vector<Point>& array_geometry);
|
||||
|
||||
// The resulting Point will be in the xy-plane.
|
||||
Point AzimuthToPoint(float azimuth);
|
||||
|
||||
template<typename T>
|
||||
float Distance(CartesianPoint<T> a, CartesianPoint<T> b) {
|
||||
return std::sqrt((a.x() - b.x()) * (a.x() - b.x()) +
|
||||
@ -38,6 +80,11 @@ float Distance(CartesianPoint<T> a, CartesianPoint<T> b) {
|
||||
(a.z() - b.z()) * (a.z() - b.z()));
|
||||
}
|
||||
|
||||
// The convention used:
|
||||
// azimuth: zero is to the right from the camera's perspective, with positive
|
||||
// angles in radians counter-clockwise.
|
||||
// elevation: zero is horizontal, with positive angles in radians upwards.
|
||||
// radius: distance from the camera in meters.
|
||||
template <typename T>
|
||||
struct SphericalPoint {
|
||||
SphericalPoint(T azimuth, T elevation, T radius) {
|
||||
@ -53,6 +100,17 @@ struct SphericalPoint {
|
||||
|
||||
using SphericalPointf = SphericalPoint<float>;
|
||||
|
||||
// Helper functions to transform degrees to radians and the inverse.
|
||||
template <typename T>
|
||||
T DegreesToRadians(T angle_degrees) {
|
||||
return M_PI * angle_degrees / 180;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T RadiansToDegrees(T angle_radians) {
|
||||
return 180 * angle_radians / M_PI;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_ARRAY_UTIL_H_
|
||||
|
@ -32,6 +32,9 @@ class Beamformer {
|
||||
// Needs to be called before the the Beamformer can be used.
|
||||
virtual void Initialize(int chunk_size_ms, int sample_rate_hz) = 0;
|
||||
|
||||
// Aim the beamformer at a point in space.
|
||||
virtual void AimAt(const SphericalPointf& spherical_point) = 0;
|
||||
|
||||
// Indicates whether a given point is inside of the beam.
|
||||
virtual bool IsInBeam(const SphericalPointf& spherical_point) { return true; }
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
|
||||
float BesselJ0(float x) {
|
||||
@ -24,9 +25,19 @@ float BesselJ0(float x) {
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
// Calculates the Euclidean norm for a row vector.
|
||||
float Norm(const ComplexMatrix<float>& x) {
|
||||
RTC_CHECK_EQ(1, x.num_rows());
|
||||
const size_t length = x.num_columns();
|
||||
const complex<float>* elems = x.elements()[0];
|
||||
float result = 0.f;
|
||||
for (size_t i = 0u; i < length; ++i) {
|
||||
result += std::norm(elems[i]);
|
||||
}
|
||||
return std::sqrt(result);
|
||||
}
|
||||
|
||||
namespace webrtc {
|
||||
} // namespace
|
||||
|
||||
void CovarianceMatrixGenerator::UniformCovarianceMatrix(
|
||||
float wave_number,
|
||||
@ -69,6 +80,7 @@ void CovarianceMatrixGenerator::AngledCovarianceMatrix(
|
||||
geometry,
|
||||
angle,
|
||||
&interf_cov_vector);
|
||||
interf_cov_vector.Scale(1.f / Norm(interf_cov_vector));
|
||||
interf_cov_vector_transposed.Transpose(interf_cov_vector);
|
||||
interf_cov_vector.PointwiseConjugate();
|
||||
mat->Multiply(interf_cov_vector_transposed, interf_cov_vector);
|
||||
|
@ -27,33 +27,21 @@ namespace {
|
||||
// Alpha for the Kaiser Bessel Derived window.
|
||||
const float kKbdAlpha = 1.5f;
|
||||
|
||||
// The minimum value a post-processing mask can take.
|
||||
const float kMaskMinimum = 0.01f;
|
||||
|
||||
const float kSpeedOfSoundMeterSeconds = 343;
|
||||
|
||||
// For both target and interference angles, PI / 2 is perpendicular to the
|
||||
// microphone array, facing forwards. The positive direction goes
|
||||
// counterclockwise.
|
||||
// The angle at which we amplify sound.
|
||||
const float kTargetAngleRadians = static_cast<float>(M_PI) / 2.f;
|
||||
// The minimum separation in radians between the target direction and an
|
||||
// interferer scenario.
|
||||
const float kMinAwayRadians = 0.2f;
|
||||
|
||||
// The angle at which we suppress sound. Suppression is symmetric around PI / 2
|
||||
// radians, so sound is suppressed at both +|kInterfAngleRadians| and
|
||||
// PI - |kInterfAngleRadians|. Since the beamformer is robust, this should
|
||||
// suppress sound coming from close angles as well.
|
||||
const float kInterfAngleRadians = static_cast<float>(M_PI) / 4.f;
|
||||
// The separation between the target direction and the closest interferer
|
||||
// scenario is proportional to this constant.
|
||||
const float kAwaySlope = 0.008f;
|
||||
|
||||
// When calculating the interference covariance matrix, this is the weight for
|
||||
// the weighted average between the uniform covariance matrix and the angled
|
||||
// covariance matrix.
|
||||
// Rpsi = Rpsi_angled * kBalance + Rpsi_uniform * (1 - kBalance)
|
||||
const float kBalance = 0.4f;
|
||||
|
||||
const float kHalfBeamWidthRadians = static_cast<float>(M_PI) * 20.f / 180.f;
|
||||
|
||||
// TODO(claguna): need comment here.
|
||||
const float kBeamwidthConstant = 0.00002f;
|
||||
const float kBalance = 0.95f;
|
||||
|
||||
// Alpha coefficients for mask smoothing.
|
||||
const float kMaskTimeSmoothAlpha = 0.2f;
|
||||
@ -64,17 +52,28 @@ const float kMaskFrequencySmoothAlpha = 0.6f;
|
||||
const int kLowMeanStartHz = 200;
|
||||
const int kLowMeanEndHz = 400;
|
||||
|
||||
const int kHighMeanStartHz = 3000;
|
||||
const int kHighMeanEndHz = 5000;
|
||||
// Range limiter for subtractive terms in the nominator and denominator of the
|
||||
// postfilter expression. It handles the scenario mismatch between the true and
|
||||
// model sources (target and interference).
|
||||
const float kCutOffConstant = 0.9999f;
|
||||
|
||||
// Quantile of mask values which is used to estimate target presence.
|
||||
const float kMaskQuantile = 0.7f;
|
||||
// Mask threshold over which the data is considered signal and not interference.
|
||||
const float kMaskTargetThreshold = 0.3f;
|
||||
// It has to be updated every time the postfilter calculation is changed
|
||||
// significantly.
|
||||
// TODO(aluebs): Write a tool to tune the target threshold automatically based
|
||||
// on files annotated with target and interference ground truth.
|
||||
const float kMaskTargetThreshold = 0.01f;
|
||||
// Time in seconds after which the data is considered interference if the mask
|
||||
// does not pass |kMaskTargetThreshold|.
|
||||
const float kHoldTargetSeconds = 0.25f;
|
||||
|
||||
// To compensate for the attenuation this algorithm introduces to the target
|
||||
// signal. It was estimated empirically from a low-noise low-reverberation
|
||||
// recording from broadside.
|
||||
const float kCompensationGain = 2.f;
|
||||
|
||||
// Does conjugate(|norm_mat|) * |mat| * transpose(|norm_mat|). No extra space is
|
||||
// used; to accomplish this, we compute both multiplications in the same loop.
|
||||
// The returned norm is clamped to be non-negative.
|
||||
@ -179,13 +178,23 @@ std::vector<Point> GetCenteredArray(std::vector<Point> array_geometry) {
|
||||
|
||||
} // namespace
|
||||
|
||||
const float NonlinearBeamformer::kHalfBeamWidthRadians = DegreesToRadians(20.f);
|
||||
|
||||
// static
|
||||
const size_t NonlinearBeamformer::kNumFreqBins;
|
||||
|
||||
NonlinearBeamformer::NonlinearBeamformer(
|
||||
const std::vector<Point>& array_geometry)
|
||||
const std::vector<Point>& array_geometry,
|
||||
SphericalPointf target_direction)
|
||||
: num_input_channels_(array_geometry.size()),
|
||||
array_geometry_(GetCenteredArray(array_geometry)) {
|
||||
array_geometry_(GetCenteredArray(array_geometry)),
|
||||
array_normal_(GetArrayNormalIfExists(array_geometry)),
|
||||
min_mic_spacing_(GetMinimumSpacing(array_geometry)),
|
||||
target_angle_radians_(target_direction.azimuth()),
|
||||
away_radians_(std::min(
|
||||
static_cast<float>(M_PI),
|
||||
std::max(kMinAwayRadians,
|
||||
kAwaySlope * static_cast<float>(M_PI) / min_mic_spacing_))) {
|
||||
WindowGenerator::KaiserBesselDerived(kKbdAlpha, kFftSize, window_);
|
||||
}
|
||||
|
||||
@ -193,32 +202,12 @@ void NonlinearBeamformer::Initialize(int chunk_size_ms, int sample_rate_hz) {
|
||||
chunk_length_ =
|
||||
static_cast<size_t>(sample_rate_hz / (1000.f / chunk_size_ms));
|
||||
sample_rate_hz_ = sample_rate_hz;
|
||||
low_mean_start_bin_ = Round(kLowMeanStartHz * kFftSize / sample_rate_hz_);
|
||||
low_mean_end_bin_ = Round(kLowMeanEndHz * kFftSize / sample_rate_hz_);
|
||||
high_mean_start_bin_ = Round(kHighMeanStartHz * kFftSize / sample_rate_hz_);
|
||||
high_mean_end_bin_ = Round(kHighMeanEndHz * kFftSize / sample_rate_hz_);
|
||||
// These bin indexes determine the regions over which a mean is taken. This
|
||||
// is applied as a constant value over the adjacent end "frequency correction"
|
||||
// regions.
|
||||
//
|
||||
// low_mean_start_bin_ high_mean_start_bin_
|
||||
// v v constant
|
||||
// |----------------|--------|----------------|-------|----------------|
|
||||
// constant ^ ^
|
||||
// low_mean_end_bin_ high_mean_end_bin_
|
||||
//
|
||||
RTC_DCHECK_GT(low_mean_start_bin_, 0U);
|
||||
RTC_DCHECK_LT(low_mean_start_bin_, low_mean_end_bin_);
|
||||
RTC_DCHECK_LT(low_mean_end_bin_, high_mean_end_bin_);
|
||||
RTC_DCHECK_LT(high_mean_start_bin_, high_mean_end_bin_);
|
||||
RTC_DCHECK_LT(high_mean_end_bin_, kNumFreqBins - 1);
|
||||
|
||||
high_pass_postfilter_mask_ = 1.f;
|
||||
is_target_present_ = false;
|
||||
hold_target_blocks_ = kHoldTargetSeconds * 2 * sample_rate_hz / kFftSize;
|
||||
interference_blocks_count_ = hold_target_blocks_;
|
||||
|
||||
|
||||
lapped_transform_.reset(new LappedTransform(num_input_channels_,
|
||||
1,
|
||||
chunk_length_,
|
||||
@ -231,34 +220,88 @@ void NonlinearBeamformer::Initialize(int chunk_size_ms, int sample_rate_hz) {
|
||||
final_mask_[i] = 1.f;
|
||||
float freq_hz = (static_cast<float>(i) / kFftSize) * sample_rate_hz_;
|
||||
wave_numbers_[i] = 2 * M_PI * freq_hz / kSpeedOfSoundMeterSeconds;
|
||||
mask_thresholds_[i] = num_input_channels_ * num_input_channels_ *
|
||||
kBeamwidthConstant * wave_numbers_[i] *
|
||||
wave_numbers_[i];
|
||||
}
|
||||
|
||||
// Initialize all nonadaptive values before looping through the frames.
|
||||
InitDelaySumMasks();
|
||||
InitTargetCovMats();
|
||||
InitInterfCovMats();
|
||||
InitLowFrequencyCorrectionRanges();
|
||||
InitDiffuseCovMats();
|
||||
AimAt(SphericalPointf(target_angle_radians_, 0.f, 1.f));
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < kNumFreqBins; ++i) {
|
||||
rxiws_[i] = Norm(target_cov_mats_[i], delay_sum_masks_[i]);
|
||||
rpsiws_[i] = Norm(interf_cov_mats_[i], delay_sum_masks_[i]);
|
||||
reflected_rpsiws_[i] =
|
||||
Norm(reflected_interf_cov_mats_[i], delay_sum_masks_[i]);
|
||||
// These bin indexes determine the regions over which a mean is taken. This is
|
||||
// applied as a constant value over the adjacent end "frequency correction"
|
||||
// regions.
|
||||
//
|
||||
// low_mean_start_bin_ high_mean_start_bin_
|
||||
// v v constant
|
||||
// |----------------|--------|----------------|-------|----------------|
|
||||
// constant ^ ^
|
||||
// low_mean_end_bin_ high_mean_end_bin_
|
||||
//
|
||||
void NonlinearBeamformer::InitLowFrequencyCorrectionRanges() {
|
||||
low_mean_start_bin_ = Round(kLowMeanStartHz * kFftSize / sample_rate_hz_);
|
||||
low_mean_end_bin_ = Round(kLowMeanEndHz * kFftSize / sample_rate_hz_);
|
||||
|
||||
RTC_DCHECK_GT(low_mean_start_bin_, 0U);
|
||||
RTC_DCHECK_LT(low_mean_start_bin_, low_mean_end_bin_);
|
||||
}
|
||||
|
||||
void NonlinearBeamformer::InitHighFrequencyCorrectionRanges() {
|
||||
const float kAliasingFreqHz =
|
||||
kSpeedOfSoundMeterSeconds /
|
||||
(min_mic_spacing_ * (1.f + std::abs(std::cos(target_angle_radians_))));
|
||||
const float kHighMeanStartHz = std::min(0.5f * kAliasingFreqHz,
|
||||
sample_rate_hz_ / 2.f);
|
||||
const float kHighMeanEndHz = std::min(0.75f * kAliasingFreqHz,
|
||||
sample_rate_hz_ / 2.f);
|
||||
high_mean_start_bin_ = Round(kHighMeanStartHz * kFftSize / sample_rate_hz_);
|
||||
high_mean_end_bin_ = Round(kHighMeanEndHz * kFftSize / sample_rate_hz_);
|
||||
|
||||
RTC_DCHECK_LT(low_mean_end_bin_, high_mean_end_bin_);
|
||||
RTC_DCHECK_LT(high_mean_start_bin_, high_mean_end_bin_);
|
||||
RTC_DCHECK_LT(high_mean_end_bin_, kNumFreqBins - 1);
|
||||
}
|
||||
|
||||
void NonlinearBeamformer::InitInterfAngles() {
|
||||
interf_angles_radians_.clear();
|
||||
const Point target_direction = AzimuthToPoint(target_angle_radians_);
|
||||
const Point clockwise_interf_direction =
|
||||
AzimuthToPoint(target_angle_radians_ - away_radians_);
|
||||
if (!array_normal_ ||
|
||||
DotProduct(*array_normal_, target_direction) *
|
||||
DotProduct(*array_normal_, clockwise_interf_direction) >=
|
||||
0.f) {
|
||||
// The target and clockwise interferer are in the same half-plane defined
|
||||
// by the array.
|
||||
interf_angles_radians_.push_back(target_angle_radians_ - away_radians_);
|
||||
} else {
|
||||
// Otherwise, the interferer will begin reflecting back at the target.
|
||||
// Instead rotate it away 180 degrees.
|
||||
interf_angles_radians_.push_back(target_angle_radians_ - away_radians_ +
|
||||
M_PI);
|
||||
}
|
||||
const Point counterclock_interf_direction =
|
||||
AzimuthToPoint(target_angle_radians_ + away_radians_);
|
||||
if (!array_normal_ ||
|
||||
DotProduct(*array_normal_, target_direction) *
|
||||
DotProduct(*array_normal_, counterclock_interf_direction) >=
|
||||
0.f) {
|
||||
// The target and counter-clockwise interferer are in the same half-plane
|
||||
// defined by the array.
|
||||
interf_angles_radians_.push_back(target_angle_radians_ + away_radians_);
|
||||
} else {
|
||||
// Otherwise, the interferer will begin reflecting back at the target.
|
||||
// Instead rotate it away 180 degrees.
|
||||
interf_angles_radians_.push_back(target_angle_radians_ + away_radians_ -
|
||||
M_PI);
|
||||
}
|
||||
}
|
||||
|
||||
void NonlinearBeamformer::InitDelaySumMasks() {
|
||||
for (size_t f_ix = 0; f_ix < kNumFreqBins; ++f_ix) {
|
||||
delay_sum_masks_[f_ix].Resize(1, num_input_channels_);
|
||||
CovarianceMatrixGenerator::PhaseAlignmentMasks(f_ix,
|
||||
kFftSize,
|
||||
sample_rate_hz_,
|
||||
kSpeedOfSoundMeterSeconds,
|
||||
array_geometry_,
|
||||
kTargetAngleRadians,
|
||||
&delay_sum_masks_[f_ix]);
|
||||
CovarianceMatrixGenerator::PhaseAlignmentMasks(
|
||||
f_ix, kFftSize, sample_rate_hz_, kSpeedOfSoundMeterSeconds,
|
||||
array_geometry_, target_angle_radians_, &delay_sum_masks_[f_ix]);
|
||||
|
||||
complex_f norm_factor = sqrt(
|
||||
ConjugateDotProduct(delay_sum_masks_[f_ix], delay_sum_masks_[f_ix]));
|
||||
@ -273,23 +316,30 @@ void NonlinearBeamformer::InitTargetCovMats() {
|
||||
for (size_t i = 0; i < kNumFreqBins; ++i) {
|
||||
target_cov_mats_[i].Resize(num_input_channels_, num_input_channels_);
|
||||
TransposedConjugatedProduct(delay_sum_masks_[i], &target_cov_mats_[i]);
|
||||
complex_f normalization_factor = target_cov_mats_[i].Trace();
|
||||
target_cov_mats_[i].Scale(1.f / normalization_factor);
|
||||
}
|
||||
}
|
||||
|
||||
void NonlinearBeamformer::InitDiffuseCovMats() {
|
||||
for (size_t i = 0; i < kNumFreqBins; ++i) {
|
||||
uniform_cov_mat_[i].Resize(num_input_channels_, num_input_channels_);
|
||||
CovarianceMatrixGenerator::UniformCovarianceMatrix(
|
||||
wave_numbers_[i], array_geometry_, &uniform_cov_mat_[i]);
|
||||
complex_f normalization_factor = uniform_cov_mat_[i].elements()[0][0];
|
||||
uniform_cov_mat_[i].Scale(1.f / normalization_factor);
|
||||
uniform_cov_mat_[i].Scale(1 - kBalance);
|
||||
}
|
||||
}
|
||||
|
||||
void NonlinearBeamformer::InitInterfCovMats() {
|
||||
for (size_t i = 0; i < kNumFreqBins; ++i) {
|
||||
interf_cov_mats_[i].Resize(num_input_channels_, num_input_channels_);
|
||||
ComplexMatrixF uniform_cov_mat(num_input_channels_, num_input_channels_);
|
||||
interf_cov_mats_[i].clear();
|
||||
for (size_t j = 0; j < interf_angles_radians_.size(); ++j) {
|
||||
interf_cov_mats_[i].push_back(new ComplexMatrixF(num_input_channels_,
|
||||
num_input_channels_));
|
||||
ComplexMatrixF angled_cov_mat(num_input_channels_, num_input_channels_);
|
||||
|
||||
CovarianceMatrixGenerator::UniformCovarianceMatrix(wave_numbers_[i],
|
||||
array_geometry_,
|
||||
&uniform_cov_mat);
|
||||
|
||||
CovarianceMatrixGenerator::AngledCovarianceMatrix(kSpeedOfSoundMeterSeconds,
|
||||
kInterfAngleRadians,
|
||||
CovarianceMatrixGenerator::AngledCovarianceMatrix(
|
||||
kSpeedOfSoundMeterSeconds,
|
||||
interf_angles_radians_[j],
|
||||
i,
|
||||
kFftSize,
|
||||
kNumFreqBins,
|
||||
@ -297,16 +347,22 @@ void NonlinearBeamformer::InitInterfCovMats() {
|
||||
array_geometry_,
|
||||
&angled_cov_mat);
|
||||
// Normalize matrices before averaging them.
|
||||
complex_f normalization_factor = uniform_cov_mat.Trace();
|
||||
uniform_cov_mat.Scale(1.f / normalization_factor);
|
||||
normalization_factor = angled_cov_mat.Trace();
|
||||
complex_f normalization_factor = angled_cov_mat.elements()[0][0];
|
||||
angled_cov_mat.Scale(1.f / normalization_factor);
|
||||
|
||||
// Average matrices.
|
||||
uniform_cov_mat.Scale(1 - kBalance);
|
||||
// Weighted average of matrices.
|
||||
angled_cov_mat.Scale(kBalance);
|
||||
interf_cov_mats_[i].Add(uniform_cov_mat, angled_cov_mat);
|
||||
reflected_interf_cov_mats_[i].PointwiseConjugate(interf_cov_mats_[i]);
|
||||
interf_cov_mats_[i][j]->Add(uniform_cov_mat_[i], angled_cov_mat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NonlinearBeamformer::NormalizeCovMats() {
|
||||
for (size_t i = 0; i < kNumFreqBins; ++i) {
|
||||
rxiws_[i] = Norm(target_cov_mats_[i], delay_sum_masks_[i]);
|
||||
rpsiws_[i].clear();
|
||||
for (size_t j = 0; j < interf_angles_radians_.size(); ++j) {
|
||||
rpsiws_[i].push_back(Norm(*interf_cov_mats_[i][j], delay_sum_masks_[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -322,28 +378,32 @@ void NonlinearBeamformer::ProcessChunk(const ChannelBuffer<float>& input,
|
||||
const float ramp_increment =
|
||||
(high_pass_postfilter_mask_ - old_high_pass_mask) /
|
||||
input.num_frames_per_band();
|
||||
// Apply delay and sum and post-filter in the time domain. WARNING: only works
|
||||
// because delay-and-sum is not frequency dependent.
|
||||
// Apply the smoothed high-pass mask to the first channel of each band.
|
||||
// This can be done because the effct of the linear beamformer is negligible
|
||||
// compared to the post-filter.
|
||||
for (size_t i = 1; i < input.num_bands(); ++i) {
|
||||
float smoothed_mask = old_high_pass_mask;
|
||||
for (size_t j = 0; j < input.num_frames_per_band(); ++j) {
|
||||
smoothed_mask += ramp_increment;
|
||||
output->channels(i)[0][j] = input.channels(i)[0][j] * smoothed_mask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Applying the delay and sum (at zero degrees, this is equivalent to
|
||||
// averaging).
|
||||
float sum = 0.f;
|
||||
for (int k = 0; k < input.num_channels(); ++k) {
|
||||
sum += input.channels(i)[k][j];
|
||||
}
|
||||
output->channels(i)[0][j] = sum / input.num_channels() * smoothed_mask;
|
||||
}
|
||||
}
|
||||
void NonlinearBeamformer::AimAt(const SphericalPointf& target_direction) {
|
||||
target_angle_radians_ = target_direction.azimuth();
|
||||
InitHighFrequencyCorrectionRanges();
|
||||
InitInterfAngles();
|
||||
InitDelaySumMasks();
|
||||
InitTargetCovMats();
|
||||
InitInterfCovMats();
|
||||
NormalizeCovMats();
|
||||
}
|
||||
|
||||
bool NonlinearBeamformer::IsInBeam(const SphericalPointf& spherical_point) {
|
||||
// If more than half-beamwidth degrees away from the beam's center,
|
||||
// you are out of the beam.
|
||||
return fabs(spherical_point.azimuth() - kTargetAngleRadians) <
|
||||
return fabs(spherical_point.azimuth() - target_angle_radians_) <
|
||||
kHalfBeamWidthRadians;
|
||||
}
|
||||
|
||||
@ -376,17 +436,19 @@ void NonlinearBeamformer::ProcessAudioBlock(const complex_f* const* input,
|
||||
rmw *= rmw;
|
||||
float rmw_r = rmw.real();
|
||||
|
||||
new_mask_[i] = CalculatePostfilterMask(interf_cov_mats_[i],
|
||||
rpsiws_[i],
|
||||
new_mask_[i] = CalculatePostfilterMask(*interf_cov_mats_[i][0],
|
||||
rpsiws_[i][0],
|
||||
ratio_rxiw_rxim,
|
||||
rmw_r,
|
||||
mask_thresholds_[i]);
|
||||
|
||||
new_mask_[i] *= CalculatePostfilterMask(reflected_interf_cov_mats_[i],
|
||||
reflected_rpsiws_[i],
|
||||
rmw_r);
|
||||
for (size_t j = 1; j < interf_angles_radians_.size(); ++j) {
|
||||
float tmp_mask = CalculatePostfilterMask(*interf_cov_mats_[i][j],
|
||||
rpsiws_[i][j],
|
||||
ratio_rxiw_rxim,
|
||||
rmw_r,
|
||||
mask_thresholds_[i]);
|
||||
rmw_r);
|
||||
if (tmp_mask < new_mask_[i]) {
|
||||
new_mask_[i] = tmp_mask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ApplyMaskTimeSmoothing();
|
||||
@ -401,24 +463,16 @@ float NonlinearBeamformer::CalculatePostfilterMask(
|
||||
const ComplexMatrixF& interf_cov_mat,
|
||||
float rpsiw,
|
||||
float ratio_rxiw_rxim,
|
||||
float rmw_r,
|
||||
float mask_threshold) {
|
||||
float rmw_r) {
|
||||
float rpsim = Norm(interf_cov_mat, eig_m_);
|
||||
|
||||
// Find lambda.
|
||||
float ratio = 0.f;
|
||||
if (rpsim > 0.f) {
|
||||
ratio = rpsiw / rpsim;
|
||||
}
|
||||
float numerator = rmw_r - ratio;
|
||||
float denominator = ratio_rxiw_rxim - ratio;
|
||||
|
||||
float mask = 1.f;
|
||||
if (denominator > mask_threshold) {
|
||||
float lambda = numerator / denominator;
|
||||
mask = std::max(lambda * ratio_rxiw_rxim / rmw_r, kMaskMinimum);
|
||||
}
|
||||
return mask;
|
||||
return (1.f - std::min(kCutOffConstant, ratio / rmw_r)) /
|
||||
(1.f - std::min(kCutOffConstant, ratio / ratio_rxiw_rxim));
|
||||
}
|
||||
|
||||
void NonlinearBeamformer::ApplyMasks(const complex_f* const* input,
|
||||
@ -433,7 +487,7 @@ void NonlinearBeamformer::ApplyMasks(const complex_f* const* input,
|
||||
output_channel[f_ix] += input[c_ix][f_ix] * delay_sum_mask_els[c_ix];
|
||||
}
|
||||
|
||||
output_channel[f_ix] *= final_mask_[f_ix];
|
||||
output_channel[f_ix] *= kCompensationGain * final_mask_[f_ix];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,12 +11,17 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_NONLINEAR_BEAMFORMER_H_
|
||||
#define WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_NONLINEAR_BEAMFORMER_H_
|
||||
|
||||
// MSVC++ requires this to be set before any other includes to get M_PI.
|
||||
#define _USE_MATH_DEFINES
|
||||
|
||||
#include <math.h>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/common_audio/lapped_transform.h"
|
||||
#include "webrtc/common_audio/channel_buffer.h"
|
||||
#include "webrtc/modules/audio_processing/beamformer/beamformer.h"
|
||||
#include "webrtc/modules/audio_processing/beamformer/complex_matrix.h"
|
||||
#include "webrtc/system_wrappers/include/scoped_vector.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -26,15 +31,16 @@ namespace webrtc {
|
||||
//
|
||||
// The implemented nonlinear postfilter algorithm taken from "A Robust Nonlinear
|
||||
// Beamforming Postprocessor" by Bastiaan Kleijn.
|
||||
//
|
||||
// TODO(aluebs): Target angle assumed to be 0. Parameterize target angle.
|
||||
class NonlinearBeamformer
|
||||
: public Beamformer<float>,
|
||||
public LappedTransform::Callback {
|
||||
public:
|
||||
// At the moment it only accepts uniform linear microphone arrays. Using the
|
||||
// first microphone as a reference position [0, 0, 0] is a natural choice.
|
||||
explicit NonlinearBeamformer(const std::vector<Point>& array_geometry);
|
||||
static const float kHalfBeamWidthRadians;
|
||||
|
||||
explicit NonlinearBeamformer(
|
||||
const std::vector<Point>& array_geometry,
|
||||
SphericalPointf target_direction =
|
||||
SphericalPointf(static_cast<float>(M_PI) / 2.f, 0.f, 1.f));
|
||||
|
||||
// Sample rate corresponds to the lower band.
|
||||
// Needs to be called before the NonlinearBeamformer can be used.
|
||||
@ -47,6 +53,8 @@ class NonlinearBeamformer
|
||||
void ProcessChunk(const ChannelBuffer<float>& input,
|
||||
ChannelBuffer<float>* output) override;
|
||||
|
||||
void AimAt(const SphericalPointf& target_direction) override;
|
||||
|
||||
bool IsInBeam(const SphericalPointf& spherical_point) override;
|
||||
|
||||
// After processing each block |is_target_present_| is set to true if the
|
||||
@ -65,23 +73,30 @@ class NonlinearBeamformer
|
||||
complex<float>* const* output) override;
|
||||
|
||||
private:
|
||||
#ifndef WEBRTC_AUDIO_PROCESSING_ONLY_BUILD
|
||||
FRIEND_TEST_ALL_PREFIXES(NonlinearBeamformerTest,
|
||||
InterfAnglesTakeAmbiguityIntoAccount);
|
||||
#endif
|
||||
|
||||
typedef Matrix<float> MatrixF;
|
||||
typedef ComplexMatrix<float> ComplexMatrixF;
|
||||
typedef complex<float> complex_f;
|
||||
|
||||
void InitLowFrequencyCorrectionRanges();
|
||||
void InitHighFrequencyCorrectionRanges();
|
||||
void InitInterfAngles();
|
||||
void InitDelaySumMasks();
|
||||
void InitTargetCovMats(); // TODO(aluebs): Make this depend on target angle.
|
||||
void InitTargetCovMats();
|
||||
void InitDiffuseCovMats();
|
||||
void InitInterfCovMats();
|
||||
void NormalizeCovMats();
|
||||
|
||||
// An implementation of equation 18, which calculates postfilter masks that,
|
||||
// when applied, minimize the mean-square error of our estimation of the
|
||||
// desired signal. A sub-task is to calculate lambda, which is solved via
|
||||
// equation 13.
|
||||
// Calculates postfilter masks that minimize the mean squared error of our
|
||||
// estimation of the desired signal.
|
||||
float CalculatePostfilterMask(const ComplexMatrixF& interf_cov_mat,
|
||||
float rpsiw,
|
||||
float ratio_rxiw_rxim,
|
||||
float rmxi_r,
|
||||
float mask_threshold);
|
||||
float rmxi_r);
|
||||
|
||||
// Prevents the postfilter masks from degenerating too quickly (a cause of
|
||||
// musical noise).
|
||||
@ -120,6 +135,11 @@ class NonlinearBeamformer
|
||||
int sample_rate_hz_;
|
||||
|
||||
const std::vector<Point> array_geometry_;
|
||||
// The normal direction of the array if it has one and it is in the xy-plane.
|
||||
const rtc::Maybe<Point> array_normal_;
|
||||
|
||||
// Minimum spacing between microphone pairs.
|
||||
const float min_mic_spacing_;
|
||||
|
||||
// Calculated based on user-input and constants in the .cc file.
|
||||
size_t low_mean_start_bin_;
|
||||
@ -134,28 +154,33 @@ class NonlinearBeamformer
|
||||
// Time and frequency smoothed mask.
|
||||
float final_mask_[kNumFreqBins];
|
||||
|
||||
float target_angle_radians_;
|
||||
// Angles of the interferer scenarios.
|
||||
std::vector<float> interf_angles_radians_;
|
||||
// The angle between the target and the interferer scenarios.
|
||||
const float away_radians_;
|
||||
|
||||
// Array of length |kNumFreqBins|, Matrix of size |1| x |num_channels_|.
|
||||
ComplexMatrixF delay_sum_masks_[kNumFreqBins];
|
||||
ComplexMatrixF normalized_delay_sum_masks_[kNumFreqBins];
|
||||
|
||||
// Array of length |kNumFreqBins|, Matrix of size |num_input_channels_| x
|
||||
// Arrays of length |kNumFreqBins|, Matrix of size |num_input_channels_| x
|
||||
// |num_input_channels_|.
|
||||
ComplexMatrixF target_cov_mats_[kNumFreqBins];
|
||||
|
||||
ComplexMatrixF uniform_cov_mat_[kNumFreqBins];
|
||||
// Array of length |kNumFreqBins|, Matrix of size |num_input_channels_| x
|
||||
// |num_input_channels_|.
|
||||
ComplexMatrixF interf_cov_mats_[kNumFreqBins];
|
||||
ComplexMatrixF reflected_interf_cov_mats_[kNumFreqBins];
|
||||
// |num_input_channels_|. ScopedVector has a size equal to the number of
|
||||
// interferer scenarios.
|
||||
ScopedVector<ComplexMatrixF> interf_cov_mats_[kNumFreqBins];
|
||||
|
||||
// Of length |kNumFreqBins|.
|
||||
float mask_thresholds_[kNumFreqBins];
|
||||
float wave_numbers_[kNumFreqBins];
|
||||
|
||||
// Preallocated for ProcessAudioBlock()
|
||||
// Of length |kNumFreqBins|.
|
||||
float rxiws_[kNumFreqBins];
|
||||
float rpsiws_[kNumFreqBins];
|
||||
float reflected_rpsiws_[kNumFreqBins];
|
||||
// The vector has a size equal to the number of interferer scenarios.
|
||||
std::vector<float> rpsiws_[kNumFreqBins];
|
||||
|
||||
// The microphone normalization factor.
|
||||
ComplexMatrixF eig_m_;
|
||||
|
@ -18,7 +18,7 @@ extern "C" {
|
||||
}
|
||||
#include "webrtc/modules/audio_processing/aec/include/echo_cancellation.h"
|
||||
#include "webrtc/modules/audio_processing/audio_buffer.h"
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
#include "webrtc/modules/audio_processing/aecm/include/echo_control_mobile.h"
|
||||
#include "webrtc/modules/audio_processing/audio_buffer.h"
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/interface/logging.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/logging.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include "webrtc/modules/audio_processing/audio_buffer.h"
|
||||
#include "webrtc/modules/audio_processing/agc/legacy/gain_control.h"
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
|
||||
#include "webrtc/modules/audio_processing/audio_buffer.h"
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
|
||||
|
@ -11,6 +11,10 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_
|
||||
#define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_
|
||||
|
||||
// MSVC++ requires this to be set before any other includes to get M_PI.
|
||||
#define _USE_MATH_DEFINES
|
||||
|
||||
#include <math.h>
|
||||
#include <stddef.h> // size_t
|
||||
#include <stdio.h> // FILE
|
||||
#include <vector>
|
||||
@ -109,12 +113,23 @@ struct ExperimentalNs {
|
||||
struct Beamforming {
|
||||
Beamforming()
|
||||
: enabled(false),
|
||||
array_geometry() {}
|
||||
array_geometry(),
|
||||
target_direction(
|
||||
SphericalPointf(static_cast<float>(M_PI) / 2.f, 0.f, 1.f)) {}
|
||||
Beamforming(bool enabled, const std::vector<Point>& array_geometry)
|
||||
: Beamforming(enabled,
|
||||
array_geometry,
|
||||
SphericalPointf(static_cast<float>(M_PI) / 2.f, 0.f, 1.f)) {
|
||||
}
|
||||
Beamforming(bool enabled,
|
||||
const std::vector<Point>& array_geometry,
|
||||
SphericalPointf target_direction)
|
||||
: enabled(enabled),
|
||||
array_geometry(array_geometry) {}
|
||||
array_geometry(array_geometry),
|
||||
target_direction(target_direction) {}
|
||||
const bool enabled;
|
||||
const std::vector<Point> array_geometry;
|
||||
const SphericalPointf target_direction;
|
||||
};
|
||||
|
||||
// Use to enable intelligibility enhancer in audio processing. Must be provided
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "webrtc/modules/audio_processing/audio_buffer.h"
|
||||
#include "webrtc/modules/audio_processing/include/audio_processing.h"
|
||||
#include "webrtc/modules/audio_processing/rms_level.h"
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#elif defined(WEBRTC_NS_FIXED)
|
||||
#include "webrtc/modules/audio_processing/ns/include/noise_suppression_x.h"
|
||||
#endif
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "webrtc/common_audio/signal_processing/include/real_fft.h"
|
||||
#include "webrtc/modules/audio_processing/ns/nsx_core.h"
|
||||
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
|
||||
|
||||
#if (defined WEBRTC_DETECT_NEON || defined WEBRTC_HAS_NEON)
|
||||
/* Tables are defined in ARM assembly files. */
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/modules/audio_processing/three_band_filter_bank.h"
|
||||
#include "webrtc/system_wrappers/interface/scoped_vector.h"
|
||||
#include "webrtc/system_wrappers/include/scoped_vector.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/common_audio/sparse_fir_filter.h"
|
||||
#include "webrtc/system_wrappers/interface/scoped_vector.h"
|
||||
#include "webrtc/system_wrappers/include/scoped_vector.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "webrtc/modules/audio_processing/transient/transient_detector.h"
|
||||
#include "webrtc/modules/audio_processing/transient/file_utils.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/system_wrappers/interface/file_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/file_wrapper.h"
|
||||
|
||||
using rtc::scoped_ptr;
|
||||
using webrtc::FileWrapper;
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "webrtc/modules/audio_processing/transient/file_utils.h"
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/system_wrappers/interface/file_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/file_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "webrtc/system_wrappers/interface/file_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/file_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "webrtc/modules/audio_processing/transient/common.h"
|
||||
#include "webrtc/modules/audio_processing/transient/transient_detector.h"
|
||||
#include "webrtc/modules/audio_processing/ns/windows_private.h"
|
||||
#include "webrtc/system_wrappers/interface/logging.h"
|
||||
#include "webrtc/system_wrappers/include/logging.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
#include "webrtc/modules/audio_processing/utility/delay_estimator.h"
|
||||
#include "webrtc/modules/audio_processing/utility/delay_estimator_internal.h"
|
||||
#include "webrtc/system_wrappers/interface/compile_assert_c.h"
|
||||
#include "webrtc/system_wrappers/include/compile_assert_c.h"
|
||||
|
||||
// Only bit |kBandFirst| through bit |kBandLast| are processed and
|
||||
// |kBandFirst| - |kBandLast| must be < 32.
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include "webrtc/common_audio/vad/include/webrtc_vad.h"
|
||||
#include "webrtc/modules/audio_processing/audio_buffer.h"
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -41,7 +41,7 @@ const uint8_t kNoTemporalIdx = 0xFF;
|
||||
const uint8_t kNoSpatialIdx = 0xFF;
|
||||
const uint8_t kNoGofIdx = 0xFF;
|
||||
const size_t kMaxVp9RefPics = 3;
|
||||
const size_t kMaxVp9FramesInGof = 16;
|
||||
const size_t kMaxVp9FramesInGof = 0xFF; // 8 bits
|
||||
const size_t kMaxVp9NumberOfSpatialLayers = 8;
|
||||
const int kNoKeyIdx = -1;
|
||||
|
||||
|
@ -11,39 +11,38 @@ import("../build/webrtc.gni")
|
||||
|
||||
static_library("system_wrappers") {
|
||||
sources = [
|
||||
"interface/aligned_array.h",
|
||||
"interface/aligned_malloc.h",
|
||||
"interface/atomic32.h",
|
||||
"interface/clock.h",
|
||||
"interface/condition_variable_wrapper.h",
|
||||
"interface/cpu_features_wrapper.h",
|
||||
"interface/cpu_info.h",
|
||||
"interface/critical_section_wrapper.h",
|
||||
"interface/data_log.h",
|
||||
"interface/data_log_c.h",
|
||||
"interface/data_log_impl.h",
|
||||
"interface/event_tracer.h",
|
||||
"interface/event_wrapper.h",
|
||||
"interface/field_trial.h",
|
||||
"interface/file_wrapper.h",
|
||||
"interface/fix_interlocked_exchange_pointer_win.h",
|
||||
"interface/logging.h",
|
||||
"interface/metrics.h",
|
||||
"interface/ref_count.h",
|
||||
"interface/rtp_to_ntp.h",
|
||||
"interface/rw_lock_wrapper.h",
|
||||
"interface/scoped_vector.h",
|
||||
"interface/sleep.h",
|
||||
"interface/sort.h",
|
||||
"interface/static_instance.h",
|
||||
"interface/stl_util.h",
|
||||
"interface/stringize_macros.h",
|
||||
"interface/thread_wrapper.h",
|
||||
"interface/tick_util.h",
|
||||
"interface/timestamp_extrapolator.h",
|
||||
"interface/trace.h",
|
||||
"interface/trace_event.h",
|
||||
"interface/utf_util_win.h",
|
||||
"include/aligned_array.h",
|
||||
"include/aligned_malloc.h",
|
||||
"include/atomic32.h",
|
||||
"include/clock.h",
|
||||
"include/condition_variable_wrapper.h",
|
||||
"include/cpu_features_wrapper.h",
|
||||
"include/cpu_info.h",
|
||||
"include/critical_section_wrapper.h",
|
||||
"include/data_log.h",
|
||||
"include/data_log_c.h",
|
||||
"include/data_log_impl.h",
|
||||
"include/event_tracer.h",
|
||||
"include/event_wrapper.h",
|
||||
"include/field_trial.h",
|
||||
"include/file_wrapper.h",
|
||||
"include/fix_interlocked_exchange_pointer_win.h",
|
||||
"include/logging.h",
|
||||
"include/metrics.h",
|
||||
"include/ref_count.h",
|
||||
"include/rtp_to_ntp.h",
|
||||
"include/rw_lock_wrapper.h",
|
||||
"include/scoped_vector.h",
|
||||
"include/sleep.h",
|
||||
"include/sort.h",
|
||||
"include/static_instance.h",
|
||||
"include/stl_util.h",
|
||||
"include/stringize_macros.h",
|
||||
"include/thread_wrapper.h",
|
||||
"include/tick_util.h",
|
||||
"include/timestamp_extrapolator.h",
|
||||
"include/trace.h",
|
||||
"include/utf_util_win.h",
|
||||
"source/aligned_malloc.cc",
|
||||
"source/atomic32_mac.cc",
|
||||
"source/atomic32_win.cc",
|
||||
@ -115,7 +114,7 @@ static_library("system_wrappers") {
|
||||
|
||||
if (is_android) {
|
||||
sources += [
|
||||
"interface/logcat_trace_context.h",
|
||||
"include/logcat_trace_context.h",
|
||||
"source/logcat_trace_context.cc",
|
||||
]
|
||||
|
||||
@ -174,7 +173,7 @@ static_library("system_wrappers") {
|
||||
|
||||
source_set("field_trial_default") {
|
||||
sources = [
|
||||
"interface/field_trial_default.h",
|
||||
"include/field_trial_default.h",
|
||||
"source/field_trial_default.cc",
|
||||
]
|
||||
|
||||
|
@ -1,23 +1,23 @@
|
||||
noinst_LTLIBRARIES = libsystem_wrappers.la
|
||||
|
||||
noinst_HEADERS = interface/aligned_array.h \
|
||||
interface/asm_defines.h \
|
||||
interface/compile_assert_c.h \
|
||||
interface/event_wrapper.h \
|
||||
interface/scoped_vector.h \
|
||||
interface/static_instance.h \
|
||||
interface/stl_util.h
|
||||
noinst_HEADERS = include/aligned_array.h \
|
||||
include/asm_defines.h \
|
||||
include/compile_assert_c.h \
|
||||
include/event_wrapper.h \
|
||||
include/scoped_vector.h \
|
||||
include/static_instance.h \
|
||||
include/stl_util.h
|
||||
|
||||
libsystem_wrappers_la_SOURCES = interface/aligned_malloc.h \
|
||||
interface/cpu_features_wrapper.h \
|
||||
interface/critical_section_wrapper.h \
|
||||
interface/file_wrapper.h \
|
||||
interface/logging.h \
|
||||
interface/metrics.h \
|
||||
interface/rw_lock_wrapper.h \
|
||||
interface/sleep.h \
|
||||
interface/thread_wrapper.h \
|
||||
interface/trace.h \
|
||||
libsystem_wrappers_la_SOURCES = include/aligned_malloc.h \
|
||||
include/cpu_features_wrapper.h \
|
||||
include/critical_section_wrapper.h \
|
||||
include/file_wrapper.h \
|
||||
include/logging.h \
|
||||
include/metrics.h \
|
||||
include/rw_lock_wrapper.h \
|
||||
include/sleep.h \
|
||||
include/thread_wrapper.h \
|
||||
include/trace.h \
|
||||
source/aligned_malloc.cc \
|
||||
source/cpu_features.cc \
|
||||
source/event.cc \
|
||||
|
@ -8,11 +8,11 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ALIGNED_ARRAY_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ALIGNED_ARRAY_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ALIGNED_ARRAY_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ALIGNED_ARRAY_
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/system_wrappers/interface/aligned_malloc.h"
|
||||
#include "webrtc/system_wrappers/include/aligned_malloc.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -85,4 +85,4 @@ template<typename T> class AlignedArray {
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ALIGNED_ARRAY_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ALIGNED_ARRAY_
|
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ALIGNED_MALLOC_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ALIGNED_MALLOC_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ALIGNED_MALLOC_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ALIGNED_MALLOC_H_
|
||||
|
||||
// The functions declared here
|
||||
// 1) Allocates block of aligned memory.
|
||||
@ -56,4 +56,4 @@ struct AlignedFreeDeleter {
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ALIGNED_MALLOC_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ALIGNED_MALLOC_H_
|
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ASM_DEFINES_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ASM_DEFINES_H_
|
||||
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
@ -63,4 +63,4 @@ strheq \reg1, \reg2, \num
|
||||
|
||||
.text
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ASM_DEFINES_H_
|
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_COMPILE_ASSERT_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_COMPILE_ASSERT_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
#error "Only use this for C files. For C++, use static_assert."
|
||||
@ -21,4 +21,4 @@
|
||||
// COMPILE_ASSERT(sizeof(foo) < 128);
|
||||
#define COMPILE_ASSERT(expression) switch (0) {case 0: case expression:;}
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_COMPILE_ASSERT_H_
|
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CPU_FEATURES_WRAPPER_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CPU_FEATURES_WRAPPER_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CPU_FEATURES_WRAPPER_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CPU_FEATURES_WRAPPER_H_
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
extern "C" {
|
||||
@ -48,4 +48,4 @@ extern uint64_t WebRtc_GetCPUFeaturesARM(void);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CPU_FEATURES_WRAPPER_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CPU_FEATURES_WRAPPER_H_
|
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CRITICAL_SECTION_WRAPPER_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CRITICAL_SECTION_WRAPPER_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CRITICAL_SECTION_WRAPPER_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CRITICAL_SECTION_WRAPPER_H_
|
||||
|
||||
// If the critical section is heavily contended it may be beneficial to use
|
||||
// read/write locks instead.
|
||||
@ -51,4 +51,4 @@ class SCOPED_LOCKABLE CriticalSectionScoped {
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CRITICAL_SECTION_WRAPPER_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CRITICAL_SECTION_WRAPPER_H_
|
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_EVENT_WRAPPER_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_EVENT_WRAPPER_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_EVENT_WRAPPER_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_EVENT_WRAPPER_H_
|
||||
|
||||
namespace webrtc {
|
||||
enum EventTypeWrapper {
|
||||
@ -67,4 +67,4 @@ class EventTimerWrapper : public EventWrapper {
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_EVENT_WRAPPER_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_EVENT_WRAPPER_H_
|
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_FILE_WRAPPER_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_FILE_WRAPPER_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_FILE_WRAPPER_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_FILE_WRAPPER_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
@ -75,4 +75,4 @@ class FileWrapper : public InStream, public OutStream {
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_FILE_WRAPPER_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_FILE_WRAPPER_H_
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2013 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.
|
||||
*/
|
||||
|
||||
// Various inline functions and macros to fix compilation of 32 bit target
|
||||
// on MSVC with /Wp64 flag enabled.
|
||||
|
||||
// The original code can be found here:
|
||||
// http://src.chromium.org/svn/trunk/src/base/fix_wp64.h
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_FIX_INTERLOCKED_EXCHANGE_POINTER_WINDOWS_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_FIX_INTERLOCKED_EXCHANGE_POINTER_WINDOWS_H_
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// Platform SDK fixes when building with /Wp64 for a 32 bits target.
|
||||
#if !defined(_WIN64) && defined(_Wp64)
|
||||
|
||||
#ifdef InterlockedExchangePointer
|
||||
#undef InterlockedExchangePointer
|
||||
// The problem is that the macro provided for InterlockedExchangePointer() is
|
||||
// doing a (LONG) C-style cast that triggers invariably the warning C4312 when
|
||||
// building on 32 bits.
|
||||
inline void* InterlockedExchangePointer(void* volatile* target, void* value) {
|
||||
return reinterpret_cast<void*>(static_cast<LONG_PTR>(InterlockedExchange(
|
||||
reinterpret_cast<volatile LONG*>(target),
|
||||
static_cast<LONG>(reinterpret_cast<LONG_PTR>(value)))));
|
||||
}
|
||||
#endif // #ifdef InterlockedExchangePointer
|
||||
|
||||
#endif // #if !defined(_WIN64) && defined(_Wp64)
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_FIX_INTERLOCKED_EXCHANGE_POINTER_WINDOWS_H_
|
@ -48,8 +48,8 @@
|
||||
// LOG_FERR1(LS_WARNING, Foo, bar);
|
||||
// }
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_LOGGING_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_LOGGING_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_LOGGING_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_LOGGING_H_
|
||||
|
||||
#include <sstream>
|
||||
|
||||
@ -131,7 +131,7 @@ class LogMessageVoidify {
|
||||
webrtc::LogMessage(__FILE__, __LINE__, sev).stream()
|
||||
|
||||
// The _F version prefixes the message with the current function name.
|
||||
#if (defined(__GNUC__) && defined(_DEBUG)) || defined(WANT_PRETTY_LOG_F)
|
||||
#if (defined(__GNUC__) && !defined(NDEBUG)) || defined(WANT_PRETTY_LOG_F)
|
||||
#define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": "
|
||||
#else
|
||||
#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": "
|
||||
@ -158,4 +158,4 @@ class LogMessageVoidify {
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_LOGGING_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_LOGGING_H_
|
@ -8,8 +8,8 @@
|
||||
// be found in the AUTHORS file in the root of the source tree.
|
||||
//
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_METRICS_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_METRICS_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_METRICS_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_METRICS_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -72,6 +72,9 @@
|
||||
#define RTC_HISTOGRAM_COUNTS_100(name, sample) RTC_HISTOGRAM_COUNTS( \
|
||||
name, sample, 1, 100, 50)
|
||||
|
||||
#define RTC_HISTOGRAM_COUNTS_200(name, sample) RTC_HISTOGRAM_COUNTS( \
|
||||
name, sample, 1, 200, 50)
|
||||
|
||||
#define RTC_HISTOGRAM_COUNTS_1000(name, sample) RTC_HISTOGRAM_COUNTS( \
|
||||
name, sample, 1, 1000, 50)
|
||||
|
||||
@ -132,5 +135,5 @@ void HistogramAdd(
|
||||
} // namespace metrics
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_METRICS_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_METRICS_H_
|
||||
|
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_RW_LOCK_WRAPPER_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_RW_LOCK_WRAPPER_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_RW_LOCK_WRAPPER_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_RW_LOCK_WRAPPER_H_
|
||||
|
||||
#include "webrtc/base/thread_annotations.h"
|
||||
|
||||
@ -65,4 +65,4 @@ class SCOPED_LOCKABLE WriteLockScoped {
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_RW_LOCK_WRAPPER_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_RW_LOCK_WRAPPER_H_
|
@ -10,13 +10,13 @@
|
||||
|
||||
// Borrowed from Chromium's src/base/memory/scoped_vector.h.
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_VECTOR_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_VECTOR_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_SCOPED_VECTOR_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_SCOPED_VECTOR_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/system_wrappers/interface/stl_util.h"
|
||||
#include "webrtc/system_wrappers/include/stl_util.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -154,4 +154,4 @@ class ScopedVector {
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_VECTOR_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_SCOPED_VECTOR_H_
|
@ -9,8 +9,8 @@
|
||||
*/
|
||||
// An OS-independent sleep function.
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SLEEP_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SLEEP_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_SLEEP_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_SLEEP_H_
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -21,4 +21,4 @@ void SleepMs(int msecs);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SLEEP_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_SLEEP_H_
|
@ -8,14 +8,14 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STATIC_INSTANCE_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STATIC_INSTANCE_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STATIC_INSTANCE_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STATIC_INSTANCE_H_
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
#ifdef _WIN32
|
||||
#include "webrtc/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h"
|
||||
#include "webrtc/system_wrappers/include/fix_interlocked_exchange_pointer_win.h"
|
||||
#endif
|
||||
|
||||
namespace webrtc {
|
||||
@ -150,4 +150,4 @@ static T* GetStaticInstance(CountOperation count_operation) {
|
||||
|
||||
} // namspace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STATIC_INSTANCE_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STATIC_INSTANCE_H_
|
@ -10,8 +10,8 @@
|
||||
|
||||
// Borrowed from Chromium's src/base/stl_util.h.
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STL_UTIL_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STL_UTIL_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STL_UTIL_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STL_UTIL_H_
|
||||
|
||||
#include <assert.h>
|
||||
#include <algorithm>
|
||||
@ -262,4 +262,4 @@ bool STLIncludes(const Arg1& a1, const Arg2& a2) {
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STL_UTIL_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_STL_UTIL_H_
|
@ -13,8 +13,8 @@
|
||||
// Note: The callback function is expected to return every 2 seconds or more
|
||||
// often.
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_THREAD_WRAPPER_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_THREAD_WRAPPER_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_THREAD_WRAPPER_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_THREAD_WRAPPER_H_
|
||||
|
||||
#if defined(WEBRTC_WIN)
|
||||
#include <windows.h>
|
||||
@ -92,4 +92,4 @@ class ThreadWrapper {
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_THREAD_WRAPPER_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_THREAD_WRAPPER_H_
|
@ -13,8 +13,8 @@
|
||||
* messages. Apply filtering to avoid that.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TRACE_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TRACE_H_
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_TRACE_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_TRACE_H_
|
||||
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
@ -89,4 +89,4 @@ class Trace {
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TRACE_H_
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_TRACE_H_
|
@ -8,7 +8,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/system_wrappers/interface/aligned_malloc.h"
|
||||
#include "webrtc/system_wrappers/include/aligned_malloc.h"
|
||||
|
||||
#include <memory.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// Parts of this file derived from Chromium's base/cpu.cc.
|
||||
|
||||
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
|
||||
|
||||
#if defined(WEBRTC_ARCH_X86_FAMILY) && defined(_MSC_VER)
|
||||
#include <intrin.h>
|
||||
|
@ -11,7 +11,7 @@
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_CRITICAL_SECTION_POSIX_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_CRITICAL_SECTION_POSIX_H_
|
||||
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_CRITICAL_SECTION_WIN_H_
|
||||
|
||||
#include <windows.h>
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -8,7 +8,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/system_wrappers/interface/event_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/event_wrapper.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
|
@ -11,12 +11,12 @@
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_EVENT_POSIX_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_EVENT_POSIX_H_
|
||||
|
||||
#include "webrtc/system_wrappers/interface/event_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/event_wrapper.h"
|
||||
|
||||
#include <pthread.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "webrtc/system_wrappers/interface/thread_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/thread_wrapper.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "webrtc/system_wrappers/interface/event_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/event_wrapper.h"
|
||||
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#endif
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/rw_lock_wrapper.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/system_wrappers/interface/file_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/file_wrapper.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -8,14 +8,14 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/system_wrappers/interface/logging.h"
|
||||
#include "webrtc/system_wrappers/include/logging.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/system_wrappers/interface/trace.h"
|
||||
#include "webrtc/system_wrappers/include/trace.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
|
@ -7,7 +7,7 @@
|
||||
// be found in the AUTHORS file in the root of the source tree.
|
||||
//
|
||||
|
||||
#include "webrtc/system_wrappers/interface/metrics.h"
|
||||
#include "webrtc/system_wrappers/include/metrics.h"
|
||||
|
||||
// Default implementation of histogram methods for WebRTC clients that do not
|
||||
// want to provide their own implementation.
|
||||
|
@ -8,7 +8,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/rw_lock_wrapper.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
#include "webrtc/system_wrappers/source/rw_lock_generic.h"
|
||||
|
||||
#include "webrtc/system_wrappers/interface/condition_variable_wrapper.h"
|
||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/condition_variable_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_GENERIC_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_GENERIC_H_
|
||||
|
||||
#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/rw_lock_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -11,7 +11,7 @@
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_POSIX_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_POSIX_H_
|
||||
|
||||
#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/rw_lock_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
#include <pthread.h>
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "webrtc/system_wrappers/source/rw_lock_win.h"
|
||||
|
||||
#include "webrtc/system_wrappers/interface/trace.h"
|
||||
#include "webrtc/system_wrappers/include/trace.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_WIN_H_
|
||||
#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_WIN_H_
|
||||
|
||||
#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/rw_lock_wrapper.h"
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user