ref: 172f66a3ac321d1c39c4341944983d3de723d199
parent: b08c4ca3f54c964f1108170d0e4b7df2200b6a82
author: Jean-Marc Valin <[email protected]>
date: Fri Apr 26 22:29:52 EDT 2013
More forced decisions in CELT LFE encoding
--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -1328,7 +1328,7 @@
{
int enabled;
int qg;
- enabled = nbAvailableBytes>12*C && st->start==0 && !silence && !st->disable_pf
+ enabled = (st->lfe || nbAvailableBytes>12*C) && st->start==0 && !silence && !st->disable_pf
&& st->complexity >= 5 && !(st->consec_transient && LM!=3 && st->variable_duration);
prefilter_tapset = st->tapset_decision;
@@ -1391,6 +1391,11 @@
tf_chan = 0;
compute_band_energies(mode, freq, bandE, effEnd, C, M);
+ if (st->lfe)
+ {
+ for (i=2;i<st->end;i++)
+ bandE[i] = IMIN(bandE[i], MULT16_32_Q15(QCONST16(1e-4f,15),bandE[0]));
+ }
amp2Log2(mode, effEnd, st->end, bandE, bandLogE, C);
/*for (i=0;i<21;i++)
printf("%f ", bandLogE[i]);
@@ -1404,7 +1409,7 @@
/* Last chance to catch any transient we might have missed in the
time-domain analysis */
- if (LM>0 && ec_tell(enc)+3<=total_bits && !isTransient && st->complexity>=5)
+ if (LM>0 && ec_tell(enc)+3<=total_bits && !isTransient && st->complexity>=5 && !st->lfe)
{
if (patch_transient_decision(bandLogE, oldBandE, nbEBands, st->end, C))
{
@@ -1462,7 +1467,11 @@
if (ec_tell(enc)+4<=total_bits)
{
- if (shortBlocks || st->complexity < 3 || nbAvailableBytes < 10*C || st->start != 0)
+ if (st->lfe)
+ {
+ st->tapset_decision = 0;
+ st->spread_decision = SPREAD_NORMAL;
+ } else if (shortBlocks || st->complexity < 3 || nbAvailableBytes < 10*C || st->start != 0)
{
if (st->complexity == 0)
st->spread_decision = SPREAD_NONE;