ref: c33c3d6ce59e0c51db98048161e65cc165c9565b
parent: d539c6b9c59d243f81a47d78b9497ea455bdea00
author: Ron <[email protected]>
date: Fri Feb 4 00:44:15 EST 2011
Align the sample buffer for short
--- a/tools/celtenc.c
+++ b/tools/celtenc.c
@@ -92,9 +92,9 @@
/* Convert input audio bits, endians and channels */
static int read_samples(FILE *fin,int frame_size, int bits, int channels, int lsb, short * input, char *buff, celt_int32 *size)
{
- unsigned char in[MAX_FRAME_SIZE*2];
+ short s[MAX_FRAME_SIZE];
+ unsigned char *in = (unsigned char*)s;
int i;
- short *s;
int nb_read;
if (size && *size<=0)
@@ -120,7 +120,6 @@
if (nb_read==0)
return 0;
- s=(short*)in;
if(bits==8)
{
/* Convert 8->16 bits */
@@ -144,7 +143,7 @@
/* copy to float input buffer */
for (i=0;i<frame_size*channels;i++)
{
- input[i]=(short)s[i];
+ input[i]=s[i];
}
for (i=nb_read*channels;i<frame_size*channels;i++)