<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: G.729 Decoding Problem. in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/G-729-Decoding-Problem/m-p/886766#M10903</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/304145"&gt;Ken.t&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Just fixed a formatting error I put in when putting code on the forum. Based on what I'm seeing for data, I seem to be seeing two 10 byte frames every rtp packet with no SID frames. So I assume that I'm actually dealing with G.729 Annex A. I turned off stream mixing which I do later in the application so I was just hearing one stream and you can hear some legible audio. Unfortunately it's quiet and hard to make out though the garbage audio that I'm also getting.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Hi,it seemsyour codeis correct.I may only suggest you to tryIPP_G729I orIPP_G729_FP decoders also, assumingyou are usingIPP_G729A now.They all areinteroperable (may consumesame bitstream), so you maysee a difference if any.&lt;BR /&gt;It make sence also to try C-optimized IPP library versus IPP best foryour machine, for example by callingippStatiInitCpu(ippCpuUnknown) instatic merged IPP linkage.&lt;BR /&gt;Vyacheslav</description>
    <pubDate>Thu, 18 Jun 2009 12:13:41 GMT</pubDate>
    <dc:creator>Vyacheslav_Baranniko</dc:creator>
    <dc:date>2009-06-18T12:13:41Z</dc:date>
    <item>
      <title>G.729 Decoding Problem.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/G-729-Decoding-Problem/m-p/886764#M10901</link>
      <description>&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt; I've got an application that receives audio in G711, GSM610, iLBC and G729. Using the sample code found in the USC Manual I created a function that converts all these codecs in to liner PCM.&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;[cpp]/** brief decode audio&lt;BR /&gt;*&lt;BR /&gt;		* Decodes the audio stream passed in the 2nd and 3rd parameter, generates a new array in the boost::shared pointer&lt;BR /&gt;		* and fills in the length parameter with the size of the new array.&lt;BR /&gt;		*&lt;BR /&gt;		* param USC_Fxns * - Decoder to use.&lt;BR /&gt;		* param unsigned char * - input array&lt;BR /&gt;		* param const unsigned int &amp;amp; - input length&lt;BR /&gt;		* param boost::shared_array&lt;UNSIGNED char=""&gt; - Output Array&lt;BR /&gt;		* param int &amp;amp; - output length&lt;BR /&gt;		* param const int &amp;amp; - frametype&lt;BR /&gt;		* param const int - bitrate desired.&lt;BR /&gt;		*/&lt;BR /&gt;		static bool decodeGeneric(USC_Fxns * _decoder,unsigned char * _input, const unsigned int &amp;amp; _isize, boost::shared_array&lt;UNSIGNED char=""&gt; &amp;amp; _output, int &amp;amp; _osize, const int &amp;amp; _frametype, const int _bitrate);[/cpp]&lt;/UNSIGNED&gt;&lt;/UNSIGNED&gt;&lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I then call it like this:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;[cpp]decodeGeneric(&amp;amp;USC_G729I_Fxns,_input,_isize,_output,_osize,3,8000);[/cpp]&lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;And here is the code contained in the fuction, as you can see it's only lightly modified from the example given in the USC Manual. &lt;BR /&gt;
