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

Stefano Sabatini stefano.sabatini-lala
Thu Nov 12 23:29:17 CET 2009


On date Thursday 2009-11-12 23:07:35 +0100, Thilo Borgmann encoded:
> Stefano Sabatini schrieb:
> > On date Thursday 2009-11-12 19:12:52 +0100, Thilo Borgmann encoded:
> >> Michael Niedermayer schrieb:
> >>> 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 ...
> > 
> > Do as you want, but the last is a little too obfuscated...
> 
> Hm, it seems like I've submitted updated revisions too fast...
> I leave the decision up to you just tell me which way we all can agree
> on and I will submit a corresponding patch.

I'm OK with:
ltp_lag_length = 8 + (samplerate >= 96000) + (samplerate >= 192000);

or what I suggested in the first place, but again this could easily
end-up in a bikeshed issue, so use the form you prefer the most.

Regards.
-- 
FFmpeg = Free and Fast Mean Prodigious Exxagerate Guru



More information about the ffmpeg-devel mailing list