[MPlayer-dev-eng] [PATCH] intresample first attempt

Balatoni Denes pnis at coder.hu
Sun Oct 20 15:05:32 CEST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

I attached two new patches. One is af_intresample.c, 
the other adds -af linint to the options. If you don't like it,
feel free to do whatever you want with it, or I can change it too.

> intresample() function to work with 1 to 6 channels and resend it -
This I did, but could not test.

> filter creates a frequency offset that changes over time, that could be
> fixed by using a counter to add samples when the counter passes "step"
> (I think).
I don't really understand this. The change I made, is that pt is now saved in
the context, so it is not initialized to 0 always.
Also of course this filter sounds much worse than your resample filter - 
interpolation I might add later if you want, but that will make it a bit 
slower (and much nicer too).


> I knew there would be a sample frequency somewhere that would contain a
> big enough prime number :). Could you check the "up" and "down" numbers
> (mplayer -v) and post them here.
mplayer -v says:

Building audio filter chain for 11127Hz/1ch/8bit -> 44100Hz/2ch/16bit...
[dummy] Was reinitialized, rate=11127Hz, nch = 1, format = 0x00000008 and bps 
= 1
[resample] Changing sample rate to 44100Hz
[resample] New filter designed up: 14700 down: 3709


> I really hope you don't mind if we don't make it a separate filter,
> the reason is that I want it to work with the automatic conversion.
Not at all.


Now I have made some tests. There is this 11127->44100 hz video.
With the original resample audio time is 2.4 s, with the new
0.6s  - that's like 1% improvement in cpu utilization.
Then I tried matrix trailer pocketdivx, 44100->11025 hz .
With the original resample audio time is ~7.8 s, with the
new one ~6.8 s - that's like less than 1 % improvement in
cpu utilization. So it turns out that af_resample is not slow at 
all actually, that waiting at the beginning is than probably a bug (and in 
deed, it didn't happen with the matrix pocketdivx).
I hope it is still useable something, but I won't be surprised if it is not ;)


best regards
Denes

- -- 
"Use the source Luke !"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD4DBQE9sqocaQToeq3jgogRAsJOAJjIIIgUy2XVxGLMk58+kooWLdpYAJ4p14Ii
Ij6Qd6CS6bIZKxfPNxFrQg==
=qG3a
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: intresample2.patch
Type: text/x-c++
Size: 5043 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20021020/98940f02/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linint.patch
Type: text/x-c
Size: 2708 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20021020/98940f02/attachment-0001.bin>


More information about the MPlayer-dev-eng mailing list