comparison libtwamr/gain_q.h @ 378:ccba5812fa44

libtwamr: integrate gain_q.c
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 06 May 2024 04:38:55 +0000
parents
children
comparison
equal deleted inserted replaced
377:b02e043dcba0 378:ccba5812fa44
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 : gainQuant.h
11 * Purpose : Quantazation of gains
12 *
13 ********************************************************************************
14 */
15 #ifndef gain_q_h
16 #define gain_q_h "$Id $"
17
18 /*
19 ********************************************************************************
20 * INCLUDE FILES
21 ********************************************************************************
22 */
23 #include "tw_amr.h"
24 #include "typedef.h"
25 #include "gc_pred.h"
26 #include "g_adapt.h"
27
28 /*
29 ********************************************************************************
30 * DEFINITION OF DATA TYPES
31 ********************************************************************************
32 */
33 typedef struct {
34 Word16 sf0_exp_gcode0;
35 Word16 sf0_frac_gcode0;
36 Word16 sf0_exp_target_en;
37 Word16 sf0_frac_target_en;
38 Word16 sf0_exp_coeff[5];
39 Word16 sf0_frac_coeff[5];
40 Word16 *gain_idx_ptr;
41 gc_predState gc_predSt;
42 gc_predState gc_predUnqSt;
43 GainAdaptState adaptSt;
44 } gainQuantState;
45
46 /*
47 ********************************************************************************
48 * DECLARATION OF PROTOTYPES
49 ********************************************************************************
50 */
51 void gainQuant_reset (gainQuantState *st);
52 /* reset of pre processing state (i.e. set state memory to zero)
53 returns 0 on success
54 */
55
56 int gainQuant(
57 gainQuantState *st, /* i/o : State struct */
58 enum Mode mode, /* i : coder mode */
59 Word16 res[], /* i : LP residual, Q0 */
60 Word16 exc[], /* i : LTP excitation (unfiltered), Q0 */
61 Word16 code[], /* i : CB innovation (unfiltered), Q13 */
62 /* (unsharpened for MR475) */
63 Word16 xn[], /* i : Target vector. */
64 Word16 xn2[], /* i : Target vector. */
65 Word16 y1[], /* i : Adaptive codebook. */
66 Word16 Y2[], /* i : Filtered innovative vector. */
67 Word16 g_coeff[], /* i : Correlations <xn y1> <y1 y1> */
68 /* Compute in G_pitch(). */
69 Word16 even_subframe, /* i : even subframe indicator flag */
70 Word16 gp_limit, /* i : pitch gain limit */
71 Word16 *sf0_gain_pit, /* o : Pitch gain sf 0. MR475 */
72 Word16 *sf0_gain_cod, /* o : Code gain sf 0. MR475 */
73 Word16 *gain_pit, /* i/o : Pitch gain. */
74 Word16 *gain_cod, /* o : Code gain. */
75 /* MR475: gain_* unquantized in even */
76 /* subframes, quantized otherwise */
77 Word16 **anap /* o : Index of quantization */
78 );
79
80 #endif