FreeCalypso > hg > gsm-codec-lib
view doc/Binary-file-format @ 128:a5ffec18e4cd
test programs: use printf %d format for codec parameters
Even though all codec params (both FR and EFR) are small unsigned integers,
we use signed int16_t data type for both, for interface reasons: in the
case of FR it's the gsm_signal type of libgsm, and in the case of EFR
it's the Word16 type of ETSI codec guts. Therefore, the correct printf
format is %d, not %u, when the objective is to see what's in the variables
(what the compiler sees) and catch any bugs.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 11 Dec 2022 04:00:13 +0000 |
parents | 598ee3ce238b |
children | b4b1c3a192c7 |
line wrap: on
line source
We (Themyscira Wireless) define our own binary file format for testing of GSM 06.10 (FR) and EFR codec functions; this format of ours is an extension of classic .gsm format from libgsm/toast. The original libgsm file format is a directly abutted sequence of 33-byte libgsm frames, equivalent to RTP frames for GSM FR, with the upper nibble of the first byte in each frame equal to 0xD, serving as a signature. We simply extend this idea: our version is still a directly abutted sequence of binary records, but each record is now one of 3 possibilities: - a 33-byte GSM FR frame in libgsm/RTP format, 0xD signature - a 31-byte GSM EFR frame in RTP format (ETSI TS 101 318), 0xC signature - a 2-byte Themyscira-extension BFI marker, 0xBF signature File reading functions begin by reading only one byte; this byte, once decoded, tells us how many more bytes need to be read, and frame synchronization is thus maintained. FR and EFR frames are not expected to be mixed in the same stream recording; our low-level binary file reading function will grok such mixing just fine, but each higher-level test program is expected to be written for only one codec, either FR or EFR. The recommended filename suffix for extended-libgsm binary files in the present format is .gsmx; of course dot-separated filename suffixes hold absolutely no special meaning on Unix systems, but many developers still strongly prefer to have them for psychological comfort.