Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Coverting Codec Data

mworkman
Beginner
2,613 Views
I have the function from va_g729 using this funtion
va_g729_encode(short *in, char *out)
how can I replace this with the IPP can someone please send me a sample
0 Kudos
23 Replies
Vladimir_Dudnik
Employee
2,269 Views

Hello,

we have ippsConvert_8s16s(const Ipp8s* pSrc,Ipp16s* pDst,int len) function but we have no ippsConvert_16s8s(const Ipp16s* pSrc,Ipp8s* pDst,int len) function. If you find such functionality useful please submit your request to Intel Premier Support

Regards,
Vladimir

0 Kudos
mworkman
Beginner
2,269 Views
Yes But can you please provide sample how to convert to a

G729Decoder_Obj

0 Kudos
Vladimir_Dudnik
Employee
2,269 Views
What sample do you mean? How to convert 16s to 8s data?
0 Kudos
mworkman
Beginner
2,269 Views
how to load and use it
0 Kudos
Vladimir_Dudnik
Employee
2,269 Views

Did you look at IPP speech-coding sample?

Vladimir

0 Kudos
mworkman
Beginner
2,269 Views

yes i did... still not a clear simple sample

0 Kudos
Vladimir_Dudnik
Employee
2,269 Views

That's what we have.

If you have some particular questions about codec and how to use it you can ask here.

Vladimir

0 Kudos
p4top
Beginner
2,269 Views
If you use IPP4.0, those OBJ files in ippscmerged.lib maybe help you.
But if you use IPP5.0, the names of OBJ files maybe differ.

d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split0.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split1.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split10.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split11.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split12.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split13.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split14.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split15.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split16.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split17.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split18.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split2.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split3.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split4.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split5.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split6.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split7.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split8.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ownctsg729/ownctsg729_split0.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/psg729dphd/psg729dphd_split0.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/psg729dphd/psg729dphd_split1.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/psg729dphd/psg729dphd_split2.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/psg729dphd/psg729dphd_split3.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/psg729icdbk/psg729icdbk_split0.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/psg729icdbk/psg729icdbk_split10.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/psg729icdbk/psg729icdbk_split9.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/psg729ihw/psg729ihw_split0.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/psg729ihw/psg729ihw_split1.obj
d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/psg729ihw/psg729ihw_split2.obj

you can extract them from ippscmerged.lib by
lib.exe ippscmerged.lib /EXTRACT:d:/ippsr_sc/ippobj/sclibsobjs/win32/w7/mrg/ippscsag729/ippscsag729_split0.obj
.................................
0 Kudos
mworkman
Beginner
2,269 Views

One.... Merge Libraries dont seem to be in eval version of IPP v5

Two.... What does the Libraries have to do with the Question I asked...

Three.... Based on the "sample-speech-coding" example can some one please show me how to convert data comming from voip g729 to PCM LINIAR and back to g729 for return

it would go along way in convincing company to buy IPP Licenses

0 Kudos
Vladimir_Dudnik
Employee
2,269 Views
Hi,
that's true, evaluation version of IPP provides only DLLs. You should be able to build speech-coding sample with IPP DLL, aren't you?
I'll ask our expert to comment your third question.
Thanks,
Vladimir
0 Kudos
mworkman
Beginner
2,269 Views
no I get error when tring to build the EXE part... because it wants to build static...
but again the sample deals with file based audio and we need live audio from voip server.... the idea is to tie it into softphone.
and if we can get the g729 codec fixed forout teststhen we can get the funding for Licenses... this is the ugency... we were hopping to have this done this week using your eval but it seems not possible... if we can get this working this week you can look forward to a sale of IPP by next week
0 Kudos
Vladimir_Dudnik
Employee
2,269 Views

Well, lets us first solve your build issue. Could you please look at speech-coding folder and confirm that file support.txt contains sample id like this w_ipp-sample-speech-coding_p_5.0.019?

I've just tested sample, it link IPP DLL.

We will try to help you as quick as possible

Vladimir

0 Kudos
mworkman
Beginner
2,269 Views
I can read the code in basic.... I dont need to compile.....
what I need to know is how to convert it to support g729 encoding and decoding..... that would at least point me to right direction...
0 Kudos
mworkman
Beginner
2,269 Views
g723 also would be handy...
0 Kudos
Vladimir_Dudnik
Employee
2,269 Views

According speech-coding sample's readme.htm,

