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

Uoti Urpala uoti.urpala
Thu Mar 22 12:24:23 CET 2007


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?





More information about the ffmpeg-cvslog mailing list