[FFmpeg-devel] [PATCH] Long-term prediction for ALS

Michael Niedermayer michaelni
Thu Nov 12 19:03:00 CET 2009


On Thu, Nov 12, 2009 at 10:51:05AM -0500, Ronald S. Bultje wrote:
> Hi,
> 
> On Thu, Nov 12, 2009 at 10:45 AM, Stefano Sabatini
> <stefano.sabatini-lala at poste.it> wrote:
> > On date Thursday 2009-11-12 16:37:04 +0100, Thilo Borgmann encoded:
> >> + ? ?// set lag value for long-term prediction
> >> + ? ?if ? ? ?(avctx->sample_rate >= 192000)
> >> + ? ? ? ?ctx->ltp_lag_length = 10;
> >> + ? ?else if (avctx->sample_rate >= ?96000)
> >> + ? ? ? ?ctx->ltp_lag_length = 9;
> >> + ? ?else
> >> + ? ? ? ?ctx->ltp_lag_length = 8;
> >> +
> >
> > Slightly simpler:
> >
> > ctx->ltp_lag_length = avctx->sample_rate >= 192000 ? 10 :
> > ? ? ? ? ? ? ? ? ? ? ?avctx->sample_rate >= ?96000 ? ?9 : 8;
> 
> ltp_lag_length = 8 + samplerate >= 96000 + samplerate >= 192000;
> (might need brackets).

ltp_lag_length= 8 + FFMIN(samplerate/96000, 2);

if one wants the most compact source ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091112/d9669ca0/attachment.pgp>



More information about the ffmpeg-devel mailing list