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

Side by Side Diff: webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter_c.c

Issue 1227163003: Update audio code to use size_t more correctly, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comments 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) 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 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h" 11 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h"
12 #include "webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h" 12 #include "webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h"
13 13
14 /* Filter coefficicients in Q15. */ 14 /* Filter coefficicients in Q15. */
15 static const int16_t kDampFilter[PITCH_DAMPORDER] = { 15 static const int16_t kDampFilter[PITCH_DAMPORDER] = {
16 -2294, 8192, 20972, 8192, -2294 16 -2294, 8192, 20972, 8192, -2294
17 }; 17 };
18 18
19 void WebRtcIsacfix_PitchFilterCore(int loopNumber, 19 void WebRtcIsacfix_PitchFilterCore(int loopNumber,
20 int16_t gain, 20 int16_t gain,
21 int index, 21 size_t index,
22 int16_t sign, 22 int16_t sign,
23 int16_t* inputState, 23 int16_t* inputState,
24 int16_t* outputBuf2, 24 int16_t* outputBuf2,
25 const int16_t* coefficient, 25 const int16_t* coefficient,
26 int16_t* inputBuf, 26 int16_t* inputBuf,
27 int16_t* outputBuf, 27 int16_t* outputBuf,
28 int* index2) { 28 int* index2) {
29 int i = 0, j = 0; /* Loop counters. */ 29 int i = 0, j = 0; /* Loop counters. */
30 int16_t* ubufQQpos2 = &outputBuf2[PITCH_BUFFSIZE - (index + 2)]; 30 int16_t* ubufQQpos2 = &outputBuf2[PITCH_BUFFSIZE - (index + 2)];
31 int16_t tmpW16 = 0; 31 int16_t tmpW16 = 0;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 /* Subtract from input and update buffer. */ 65 /* Subtract from input and update buffer. */
66 tmpW32 = inputBuf[*index2] - sign * tmpW16; 66 tmpW32 = inputBuf[*index2] - sign * tmpW16;
67 outputBuf[*index2] = WebRtcSpl_SatW32ToW16(tmpW32); 67 outputBuf[*index2] = WebRtcSpl_SatW32ToW16(tmpW32);
68 tmpW32 = inputBuf[*index2] + outputBuf[*index2]; 68 tmpW32 = inputBuf[*index2] + outputBuf[*index2];
69 outputBuf2[*index2 + PITCH_BUFFSIZE] = WebRtcSpl_SatW32ToW16(tmpW32); 69 outputBuf2[*index2 + PITCH_BUFFSIZE] = WebRtcSpl_SatW32ToW16(tmpW32);
70 70
71 (*index2)++; 71 (*index2)++;
72 } 72 }
73 } 73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698