2012-04-18 09:42:16 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2012 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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// Header file including the delay estimator handle used for testing.
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_AUDIO_PROCESSING_UTILITY_DELAY_ESTIMATOR_INTERNAL_H_
|
|
|
|
|
#define MODULES_AUDIO_PROCESSING_UTILITY_DELAY_ESTIMATOR_INTERNAL_H_
|
2012-04-18 09:42:16 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_processing/utility/delay_estimator.h"
|
2012-04-18 09:42:16 +00:00
|
|
|
|
2020-03-20 16:43:34 +01:00
|
|
|
namespace webrtc {
|
|
|
|
|
|
2012-04-18 09:42:16 +00:00
|
|
|
typedef union {
|
|
|
|
|
float float_;
|
|
|
|
|
int32_t int32_;
|
|
|
|
|
} SpectrumType;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
// Pointers to mean values of spectrum.
|
|
|
|
|
SpectrumType* mean_far_spectrum;
|
2013-01-30 16:16:59 +00:00
|
|
|
// |mean_far_spectrum| initialization indicator.
|
Revert 3428
> Delay estimator wrapper API changes. This should finalize the changes to delay estimator making it work for multi-probe.
>
> The changes are summarized here:
>
> delay_estimator.*
> -----------------
> Replaced assert() with correct error check. This is consistent with previous versions of the delay_estimator, i.e., to check for valid parameters where they are actually used and not high up in a wrapper layer.
>
> delay_estimator_internal.h
> --------------------------
> Pulled out the far-end part of DelayEstimator struct and put it in DelayEstimatorFarend. The only common parameter is spectrum_size, which we store in both and thereby avoiding having a Farend pointer in DelayEstimator.
>
> delay_estimator_wrapper.*
> -------------------------
> Added and updated descriptions. From Free(), Create(), Init() the far-end parts have been put in separate Farend versions. Same goes for the Process() which now has an AddFarSpectrum() version.
> The flow of calls should be something like (in pseudo-code)
>
> far* = CreateFarend(history_size)
> near* = Create(far, lookahead)
> InitFarend(far)
> Init(near)
> while call ongoing
> AddFarSpectrum(far, far_spectrum)
> Process(near, near_spectrum)
> end while
> Free(near)
> FreeFarend(far)
>
> delay_estimator_unittest.cc
> ---------------------------
> Added farend support setting up calls as mentioned above.
>
> aecm_core.*
> -----------
> Cleaned up some lint warnings.
> Added delay_estimator_farend pointer. Called Create(), Init() and Free() in above mentioned order.
> If AddFarSpectrumFix() was not successfully done, we end and return -1. This is what we would have done for Process().
>
> aec_core.*
> ----------
> Cleaned up some lint warnings.
> Added delay_estimator_farend pointer. Calls in proper order. Since we only use the delay estimator for logging there is no error handling. We only call Process() if AddFarSpectrum() was successful though.
>
> TEST=audioproc_unittest, trybots
> BUG=None
>
> Review URL: https://webrtc-codereview.appspot.com/1076006
TBR=bjornv@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/1062008
git-svn-id: http://webrtc.googlecode.com/svn/trunk@3429 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-29 21:30:26 +00:00
|
|
|
int far_spectrum_initialized;
|
2013-01-30 16:16:59 +00:00
|
|
|
|
|
|
|
|
int spectrum_size;
|
|
|
|
|
|
|
|
|
|
// Far-end part of binary spectrum based delay estimation.
|
|
|
|
|
BinaryDelayEstimatorFarend* binary_farend;
|
|
|
|
|
} DelayEstimatorFarend;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
// Pointers to mean values of spectrum.
|
|
|
|
|
SpectrumType* mean_near_spectrum;
|
|
|
|
|
// |mean_near_spectrum| initialization indicator.
|
2012-04-18 09:42:16 +00:00
|
|
|
int near_spectrum_initialized;
|
|
|
|
|
|
|
|
|
|
int spectrum_size;
|
|
|
|
|
|
|
|
|
|
// Binary spectrum based delay estimator
|
|
|
|
|
BinaryDelayEstimator* binary_handle;
|
|
|
|
|
} DelayEstimator;
|
|
|
|
|
|
2020-03-20 16:43:34 +01:00
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_AUDIO_PROCESSING_UTILITY_DELAY_ESTIMATOR_INTERNAL_H_
|