}
/* Use mode4 for stereo and don't forget to change the value of CHANNEL above */
- enc = celt_encoder_new(mode);
- dec = celt_decoder_new(mode);
+ enc = celt_encoder_create(mode);
+ dec = celt_decoder_create(mode);
celt_mode_info(mode, CELT_GET_FRAME_SIZE, &frame_size);
celt_mode_info(mode, CELT_GET_NB_CHANNELS, &channels);
{
VARDECL(celt_int16_t *in);
VARDECL(celt_int16_t *out);
+ SAVE_STACK;
ALLOC(in, frame_size*channels, celt_int16_t);
ALLOC(out, frame_size*channels, celt_int16_t);
fread(in, sizeof(short), frame_size*channels, fin);
if (len <= 0)
{
fprintf (stderr, "celt_encode() returned %d\n", len);
+ RESTORE_STACK;
return 1;
}
/* This is to simulate packet loss */
out[i] = in[i];
#endif
for (i=0;i<frame_size*channels;i++)
+ {
rmsd += (in[i]-out[i])*1.0*(in[i]-out[i]);
+ /*out[i] -= in[i];*/
+ }
count++;
fwrite(out, sizeof(short), (frame_size-skip)*channels, fout);
skip = 0;
+ RESTORE_STACK;
}
celt_encoder_destroy(enc);
celt_decoder_destroy(dec);