Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
rav1e
Commits
4334d7ca
Commit
4334d7ca
authored
Jun 20, 2019
by
Raphaël Zumer
Browse files
Use pattern matching for is_rect_tx_allowed()
parent
72c47ecf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/partition.rs
View file @
4334d7ca
...
...
@@ -459,32 +459,12 @@ impl BlockSize {
}
pub
fn
is_rect_tx_allowed
(
self
)
->
bool
{
static
LUT
:
[
u8
;
BlockSize
::
BLOCK_SIZES_ALL
]
=
[
0
,
// BLOCK_4X4
1
,
// BLOCK_4X8
1
,
// BLOCK_8X4
0
,
// BLOCK_8X8
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
match
self
{
BLOCK_4X4
|
BLOCK_8X8
|
BLOCK_16X16
|
BLOCK_32X32
|
BLOCK_64X64
|
BLOCK_64X128
|
BLOCK_128X64
|
BLOCK_128X128
=>
false
,
BLOCK_INVALID
=>
unreachable!
(),
_
=>
true
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment