Commit 4334d7ca authored by Raphaël Zumer's avatar Raphaël Zumer
Browse files

Use pattern matching for is_rect_tx_allowed()

parent 72c47ecf
...@@ -459,32 +459,12 @@ impl BlockSize { ...@@ -459,32 +459,12 @@ impl BlockSize {
} }
pub fn is_rect_tx_allowed(self) -> bool { pub fn is_rect_tx_allowed(self) -> bool {
static LUT: [u8; BlockSize::BLOCK_SIZES_ALL] = [ match self {
0, // BLOCK_4X4 BLOCK_4X4 | BLOCK_8X8 | BLOCK_16X16 | BLOCK_32X32 |
1, // BLOCK_4X8 BLOCK_64X64 | BLOCK_64X128 | BLOCK_128X64 | BLOCK_128X128 => false,
1, // BLOCK_8X4 BLOCK_INVALID => unreachable!(),
0, // BLOCK_8X8 _ => true
1, // BLOCK_8X16 }
1, // BLOCK_16X8
0, // BLOCK_16X16
1, // BLOCK_16X32
1, // BLOCK_32X16
0, // BLOCK_32X32
1, // BLOCK_32X64
1, // BLOCK_64X32
0, // BLOCK_64X64
0, // BLOCK_64X128
0, // BLOCK_128X64
0, // BLOCK_128X128
1, // BLOCK_4X16
1, // BLOCK_16X4
1, // BLOCK_8X32
1, // BLOCK_32X8
1, // BLOCK_16X64
1, // BLOCK_64X16
];
LUT[self as usize] == 1
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment