From 3bc040387767544dc3932aba1e50a7e07a1477a6 Mon Sep 17 00:00:00 2001 From: "Rodwin.Spruel" Date: Tue, 22 Apr 2025 17:17:58 -0400 Subject: [PATCH] Updating weighting function and limits Signed-off-by: Rodwin.Spruel --- common/rfb/EncodeManager.cxx | 3 ++- common/rfb/ServerCore.cxx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/rfb/EncodeManager.cxx b/common/rfb/EncodeManager.cxx index 30bfdce..69142c0 100644 --- a/common/rfb/EncodeManager.cxx +++ b/common/rfb/EncodeManager.cxx @@ -395,7 +395,8 @@ void EncodeManager::doUpdate(bool allowLossy, const Region& changed_, screenArea = pb->getRect().width() * pb->getRect().height(); screenArea *= 1024; screenArea /= 256 * 256; - screenArea *= screenArea *= Server::webpEncodingTime > 0 ? Server::webpEncodingTime : webpBenchResult; + screenArea *= screenArea; + screenArea /= Server::webpEncodingTime > 1 ? Server::webpEncodingTime : 1; // Encoding the entire screen would take this many 1024*msecs, worst case // Calculate how many us we can send webp for, before switching to jpeg diff --git a/common/rfb/ServerCore.cxx b/common/rfb/ServerCore.cxx index f242b54..91174d6 100644 --- a/common/rfb/ServerCore.cxx +++ b/common/rfb/ServerCore.cxx @@ -291,4 +291,4 @@ rfb::PresetParameter rfb::Server::preferBandwidth rfb::IntParameter rfb::Server::webpEncodingTime ("webpEncodingTime", "Sets a weighted value that determines how much webp is used to balance bandwidth and CPU usage.", - 0, 0, 10000); + 1, 1, 1000);