From: John Koleszar Date: Fri, 19 Apr 2013 15:57:03 +0000 (-0700) Subject: Make Rand8Extremes more extreme X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd44975bc8a8b85831e1e153ce566dd2ef0a6b70;p=libvpx Make Rand8Extremes more extreme Previous code didn't do what was expected, we want numbers within 16 of the extrema. Change-Id: I20c18627c482ec66e8405ddad74ca9276c0c65dc --- diff --git a/test/acm_random.h b/test/acm_random.h index cd33d1268..56feaa234 100644 --- a/test/acm_random.h +++ b/test/acm_random.h @@ -38,7 +38,7 @@ class ACMRandom { // Returns a random value near 0 or near 255, to better exercise // saturation behavior. const uint8_t r = Rand8(); - return r < 128 ? r << 4 : r >> 4; + return r <= 128 ? 255 - (r >> 4) : r >> 4; } int PseudoUniform(int range) {