shithub: opus

Download patch

ref: 0918365b5141780969e2a09608a11d91228b502e
parent: b15b30ce6d724956e7453154db4cde396be3c3cf
author: Jean-Marc Valin <[email protected]>
date: Wed Jul 4 15:21:42 EDT 2012

Fixes a VBR bug with 2.5 ms frames

tf_estimate was being initialized to zero and then never set because
transient_analysis() wasn't being called. This could also have affected
other frame sizes at lower complexity.

--- a/celt/celt.c
+++ b/celt/celt.c
@@ -293,7 +293,7 @@
 }
 
 static int transient_analysis(const opus_val32 * restrict in, int len, int C,
-                              int overlap, opus_val16 *tf_estimate, int *tf_chan, AnalysisInfo *analysis)
+                              int overlap, float *tf_estimate, int *tf_chan, AnalysisInfo *analysis)
 {
    int i;
    VARDECL(opus_val16, tmp);
@@ -317,7 +317,6 @@
    N=len/block-1;
    ALLOC(bins, N, opus_val16);
 
-   *tf_estimate = 0;
    tf_max = 0;
    for (c=0;c<C;c++)
    {
@@ -983,7 +982,7 @@
    int anti_collapse_on=0;
    int silence=0;
    int tf_chan = 0;
-   opus_val16 tf_estimate=0;
+   float tf_estimate=1;
    opus_val16 stereo_saving = 0;
    int pitch_change=0;
    opus_int32 tot_boost=0;