Skip to content

Commit

Permalink
make it easier to test with encoder options
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Dec 7, 2021
1 parent 9ddefe5 commit 76c17ae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/xpra/codecs/benchmark_picture_encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
N = 10
CODECS = ("enc_rgb", "enc_pillow", "enc_spng", "enc_webp", "enc_jpeg", "enc_nvjpeg")

#options = {"grayscale" : True}
options = {}


def main(fmt="png", files=()):
assert len(files)>1, "specify images to benchmark"
assert len(files)>0, "specify images to benchmark"
from xpra.net import compression
compression.init_all()
from xpra.codecs.loader import load_codec, get_codec
Expand Down Expand Up @@ -43,7 +47,7 @@ def main(fmt="png", files=()):
start = monotonic()
for _ in range(N):
try:
r = enc.encode(fmt, image)
r = enc.encode(fmt, image, options)
except Exception:
print("error on %s %s" % (enc.get_type(), enc.encode))
raise
Expand Down

0 comments on commit 76c17ae

Please sign in to comment.