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

Bug in AMR-WB codec

vadim1
Beginner
304 Views
I think, i've stumbled on buf in AMR-WB codec in IPP V5.0


In the funciongetBitstreamSize in the file uscamrwb.c

The function calculates the wron number of bytes per AMR frame:
it contains following line:


nbytes = ((BitsLenTbl[usedRate] + 14) / 15) * sizeof(short);

I believe it should be:

a)
nbytes = ((BitsLenTbl[usedRate] + 15) / 16) * sizeof(short);


Or maybe:
b)
nbytes = ((BitsLenTbl[usedRate] + 7) / 8) * sizeof(short);


the b) is equivqlent to what is done in gsmamr (amr narrowband) module.
0 Kudos
2 Replies
Vyacheslav_Baranniko
New Contributor II
304 Views

Thanks a lot!

This is a bug. The bitstream length shouldbe calculated either wayyou pointed out. The bugwill be fixed in thenearest future version of IPP.

Kind regards

Vyacheslav

0 Kudos
vadim1
Beginner
304 Views
Actually thinkink some more about it
c) is buggy too

the correct code will be:

d)
nbytes = ((BitsLenTbl[usedRate] + 7) / 8);


and b) is faulty too because it will always generate an even
result which is incorrect


Vadim
0 Kudos
Reply