static unsigned int get_sby_perpixel_variance(VP9_COMP *cpi, MACROBLOCK *x,
BLOCK_SIZE bs) {
unsigned int var, sse;
- var = cpi->fn_ptr[bs].vf(x->plane[0].src.buf,
- x->plane[0].src.stride,
+ var = cpi->fn_ptr[bs].vf(x->plane[0].src.buf, x->plane[0].src.stride,
VP9_VAR_OFFS, 0, &sse);
- return (var + (1 << (num_pels_log2_lookup[bs] - 1))) >>
- num_pels_log2_lookup[bs];
+ return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]);
}
// Original activity measure from Tim T's code.