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

G729 decoder example with voipong

gcarrillo
Beginner
636 Views
Hi...

I want to use the example G729 decoder with a file raw G729 captured by the voipong. Since I read in a previous message, the decoder receives a ITU-T test vector format file. The file captured by the voipong indicates that the length of the packages G729 changes between 28,16,8 and 2. I checked the code of the encoder and noticed that the function Bits2Ref () (convert to ITU-T test format) handles length of 10,8,15 and 2. I want to know if the lengths indicated by the voipong can be handled by the IPP or simply they mean something else like union of several packages (for example 28: 10+10+8).

Thanks

Gladys

PD: my language is spanish, so my english is not so good.
0 Kudos
3 Replies
Igor_B_Intel1
Employee
636 Views
Hi,
In case of G729, I thing voipong just saves payload data from RTP packet without modification.
RFC 3551 tells thatG729 RTP packet may consist of zero or moreactive frames (15 or 10 or8 bytes, it depends on used bitrate.), followed by zero or oneSID frames (2 bytes).
In your case I assume that only G729D of SID frame are present.
Please try to do the following experiment:
///
int pckLen; - packet length
char *pPayloadData; - pointer to the data
int i;
while(pckLen >= 8) {
decode G729D frame;
pckLen -= 8;
pPayloadData -= 8;
}
0 Kudos
Igor_B_Intel1
Employee
636 Views
Hi,
In case of G729, I thing voipong just saves payload data from RTP packet without modification.
RFC 3551 tells thatG729 RTP packet may consist of zero or moreactive frames (15 or 10 or8 bytes, it depends on used bitrate.), followed by zero or oneSID frames (2 bytes). Without any payload headers.
In your case I assume that only G729D (6.4 kbits/s)and SID frame are present (because there are packets with 8 bytes length). There are variable packet length in ms. And your file doesn't conform to RFC 3551.
According to the assumptions above please try to do the following experiment:
///
char *pDecPCMData; - decoded bitsream;
USC_Fxns USC_CODEC_Fxns = USC_G729I_Fnxs; /*Linked to the G729I codec*/
USC_Handle decoder;/decoder handle*/
USC_Bitsream in;
USC_PCMStream out;
////
init decoder!!!!!
/////
{
/*loop for one packet*/
int pckLen; - packet length
char *pPayloadData; - pointer to the data from the voipong's file
/*Decode active G729D frames*/
while(pckLen >= 8) {
in.nbytes = 8;
in.frametype = 2;/*Active G729D frame*/
in.pBuffer = pPayloadData;
out.pBuffer = pDecPCMData;
USC_CODEC_Fxns->sts.Decode(decoder, &in, &out);
pckLen -= 8;
pPayloadData += 8;
pDecPCMData += 160;
}
/*Decode SID frames id thay are present*/
while(pckLen >= 0) {
in.nbytes = 2;
in.frametype = 1;/*SID frame*/
in.pBuffer = pPayloadData;
out.pBuffer = pDecPCMData;
USC_CODEC_Fxns->sts.Decode(decoder, &in, &out);
pckLen -= 2;
pPayloadData += 2;
pDecPCMData += 160;
/*It may be nessesary to add two untransmitted frames*/
/*******************
in.nbytes = 0;
in.frametype = 0;/*Untransmitted frame*/
in.pBuffer = pPayloadData;
out.pBuffer = pDecPCMData;
USC_CODEC_Fxns->sts.Decode(decoder, &in, &out);
pDecPCMData += 160;
in.nbytes = 0;
in.frametype = 0;/*Untransmitted frame*/
in.pBuffer = pPayloadData;
out.pBuffer = pDecPCMData;
USC_CODEC_Fxns->sts.Decode(decoder, &in, &out);
pDecPCMData += 160;
**********************/
}
}
Igor S. Belyakov
0 Kudos
arafath_h_
Beginner
636 Views

Can you please explain the case of G729A where the input buffers are coming in different bytes,........but most of the input buffers are 22 bytes

I can execute 2 loops of 10 ms frames and 2 bytes are remaing........

Please suggest me the actual steps to be taken for g729a decoding

0 Kudos
Reply