Minimum period is now 15

This commit is contained in:
Jean-Marc Valin 2011-01-25 13:11:36 -05:00
parent 01fa338985
commit d121260f38
2 changed files with 5 additions and 3 deletions

View file

@ -61,7 +61,7 @@ static const unsigned char spread_icdf[4] = {25, 23, 2, 0};
static const unsigned char tapset_icdf[3]={2,1,0}; static const unsigned char tapset_icdf[3]={2,1,0};
#define COMBFILTER_MAXPERIOD 1024 #define COMBFILTER_MAXPERIOD 1024
#define COMBFILTER_MINPERIOD 16 #define COMBFILTER_MINPERIOD 15
/** Encoder state /** Encoder state
@brief Encoder state @brief Encoder state

View file

@ -253,7 +253,9 @@ celt_word16 remove_doubling(celt_word16 *x, int maxperiod, int minperiod,
celt_word32 xcorr[3]; celt_word32 xcorr[3];
celt_word32 best_xy, best_yy; celt_word32 best_xy, best_yy;
int offset; int offset;
int minperiod0;
minperiod0 = minperiod;
maxperiod /= 2; maxperiod /= 2;
minperiod /= 2; minperiod /= 2;
*_T0 /= 2; *_T0 /= 2;
@ -364,8 +366,8 @@ celt_word16 remove_doubling(celt_word16 *x, int maxperiod, int minperiod,
pg = g; pg = g;
*_T0 = 2*T+offset; *_T0 = 2*T+offset;
if (*_T0<2*minperiod) if (*_T0<minperiod0)
*_T0=2*minperiod; *_T0=minperiod0;
return pg; return pg;
} }