| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 WebRtcIlbcfix_StateConstruct(iLBC_encbits->idxForMax, | 60 WebRtcIlbcfix_StateConstruct(iLBC_encbits->idxForMax, |
| 61 iLBC_encbits->idxVec, &syntdenum[(iLBC_encbits->s
tartIdx-1)*(LPC_FILTERORDER+1)], | 61 iLBC_encbits->idxVec, &syntdenum[(iLBC_encbits->s
tartIdx-1)*(LPC_FILTERORDER+1)], |
| 62 &decresidual[start_pos], iLBCdec_inst->state_shor
t_len | 62 &decresidual[start_pos], iLBCdec_inst->state_shor
t_len |
| 63 ); | 63 ); |
| 64 | 64 |
| 65 if (iLBC_encbits->state_first) { /* put adaptive part in the end */ | 65 if (iLBC_encbits->state_first) { /* put adaptive part in the end */ |
| 66 | 66 |
| 67 /* setup memory */ | 67 /* setup memory */ |
| 68 | 68 |
| 69 WebRtcSpl_MemSetW16(mem, 0, (int16_t)(CB_MEML-iLBCdec_inst->state_short_len)
); | 69 WebRtcSpl_MemSetW16(mem, 0, CB_MEML - iLBCdec_inst->state_short_len); |
| 70 WEBRTC_SPL_MEMCPY_W16(mem+CB_MEML-iLBCdec_inst->state_short_len, decresidual
+start_pos, | 70 WEBRTC_SPL_MEMCPY_W16(mem+CB_MEML-iLBCdec_inst->state_short_len, decresidual
+start_pos, |
| 71 iLBCdec_inst->state_short_len); | 71 iLBCdec_inst->state_short_len); |
| 72 | 72 |
| 73 /* construct decoded vector */ | 73 /* construct decoded vector */ |
| 74 | 74 |
| 75 WebRtcIlbcfix_CbConstruct( | 75 WebRtcIlbcfix_CbConstruct( |
| 76 &decresidual[start_pos+iLBCdec_inst->state_short_len], | 76 &decresidual[start_pos+iLBCdec_inst->state_short_len], |
| 77 iLBC_encbits->cb_index, iLBC_encbits->gain_index, | 77 iLBC_encbits->cb_index, iLBC_encbits->gain_index, |
| 78 mem+CB_MEML-ST_MEM_L_TBL, | 78 mem+CB_MEML-ST_MEM_L_TBL, |
| 79 ST_MEM_L_TBL, (int16_t)diff | 79 ST_MEM_L_TBL, diff); |
| 80 ); | |
| 81 | 80 |
| 82 } | 81 } |
| 83 else {/* put adaptive part in the beginning */ | 82 else {/* put adaptive part in the beginning */ |
| 84 | 83 |
| 85 /* setup memory */ | 84 /* setup memory */ |
| 86 | 85 |
| 87 meml_gotten = iLBCdec_inst->state_short_len; | 86 meml_gotten = iLBCdec_inst->state_short_len; |
| 88 WebRtcSpl_MemCpyReversedOrder(mem+CB_MEML-1, | 87 WebRtcSpl_MemCpyReversedOrder(mem+CB_MEML-1, |
| 89 decresidual+start_pos, meml_gotten); | 88 decresidual+start_pos, meml_gotten); |
| 90 WebRtcSpl_MemSetW16(mem, 0, (int16_t)(CB_MEML-meml_gotten)); | 89 WebRtcSpl_MemSetW16(mem, 0, CB_MEML - meml_gotten); |
| 91 | 90 |
| 92 /* construct decoded vector */ | 91 /* construct decoded vector */ |
| 93 | 92 |
| 94 WebRtcIlbcfix_CbConstruct( | 93 WebRtcIlbcfix_CbConstruct( |
| 95 reverseDecresidual, | 94 reverseDecresidual, |
| 96 iLBC_encbits->cb_index, iLBC_encbits->gain_index, | 95 iLBC_encbits->cb_index, iLBC_encbits->gain_index, |
| 97 mem+CB_MEML-ST_MEM_L_TBL, | 96 mem+CB_MEML-ST_MEM_L_TBL, |
| 98 ST_MEM_L_TBL, diff | 97 ST_MEM_L_TBL, diff |
| 99 ); | 98 ); |
| 100 | 99 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 148 |
| 150 /* setup memory */ | 149 /* setup memory */ |
| 151 | 150 |
| 152 meml_gotten = SUBL*(iLBCdec_inst->nsub+1-iLBC_encbits->startIdx); | 151 meml_gotten = SUBL*(iLBCdec_inst->nsub+1-iLBC_encbits->startIdx); |
| 153 if( meml_gotten > CB_MEML ) { | 152 if( meml_gotten > CB_MEML ) { |
| 154 meml_gotten=CB_MEML; | 153 meml_gotten=CB_MEML; |
| 155 } | 154 } |
| 156 | 155 |
| 157 WebRtcSpl_MemCpyReversedOrder(mem+CB_MEML-1, | 156 WebRtcSpl_MemCpyReversedOrder(mem+CB_MEML-1, |
| 158 decresidual+(iLBC_encbits->startIdx-1)*SUBL, m
eml_gotten); | 157 decresidual+(iLBC_encbits->startIdx-1)*SUBL, m
eml_gotten); |
| 159 WebRtcSpl_MemSetW16(mem, 0, (int16_t)(CB_MEML-meml_gotten)); | 158 WebRtcSpl_MemSetW16(mem, 0, CB_MEML - meml_gotten); |
| 160 | 159 |
| 161 /* loop over subframes to decode */ | 160 /* loop over subframes to decode */ |
| 162 | 161 |
| 163 for (subframe=0; subframe<Nback; subframe++) { | 162 for (subframe=0; subframe<Nback; subframe++) { |
| 164 | 163 |
| 165 /* construct decoded vector */ | 164 /* construct decoded vector */ |
| 166 WebRtcIlbcfix_CbConstruct( | 165 WebRtcIlbcfix_CbConstruct( |
| 167 &reverseDecresidual[subframe*SUBL], | 166 &reverseDecresidual[subframe*SUBL], |
| 168 iLBC_encbits->cb_index+subcount*CB_NSTAGES, | 167 iLBC_encbits->cb_index+subcount*CB_NSTAGES, |
| 169 iLBC_encbits->gain_index+subcount*CB_NSTAGES, | 168 iLBC_encbits->gain_index+subcount*CB_NSTAGES, |
| 170 mem, MEM_LF_TBL, SUBL | 169 mem, MEM_LF_TBL, SUBL |
| 171 ); | 170 ); |
| 172 | 171 |
| 173 /* update memory */ | 172 /* update memory */ |
| 174 memmove(mem, mem + SUBL, (CB_MEML - SUBL) * sizeof(*mem)); | 173 memmove(mem, mem + SUBL, (CB_MEML - SUBL) * sizeof(*mem)); |
| 175 WEBRTC_SPL_MEMCPY_W16(mem+CB_MEML-SUBL, | 174 WEBRTC_SPL_MEMCPY_W16(mem+CB_MEML-SUBL, |
| 176 &reverseDecresidual[subframe*SUBL], SUBL); | 175 &reverseDecresidual[subframe*SUBL], SUBL); |
| 177 | 176 |
| 178 subcount++; | 177 subcount++; |
| 179 } | 178 } |
| 180 | 179 |
| 181 /* get decoded residual from reversed vector */ | 180 /* get decoded residual from reversed vector */ |
| 182 WebRtcSpl_MemCpyReversedOrder(decresidual+SUBL*Nback-1, | 181 WebRtcSpl_MemCpyReversedOrder(decresidual+SUBL*Nback-1, |
| 183 reverseDecresidual, SUBL*Nback); | 182 reverseDecresidual, SUBL*Nback); |
| 184 } | 183 } |
| 185 } | 184 } |
| OLD | NEW |