Skip to content

Commit

Permalink
Minor cleanup in itx_tmpl (#371)
Browse files Browse the repository at this point in the history
Addressing comments from @kkysen after #366 was already merged.
  • Loading branch information
endbr64 authored Aug 10, 2023
2 parents 99f6882 + 386dc7c commit eaeea9c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/itx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub unsafe extern "C" fn inv_txfm_add_rust<BD: BitDepth>(
has_dconly: libc::c_int,
bd: BD,
) {
let bitdepth_max: libc::c_int = bd.bitdepth_max().to_prim();
let bitdepth_max: libc::c_int = bd.bitdepth_max().as_();
let stride = stride as usize;
if !(w >= 4 && w <= 64) {
unreachable!();
Expand All @@ -40,8 +40,8 @@ pub unsafe extern "C" fn inv_txfm_add_rust<BD: BitDepth>(
let is_rect2: libc::c_int = (w * 2 == h || h * 2 == w) as libc::c_int;
let rnd = (1 as libc::c_int) << shift >> 1;
if eob < has_dconly {
let mut dc: libc::c_int = BD::Coef::to_prim(*coeff.offset(0));
*coeff.offset(0) = BD::Coef::from_prim(0);
let mut dc: libc::c_int = (*coeff.offset(0)).as_();
*coeff.offset(0) = 0.as_();
if is_rect2 != 0 {
dc = dc * 181 + 128 >> 8;
}
Expand Down Expand Up @@ -89,7 +89,7 @@ pub unsafe extern "C" fn inv_txfm_add_rust<BD: BitDepth>(
} else {
let mut x_1 = 0;
while x_1 < sw {
*c.offset(x_1 as isize) = (*coeff.offset((y_0 + x_1 * sh) as isize)).to_prim();
*c.offset(x_1 as isize) = (*coeff.offset((y_0 + x_1 * sh) as isize)).as_();
x_1 += 1;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/itx_tmpl_16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4977,7 +4977,7 @@ unsafe extern "C" fn inv_txfm_add_c(
has_dconly: libc::c_int,
bitdepth_max: libc::c_int,
) {
return inv_txfm_add_rust(
inv_txfm_add_rust(
dst,
stride,
coeff,
Expand All @@ -4989,7 +4989,7 @@ unsafe extern "C" fn inv_txfm_add_c(
second_1d_fn,
has_dconly,
BitDepth16::from_c(bitdepth_max),
);
)
}
unsafe extern "C" fn inv_txfm_add_identity_identity_4x4_c(
mut dst: *mut pixel,
Expand Down
2 changes: 1 addition & 1 deletion src/itx_tmpl_8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3891,7 +3891,7 @@ unsafe extern "C" fn inv_txfm_add_c(
second_1d_fn,
has_dconly,
BitDepth8::from_c(8),
);
)
}
unsafe extern "C" fn inv_txfm_add_flipadst_flipadst_4x4_c(
mut dst: *mut pixel,
Expand Down

0 comments on commit eaeea9c

Please sign in to comment.