FreeCalypso > hg > gsm-codec-lib
annotate libgsmfr2/pp_bad.c @ 261:cfcb3ce9c778
libgsmfr2: implement gsmfr_unpack_to_array()
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 12 Apr 2024 23:29:18 +0000 |
parents | a33edf624061 |
children | 573afa985df6 |
rev | line source |
---|---|
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
2 * In this module we implement our handling of BFI frame gaps |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
3 * and invalid SID frames. |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <stdint.h> |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <string.h> |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
8 #include "tw_gsmfr.h" |
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
9 #include "pp_internal.h" |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
11 static int reduce_xmaxc(uint8_t *frame) |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 { |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 int mute_flag = 1; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 unsigned sub, xmaxc; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 for (sub = 0; sub < 4; sub++) { |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 xmaxc = ((frame[sub*7+6] & 0x1F) << 1) | (frame[sub*7+7] >> 7); |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 if (xmaxc > 4) { |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 xmaxc -= 4; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 mute_flag = 0; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 } else |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 xmaxc = 0; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 frame[sub*7+6] &= 0xE0; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 frame[sub*7+6] |= xmaxc >> 1; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 frame[sub*7+7] &= 0x7F; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 frame[sub*7+7] |= (xmaxc & 1) << 7; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 } |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 return mute_flag; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 } |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
31 static void random_grid_pos(struct gsmfr_preproc_state *st, uint8_t *frame) |
109
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
32 { |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
33 unsigned sub, Mc; |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
34 |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
35 for (sub = 0; sub < 4; sub++) { |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
36 Mc = gsmfr_preproc_prng(st, 2); |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
37 frame[sub*7+6] &= 0x9F; |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
38 frame[sub*7+6] |= Mc << 5; |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
39 } |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
40 } |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
41 |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
42 static int reduce_xmaxc_sid(struct gsmfr_preproc_state *st) |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
43 { |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
44 if (st->sid_xmaxc > 4) { |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
45 st->sid_xmaxc -= 4; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
46 return 0; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
47 } else { |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
48 st->sid_xmaxc = 0; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
49 return 1; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
50 } |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
51 } |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
52 |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
53 void gsmfr_preproc_bfi(struct gsmfr_preproc_state *st, int taf, uint8_t *frame) |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 { |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 int mute; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 switch (st->rx_state) { |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 case NO_DATA: |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
59 memcpy(frame, &gsmfr_preproc_silence_frame, |
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
60 GSMFR_RTP_FRAME_LEN); |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 return; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 case SPEECH: |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
63 memcpy(frame, &st->speech_frame, GSMFR_RTP_FRAME_LEN); |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 st->rx_state = SPEECH_MUTING; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 return; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 case SPEECH_MUTING: |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 mute = reduce_xmaxc(st->speech_frame); |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
68 memcpy(frame, &st->speech_frame, GSMFR_RTP_FRAME_LEN); |
109
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
69 random_grid_pos(st, frame); |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 if (mute) |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 st->rx_state = NO_DATA; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 return; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 case COMFORT_NOISE: |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 if (taf) |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 st->rx_state = LOST_SID; |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
76 gsmfr_preproc_gen_cn(st, frame); |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 return; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 case LOST_SID: |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
79 if (taf) { |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
80 st->rx_state = CN_MUTING; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
81 reduce_xmaxc_sid(st); |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
82 } |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 gsmfr_preproc_gen_cn(st, frame); |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
84 return; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
85 case CN_MUTING: |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
86 if (reduce_xmaxc_sid(st)) { |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 st->rx_state = NO_DATA; |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
88 memcpy(frame, &gsmfr_preproc_silence_frame, |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
89 GSMFR_RTP_FRAME_LEN); |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
90 } else |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
91 gsmfr_preproc_gen_cn(st, frame); |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 return; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 } |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 } |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
95 |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
96 void gsmfr_preproc_invalid_sid(struct gsmfr_preproc_state *st, uint8_t *frame) |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
97 { |
248
6ac547f0b903
libgsmfrp: yet another invalid SID logic change, for 1.0.2
Mychaela Falconia <falcon@freecalypso.org>
parents:
242
diff
changeset
|
98 int mute; |
6ac547f0b903
libgsmfrp: yet another invalid SID logic change, for 1.0.2
Mychaela Falconia <falcon@freecalypso.org>
parents:
242
diff
changeset
|
99 |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
100 switch (st->rx_state) { |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
101 case NO_DATA: |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
102 memcpy(frame, &gsmfr_preproc_silence_frame, |
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
103 GSMFR_RTP_FRAME_LEN); |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
104 return; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
105 case SPEECH: |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
106 /* |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
107 * Make CN out of the last good speech frame, following the |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
108 * "NOTE" at the end of section 6.1.2 in TS 46.031. |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
109 */ |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
110 st->rx_state = COMFORT_NOISE; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
111 memcpy(st->sid_prefix, &st->speech_frame, 5); |
248
6ac547f0b903
libgsmfrp: yet another invalid SID logic change, for 1.0.2
Mychaela Falconia <falcon@freecalypso.org>
parents:
242
diff
changeset
|
112 st->sid_xmaxc = gsmfr_preproc_xmaxc_mean(st->speech_frame); |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
113 gsmfr_preproc_gen_cn(st, frame); |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
114 return; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
115 case SPEECH_MUTING: |
248
6ac547f0b903
libgsmfrp: yet another invalid SID logic change, for 1.0.2
Mychaela Falconia <falcon@freecalypso.org>
parents:
242
diff
changeset
|
116 /* ignore invalid SID in this state and act as if we got BFI */ |
6ac547f0b903
libgsmfrp: yet another invalid SID logic change, for 1.0.2
Mychaela Falconia <falcon@freecalypso.org>
parents:
242
diff
changeset
|
117 mute = reduce_xmaxc(st->speech_frame); |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
118 memcpy(frame, &st->speech_frame, GSMFR_RTP_FRAME_LEN); |
248
6ac547f0b903
libgsmfrp: yet another invalid SID logic change, for 1.0.2
Mychaela Falconia <falcon@freecalypso.org>
parents:
242
diff
changeset
|
119 random_grid_pos(st, frame); |
6ac547f0b903
libgsmfrp: yet another invalid SID logic change, for 1.0.2
Mychaela Falconia <falcon@freecalypso.org>
parents:
242
diff
changeset
|
120 if (mute) |
6ac547f0b903
libgsmfrp: yet another invalid SID logic change, for 1.0.2
Mychaela Falconia <falcon@freecalypso.org>
parents:
242
diff
changeset
|
121 st->rx_state = NO_DATA; |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
122 return; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
123 case COMFORT_NOISE: |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
124 case LOST_SID: |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
125 st->rx_state = COMFORT_NOISE; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
126 gsmfr_preproc_gen_cn(st, frame); |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
127 return; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
128 case CN_MUTING: |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
129 if (reduce_xmaxc_sid(st)) { |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
130 st->rx_state = NO_DATA; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
131 memcpy(frame, &gsmfr_preproc_silence_frame, |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
132 GSMFR_RTP_FRAME_LEN); |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
133 } else |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
134 gsmfr_preproc_gen_cn(st, frame); |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
135 return; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
136 } |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
137 } |