diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2017-06-01 03:08:58 -0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2017-06-01 03:08:58 -0400 |
commit | 454330873e1c6b10b389bdcd40530c23dee33bae (patch) | |
tree | c50308e5d22503b87a0eb4397093d3ba37bbbd81 | |
parent | aef369f536ecb89ab94c2c6bc6b6e0a767fab39d (diff) | |
download | opus-454330873e1c6b10b389bdcd40530c23dee33bae.tar.gz |
Let CBR use more bits for dynalloc
It seems like letting CBR use up to 2/3 of the bit is still a win
-rw-r--r-- | celt/celt_encoder.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c index 72b6540a..187cccce 100644 --- a/celt/celt_encoder.c +++ b/celt/celt_encoder.c @@ -1076,11 +1076,11 @@ static opus_val16 dynalloc_analysis(const opus_val16 *bandLogE, const opus_val16 boost = (int)SHR32(EXTEND32(follower[i])*width/6,DB_SHIFT); boost_bits = boost*6<<BITRES; } - /* For CBR and non-transient CVBR frames, limit dynalloc to 1/4 of the bits */ + /* For CBR and non-transient CVBR frames, limit dynalloc to 2/3 of the bits */ if ((!vbr || (constrained_vbr&&!isTransient)) - && (tot_boost+boost_bits)>>BITRES>>3 > effectiveBytes/4) + && (tot_boost+boost_bits)>>BITRES>>3 > 2*effectiveBytes/3) { - opus_int32 cap = ((effectiveBytes/4)<<BITRES<<3); + opus_int32 cap = ((2*effectiveBytes/3)<<BITRES<<3); offsets[i] = cap-tot_boost; tot_boost = cap; break; |