[FFmpeg-devel] [PATCH] correct make test failure from 15261 release until now (15899)

Michael Niedermayer michaelni
Fri Nov 21 20:04:49 CET 2008


On Fri, Nov 21, 2008 at 06:14:49PM +0100, David Geldreich wrote:
> Hello Guillaume,
> 
> Le 21 nov. 08 ? 17:25, Guillaume POIRIER a ?crit :
> 
> > This is not the way to go. Reg tests pass on AMD64/Linux, so the code
> > must be fixed to work the same on any plateform. The md5sum should not
> > match X plateform results, but all plateforms result.
> 
> That's why I made another post to tell to ignore my proposed patch.
> 
> I found no way of making sin/sinf works the same way on all the  
> platform. In my case, OSX ppc and intel gives different results.
> 
> So changes r15261 and r14982 are incomplete ... they correct the  
> problem for AMD64 but breaks in on Intel32.
> 
> We must iterate to find a "stable" sine window generating function.


if someone wants to try a float free sin table generator, here is
one, and of course other algorithms are welcome but it seems this one
is close to the precission of IEEE doubles

and the small for loop should go in a av_sqrt_q() 

static void fillsin(double *out, int len){
    AVRational sintab[len*2+1];
    int i, j, step;

    sintab[    0]= (AVRational){0,1};
    sintab[len*2]= (AVRational){1,1};

    for(step= len; step>0; step>>=1){
        for(i=step; i<len*2; i+=2*step){
            int p= i - step;
            int n= i + step;
            AVRational x= av_add_q(sintab[      p], sintab[      n]);
            AVRational y= av_add_q(sintab[2*len-p], sintab[2*len-n]);
            AVRational norm2= av_add_q(av_mul_q(x,x), av_mul_q(y,y));
            AVRational norm= av_add_q(x,y);

            for(j=6; j; j--){
                norm= av_add_q(norm, av_div_q(norm2,norm)); norm.den<<=1;
            }
            sintab[i]= av_div_q(x, norm);
        }
    }
    for(i=0; i<len; i++)
        out[i]=  av_q2d(sintab[2*i+1]);
}


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I wish the Xiph folks would stop pretending they've got something they
do not.  Somehow I fear this will remain a wish. -- M?ns Rullg?rd
-------------- 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/20081121/3af79975/attachment.pgp>



More information about the ffmpeg-devel mailing list