adaptivegrain/benches/mask.rs
kageru 8ef0654595
No longer use LUT for 32bit input
That means you’ll finally get full 32bit precision, not just 8bit.
This comes at a cost (~20% lower FPS), but it’s a lot more accurate,
and there’s potentially room for optimization in the future because we
actually do math now instead of just hacky lookups in a 256-element
vector.
2020-05-26 18:12:39 +02:00

18 lines
515 B
Rust

use adaptivegrain_rs::mask::*;
use criterion::{black_box, criterion_group, criterion_main, Criterion};
fn mask_value(c: &mut Criterion) {
black_box(FLOAT_RANGE.iter().count());
let ls = black_box(calc_luma_scaling(0.412323, 10.0));
c.bench_function("mask value y=0.412", |b| {
b.iter(|| {
FLOAT_RANGE.iter().for_each(|&x| {
black_box(get_mask_value(black_box(x), ls));
});
})
});
}
criterion_group!(mask, mask_value);
criterion_main!(mask);