| commit | cb586f3ba922e647e7ed9814f6c0f4d133f381fe | [log] [tgz] |
|---|---|---|
| author | Urvang Joshi <urvang@google.com> | Tue Sep 20 11:36:33 2016 -0700 |
| committer | Urvang Joshi <urvang@google.com> | Thu Sep 22 09:44:51 2016 -0700 |
| tree | 1fdff19a1d268487ee293989690a72dad5a7f00f | |
| parent | 7a9ad9c83f7a1f562bc464e88b640901631c4aa1 [diff] [blame] |
enums.h: Combine related #defines into packed enums. enums for BLOCK_SIZE, TX_SIZE and PREDICTION_MODE. Note: These were converted to #defines earlier to save on memory: https://chromium-review.googlesource.com/#/c/269854/ But we, instead, use attribute 'packed' (see here: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#Common-Type-Attributes) to ensure that these enums use the smallest possible integer type, and so use smallest memory when used in structs/arrays etc. Change-Id: If1fc136686b28847109c9f3a06f8728165e7e475
diff --git a/test/av1_quantize_test.cc b/test/av1_quantize_test.cc index 88cddb3..db1c969 100644 --- a/test/av1_quantize_test.cc +++ b/test/av1_quantize_test.cc
@@ -179,17 +179,13 @@ private: TX_SIZE getTxSize(int count) { - TX_SIZE txSize = 0; - if (16 == count) { - txSize = 0; - } else if (64 == count) { - txSize = 1; - } else if (256 == count) { - txSize = 2; - } else if (1024 == count) { - txSize = 3; + switch (count) { + case 16: return TX_4X4; + case 64: return TX_8X8; + case 256: return TX_16X16; + case 1024: return TX_32X32; + default: return TX_4X4; } - return txSize; } QuantizeFuncParams params_;