[MPlayer-dev-eng] [PATCH] si2us() in libaf is off-by-one

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Sun Oct 2 00:46:57 CEST 2005


On Saturday, 01 October 2005 at 21:42, Reimar Döffinger wrote:
> Hi,
> On Wed, Sep 07, 2005 at 12:39:26AM -0400, dega wrote:
> > si2us() is biased by -1, turning -128 => 255 and 127 => 254 (for 8-bit)
> > instead of -128 => 0 and 127 => 255. It makes the same kind of mistake for
> > all other sample widths as well.
> > 
> > Obviously, this causes nasty pops in the output stream if one should ever
> > encounter extreme values in the input stream. (Discovered during ao_sgi
> > testing)
> 
> I'd like to suggest the attached patch. Can everyone please test, esp.
> on bigendian?
> Main advantages: only one function for both directions, on x86 only 15
> instructions total and only 3 of those in the inner loop. :-)

I'll try to test it next week, but I need some samples.

R.

-- 
MPlayer RPMs maintainer: http://rpm.greysector.net/mplayer/
"I am Grey. I stand between the candle and the star. We are Grey.
 We stand between the darkness ... and the light."
        -- Delenn in Grey Council in Babylon 5:"Babylon Squared"




More information about the MPlayer-dev-eng mailing list