From 9365328f95d8d37bd42e5e71f2fd3436baa91a26 Mon Sep 17 00:00:00 2001 From: totaam Date: Tue, 15 Feb 2022 11:12:51 +0700 Subject: [PATCH] #3457 use avif after webp --- xpra/server/window/window_source.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xpra/server/window/window_source.py b/xpra/server/window/window_source.py index b8364e9542..79229f3954 100644 --- a/xpra/server/window/window_source.py +++ b/xpra/server/window/window_source.py @@ -1060,8 +1060,9 @@ def do_get_auto_encoding(self, w, h, options, current_encoding, encoding_options jpeg = "jpeg" in co and w>=2 and h>=2 jpega = "jpega" in co and w>=2 and h>=2 webp = "webp" in co and 16383>=w>=2 and 16383>=h>=2 and not grayscale + avif = "avif" in co lossy = quality<100 - if depth in (24, 32) and (jpeg or jpega or webp): + if depth in (24, 32) and (jpeg or jpega or webp or avif): if webp and (not lossy or w*h<=WEBP_EFFICIENCY_CUTOFF): return "webp" if lossy or not TRUE_LOSSLESS: @@ -1071,6 +1072,8 @@ def do_get_auto_encoding(self, w, h, options, current_encoding, encoding_options return "jpega" if webp: return "webp" + if avif: + return "avif" elif depth>24 and "rgb32" in co and self.client_bit_depth>24 and self.client_bit_depth!=32: #the only encoding that can do higher bit depth at present #(typically r210 which is actually rgb30+2) @@ -1079,7 +1082,6 @@ def do_get_auto_encoding(self, w, h, options, current_encoding, encoding_options return "png" if jpeg: return "jpeg" - avif = "avif" in co if avif: return "avif" if current_encoding in co: