shithub: opus

Download patch

ref: 6b9087aa6efbb98731216d2b03cc977826fd6062
parent: 292544453fc89a9a2d14781328f8b1a517e756bc
author: Jean-Marc Valin <[email protected]>
date: Sat Sep 28 19:51:11 EDT 2013

Avoids unnecessary copying in opus_encode for delayed decision

--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -2004,9 +2004,9 @@
          st->variable_duration, st->channels, st->Fs, st->bitrate_bps,
          delay_compensation, downmix_float, st->analysis.subframe_mem);
 
-   ALLOC(in, analysis_frame_size*st->channels, float);
+   ALLOC(in, frame_size*st->channels, float);
 
-   for (i=0;i<analysis_frame_size*st->channels;i++)
+   for (i=0;i<frame_size*st->channels;i++)
       in[i] = (1.0f/32768)*pcm[i];
    ret = opus_encode_native(st, in, frame_size, data, max_data_bytes, 16, pcm, analysis_frame_size, 0, -2, st->channels, downmix_int);
    RESTORE_STACK;