• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_ECHO_CANCELLATION_INTERNAL_H_
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_ECHO_CANCELLATION_INTERNAL_H_
13 
14 #include "webrtc/modules/audio_processing/aec/aec_core.h"
15 #include "webrtc/modules/audio_processing/utility/ring_buffer.h"
16 
17 typedef struct {
18   int delayCtr;
19   int sampFreq;
20   int splitSampFreq;
21   int scSampFreq;
22   float sampFactor;  // scSampRate / sampFreq
23   short skewMode;
24   int bufSizeStart;
25   int knownDelay;
26   int rate_factor;
27 
28   short initFlag;  // indicates if AEC has been initialized
29 
30   // Variables used for averaging far end buffer size
31   short counter;
32   int sum;
33   short firstVal;
34   short checkBufSizeCtr;
35 
36   // Variables used for delay shifts
37   short msInSndCardBuf;
38   short filtDelay;  // Filtered delay estimate.
39   int timeForDelayChange;
40   int startup_phase;
41   int checkBuffSize;
42   short lastDelayDiff;
43 
44 #ifdef WEBRTC_AEC_DEBUG_DUMP
45   RingBuffer* far_pre_buf_s16;  // Time domain far-end pre-buffer in int16_t.
46   FILE* bufFile;
47   FILE* delayFile;
48   FILE* skewFile;
49 #endif
50 
51   // Structures
52   void* resampler;
53 
54   int skewFrCtr;
55   int resample;  // if the skew is small enough we don't resample
56   int highSkewCtr;
57   float skew;
58 
59   RingBuffer* far_pre_buf;  // Time domain far-end pre-buffer.
60 
61   int lastError;
62 
63   int farend_started;
64 
65   AecCore* aec;
66 } aecpc_t;
67 
68 #endif  // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_ECHO_CANCELLATION_INTERNAL_H_
69