diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-08 21:33:32 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-08 21:33:32 +0000 |
commit | fba973dd3f53cbcb83134bfc857fdc6bdd697e32 (patch) | |
tree | 520f25812033ab463adcd053afe32c47087af47c /codecs/codec_ilbc.c | |
parent | 809b2f32c0fdb4bb781921f07683db56adc97f21 (diff) |
minor performance improvement
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@42477 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_ilbc.c')
-rw-r--r-- | codecs/codec_ilbc.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/codecs/codec_ilbc.c b/codecs/codec_ilbc.c index 98d410e38..34847fcc7 100644 --- a/codecs/codec_ilbc.c +++ b/codecs/codec_ilbc.c @@ -176,17 +176,21 @@ static struct ast_frame *lintoilbc_frameout(struct ast_trans_pvt *pvt) while (pvt->samples >= ILBC_SAMPLES) { float tmpf[ILBC_SAMPLES]; int i; + /* Encode a frame of data */ - for ( i = 0 ; i < ILBC_SAMPLES ; i++ ) - tmpf[i] = tmp->buf[i]; + for (i = 0 ; i < ILBC_SAMPLES ; i++) + tmpf[i] = tmp->buf[samples + i]; iLBC_encode((unsigned char *) pvt->outbuf + datalen, tmpf, &tmp->enc); + datalen += ILBC_FRAME_LEN; samples += ILBC_SAMPLES; pvt->samples -= ILBC_SAMPLES; - /* Move the data at the end of the buffer to the front */ - if (pvt->samples) - memmove(tmp->buf, tmp->buf + ILBC_SAMPLES, pvt->samples * 2); } + + /* Move the data at the end of the buffer to the front */ + if (pvt->samples) + memmove(tmp->buf, tmp->buf + samples, pvt->samples * 2); + return ast_trans_frameout(pvt, datalen, samples); } |