I am implementing the ITU-T G.711 standard, and I decided to start with the reference code in G.191.
Running some A-law compression tests made me doubt the algorithm was correct.
According to G.711, input range 0-63 should be located on the first segment in two-step increments. The sample code in G.191 displays this range as follows:
- 0 to 15 on segment 0 with step size 1
- 16 to 31 on segment 1 with step size 1
- 32 to 63 on segment 2 with step size 2
We not only get the offset of 1 segment when comparing the output with the value in the table, but the range also decreases by half, so the compressed FF corresponds to a uniform 2047.
How do I work to have a G.711 compatible codec?
source
share