[MPlayer-dev-eng] [BUG] surround audio plugin broken
D Richard Felker III
dalias at aerifal.cx
Mon Jan 6 05:04:10 CET 2003
On Mon, Jan 06, 2003 at 11:41:29AM +0800, Anders Johansson wrote:
> Hi,
>
> > > > > ill try to optimize the libaf stuff tomorrow perhaps ...
> > > >
> > > > Cool. AC3 decoding and resampling to 44100 are the two biggest
> > > > bottlenecks preventing realtime dvd playback on my box right now! With
> > > > Fabrice working on the ffmpeg ac3 decoder and libaf optimized, I
> > > > imagine I'll finally be able to play dvds (without -framedrop).
> > >
> > > Try the linear interpolation it is faster than the filter bank
> > > resampling.
> >
> > It does indeed help, reducing sound cpu usage by a couple percent.
> > However, I expect that an optimized implementation of the filter bank
> > code could be even faster.
>
> It will never be faster than linear interpolation cause it only
> duplicates or removes samples (no addition or multiplication at all).
Hmm, I assumed it interpolated samples rather than just inserting or
dropping them. Reading the code, however, I still think it's much less
efficient than a good asm implementation would be, and I wouldn't be
at all surprised if a good asm implementation of the filter bank
resample could rival the current C linint resample. For example, the
64 bit arithmetic has an obvious replacement with nice use of carries,
eliminating the shifts at the same time. Perhaps a good compiler would
do this for you, but last I checked gcc wasn't a "good compiler". :)
And of course vector instructions (mmx, etc.) could reduce the impact
of arithmetic in the filter bank code quite a bit.
BTW, I'm reading the code as I write this, and I question the validity
of selecting filter length based on the presence of MMX. Certainly
length 16 should be chosen on fast non-x86 systems. Ideally it should
be a runtime option, IMO...
Rich
More information about the MPlayer-dev-eng
mailing list