| OLD | NEW |
| 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 iLBC Speech Coder ANSI-C Source Code | 13 iLBC Speech Coder ANSI-C Source Code |
| 14 | 14 |
| 15 WebRtcIlbcfix_InterpolateSamples.c | 15 WebRtcIlbcfix_InterpolateSamples.c |
| 16 | 16 |
| 17 ******************************************************************/ | 17 ******************************************************************/ |
| 18 | 18 |
| 19 #include "defines.h" | 19 #include "defines.h" |
| 20 #include "constants.h" | 20 #include "constants.h" |
| 21 | 21 |
| 22 void WebRtcIlbcfix_InterpolateSamples( | 22 void WebRtcIlbcfix_InterpolateSamples( |
| 23 int16_t *interpSamples, /* (o) The interpolated samples */ | 23 int16_t *interpSamples, /* (o) The interpolated samples */ |
| 24 int16_t *CBmem, /* (i) The CB memory */ | 24 int16_t *CBmem, /* (i) The CB memory */ |
| 25 int16_t lMem /* (i) Length of the CB memory */ | 25 size_t lMem /* (i) Length of the CB memory */ |
| 26 ) { | 26 ) { |
| 27 int16_t *ppi, *ppo, i, j, temp1, temp2; | 27 int16_t *ppi, *ppo, i, j, temp1, temp2; |
| 28 int16_t *tmpPtr; | 28 int16_t *tmpPtr; |
| 29 | 29 |
| 30 /* Calculate the 20 vectors of interpolated samples (4 samples each) | 30 /* Calculate the 20 vectors of interpolated samples (4 samples each) |
| 31 that are used in the codebooks for lag 20 to 39 */ | 31 that are used in the codebooks for lag 20 to 39 */ |
| 32 tmpPtr = interpSamples; | 32 tmpPtr = interpSamples; |
| 33 for (j=0; j<20; j++) { | 33 for (j=0; j<20; j++) { |
| 34 temp1 = 0; | 34 temp1 = 0; |
| 35 temp2 = 3; | 35 temp2 = 3; |
| 36 ppo = CBmem+lMem-4; | 36 ppo = CBmem+lMem-4; |
| 37 ppi = CBmem+lMem-j-24; | 37 ppi = CBmem+lMem-j-24; |
| 38 for (i=0; i<4; i++) { | 38 for (i=0; i<4; i++) { |
| 39 | 39 |
| 40 *tmpPtr++ = (int16_t)((WebRtcIlbcfix_kAlpha[temp2] * *ppo) >> 15) + | 40 *tmpPtr++ = (int16_t)((WebRtcIlbcfix_kAlpha[temp2] * *ppo) >> 15) + |
| 41 (int16_t)((WebRtcIlbcfix_kAlpha[temp1] * *ppi) >> 15); | 41 (int16_t)((WebRtcIlbcfix_kAlpha[temp1] * *ppi) >> 15); |
| 42 | 42 |
| 43 ppo++; | 43 ppo++; |
| 44 ppi++; | 44 ppi++; |
| 45 temp1++; | 45 temp1++; |
| 46 temp2--; | 46 temp2--; |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 return; | 50 return; |
| 51 } | 51 } |
| OLD | NEW |