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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 myDecayRate += (DECAY_RATE<<3); | 440 myDecayRate += (DECAY_RATE<<3); |
441 } | 441 } |
442 | 442 |
443 /* ------------ reconstructing the residual signal ------------------ */ | 443 /* ------------ reconstructing the residual signal ------------------ */ |
444 | 444 |
445 LinearResampler( (ISACdec_obj->plcstr_obj).lastPitchLP, | 445 LinearResampler( (ISACdec_obj->plcstr_obj).lastPitchLP, |
446 stretchPitchLP, lag0, (ISACdec_obj->plcstr_obj).stretchLag ); | 446 stretchPitchLP, lag0, (ISACdec_obj->plcstr_obj).stretchLag ); |
447 /* inverse pitch filter */ | 447 /* inverse pitch filter */ |
448 | 448 |
449 pitchLags_Q7[0] = pitchLags_Q7[1] = pitchLags_Q7[2] = pitchLags_Q7[3] = | 449 pitchLags_Q7[0] = pitchLags_Q7[1] = pitchLags_Q7[2] = pitchLags_Q7[3] = |
450 ((ISACdec_obj->plcstr_obj).stretchLag<<7); | 450 (int16_t)((ISACdec_obj->plcstr_obj).stretchLag<<7); |
451 pitchGains_Q12[3] = ( (ISACdec_obj->plcstr_obj).lastPitchGain_Q12); | 451 pitchGains_Q12[3] = ( (ISACdec_obj->plcstr_obj).lastPitchGain_Q12); |
452 pitchGains_Q12[2] = (int16_t)(pitchGains_Q12[3] * 1010 >> 10); | 452 pitchGains_Q12[2] = (int16_t)(pitchGains_Q12[3] * 1010 >> 10); |
453 pitchGains_Q12[1] = (int16_t)(pitchGains_Q12[2] * 1010 >> 10); | 453 pitchGains_Q12[1] = (int16_t)(pitchGains_Q12[2] * 1010 >> 10); |
454 pitchGains_Q12[0] = (int16_t)(pitchGains_Q12[1] * 1010 >> 10); | 454 pitchGains_Q12[0] = (int16_t)(pitchGains_Q12[1] * 1010 >> 10); |
455 | 455 |
456 | 456 |
457 /* most of the time either B or A are zero so seperating */ | 457 /* most of the time either B or A are zero so seperating */ |
458 if( (ISACdec_obj->plcstr_obj).B == 0 ) | 458 if( (ISACdec_obj->plcstr_obj).B == 0 ) |
459 { | 459 { |
460 for( i = 0; i < FRAMESAMPLES_HALF; i++ ) | 460 for( i = 0; i < FRAMESAMPLES_HALF; i++ ) |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 k = (ISACdec_obj->plcstr_obj).pitchIndex; | 742 k = (ISACdec_obj->plcstr_obj).pitchIndex; |
743 /* --- Write one pitch cycle for recovery block --- */ | 743 /* --- Write one pitch cycle for recovery block --- */ |
744 | 744 |
745 for( i = 0; i < RECOVERY_OVERLAP; i++ ) | 745 for( i = 0; i < RECOVERY_OVERLAP; i++ ) |
746 { | 746 { |
747 ISACdec_obj->plcstr_obj.overlapLP[i] = (int16_t)( | 747 ISACdec_obj->plcstr_obj.overlapLP[i] = (int16_t)( |
748 stretchPitchLP[k] * ISACdec_obj->plcstr_obj.decayCoeffPriodic >> 15); | 748 stretchPitchLP[k] * ISACdec_obj->plcstr_obj.decayCoeffPriodic >> 15); |
749 k = ( k < ((ISACdec_obj->plcstr_obj).stretchLag - 1) )? (k+1):0; | 749 k = ( k < ((ISACdec_obj->plcstr_obj).stretchLag - 1) )? (k+1):0; |
750 } | 750 } |
751 | 751 |
752 (ISACdec_obj->plcstr_obj).lastPitchLag_Q7 = (ISACdec_obj->plcstr_obj).stretchL
ag << 7; | 752 (ISACdec_obj->plcstr_obj).lastPitchLag_Q7 = |
| 753 (int16_t)((ISACdec_obj->plcstr_obj).stretchLag << 7); |
753 | 754 |
754 | 755 |
755 /* --- Inverse Pitch Filter --- */ | 756 /* --- Inverse Pitch Filter --- */ |
756 WebRtcIsacfix_PitchFilter(Vector_Word16_1, Vector_Word16_2, | 757 WebRtcIsacfix_PitchFilter(Vector_Word16_1, Vector_Word16_2, |
757 &ISACdec_obj->pitchfiltstr_obj, pitchLags_Q7, pitchG
ains_Q12, 4); | 758 &ISACdec_obj->pitchfiltstr_obj, pitchLags_Q7, pitchG
ains_Q12, 4); |
758 | 759 |
759 /* reduce gain to compensate for pitch enhancer */ | 760 /* reduce gain to compensate for pitch enhancer */ |
760 /* gain = 1.0f - 0.45f * AvgPitchGain; */ | 761 /* gain = 1.0f - 0.45f * AvgPitchGain; */ |
761 tmp32a = ISACdec_obj->plcstr_obj.AvgPitchGain_Q12 * 29; // Q18 | 762 tmp32a = ISACdec_obj->plcstr_obj.AvgPitchGain_Q12 * 29; // Q18 |
762 tmp32b = 262144 - tmp32a; // Q18 | 763 tmp32b = 262144 - tmp32a; // Q18 |
(...skipping 29 matching lines...) Expand all Loading... |
792 | 793 |
793 | 794 |
794 WebRtcIsacfix_FilterAndCombine1(Vector_Word16_1, | 795 WebRtcIsacfix_FilterAndCombine1(Vector_Word16_1, |
795 Vector_Word16_2, signal_out16, &ISACdec_obj->p
ostfiltbankstr_obj); | 796 Vector_Word16_2, signal_out16, &ISACdec_obj->p
ostfiltbankstr_obj); |
796 | 797 |
797 (ISACdec_obj->plcstr_obj).used = PLC_WAS_USED; | 798 (ISACdec_obj->plcstr_obj).used = PLC_WAS_USED; |
798 *current_framesamples = 480; | 799 *current_framesamples = 480; |
799 | 800 |
800 return len; | 801 return len; |
801 } | 802 } |
OLD | NEW |