[x265] [PATCH] testbench: ensure randomly generated width and height are >= 16

murugan at multicorewareinc.com murugan at multicorewareinc.com
Tue Apr 22 14:46:12 CEST 2014


# HG changeset patch
# User Murugan Vairavel <murugan at multicorewareinc.com>
# Date 1398170737 -19800
#      Tue Apr 22 18:15:37 2014 +0530
# Node ID dad995ad91dd5fa337252b12907f003cc1fe3c2d
# Parent  54e73d05a5b1f50c5007751d5b245cad47b5d21a
testbench: ensure randomly generated width and height are >= 16

Fixes a crash in testbench caused by upshift and downshift when height equal to 1

diff -r 54e73d05a5b1 -r dad995ad91dd source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Tue Apr 22 17:03:19 2014 +0530
+++ b/source/test/pixelharness.cpp	Tue Apr 22 18:15:37 2014 +0530
@@ -938,8 +938,8 @@
     memset(opt_dest, 0xCD, sizeof(opt_dest));
 
     int srcStride = 64;
-    int width = rand() % 64;
-    int height = 1 + rand() % 63;
+    int width = 16 + rand() % 48;
+    int height = 16 + rand() % 48;
     int dstStride = width;
     int j = 0;
 
@@ -967,8 +967,8 @@
     memset(opt_dest, 0xCD, sizeof(opt_dest));
 
     int srcStride = 64;
-    int width = rand() % 64;
-    int height = 1 + rand() % 63;
+    int width = 16 + rand() % 48;
+    int height = 16 + rand() % 48;
     int dstStride = width;
     int j = 0;
 


More information about the x265-devel mailing list