mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
checkasm/vf_gblur: split off the horiz_slice test into its own function
Will come in handy for the following commit. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
2b4da1cb8c
commit
2df3c2ed9b
@ -33,32 +33,34 @@
|
||||
tmp_buf[j] = (float)(rnd() & 0xFF); \
|
||||
} while (0)
|
||||
|
||||
static void check_horiz_slice(float *dst_ref, float *dst_new)
|
||||
{
|
||||
int steps = 2;
|
||||
float nu = 0.101f;
|
||||
float bscale = 1.112f;
|
||||
|
||||
declare_func(void, float *dst, int w, int h, int steps, float nu, float bscale);
|
||||
call_ref(dst_ref, WIDTH, HEIGHT, steps, nu, bscale);
|
||||
call_new(dst_new, WIDTH, HEIGHT, steps, nu, bscale);
|
||||
if (!float_near_abs_eps_array(dst_ref, dst_new, 0.01f, PIXELS)) {
|
||||
fail();
|
||||
}
|
||||
bench_new(dst_new, WIDTH, HEIGHT, 1, nu, bscale);
|
||||
}
|
||||
|
||||
void checkasm_check_vf_gblur(void)
|
||||
{
|
||||
float *dst_ref = av_malloc(BUF_SIZE);
|
||||
float *dst_new = av_malloc(BUF_SIZE);
|
||||
int w = WIDTH;
|
||||
int h = HEIGHT;
|
||||
int steps = 2;
|
||||
float nu = 0.101f;
|
||||
float bscale = 1.112f;
|
||||
GBlurContext s;
|
||||
|
||||
declare_func(void, float *dst, int w, int h, int steps, float nu, float bscale);
|
||||
|
||||
randomize_buffers(dst_ref, PIXELS);
|
||||
memcpy(dst_new, dst_ref, BUF_SIZE);
|
||||
|
||||
ff_gblur_init(&s);
|
||||
|
||||
if (check_func(s.horiz_slice, "horiz_slice")) {
|
||||
call_ref(dst_ref, w, h, steps, nu, bscale);
|
||||
call_new(dst_new, w, h, steps, nu, bscale);
|
||||
|
||||
if (!float_near_abs_eps_array(dst_ref, dst_new, 0.01f, PIXELS)) {
|
||||
fail();
|
||||
}
|
||||
bench_new(dst_new, w, h, 1, nu, bscale);
|
||||
check_horiz_slice(dst_ref, dst_new);
|
||||
}
|
||||
report("horiz_slice");
|
||||
av_freep(&dst_ref);
|
||||
|
Loading…
Reference in New Issue
Block a user