Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(999)

Side by Side Diff: third_party/opus/src/silk/decode_parameters.c

Issue 2962373002: [Opus] Update to v1.2.1 (Closed)
Patch Set: Pre-increment instead of post-increment Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/opus/src/silk/decode_frame.c ('k') | third_party/opus/src/silk/define.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /*********************************************************************** 1 /***********************************************************************
2 Copyright (c) 2006-2011, Skype Limited. All rights reserved. 2 Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 Redistribution and use in source and binary forms, with or without 3 Redistribution and use in source and binary forms, with or without
4 modification, are permitted provided that the following conditions 4 modification, are permitted provided that the following conditions
5 are met: 5 are met:
6 - Redistributions of source code must retain the above copyright notice, 6 - Redistributions of source code must retain the above copyright notice,
7 this list of conditions and the following disclaimer. 7 this list of conditions and the following disclaimer.
8 - Redistributions in binary form must reproduce the above copyright 8 - Redistributions in binary form must reproduce the above copyright
9 notice, this list of conditions and the following disclaimer in the 9 notice, this list of conditions and the following disclaimer in the
10 documentation and/or other materials provided with the distribution. 10 documentation and/or other materials provided with the distribution.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 /* Dequant Gains */ 45 /* Dequant Gains */
46 silk_gains_dequant( psDecCtrl->Gains_Q16, psDec->indices.GainsIndices, 46 silk_gains_dequant( psDecCtrl->Gains_Q16, psDec->indices.GainsIndices,
47 &psDec->LastGainIndex, condCoding == CODE_CONDITIONALLY, psDec->nb_subfr ); 47 &psDec->LastGainIndex, condCoding == CODE_CONDITIONALLY, psDec->nb_subfr );
48 48
49 /****************/ 49 /****************/
50 /* Decode NLSFs */ 50 /* Decode NLSFs */
51 /****************/ 51 /****************/
52 silk_NLSF_decode( pNLSF_Q15, psDec->indices.NLSFIndices, psDec->psNLSF_CB ); 52 silk_NLSF_decode( pNLSF_Q15, psDec->indices.NLSFIndices, psDec->psNLSF_CB );
53 53
54 /* Convert NLSF parameters to AR prediction filter coefficients */ 54 /* Convert NLSF parameters to AR prediction filter coefficients */
55 silk_NLSF2A( psDecCtrl->PredCoef_Q12[ 1 ], pNLSF_Q15, psDec->LPC_order ); 55 silk_NLSF2A( psDecCtrl->PredCoef_Q12[ 1 ], pNLSF_Q15, psDec->LPC_order, psDe c->arch );
56 56
57 /* If just reset, e.g., because internal Fs changed, do not allow interpolat ion */ 57 /* If just reset, e.g., because internal Fs changed, do not allow interpolat ion */
58 /* improves the case of packet loss in the first frame after a switch */ 58 /* improves the case of packet loss in the first frame after a switch */
59 if( psDec->first_frame_after_reset == 1 ) { 59 if( psDec->first_frame_after_reset == 1 ) {
60 psDec->indices.NLSFInterpCoef_Q2 = 4; 60 psDec->indices.NLSFInterpCoef_Q2 = 4;
61 } 61 }
62 62
63 if( psDec->indices.NLSFInterpCoef_Q2 < 4 ) { 63 if( psDec->indices.NLSFInterpCoef_Q2 < 4 ) {
64 /* Calculation of the interpolated NLSF0 vector from the interpolation f actor, */ 64 /* Calculation of the interpolated NLSF0 vector from the interpolation f actor, */
65 /* the previous NLSF1, and the current NLSF1 */ 65 /* the previous NLSF1, and the current NLSF1 */
66 for( i = 0; i < psDec->LPC_order; i++ ) { 66 for( i = 0; i < psDec->LPC_order; i++ ) {
67 pNLSF0_Q15[ i ] = psDec->prevNLSF_Q15[ i ] + silk_RSHIFT( silk_MUL( psDec->indices.NLSFInterpCoef_Q2, 67 pNLSF0_Q15[ i ] = psDec->prevNLSF_Q15[ i ] + silk_RSHIFT( silk_MUL( psDec->indices.NLSFInterpCoef_Q2,
68 pNLSF_Q15[ i ] - psDec->prevNLSF_Q15[ i ] ), 2 ); 68 pNLSF_Q15[ i ] - psDec->prevNLSF_Q15[ i ] ), 2 );
69 } 69 }
70 70
71 /* Convert NLSF parameters to AR prediction filter coefficients */ 71 /* Convert NLSF parameters to AR prediction filter coefficients */
72 silk_NLSF2A( psDecCtrl->PredCoef_Q12[ 0 ], pNLSF0_Q15, psDec->LPC_order ); 72 silk_NLSF2A( psDecCtrl->PredCoef_Q12[ 0 ], pNLSF0_Q15, psDec->LPC_order, psDec->arch );
73 } else { 73 } else {
74 /* Copy LPC coefficients for first half from second half */ 74 /* Copy LPC coefficients for first half from second half */
75 silk_memcpy( psDecCtrl->PredCoef_Q12[ 0 ], psDecCtrl->PredCoef_Q12[ 1 ], psDec->LPC_order * sizeof( opus_int16 ) ); 75 silk_memcpy( psDecCtrl->PredCoef_Q12[ 0 ], psDecCtrl->PredCoef_Q12[ 1 ], psDec->LPC_order * sizeof( opus_int16 ) );
76 } 76 }
77 77
78 silk_memcpy( psDec->prevNLSF_Q15, pNLSF_Q15, psDec->LPC_order * sizeof( opus _int16 ) ); 78 silk_memcpy( psDec->prevNLSF_Q15, pNLSF_Q15, psDec->LPC_order * sizeof( opus _int16 ) );
79 79
80 /* After a packet loss do BWE of LPC coefs */ 80 /* After a packet loss do BWE of LPC coefs */
81 if( psDec->lossCnt ) { 81 if( psDec->lossCnt ) {
82 silk_bwexpander( psDecCtrl->PredCoef_Q12[ 0 ], psDec->LPC_order, BWE_AFT ER_LOSS_Q16 ); 82 silk_bwexpander( psDecCtrl->PredCoef_Q12[ 0 ], psDec->LPC_order, BWE_AFT ER_LOSS_Q16 );
(...skipping 23 matching lines...) Expand all
106 /**********************/ 106 /**********************/
107 Ix = psDec->indices.LTP_scaleIndex; 107 Ix = psDec->indices.LTP_scaleIndex;
108 psDecCtrl->LTP_scale_Q14 = silk_LTPScales_table_Q14[ Ix ]; 108 psDecCtrl->LTP_scale_Q14 = silk_LTPScales_table_Q14[ Ix ];
109 } else { 109 } else {
110 silk_memset( psDecCtrl->pitchL, 0, psDec->nb_subfr * si zeof( opus_int ) ); 110 silk_memset( psDecCtrl->pitchL, 0, psDec->nb_subfr * si zeof( opus_int ) );
111 silk_memset( psDecCtrl->LTPCoef_Q14, 0, LTP_ORDER * psDec->nb_subfr * si zeof( opus_int16 ) ); 111 silk_memset( psDecCtrl->LTPCoef_Q14, 0, LTP_ORDER * psDec->nb_subfr * si zeof( opus_int16 ) );
112 psDec->indices.PERIndex = 0; 112 psDec->indices.PERIndex = 0;
113 psDecCtrl->LTP_scale_Q14 = 0; 113 psDecCtrl->LTP_scale_Q14 = 0;
114 } 114 }
115 } 115 }
OLDNEW
« no previous file with comments | « third_party/opus/src/silk/decode_frame.c ('k') | third_party/opus/src/silk/define.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698