History

quantize test: promote RandRange() result to signed

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

Johann committed 9 years ago

Commit af08fbb1 parent c782f271 file · +4 −4Browse files

Unified · Split

test/vp9_quantize_test.cc+4−4
@@ -115,7 +115,7 @@ TEST_P(VP9QuantizeTest, OperationCheck) { · 114 unmodified lines
115 // round may be up to 685 for Y values or 914 for U/V.115 // round may be up to 685 for Y values or 914 for U/V.
116 round_ptr[j] = rnd.RandRange(914);116 round_ptr[j] = rnd.RandRange(914);
117 // quant ranges from 1 to -32703117 // quant ranges from 1 to -32703
118 quant_ptr[j] = rnd.RandRange(32704) - 32703;118 quant_ptr[j] = static_cast<int>(rnd.RandRange(32704)) - 32703;
119 // quant_shift goes up to 1 << 16.119 // quant_shift goes up to 1 << 16.
120 quant_shift_ptr[j] = rnd.RandRange(16384);120 quant_shift_ptr[j] = rnd.RandRange(16384);
121 // dequant maxes out at 1828 for all cases.121 // dequant maxes out at 1828 for all cases.
@@ -181,7 +181,7 @@ TEST_P(VP9Quantize32Test, OperationCheck) { · 59 unmodified lines
181 for (int j = 0; j < 2; j++) {181 for (int j = 0; j < 2; j++) {
182 zbin_ptr[j] = rnd.RandRange(1200);182 zbin_ptr[j] = rnd.RandRange(1200);
183 round_ptr[j] = rnd.RandRange(914);183 round_ptr[j] = rnd.RandRange(914);
184 quant_ptr[j] = rnd.RandRange(32704) - 32703;184 quant_ptr[j] = static_cast<int>(rnd.RandRange(32704)) - 32703;
185 quant_shift_ptr[j] = rnd.RandRange(16384);185 quant_shift_ptr[j] = rnd.RandRange(16384);
186 dequant_ptr[j] = rnd.RandRange(1828);186 dequant_ptr[j] = rnd.RandRange(1828);
187 }187 }
@@ -248,7 +248,7 @@ TEST_P(VP9QuantizeTest, EOBCheck) { · 60 unmodified lines
248 for (int j = 0; j < 2; j++) {248 for (int j = 0; j < 2; j++) {
249 zbin_ptr[j] = rnd.RandRange(1200);249 zbin_ptr[j] = rnd.RandRange(1200);
250 round_ptr[j] = rnd.RandRange(914);250 round_ptr[j] = rnd.RandRange(914);
251 quant_ptr[j] = rnd.RandRange(32704) - 32703;251 quant_ptr[j] = static_cast<int>(rnd.RandRange(32704)) - 32703;
252 quant_shift_ptr[j] = rnd.RandRange(16384);252 quant_shift_ptr[j] = rnd.RandRange(16384);
253 dequant_ptr[j] = rnd.RandRange(1828);253 dequant_ptr[j] = rnd.RandRange(1828);
254 }254 }
@@ -315,7 +315,7 @@ TEST_P(VP9Quantize32Test, EOBCheck) { · 60 unmodified lines
315 for (int j = 0; j < 2; j++) {315 for (int j = 0; j < 2; j++) {
316 zbin_ptr[j] = rnd.RandRange(1200);316 zbin_ptr[j] = rnd.RandRange(1200);
317 round_ptr[j] = rnd.RandRange(914);317 round_ptr[j] = rnd.RandRange(914);
318 quant_ptr[j] = rnd.RandRange(32704) - 32703;318 quant_ptr[j] = static_cast<int>(rnd.RandRange(32704)) - 32703;
319 quant_shift_ptr[j] = rnd.RandRange(16384);319 quant_shift_ptr[j] = rnd.RandRange(16384);
320 dequant_ptr[j] = rnd.RandRange(1828);320 dequant_ptr[j] = rnd.RandRange(1828);
321 }321 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t