shithub: opus

Download patch

ref: d121260f38f13d83c0e2146114eeca144183f5f1
parent: 01fa3389857b2d809d008fc6b55ff191368b6905
author: Jean-Marc Valin <[email protected]>
date: Tue Jan 25 08:11:36 EST 2011

Minimum period is now 15

--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -61,7 +61,7 @@
 static const unsigned char tapset_icdf[3]={2,1,0};
 
 #define COMBFILTER_MAXPERIOD 1024
-#define COMBFILTER_MINPERIOD 16
+#define COMBFILTER_MINPERIOD 15
 
 /** Encoder state 
  @brief Encoder state
--- a/libcelt/pitch.c
+++ b/libcelt/pitch.c
@@ -253,7 +253,9 @@
    celt_word32 xcorr[3];
    celt_word32 best_xy, best_yy;
    int offset;
+   int minperiod0;
 
+   minperiod0 = minperiod;
    maxperiod /= 2;
    minperiod /= 2;
    *_T0 /= 2;
@@ -364,8 +366,8 @@
       pg = g;
    *_T0 = 2*T+offset;
 
-   if (*_T0<2*minperiod)
-      *_T0=2*minperiod;
+   if (*_T0<minperiod0)
+      *_T0=minperiod0;
    return pg;
 }