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 |
11 /* | 11 /* |
12 * This file contains the implementation of functions | 12 * This file contains the implementation of functions |
13 * WebRtcSpl_MaxAbsValueW16C() | 13 * WebRtcSpl_MaxAbsValueW16C() |
14 * WebRtcSpl_MaxAbsValueW32C() | 14 * WebRtcSpl_MaxAbsValueW32C() |
15 * WebRtcSpl_MaxValueW16C() | 15 * WebRtcSpl_MaxValueW16C() |
16 * WebRtcSpl_MaxValueW32C() | 16 * WebRtcSpl_MaxValueW32C() |
17 * WebRtcSpl_MinValueW16C() | 17 * WebRtcSpl_MinValueW16C() |
18 * WebRtcSpl_MinValueW32C() | 18 * WebRtcSpl_MinValueW32C() |
19 * WebRtcSpl_MaxAbsIndexW16() | 19 * WebRtcSpl_MaxAbsIndexW16() |
20 * WebRtcSpl_MaxIndexW16() | 20 * WebRtcSpl_MaxIndexW16() |
21 * WebRtcSpl_MaxIndexW32() | 21 * WebRtcSpl_MaxIndexW32() |
22 * WebRtcSpl_MinIndexW16() | 22 * WebRtcSpl_MinIndexW16() |
23 * WebRtcSpl_MinIndexW32() | 23 * WebRtcSpl_MinIndexW32() |
24 * | 24 * |
25 */ | 25 */ |
26 | 26 |
27 #include <stdlib.h> | 27 #include <stdlib.h> |
28 | 28 |
29 #include "webrtc/base/checks.h" | 29 #include "webrtc/rtc_base/checks.h" |
30 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" | 30 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" |
31 | 31 |
32 // TODO(bjorn/kma): Consolidate function pairs (e.g. combine | 32 // TODO(bjorn/kma): Consolidate function pairs (e.g. combine |
33 // WebRtcSpl_MaxAbsValueW16C and WebRtcSpl_MaxAbsIndexW16 into a single one.) | 33 // WebRtcSpl_MaxAbsValueW16C and WebRtcSpl_MaxAbsIndexW16 into a single one.) |
34 // TODO(kma): Move the next six functions into min_max_operations_c.c. | 34 // TODO(kma): Move the next six functions into min_max_operations_c.c. |
35 | 35 |
36 // Maximum absolute value of word16 vector. C version for generic platforms. | 36 // Maximum absolute value of word16 vector. C version for generic platforms. |
37 int16_t WebRtcSpl_MaxAbsValueW16C(const int16_t* vector, size_t length) { | 37 int16_t WebRtcSpl_MaxAbsValueW16C(const int16_t* vector, size_t length) { |
38 size_t i = 0; | 38 size_t i = 0; |
39 int absolute = 0, maximum = 0; | 39 int absolute = 0, maximum = 0; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 for (i = 0; i < length; i++) { | 216 for (i = 0; i < length; i++) { |
217 if (vector[i] < minimum) { | 217 if (vector[i] < minimum) { |
218 minimum = vector[i]; | 218 minimum = vector[i]; |
219 index = i; | 219 index = i; |
220 } | 220 } |
221 } | 221 } |
222 | 222 |
223 return index; | 223 return index; |
224 } | 224 } |
OLD | NEW |