update voipcodecs

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7600 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Brian West committed 2008-02-13 00:44:51 +00:00
1 parent c0b192bedc
commit 55d749ff23
5 files changed
+47 -47

No files matched your search

+18 -19
View File
@@ -26,7 +26,7 @@
* This code is based on the widely used GSM 06.10 code available from
* http://kbs.cs.tu-berlin.de/~jutta/toast.html
*
* $Id: gsm0610_decode.c,v 1.15 2008/02/09 15:31:36 steveu Exp $
* $Id: gsm0610_decode.c,v 1.16 2008/02/12 12:27:48 steveu Exp $
*/
/*! \file */
@@ -310,50 +310,49 @@ int gsm0610_unpack_voip(gsm0610_frame_t *s, const uint8_t c[33])
}
/*- End of function --------------------------------------------------------*/
int gsm0610_decode(gsm0610_state_t *s, int16_t amp[], const uint8_t code[], int quant)
int gsm0610_decode(gsm0610_state_t *s, int16_t amp[], const uint8_t code[], int len)
{
gsm0610_frame_t frame[2];
const uint8_t *c;
int bytes;
int samples;
int i;
c = code;
for (i = 0; i < quant; i++)
samples = 0;
for (i = 0; i < len; i += bytes)
{
switch (s->packing)
{
default:
case GSM0610_PACKING_NONE:
if ((bytes = gsm0610_unpack_none(frame, c)) >= 0)
if ((bytes = gsm0610_unpack_none(frame, &code[i])) >= 0)
{
decode_a_frame(s, amp, frame);
amp += GSM0610_FRAME_LEN;
decode_a_frame(s, &amp[samples], frame);
samples += GSM0610_FRAME_LEN;
}
break;
case GSM0610_PACKING_WAV49:
if ((bytes = gsm0610_unpack_wav49(frame, c)) >= 0)
if ((bytes = gsm0610_unpack_wav49(frame, &code[i])) >= 0)
{
decode_a_frame(s, amp, frame);
amp += GSM0610_FRAME_LEN;
decode_a_frame(s, amp, frame + 1);
amp += GSM0610_FRAME_LEN;
decode_a_frame(s, &amp[samples], frame);
samples += GSM0610_FRAME_LEN;
decode_a_frame(s, &amp[samples], frame + 1);
samples += GSM0610_FRAME_LEN;
}
break;
case GSM0610_PACKING_VOIP:
if ((bytes = gsm0610_unpack_voip(frame, c)) >= 0)
if ((bytes = gsm0610_unpack_voip(frame, &code[i])) >= 0)
{
decode_a_frame(s, amp, frame);
amp += GSM0610_FRAME_LEN;
decode_a_frame(s, &amp[samples], frame);
samples += GSM0610_FRAME_LEN;
}
break;
}
/*endswitch*/
if (bytes < 0)
return 0;
c += bytes;
}
/*endwhile*/
return quant*GSM0610_FRAME_LEN;
/*endfor*/
return samples;
}
/*- End of function --------------------------------------------------------*/
/*- End of file ------------------------------------------------------------*/