Fix decision thresholds for larger frame sizes exp_bandwidth_fix3
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Thu, 24 May 2018 06:36:30 +0000 (02:36 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Thu, 24 May 2018 06:36:30 +0000 (02:36 -0400)
Don't assume that frames larger than 20 ms save any overhead compared to 20 ms.

src/opus_encoder.c

index e6cca90..47b586a 100644 (file)
@@ -808,7 +808,8 @@ static opus_int32 compute_equiv_rate(opus_int32 bitrate, int channels,
    opus_int32 equiv;
    equiv = bitrate;
    /* Take into account overhead from smaller frames. */
-   equiv -= (40*channels+20)*(frame_rate - 50);
+   if (frame_rate > 50)
+      equiv -= (40*channels+20)*(frame_rate - 50);
    /* CBR is about a 8% penalty for both SILK and CELT. */
    if (!vbr)
       equiv -= equiv/12;