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_AbsQuantLoop.c | 15 WebRtcIlbcfix_AbsQuantLoop.c |
16 | 16 |
17 ******************************************************************/ | 17 ******************************************************************/ |
18 | 18 |
19 #include "defines.h" | 19 #include "defines.h" |
20 #include "constants.h" | 20 #include "constants.h" |
21 #include "sort_sq.h" | 21 #include "sort_sq.h" |
22 | 22 |
23 void WebRtcIlbcfix_AbsQuantLoop(int16_t *syntOutIN, int16_t *in_weightedIN, | 23 void WebRtcIlbcfix_AbsQuantLoop(int16_t *syntOutIN, int16_t *in_weightedIN, |
24 int16_t *weightDenumIN, int16_t *quantLenIN, | 24 int16_t *weightDenumIN, int16_t *quantLenIN, |
25 int16_t *idxVecIN ) { | 25 int16_t *idxVecIN ) { |
26 int n, k1, k2; | 26 int k1, k2; |
27 int16_t index; | 27 int16_t index; |
28 int32_t toQW32; | 28 int32_t toQW32; |
29 int32_t toQ32; | 29 int32_t toQ32; |
30 int16_t tmp16a; | 30 int16_t tmp16a; |
31 int16_t xq; | 31 int16_t xq; |
32 | 32 |
33 int16_t *syntOut = syntOutIN; | 33 int16_t *syntOut = syntOutIN; |
34 int16_t *in_weighted = in_weightedIN; | 34 int16_t *in_weighted = in_weightedIN; |
35 int16_t *weightDenum = weightDenumIN; | 35 int16_t *weightDenum = weightDenumIN; |
36 int16_t *quantLen = quantLenIN; | 36 int16_t *quantLen = quantLenIN; |
37 int16_t *idxVec = idxVecIN; | 37 int16_t *idxVec = idxVecIN; |
38 | 38 |
39 n=0; | |
40 | |
41 for(k1=0;k1<2;k1++) { | 39 for(k1=0;k1<2;k1++) { |
42 for(k2=0;k2<quantLen[k1];k2++){ | 40 for(k2=0;k2<quantLen[k1];k2++){ |
43 | 41 |
44 /* Filter to get the predicted value */ | 42 /* Filter to get the predicted value */ |
45 WebRtcSpl_FilterARFastQ12( | 43 WebRtcSpl_FilterARFastQ12( |
46 syntOut, syntOut, | 44 syntOut, syntOut, |
47 weightDenum, LPC_FILTERORDER+1, 1); | 45 weightDenum, LPC_FILTERORDER+1, 1); |
48 | 46 |
49 /* the quantizer */ | 47 /* the quantizer */ |
50 toQW32 = (int32_t)(*in_weighted) - (int32_t)(*syntOut); | 48 toQW32 = (int32_t)(*in_weighted) - (int32_t)(*syntOut); |
(...skipping 23 matching lines...) Expand all Loading... |
74 } | 72 } |
75 | 73 |
76 /* Store selected index */ | 74 /* Store selected index */ |
77 (*idxVec++) = index; | 75 (*idxVec++) = index; |
78 | 76 |
79 /* Compute decoded sample and update of the prediction filter */ | 77 /* Compute decoded sample and update of the prediction filter */ |
80 tmp16a = ((WebRtcIlbcfix_kStateSq3[index] + 2 ) >> 2); | 78 tmp16a = ((WebRtcIlbcfix_kStateSq3[index] + 2 ) >> 2); |
81 | 79 |
82 *syntOut = (int16_t) (tmp16a + (int32_t)(*in_weighted) - toQW32); | 80 *syntOut = (int16_t) (tmp16a + (int32_t)(*in_weighted) - toQW32); |
83 | 81 |
84 n++; | |
85 syntOut++; in_weighted++; | 82 syntOut++; in_weighted++; |
86 } | 83 } |
87 /* Update perceptual weighting filter at subframe border */ | 84 /* Update perceptual weighting filter at subframe border */ |
88 weightDenum += 11; | 85 weightDenum += 11; |
89 } | 86 } |
90 } | 87 } |
OLD | NEW |