mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
add some code optimizations, see the report for an explanation
(issue #7105, Mithraen) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@29018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -239,13 +239,13 @@ struct adpcm_decoder_pvt {
|
||||
static int adpcmtolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
|
||||
{
|
||||
struct adpcm_decoder_pvt *tmp = pvt->pvt;
|
||||
int x;
|
||||
int x = f->datalen;
|
||||
unsigned char *src = f->data;
|
||||
int16_t *dst = (int16_t *)pvt->outbuf + pvt->samples;
|
||||
|
||||
for (x=0; x < f->datalen; x++) {
|
||||
*dst++ = decode((src[x] >> 4) & 0xf, &tmp->state);
|
||||
*dst++ = decode(src[x] & 0x0f, &tmp->state);
|
||||
while (x--) {
|
||||
*dst++ = decode((*src >> 4) & 0xf, &tmp->state);
|
||||
*dst++ = decode(*src++ & 0x0f, &tmp->state);
|
||||
}
|
||||
pvt->samples += f->samples;
|
||||
pvt->datalen += 2*f->samples;
|
||||
|
Reference in New Issue
Block a user