Update to current webrtc library
This is from the upstream library commit id 3326535126e435f1ba647885ce43a8f0f3d317eb, corresponding to Chromium 88.0.4290.1.
This commit is contained in:
@ -8,16 +8,18 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_VAD_VAD_AUDIO_PROC_H_
|
||||
#define WEBRTC_MODULES_AUDIO_PROCESSING_VAD_VAD_AUDIO_PROC_H_
|
||||
#ifndef MODULES_AUDIO_PROCESSING_VAD_VAD_AUDIO_PROC_H_
|
||||
#define MODULES_AUDIO_PROCESSING_VAD_VAD_AUDIO_PROC_H_
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/modules/audio_processing/vad/common.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "modules/audio_processing/vad/common.h" // AudioFeatures, kSampleR...
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class AudioFrame;
|
||||
class PoleZeroFilter;
|
||||
|
||||
class VadAudioProc {
|
||||
@ -49,25 +51,28 @@ class VadAudioProc {
|
||||
// For every 30 ms we compute 3 spectral peak there for 3 LPC analysis.
|
||||
// LPC is computed over 15 ms of windowed audio. For every 10 ms sub-frame
|
||||
// we need 5 ms of past signal to create the input of LPC analysis.
|
||||
static const size_t kNumPastSignalSamples =
|
||||
static_cast<size_t>(kSampleRateHz / 200);
|
||||
enum : size_t {
|
||||
kNumPastSignalSamples = static_cast<size_t>(kSampleRateHz / 200)
|
||||
};
|
||||
|
||||
// TODO(turajs): maybe defining this at a higher level (maybe enum) so that
|
||||
// all the code recognize it as "no-error."
|
||||
static const int kNoError = 0;
|
||||
enum : int { kNoError = 0 };
|
||||
|
||||
static const size_t kNum10msSubframes = 3;
|
||||
static const size_t kNumSubframeSamples =
|
||||
static_cast<size_t>(kSampleRateHz / 100);
|
||||
static const size_t kNumSamplesToProcess =
|
||||
kNum10msSubframes *
|
||||
kNumSubframeSamples; // Samples in 30 ms @ given sampling rate.
|
||||
static const size_t kBufferLength =
|
||||
kNumPastSignalSamples + kNumSamplesToProcess;
|
||||
static const size_t kIpLength = kDftSize >> 1;
|
||||
static const size_t kWLength = kDftSize >> 1;
|
||||
|
||||
static const size_t kLpcOrder = 16;
|
||||
enum : size_t { kNum10msSubframes = 3 };
|
||||
enum : size_t {
|
||||
kNumSubframeSamples = static_cast<size_t>(kSampleRateHz / 100)
|
||||
};
|
||||
enum : size_t {
|
||||
// Samples in 30 ms @ given sampling rate.
|
||||
kNumSamplesToProcess = kNum10msSubframes * kNumSubframeSamples
|
||||
};
|
||||
enum : size_t {
|
||||
kBufferLength = kNumPastSignalSamples + kNumSamplesToProcess
|
||||
};
|
||||
enum : size_t { kIpLength = kDftSize >> 1 };
|
||||
enum : size_t { kWLength = kDftSize >> 1 };
|
||||
enum : size_t { kLpcOrder = 16 };
|
||||
|
||||
size_t ip_[kIpLength];
|
||||
float w_fft_[kWLength];
|
||||
@ -79,11 +84,11 @@ class VadAudioProc {
|
||||
double log_old_gain_;
|
||||
double old_lag_;
|
||||
|
||||
rtc::scoped_ptr<PitchAnalysisStruct> pitch_analysis_handle_;
|
||||
rtc::scoped_ptr<PreFiltBankstr> pre_filter_handle_;
|
||||
rtc::scoped_ptr<PoleZeroFilter> high_pass_filter_;
|
||||
std::unique_ptr<PitchAnalysisStruct> pitch_analysis_handle_;
|
||||
std::unique_ptr<PreFiltBankstr> pre_filter_handle_;
|
||||
std::unique_ptr<PoleZeroFilter> high_pass_filter_;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_VAD_VAD_AUDIO_PROC_H_
|
||||
#endif // MODULES_AUDIO_PROCESSING_VAD_VAD_AUDIO_PROC_H_
|
||||
|
Reference in New Issue
Block a user