[MPlayer-cvslog] CVS: main/libaf af_ladspa.c, NONE, 1.1 .cvsignore, 1.1, 1.2 Makefile, 1.18, 1.19 af.c, 1.34, 1.35

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Dec 24 11:10:12 CET 2004

> > I just don't think that is what you want. It will give you values in
> > between -1 and (1 - 1/32768), thus scaling positive values a bit smaller
> > than negative ones. This will produce inaccuracies with almost any filter
> > that does anything useful.. I really think you should use unsigned as
> > input format and multiply (faster than division) by (2.0f / 65535.0f) and
> > then subtract 1.0f. And for converting back add 1.0f and multiply by
> > (65535.0f / 2.0f). You can of course write the numbers out, if you don't
> > want to rely on the compiler optimizing it...
> I agree. I don't know what I was thinking there, although it is better than 
> what was previously in the proposed patch. The inaccuracy is only 0.003%, 
> so I don't think it'll be a big problem in -pre6. Nevertheless, it's wrong 
> so I'll fix this.

Actually I'm not too sure anymore if it's wrong - at least I think you
will always have some inaccuracy in that conversion...
Actually... Why don't you just request float sample format 
(AF_FORMAT_F | AF_FORMAT_NE | AF_FORMAT_SI) from mplayer?? This will be a big 
speedup when people use e.g. several instances of this filter one after the other.
Also it avoids code duplication and provides a central place to speedup
and fix the code (af_format.c, the conversion maybe should be improved
though later on - also it doesn't do clipping, so you would
have to do that in your code if you need it - maybe this should
be done in af_format.c later on, but it comes with a speed penalty :-(...).

Reimar Döffinger

More information about the MPlayer-cvslog mailing list