[Ffmpeg-cvslog] r8474 - trunk/libavcodec/resample2.c

Michael Niedermayer michaelni
Thu Mar 22 22:58:38 CET 2007


Hi

On Thu, Mar 22, 2007 at 12:32:29PM -0500, Rich Felker wrote:
> On Thu, Mar 22, 2007 at 05:20:17PM +0100, Michael Niedermayer wrote:
> > Hi
> > 
> > On Thu, Mar 22, 2007 at 10:18:04AM -0500, Rich Felker wrote:
> > > On Thu, Mar 22, 2007 at 11:47:01AM +0100, Michael Niedermayer wrote:
> > > > to factor out the pow() your needing algebraic identities depends on how pow
> > > > is defined either way the associative law for multiplication is enough and
> > > 
> > > Associative law is false with floats. Think of
> > > 
> > > A = FLOAT_MAX
> > > B = FLOAT_MAX
> > > C = 1.0/FLOAT_MAX
> > 
> > yes i did think of it, and i just tested:
> > [...]
> 
> This was not intended as C code, just as abstract explanation. In C,
> all floating point expressions are evaulated as doubles or larger. You
> need DBL_MAX or whatever for it to work. The results will be:
> 
> (A*B)*C = +Inf
> A*(B*C) = A

probably true, but what i meant was that pow() can be split into
multiplications or more generally the associative law holds approximatley
at x86 asm level with a,b,c and a*b*c being doubles and intermedeates in
registers so that a compiler could use the law to simplify an expression

i didnt mean that (a*b)*c == a*(b*c) with all intermediates stored as
the same type as a,b,c would work, it of course doesnt

such tricks work with integers though i doubt gcc is smart enough for
that either

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20070322/7794bb9e/attachment.pgp>



More information about the ffmpeg-cvslog mailing list