FreeCalypso > hg > gsm-codec-lib
comparison libtwamr/fr_type_conv.c @ 428:ffd87f972f86
libtwamr: implement TXFrameType to RXFrameType conversion
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 07 May 2024 22:15:23 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
427:357d1faad55d | 428:ffd87f972f86 |
---|---|
1 /* | |
2 * The function implemented in this module converts from TXFrameType | |
3 * to RXFrameType. It is needed for decoding standard test sequence | |
4 * .cod files, where TXFrameType is used in the file but RXFrameType | |
5 * is needed for decoding. | |
6 */ | |
7 | |
8 #include "tw_amr.h" | |
9 | |
10 int amr_txtype_to_rxtype(enum TXFrameType tx_type, enum RXFrameType *rx_type) | |
11 { | |
12 switch (tx_type) { | |
13 case TX_SPEECH_GOOD: | |
14 *rx_type = RX_SPEECH_GOOD; | |
15 return 0; | |
16 case TX_SPEECH_DEGRADED: | |
17 *rx_type = RX_SPEECH_DEGRADED; | |
18 return 0; | |
19 case TX_SPEECH_BAD: | |
20 *rx_type = RX_SPEECH_BAD; | |
21 return 0; | |
22 case TX_SID_FIRST: | |
23 *rx_type = RX_SID_FIRST; | |
24 return 0; | |
25 case TX_SID_UPDATE: | |
26 *rx_type = RX_SID_UPDATE; | |
27 return 0; | |
28 case TX_SID_BAD: | |
29 *rx_type = RX_SID_BAD; | |
30 return 0; | |
31 case TX_ONSET: | |
32 *rx_type = RX_ONSET; | |
33 return 0; | |
34 case TX_NO_DATA: | |
35 *rx_type = RX_NO_DATA; | |
36 return 0; | |
37 default: | |
38 return -1; | |
39 } | |
40 } |