| 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_CbMemEnergyAugmentation.c | 15 WebRtcIlbcfix_CbMemEnergyAugmentation.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_CbMemEnergyAugmentation( | 22 void WebRtcIlbcfix_CbMemEnergyAugmentation( |
| 23 int16_t *interpSamples, /* (i) The interpolated samples */ | 23 int16_t *interpSamples, /* (i) The interpolated samples */ |
| 24 int16_t *CBmem, /* (i) The CB memory */ | 24 int16_t *CBmem, /* (i) The CB memory */ |
| 25 int scale, /* (i) The scaling of all energy values */ | 25 int scale, /* (i) The scaling of all energy values */ |
| 26 int16_t base_size, /* (i) Index to where energy values should be stored */ | 26 size_t base_size, /* (i) Index to where energy values should be stored */ |
| 27 int16_t *energyW16, /* (o) Energy in the CB vectors */ | 27 int16_t *energyW16, /* (o) Energy in the CB vectors */ |
| 28 int16_t *energyShifts /* (o) Shift value of the energy */ | 28 int16_t *energyShifts /* (o) Shift value of the energy */ |
| 29 ){ | 29 ){ |
| 30 int32_t energy, tmp32; | 30 int32_t energy, tmp32; |
| 31 int16_t *ppe, *pp, *interpSamplesPtr; | 31 int16_t *ppe, *pp, *interpSamplesPtr; |
| 32 int16_t *CBmemPtr, lagcount; | 32 int16_t *CBmemPtr; |
| 33 size_t lagcount; |
| 33 int16_t *enPtr=&energyW16[base_size-20]; | 34 int16_t *enPtr=&energyW16[base_size-20]; |
| 34 int16_t *enShPtr=&energyShifts[base_size-20]; | 35 int16_t *enShPtr=&energyShifts[base_size-20]; |
| 35 int32_t nrjRecursive; | 36 int32_t nrjRecursive; |
| 36 | 37 |
| 37 CBmemPtr = CBmem+147; | 38 CBmemPtr = CBmem+147; |
| 38 interpSamplesPtr = interpSamples; | 39 interpSamplesPtr = interpSamples; |
| 39 | 40 |
| 40 /* Compute the energy for the first (low-5) noninterpolated samples */ | 41 /* Compute the energy for the first (low-5) noninterpolated samples */ |
| 41 nrjRecursive = WebRtcSpl_DotProductWithScale( CBmemPtr-19, CBmemPtr-19, 15, sc
ale); | 42 nrjRecursive = WebRtcSpl_DotProductWithScale( CBmemPtr-19, CBmemPtr-19, 15, sc
ale); |
| 42 ppe = CBmemPtr - 20; | 43 ppe = CBmemPtr - 20; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 57 energy += WebRtcSpl_DotProductWithScale(pp, pp, SUBL-lagcount, scale); | 58 energy += WebRtcSpl_DotProductWithScale(pp, pp, SUBL-lagcount, scale); |
| 58 | 59 |
| 59 /* Normalize the energy and store the number of shifts */ | 60 /* Normalize the energy and store the number of shifts */ |
| 60 (*enShPtr) = (int16_t)WebRtcSpl_NormW32(energy); | 61 (*enShPtr) = (int16_t)WebRtcSpl_NormW32(energy); |
| 61 tmp32 = energy << *enShPtr; | 62 tmp32 = energy << *enShPtr; |
| 62 *enPtr = (int16_t)(tmp32 >> 16); | 63 *enPtr = (int16_t)(tmp32 >> 16); |
| 63 enShPtr++; | 64 enShPtr++; |
| 64 enPtr++; | 65 enPtr++; |
| 65 } | 66 } |
| 66 } | 67 } |
| OLD | NEW |