Line data Source code
1 : /*====================================================================================
2 : EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0
3 : ====================================================================================*/
4 :
5 :
6 : /* Header files */
7 : #include <assert.h>
8 : #include <stdint.h>
9 : #include "options.h"
10 : #include "basop_util.h"
11 : #include "prot_fx.h"
12 : /* Constants */
13 : #define M 16
14 :
15 199627 : void lpc_unquantize_fx(
16 : Decoder_State *st,
17 : Word16 *lsf, /*x2.56*/
18 : Word16 *lsp, /*Q15*/
19 : const Word16 m,
20 : Word16 *param_lpc, /*Q0*/
21 : Word16 *lspmid, /*Q15*/
22 : Word16 *lsfmid, /*x2.56*/
23 : Word16 coder_type,
24 : Word16 *LSF_Q_prediction /* o : LSF prediction mode Q0*/
25 : )
26 : {
27 : Word16 nb_indices, k;
28 : Word16 i;
29 :
30 199627 : nb_indices = 0; /* to avoid compilation warnings */
31 199627 : move16();
32 :
33 199627 : Copy( st->lsf_old_fx, &lsf[0], m ); /*x2.56*/
34 199627 : Copy( st->lsp_old_fx, &lsp[0], m ); /*x2.56*/
35 :
36 199627 : IF( st->lpcQuantization == 0 )
37 : {
38 101170 : nb_indices = dlpc_avq_fx( param_lpc, &lsf[m], st->numlpc, st->sr_core ); /*Q0*/
39 204282 : FOR( k = 0; k < st->numlpc; k++ )
40 : {
41 103112 : E_LPC_lsf_lsp_conversion( &lsf[( ( k + 1 ) * m )], &lsp[( ( k + 1 ) * m )], m ); /*Q15*/
42 : }
43 : }
44 98457 : ELSE IF( EQ_16( st->lpcQuantization, 1 ) )
45 : {
46 98457 : test();
47 98457 : IF( ( EQ_32( st->sr_core, INT_FS_16k ) ) && ( EQ_16( coder_type, UNVOICED ) ) )
48 : {
49 26 : lsf_end_dec_fx( st, 1, GENERIC, sub( 1, st->narrowBand ) /* st->bwidth */, ENDLSF_NBITS, &lsf[m], param_lpc, LSF_Q_prediction, &nb_indices,
50 : NULL );
51 : }
52 : ELSE
53 : {
54 98431 : IF( EQ_16( st->core, TCX_20_CORE ) )
55 : {
56 97847 : lsf_end_dec_fx( st, 1, AUDIO, sub( 1, st->narrowBand ) /* st->bwidth */, ENDLSF_NBITS, &lsf[m], param_lpc, LSF_Q_prediction, &nb_indices,
57 : NULL );
58 : }
59 : ELSE
60 : {
61 584 : lsf_end_dec_fx( st, 1, coder_type, sub( 1, st->narrowBand ) /* st->bwidth */, ENDLSF_NBITS, &lsf[m], param_lpc, LSF_Q_prediction, &nb_indices,
62 : NULL );
63 : }
64 : }
65 :
66 98457 : lsf2lsp_fx( &lsf[m], &lsp[m], M, st->sr_core ); /*Q15*/
67 : }
68 : ELSE
69 : {
70 0 : assert( 0 );
71 : }
72 :
73 199627 : st->seed_acelp = 0;
74 199627 : move16();
75 1527819 : FOR( i = nb_indices - 1; i >= 0; i-- )
76 : {
77 1328192 : st->seed_acelp = extract_l( L_mac0( L_mac0( 13849 /*Q0*/, shr( st->seed_acelp, 1 ), 31821 /*Q0*/ ), param_lpc[i], 31821 /*Q0*/ ) ); /*Q0*/
78 : }
79 :
80 : /* Decoded mid-frame isf */
81 199627 : test();
82 199627 : test();
83 199627 : test();
84 199627 : IF( st->lpcQuantization && st->acelp_cfg.midLpc && EQ_16( st->core, ACELP_CORE ) && st->rate_switching_reset == 0 )
85 : {
86 337 : midlsf_dec( &lsf[0], &lsf[m], param_lpc[nb_indices], lsfmid, coder_type, &( st->mid_lsf_int ), st->prev_bfi, st->safety_net ); /*3Q12*/
87 337 : reorder_lsf_fx( lsfmid, LSF_GAP_MID_FX, M, st->sr_core ); /*x2.56*/
88 337 : lsf2lsp_fx( lsfmid, lspmid, M, st->sr_core ); /*Q15*/
89 : }
90 :
91 :
92 199627 : return;
93 : }
|