annotate libtwamr/d_plsf.h @ 352:99661127ca53

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