echo_cancellation_internal.h revision 9ae1354e250bebaba295048e1cb47a74d33bf8e0
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
17typedef struct {
18  int delayCtr;
19  int sampFreq;
20  int splitSampFreq;
21  int scSampFreq;
22  float sampFactor;  // scSampRate / sampFreq
23  short autoOnOff;
24  short activity;
25  short skewMode;
26  int bufSizeStart;
27  int knownDelay;
28  int rate_factor;
29
30  short initFlag;  // indicates if AEC has been initialized
31
32  // Variables used for averaging far end buffer size
33  short counter;
34  int sum;
35  short firstVal;
36  short checkBufSizeCtr;
37
38  // Variables used for delay shifts
39  short msInSndCardBuf;
40  short filtDelay;  // Filtered delay estimate.
41  int timeForDelayChange;
42  int ECstartup;
43  int checkBuffSize;
44  short lastDelayDiff;
45
46#ifdef WEBRTC_AEC_DEBUG_DUMP
47  RingBuffer* far_pre_buf_s16;  // Time domain far-end pre-buffer in int16_t.
48  FILE* bufFile;
49  FILE* delayFile;
50  FILE* skewFile;
51#endif
52
53  // Structures
54  void* resampler;
55
56  int skewFrCtr;
57  int resample;  // if the skew is small enough we don't resample
58  int highSkewCtr;
59  float skew;
60
61  RingBuffer* far_pre_buf;  // Time domain far-end pre-buffer.
62
63  int lastError;
64
65  AecCore* aec;
66} aecpc_t;
67
68#endif  // WEBRTC_MODULES_AUDIO_PROCESSING_AEC_ECHO_CANCELLATION_INTERNAL_H_
69