[MPlayer-dev-eng] Soft volume clip methods

Zoltan Hidvegi mplayer at hzoli.2y.net
Sat Feb 19 23:52:31 CET 2005


The current softclip method used my libaf is sin(x), which is slow,
and becomes hard at 4dB.  What are the requirements for a good clip
functions?  Obviously, it must clip to [-1,+1], it's first derivative
at zero must be 1, it must be strictly increasing and and it must
satisfy f(-x) = -f(x).  The rest are fuzzy, like it should be
reasonable smooth etc.  For example, what about this much faster
function:

sign(x) * (1 - (2-abs(x))^2/4)  for -2 < x < 2 and sign(x) otherwise.

This hard clips above 6dB.  And there are other possible clip
functions which have no hard limit, e.g. sign(x) * (1 - exp(-abs(x)))
or 2*atan(2x/pi)/pi or similar, like in
http://www.musicdsp.org/showone.php?id=104, but these are slow, what
would be a good unbounded clip funciton with parameterizable hardness?

Zoli




More information about the MPlayer-dev-eng mailing list