&lt;PRE&gt;[cpp]	bool decodeGeneric(USC_Fxns * _decoder,unsigned char * _input, const unsigned int &amp;amp; _isize, boost::shared_array&lt;UNSIGNED char=""&gt; &amp;amp; _output, int &amp;amp; _osize, const int &amp;amp; _frametype, const int _bitrate)&lt;BR /&gt;	{&lt;BR /&gt;	&lt;BR /&gt;		boost::shared_array&lt;UNSIGNED char=""&gt; codecInfoRaw;&lt;BR /&gt;		boost::shared_array&lt;UNSIGNED char=""&gt; decoderMemoryRaw;&lt;BR /&gt;		boost::shared_array&lt;UNSIGNED char=""&gt; memBlocksRaw;&lt;BR /&gt;&lt;BR /&gt;		USC_CodecInfo * codecInfo;&lt;BR /&gt;		USC_MemBank * decoderMemory;&lt;BR /&gt;&lt;BR /&gt;		int infoSize;&lt;BR /&gt;&lt;BR /&gt;		USC_Handle hUSCDecoder;&lt;BR /&gt;&lt;BR /&gt;		char* tmpInputBuff=NULL;&lt;BR /&gt;		char* tmpOutputBuff=NULL;&lt;BR /&gt;		char* tmpOutputPCMBuff=NULL;&lt;BR /&gt;&lt;BR /&gt;		if(USC_NoError != _decoder-&amp;gt;std.GetInfoSize(&amp;amp;infoSize)) &lt;BR /&gt;		{&lt;BR /&gt;			return false;&lt;BR /&gt;		}&lt;BR /&gt;&lt;BR /&gt;		codecInfoRaw.reset(new unsigned char[infoSize]);&lt;BR /&gt;&lt;BR /&gt;		codecInfo = (USC_CodecInfo *)codecInfoRaw.get();&lt;BR /&gt;&lt;BR /&gt;		/* Get the Gxxx codec info */&lt;BR /&gt;		if(USC_NoError != _decoder-&amp;gt;std.GetInfo((USC_Handle)NULL,codecInfo))&lt;BR /&gt;		{&lt;BR /&gt;			return false;&lt;BR /&gt;		}&lt;BR /&gt;&lt;BR /&gt;		/*&lt;BR /&gt;		decoder instance creation&lt;BR /&gt;		*/&lt;BR /&gt;&lt;BR /&gt;		codecInfo-&amp;gt;params.direction = USC_DECODE; /* Direction: decode */&lt;BR /&gt;		codecInfo-&amp;gt;params.modes.vad = 0; /* Suppress a silence compression */&lt;BR /&gt;		codecInfo-&amp;gt;params.law = 0; /* Linear PCM output. */&lt;BR /&gt;		codecInfo-&amp;gt;params.modes.bitrate = _bitrate;&lt;BR /&gt;		/* Learn how many memory block needed for the encoder */&lt;BR /&gt;&lt;BR /&gt;		int membytes;&lt;BR /&gt;&lt;BR /&gt;		if(USC_NoError != _decoder-&amp;gt;std.NumAlloc(&amp;amp;codecInfo-&amp;gt;params,&amp;amp;membytes)) &lt;BR /&gt;		{&lt;BR /&gt;			return false;&lt;BR /&gt;		}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;		/* allocate memory for memory bank table */&lt;BR /&gt;		decoderMemoryRaw.reset(new unsigned char[(sizeof(USC_MemBank) * membytes)]);&lt;BR /&gt;		decoderMemory = (USC_MemBank*)decoderMemoryRaw.get();&lt;BR /&gt;&lt;BR /&gt;		/* Query how big has to be each block */&lt;BR /&gt;		if(USC_NoError != _decoder-&amp;gt;std.MemAlloc(&amp;amp;codecInfo-&amp;gt;params,decoderMemory))&lt;BR /&gt;		{&lt;BR /&gt;			return false;&lt;BR /&gt;		}&lt;BR /&gt;&lt;BR /&gt;		/* allocate memory for each block */&lt;BR /&gt;&lt;BR /&gt;		std::queue decoderMemoryArray;&lt;BR /&gt;&lt;BR /&gt;		for(int i=0; i &amp;lt; membytes;i++)&lt;BR /&gt;		{&lt;BR /&gt;			boost::shared_array&lt;CHAR&gt; m(new char[decoderMemory&lt;I&gt;.nbytes]);&lt;BR /&gt;			decoderMemoryArray.push(m);&lt;BR /&gt;			decoderMemory&lt;I&gt;.pMem = m.get();&lt;BR /&gt;		}&lt;BR /&gt;		&lt;BR /&gt;		/* Create decoder instance */&lt;BR /&gt;		if(USC_NoError != _decoder-&amp;gt;std.Init(&amp;amp;codecInfo-&amp;gt;params, decoderMemory,&amp;amp;hUSCDecoder))&lt;BR /&gt;		{&lt;BR /&gt;			return false;&lt;BR /&gt;		}&lt;BR /&gt;		/* Correct the Gxxx codec info */&lt;BR /&gt;		if(USC_NoError != _decoder-&amp;gt;std.GetInfo(hUSCDecoder, codecInfo))&lt;BR /&gt;		{&lt;BR /&gt;			return false;&lt;BR /&gt;		}&lt;BR /&gt;&lt;BR /&gt;		/* Query how big can be max output bitstream */&lt;BR /&gt;		if(USC_NoError != _decoder-&amp;gt;GetOutStreamSize(&amp;amp;codecInfo-&amp;gt;params,codecInfo-&amp;gt;params.modes.bitrate, _isize, &amp;amp;_osize))&lt;BR /&gt;		{&lt;BR /&gt;			return false;&lt;BR /&gt;		}&lt;BR /&gt;&lt;BR /&gt;		/* allocate output bitstream buffer */&lt;BR /&gt;		_output.reset(new unsigned char[_osize]);&lt;BR /&gt;&lt;BR /&gt;		USC_PCMStream out;&lt;BR /&gt;		USC_Bitstream in;&lt;BR /&gt;&lt;BR /&gt;		in.bitrate = codecInfo-&amp;gt;params.modes.bitrate;&lt;BR /&gt;		in.nbytes = codecInfo-&amp;gt;maxbitsize;&lt;BR /&gt;		in.frametype = _frametype;	&lt;BR /&gt;		out.pcmType = codecInfo-&amp;gt;pPcmTypesTbl[0];&lt;BR /&gt;&lt;BR /&gt;		in.pBuffer = (char *) _input;&lt;BR /&gt;		out.pBuffer = (char *) _output.get();&lt;BR /&gt;&lt;BR /&gt;		for(unsigned int t = 0; t &amp;lt; _isize;t+=in.nbytes) &lt;BR /&gt;		{&lt;BR /&gt;			int ret = _decoder-&amp;gt;Decode (hUSCDecoder, &amp;amp;in, &amp;amp;out);&lt;BR /&gt;			if(USC_NoError != ret)&lt;BR /&gt;			{&lt;BR /&gt;				return false;&lt;BR /&gt;			}&lt;BR /&gt;&lt;BR /&gt;			/* Move to the next frame */&lt;BR /&gt;			if(in.nbytes &amp;gt; 0)&lt;BR /&gt;			{&lt;BR /&gt;				in.pBuffer += in.nbytes;&lt;BR /&gt;				out.pBuffer += out.nbytes;&lt;BR /&gt;			}&lt;BR /&gt;		}&lt;BR /&gt;&lt;BR /&gt;		return true;&lt;BR /&gt;	}[/cpp]&lt;/I&gt;&lt;/I&gt;&lt;/CHAR&gt;&lt;/UNSIGNED&gt;&lt;/UNSIGNED&gt;&lt;/UNSIGNED&gt;&lt;/UNSIGNED&gt;&lt;/PRE&gt;
&lt;BR /&gt;This code works fine for GSM610, and G711 uLaw as is. But when I pass G729 through it, it produces very quiet audio with the human voice lost in the noise if it's even detectable. I've tried enabling vad, but that didn't seem to help. I've checked the input stream and I'm getting 20 bytes for each RTP Packet so I believe all my packets are type 3 (Voice). I'm not quite sure what I'm doing wrong, any help would be appreciated.&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Jun 2009 14:24:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/G-729-Decoding-Problem/m-p/886764#M10901</guid>
      <dc:creator>Ken_t</dc:creator>
      <dc:date>2009-06-05T14:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: G.729 Decoding Problem.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/G-729-Decoding-Problem/m-p/886765#M10902</link>
      <description>Just fixed a formatting error I put in when putting code on the forum. Based on what I'm seeing for data, I seem to be seeing two 10 byte frames every rtp packet with no SID frames. So I assume that I'm actually dealing with G.729 Annex A. I turned off stream mixing which I do later in the application so I was just hearing one stream and you can hear some legible audio. Unfortunately it's quiet and hard to make out though the garbage audio that I'm also getting.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Jun 2009 14:48:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/G-729-Decoding-Problem/m-p/886765#M10902</guid>
      <dc:creator>Ken_t</dc:creator>
      <dc:date>2009-06-09T14:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: G.729 Decoding Problem.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/G-729-Decoding-Problem/m-p/886766#M10903</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/304145"&gt;Ken.t&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Just fixed a formatting error I put in when putting code on the forum. Based on what I'm seeing for data, I seem to be seeing two 10 byte frames every rtp packet with no SID frames. So I assume that I'm actually dealing with G.729 Annex A. I turned off stream mixing which I do later in the application so I was just hearing one stream and you can hear some legible audio. Unfortunately it's quiet and hard to make out though the garbage audio that I'm also getting.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Hi,it seemsyour codeis correct.I may only suggest you to tryIPP_G729I orIPP_G729_FP decoders also, assumingyou are usingIPP_G729A now.They all areinteroperable (may consumesame bitstream), so you maysee a difference if any.&lt;BR /&gt;It make sence also to try C-optimized IPP library versus IPP best foryour machine, for example by callingippStatiInitCpu(ippCpuUnknown) instatic merged IPP linkage.&lt;BR /&gt;Vyacheslav</description>
      <pubDate>Thu, 18 Jun 2009 12:13:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/G-729-Decoding-Problem/m-p/886766#M10903</guid>
      <dc:creator>Vyacheslav_Baranniko</dc:creator>
      <dc:date>2009-06-18T12:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: G.729 Decoding Problem.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/G-729-Decoding-Problem/m-p/886767#M10904</link>
      <description>Hey all. I have the same problem, Decoder doesn't decode bitstream properly. It's pity but it seems not working at all. :-(</description>
      <pubDate>Fri, 22 Jul 2011 12:37:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/G-729-Decoding-Problem/m-p/886767#M10904</guid>
      <dc:creator>tcorp1</dc:creator>
      <dc:date>2011-07-22T12:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: G.729 Decoding Problem.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/G-729-Decoding-Problem/m-p/886768#M10905</link>
      <description>But I found interesting thing in ipp. You can build exe file for speech codecs, which codes and decodes files fine. It seems like problem is with building the project, or something like that. I am almoust sure that it must work well because in builded exe file it works great, and that exe file was made from ipp sources. I'll let you know if I find the answer for this problem.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Regards, Ron&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Jul 2011 12:49:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/G-729-Decoding-Problem/m-p/886768#M10905</guid>
      <dc:creator>tcorp1</dc:creator>
      <dc:date>2011-07-22T12:49:21Z</dc:date>
    </item>
  </channel>
</rss>

