[FFmpeg-devel] [PATCH] Make MMX2 put_no_rnd_pixels _x2 and _y2 bitexact

Michael Niedermayer michaelni
Tue Jun 1 17:30:40 CEST 2010


On Mon, May 31, 2010 at 08:00:03PM -0400, David Conrad wrote:
> On May 30, 2010, at 12:39 PM, Michael Niedermayer wrote:
> 
> > On Fri, May 28, 2010 at 06:27:41PM -0400, David Conrad wrote:
> >> On May 28, 2010, at 6:25 PM, Stefan Gehrer wrote:
> >> 
> >>> On 05/28/2010 11:49 PM, David Conrad wrote:
> >>>> Hi,
> >>>> 
> >>>> The mmx2/3dnow put_no_rnd functions don't always round correctly, since they compensate for the +1 in pavgb by subtracting 1 from one of the inputs. This causes our theora decoder to not be bitexact to libtheora, though I haven't found any real source where the error accumulates enough to be visible.
> >>>> 
> >>>> This fixes it by using the property that (a+b)>>1 is equivalent to ~(~a+~b+1)>>1. This makes these functions 5 cycles slower on my penryn, but on my atom the additional instructions appear to be free probably due to load stalls.
> >>> 
> >>> Wouldn't it be worth creating new bitexact functions, but still
> >>> override them with the old/faster ones if BITEXACT is not set?
> >> 
> >> The problem is that theora must always be bitexact, and codecs can't set the bitexact flag themselves.
> > 
> > if you still want it, you could change the used functions under
> > if(codec_id == CODEC_ID_THEORA)
> 
> Like so?
> 

> commit 01049d1c24d450a9247acec6f0f52a9db9ffa55b
> Author: David Conrad <lessen42 at gmail.com>
> Date:   Fri May 28 02:20:58 2010 -0400
> 
>     Add bitexact versions of put_no_rnd_pixels8 _x2 and _y2 for vp3/theora

if you want thatm then ok

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100601/df27cb02/attachment.pgp>



More information about the ffmpeg-devel mailing list