[Asterisk-Users] GSM compression tool
Steven Critchfield
critch at basesys.com
Thu Oct 9 14:48:37 MST 2003
On Thu, 2003-10-09 at 15:51, George Lin wrote:
> Hi list,
>
> Can anyone suggest us what kind compression tool is best to compress a GSM
> file.
>
> And what kind compression ratio can be?
This is a hard message to write with out unleashing the flame thrower.
On this list it has been discussed many times that you can use sox or
toast to convert to GSM.
At least you should have issued a apropos gsm on the command line, or
even a man -k gsm. That alone would have pointed you to toast.
A little study of GSM information tells you that the codec produces 32.5
bytes of data per 20ms. So compression ratio depends on the format it
was in to begin with. Generally speaking though, you should be working
with 8k samples a second and therefore 20ms is 160 samples. You may even
be using 8bit samples like everything else is. At this point 160 samples
is 160 bytes that gets compressed to 32.5 bytes. On computer platforms,
it is a pain to deal with half bytes. So on a unix system, it has been
standardized that 32.5 will be null padded to 33 bytes even. On Crapdos,
they decided that this is one of the few places they would try not to
bloat. On Crapdos, they take 2 32.5 byte frames and bit shift the second
down into the empty half left by the first frame and produce a 65 byte
double frame.
Oddly enough, the majority of this is all learned from reading the
source code readily available already in the asterisk code base. It
possibly could be even more easily been found by a simple google search.
At the minimum, please go here and read for the next 10 or so minutes.
http://kbs.cs.tu-berlin.de/~jutta/toast.html
--
Steven Critchfield <critch at basesys.com>
More information about the asterisk-users
mailing list