tests/checkasm: Add vf_pp7 checkasm test

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2026-05-10 20:43:49 +02:00
parent 617a9afeb4
commit 94a49068db
5 changed files with 72 additions and 0 deletions
+1
View File
@@ -76,6 +76,7 @@ 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
AVFILTEROBJS-$(CONFIG_PP7_FILTER) += vf_pp7.o
AVFILTEROBJS-$(CONFIG_THRESHOLD_FILTER) += vf_threshold.o
AVFILTEROBJS-$(CONFIG_NLMEANS_FILTER) += vf_nlmeans.o
AVFILTEROBJS-$(CONFIG_SOBEL_FILTER) += vf_convolution.o
+3
View File
@@ -342,6 +342,9 @@ static const struct {
#if CONFIG_NLMEANS_FILTER
{ "vf_nlmeans", checkasm_check_nlmeans },
#endif
#if CONFIG_PP7_FILTER
{ "vf_pp7", checkasm_check_vf_pp7 },
#endif
#if CONFIG_THRESHOLD_FILTER
{ "vf_threshold", checkasm_check_vf_threshold },
#endif
+1
View File
@@ -162,6 +162,7 @@ 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_pp7(void);
void checkasm_check_vf_threshold(void);
void checkasm_check_vf_sobel(void);
void checkasm_check_vp3dsp(void);
+66
View File
@@ -0,0 +1,66 @@
/*
* 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 <assert.h>
#include <stddef.h>
#include <stdint.h>
#include "checkasm.h"
#include "libavfilter/vf_pp7dsp.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem_internal.h"
#define randomize_buffer(buf) \
do { \
static_assert(!(sizeof(buf) % 4), "Tail handling needed"); \
for (size_t k = 0; k < sizeof(buf); k += 4) { \
AV_WN32A((char*)buf + k, rnd()); \
} \
} while (0)
static void check_dctB(const PP7DSPContext *const pp7dsp)
{
declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *dst, const int16_t *src);
if (!check_func(pp7dsp->dctB, "dctB"))
return;
DECLARE_ALIGNED(8, int16_t, src)[7 * 4];
DECLARE_ALIGNED(8, int16_t, dst_ref)[6 * 4];
DECLARE_ALIGNED(8, int16_t, dst_new)[6 * 4];
randomize_buffer(src);
randomize_buffer(dst_ref);
memcpy(dst_new, dst_ref, sizeof(dst_new));
call_ref(dst_ref, src);
call_new(dst_new, src);
if (memcmp(dst_new, dst_ref, sizeof(dst_new)))
fail();
bench_new(dst_new, src);
}
void checkasm_check_vf_pp7(void)
{
PP7DSPContext pp7dsp;
ff_pp7dsp_init(&pp7dsp);
check_dctB(&pp7dsp);
report("dctB");
}
+1
View File
@@ -83,6 +83,7 @@ FATE_CHECKASM = fate-checkasm-aacencdsp \
fate-checkasm-vf_hflip \
fate-checkasm-vf_idet \
fate-checkasm-vf_nlmeans \
fate-checkasm-vf_pp7 \
fate-checkasm-vf_threshold \
fate-checkasm-vf_sobel \
fate-checkasm-videodsp \