forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

obmc_skip_chroma_tests.rs27 lines, 1.4 KiBHistoryRawDownload
1use super::obmc_skip_chroma_above;
2
3/// lane-av1-llpred2: the above-chroma skip keys off the PLANE block
4/// under the frame's own ss pair. At 4:2:0 a 16x8/8x16 rect strip's
5/// plane block is 8x4/4x8 and MUST still skip (the old `chroma_side`
6/// ratio read ss=(1,0) off a 16x8 strip and made it blend); at 4:4:4
7/// the plane block is the luma block, so only true 4-wide/high shapes
8/// skip and the shift never leaves `usize` range (the old ratio's
9/// `trailing_zeros(0)` = 64 panicked a debug build).
10#[test]
11fn rect_strips_skip_above_chroma_at_420_and_shift_never_overflows() {
12 // 4:2:0 (ss 1,1): 8x8 -> 4x4, 16x8 -> 8x4, 8x16 -> 4x8 all skip.
13 assert!(obmc_skip_chroma_above(8, 8, 1, 1));
14 assert!(obmc_skip_chroma_above(16, 8, 1, 1));
15 assert!(obmc_skip_chroma_above(8, 16, 1, 1));
16 // ... larger plane blocks blend, exactly libaom's own list.
17 assert!(!obmc_skip_chroma_above(16, 16, 1, 1));
18 assert!(!obmc_skip_chroma_above(32, 16, 1, 1));
19 assert!(!obmc_skip_chroma_above(16, 32, 1, 1));
20 // 4:4:4 (ss 0,0): the plane block is the luma block itself.
21 assert!(obmc_skip_chroma_above(4, 4, 0, 0));
22 assert!(obmc_skip_chroma_above(8, 4, 0, 0));
23 assert!(obmc_skip_chroma_above(4, 8, 0, 0));
24 assert!(!obmc_skip_chroma_above(8, 8, 0, 0));
25 assert!(!obmc_skip_chroma_above(16, 8, 0, 0));
26 assert!(!obmc_skip_chroma_above(8, 16, 0, 0));
27}