FreeCalypso > hg > gsm-codec-lib
annotate doc/AMR-EFR-hybrid-emu @ 556:18aca50d68df default tip
doc/Calypso-TCH-downlink: update for FR1 BFI-with-data
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 11 Oct 2024 01:54:00 +0000 |
parents | ad032051166a |
children |
rev | line source |
---|---|
467
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
1 Emulation of other people's AMR-EFR hybrid implementations |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
2 ========================================================== |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
3 |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
4 [Please see AMR-EFR-philosophy article for background information on the |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
5 differences between classic GSM-EFR and the 12k2 mode of AMR, and how ETSI/3GPP |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
6 loosened their regulation on bit-exactness of EFR, then continue here.] |
311
83408f67a96c
doc/AMR-EFR-philosophy: new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
136
diff
changeset
|
7 |
467
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
8 Experiments reveal that the extant commercial GSM networks of T-Mobile USA and |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
9 Telcel Mexico (and likely other countries' GSM networks too) use a GSM speech |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
10 transcoder implementation that performs EFR encoding and decoding (for times |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
11 when the MS declares no support for AMR and the network falls back to EFR) per |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
12 the alternative which we call AMR-EFR hybrid. The needed experiments are done |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
13 by using a FreeCalypso phone or devboard as the MS (declaring yourself to the |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
14 network as non-AMR-capable via AT%SPVER), capturing TCH DL and feeding TCH UL |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
15 with FreeCalypso tools, and using a SIP-to-PSTN connectivity provider (BulkVS |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
16 or Anveo) on the other end of the test call that allows the experimenter to |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
17 receive the PCMU or PCMA sample stream coming out of the GSM network's speech |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
18 transcoder and feed a crafted PCMU/PCMA sample stream in the other direction. |
311
83408f67a96c
doc/AMR-EFR-philosophy: new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
136
diff
changeset
|
19 |
467
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
20 In this experimental setup, bit-exact details of how the GSM network under study |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
21 implements EFR decoding can be tested by feeding a controlled sequence of EFR |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
22 codec frames (beginning with at least two DHFs) to GSM Um uplink and observing |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
23 the PCMU or PCMA sample stream received on the IP-PSTN end of the call. |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
24 Similarly, bit-exact details of how the NUS implements EFR encoding can be |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
25 tested by feeding controlled PCMU/PCMA sample streams into the call from IP-PSTN |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
26 and observing what the network emits on GSM Um downlink. In the latter case, |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
27 frame synchronization finding tricks described in ETSI/3GPP test sequence specs |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
28 need to included as part of the experiment. |
311
83408f67a96c
doc/AMR-EFR-philosophy: new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
136
diff
changeset
|
29 |
467
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
30 When these experiments were performed on the GSM networks of T-Mobile USA and |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
31 Telcel Mexico, it was immediately apparent that they do not implement EFR |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
32 following the original bit-exact code of GSM 06.53: feeding any of the original |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
33 EFR test sequences from GSM 06.54 to the NUS does not produce matching results. |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
34 However, when I tried feeding EFR codec frame sequences from amr122_efr.zip |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
35 (the late addendum to GSM 06.54 for the AMR-EFR hybrid option) to GSM UL, the |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
36 PCMU (T-Mobile USA) or PCMA (Telcel Mexico) output from the GSM network's EFR |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
37 decoder matched _those_ test sequences, indicating that these networks use the |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
38 AMR-EFR alternative implementation. |
311
83408f67a96c
doc/AMR-EFR-philosophy: new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
136
diff
changeset
|
39 |
467
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
40 Creating tinkerer-oriented FOSS tools that can emulate or replicate the poorly |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
41 defined "EFR alternative 2" implemented by these extant commercial networks has |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
42 been a sportive challenge ever since. The present development in Themyscira |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
43 GSM codec libraries and utilities suite is a step toward conquering that |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
44 challenge: we are now able to replicate the mystery commercial transcoder in |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
45 non-DTX operation, specifically: |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
46 |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
47 a) We can feed a SID-free stream of EFR codec frames to GSM UL, beginning with |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
48 DHF, and get the expected result on PCMU or PCMA; |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
49 |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
50 b) In the encoder direction, for the first 7 frames after EHF, before DTX is |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
51 allowed to kick in, we can get GSM DL output from the network that matches |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
52 our expectations. |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
53 |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
54 Encoder 5 ms delay and DHF transformation |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
55 ========================================= |
311
83408f67a96c
doc/AMR-EFR-philosophy: new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
136
diff
changeset
|
56 |
467
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
57 One of the diffs between classic EFR and MR122 in the encoder direction is the |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
58 artificial delay of 5 ms introduced in the AMR version. In true multirate |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
59 operation this delay is needed to support seamless switching between codec |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
60 modes, but when the only allowed codec rate is 12k2 (which is the case with EFR |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
61 by definition), this delay is pure waste. (Needless to say, an extra delay of |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
62 5 ms is nothing compared to the egregious latencies introduced by today's ugly |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
63 and horrible world of IP-based transport everywhere, but still...) This |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
64 artificial 5 ms delay in the encoder is the reason for the DHF difference |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
65 between EFR and MR122 - but here is the wild part: instead of recognizing this |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
66 artificial delay as unnecessary and wasteful for 12k2-only EFR and removing it |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
67 from the AMR-EFR hybrid contraption, those commercial transcoder vendors and |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
68 the people who prepared amr122_efr.zip for ETSI/3GPP (were they the same |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
69 people?) kept this 5 ms encoder delay, keeping the whole encoder unchanged AMR |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
70 except for whatever insane trickery they did to fit EFR DTX logic and EFR SID |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
71 generation into it, but added special DHF transformation logic on the output of |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
72 this AMR encoder to produce compliant EFR DHF when the input is EHF. |
136
8eb0e7a39409
doc: document command line utilities
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 |
467
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
74 Exactly how this DHF transformation is done in those actually-deployed AMR-EFR |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
75 hybrid encoders is a bit of a mystery. My first thought was to compare the |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
76 speech parameters emitted by the AMR encoder against MR122 DHF, and if the |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
77 result is a match, replace that MR122-DHF parameter set with EFR DHF. This |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
78 approach is implemented in the simple amr_dhf_subst_efr() function in libtwamr. |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
79 One distinctive signature of this approach is that the output of a hybrid |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
80 encoder following this method can never equal MR122 DHF: this one particular |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
81 bit pattern is precluded from the set of possible outputs under all conditions. |
457
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
82 |
467
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
83 However, subsequent experiments quickly revealed that the logic implemented by |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
84 the transcoder in the network of T-Mobile USA must be different. One of the |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
85 counter-intuitive effects of the 5 ms artificial delay in the MR122 encoder is |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
86 what happens when the encoder is in its homed state and you feed it an input |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
87 frame whose first 120 samples are all 0x0008, but some (as few as one or as many |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
88 as all) of the last 40 samples are different. This frame does not meet the |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
89 definition of EHF and won't be recognized as such - the encoder won't get |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
90 rehomed once again after processing this frame - yet the output will be |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
91 bit-exact MR122 DHF. How do those AMR-EFR hybrid encoders handle *this* case? |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
92 |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
93 Experiments on T-Mobile reveal that in the case in question, the encoded frame |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
94 is emitted with the bit pattern of MR122 DHF, *not* transformed into EFR DHF. |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
95 Because MR122-DHF output is impossible with an encoder that implements logic |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
96 like our amr_dhf_subst_efr() first cut, we know (by modus tollens) that |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
97 T-Mobile's implementation uses some different logic. |
311
83408f67a96c
doc/AMR-EFR-philosophy: new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
136
diff
changeset
|
98 |
467
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
99 Our new (current) working model is implemented in amr_dhf_subst_efr2(): we |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
100 replace the output of the AMR encoder with EFR DHF if the raw encoder output |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
101 was MR122 DHF *and* the input frame was EHF. This version appears to match |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
102 the observed behavior of T-Mobile USA so far. |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
103 |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
104 EFR DHF in the decoder direction |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
105 ================================ |
311
83408f67a96c
doc/AMR-EFR-philosophy: new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
136
diff
changeset
|
106 |
467
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
107 The way decoder homing works in all ETSI/3GPP-defined speech codecs, there is |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
108 an explicit check against known DHF bit pattern (up to first subframe only) at |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
109 the beginning of the decoder (if the decoder is homed and the input is DHF per |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
110 this reduced check, artificially emit EHF, stay homed and do nothing more), and |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
111 a second similar check against the known DHF bit pattern (full frame comparison |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
112 this time) at the end of the decoder, triggering the state reset function on |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
113 match. These checks are (and can only be) implemented by explicit comparison |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
114 against a known hard-coded DHF pattern - hence it doesn't matter in the decoder |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
115 case whether the DHF is natural (as in all properly ETSI-defined codecs) or |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
116 artificial as in AMR-EFR hybrid. Thus the "correct" handling of DHF in the |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
117 AMR-EFR hybrid decoder is a matter of replacing the check against MR122 DHF bit |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
118 pattern with a check against the different bit pattern of EFR DHF. |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
119 |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
120 The decoder engine in libtwamr supports this different-DHF option for MR122 |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
121 decoding by way of a bit set in the mode field in struct amr_param_frame - see |
ad032051166a
doc: AMR-EFR-hybrid-emu new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
457
diff
changeset
|
122 the detailed description in AMR-library-API article. |
311
83408f67a96c
doc/AMR-EFR-philosophy: new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
136
diff
changeset
|
123 |
457
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
124 Command line utilities for AMR-EFR hybrid |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
125 ========================================= |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
126 |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
127 The present package includes a small set of command line utilities that work |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
128 with the AMR-EFR hybrid described above: |
311
83408f67a96c
doc/AMR-EFR-philosophy: new article
Mychaela Falconia <falcon@freecalypso.org>
parents:
136
diff
changeset
|
129 |
457
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
130 amrefr-encode-r |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
131 amrefr-decode-r |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
132 |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
133 These two utilities function just like gsmefr-encode-r and |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
134 gsmefr-decode-r described in Codec-utils article, but implement the |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
135 AMR-EFR hybrid version of the codec instead of original EFR. The |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
136 no-DTX limitation applies: amrefr-encode-r lacks -d option, and the |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
137 input to amrefr-decode-r must not contain any SID frames. |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
138 |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
139 amrefr-tseq-enc |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
140 amrefr-tseq-dec |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
141 |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
142 These two utilities are AMR-EFR counterparts to gsmefr-etsi-enc and |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
143 gsmefr-etsi-dec test programs described in EFR-testing article. They |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
144 pass all tests on the non-DTX t??_efr.* sequences in ETSI's |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
145 amr122_efr.zip, but not on any of the DTX sequences included in the |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
146 same ZIP. Just like amrefr-encode-r, amrefr-tseq-enc lacks -d option, |
9bcf65088006
doc/AMR-EFR-philosophy: document implemented solution
Mychaela Falconia <falcon@freecalypso.org>
parents:
311
diff
changeset
|
147 and amrefr-tseq-dec rejects input containing SID frames. |