X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavutil%2Fmathematics.c;h=180f72e3f0dec20e55ada3bb563d9a20af92e65c;hb=f863cdef813e51d5850e2386618feafe197f06f4;hp=cfe8fbc9ebc595fd48410c7359487a84402cfde4;hpb=2905e3ff6462431d55f89614b24e2a407707c82a;p=ffmpeg diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c index cfe8fbc9ebc..180f72e3f0d 100644 --- a/libavutil/mathematics.c +++ b/libavutil/mathematics.c @@ -153,32 +153,3 @@ int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod){ c-= mod; return c; } - -#ifdef TEST -#include "integer.h" -#undef printf -int main(void){ - int64_t a,b,c,d,e; - - for(a=7; a<(1LL<<62); a+=a/3+1){ - for(b=3; b<(1LL<<62); b+=b/4+1){ - for(c=9; c<(1LL<<62); c+=(c*2)/5+3){ - int64_t r= c/2; - AVInteger ai; - ai= av_mul_i(av_int2i(a), av_int2i(b)); - ai= av_add_i(ai, av_int2i(r)); - - d= av_i2int(av_div_i(ai, av_int2i(c))); - - e= av_rescale(a,b,c); - - if((double)a * (double)b / (double)c > (1LL<<63)) - continue; - - if(d!=e) printf("%"PRId64"*%"PRId64"/%"PRId64"= %"PRId64"=%"PRId64"\n", a, b, c, d, e); - } - } - } - return 0; -} -#endif