"Ronald S. Bultje" <[email protected]> writes: > + int64_t ddd = d > SQRT_INT64_MAX || dd > SQRT_INT64_MAX ? > + ((dd >> 2) * d) >> 28 > : (dd * d) >> 30;
This test isn't quite optimal (although it is safe). Ideally, you should check whether log2(d) + log2(dd) > 63. Since log2(dd) = 2*log2(d) - 30, this simplifies to log2(d) > 31. Or something like that. -- Måns Rullgård [email protected] _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
