shithub: opus

Download patch

ref: a2546bbf72ad545e3d108a8d0e4b3ed4f1759187
parent: 223b69db022fefc22c6ec075fc0a6766b94e605a
author: Jean-Marc Valin <[email protected]>
date: Fri Jul 16 08:00:00 EDT 2010

Number of short blocks now based on the frame duration instead of the
number of samples

--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -365,13 +365,13 @@
       mode->preemph[3] =  QCONST16(1.f, 13);
    }
 
-   if (frame_size >= 640 && (frame_size%16)==0)
+   if ((celt_int32)frame_size*75 >= Fs && (frame_size%16)==0)
    {
      LM = 3;
-   } else if (frame_size >= 320 && (frame_size%8)==0)
+   } else if ((celt_int32)frame_size*150 >= Fs && (frame_size%8)==0)
    {
      LM = 2;
-   } else if (frame_size >= 160 && (frame_size%4)==0)
+   } else if ((celt_int32)frame_size*300 >= Fs && (frame_size%4)==0)
    {
      LM = 1;
    } else