FreeCalypso > hg > gsm-codec-lib
annotate libgsmfr2/pp_bad.c @ 352:99661127ca53
libtwamr/bitno.h: fix typo in comment
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 05 May 2024 20:54:51 +0000 |
parents | 573afa985df6 |
children | 405a84110997 |
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" |
262
573afa985df6
libgsmfr2: split pp_state.h from pp_internal.h
Mychaela Falconia <falcon@freecalypso.org>
parents:
256
diff
changeset
|
9 #include "pp_state.h" |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
10 #include "pp_internal.h" |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
12 static int reduce_xmaxc(uint8_t *frame) |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 { |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 int mute_flag = 1; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 unsigned sub, xmaxc; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 for (sub = 0; sub < 4; sub++) { |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 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
|
19 if (xmaxc > 4) { |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 xmaxc -= 4; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 mute_flag = 0; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 } else |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 xmaxc = 0; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 frame[sub*7+6] &= 0xE0; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 frame[sub*7+6] |= xmaxc >> 1; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 frame[sub*7+7] &= 0x7F; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 frame[sub*7+7] |= (xmaxc & 1) << 7; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 } |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 return mute_flag; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 } |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
32 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
|
33 { |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
34 unsigned sub, Mc; |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
35 |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
36 for (sub = 0; sub < 4; sub++) { |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
37 Mc = gsmfr_preproc_prng(st, 2); |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
38 frame[sub*7+6] &= 0x9F; |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
39 frame[sub*7+6] |= Mc << 5; |
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 } |
2361a7d8c1eb
libgsmfrp: randomize grid position params when muting speech,
Mychaela Falconia <falcon@freecalypso.org>
parents:
6
diff
changeset
|
42 |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
43 static int reduce_xmaxc_sid(struct gsmfr_preproc_state *st) |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
44 { |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
45 if (st->sid_xmaxc > 4) { |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
46 st->sid_xmaxc -= 4; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
47 return 0; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
48 } else { |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
49 st->sid_xmaxc = 0; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
50 return 1; |
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 } |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
53 |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
54 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
|
55 { |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 int mute; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 switch (st->rx_state) { |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 case NO_DATA: |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
60 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
|
61 GSMFR_RTP_FRAME_LEN); |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 return; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 case SPEECH: |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
64 memcpy(frame, &st->speech_frame, GSMFR_RTP_FRAME_LEN); |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 st->rx_state = SPEECH_MUTING; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 return; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 case SPEECH_MUTING: |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 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
|
69 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
|
70 random_grid_pos(st, frame); |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 if (mute) |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 st->rx_state = NO_DATA; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 return; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 case COMFORT_NOISE: |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 if (taf) |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 st->rx_state = LOST_SID; |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
77 gsmfr_preproc_gen_cn(st, frame); |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 return; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 case LOST_SID: |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
80 if (taf) { |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
81 st->rx_state = CN_MUTING; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
82 reduce_xmaxc_sid(st); |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
83 } |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 gsmfr_preproc_gen_cn(st, frame); |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
85 return; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
86 case CN_MUTING: |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
87 if (reduce_xmaxc_sid(st)) { |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 st->rx_state = NO_DATA; |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
89 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
|
90 GSMFR_RTP_FRAME_LEN); |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
91 } else |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
92 gsmfr_preproc_gen_cn(st, frame); |
6
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 return; |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 } |
b2255a5d0519
libgsmfrp: implement BFI handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 } |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
96 |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
97 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
|
98 { |
248
6ac547f0b903
libgsmfrp: yet another invalid SID logic change, for 1.0.2
Mychaela Falconia <falcon@freecalypso.org>
parents:
242
diff
changeset
|
99 int mute; |
6ac547f0b903
libgsmfrp: yet another invalid SID logic change, for 1.0.2
Mychaela Falconia <falcon@freecalypso.org>
parents:
242
diff
changeset
|
100 |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
101 switch (st->rx_state) { |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
102 case NO_DATA: |
256
a33edf624061
libgsmfr2: start with API definition and port of libgsmfrp code
Mychaela Falconia <falcon@freecalypso.org>
parents:
248
diff
changeset
|
103 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
|
104 GSMFR_RTP_FRAME_LEN); |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
105 return; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
106 case SPEECH: |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
107 /* |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
108 * 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
|
109 * "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
|
110 */ |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
111 st->rx_state = COMFORT_NOISE; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
112 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
|
113 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
|
114 gsmfr_preproc_gen_cn(st, frame); |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
115 return; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
116 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
|
117 /* 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
|
118 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
|
119 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
|
120 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
|
121 if (mute) |
6ac547f0b903
libgsmfrp: yet another invalid SID logic change, for 1.0.2
Mychaela Falconia <falcon@freecalypso.org>
parents:
242
diff
changeset
|
122 st->rx_state = NO_DATA; |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
123 return; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
124 case COMFORT_NOISE: |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
125 case LOST_SID: |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
126 st->rx_state = COMFORT_NOISE; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
127 gsmfr_preproc_gen_cn(st, frame); |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
128 return; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
129 case CN_MUTING: |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
130 if (reduce_xmaxc_sid(st)) { |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
131 st->rx_state = NO_DATA; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
132 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
|
133 GSMFR_RTP_FRAME_LEN); |
242
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
134 } else |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
135 gsmfr_preproc_gen_cn(st, frame); |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
136 return; |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
137 } |
f081a6850fb5
libgsmfrp: new refined implementation
Mychaela Falconia <falcon@freecalypso.org>
parents:
109
diff
changeset
|
138 } |