Commit graph

5 commits

Author SHA1 Message Date
Ryan Foster ba263ee4fa Revert "libobs: Improve util_mul_div64 outside MSVC"
This reverts commit c977417747.

Reverted due to a regression.
2023-04-16 20:29:47 -04:00
jpark37 c977417747 libobs: Improve util_mul_div64 outside MSVC
Use inline assembly for x86_64 speed/accuracy.

Sacrifice speed for accuracy on other processors.

Continue to use original implementation for ARM on Windows.
2023-04-15 17:08:04 -07:00
Simon Rost a144a736f9 libobs: Remove dependency on Visual Studio 2019+
In util_uint64.h the intrinsic function _udiv128 is used.
The implementation is only available in Visual Studio 2019+
2023-03-30 19:51:08 -04:00
jpark37 0c0ff1195f libobs: Simplify util_mul_div64 for x64 on Windows
Use intrinsics to perform 128-bit math directly.
2021-09-29 02:22:01 -07:00
Hans Petter Selasky 0e4ea14ba1 libobs: Implement and use better scaling function for 64-bit integers
As os_gettime_ns() gets large the current scaling methods, mostly by casting
to uint64_t, may lead to numerical overflows. Sweep the code and use
util_mul_div64() where applicable.

Signed-off-by: Hans Petter Selasky <hps@selasky.org>
2020-04-05 20:27:28 +02:00