| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 &syntdenum[(iLBCbits_inst->startIdx-1)*(LPC_FIL
TERORDER+1)], | 186 &syntdenum[(iLBCbits_inst->startIdx-1)*(LPC_FIL
TERORDER+1)], |
| 187 &decresidual[start_pos], iLBCenc_inst->state_sh
ort_len | 187 &decresidual[start_pos], iLBCenc_inst->state_sh
ort_len |
| 188 ); | 188 ); |
| 189 | 189 |
| 190 /* predictive quantization in state */ | 190 /* predictive quantization in state */ |
| 191 | 191 |
| 192 if (iLBCbits_inst->state_first) { /* put adaptive part in the end */ | 192 if (iLBCbits_inst->state_first) { /* put adaptive part in the end */ |
| 193 | 193 |
| 194 /* setup memory */ | 194 /* setup memory */ |
| 195 | 195 |
| 196 WebRtcSpl_MemSetW16(mem, 0, (int16_t)(CB_MEML-iLBCenc_inst->state_short_le
n)); | 196 WebRtcSpl_MemSetW16(mem, 0, CB_MEML - iLBCenc_inst->state_short_len); |
| 197 WEBRTC_SPL_MEMCPY_W16(mem+CB_MEML-iLBCenc_inst->state_short_len, | 197 WEBRTC_SPL_MEMCPY_W16(mem+CB_MEML-iLBCenc_inst->state_short_len, |
| 198 decresidual+start_pos, iLBCenc_inst->state_short_len
); | 198 decresidual+start_pos, iLBCenc_inst->state_short_len
); |
| 199 | 199 |
| 200 /* encode subframes */ | 200 /* encode subframes */ |
| 201 | 201 |
| 202 WebRtcIlbcfix_CbSearch(iLBCenc_inst, iLBCbits_inst->cb_index, iLBCbits_ins
t->gain_index, | 202 WebRtcIlbcfix_CbSearch(iLBCenc_inst, iLBCbits_inst->cb_index, iLBCbits_ins
t->gain_index, |
| 203 &residual[start_pos+iLBCenc_inst->state_short_len], | 203 &residual[start_pos+iLBCenc_inst->state_short_len], |
| 204 mem+CB_MEML-ST_MEM_L_TBL, ST_MEM_L_TBL, diff, | 204 mem+CB_MEML-ST_MEM_L_TBL, ST_MEM_L_TBL, diff, |
| 205 &weightdenum[iLBCbits_inst->startIdx*(LPC_FILTERORD
ER+1)], 0); | 205 &weightdenum[iLBCbits_inst->startIdx*(LPC_FILTERORD
ER+1)], 0); |
| 206 | 206 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 217 | 217 |
| 218 /* create reversed vectors for prediction */ | 218 /* create reversed vectors for prediction */ |
| 219 | 219 |
| 220 WebRtcSpl_MemCpyReversedOrder(&reverseResidual[diff-1], | 220 WebRtcSpl_MemCpyReversedOrder(&reverseResidual[diff-1], |
| 221 &residual[(iLBCbits_inst->startIdx+1)*SUBL-S
TATE_LEN], diff); | 221 &residual[(iLBCbits_inst->startIdx+1)*SUBL-S
TATE_LEN], diff); |
| 222 | 222 |
| 223 /* setup memory */ | 223 /* setup memory */ |
| 224 | 224 |
| 225 meml_gotten = iLBCenc_inst->state_short_len; | 225 meml_gotten = iLBCenc_inst->state_short_len; |
| 226 WebRtcSpl_MemCpyReversedOrder(&mem[CB_MEML-1], &decresidual[start_pos], me
ml_gotten); | 226 WebRtcSpl_MemCpyReversedOrder(&mem[CB_MEML-1], &decresidual[start_pos], me
ml_gotten); |
| 227 WebRtcSpl_MemSetW16(mem, 0, (int16_t)(CB_MEML-iLBCenc_inst->state_short_le
n)); | 227 WebRtcSpl_MemSetW16(mem, 0, CB_MEML - iLBCenc_inst->state_short_len); |
| 228 | 228 |
| 229 /* encode subframes */ | 229 /* encode subframes */ |
| 230 WebRtcIlbcfix_CbSearch(iLBCenc_inst, iLBCbits_inst->cb_index, iLBCbits_ins
t->gain_index, | 230 WebRtcIlbcfix_CbSearch(iLBCenc_inst, iLBCbits_inst->cb_index, iLBCbits_ins
t->gain_index, |
| 231 reverseResidual, mem+CB_MEML-ST_MEM_L_TBL, ST_MEM_L
_TBL, diff, | 231 reverseResidual, mem+CB_MEML-ST_MEM_L_TBL, ST_MEM_L
_TBL, diff, |
| 232 &weightdenum[(iLBCbits_inst->startIdx-1)*(LPC_FILTE
RORDER+1)], | 232 &weightdenum[(iLBCbits_inst->startIdx-1)*(LPC_FILTE
RORDER+1)], |
| 233 0); | 233 0); |
| 234 | 234 |
| 235 /* construct decoded vector */ | 235 /* construct decoded vector */ |
| 236 | 236 |
| 237 WebRtcIlbcfix_CbConstruct(reverseDecresidual, | 237 WebRtcIlbcfix_CbConstruct(reverseDecresidual, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 WebRtcSpl_MemCpyReversedOrder(&reverseResidual[Nback*SUBL-1], residual, Nbac
k*SUBL); | 391 WebRtcSpl_MemCpyReversedOrder(&reverseResidual[Nback*SUBL-1], residual, Nbac
k*SUBL); |
| 392 | 392 |
| 393 /* setup memory */ | 393 /* setup memory */ |
| 394 | 394 |
| 395 meml_gotten = SUBL*(iLBCenc_inst->nsub+1-iLBCbits_inst->startIdx); | 395 meml_gotten = SUBL*(iLBCenc_inst->nsub+1-iLBCbits_inst->startIdx); |
| 396 if( meml_gotten > CB_MEML ) { | 396 if( meml_gotten > CB_MEML ) { |
| 397 meml_gotten=CB_MEML; | 397 meml_gotten=CB_MEML; |
| 398 } | 398 } |
| 399 | 399 |
| 400 WebRtcSpl_MemCpyReversedOrder(&mem[CB_MEML-1], &decresidual[Nback*SUBL], mem
l_gotten); | 400 WebRtcSpl_MemCpyReversedOrder(&mem[CB_MEML-1], &decresidual[Nback*SUBL], mem
l_gotten); |
| 401 WebRtcSpl_MemSetW16(mem, 0, (int16_t)(CB_MEML-meml_gotten)); | 401 WebRtcSpl_MemSetW16(mem, 0, CB_MEML - meml_gotten); |
| 402 | 402 |
| 403 #ifdef SPLIT_10MS | 403 #ifdef SPLIT_10MS |
| 404 if (iLBCenc_inst->Nback_flag > 0) | 404 if (iLBCenc_inst->Nback_flag > 0) |
| 405 { | 405 { |
| 406 for (subframe = 0; subframe < WEBRTC_SPL_MAX (2 - Nfor, 0); subframe++) | 406 for (subframe = 0; subframe < WEBRTC_SPL_MAX (2 - Nfor, 0); subframe++) |
| 407 { | 407 { |
| 408 /* update memory */ | 408 /* update memory */ |
| 409 WEBRTC_SPL_MEMCPY_W16 (mem, mem + SUBL, (CB_MEML - SUBL)); | 409 WEBRTC_SPL_MEMCPY_W16 (mem, mem + SUBL, (CB_MEML - SUBL)); |
| 410 WEBRTC_SPL_MEMCPY_W16 (mem + CB_MEML - SUBL, | 410 WEBRTC_SPL_MEMCPY_W16 (mem + CB_MEML - SUBL, |
| 411 &reverseDecresidual[subframe * SUBL], SUBL); | 411 &reverseDecresidual[subframe * SUBL], SUBL); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 } | 510 } |
| 511 else | 511 else |
| 512 { | 512 { |
| 513 iLBCenc_inst->section++; | 513 iLBCenc_inst->section++; |
| 514 WEBRTC_SPL_MEMCPY_W16 (weightdenumbuf, weightdenum, | 514 WEBRTC_SPL_MEMCPY_W16 (weightdenumbuf, weightdenum, |
| 515 SCRATCH_ENCODE_DATAVEC - SCRATCH_ENCODE_WEIGHTDENUM); | 515 SCRATCH_ENCODE_DATAVEC - SCRATCH_ENCODE_WEIGHTDENUM); |
| 516 } | 516 } |
| 517 #endif | 517 #endif |
| 518 | 518 |
| 519 } | 519 } |
| OLD | NEW |