OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 13 matching lines...) Loading... | |
24 #define ALIGN16_END __attribute__((aligned(16))) | 24 #define ALIGN16_END __attribute__((aligned(16))) |
25 #endif | 25 #endif |
26 | 26 |
27 enum class Aec3Optimization { kNone, kSse2 }; | 27 enum class Aec3Optimization { kNone, kSse2 }; |
28 | 28 |
29 constexpr int kMetricsReportingIntervalBlocks = 10 * 250; | 29 constexpr int kMetricsReportingIntervalBlocks = 10 * 250; |
30 constexpr int kMetricsComputationBlocks = 9; | 30 constexpr int kMetricsComputationBlocks = 9; |
31 constexpr int kMetricsCollectionBlocks = | 31 constexpr int kMetricsCollectionBlocks = |
32 kMetricsReportingIntervalBlocks - kMetricsComputationBlocks; | 32 kMetricsReportingIntervalBlocks - kMetricsComputationBlocks; |
33 | 33 |
34 constexpr int kAdaptiveFilterLength = 12; | |
peah-webrtc
2017/03/30 05:36:55
The adaptive filter lengths has now been fixed int
| |
35 | |
34 constexpr size_t kFftLengthBy2 = 64; | 36 constexpr size_t kFftLengthBy2 = 64; |
35 constexpr size_t kFftLengthBy2Plus1 = kFftLengthBy2 + 1; | 37 constexpr size_t kFftLengthBy2Plus1 = kFftLengthBy2 + 1; |
36 constexpr size_t kFftLengthBy2Minus1 = kFftLengthBy2 - 1; | 38 constexpr size_t kFftLengthBy2Minus1 = kFftLengthBy2 - 1; |
37 constexpr size_t kFftLength = 2 * kFftLengthBy2; | 39 constexpr size_t kFftLength = 2 * kFftLengthBy2; |
38 | 40 |
39 constexpr size_t kMaxNumBands = 3; | 41 constexpr size_t kMaxNumBands = 3; |
40 constexpr size_t kSubFrameLength = 80; | 42 constexpr size_t kSubFrameLength = 80; |
41 | 43 |
42 constexpr size_t kBlockSize = kFftLengthBy2; | 44 constexpr size_t kBlockSize = kFftLengthBy2; |
43 constexpr size_t kExtendedBlockSize = 2 * kFftLengthBy2; | 45 constexpr size_t kExtendedBlockSize = 2 * kFftLengthBy2; |
44 constexpr size_t kSubBlockSize = 16; | 46 constexpr size_t kSubBlockSize = 16; |
45 | 47 |
48 constexpr size_t kNumMatchedFilters = 4; | |
peah-webrtc
2017/03/30 05:36:55
The matched filter number, as well as the alignmen
| |
49 constexpr size_t kMatchedFilterWindowSizeSubBlocks = 32; | |
50 constexpr size_t kMatchedFilterAlignmentShiftSizeSubBlocks = | |
51 kMatchedFilterWindowSizeSubBlocks * 3 / 4; | |
52 constexpr size_t kDownsampledRenderBufferSize = | |
53 kSubBlockSize * | |
54 (kMatchedFilterAlignmentShiftSizeSubBlocks * kNumMatchedFilters + | |
55 kMatchedFilterWindowSizeSubBlocks + | |
56 1); | |
57 | |
58 constexpr size_t kRenderDelayBufferSize = | |
59 (3 * kDownsampledRenderBufferSize) / (4 * kSubBlockSize); | |
60 | |
61 constexpr size_t kMaxApiCallsJitterBlocks = 9; | |
62 constexpr size_t kRenderTransferQueueSize = kMaxApiCallsJitterBlocks / 2; | |
63 | |
46 constexpr size_t NumBandsForRate(int sample_rate_hz) { | 64 constexpr size_t NumBandsForRate(int sample_rate_hz) { |
47 return static_cast<size_t>(sample_rate_hz == 8000 ? 1 | 65 return static_cast<size_t>(sample_rate_hz == 8000 ? 1 |
48 : sample_rate_hz / 16000); | 66 : sample_rate_hz / 16000); |
49 } | 67 } |
50 constexpr int LowestBandRate(int sample_rate_hz) { | 68 constexpr int LowestBandRate(int sample_rate_hz) { |
51 return sample_rate_hz == 8000 ? sample_rate_hz : 16000; | 69 return sample_rate_hz == 8000 ? sample_rate_hz : 16000; |
52 } | 70 } |
53 | 71 |
54 constexpr bool ValidFullBandRate(int sample_rate_hz) { | 72 constexpr bool ValidFullBandRate(int sample_rate_hz) { |
55 return sample_rate_hz == 8000 || sample_rate_hz == 16000 || | 73 return sample_rate_hz == 8000 || sample_rate_hz == 16000 || |
(...skipping 23 matching lines...) Loading... | |
79 static_assert(ValidFullBandRate(32000), | 97 static_assert(ValidFullBandRate(32000), |
80 "Test that 32 kHz is a valid sample rate"); | 98 "Test that 32 kHz is a valid sample rate"); |
81 static_assert(ValidFullBandRate(48000), | 99 static_assert(ValidFullBandRate(48000), |
82 "Test that 48 kHz is a valid sample rate"); | 100 "Test that 48 kHz is a valid sample rate"); |
83 static_assert(!ValidFullBandRate(8001), | 101 static_assert(!ValidFullBandRate(8001), |
84 "Test that 8001 Hz is not a valid sample rate"); | 102 "Test that 8001 Hz is not a valid sample rate"); |
85 | 103 |
86 } // namespace webrtc | 104 } // namespace webrtc |
87 | 105 |
88 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC3_COMMON_H_ | 106 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC3_COMMON_H_ |
OLD | NEW |