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 int16_t scale, /* (i) The scaling of all energy values */ |
26 int16_t base_size, /* (i) Index to where the energy values should be stored
*/ | 26 int16_t base_size, /* (i) Index to where the 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, lagcount; |
33 int16_t *enPtr=&energyW16[base_size-20]; | 33 int16_t *enPtr=&energyW16[base_size-20]; |
34 int16_t *enShPtr=&energyShifts[base_size-20]; | 34 int16_t *enShPtr=&energyShifts[base_size-20]; |
35 int32_t nrjRecursive; | 35 int32_t nrjRecursive; |
(...skipping 21 matching lines...) Expand all Loading... |
57 energy += WebRtcSpl_DotProductWithScale(pp, pp, SUBL-lagcount, scale); | 57 energy += WebRtcSpl_DotProductWithScale(pp, pp, SUBL-lagcount, scale); |
58 | 58 |
59 /* Normalize the energy and store the number of shifts */ | 59 /* Normalize the energy and store the number of shifts */ |
60 (*enShPtr) = (int16_t)WebRtcSpl_NormW32(energy); | 60 (*enShPtr) = (int16_t)WebRtcSpl_NormW32(energy); |
61 tmp32 = energy << *enShPtr; | 61 tmp32 = energy << *enShPtr; |
62 *enPtr = (int16_t)(tmp32 >> 16); | 62 *enPtr = (int16_t)(tmp32 >> 16); |
63 enShPtr++; | 63 enShPtr++; |
64 enPtr++; | 64 enPtr++; |
65 } | 65 } |
66 } | 66 } |
OLD | NEW |