comparison libtwamr/b_cn_cod.h @ 255:07f936338de1

libtwamr: integrated up to b_cn_cod.c
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 05 Apr 2024 17:31:49 +0000
parents
children
comparison
equal deleted inserted replaced
254:f931e704adc5 255:07f936338de1
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 : b_cn_cod.h
11 * Purpose : Contains function for comfort noise generation.
12 *
13 ********************************************************************************
14 */
15 #ifndef b_cn_cod_h
16 #define b_cn_cod_h "$Id $"
17
18 /*
19 ********************************************************************************
20 * INCLUDE FILES
21 ********************************************************************************
22 */
23 #include "typedef.h"
24
25 /*
26 ********************************************************************************
27 * DEFINITION OF DATA TYPES
28 ********************************************************************************
29 */
30
31 /*
32 ********************************************************************************
33 * DECLARATION OF PROTOTYPES
34 ********************************************************************************
35 */
36
37 /*************************************************************************
38 *
39 * FUNCTION NAME: pseudonoise
40 *
41 * PURPOSE: Generate a random integer value to use in comfort noise
42 * generation. The algorithm uses polynomial x^31 + x^3 + 1
43 * (length of PN sequence is 2^31 - 1).
44 *
45 * INPUTS: *shift_reg Old CN generator shift register state
46 *
47 *
48 * OUTPUTS: *shift_reg Updated CN generator shift register state
49 *
50 * RETURN VALUE: Generated random integer value
51 *
52 *************************************************************************/
53
54 Word16 pseudonoise (
55 Word32 *shift_reg, /* i/o : Old CN generator shift register state */
56 Word16 no_bits /* i : Number of bits */
57 );
58
59 /*************************************************************************
60 *
61 * FUNCTION NAME: build_CN_code
62 *
63 * PURPOSE: Compute the comfort noise fixed codebook excitation. The
64 * gains of the pulses are always +/-1.
65 *
66 * INPUTS: *seed Old CN generator shift register state
67 *
68 * OUTPUTS: cod[0..39] Generated comfort noise fixed codebook vector
69 * *seed Updated CN generator shift register state
70 *
71 * RETURN VALUE: none
72 *
73 *************************************************************************/
74 void build_CN_code (
75 Word32 *seed, /* i/o : Old CN generator shift register state */
76 Word16 cod[] /* o : Generated CN fixed codebook vector */
77 );
78
79 /*************************************************************************
80 *
81 * FUNCTION NAME: build_CN_param
82 *
83 * PURPOSE: Randomize the speech parameters. So that they
84 * do not produce tonal artifacts if used by ECU.
85 *
86 * INPUTS: *seed Old CN generator shift register state
87 * n_param, Number of parameters to randomize
88 * parm_size_table,
89 *
90 *
91 * OUTPUTS: parm CN Generated Parameters
92 * *seed Updated CN generator shift register state
93 *
94 * RETURN VALUE: none
95 *
96 *************************************************************************/
97 void build_CN_param (
98 Word16 *seed, /* i/o : Old CN generator shift register state */
99 const Word16 n_param, /* i : number of params */
100 const Word16 param_size_table[], /* i : size of params */
101 Word16 parm[] /* o : CN Generated Params*/
102 );
103
104 #endif