Skip to content

Commit

Permalink
fn rav1d_itx_dsp_init_*: Deduplicate w/ generics
Browse files Browse the repository at this point in the history
  • Loading branch information
thedataking committed Mar 15, 2024
1 parent 6315878 commit 150dacb
Show file tree
Hide file tree
Showing 5 changed files with 1,600 additions and 2,349 deletions.
3 changes: 0 additions & 3 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ pub mod src {
mod ipred_prepare;
mod itx;
mod itx_1d;
#[cfg(feature = "bitdepth_16")]
mod itx_tmpl_16;
mod itx_tmpl_8;
mod levels;
mod lf_apply;
mod lf_mask;
Expand Down
11 changes: 3 additions & 8 deletions src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ use crate::src::intra_edge::EdgeFlags;
use crate::src::intra_edge::EdgeIndex;
use crate::src::intra_edge::IntraEdges;
use crate::src::ipred::rav1d_intra_pred_dsp_init;
use crate::src::itx::rav1d_itx_dsp_init;
use crate::src::levels::mv;
use crate::src::levels::Av1Block;
use crate::src::levels::BS_128x128;
Expand Down Expand Up @@ -219,12 +220,6 @@ use std::slice;
use std::sync::atomic::AtomicI32;
use std::sync::atomic::Ordering;

#[cfg(feature = "bitdepth_8")]
use crate::src::itx_tmpl_8::rav1d_itx_dsp_init_8bpc;

#[cfg(feature = "bitdepth_16")]
use crate::src::itx_tmpl_16::rav1d_itx_dsp_init_16bpc;

fn init_quant_tables(
seq_hdr: &Rav1dSequenceHeader,
frame_hdr: &Rav1dFrameHeader,
Expand Down Expand Up @@ -4961,7 +4956,7 @@ pub unsafe fn rav1d_submit_frame(c: &mut Rav1dContext) -> Rav1dResult {
8 => {
rav1d_cdef_dsp_init::<BitDepth8>(&mut dsp.cdef);
rav1d_intra_pred_dsp_init::<BitDepth8>(&mut dsp.ipred);
rav1d_itx_dsp_init_8bpc(&mut dsp.itx, bpc);
rav1d_itx_dsp_init::<BitDepth8>(&mut dsp.itx, bpc);
rav1d_loop_filter_dsp_init::<BitDepth8>(&mut dsp.lf);
rav1d_loop_restoration_dsp_init::<BitDepth8>(&mut dsp.lr, bpc);
rav1d_mc_dsp_init::<BitDepth8>(&mut dsp.mc);
Expand All @@ -4971,7 +4966,7 @@ pub unsafe fn rav1d_submit_frame(c: &mut Rav1dContext) -> Rav1dResult {
10 | 12 => {
rav1d_cdef_dsp_init::<BitDepth16>(&mut dsp.cdef);
rav1d_intra_pred_dsp_init::<BitDepth16>(&mut dsp.ipred);
rav1d_itx_dsp_init_16bpc(&mut dsp.itx, bpc);
rav1d_itx_dsp_init::<BitDepth16>(&mut dsp.itx, bpc);
rav1d_loop_filter_dsp_init::<BitDepth16>(&mut dsp.lf);
rav1d_loop_restoration_dsp_init::<BitDepth16>(&mut dsp.lr, bpc);
rav1d_mc_dsp_init::<BitDepth16>(&mut dsp.mc);
Expand Down
Loading

0 comments on commit 150dacb

Please sign in to comment.