[MPlayer-dev-eng] Audio Filter Layer
Anders Johansson
ajh at atri.curtin.edu.au
Thu Feb 28 04:20:56 CET 2002
Hi,
> > Yes I have rescheduled so it will be ready Real Soon Now (TM), na just
> > kidding I haven't started yet but it is easy to implement so it won't
> > take long to finish it.
>
> do you plan to read whole audio stream, find highest volume and then set up
> software mixer? or you will dinamically set volume depending on avg/max
> volume, similar to brightness control of postprocess filter?
I will make it adaptive, the way a commercial analog compressor/limiter
works, i.e. run the sound through a nonlinear filter that changes over
time depending on the envelope of the data stream.
Basically it works like this: estimate the average energy level in the
data stream using a first order AR model:
p=0.999*p + 0.001*in^2
where p is the power and in is the current sample. Run the sound
through a nonlinear filter:
out=atan(p*in)
where out is current output sample. The arc-tangens function is
implemented using a lookup table (normalized to the levels of the
sample format and power). The adaptation is made once for every N
samples, where N is chosen such that the transition between lookup
tables becomes unaudible.
>
> A'rpi / Astral & ESP-team
//Anders
More information about the MPlayer-dev-eng
mailing list