OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 // Sets the mode of the background noise playout for cases when there is long | 73 // Sets the mode of the background noise playout for cases when there is long |
74 // duration of packet loss. | 74 // duration of packet loss. |
75 void set_mode(NetEq::BackgroundNoiseMode mode) { mode_ = mode; } | 75 void set_mode(NetEq::BackgroundNoiseMode mode) { mode_ = mode; } |
76 | 76 |
77 private: | 77 private: |
78 static const int kThresholdIncrement = 229; // 0.0035 in Q16. | 78 static const int kThresholdIncrement = 229; // 0.0035 in Q16. |
79 static const int kVecLen = 256; | 79 static const int kVecLen = 256; |
80 static const int kLogVecLen = 8; // log2(kVecLen). | 80 static const int kLogVecLen = 8; // log2(kVecLen). |
81 static const int kResidualLength = 64; | 81 static const int kResidualLength = 64; |
82 static const int kLogResidualLength = 6; // log2(kResidualLength) | 82 static const int16_t kLogResidualLength = 6; // log2(kResidualLength) |
83 | 83 |
84 struct ChannelParameters { | 84 struct ChannelParameters { |
85 // Constructor. | 85 // Constructor. |
86 ChannelParameters() { | 86 ChannelParameters() { |
87 Reset(); | 87 Reset(); |
88 } | 88 } |
89 | 89 |
90 void Reset() { | 90 void Reset() { |
91 energy = 2500; | 91 energy = 2500; |
92 max_energy = 0; | 92 max_energy = 0; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 size_t num_channels_; | 128 size_t num_channels_; |
129 rtc::scoped_ptr<ChannelParameters[]> channel_parameters_; | 129 rtc::scoped_ptr<ChannelParameters[]> channel_parameters_; |
130 bool initialized_; | 130 bool initialized_; |
131 NetEq::BackgroundNoiseMode mode_; | 131 NetEq::BackgroundNoiseMode mode_; |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(BackgroundNoise); | 133 DISALLOW_COPY_AND_ASSIGN(BackgroundNoise); |
134 }; | 134 }; |
135 | 135 |
136 } // namespace webrtc | 136 } // namespace webrtc |
137 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_BACKGROUND_NOISE_H_ | 137 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_BACKGROUND_NOISE_H_ |
OLD | NEW |