Running transient_analysis() even for 2.5 ms frames

This means 2.5 ms frames can now use a higher bitrate for transients.
This commit is contained in:
Jean-Marc Valin 2012-11-19 23:17:06 -05:00
parent 48ac122141
commit 2a5f0565b8

View file

@ -1298,16 +1298,18 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
isTransient = 0;
shortBlocks = 0;
if (st->complexity >= 1)
{
isTransient = transient_analysis(in, N+st->overlap, CC,
&tf_estimate, &tf_chan);
}
if (LM>0 && ec_tell(enc)+3<=total_bits)
{
if (st->complexity >= 1)
{
isTransient = transient_analysis(in, N+st->overlap, CC,
&tf_estimate, &tf_chan);
if (isTransient)
shortBlocks = M;
}
if (isTransient)
shortBlocks = M;
ec_enc_bit_logp(enc, isTransient, 3);
} else {
isTransient = 0;
}
ALLOC(freq, CC*N, celt_sig); /**< Interleaved signal MDCTs */