shithub: opus

Download patch

ref: 4d40636748da8aefd2e17b18c6897199838af77f
parent: 8aa7767207b1e3633004c26aecbb67d1c5118485
author: Hector Martin <marcan@marcan.st>
date: Mon May 25 16:30:04 EDT 2020

fix equivalent bitrate calculation for <20ms frame sizes

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Mark Harris <mark.hsj@gmail.com>

--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -1571,7 +1571,7 @@
                (tmp+4*mode->Fs)/(8*mode->Fs)-!!st->signalling));
       effectiveBytes = nbCompressedBytes - nbFilledBytes;
    }
-   equiv_rate = ((opus_int32)nbCompressedBytes*8*50 >> (3-LM)) - (40*C+20)*((400>>LM) - 50);
+   equiv_rate = ((opus_int32)nbCompressedBytes*8*50 << (3-LM)) - (40*C+20)*((400>>LM) - 50);
    if (st->bitrate != OPUS_BITRATE_MAX)
       equiv_rate = IMIN(equiv_rate, st->bitrate - (40*C+20)*((400>>LM) - 50));