Surround: Better LFE handling
Forces CELT-only mode for LFE (despite the rate) and "locks" most of the
CELT analysis:
- No transient or TF
- Band boost on first band
- Only first two bands get PVQ bits
- Forced energy decay after the first two bands
diff --git a/src/opus_multistream_encoder.c b/src/opus_multistream_encoder.c
index b3e0ccc..9dcbb71 100644
--- a/src/opus_multistream_encoder.c
+++ b/src/opus_multistream_encoder.c
@@ -329,7 +329,7 @@
int total = ((st->layout.nb_streams-st->layout.nb_coupled_streams-(st->lfe_stream!=-1))<<8) /* mono */
+ coupled_ratio*st->layout.nb_coupled_streams /* stereo */
+ (st->lfe_stream!=-1)*lfe_ratio;
- channel_rate = 256*st->bitrate_bps/total;
+ channel_rate = 256*(st->bitrate_bps-2000)/total;
}
#ifndef FIXED_POINT
if (st->variable_duration==OPUS_FRAMESIZE_VARIABLE && frame_size != Fs/50)
@@ -347,7 +347,7 @@
else if (i!=st->lfe_stream)
rate[i] = channel_rate;
else
- rate[i] = channel_rate*lfe_ratio>>8;
+ rate[i] = 2000+(channel_rate*lfe_ratio>>8);
}