Skip to content

Commit

Permalink
use select in 2 more places
Browse files Browse the repository at this point in the history
  • Loading branch information
Folkert de Vries committed Feb 23, 2024
1 parent 6be4e9e commit fbd360e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/intra_edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl EdgeFlags {
| Self::EDGE_I420_TOP_HAS_RIGHT.bits(),
);

const fn select(&self, select: bool) -> Self {
pub(crate) const fn select(&self, select: bool) -> Self {
if select {
*self
} else {
Expand Down
15 changes: 5 additions & 10 deletions src/recon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2628,16 +2628,11 @@ pub(crate) unsafe fn rav1d_recon_b_intra<BD: BitDepth>(
let m: IntraPredMode;
if !(b.c2rust_unnamed.c2rust_unnamed.pal_sz[0] != 0) {
angle = b.c2rust_unnamed.c2rust_unnamed.y_angle as c_int;
edge_flags =
(if (y > init_y || !sb_has_tr) && x + (*t_dim).w as c_int >= sub_w4 {
EdgeFlags::empty()
} else {
EdgeFlags::EDGE_I444_TOP_HAS_RIGHT
}) | (if x > init_x || !sb_has_bl && y + (*t_dim).h as c_int >= sub_h4 {
EdgeFlags::empty()
} else {
EdgeFlags::EDGE_I444_LEFT_HAS_BOTTOM
});
edge_flags = EdgeFlags::EDGE_I444_TOP_HAS_RIGHT.select(
!((y > init_y || !sb_has_tr) && x + (*t_dim).w as c_int >= sub_w4),
) | EdgeFlags::EDGE_I444_LEFT_HAS_BOTTOM.select(
!(x > init_x || (!sb_has_bl && y + (*t_dim).h as c_int >= sub_h4)),
);
let top_sb_edge_slice = if t.by & f.sb_step - 1 == 0 {
let mut top_sb_edge: *const BD::Pixel =
f.ipred_edge[0] as *mut BD::Pixel;
Expand Down

0 comments on commit fbd360e

Please sign in to comment.