Skip to content

Commit

Permalink
fn w_mask*c: Make ss_{hor,ver} args bools (#360)
Browse files Browse the repository at this point in the history
I didn't deduplicate these ones since they're so trivial and because
I'll make `ss_{hor,ver}` `const` generics once I type erase them so that
I can just do `w_mask_c_erased::<true, true>`, etc.
  • Loading branch information
kkysen authored Aug 7, 2023
2 parents 71a63ff + d880140 commit 0b9aa66
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 54 deletions.
26 changes: 13 additions & 13 deletions src/mc_tmpl_16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3175,8 +3175,8 @@ unsafe extern "C" fn w_mask_c(
h: libc::c_int,
mask: *mut uint8_t,
sign: libc::c_int,
ss_hor: libc::c_int,
ss_ver: libc::c_int,
ss_hor: bool,
ss_ver: bool,
bitdepth_max: libc::c_int,
) {
debug_assert!(sign == 0 || sign == 1);
Expand All @@ -3189,8 +3189,8 @@ unsafe extern "C" fn w_mask_c(
h as usize,
mask,
sign != 0,
ss_hor != 0,
ss_ver != 0,
ss_hor,
ss_ver,
BitDepth16::new(bitdepth_max as u16),
)
}
Expand All @@ -3214,10 +3214,10 @@ unsafe extern "C" fn w_mask_444_c(
h,
mask,
sign,
0 as libc::c_int,
0 as libc::c_int,
false,
false,
bitdepth_max,
);
)
}
unsafe extern "C" fn w_mask_422_c(
dst: *mut pixel,
Expand All @@ -3239,10 +3239,10 @@ unsafe extern "C" fn w_mask_422_c(
h,
mask,
sign,
1 as libc::c_int,
0 as libc::c_int,
true,
false,
bitdepth_max,
);
)
}
unsafe extern "C" fn w_mask_420_c(
dst: *mut pixel,
Expand All @@ -3264,10 +3264,10 @@ unsafe extern "C" fn w_mask_420_c(
h,
mask,
sign,
1 as libc::c_int,
1 as libc::c_int,
true,
true,
bitdepth_max,
);
)
}
unsafe extern "C" fn warp_affine_8x8_c(
mut dst: *mut pixel,
Expand Down
48 changes: 7 additions & 41 deletions src/mc_tmpl_8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3077,8 +3077,8 @@ unsafe extern "C" fn w_mask_c(
h: libc::c_int,
mask: *mut uint8_t,
sign: libc::c_int,
ss_hor: libc::c_int,
ss_ver: libc::c_int,
ss_hor: bool,
ss_ver: bool,
) {
debug_assert!(sign == 0 || sign == 1);
w_mask_rust(
Expand All @@ -3090,8 +3090,8 @@ unsafe extern "C" fn w_mask_c(
h as usize,
mask,
sign != 0,
ss_hor != 0,
ss_ver != 0,
ss_hor,
ss_ver,
BitDepth8::new(()),
)
}
Expand All @@ -3105,20 +3105,8 @@ unsafe extern "C" fn w_mask_444_c(
mut mask: *mut uint8_t,
sign: libc::c_int,
) {
w_mask_c(
dst,
dst_stride,
tmp1,
tmp2,
w,
h,
mask,
sign,
0 as libc::c_int,
0 as libc::c_int,
);
w_mask_c(dst, dst_stride, tmp1, tmp2, w, h, mask, sign, false, false)
}

unsafe extern "C" fn w_mask_422_c(
dst: *mut pixel,
dst_stride: ptrdiff_t,
Expand All @@ -3129,18 +3117,7 @@ unsafe extern "C" fn w_mask_422_c(
mut mask: *mut uint8_t,
sign: libc::c_int,
) {
w_mask_c(
dst,
dst_stride,
tmp1,
tmp2,
w,
h,
mask,
sign,
1 as libc::c_int,
0 as libc::c_int,
);
w_mask_c(dst, dst_stride, tmp1, tmp2, w, h, mask, sign, true, false)
}
unsafe extern "C" fn w_mask_420_c(
dst: *mut pixel,
Expand All @@ -3152,18 +3129,7 @@ unsafe extern "C" fn w_mask_420_c(
mut mask: *mut uint8_t,
sign: libc::c_int,
) {
w_mask_c(
dst,
dst_stride,
tmp1,
tmp2,
w,
h,
mask,
sign,
1 as libc::c_int,
1 as libc::c_int,
);
w_mask_c(dst, dst_stride, tmp1, tmp2, w, h, mask, sign, true, true)
}
unsafe extern "C" fn warp_affine_8x8_c(
mut dst: *mut pixel,
Expand Down

0 comments on commit 0b9aa66

Please sign in to comment.