Skip to content

Commit

Permalink
#3457 use avif after webp
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Feb 15, 2022
1 parent 84eb161 commit 9365328
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xpra/server/window/window_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand All @@ -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:
Expand Down

0 comments on commit 9365328

Please sign in to comment.