| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 |
| 11 #include <math.h> | 11 #include <math.h> |
| 12 #include <string.h> | 12 #include <string.h> |
| 13 | 13 |
| 14 #include <algorithm> | 14 #include <algorithm> |
| 15 #include <bitset> | 15 #include <bitset> |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "webrtc/base/checks.h" | |
| 19 #include "webrtc/modules/audio_processing/residual_echo_detector.h" | 18 #include "webrtc/modules/audio_processing/residual_echo_detector.h" |
| 19 #include "webrtc/rtc_base/checks.h" |
| 20 | 20 |
| 21 namespace webrtc { | 21 namespace webrtc { |
| 22 | 22 |
| 23 void FuzzOneInput(const uint8_t* data, size_t size) { | 23 void FuzzOneInput(const uint8_t* data, size_t size) { |
| 24 // Number of times to update the echo detector. | 24 // Number of times to update the echo detector. |
| 25 constexpr size_t kNrOfUpdates = 7; | 25 constexpr size_t kNrOfUpdates = 7; |
| 26 // Each round of updates requires a call to both AnalyzeRender and | 26 // Each round of updates requires a call to both AnalyzeRender and |
| 27 // AnalyzeCapture, so the amount of needed input bytes doubles. Also, two | 27 // AnalyzeCapture, so the amount of needed input bytes doubles. Also, two |
| 28 // bytes are used to set the call order. | 28 // bytes are used to set the call order. |
| 29 constexpr size_t kNrOfNeededInputBytes = 2 * kNrOfUpdates * sizeof(float) + 2; | 29 constexpr size_t kNrOfNeededInputBytes = 2 * kNrOfUpdates * sizeof(float) + 2; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 57 } | 57 } |
| 58 if (call_order[i]) { | 58 if (call_order[i]) { |
| 59 echo_detector.AnalyzeRenderAudio(input); | 59 echo_detector.AnalyzeRenderAudio(input); |
| 60 } else { | 60 } else { |
| 61 echo_detector.AnalyzeCaptureAudio(input); | 61 echo_detector.AnalyzeCaptureAudio(input); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace webrtc | 66 } // namespace webrtc |
| OLD | NEW |