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

Michael Niedermayer michaelni
Thu Mar 22 12:55:38 CET 2007


Hi

On Thu, Mar 22, 2007 at 01:24:23PM +0200, Uoti Urpala wrote:
> On Thu, 2007-03-22 at 11:47 +0100, Michael Niedermayer wrote:
> > On Wed, Mar 21, 2007 at 10:50:06PM -0500, Rich Felker wrote:
> > > This is not trivial and most likely an illegal optimization for the
> > > compiler to make. As soon as you go to floating point, algebraic
> > > identities simply fail to hold in the general case, and
> > > "optimizations" using them will make code do the wrong things in
> > > corner cases. You may not care about the corner cases, but the
> > > compiler can't know that. So floating point optimization of this sort
> > > always needs to be done explicitly by the coder.
> > 
> > hmm
> > 
> > for(i=1; i<50; i++){
> >     t *= i;
> >     v += pow(x*x/4, i)/(t*t);
> > 
> > factoring the x*x/4 out doesnt need any algebraic identities
> 
> Does your gcc not factor that out then?

i didnt check that specific part, just that the code before and after all
optimizations (which you cliped away from the mail) differed in speed by 
a huge factor

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

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- 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/8149f2e4/attachment.pgp>



More information about the ffmpeg-cvslog mailing list