mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-20 11:43:52 +00:00
further codec module optimization based on codec_alaw changes by rizzo
(issue #7190, Mithraen) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@29880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -56,14 +56,15 @@ static unsigned char a2mu[256];
|
||||
static int alawtoulaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
|
||||
{
|
||||
int x = f->samples;
|
||||
int in_samples = f->samples;
|
||||
unsigned char *src = f->data;
|
||||
unsigned char *dst = (unsigned char *)pvt->outbuf + pvt->samples;
|
||||
|
||||
pvt->samples += x;
|
||||
pvt->datalen += x;
|
||||
|
||||
while (x--)
|
||||
*dst++ = a2mu[*src++];
|
||||
pvt->samples += in_samples;
|
||||
pvt->datalen += in_samples;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -71,14 +72,15 @@ static int alawtoulaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
|
||||
static int ulawtoalaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
|
||||
{
|
||||
int x = f->samples;
|
||||
int in_samples = f->samples;
|
||||
unsigned char *src = f->data;
|
||||
unsigned char *dst = (unsigned char *)pvt->outbuf + pvt->samples;
|
||||
|
||||
pvt->samples += x;
|
||||
pvt->datalen += x;
|
||||
|
||||
while (x--)
|
||||
*dst++ = mu2a[*src++];
|
||||
pvt->samples += in_samples;
|
||||
pvt->datalen += in_samples;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user