annotate doc/Binary-file-format @ 45:4ae1dd43e332

libgsmefr/frame2params.c: brown paper bag
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 25 Nov 2022 02:40:21 +0000
parents 820d88b97924
children 598ee3ce238b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 We (Themyscira Wireless) define our own binary file format for testing of GSM
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 06.10 (FR) and EFR codec functions; this format of ours is an extension of
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 classic .gsm format from libgsm/toast. The original libgsm file format is a
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 directly abutted sequence of 33-byte libgsm frames, equivalent to RTP frames
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 for GSM FR, with the upper nibble of the first byte in each frame equal to 0xD,
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 serving as a signature. We simply extend this idea: our version is still a
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 directly abutted sequence of binary records, but each record is now one of 3
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 possibilities:
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 - a 33-byte GSM FR frame in libgsm/RTP format, 0xD signature
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 - a 31-byte GSM EFR frame in RTP format (ETSI TS 101 318), 0xC signature
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 - a 2-byte Themyscira-extension BFI marker, 0xBF signature
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 File reading functions begin by reading only one byte; this byte, once decoded,
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 tells us how many more bytes need to be read, and frame synchronization is thus
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 maintained.
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 FR and EFR frames are not expected to be mixed in the same stream recording;
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 our low-level binary file reading function will grok such mixing just fine, but
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 each higher-level test program is expected to be written for only one codec,
820d88b97924 libtest: implement binary file reader
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 either FR or EFR.