comparison libtwamr/bgnscd.h @ 308:8dfb7cbe6b59

libtwamr: integrated up to bgnscd.c
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 16 Apr 2024 17:57:21 +0000
parents
children
comparison
equal deleted inserted replaced
307:6b33f3ba4289 308:8dfb7cbe6b59
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 : bgnscd.h
11 * Purpose : Background noise source charateristic detector (SCD)
12 *
13 ********************************************************************************
14 */
15 #ifndef bgnscd_h
16 #define bgnscd_h "$Id $"
17
18 /*
19 ********************************************************************************
20 * INCLUDE FILES
21 ********************************************************************************
22 */
23 #include "typedef.h"
24 #include "cnst.h"
25
26 /*
27 ********************************************************************************
28 * LOCAL VARIABLES AND TABLES
29 ********************************************************************************
30 */
31 #define L_ENERGYHIST 60
32 #define INV_L_FRAME 102
33
34
35 /* 2*(160*x)^2 / 65536 where x is FLP values 150,5 and 50 */
36 #define FRAMEENERGYLIMIT 17578 /* 150 */
37 #define LOWERNOISELIMIT 20 /* 5 */
38 #define UPPERNOISELIMIT 1953 /* 50 */
39
40 /*
41 ********************************************************************************
42 * DEFINITION OF DATA TYPES
43 ********************************************************************************
44 */
45 typedef struct{
46 /* history vector of past synthesis speech energy */
47 Word16 frameEnergyHist[L_ENERGYHIST];
48
49 /* state flags */
50 Word16 bgHangover; /* counter; number of frames after last speech frame */
51
52 } Bgn_scdState;
53
54 /*
55 ********************************************************************************
56 * DECLARATION OF PROTOTYPES
57 ********************************************************************************
58 */
59 /*
60 **************************************************************************
61 *
62 * Function : Bgn_scd_reset
63 * Purpose : Resets state memory
64 * Returns : 0 on success
65 *
66 **************************************************************************
67 */
68 void Bgn_scd_reset (Bgn_scdState *st);
69
70 /*
71 **************************************************************************
72 *
73 * Function : Bgn_scd
74 * Purpose : Charaterice synthesis speech and detect background noise
75 * Returns : background noise decision; 0 = bgn, 1 = no bgn
76 *
77 **************************************************************************
78 */
79 Word16 Bgn_scd (Bgn_scdState *st, /* i : State variables for bgn SCD */
80 Word16 ltpGainHist[], /* i : LTP gain history */
81 Word16 speech[], /* o : synthesis speech frame */
82 Word16 *voicedHangover /* o : # of frames after last voiced frame */
83 );
84
85 #endif