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

Side by Side Diff: webrtc/common_audio/signal_processing/copy_set_operations.c

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 4 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) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 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 /* 12 /*
13 * This file contains the implementation of functions 13 * This file contains the implementation of functions
14 * WebRtcSpl_MemSetW16() 14 * WebRtcSpl_MemSetW16()
15 * WebRtcSpl_MemSetW32() 15 * WebRtcSpl_MemSetW32()
16 * WebRtcSpl_MemCpyReversedOrder() 16 * WebRtcSpl_MemCpyReversedOrder()
17 * WebRtcSpl_CopyFromEndW16() 17 * WebRtcSpl_CopyFromEndW16()
18 * WebRtcSpl_ZerosArrayW16() 18 * WebRtcSpl_ZerosArrayW16()
19 * WebRtcSpl_ZerosArrayW32() 19 * WebRtcSpl_ZerosArrayW32()
20 * 20 *
21 * The description header can be found in signal_processing_library.h 21 * The description header can be found in signal_processing_library.h
22 * 22 *
23 */ 23 */
24 24
25 #include <string.h> 25 #include <string.h>
26 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h" 26 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h"
27 27
28 28
29 void WebRtcSpl_MemSetW16(int16_t *ptr, int16_t set_value, int length) 29 void WebRtcSpl_MemSetW16(int16_t *ptr, int16_t set_value, size_t length)
30 { 30 {
31 int j; 31 size_t j;
32 int16_t *arrptr = ptr; 32 int16_t *arrptr = ptr;
33 33
34 for (j = length; j > 0; j--) 34 for (j = length; j > 0; j--)
35 { 35 {
36 *arrptr++ = set_value; 36 *arrptr++ = set_value;
37 } 37 }
38 } 38 }
39 39
40 void WebRtcSpl_MemSetW32(int32_t *ptr, int32_t set_value, int length) 40 void WebRtcSpl_MemSetW32(int32_t *ptr, int32_t set_value, size_t length)
41 { 41 {
42 int j; 42 size_t j;
43 int32_t *arrptr = ptr; 43 int32_t *arrptr = ptr;
44 44
45 for (j = length; j > 0; j--) 45 for (j = length; j > 0; j--)
46 { 46 {
47 *arrptr++ = set_value; 47 *arrptr++ = set_value;
48 } 48 }
49 } 49 }
50 50
51 void WebRtcSpl_MemCpyReversedOrder(int16_t* dest, int16_t* source, int length) 51 void WebRtcSpl_MemCpyReversedOrder(int16_t* dest,
52 int16_t* source,
53 size_t length)
52 { 54 {
53 int j; 55 size_t j;
54 int16_t* destPtr = dest; 56 int16_t* destPtr = dest;
55 int16_t* sourcePtr = source; 57 int16_t* sourcePtr = source;
56 58
57 for (j = 0; j < length; j++) 59 for (j = 0; j < length; j++)
58 { 60 {
59 *destPtr-- = *sourcePtr++; 61 *destPtr-- = *sourcePtr++;
60 } 62 }
61 } 63 }
62 64
63 void WebRtcSpl_CopyFromEndW16(const int16_t *vector_in, 65 void WebRtcSpl_CopyFromEndW16(const int16_t *vector_in,
64 int length, 66 size_t length,
65 int samples, 67 size_t samples,
66 int16_t *vector_out) 68 int16_t *vector_out)
67 { 69 {
68 // Copy the last <samples> of the input vector to vector_out 70 // Copy the last <samples> of the input vector to vector_out
69 WEBRTC_SPL_MEMCPY_W16(vector_out, &vector_in[length - samples], samples); 71 WEBRTC_SPL_MEMCPY_W16(vector_out, &vector_in[length - samples], samples);
70 } 72 }
71 73
72 void WebRtcSpl_ZerosArrayW16(int16_t *vector, int length) 74 void WebRtcSpl_ZerosArrayW16(int16_t *vector, size_t length)
73 { 75 {
74 WebRtcSpl_MemSetW16(vector, 0, length); 76 WebRtcSpl_MemSetW16(vector, 0, length);
75 } 77 }
76 78
77 void WebRtcSpl_ZerosArrayW32(int32_t *vector, int length) 79 void WebRtcSpl_ZerosArrayW32(int32_t *vector, size_t length)
78 { 80 {
79 WebRtcSpl_MemSetW32(vector, 0, length); 81 WebRtcSpl_MemSetW32(vector, 0, length);
80 } 82 }
OLDNEW
« no previous file with comments | « webrtc/common_audio/signal_processing/complex_fft.c ('k') | webrtc/common_audio/signal_processing/cross_correlation.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698