Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: webrtc/modules/audio_processing/aec3/aec3_common.h

Issue 2784023002: Major AEC3 render pipeline changes (Closed)
Patch Set: Disabled one more DEATH test that caused issues due to bug on bots Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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...) Expand all
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;
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;
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 = 10;
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...) Expand all
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_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/aec3/adaptive_fir_filter_unittest.cc ('k') | webrtc/modules/audio_processing/aec3/aec_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698