comparison libtwamr/d_plsf.h @ 343:3f574255c3aa

libtwamr: integrate d_plsf.c
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 19 Apr 2024 01:08:39 +0000
parents
children
comparison
equal deleted inserted replaced
342:e42075184628 343:3f574255c3aa
1 /*
2 ********************************************************************************
3 *
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001
5 * R99 Version 3.3.0
6 * REL-4 Version 4.1.0
7 *
8 ********************************************************************************
9 *
10 * File : d_plsf.h
11 * Purpose : common part (init, exit, reset) of LSF decoder
12 * module (rest in d_plsf_3.c and d_plsf_5.c)
13 *
14 ********************************************************************************
15 */
16 #ifndef d_plsf_h
17 #define d_plsf_h "$Id $"
18
19 /*
20 ********************************************************************************
21 * INCLUDE FILES
22 ********************************************************************************
23 */
24 #include "tw_amr.h"
25 #include "typedef.h"
26 #include "cnst.h"
27
28 /*
29 ********************************************************************************
30 * LOCAL VARIABLES AND TABLES
31 ********************************************************************************
32 */
33 /*
34 *--------------------------------------------------*
35 * Constants (defined in cnst.h) *
36 *--------------------------------------------------*
37 * M : LPC Order *
38 *--------------------------------------------------*
39 */
40
41 /*
42 ********************************************************************************
43 * DEFINITION OF DATA TYPES
44 ********************************************************************************
45 */
46 typedef struct {
47 Word16 past_r_q[M]; /* Past quantized prediction error, Q15 */
48 Word16 past_lsf_q[M]; /* Past dequantized lsfs, Q15 */
49 } D_plsfState;
50
51 /*
52 ********************************************************************************
53 * DECLARATION OF PROTOTYPES
54 ********************************************************************************
55 */
56
57 /*
58 **************************************************************************
59 *
60 * Function : D_plsf_reset
61 * Purpose : Resets state memory
62 * Returns : 0 on success
63 *
64 **************************************************************************
65 */
66 void D_plsf_reset (D_plsfState *st);
67
68 /*
69 **************************************************************************
70 *
71 * Function : D_plsf_5
72 * Purpose : Decodes the 2 sets of LSP parameters in a frame
73 * using the received quantization indices.
74 * Description : The two sets of LSFs are quantized using split by
75 * 5 matrix quantization (split-MQ) with 1st order MA
76 * prediction.
77 * See "q_plsf_5.c" for more details about the
78 * quantization procedure
79 * Returns : 0
80 *
81 **************************************************************************
82 */
83 int D_plsf_5 (
84 D_plsfState *st, /* i/o: State variables */
85 Word16 bfi, /* i : bad frame indicator (set to 1 if a bad
86 frame is received) */
87 Word16 *indice, /* i : quantization indices of 5 submatrices, Q0 */
88 Word16 *lsp1_q, /* o : quantized 1st LSP vector (M) Q15 */
89 Word16 *lsp2_q /* o : quantized 2nd LSP vector (M) Q15 */
90 );
91
92 /*************************************************************************
93 *
94 * FUNCTION: D_plsf_3()
95 *
96 * PURPOSE: Decodes the LSP parameters using the received quantization
97 * indices.1st order MA prediction and split by 3 matrix
98 * quantization (split-MQ)
99 *
100 *************************************************************************/
101
102 void D_plsf_3(
103 D_plsfState *st, /* i/o: State struct */
104 enum Mode mode, /* i : coder mode */
105 Word16 bfi, /* i : bad frame indicator (set to 1 if a */
106 /* bad frame is received) */
107 Word16 * indice, /* i : quantization indices of 3 submatrices, Q0 */
108 Word16 * lsp1_q /* o : quantized 1st LSP vector, Q15 */
109 );
110
111 /*************************************************************************
112 *
113 * FUNCTION: Init_D_plsf_3()
114 *
115 * PURPOSE: Set the past_r_q[M] vector to one of the eight
116 * past_rq_init vectors.
117 *
118 *************************************************************************/
119 void Init_D_plsf_3(D_plsfState *st, /* i/o: State struct */
120 Word16 index /* i : past_rq_init[] index [0, 7] */
121 );
122
123 #endif