diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2015-11-16 23:03:17 -0500 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2015-11-27 17:54:42 -0500 |
commit | 7eadd5420de1427046be46c4f884473dd9f738ac (patch) | |
tree | 5527f937aee346579419a00beb5e70744b0f1334 | |
parent | 60fcfd59541bab7189cc416f2f5692bfbb534f32 (diff) | |
download | opus-7eadd5420de1427046be46c4f884473dd9f738ac.tar.gz |
Quality: removes VBR attenuation at low bitrate
Turns out that even low bitrates benefit from VBR
-rw-r--r-- | celt/celt_encoder.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c index 1c9dbcb2..4e688bf4 100644 --- a/celt/celt_encoder.c +++ b/celt/celt_encoder.c @@ -1279,18 +1279,11 @@ static int compute_vbr(const CELTMode *mode, AnalysisInfo *analysis, opus_int32 /*printf("%f %d\n", maxDepth, floor_depth);*/ } - if ((!has_surround_mask||lfe) && (constrained_vbr || bitrate<64000)) + /* Make VBR less aggressive for constrained VBR because we can't keep a higher bitrate + for long. Needs tuning. */ + if ((!has_surround_mask||lfe) && constrained_vbr) { - opus_val16 rate_factor; -#ifdef FIXED_POINT - rate_factor = MAX16(0,(bitrate-32000)); -#else - rate_factor = MAX16(0,(1.f/32768)*(bitrate-32000)); -#endif - if (constrained_vbr) - rate_factor = MIN16(rate_factor, QCONST16(0.67f, 15)); - target = base_target + (opus_int32)MULT16_32_Q15(rate_factor, target-base_target); - + target = base_target + (opus_int32)MULT16_32_Q15(QCONST16(0.67f, 15), target-base_target); } if (!has_surround_mask && tf_estimate < QCONST16(.2f, 14)) |