[MPlayer-dev-eng] [PATCH] fix for -srate bug
Michael Niedermayer
michaelni at gmx.at
Wed Oct 27 18:48:31 CEST 2004
Hi
On Monday 25 October 2004 00:55, Ed Wildgoose wrote:
> Hi Michael,
>
> Had a chance to look at this code a little. I have a couple of quick
> questions:
>
> Why did you do this:
> >@@ -351,15 +402,34 @@
> > src_data.data_in = input ;
> > src_data.input_frames = BUFFER_LEN ;
> >
> >- src_data.src_ratio = 1.999 ;
> >+ src_data.src_ratio = 0.4999 ;
the bandwidth test simply failed without this change
>
> and this:
> >@@ -402,7 +472,7 @@
> >
> > freq = f1 + (3.0 - a1) * (f2 - f1) / (a2 - a1) ;
> >
> >- return 200.0 * freq ;
> >+ return 400.0 * freq ;
> > } /* bandwidth_test */
>
> I can't quite follow your logic here?
as the *2 upsampling is replaced by /2 downsampling the maximum frequency
changes from samplingrate/2 -> /4
>
> Also, you convert from int to float and add 0.5. But you don't reverse
> this logic when you convert back to int? Why is this?
no, its the other way around, (int v= floor(data[i]*INT16_MAX + 0.5);)
this is simply rounding to nearest, nothing special
On Wednesday 27 October 2004 17:00, Ed Wildgoose wrote:
> Hi Michael,
>
> Not sure if you saw this reply from me on the mplayer list?
>
> I have been in touch with the libsamplerate author and he also agrees
> that since you are starting and ending with 16 bit integers, then you
> really should be seeing a 96dB limit on your results?
yes, thats what i would expect too, still its not what the code returns, so
either the rounding errors happen to be smaller then with random data or the
test code is plain buggy
>
> I have looked through your code and I can't obviously see any problems,
> but I did that the questions below. Perhaps you could have a look and
> let me know?
>
> Given a little more time I will wire up both your resampler and
> libsamplerate in mplayer and have a listen to both. I should have
> thought that your resampler was at least a good deal better than the
> current job?! I have been doing some more listening to the current
> mplayer resampler and it really is very audible
my resampler is already supported, just try -af
lavcresample=<samplerate>:<filter_length>:<linear_flag>:<polyphase_size>:<cutoff>
btw, iam very interrested in any feedback about its quality especially if it
includes a hint on how to improve it
[...]
--
Michael
"I do not agree with what you have to say, but I'll defend to the death your
right to say it." -- Voltaire
More information about the MPlayer-dev-eng
mailing list