forked from nostar/imbe_vocoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aux_sub.h
133 lines (123 loc) · 3.74 KB
/
aux_sub.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
* Project 25 IMBE Encoder/Decoder Fixed-Point implementation
* Developed by Pavel Yazev E-mail: [email protected]
* Version 1.0 (c) Copyright 2009
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* The software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Boston, MA
* 02110-1301, USA.
*/
#ifndef _AUX_SUB
#define _AUX_SUB
//-----------------------------------------------------------------------------
// PURPOSE:
// Return pointer to bit allocation array
// according to the number of harmonics
//
// INPUT:
// num_harms - The number of harmonics
//
// OUTPUT:
// None
//
// RETURN:
// Pointer to bits allocation array
//
//-----------------------------------------------------------------------------
const UWord16 *get_bit_allocation_arr(Word16 num_harms);
//-----------------------------------------------------------------------------
// PURPOSE:
// Unpack bit allocation table's item
//
// INPUT:
// num_harms - The number of harmonics
// ptr - Pointer to buffer to place bit allocation data
//
// OUTPUT:
// Unpacked bit allocation table
//
// RETURN:
// None
//
//-----------------------------------------------------------------------------
void get_bit_allocation(Word16 num_harms, Word16 *ptr);
//-----------------------------------------------------------------------------
// PURPOSE:
// Set the elements of a 16 bit input vector to zero.
//
// INPUT:
// vec - Pointer to vector
// n - size of vec
//
// OUTPUT:
// None
//
// RETURN:
// None
//
//-----------------------------------------------------------------------------
void v_zap(Word16 *vec, Word16 n);
//-----------------------------------------------------------------------------
// PURPOSE:
// Copy the contents of one 16 bit input vector to another
//
// INPUT:
// vec1 - Pointer to the destination vector
// vec2 - Pointer to the source vector
// n - size of data should be copied
//
// OUTPUT:
// Copy of the source vector
//
// RETURN:
// None
//
//-----------------------------------------------------------------------------
void v_equ(Word16 *vec1, Word16 *vec2, Word16 n);
//-----------------------------------------------------------------------------
// PURPOSE:
// Compute the sum of square magnitude of a 16 bit input vector
// with saturation and truncation. Output is a 32 bit number.
//
// INPUT:
// vec - Pointer to the vector
// n - size of input vectors
//
// OUTPUT:
// none
//
// RETURN:
// 32 bit long signed integer result
//
//-----------------------------------------------------------------------------
Word32 L_v_magsq(Word16 *vec, Word16 n);
//-----------------------------------------------------------------------------
// PURPOSE:
// Copy the contents of one 16 bit input vector to another with shift
//
// INPUT:
// vec1 - Pointer to the destination vector
// vec2 - Pointer to the source vector
// scale - right shift factor
// n - size of data should be copied
//
// OUTPUT:
// Copy of the source vector
//
// RETURN:
// None
//
//-----------------------------------------------------------------------------
void v_equ_shr(Word16 *vec1, Word16 *vec2, Word16 scale, Word16 n);
#endif