The samples have been implemented using the Intel Integrated Performance Primitives (Intel IPP) Speech Coding functions.They are command line based applications which process data given by one or more input PCM files and store the result into output bitstreams or PCM files. Both narrow band (8000 Hz) and wide band (16000 KHz) are supported.

the sample provide you exactly functionality you are looking for, right? So, I hope, if you will solve build issue you probably get a better chance to understand how this sample works, how it connects encoder or decoder and so on.

Vladimir

0 Kudos
Igor_B_Intel1
Employee
2,269 Views
Hi,
Touse USC encoder:
#include "usc.h"
#include

/*Declare global variable and pointer to the USC function table*/
extern USC_Fxns USC_G729A_Fxns; /* G729A is done inva_g729 */
USC_Fxns *USC_Gxxx_Fnxs = &USC_G729A_Fxns;
.......
/*Init encoder*/
USC_CodecInfo pInfo;
int i, nbanksEnc;
USC_MemBank* pBanksEnc;
USC_Handle hUSCEncoder;

/* Get the Gxxx codec info */
if(USC_NoError != USC_Gxxx_Fnxs->std.GetInfo((USC_Handle)NULL, &pInfo)) exit(1);
/*We'll create encoder*/

pInfo.params.direction = 0; /* Direction: encode */
pInfo.params.modes.vad = 0; /*No VAD in va_g729*/

pInfo.params.modes.bitrate =8000;/* G729A codec has got this bitrate*/

/* Learn how many memory block needed for the encoder */
if(USC_NoError != USC_Gxxx_Fnxs->std.NumAlloc(&pInfo.params, &nbanksEnc)) exit(2);

/* allocate memory for memory bank table */
pBanksEnc = (USC_MemBank*)malloc(sizeof(USC_MemBank)*nbanksEnc);

/* Query how big has to be each block */
if(USC_NoError != USC_Gxxx_Fnxs->std.MemAlloc(&pInfo.params, pBanksEnc)) exit(3);

/* allocate memory for each block */
for(i=0; ipBanksEnc.pMem = (unsigned char*)malloc(pBanksEnc.nbytes);
}

/* Create encoder instance */
if(USC_NoError != USC_Gxxx_Fnxs->std.Init(&pInfo.params, pBanksEnc, &hUSCEncoder)) exit(4);

Now to encode one frame (this code is equal to call va_g729_encode(short *in, char *out) function.

USC_PCMStream in;
USC_Bitstream out;

/* Set input stream params */
in.bitrate = 8000;
in.nbytes = lenPCM;
in.pBuffer = pPCM;
in.pcmType.bitPerSample = 16;
in.pcmType.sample_frequency = 8000;

/* Set output buffer */
out.pBuffer = pBitstrea;

/* Encode a frame */
if(USC_NoError != USC_Gxxx_Fnxs->Encode (hUSCEncoder, &in, &out)) exit(6);

For G723 codec just change

USC_Fxns *USC_Gxxx_Fnxs = &USC_G729A_Fxns;

to

USC_Fxns *USC_Gxxx_Fnxs = &USC_G723_Fxns;

Igor

0 Kudos
mworkman
Beginner
2,269 Views

Great Example....

thanks.... but how does one clean up after finished

0 Kudos
Igor_B_Intel1
Employee
2,269 Views

Hi,

No clean up needed. Just

for(i=0; ifree(pBanksEnc.pMem);

free(pBanksEnc);

But if you'd like to put a USC codecinstance to its initial state just call:

USC_Status Reinit(USC_Modes *modes, USC_Handle handle );

Igor S. Belyakov

0 Kudos
mworkman
Beginner
2,269 Views
I am still having alot of problems with this....

I am tring to tie it into a Freeware Opensource application

I put the USC lib into a Single Threaded DLL and I am calling it though Application....

Eveything works fine except the encode and decode...
it inits fine but decode and encode fails
0 Kudos
Igor_B_Intel1
Employee
2,122 Views

Could you provide witchstatus you get when you call encode() and decode() functions?

My first assumption that you incorrectly prepare function params. As for encode() function try to do following. Pls be prepared that this function operates under single frame and after function call in->nbytes will hold used PCM size out->nbytes willreturn bitstream size.

USC_PCMStream inData;
USC_Bitstream outData;

in.bitrate = 8000; /*it's hard patch for G729A. For the correct values in.bitrate = pInfo->params.modes.bitrate*/

in.nbytes = *inlen;

in.pBuffer = (char*)in;

in.pcmType.bitPerSample = 16;

in.pcmType.sample_frequency = 8000;

out.pBuffer = out;

Igor S. Belyakov

0 Kudos
Reply