Skip to content

Commit

Permalink
#999:
Browse files Browse the repository at this point in the history
* "pcmult" factor should do nothing once we have more than 20 packets
* ensure the "max_rgb_threshold" is never lower than 1024 - we still want plain rgb for very small areas, even when there are bandwidth constraints or problems
* log more details on rgb threshold calculations

git-svn-id: https://xpra.org/svn/Xpra/trunk@17516 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 26, 2017
1 parent f8182c8 commit 1cb1c9a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/xpra/server/window/window_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ def update_encoding_options(self, force_reload=False):
#if speed is high, assume we have bandwidth to spare
smult = max(0.25, (self._current_speed-50)/5.0)
qmult = max(0, self._current_quality/20.0)
pcmult = float(0.5+min(20, self.statistics.packet_count))/20.0
pcmult = float(min(20, 0.5+self.statistics.packet_count))/20.0
max_rgb_threshold = 128*1024
min_rgb_threshold = 4096
cv = self.global_statistics.congestion_value
Expand All @@ -787,12 +787,12 @@ def update_encoding_options(self, force_reload=False):
min_rgb_threshold = 1024
bwl = self.bandwidth_limit
if bwl:
max_rgb_threshold = min(max_rgb_threshold, bwl//1000)
max_rgb_threshold = min(max_rgb_threshold, max(bwl//1000, 1024))
v = int(MAX_PIXELS_PREFER_RGB * pcmult * smult * qmult * (1 + int(self.is_OR or self.is_tray or self.is_shadow)*2))
self._rgb_auto_threshold = min(max_rgb_threshold, max(min_rgb_threshold, v))
self.get_best_encoding = self.get_best_encoding_impl()
log("update_encoding_options(%s) want_alpha=%s, lossless threshold: %s / %s, rgb auto threshold=%s, get_best_encoding=%s",
force_reload, self._want_alpha, self._lossless_threshold_base, self._lossless_threshold_pixel_boost, self._rgb_auto_threshold, self.get_best_encoding)
log("update_encoding_options(%s) wid=%i, want_alpha=%s, speed=%i, quality=%i, bandwidth-limit=%i, lossless threshold: %s / %s, rgb auto threshold=%i (min=%i, max=%i), get_best_encoding=%s",
force_reload, self.wid, self._want_alpha, self._current_speed, self._current_quality, bwl, self._lossless_threshold_base, self._lossless_threshold_pixel_boost, self._rgb_auto_threshold, min_rgb_threshold, max_rgb_threshold, self.get_best_encoding)

def get_best_encoding_impl(self):
if HARDCODED_ENCODING:
Expand Down

0 comments on commit 1cb1c9a

Please sign in to comment.