diff --git a/src/beauty/beauty-demo.cpp b/src/beauty/beauty-demo.cpp index 82a4fe49b..ec665abe1 100644 --- a/src/beauty/beauty-demo.cpp +++ b/src/beauty/beauty-demo.cpp @@ -15,7 +15,9 @@ constexpr unsigned long HEIGHT = 1080; constexpr double SCALE = 0.125; constexpr bool OFFSCREEN = false; constexpr int VA_HW_DEVICE_INDEX = 0; -constexpr int BLUR_KERNEL_SIZE = WIDTH / 360 % 2 == 0 ? WIDTH / 360 + 1 : WIDTH / 360; +constexpr unsigned long DIAG = hypot(double(WIDTH), double(HEIGHT)); + +constexpr int BLUR_KERNEL_SIZE = DIAG / 413 % 2 == 0 ? DIAG / 413 + 1 : DIAG / 413; using std::cerr; using std::endl; diff --git a/src/tetra/tetra-demo.cpp b/src/tetra/tetra-demo.cpp index f21dbe143..b3c30568e 100644 --- a/src/tetra/tetra-demo.cpp +++ b/src/tetra/tetra-demo.cpp @@ -8,8 +8,9 @@ constexpr double FPS = 60; constexpr bool OFFSCREEN = false; constexpr const char* OUTPUT_FILENAME = "tetra-demo.mkv"; constexpr const int VA_HW_DEVICE_INDEX = 0; +constexpr unsigned long DIAG = hypot(double(WIDTH), double(HEIGHT)); -constexpr int GLOW_KERNEL_SIZE = WIDTH / 120 % 2 == 0 ? WIDTH / 120 + 1 : WIDTH / 120; +constexpr int GLOW_KERNEL_SIZE = DIAG / 138 % 2 == 0 ? DIAG / 138 + 1 : DIAG / 138; using std::cerr; using std::endl; diff --git a/src/video/video-demo.cpp b/src/video/video-demo.cpp index e08fdee5e..ecfa4631a 100644 --- a/src/video/video-demo.cpp +++ b/src/video/video-demo.cpp @@ -8,8 +8,10 @@ constexpr long unsigned int HEIGHT = 1080; constexpr const int VA_HW_DEVICE_INDEX = 0; constexpr bool OFFSCREEN = false; constexpr const char *OUTPUT_FILENAME = "video-demo.mkv"; +constexpr unsigned long DIAG = hypot(double(WIDTH), double(HEIGHT)); + +constexpr int GLOW_KERNEL_SIZE = DIAG / 138 % 2 == 0 ? DIAG / 138 + 1 : DIAG / 138; -constexpr int GLOW_KERNEL_SIZE = WIDTH / 120 % 2 == 0 ? WIDTH / 120 + 1 : WIDTH / 120; using std::cerr; using std::endl;