annotate libtwamr/int_lpc.h @ 409:4184ccc136a3

libtwamr/typedef.h: drop Pfloat from EFR, not used in AMR
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 07 May 2024 01:04:17 +0000
parents 32bc48faec4b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
381
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 ********************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * R99 Version 3.3.0
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * REL-4 Version 4.1.0
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 ********************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 * File : int_lpc.h
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 * Purpose : Interpolates the LSPs and converts to LPC parameters
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 ********************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 #ifndef int_lpc_h
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 #define int_lpc_h "$Id $"
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 /*
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 ********************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 * INCLUDE FILES
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 ********************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #include "typedef.h"
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 /*
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 ********************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 * DEFINITION OF DATA TYPES
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 ********************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 /*
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 ********************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 * DECLARATION OF PROTOTYPES
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 ********************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 /*
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 **************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 * Function : Int_lpc_1and3
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 * Purpose : Interpolates the LSPs and converts to LPC parameters
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 * to get a different LP filter in each subframe.
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 * Description : The 20 ms speech frame is divided into 4 subframes.
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 * The LSPs are quantized and transmitted at the 2nd and
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 * 4th subframes (twice per frame) and interpolated at the
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 * 1st and 3rd subframe.
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 * |------|------|------|------|
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 * sf1 sf2 sf3 sf4
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 * F0 Fm F1
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 * sf1: 1/2 Fm + 1/2 F0 sf3: 1/2 F1 + 1/2 Fm
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 * sf2: Fm sf4: F1
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 * Returns : void
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 **************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 void Int_lpc_1and3 (
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 Word16 lsp_old[], /* i : LSP vector at the 4th subfr. of past frame (M) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 Word16 lsp_mid[], /* i : LSP vector at the 2nd subfr. of
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 present frame (M) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 Word16 lsp_new[], /* i : LSP vector at the 4th subfr. of
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 present frame (M) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 Word16 Az[] /* o : interpolated LP parameters in all subfr.
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 (AZ_SIZE) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 );
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 /*
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 **************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 * Function : Int_lpc_1and3_2
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 * Purpose : Interpolation of the LPC parameters. Same as the Int_lpc
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 * function but we do not recompute Az() for subframe 2 and
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 * 4 because it is already available.
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 * Returns : void
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 **************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 void Int_lpc_1and3_2 (
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 Word16 lsp_old[], /* i : LSP vector at the 4th subfr. of past frame (M) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 Word16 lsp_mid[], /* i : LSP vector at the 2nd subframe of
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 present frame (M) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 Word16 lsp_new[], /* i : LSP vector at the 4th subframe of
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 present frame (M) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 Word16 Az[] /* o :interpolated LP parameters
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 in subframes 1 and 3 (AZ_SIZE) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 );
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 /*
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 **************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 * Function : Int_lpc_1to3
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 * Purpose : Interpolates the LSPs and converts to LPC parameters
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 * to get a different LP filter in each subframe.
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 * Description : The 20 ms speech frame is divided into 4 subframes.
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 * The LSPs are quantized and transmitted at the 4th
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 * subframes (once per frame) and interpolated at the
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 * 1st, 2nd and 3rd subframe.
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 * |------|------|------|------|
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 * sf1 sf2 sf3 sf4
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 * F0 F1
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 * sf1: 3/4 F0 + 1/4 F1 sf3: 1/4 F0 + 3/4 F1
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 * sf2: 1/2 F0 + 1/2 F1 sf4: F1
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 * Returns : void
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 **************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 void Int_lpc_1to3 (
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 Word16 lsp_old[], /* i : LSP vector at the 4th SF of past frame (M) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 Word16 lsp_new[], /* i : LSP vector at the 4th SF of present frame (M) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 Word16 Az[] /* o : interpolated LP parameters in all SFs (AZ_SIZE) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 );
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 /*
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 **************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 * Function : Int_lpc_1to3_2
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 * Purpose : Interpolation of the LPC parameters. Same as the Int_lpc
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 * function but we do not recompute Az() for subframe 4
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 * because it is already available.
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 * Returns : void
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 *
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 **************************************************************************
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 void Int_lpc_1to3_2 (
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 Word16 lsp_old[], /* i : LSP vector at the 4th SF of past frame (M) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 Word16 lsp_new[], /* i : LSP vector at the 4th SF present frame (M) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 Word16 Az[] /* o :interpolated LP parameters in SFs 1, 2, 3
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 (AZ_SIZE) */
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 );
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132
32bc48faec4b libtwamr: integrate int_lpc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 #endif