tests/checkasm: Add vf_fspp mul_thrmat test

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2025-11-09 18:50:48 +01:00
parent 9f4d5d818d
commit 70eb8a76a9
5 changed files with 58 additions and 0 deletions

View file

@ -64,6 +64,7 @@ AVFILTEROBJS-$(CONFIG_BWDIF_FILTER) += vf_bwdif.o
AVFILTEROBJS-$(CONFIG_COLORDETECT_FILTER)+= vf_colordetect.o
AVFILTEROBJS-$(CONFIG_COLORSPACE_FILTER) += vf_colorspace.o
AVFILTEROBJS-$(CONFIG_EQ_FILTER) += vf_eq.o
AVFILTEROBJS-$(CONFIG_FSPP_FILTER) += vf_fspp.o
AVFILTEROBJS-$(CONFIG_GBLUR_FILTER) += vf_gblur.o
AVFILTEROBJS-$(CONFIG_HFLIP_FILTER) += vf_hflip.o
AVFILTEROBJS-$(CONFIG_IDET_FILTER) += vf_idet.o

View file

@ -297,6 +297,9 @@ static const struct {
#if CONFIG_EQ_FILTER
{ "vf_eq", checkasm_check_vf_eq },
#endif
#if CONFIG_FSPP_FILTER
{ "vf_fspp", checkasm_check_vf_fspp },
#endif
#if CONFIG_GBLUR_FILTER
{ "vf_gblur", checkasm_check_vf_gblur },
#endif

View file

@ -148,6 +148,7 @@ void checkasm_check_v210enc(void);
void checkasm_check_vc1dsp(void);
void checkasm_check_vf_bwdif(void);
void checkasm_check_vf_eq(void);
void checkasm_check_vf_fspp(void);
void checkasm_check_vf_gblur(void);
void checkasm_check_vf_hflip(void);
void checkasm_check_vf_threshold(void);

52
tests/checkasm/vf_fspp.c Normal file
View file

@ -0,0 +1,52 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with FFmpeg; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "checkasm.h"
#include "libavfilter/vf_fsppdsp.h"
#define randomize_buffers(buf) \
do { \
for (size_t j = 0; j < FF_ARRAY_ELEMS(buf); ++j) \
buf[j] = rnd(); \
} while (0)
static void check_mul_thrmat(void)
{
FSPPDSPContext fspp;
int16_t src[64];
int16_t dst_ref[64], dst_new[64];
const int q = (uint8_t)rnd();
declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *thr_adr_noq, int16_t *thr_adr, int q);
ff_fsppdsp_init(&fspp);
if (check_func(fspp.mul_thrmat, "mul_thrmat")) {
randomize_buffers(src);
call_ref(src, dst_ref, q);
call_new(src, dst_new, q);
if (memcmp(dst_ref, dst_new, sizeof(dst_ref)))
fail();
bench_new(src, dst_new, q);
}
}
void checkasm_check_vf_fspp(void)
{
check_mul_thrmat();
}

View file

@ -67,6 +67,7 @@ FATE_CHECKASM = fate-checkasm-aacencdsp \
fate-checkasm-vf_colordetect \
fate-checkasm-vf_colorspace \
fate-checkasm-vf_eq \
fate-checkasm-vf_fspp \
fate-checkasm-vf_gblur \
fate-checkasm-vf_hflip \
fate-checkasm-vf_nlmeans \