Skip to content

Commit

Permalink
WIP: Use macros in itx_dsp_init_x86
Browse files Browse the repository at this point in the history
  • Loading branch information
thedataking committed Mar 19, 2024
1 parent b349c7f commit d37d583
Show file tree
Hide file tree
Showing 2 changed files with 248 additions and 1,000 deletions.
16 changes: 15 additions & 1 deletion include/common/bitdepth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ impl BitDepth for BitDepth16 {
self.bitdepth_max
}

/// 4 for 10 bits/component.
/// 4 for 10 bits/component.
/// 2 for 12 bits/component.
fn get_intermediate_bits(&self) -> u8 {
14 - self.bitdepth()
Expand Down Expand Up @@ -561,11 +561,25 @@ macro_rules! bd_fn {
}
}};

($decl_fn:path, $bpc:literal bpc, $name:ident, $asm:ident) => {{
use paste::paste;

paste! {
$decl_fn!(fn [<dav1d_ $name _ $bpc bpc_ $asm>])
}
}};

($BD:ty, $name:ident, $asm:ident) => {{
use $crate::include::common::bitdepth::fn_identity;

bd_fn!(fn_identity, $BD, $name, $asm)
}};

($bpc:literal bpc, $name:ident, $asm:ident) => {{
use $crate::include::common::bitdepth::fn_identity;

bd_fn!(fn_identity, $bpc bpc, $name, $asm)
}};
}

#[cfg(feature = "asm")]
Expand Down
Loading

0 comments on commit d37d583

Please sign in to comment.