Skip to content

Commit

Permalink
mod {cdef,{cdef,lf,lr}_apply}_tmpl_{8,16}: Always compile both and …
Browse files Browse the repository at this point in the history
…dead-code eliminate (#562)

Since these bitdepth-specific `fn`s are Rust `fn`s, not asm `fn`s, we
can't use `bd_fn!` in the same way, so when `mod recon` got
deduplicated, it broke compiling for a single bitdepth. If we just
compile both bitdepths for these `mod`s and rely on dead code
elimination, it works again. And once we deduplicate these `mod`s, it
will all be for naught since they'll be generic instead.
  • Loading branch information
kkysen authored Nov 11, 2023
2 parents e57a261 + 79da37f commit b8c9b8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ pub mod include {
pub mod src {
pub mod align;
mod cdef;
#[cfg(feature = "bitdepth_16")]
#[cfg_attr(not(feature = "bitdepth_16"), allow(dead_code))]
mod cdef_apply_tmpl_16;
#[cfg(feature = "bitdepth_8")]
#[cfg_attr(not(feature = "bitdepth_8"), allow(dead_code))]
mod cdef_apply_tmpl_8;
#[cfg(feature = "bitdepth_16")]
#[cfg_attr(not(feature = "bitdepth_16"), allow(dead_code))]
mod cdef_tmpl_16;
#[cfg(feature = "bitdepth_8")]
#[cfg_attr(not(feature = "bitdepth_8"), allow(dead_code))]
mod cdef_tmpl_8;
mod cdf;
mod const_fn;
Expand Down Expand Up @@ -69,9 +69,9 @@ pub mod src {
mod itx_tmpl_16;
mod itx_tmpl_8;
mod levels;
#[cfg(feature = "bitdepth_16")]
#[cfg_attr(not(feature = "bitdepth_8"), allow(dead_code))]
mod lf_apply_tmpl_16;
#[cfg(feature = "bitdepth_8")]
#[cfg_attr(not(feature = "bitdepth_16"), allow(dead_code))]
mod lf_apply_tmpl_8;
mod lf_mask;
pub mod lib;
Expand All @@ -83,9 +83,9 @@ pub mod src {
mod loopfilter_tmpl_8;
mod looprestoration;
mod lr_apply;
#[cfg(feature = "bitdepth_16")]
#[cfg_attr(not(feature = "bitdepth_16"), allow(dead_code))]
mod lr_apply_tmpl_16;
#[cfg(feature = "bitdepth_8")]
#[cfg_attr(not(feature = "bitdepth_8"), allow(dead_code))]
mod lr_apply_tmpl_8;
mod mc;
mod mem;
Expand Down
4 changes: 2 additions & 2 deletions src/recon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ use std::ffi::c_void;
use std::ops::BitOr;
use std::slice;

#[cfg(feature = "bitdepth_8")]
#[cfg_attr(not(feature = "bitdepth_8"), allow(dead_code))]
use crate::{
src::cdef_apply_tmpl_8::rav1d_cdef_brow_8bpc, src::lf_apply_tmpl_8::rav1d_copy_lpf_8bpc,
src::lf_apply_tmpl_8::rav1d_loopfilter_sbrow_cols_8bpc,
src::lf_apply_tmpl_8::rav1d_loopfilter_sbrow_rows_8bpc,
src::lr_apply_tmpl_8::rav1d_lr_sbrow_8bpc,
};

#[cfg(feature = "bitdepth_16")]
#[cfg_attr(not(feature = "bitdepth_16"), allow(dead_code))]
use crate::{
src::cdef_apply_tmpl_16::rav1d_cdef_brow_16bpc, src::lf_apply_tmpl_16::rav1d_copy_lpf_16bpc,
src::lf_apply_tmpl_16::rav1d_loopfilter_sbrow_cols_16bpc,
Expand Down

0 comments on commit b8c9b8e

Please sign in to comment.