Skip to content
Snippets Groups Projects
Commit 8bc92013 authored by Luca Barbato's avatar Luca Barbato Committed by Luca Barbato
Browse files

Use for_each for the skip/not skip inner loop rdo

And use a conditional slice outside the chroma loop.
parent c8affff6
No related branches found
No related tags found
No related merge requests found
......@@ -332,15 +332,19 @@ pub fn rdo_mode_decision(
seq, fi, fs, cw, bsize, bo, luma_mode, ref_frame, mv, false,
);
let all_skips = [false, true];
// Don't skip when using intra modes
let skips = if luma_mode_is_intra {
&all_skips[..1]
} else {
&all_skips[..]
};
// Find the best chroma prediction mode for the current luma prediction mode
for &chroma_mode in &mode_set_chroma {
for &skip in &[false, true] {
// Don't skip when using intra modes
if skip && luma_mode_is_intra {
continue;
}
let mut wr: &mut dyn Writer = &mut WriterCounter::new();
skips.iter().for_each(|&skip| {
let wr: &mut dyn Writer = &mut WriterCounter::new();
let tell = wr.tell_frac();
encode_block_a(seq, cw, wr, bsize, bo, skip);
......@@ -390,7 +394,7 @@ pub fn rdo_mode_decision(
}
cw.rollback(&cw_checkpoint);
}
});
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment