comparison libtwamr/ph_disp.h @ 390:bde9f5804670

libtwamr: integrate ph_disp.c
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 06 May 2024 18:20:22 +0000
parents
children
comparison
equal deleted inserted replaced
389:9cd332a94c97 390:bde9f5804670
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 : ph_disp.h
11 * Purpose : Phase dispersion of excitation signal
12 *
13 ********************************************************************************
14 */
15
16 #ifndef ph_disp_h
17 #define ph_disp_h "$Id $"
18
19 /*
20 ********************************************************************************
21 * INCLUDE FILES
22 ********************************************************************************
23 */
24 #include "tw_amr.h"
25 #include "typedef.h"
26
27 /*
28 ********************************************************************************
29 * LOCAL VARIABLES AND TABLES
30 ********************************************************************************
31 */
32 #define PHDGAINMEMSIZE 5
33 #define PHDTHR1LTP 9830 /* 0.6 in Q14 */
34 #define PHDTHR2LTP 14746 /* 0.9 in Q14 */
35 #define ONFACTPLUS1 16384 /* 2.0 in Q13 */
36 #define ONLENGTH 2
37 /*
38 ********************************************************************************
39 * DEFINITION OF DATA TYPES
40 ********************************************************************************
41 */
42 typedef struct {
43 Word16 gainMem[PHDGAINMEMSIZE];
44 Word16 prevState;
45 Word16 prevCbGain;
46 Word16 lockFull;
47 Word16 onset;
48 } ph_dispState;
49
50 /*
51 ********************************************************************************
52 * DECLARATION OF PROTOTYPES
53 ********************************************************************************
54 */
55
56 /*************************************************************************
57 *
58 * Function: ph_disp_reset
59 * Purpose: Initializes state memory
60 *
61 **************************************************************************
62 */
63 void ph_disp_reset (ph_dispState *state);
64
65 /*************************************************************************
66 *
67 * Function: ph_disp_lock
68 * Purpose: mark phase dispersion as locked in state struct
69 *
70 **************************************************************************
71 */
72 void ph_disp_lock (ph_dispState *state);
73
74 /*************************************************************************
75 *
76 * Function: ph_disp_release
77 * Purpose: mark phase dispersion as unlocked in state struct
78 *
79 **************************************************************************
80 */
81 void ph_disp_release (ph_dispState *state);
82
83 /*************************************************************************
84 *
85 * Function: ph_disp
86 * Purpose: perform phase dispersion according to the specified codec
87 * mode and computes total excitation for synthesis part
88 * if decoder
89 *
90 **************************************************************************
91 */
92 void ph_disp (
93 ph_dispState *state, /* i/o : State struct */
94 enum Mode mode, /* i : codec mode */
95 Word16 x[], /* i/o Q0 : in: LTP excitation signal */
96 /* out: total excitation signal */
97 Word16 cbGain, /* i Q1 : Codebook gain */
98 Word16 ltpGain, /* i Q14 : LTP gain */
99 Word16 inno[], /* i Q13 : Innovation vector (Q12 for 12.2) */
100 Word16 pitch_fac, /* i Q14 : pitch factor used to scale the
101 LTP excitation (Q13 for 12.2) */
102 Word16 tmp_shift /* i Q0 : shift factor applied to sum of
103 scaled LTP ex & innov. before
104 rounding */
105 );
106
107 #endif