[MPlayer-dev-eng] [BUG] surround audio plugin broken

Michael Niedermayer michaelni at gmx.at
Thu Jan 9 11:35:37 CET 2003


Hi

On Thursday 09 January 2003 03:31, Anders Johansson wrote:
[...]
> > hmm, seems its a bit more tricky to optimize
> > the problem:
> > the circular buffer is filled 1 sample at a time and then these are
> > immediatly used in the FIR filter, this makes MMX&SSE useless as there
> > are large penalties for reading something which was written with a
> > different size immedeately before, i ll try to use a larger buffer and
> > prefill it before running the FIR filter over it ...
>
> Make sure it still works if there is only 1 new input sample.
ok, but how do i force that the resample filter is feeded with 1 new sample at 
a time?

>
> > btw, is
> > #define ADDQUE(xi,xq,in)\
> >   xq[xi]=xq[xi+L]=(*in);\
> >   xi=(xi-1)&(L-1);
> > correct?
> > shouldnt it be
> > #define ADDQUE(xi,xq,in)\
> >   xi=(xi-1)&(L-1);\
> >   xq[xi]=xq[xi+L]=(*in);
> > ?
>
> Yes I think so. I'll apply the matlab script I used to develope the
> algorithm.
my matlab skills are limited, so i dunno if its identical or not, ill try to 
describe the possible issue more clearly

the buffer is filled in reverse direction & the index decreased after the 
store so, the buffer will look something like:

0-------0-------
       ^

0------10------1
      ^
...
0765432107654321
^

and the FIR filter will be applied from the index, so it will get samples 
07654321 (in that order, which seems wrong to me)

my suggested variant fills the buffer after changing the index so:

-------0-------0
       ^

------10------10
      ^
...
7654321076543210
^

here the FIR filter is feeded with 76543210 which seems more likely correct 
(to me)

[...]

Michael


More information about the MPlayer-dev-eng mailing list