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

Side by Side Diff: silk/fixed/find_pred_coefs_FIX.c

Issue 882843002: Update to opus-HEAD-66611f1. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/opus.git@master
Patch Set: Created 5 years, 10 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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 /**********/ 82 /**********/
83 /* VOICED */ 83 /* VOICED */
84 /**********/ 84 /**********/
85 silk_assert( psEnc->sCmn.ltp_mem_length - psEnc->sCmn.predictLPCOrder >= psEncCtrl->pitchL[ 0 ] + LTP_ORDER / 2 ); 85 silk_assert( psEnc->sCmn.ltp_mem_length - psEnc->sCmn.predictLPCOrder >= psEncCtrl->pitchL[ 0 ] + LTP_ORDER / 2 );
86 86
87 ALLOC( WLTP, psEnc->sCmn.nb_subfr * LTP_ORDER * LTP_ORDER, opus_int32 ); 87 ALLOC( WLTP, psEnc->sCmn.nb_subfr * LTP_ORDER * LTP_ORDER, opus_int32 );
88 88
89 /* LTP analysis */ 89 /* LTP analysis */
90 silk_find_LTP_FIX( psEncCtrl->LTPCoef_Q14, WLTP, &psEncCtrl->LTPredCodGa in_Q7, 90 silk_find_LTP_FIX( psEncCtrl->LTPCoef_Q14, WLTP, &psEncCtrl->LTPredCodGa in_Q7,
91 res_pitch, psEncCtrl->pitchL, Wght_Q15, psEnc->sCmn.subfr_length, 91 res_pitch, psEncCtrl->pitchL, Wght_Q15, psEnc->sCmn.subfr_length,
92 psEnc->sCmn.nb_subfr, psEnc->sCmn.ltp_mem_length, LTP_corrs_rshift ) ; 92 psEnc->sCmn.nb_subfr, psEnc->sCmn.ltp_mem_length, LTP_corrs_rshift, psEnc->sCmn.arch );
93 93
94 /* Quantize LTP gain parameters */ 94 /* Quantize LTP gain parameters */
95 silk_quant_LTP_gains( psEncCtrl->LTPCoef_Q14, psEnc->sCmn.indices.LTPInd ex, &psEnc->sCmn.indices.PERIndex, 95 silk_quant_LTP_gains( psEncCtrl->LTPCoef_Q14, psEnc->sCmn.indices.LTPInd ex, &psEnc->sCmn.indices.PERIndex,
96 &psEnc->sCmn.sum_log_gain_Q7, WLTP, psEnc->sCmn.mu_LTP_Q9, psEnc->sC mn.LTPQuantLowComplexity, psEnc->sCmn.nb_subfr); 96 &psEnc->sCmn.sum_log_gain_Q7, WLTP, psEnc->sCmn.mu_LTP_Q9, psEnc->sC mn.LTPQuantLowComplexity, psEnc->sCmn.nb_subfr,
97 psEnc->sCmn.arch);
97 98
98 /* Control LTP scaling */ 99 /* Control LTP scaling */
99 silk_LTP_scale_ctrl_FIX( psEnc, psEncCtrl, condCoding ); 100 silk_LTP_scale_ctrl_FIX( psEnc, psEncCtrl, condCoding );
100 101
101 /* Create LTP residual */ 102 /* Create LTP residual */
102 silk_LTP_analysis_filter_FIX( LPC_in_pre, x - psEnc->sCmn.predictLPCOrde r, psEncCtrl->LTPCoef_Q14, 103 silk_LTP_analysis_filter_FIX( LPC_in_pre, x - psEnc->sCmn.predictLPCOrde r, psEncCtrl->LTPCoef_Q14,
103 psEncCtrl->pitchL, invGains_Q16, psEnc->sCmn.subfr_length, psEnc->sC mn.nb_subfr, psEnc->sCmn.predictLPCOrder ); 104 psEncCtrl->pitchL, invGains_Q16, psEnc->sCmn.subfr_length, psEnc->sC mn.nb_subfr, psEnc->sCmn.predictLPCOrder );
104 105
105 } else { 106 } else {
106 /************/ 107 /************/
107 /* UNVOICED */ 108 /* UNVOICED */
108 /************/ 109 /************/
109 /* Create signal with prepended subframes, scaled by inverse gains */ 110 /* Create signal with prepended subframes, scaled by inverse gains */
110 x_ptr = x - psEnc->sCmn.predictLPCOrder; 111 x_ptr = x - psEnc->sCmn.predictLPCOrder;
111 x_pre_ptr = LPC_in_pre; 112 x_pre_ptr = LPC_in_pre;
112 for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { 113 for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) {
113 silk_scale_copy_vector16( x_pre_ptr, x_ptr, invGains_Q16[ i ], 114 silk_scale_copy_vector16( x_pre_ptr, x_ptr, invGains_Q16[ i ],
114 psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder ); 115 psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder );
115 x_pre_ptr += psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder; 116 x_pre_ptr += psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder;
116 x_ptr += psEnc->sCmn.subfr_length; 117 x_ptr += psEnc->sCmn.subfr_length;
117 } 118 }
118 119
119 silk_memset( psEncCtrl->LTPCoef_Q14, 0, psEnc->sCmn.nb_subfr * LTP_ORDER * sizeof( opus_int16 ) ); 120 silk_memset( psEncCtrl->LTPCoef_Q14, 0, psEnc->sCmn.nb_subfr * LTP_ORDER * sizeof( opus_int16 ) );
120 psEncCtrl->LTPredCodGain_Q7 = 0; 121 psEncCtrl->LTPredCodGain_Q7 = 0;
121 » » psEnc->sCmn.sum_log_gain_Q7 = 0; 122 psEnc->sCmn.sum_log_gain_Q7 = 0;
122 } 123 }
123 124
124 /* Limit on total predictive coding gain */ 125 /* Limit on total predictive coding gain */
125 if( psEnc->sCmn.first_frame_after_reset ) { 126 if( psEnc->sCmn.first_frame_after_reset ) {
126 minInvGain_Q30 = SILK_FIX_CONST( 1.0f / MAX_PREDICTION_POWER_GAIN_AFTER_ RESET, 30 ); 127 minInvGain_Q30 = SILK_FIX_CONST( 1.0f / MAX_PREDICTION_POWER_GAIN_AFTER_ RESET, 30 );
127 } else { 128 } else {
128 minInvGain_Q30 = silk_log2lin( silk_SMLAWB( 16 << 7, (opus_int32)psEncCt rl->LTPredCodGain_Q7, SILK_FIX_CONST( 1.0 / 3, 16 ) ) ); /* Q16 */ 129 minInvGain_Q30 = silk_log2lin( silk_SMLAWB( 16 << 7, (opus_int32)psEncCt rl->LTPredCodGain_Q7, SILK_FIX_CONST( 1.0 / 3, 16 ) ) ); /* Q16 */
129 minInvGain_Q30 = silk_DIV32_varQ( minInvGain_Q30, 130 minInvGain_Q30 = silk_DIV32_varQ( minInvGain_Q30,
130 silk_SMULWW( SILK_FIX_CONST( MAX_PREDICTION_POWER_GAIN, 0 ), 131 silk_SMULWW( SILK_FIX_CONST( MAX_PREDICTION_POWER_GAIN, 0 ),
131 silk_SMLAWB( SILK_FIX_CONST( 0.25, 18 ), SILK_FIX_CONST( 0.75, 1 8 ), psEncCtrl->coding_quality_Q14 ) ), 14 ); 132 silk_SMLAWB( SILK_FIX_CONST( 0.25, 18 ), SILK_FIX_CONST( 0.75, 1 8 ), psEncCtrl->coding_quality_Q14 ) ), 14 );
132 } 133 }
133 134
134 /* LPC_in_pre contains the LTP-filtered input for voiced, and the unfiltered input for unvoiced */ 135 /* LPC_in_pre contains the LTP-filtered input for voiced, and the unfiltered input for unvoiced */
135 silk_find_LPC_FIX( &psEnc->sCmn, NLSF_Q15, LPC_in_pre, minInvGain_Q30 ); 136 silk_find_LPC_FIX( &psEnc->sCmn, NLSF_Q15, LPC_in_pre, minInvGain_Q30 );
136 137
137 /* Quantize LSFs */ 138 /* Quantize LSFs */
138 silk_process_NLSFs( &psEnc->sCmn, psEncCtrl->PredCoef_Q12, NLSF_Q15, psEnc-> sCmn.prev_NLSFq_Q15 ); 139 silk_process_NLSFs( &psEnc->sCmn, psEncCtrl->PredCoef_Q12, NLSF_Q15, psEnc-> sCmn.prev_NLSFq_Q15 );
139 140
140 /* Calculate residual energy using quantized LPC coefficients */ 141 /* Calculate residual energy using quantized LPC coefficients */
141 silk_residual_energy_FIX( psEncCtrl->ResNrg, psEncCtrl->ResNrgQ, LPC_in_pre, psEncCtrl->PredCoef_Q12, local_gains, 142 silk_residual_energy_FIX( psEncCtrl->ResNrg, psEncCtrl->ResNrgQ, LPC_in_pre, psEncCtrl->PredCoef_Q12, local_gains,
142 psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.predictLPCOr der ); 143 psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.predictLPCOr der, psEnc->sCmn.arch );
143 144
144 /* Copy to prediction struct for use in next frame for interpolation */ 145 /* Copy to prediction struct for use in next frame for interpolation */
145 silk_memcpy( psEnc->sCmn.prev_NLSFq_Q15, NLSF_Q15, sizeof( psEnc->sCmn.prev_ NLSFq_Q15 ) ); 146 silk_memcpy( psEnc->sCmn.prev_NLSFq_Q15, NLSF_Q15, sizeof( psEnc->sCmn.prev_ NLSFq_Q15 ) );
146 RESTORE_STACK; 147 RESTORE_STACK;
147 } 148 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698