Skip to content

Commit

Permalink
Enable CDEF filter for 4:2:2
Browse files Browse the repository at this point in the history
The logic to map CDEF direction for chroma planes was missing.
  • Loading branch information
barrbrain committed May 11, 2020
1 parent c49c6c4 commit fb08f7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/cdef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,11 @@ pub fn cdef_filter_superblock<T: Pixel, U: Pixel>(
local_sec_strength = cdef_sec_uv_strength << coeff_shift;
local_damping -= 1;
if cdef_pri_uv_strength != 0 {
dir as usize
if xdec != ydec {
[7, 0, 2, 4, 5, 6, 6, 6][dir as usize]
} else {
dir as usize
}
} else {
0
}
Expand Down
4 changes: 1 addition & 3 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,7 @@ impl Sequence {
enable_ref_frame_mvs: false,
enable_warped_motion: false,
enable_superres: false,
enable_cdef: config.speed_settings.cdef
&& config.chroma_sampling != ChromaSampling::Cs422
&& enable_restoration_filters,
enable_cdef: config.speed_settings.cdef && enable_restoration_filters,
enable_restoration: config.speed_settings.lrf
&& config.chroma_sampling != ChromaSampling::Cs422
&& enable_restoration_filters,
Expand Down

0 comments on commit fb08f7e

Please sign in to comment.