FreeCalypso > hg > gsm-codec-lib
comparison doc/PCM8-conversions @ 237:e4a4bf11f37c
doc/PCM8-conversions: document command line utilities
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 08 May 2023 04:29:05 +0000 |
parents | 4c7d0dc1eecb |
children |
comparison
equal
deleted
inserted
replaced
236:4c7d0dc1eecb | 237:e4a4bf11f37c |
---|---|
165 identical output. | 165 identical output. |
166 | 166 |
167 For production software, our (Themyscira) recommendation is to use look-up | 167 For production software, our (Themyscira) recommendation is to use look-up |
168 tables (dev/s2a-regen.out and dev/s2u-regen.out) for both A-law and mu-law | 168 tables (dev/s2a-regen.out and dev/s2u-regen.out) for both A-law and mu-law |
169 encoding, using the upper 12 bits from 16-bit 2's complement input for A-law | 169 encoding, using the upper 12 bits from 16-bit 2's complement input for A-law |
170 encoding and the upper 13 bits for mu-law encoding. | 170 encoding and the upper 13 bits for mu-law encoding. For mu-law encoding the |
171 resulting mapping is different from what G.191 STL ulaw_compress() function | |
172 produces, and many will consider that function to be canon - but our approach | |
173 exhibits the same key properties, just mirrored around zero, and has the | |
174 advantage of needing only the upper 13 bits. | |
175 | |
176 Command line utilities | |
177 ====================== | |
178 | |
179 As usual, the present Themyscira GSM codec libraries & utilities package | |
180 provides command line utilities for working with the subject of this article: | |
181 conversions between 16-bit linear PCM (the format read and written by other | |
182 tools in the present suite) and 8-bit PCM in G.711 A-law or mu-law. The | |
183 following utilities are provided: | |
184 | |
185 pcm16-to-alaw These two utilities read 16-bit linear PCM in raw format (BE | |
186 pcm16-to-ulaw byte order by default, or LE with -l option) and convert the | |
187 recording into one byte per sample G.711 format, with each | |
188 program emitting its respective encoding law. pcm16-to-alaw | |
189 has only one mapping, but pcm16-to-ulaw supports two possible | |
190 mappings: by default it applies the mapping of G.191 STL | |
191 ulaw_compress(), or if use specify -t option it applies the | |
192 same mapping that would be produced by our recommended 13-bit | |
193 look-up table method. | |
194 | |
195 pcm8-to-pcm16 This utility reads a G.711 8-bit PCM recording (alaw or ulaw | |
196 selected with a mandatory command line argument) from a "raw" | |
197 G.711 file and converts it to 16-bit linear PCM. The output | |
198 byte order is BE by default, or can be changed to LE with an | |
199 extra command line qualifier. |