Commit e3c0eabc authored by Josh Holmer's avatar Josh Holmer Committed by Thomas Daede
Browse files

Eliminate minor code duplication in compute_distortion

parent 8a721b62
......@@ -143,31 +143,22 @@ fn compute_distortion(
) -> u64 {
let po = bo.plane_offset(&fs.input.planes[0].cfg);
let mut distortion = match fi.config.tune {
Tune::Psnr => {
Tune::Psychovisual if w_y >= 8 && h_y >= 8 => {
cdef_dist_wxh(
&fs.input.planes[0].slice(&po),
&fs.rec.planes[0].slice(&po),
w_y,
h_y,
fi.sequence.bit_depth
)
}
Tune::Psnr | Tune::Psychovisual => {
sse_wxh(
&fs.input.planes[0].slice(&po),
&fs.rec.planes[0].slice(&po),
w_y,
h_y
)
},
Tune::Psychovisual => {
if w_y < 8 || h_y < 8 {
sse_wxh(
&fs.input.planes[0].slice(&po),
&fs.rec.planes[0].slice(&po),
w_y,
h_y
)
} else {
cdef_dist_wxh(
&fs.input.planes[0].slice(&po),
&fs.rec.planes[0].slice(&po),
w_y,
h_y,
fi.sequence.bit_depth
)
}
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment