[MPlayer-dev-eng] Let af_lavcresample use float point sample format.

Ivan Kalvachev ikalvachev at gmail.com
Mon Apr 22 22:53:21 EEST 2024


On Sat, Apr 20, 2024 at 3:13 AM Michael Niedermayer
<michael at niedermayer.cc> wrote:
>
> Hi
>
> On Sat, Apr 20, 2024 at 01:04:00AM +0200, Alexander Strasser wrote:
> > Hi Ivan,
> >
> > On 2024-04-15 21:40 +0300, Ivan Kalvachev wrote:
> > > While fixing ch_layout in af_lavcresample, I've noticed that libaf
> > > inserts two format change filters - one before lavcresample to do
> > > float->s16le and one after to do s16le->float. Since swresample
> > > handles float point sample format natively, it should be both faster
> > > and better quality to use it.
> > >
> > > If float point sample format is requested by libaf at initialization,
> > > use swresample float point sample format for the conversion.
> > > Adjust internal buffer size calculations to use a variable (bps).
> > > Store the used format in the filter context structure to avoid
> > > unnecessary reinitialization.
> >
> > Cannot comment much on the inter workings of libaf and libswr, but
> > the code looks good to me.
>
> I cant comment on libaf either but if it works it should be correct
> its quite unlikely to be wrong and working
>
> thx
>
> [...]
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Asymptotically faster algorithms should always be preferred if you have
> asymptotical amounts of data

Thank you all for the testing.
The patch is committed.

As for the documentation change.
Do you think the following text is proper:

"Changes the sample rate of the audio stream to <srate> in Hz.
    It supports both float and 16-bit integer native-endian formats."

Best Regards
   Ivan Kalvachev
  iive


More information about the MPlayer-dev-eng mailing list