Skip to content

Commit

Permalink
test more frames and with different input each time (change seed)
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@8941 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 7, 2015
1 parent 6bfdea1 commit 0b708d9
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/tests/xpra/codecs/test_video_codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@


def do_test_codec_roundtrip(encoder_class, decoder_class, encoding, src_format, dst_formats, w, h, populate):
if src_format.find("RGB")>=0 or src_format.find("BGR")>=0:
pixels = make_rgb_input(src_format, w, h, populate=populate)
isize = len(pixels)
stride = len(src_format)*w
#print(" input pixels: %s (%sx%s, stride=%s, stride*h=%s)" % (len(pixels), w, h, stride, stride*h))
assert len(pixels)>=stride*h, "not enough pixels! (expected at least %s but got %s)" % (stride*h, len(pixels))
image = ImageWrapper(0, 0, w, h, pixels, src_format, 24, stride, planes=ImageWrapper.PACKED)
else:
strides, pixels = make_planar_input(src_format, w, h, populate=populate)
isize = sum([len(x) for x in pixels])
image = ImageWrapper(0, 0, w, h, pixels, src_format, 24, strides, planes=ImageWrapper._3_PLANES)

quality = 100
speed = 100
scaling = (1,1)
Expand All @@ -42,7 +30,20 @@ def do_test_codec_roundtrip(encoder_class, decoder_class, encoding, src_format,
end = time.time()
print("decoder %s initialized in %.1fms" % (decoder, 1000.0*(end-start)))

for i in range(2):
for i in range(4):

if src_format.find("RGB")>=0 or src_format.find("BGR")>=0:
pixels = make_rgb_input(src_format, w, h, populate=populate, seed=i)
isize = len(pixels)
stride = len(src_format)*w
#print(" input pixels: %s (%sx%s, stride=%s, stride*h=%s)" % (len(pixels), w, h, stride, stride*h))
assert len(pixels)>=stride*h, "not enough pixels! (expected at least %s but got %s)" % (stride*h, len(pixels))
image = ImageWrapper(0, 0, w, h, pixels, src_format, 24, stride, planes=ImageWrapper.PACKED)
else:
strides, pixels = make_planar_input(src_format, w, h, populate=populate)
isize = sum([len(x) for x in pixels])
image = ImageWrapper(0, 0, w, h, pixels, src_format, 24, strides, planes=ImageWrapper._3_PLANES)

print("FRAME %s" % i)
print("using %s to compress %s" % (encoder, image))
start = time.time()
Expand Down

0 comments on commit 0b708d9

Please sign in to comment.