Updating weighting function and limits

Signed-off-by: Rodwin.Spruel <rodwin.spruel@kasmweb.com>
This commit is contained in:
Rodwin.Spruel 2025-04-22 17:17:58 -04:00
parent 7353f38652
commit 3bc0403877
No known key found for this signature in database
GPG key ID: 732BE68DCA2B69CA
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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);