[FFmpeg-devel] [PATCH] AAC: type puns for 16 bit floating point rounding

Michael Niedermayer michaelni
Thu Dec 4 13:09:52 CET 2008


On Thu, Dec 04, 2008 at 03:13:57AM +0000, M?ns Rullg?rd wrote:
> "Alex Converse" <alex.converse at gmail.com> writes:
> 
> > Hi,
> >
> > Attached is the remaing patch from the AAC Main series with the
> > rounding functions rewritten as suggested to do arithmetic in the
> > integer domain rather than the floating point domain.
> >
> > A configure check has been added as suggested but I'm not happy with
> > it. Any input on this is greatly appreciated.
> >
> > Regards,
> > Alex Converse
> >
> > diff --git a/configure b/configure
> > index 605bf3f..035e939 100755
> > --- a/configure
> > +++ b/configure
> > @@ -844,6 +844,7 @@ HAVE_LIST="
> >      gethrtime
> >      GetProcessTimes
> >      getrusage
> > +    ieee754_pun
> >      imlib2
> >      inet_aton
> >      inline_asm
> > @@ -1800,6 +1801,13 @@ EOF
> >  od -A n -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
> >  
> >  # ---
> > +# IEEE float test
> > +check_cc <<EOF || die "IEEE float test failed"
> > +float f[3] = {218387568.0f, 218387568.0f, 218387568.0f };
> > +EOF
> > +strings $TMPO | grep -E -q 'MPEGMPEGMPEG|GEPMGEPMGEPM' && enable ieee754_pun
> 
> That test isn't portable.  However, I think it's safe to assume
> IEEE754 floats.  I doubt anyone will ever run FFmpeg on a VAX, and
> it's already broken on Cray since we assume two's complement signed
> integers.  

Arent there some floating point emulators (for FPUless CPUs) that use non
IEEE floats? No i cant point to a specific real world case, its just that
if i was writing one, i would use 8/16/32 bit "words" instead of squeezing
bits in a 32bit IEEE float with an implicit leading bit.
Also libavutil/softfloat.c/h is non IEEE, though its AFAIK not used by
anyone, people maybe prefer emulators doing lots of uneeded IEEE bit packing

besides, i do prefer a IEEE float detection that detects all IEEE systems and
maybe misdetects some hypotetical non IEEE systems over no detection at all.
That of course is just my oppinion

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- 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/20081204/adbca055/attachment.pgp>



More information about the ffmpeg-devel mailing list