From e6f6b64a0f1e1c502570e703148592ad8a3beade Mon Sep 17 00:00:00 2001 From: kxxt Date: Sun, 28 May 2023 12:28:33 +0800 Subject: [PATCH] Fix Stabilize_Video test for platforms that doesn't use fast color space conversion The Stabilize_Video test fails on platforms that doesn't support accelerated colorspace conversion from yuv420p to rgba. https://github.com/FFmpeg/FFmpeg/blob/e8e486332571347dd55822c842ba67276ac308e2/libswscale/yuv2rgb.c#L678-L696 This PR fixes it by rounding the result that caused the test failure. On x86_64, y = -0.001074643496478603 On riscv64, y = -0.0009904620157904118 --- tests/CVStabilizer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/CVStabilizer.cpp b/tests/CVStabilizer.cpp index 401062d9..51df2e3b 100644 --- a/tests/CVStabilizer.cpp +++ b/tests/CVStabilizer.cpp @@ -13,6 +13,7 @@ #include #include +#include #include "openshot_catch.h" @@ -56,7 +57,7 @@ TEST_CASE( "Stabilize_Video", "[libopenshot][opencv][stabilizer]" ) int dy = tp.dy*1000; int da = tp.da*1000; int x = ct.x*1000; - int y = ct.y*1000; + int y = std::round(ct.y*1000); int a = ct.a*1000; CHECK(dx == (int) (58));