shithub: opus

Download patch

ref: 54bddf0f1a83f37cfeb8519627beaa2422a86418
parent: 978e4cb507b1fdb90d62e2b15537ebd56087b542
author: Jean-Marc Valin <[email protected]>
date: Wed Sep 11 19:34:51 EDT 2013

Surround analysis should now work for non-20ms frame sizes.

Not well tested.

--- a/src/opus_multistream_encoder.c
+++ b/src/opus_multistream_encoder.c
@@ -222,8 +222,7 @@
 {
    int c;
    int i;
-   /* FIXME: pass LM properly */
-   int LM=3;
+   int LM;
    int pos[8] = {0};
    int upsample;
    int frame_size;
@@ -236,6 +235,10 @@
 
    upsample = resampling_factor(rate);
    frame_size = len*upsample;
+
+   for (LM=0;LM<=celt_mode->maxLM;LM++)
+      if (celt_mode->shortMdctSize<<LM==frame_size)
+         break;
 
    ALLOC(in, frame_size+overlap, opus_val32);
    ALLOC(x, len, opus_val16);