Skip to content
Snippets Groups Projects
Commit 7e2f72d2 authored by Frank Bossen's avatar Frank Bossen Committed by fbossen
Browse files

Double the ME search range and increase step size in initial ME

parent 8544574d
No related branches found
No related tags found
No related merge requests found
......@@ -44,7 +44,7 @@ pub fn motion_estimation(fi: &FrameInvariants, fs: &mut FrameState, bsize: Block
match fi.rec_buffer.frames[fi.ref_frames[ref_frame - LAST_FRAME]] {
Some(ref rec) => {
let po = PlaneOffset { x: (bo.x as isize) << BLOCK_TO_PLANE_SHIFT, y: (bo.y as isize) << BLOCK_TO_PLANE_SHIFT };
let range = 16 as isize;
let range = 32 as isize;
let blk_w = bsize.width();
let blk_h = bsize.height();
let x_lo = po.x - range;
......@@ -55,8 +55,8 @@ pub fn motion_estimation(fi: &FrameInvariants, fs: &mut FrameState, bsize: Block
let mut lowest_sad = 128*128*4096 as u32;
let mut best_mv = MotionVector { row: 0, col: 0 };
for y in (y_lo..y_hi).step_by(1) {
for x in (x_lo..x_hi).step_by(1) {
for y in (y_lo..y_hi).step_by(2) {
for x in (x_lo..x_hi).step_by(2) {
let mut plane_org = fs.input.planes[0].slice(&po);
let mut plane_ref = rec.frame.planes[0].slice(&PlaneOffset { x: x, y: y });
......@@ -73,7 +73,7 @@ pub fn motion_estimation(fi: &FrameInvariants, fs: &mut FrameState, bsize: Block
let mode = PredictionMode::NEWMV;
let mut tmp_plane = Plane::new(blk_w, blk_h, 0, 0, 0, 0);
let mut steps = vec![4, 2];
let mut steps = vec![8, 4, 2];
if fi.allow_high_precision_mv {
steps.push(1);
}
......
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