Prevents remove_doubling() from considering negative pitch gains
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 24 Apr 2012 21:00:54 +0000 (17:00 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 24 Apr 2012 21:00:54 +0000 (17:00 -0400)
celt/pitch.c

index 5b0cfb6..29e4bd1 100644 (file)
@@ -365,6 +365,7 @@ opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
          g = g1;
       }
    }
+   best_xy = MAX32(0, best_xy);
    if (best_yy <= best_xy)
       pg = Q15ONE;
    else