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:
Russell Bryant
2006-05-20 13:37:11 +00:00
parent 9d53a3e7f5
commit b88c06b8b5
4 changed files with 27 additions and 26 deletions

View File

@@ -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;