Community
cancel
Showing results for 
Search instead for 
Did you mean: 
samsmile
Beginner
145 Views

Questions about AMR codec!Help!

Hi guys,
I have been studing on codec converting based on ipp-samples. I tried to convert a file which is PCMU law to GSMAMR. The amr data is sotred as the RFC4867 section 5. My first step is try to save the result of the speech codec example. I add some codes in the function ProcessOneFrameOneChannel which is in the file player.c.

[cpp]Ipp32s ProcessOneFrameOneChannel(USCParams *uscPrms, Ipp8s *inputBuffer,
                                 Ipp8s *outputBuffer, Ipp32s *pSrcLenUsed, Ipp32s *pDstLenUsed, FILE *f_log)
{
  Ipp32s frmlen, infrmLen, FrmDataLen;
  USC_PCMStream PCMStream;
  USC_Bitstream Bitstream;
  Ipp8s shift;  
  Ipp8s buf[64];
  
  if (uscPrms->pInfo->params.direction==USC_ENCODE)
    {
      /*Do the pre-procession of the frame*/
      infrmLen = USCEncoderPreProcessFrame(uscPrms, inputBuffer,
                                           outputBuffer,&PCMStream,&Bitstream);
      /*Encode one frame*/
      FrmDataLen = USCCodecEncode(uscPrms, &PCMStream,&Bitstream,f_log);
      if (FrmDataLen < 0) return USC_CALL_FAIL;


      ippsZero_8u((Ipp8u *)buf , 64);
	  speech_codec_amr_file_write(&amrParam, Bitstream.pBuffer, Bitstream.nbytes); //is Bitstream already can be used directly for RFC4867
	  
.....}[/cpp]



As you can see, I add speech_codec_amr_file_write to store the result in a file. I think it's a simple work, but I just get noise when I use the KMP playerto play the file.
I want to know if each frame data of Bitstream can be used as the RFC4867 required. Do you have any method to test the result of your own example code?
I put the example code which I modified in the attachment. And also the test resouce file. I use the command:./usc_speech_codec -format IPP_GSMAMR -r12200 8kulaw.wav amr.wav
And the amr file which according to RFC4867 section 5 is default set to data_rec.amr. Please tell me a way to test your example result!

BR
Sam

0 Kudos
4 Replies
samsmile
Beginner
145 Views

Quoting - samsmile

Hi guys,
I have been studing on codec converting based on ipp-samples. I tried to convert a file which is PCMU law to GSMAMR. The amr data is sotred as the RFC4867 section 5. My first step is try to save the result of the speech codec example. I add some codes in the function ProcessOneFrameOneChannel which is in the file player.c.

[cpp]Ipp32s ProcessOneFrameOneChannel(USCParams *uscPrms, Ipp8s *inputBuffer,
                                 Ipp8s *outputBuffer, Ipp32s *pSrcLenUsed, Ipp32s *pDstLenUsed, FILE *f_log)
{
  Ipp32s frmlen, infrmLen, FrmDataLen;
  USC_PCMStream PCMStream;
  USC_Bitstream Bitstream;
  Ipp8s shift;  
  Ipp8s buf[64];
  
  if (uscPrms->pInfo->params.direction==USC_ENCODE)
    {
      /*Do the pre-procession of the frame*/
      infrmLen = USCEncoderPreProcessFrame(uscPrms, inputBuffer,
                                           outputBuffer,&PCMStream,&Bitstream);
      /*Encode one frame*/
      FrmDataLen = USCCodecEncode(uscPrms, &PCMStream,&Bitstream,f_log);
      if (FrmDataLen < 0) return USC_CALL_FAIL;


      ippsZero_8u((Ipp8u *)buf , 64);
	  speech_codec_amr_file_write(&amrParam, Bitstream.pBuffer, Bitstream.nbytes); //is Bitstream already can be used directly for RFC4867
	  
.....}[/cpp]



As you can see, I add speech_codec_amr_file_write to store the result in a file. I think it's a simple work, but I just get noise when I use the KMP playerto play the file.
I want to know if each frame data of Bitstream can be used as the RFC4867 required. Do you have any method to test the result of your own example code?
I put the example code which I modified in the attachment. And also the test resouce file. I use the command:./usc_speech_codec -format IPP_GSMAMR -r12200 8kulaw.wav amr.wav
And the amr file which according to RFC4867 section 5 is default set to data_rec.amr. Please tell me a way to test your example result!

BR
Sam





Hi! anybody could help me?
Tell me how to verify the encode result is correct?
Vyacheslav_Baranniko
New Contributor II
145 Views

Quoting - samsmile

Hi guys,
I have been studing on codec converting based on ipp-samples. I tried to convert a file which is PCMU law to GSMAMR. The amr data is sotred as the RFC4867 section 5. My first step is try to save the result of the speech codec example. I add some codes in the function ProcessOneFrameOneChannel which is in the file player.c.

[cpp]Ipp32s ProcessOneFrameOneChannel(USCParams *uscPrms, Ipp8s *inputBuffer,
                                 Ipp8s *outputBuffer, Ipp32s *pSrcLenUsed, Ipp32s *pDstLenUsed, FILE *f_log)
{
  Ipp32s frmlen, infrmLen, FrmDataLen;
  USC_PCMStream PCMStream;
  USC_Bitstream Bitstream;
  Ipp8s shift;  
  Ipp8s buf[64];
  
  if (uscPrms->pInfo->params.direction==USC_ENCODE)
    {
      /*Do the pre-procession of the frame*/
      infrmLen = USCEncoderPreProcessFrame(uscPrms, inputBuffer,
                                           outputBuffer,&PCMStream,&Bitstream);
      /*Encode one frame*/
      FrmDataLen = USCCodecEncode(uscPrms, &PCMStream,&Bitstream,f_log);
      if (FrmDataLen < 0) return USC_CALL_FAIL;


      ippsZero_8u((Ipp8u *)buf , 64);
	  speech_codec_amr_file_write(&amrParam, Bitstream.pBuffer, Bitstream.nbytes); //is Bitstream already can be used directly for RFC4867
	  
.....}[/cpp]



As you can see, I add speech_codec_amr_file_write to store the result in a file. I think it's a simple work, but I just get noise when I use the KMP playerto play the file.
I want to know if each frame data of Bitstream can be used as the RFC4867 required. Do you have any method to test the result of your own example code?
I put the example code which I modified in the attachment. And also the test resouce file. I use the command:./usc_speech_codec -format IPP_GSMAMR -r12200 8kulaw.wav amr.wav
And the amr file which according to RFC4867 section 5 is default set to data_rec.amr. Please tell me a way to test your example result!

BR
Sam


Hi Sam,

There are two speech codingapplications withinIPP Speech codecs sample:
1st: usc_speech_codec - raw speech codecable to encode wave file to and decode backfrominternal IPP format (RIFF based) with no support for RFC4867 for GSMAMR.
2nd: umc_speech_rtp_codec -speech codec with RTP support ableto encodeinto and to decode from RTPDump format,playable by Wireshark for example.

Thanks
Vyacheslav, IPP specch
samsmile
Beginner
145 Views

Quoting - vbaranni

Hi Sam,

There are two speech codingapplications withinIPP Speech codecs sample:
1st: usc_speech_codec - raw speech codecable to encode wave file to and decode backfrominternal IPP format (RIFF based) with no support for RFC4867 for GSMAMR.
2nd: umc_speech_rtp_codec -speech codec with RTP support ableto encodeinto and to decode from RTPDump format,playable by Wireshark for example.

Thanks
Vyacheslav, IPP specch

Hi Vyacheslav,
How could I get the code of umc_speech_rtp_codec? I can't find it in the sample code.
By the way, do Intel provide a smple encode and decode interface for audio application? It's really difficult for me to learn how to combineall the IPP function together to implementtranscoding.

BR
Sam
Vyacheslav_Baranniko
New Contributor II
145 Views

Quoting - samsmile

Hi Vyacheslav,
How could I get the code of umc_speech_rtp_codec? I can't find it in the sample code.
By the way, do Intel provide a smple encode and decode interface for audio application? It's really difficult for me to learn how to combineall the IPP function together to implementtranscoding.

BR
Sam

Hi Sam,
the umc_speech_rtp_codecis supportedforwindows only.Pease check http://software.intel.com/en-us/intel-ipp/ for latest IPP withFree Code Samples foraudio, video, imageand many other domains.
Regards,
Vyacheslav
Reply