Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable CDEF and restoration filters for 4:2:2 #2224

Merged
merged 2 commits into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/cdef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,8 @@ pub fn cdef_filter_superblock<T: Pixel, U: Pixel>(
let local_pri_strength;
let local_sec_strength;
let mut local_damping: i32 = cdef_damping + coeff_shift;
// See `Cdef_Uv_Dir` constant lookup table in Section 7.15.1
// <https://aomediacodec.github.io/av1-spec/#cdef-block-process>
let local_dir = if p == 0 {
local_pri_strength =
adjust_strength(cdef_pri_y_strength << coeff_shift, var);
Expand All @@ -535,7 +537,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]
barrbrain marked this conversation as resolved.
Show resolved Hide resolved
} else {
dir as usize
}
} else {
0
}
Expand Down
5 changes: 1 addition & 4 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,8 @@ 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,
enable_large_lru: true,
enable_delayed_loopfilter_rdo: true,
Expand Down