shithub: libvpx

Download patch

ref: af08fbb44467fb4e824ba353d64d0905fd5cc023
parent: c782f27ead354ae7fa4a40c5c679071ae9e8dd3b
author: Johann <[email protected]>
date: Wed Jul 19 10:33:00 EDT 2017

quantize test: promote RandRange() result to signed

Avoid unsigned overflow warning:
unsigned integer overflow: 19974 - 32703 cannot be represented in type
'unsigned int'

Change-Id: Ifebee014342e4c6f3b53306c0cad6ae0b465ac12

--- a/test/vp9_quantize_test.cc
+++ b/test/vp9_quantize_test.cc
@@ -115,7 +115,7 @@
       // round may be up to 685 for Y values or 914 for U/V.
       round_ptr[j] = rnd.RandRange(914);
       // quant ranges from 1 to -32703
-      quant_ptr[j] = rnd.RandRange(32704) - 32703;
+      quant_ptr[j] = static_cast<int>(rnd.RandRange(32704)) - 32703;
       // quant_shift goes up to 1 << 16.
       quant_shift_ptr[j] = rnd.RandRange(16384);
       // dequant maxes out at 1828 for all cases.
@@ -181,7 +181,7 @@
     for (int j = 0; j < 2; j++) {
       zbin_ptr[j] = rnd.RandRange(1200);
       round_ptr[j] = rnd.RandRange(914);
-      quant_ptr[j] = rnd.RandRange(32704) - 32703;
+      quant_ptr[j] = static_cast<int>(rnd.RandRange(32704)) - 32703;
       quant_shift_ptr[j] = rnd.RandRange(16384);
       dequant_ptr[j] = rnd.RandRange(1828);
     }
@@ -248,7 +248,7 @@
     for (int j = 0; j < 2; j++) {
       zbin_ptr[j] = rnd.RandRange(1200);
       round_ptr[j] = rnd.RandRange(914);
-      quant_ptr[j] = rnd.RandRange(32704) - 32703;
+      quant_ptr[j] = static_cast<int>(rnd.RandRange(32704)) - 32703;
       quant_shift_ptr[j] = rnd.RandRange(16384);
       dequant_ptr[j] = rnd.RandRange(1828);
     }
@@ -315,7 +315,7 @@
     for (int j = 0; j < 2; j++) {
       zbin_ptr[j] = rnd.RandRange(1200);
       round_ptr[j] = rnd.RandRange(914);
-      quant_ptr[j] = rnd.RandRange(32704) - 32703;
+      quant_ptr[j] = static_cast<int>(rnd.RandRange(32704)) - 32703;
       quant_shift_ptr[j] = rnd.RandRange(16384);
       dequant_ptr[j] = rnd.RandRange(1828);
     }