From 9c23f5cdca89b9ef7af158d19f436360bb404837 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin <jmvalin@jmvalin.ca> Date: Mon, 28 Oct 2013 14:15:18 -0400 Subject: [PATCH] Makes stereo savings still less aggressive Caps the savings at 1 bit per (coded) sample. This doesn't really increase the bitrate and fixes some issues, e.g. with IgorC's "twilight" sample. --- celt/celt_encoder.c | 1 + 1 file changed, 1 insertion(+) diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c index 59dcc5c61..612fc2136 100644 --- a/celt/celt_encoder.c +++ b/celt/celt_encoder.c @@ -1156,6 +1156,7 @@ static int compute_vbr(const CELTMode *mode, AnalysisInfo *analysis, opus_int32 coded_stereo_dof = (eBands[coded_stereo_bands]<<LM)-coded_stereo_bands; /* Maximum fraction of the bits we can save if the signal is mono. */ max_frac = DIV32_16(MULT16_16(QCONST16(0.8f, 15), coded_stereo_dof), coded_bins); + stereo_saving = MIN16(stereo_saving, QCONST16(1.f, 8)); /*printf("%d %d %d ", coded_stereo_dof, coded_bins, tot_boost);*/ target -= (opus_int32)MIN32(MULT16_32_Q15(max_frac,target), SHR32(MULT16_16(stereo_saving-QCONST16(0.1f,8),(coded_stereo_dof<<BITRES)),8)); -- GitLab