Michael Vogel
2004-Dec-15 08:26 UTC
[Asterisk-Users] How "expensive" are the different codecs? (Regarding CPU time)
Hi! The encoding, decoding and recoding cost cpu time, that's sure. But does this time differs much depending on the used codec? Is - for example - a G729 faster than a GSM codec? Bye! Michael
el Flynn
2004-Dec-15 08:37 UTC
[Asterisk-Users] How "expensive" are the different codecs? (Regarding CPU time)
Michael Vogel wrote:> Hi! > > The encoding, decoding and recoding cost cpu time, that's sure. But does > this time differs much depending on the used codec? > > Is - for example - a G729 faster than a GSM codec? >at the CLI, type "show translation" and it will show a chart of how long (in milliseconds) it will take to translate from one codec to another. flynn
Steve Underwood
2004-Dec-15 08:40 UTC
[Asterisk-Users] How "expensive" are the different codecs? (Regarding CPU time)
Michael Vogel wrote:> Hi! > > The encoding, decoding and recoding cost cpu time, that's sure. But > does this time differs much depending on the used codec? > > Is - for example - a G729 faster than a GSM codec? > > Bye! > > MichaelThey vary a lot. G.729 is pretty slow. iLBC and speex in the same ballpark. G.723.1 even slower. GSM 06.10 is reasonably fast. Encode usually takes a low longer than decode - maybe 3 to 6 times, depending in the codec. One encode + one decode of G.723.1 is nearly 20MIPs on a DSP chip. Multiply that by maybe 5 or 6 for MIPs on a Pentium. G.729 is maybe 11 DSP MIPs. Regards, Steve
Tony Mountifield
2004-Dec-15 09:01 UTC
[Asterisk-Users] Re: How "expensive" are the different codecs? (Regarding CPU time)
In article <41C05796.40105@dabo.de>, Michael Vogel <icarus@dabo.de> wrote:> Hi! > > The encoding, decoding and recoding cost cpu time, that's sure. But does > this time differs much depending on the used codec?Yes, it does. The Asterisk command "show translations" will display a table of relative CPU costs for transcoding from one codec to another. Tony -- Tony Mountifield Work: tony@softins.co.uk - http://www.softins.co.uk Play: tony@mountifield.org - http://tony.mountifield.org
Adam Hart
2004-Dec-15 09:44 UTC
[Asterisk-Users] How "expensive" are the different codecs? (Regarding CPU time)
Michael Vogel wrote:> Hi! > > The encoding, decoding and recoding cost cpu time, that's sure. But does > this time differs much depending on the used codec? > > Is - for example - a G729 faster than a GSM codec? >Try 'show translations' in asterisk's CLI (GSM is much faster than G.729)
Jim Van Meggelen
2004-Dec-15 10:08 UTC
[Asterisk-Users] How "expensive" are the different codecs?(Regarding CPU time)
> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com > [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of > Michael Vogel > Sent: December 15, 2004 10:26 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: [Asterisk-Users] How "expensive" are the different > codecs?(Regarding CPU time) > > > Hi! > > The encoding, decoding and recoding cost cpu time, that's > sure. But does > this time differs much depending on the used codec?Absolutely.> > Is - for example - a G729 faster than a GSM codec?The Asterisk console command (at the CLI> prompt): show translation Will provide a matrix that gives an idea of the CPU penalty of each codec on your system. One of my lab systems returned this (sorry, I haven't licensed G.729 yet): (view with a fixed-width font such as courier) Translation times between formats (in milliseconds) Source Format (Rows) Destination Format(Columns) g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex ilbc g723 - - - - - - - - - - - gsm - - 2 2 3 2 1 4 - - 18 ulaw - 3 - 1 3 2 1 4 - - 18 alaw - 3 1 - 3 2 1 4 - - 18 g726 - 4 3 3 - 3 2 5 - - 19 adpcm - 3 2 2 3 - 1 4 - - 18 slin - 2 1 1 2 1 - 3 - - 17 lpc10 - 4 3 3 4 3 2 - - - 19 g729 - - - - - - - - - - - speex - - - - - - - - - - - ilbc - 4 3 3 4 3 2 5 - - - The rule of thumb is generally this: the more bandwidth a codec uses, the less CPU it will require. So G.711 uses the most bandwidth, but almost no CPU. Conversely, a highly compressed codec will require the CPU to perform complex calculations on it; the better the compression, the more time it will take. Some codecs are better than others (GSM is pretty easy on the CPU relative to it's bandwidth). I'll paraphrase that old adage: - Low Bandwidth - Low CPU Use - Reasonable Audio Quality Pick any two. Keep in mind that the only time a codec will eat up CPU is if transcoding is required. If Asterisk does not need to convert between formats, then the load on the CPU will be essentially the same, regardless of the codec in use.