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 |
(...skipping 16 matching lines...) Expand all Loading... |
27 *----------------------------------------------------------------*/ | 27 *----------------------------------------------------------------*/ |
28 | 28 |
29 void WebRtcIlbcfix_CbMemEnergy( | 29 void WebRtcIlbcfix_CbMemEnergy( |
30 int16_t range, | 30 int16_t range, |
31 int16_t *CB, /* (i) The CB memory (1:st section) */ | 31 int16_t *CB, /* (i) The CB memory (1:st section) */ |
32 int16_t *filteredCB, /* (i) The filtered CB memory (2:nd section) */ | 32 int16_t *filteredCB, /* (i) The filtered CB memory (2:nd section) */ |
33 int16_t lMem, /* (i) Length of the CB memory */ | 33 int16_t lMem, /* (i) Length of the CB memory */ |
34 int16_t lTarget, /* (i) Length of the target vector */ | 34 int16_t lTarget, /* (i) Length of the target vector */ |
35 int16_t *energyW16, /* (o) Energy in the CB vectors */ | 35 int16_t *energyW16, /* (o) Energy in the CB vectors */ |
36 int16_t *energyShifts, /* (o) Shift value of the energy */ | 36 int16_t *energyShifts, /* (o) Shift value of the energy */ |
37 int16_t scale, /* (i) The scaling of all energy values */ | 37 int scale, /* (i) The scaling of all energy values */ |
38 int16_t base_size /* (i) Index to where energy values should be stored */ | 38 int16_t base_size /* (i) Index to where energy values should be stored */ |
39 ) { | 39 ) { |
40 int16_t *ppi, *ppo, *pp; | 40 int16_t *ppi, *ppo, *pp; |
41 int32_t energy, tmp32; | 41 int32_t energy, tmp32; |
42 | 42 |
43 /* Compute the energy and store it in a vector. Also the | 43 /* Compute the energy and store it in a vector. Also the |
44 * corresponding shift values are stored. The energy values | 44 * corresponding shift values are stored. The energy values |
45 * are reused in all three stages. */ | 45 * are reused in all three stages. */ |
46 | 46 |
47 /* Calculate the energy in the first block of 'lTarget' sampels. */ | 47 /* Calculate the energy in the first block of 'lTarget' sampels. */ |
(...skipping 22 matching lines...) Expand all Loading... |
70 /* Normalize the energy and store the number of shifts */ | 70 /* Normalize the energy and store the number of shifts */ |
71 energyShifts[base_size] = (int16_t)WebRtcSpl_NormW32(energy); | 71 energyShifts[base_size] = (int16_t)WebRtcSpl_NormW32(energy); |
72 tmp32 = energy << energyShifts[base_size]; | 72 tmp32 = energy << energyShifts[base_size]; |
73 energyW16[base_size] = (int16_t)(tmp32 >> 16); | 73 energyW16[base_size] = (int16_t)(tmp32 >> 16); |
74 | 74 |
75 ppi = filteredCB + lMem - 1 - lTarget; | 75 ppi = filteredCB + lMem - 1 - lTarget; |
76 ppo = filteredCB + lMem - 1; | 76 ppo = filteredCB + lMem - 1; |
77 | 77 |
78 WebRtcIlbcfix_CbMemEnergyCalc(energy, range, ppi, ppo, energyW16, energyShifts
, scale, base_size); | 78 WebRtcIlbcfix_CbMemEnergyCalc(energy, range, ppi, ppo, energyW16, energyShifts
, scale, base_size); |
79 } | 79 } |
OLD | NEW |