Fix IMA4 decoding

This commit is contained in:
Chris Robinson 2010-11-30 16:54:30 -08:00
parent a79129835c
commit 3f8ae8f1ce

View File

@ -885,7 +885,8 @@ static void DecodeIMA4Block(ALshort *dst, const ALubyte *IMAData, ALint numchans
{
for(c = 0;c < numchans;c++)
{
Sample[c] += ((g_IMAStep_size[Index[c]]*g_IMACodeword_4[IMACode[c]&15])/8);
Sample[c] += g_IMAStep_size[Index[c]] *
g_IMACodeword_4[IMACode[c]&15] / 8;
Index[c] += g_IMAIndex_adjust_4[IMACode[c]&15];
if(Sample[c] < -32768) Sample[c] = -32768;
@ -894,7 +895,7 @@ static void DecodeIMA4Block(ALshort *dst, const ALubyte *IMAData, ALint numchans
if(Index[c] < 0) Index[c] = 0;
else if(Index[c] > 88) Index[c] = 88;
dst[(j+k)*numchans + c] = Sample[c];
dst[j*numchans + c] = Sample[c];
IMACode[c] >>= 4;
}
}