SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
sdrbase
audio
audiog722.h
Go to the documentation of this file.
1
// Copyright (C) 2019 F4EXB //
3
// written by Edouard Griffiths //
4
// //
5
// This program is free software; you can redistribute it and/or modify //
6
// it under the terms of the GNU General Public License as published by //
7
// the Free Software Foundation as version 3 of the License, or //
8
// (at your option) any later version. //
9
// //
10
// This program is distributed in the hope that it will be useful, //
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
13
// GNU General Public License V3 for more details. //
14
// //
15
// You should have received a copy of the GNU General Public License //
16
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
18
19
#ifndef SDRBASE_AUDIO_AUDIOG722_H_
20
#define SDRBASE_AUDIO_AUDIOG722_H_
21
22
#include <stdint.h>
23
#include "
export.h
"
24
25
class
SDRBASE_API
AudioG722
26
{
27
public
:
28
AudioG722
();
29
~
AudioG722
();
30
void
init(
int
rate,
int
options);
31
int
encode(
uint8_t
g722_data[],
const
int16_t
amp[],
int
len);
32
33
private
:
34
struct
g722_encode_state
35
{
38
int
itu_test_mode
;
40
int
packed
;
42
int
eight_k
;
44
int
bits_per_sample
;
45
47
int
x[24];
48
49
struct
50
{
51
int
s
;
52
int
sp
;
53
int
sz
;
54
int
r[3];
55
int
a[3];
56
int
ap[3];
57
int
p[3];
58
int
d[7];
59
int
b[7];
60
int
bp[7];
61
int
sg[7];
62
int
nb
;
63
int
det
;
64
} band[2];
65
66
unsigned
int
in_buffer
;
67
int
in_bits
;
68
unsigned
int
out_buffer
;
69
int
out_bits
;
70
71
g722_encode_state
();
72
void
init(
int
rate,
int
options);
73
};
74
75
int16_t
saturate
(
int32_t
amp)
76
{
77
int16_t
amp16;
78
79
/* Hopefully this is optimized for the common case - not clipping */
80
amp16 = (
int16_t
) amp;
81
if
(amp == amp16) {
82
return
amp16;
83
}
84
85
if
(amp > INT16_MAX) {
86
return
INT16_MAX;
87
}
88
89
return
INT16_MIN;
90
}
91
92
void
block4(
int
band,
int
d);
93
94
g722_encode_state
state
;
95
96
static
const
int
q6[32];
97
static
const
int
iln[32];
98
static
const
int
ilp[32];
99
static
const
int
wl[8];
100
static
const
int
rl42[16];
101
static
const
int
ilb[32];
102
static
const
int
qm4[16];
103
static
const
int
qm2[4];
104
static
const
int
qmf_coeffs[12];
105
static
const
int
ihn[3];
106
static
const
int
ihp[3];
107
static
const
int
wh[3];
108
static
const
int
rh2[4];
109
};
110
111
112
#endif
/* SDRBASE_AUDIO_AUDIOG722_H_ */
int16_t
short int16_t
Definition:
rtptypes_win.h:43
export.h
AudioG722::g722_encode_state::in_bits
int in_bits
Definition:
audiog722.h:67
AudioG722::g722_encode_state::packed
int packed
Definition:
audiog722.h:40
AudioG722::g722_encode_state::nb
int nb
Definition:
audiog722.h:62
AudioG722::g722_encode_state::out_buffer
unsigned int out_buffer
Definition:
audiog722.h:68
uint8_t
unsigned char uint8_t
Definition:
rtptypes_win.h:42
AudioG722
Definition:
audiog722.h:25
int32_t
int int32_t
Definition:
rtptypes_win.h:45
AudioG722::g722_encode_state::s
int s
Definition:
audiog722.h:51
AudioG722::g722_encode_state::det
int det
Definition:
audiog722.h:63
AudioG722::g722_encode_state::eight_k
int eight_k
Definition:
audiog722.h:42
AudioG722::g722_encode_state::bits_per_sample
int bits_per_sample
Definition:
audiog722.h:44
AudioG722::g722_encode_state::sp
int sp
Definition:
audiog722.h:52
AudioG722::g722_encode_state::sz
int sz
Definition:
audiog722.h:53
AudioG722::state
g722_encode_state state
Definition:
audiog722.h:94
AudioG722::g722_encode_state
Definition:
audiog722.h:34
SDRBASE_API
#define SDRBASE_API
Definition:
export.h:40
AudioG722::saturate
int16_t saturate(int32_t amp)
Definition:
audiog722.h:75
AudioG722::g722_encode_state::out_bits
int out_bits
Definition:
audiog722.h:69
AudioG722::g722_encode_state::in_buffer
unsigned int in_buffer
Definition:
audiog722.h:66
AudioG722::g722_encode_state::itu_test_mode
int itu_test_mode
Definition:
audiog722.h:38
Generated on Fri Aug 2 2019 17:56:33 for SDRAngel by
1.8.13