diff --git a/src/xpra/codecs/codec_checks.py b/src/xpra/codecs/codec_checks.py index 9ddeb93d64..4e6e1f9da0 100644 --- a/src/xpra/codecs/codec_checks.py +++ b/src/xpra/codecs/codec_checks.py @@ -32,15 +32,15 @@ def make_test_image(pixel_format, w, h): if pixel_format.startswith("YUV") or pixel_format=="GBRP": divs = get_subsampling_divs(pixel_format) ydiv = divs[0] #always (1,1) - y = bytearray(w*h//(ydiv[0]*ydiv[1])) + y = bytes("\0"*(w*h//(ydiv[0]*ydiv[1]))) udiv = divs[1] - u = bytearray(w*h//(udiv[0]*udiv[1])) + u = bytes("\0"*(w*h//(udiv[0]*udiv[1]))) vdiv = divs[2] - v = bytearray(w*h//(vdiv[0]*vdiv[1])) + v = bytes("\0"*(w*h//(vdiv[0]*vdiv[1]))) image = ImageWrapper(0, 0, w, h, [y, u, v], pixel_format, 32, [w//ydiv[0], w//udiv[0], w//vdiv[0]], planes=ImageWrapper._3_PLANES, thread_safe=True) #l = len(y)+len(u)+len(v) elif pixel_format in ("RGB", "BGR", "RGBX", "BGRX", "XRGB", "BGRA", "RGBA"): - rgb_data = bytearray(w*h*len(pixel_format)) + rgb_data = bytes("\0"*(w*h*len(pixel_format))) image = ImageWrapper(0, 0, w, h, rgb_data, pixel_format, 32, w*len(pixel_format), planes=ImageWrapper.PACKED, thread_safe=True) #l = len(rgb_data) else: @@ -152,19 +152,20 @@ def einfo(): MAX_WIDTH = maxw MAX_HEIGHT = maxh for v in (512, 1024, 2048, 4096, 8192, 16384): - if v>=limit: - break - try: - w = min(maxw, v) - h = min(maxh, v) - do_testencoding(encoder_module, encoding, w, h) - log("%s can handle %ix%i for %s", einfo(), w, h, encoding) - MAX_WIDTH = w - MAX_HEIGHT = h - except Exception as e: - log("%s is limited to %ix%i for %s", einfo(), MAX_WIDTH, MAX_HEIGHT, encoding) - log(" %s", e) - break + for tw, th in ((v, v), (v*2, v)): + if tw>limit or th>limit: + continue + try: + w = min(maxw, tw) + h = min(maxh, th) + do_testencoding(encoder_module, encoding, w, h) + log("%s can handle %ix%i for %s", einfo(), w, h, encoding) + MAX_WIDTH = w + MAX_HEIGHT = h + except Exception as e: + log("%s is limited to %ix%i for %s", einfo(), MAX_WIDTH, MAX_HEIGHT, encoding) + log(" %s", e) + break log("%s max dimensions for %s: %ix%i", einfo(), encoding, MAX_WIDTH, MAX_HEIGHT) return MAX_WIDTH, MAX_HEIGHT diff --git a/src/xpra/codecs/enc_x264/encoder.pyx b/src/xpra/codecs/enc_x264/encoder.pyx index d9c8db62b7..b5d746fa2a 100644 --- a/src/xpra/codecs/enc_x264/encoder.pyx +++ b/src/xpra/codecs/enc_x264/encoder.pyx @@ -340,8 +340,8 @@ if X264_BUILD<146: MAX_WIDTH = 4096 MAX_HEIGHT = 4096 else: - MAX_WIDTH = 8192 - MAX_HEIGHT = 8192 + MAX_WIDTH = 16384 + MAX_HEIGHT = 16384 def get_spec(encoding, colorspace): assert encoding in get_encodings(), "invalid encoding: %s (must be one of %s" % (encoding, get_encodings()) diff --git a/src/xpra/codecs/nvenc4/encoder.pyx b/src/xpra/codecs/nvenc4/encoder.pyx index c6a2d6bfc5..f501cc2b8e 100644 --- a/src/xpra/codecs/nvenc4/encoder.pyx +++ b/src/xpra/codecs/nvenc4/encoder.pyx @@ -2408,3 +2408,11 @@ def init_module(): def cleanup_module(): log("nvenc.cleanup_module()") reset_state() + +def selftest(full=False): + #this is expensive, so don't run it unless "full" is set: + if full: + from xpra.codecs.codec_checks import get_encoder_max_sizes + from xpra.codecs.nvenc4 import encoder + init_module() + log.info("%s max dimensions: %s", encoder, get_encoder_max_sizes(encoder)) diff --git a/src/xpra/codecs/nvenc5/encoder.pyx b/src/xpra/codecs/nvenc5/encoder.pyx index 5d5d891b44..bdcf4e00f6 100644 --- a/src/xpra/codecs/nvenc5/encoder.pyx +++ b/src/xpra/codecs/nvenc5/encoder.pyx @@ -2404,3 +2404,11 @@ def init_module(): def cleanup_module(): log("nvenc.cleanup_module()") reset_state() + +def selftest(full=False): + #this is expensive, so don't run it unless "full" is set: + if full: + from xpra.codecs.codec_checks import get_encoder_max_sizes + from xpra.codecs.nvenc5 import encoder + init_module() + log.info("%s max dimensions: %s", encoder, get_encoder_max_sizes(encoder)) diff --git a/src/xpra/codecs/vpx/encoder.pyx b/src/xpra/codecs/vpx/encoder.pyx index 55e36311b9..e6dce72529 100644 --- a/src/xpra/codecs/vpx/encoder.pyx +++ b/src/xpra/codecs/vpx/encoder.pyx @@ -294,10 +294,11 @@ cdef const vpx_codec_iface_t *make_codec_cx(encoding): #educated guess: MAX_SIZE = {"vp8" : (4096, 4096), - "vp9" : (4096, 4096), + "vp9" : (8192, 8192), } IF LIBVPX14: - MAX_SIZE["vp9"] = (8192, 8192) + MAX_SIZE["vp8"] = (8192, 8192) + MAX_SIZE["vp9"] = (16384, 8192) def get_spec(encoding, colorspace): assert encoding in CODECS, "invalid encoding: %s (must be one of %s" % (encoding, get_encodings())