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

get_sad does not need mutable PlaneSlices anymore

parent eb18ea7a
No related branches found
No related tags found
No related merge requests found
......@@ -41,11 +41,11 @@ fn bench_get_sad(b: &mut Bencher, bs: &BlockSize) {
let rec_plane = new_plane(&mut ra, w, h);
let po = PlaneOffset { x: 0, y: 0 };
let mut plane_org = input_plane.slice(&po);
let mut plane_ref = rec_plane.slice(&po);
let plane_org = input_plane.slice(&po);
let plane_ref = rec_plane.slice(&po);
b.iter(|| {
let _ = me::get_sad(&mut plane_org, &mut plane_ref, bsw, bsh);
let _ = me::get_sad(&plane_org, &plane_ref, bsw, bsh);
})
}
......
......@@ -17,7 +17,7 @@ use FrameState;
#[inline(always)]
pub fn get_sad(
plane_org: &mut PlaneSlice, plane_ref: &mut PlaneSlice, blk_h: usize,
plane_org: &PlaneSlice, plane_ref: &PlaneSlice, blk_h: usize,
blk_w: usize
) -> u32 {
let mut sum = 0 as u32;
......@@ -64,10 +64,10 @@ pub fn motion_estimation(
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, y });
let plane_org = fs.input.planes[0].slice(&po);
let plane_ref = rec.frame.planes[0].slice(&PlaneOffset { x, y });
let sad = get_sad(&mut plane_org, &mut plane_ref, blk_h, blk_w);
let sad = get_sad(&plane_org, &plane_ref, blk_h, blk_w);
if sad < lowest_sad {
lowest_sad = sad;
......@@ -117,10 +117,10 @@ pub fn motion_estimation(
);
}
let mut plane_org = fs.input.planes[0].slice(&po);
let mut plane_ref = tmp_plane.slice(&PlaneOffset { x: 0, y: 0 });
let plane_org = fs.input.planes[0].slice(&po);
let plane_ref = tmp_plane.slice(&PlaneOffset { x: 0, y: 0 });
let sad = get_sad(&mut plane_org, &mut plane_ref, blk_h, blk_w);
let sad = get_sad(&plane_org, &plane_ref, blk_h, blk_w);
if sad < lowest_sad {
lowest_sad = sad;
......
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