checkasm/takdsp: add decorrelate_ls test

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
This commit is contained in:
sunyuechi 2023-12-18 22:39:13 +08:00 committed by Rémi Denis-Courmont
parent cdd38a2ffe
commit 3bdb0fe511
5 changed files with 74 additions and 0 deletions

View File

@ -33,6 +33,7 @@ AVCODECOBJS-$(CONFIG_JPEG2000_DECODER) += jpeg2000dsp.o
AVCODECOBJS-$(CONFIG_OPUS_DECODER) += opusdsp.o
AVCODECOBJS-$(CONFIG_PIXBLOCKDSP) += pixblockdsp.o
AVCODECOBJS-$(CONFIG_HEVC_DECODER) += hevc_add_res.o hevc_deblock.o hevc_idct.o hevc_sao.o hevc_pel.o
AVCODECOBJS-$(CONFIG_TAK_DECODER) += takdsp.o
AVCODECOBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodsp.o
AVCODECOBJS-$(CONFIG_V210_DECODER) += v210dec.o
AVCODECOBJS-$(CONFIG_V210_ENCODER) += v210enc.o

View File

@ -159,6 +159,9 @@ static const struct {
#if CONFIG_PIXBLOCKDSP
{ "pixblockdsp", checkasm_check_pixblockdsp },
#endif
#if CONFIG_TAK_DECODER
{ "takdsp", checkasm_check_takdsp },
#endif
#if CONFIG_UTVIDEO_DECODER
{ "utvideodsp", checkasm_check_utvideodsp },
#endif

View File

@ -85,6 +85,7 @@ void checkasm_check_synth_filter(void);
void checkasm_check_sw_gbrp(void);
void checkasm_check_sw_rgb(void);
void checkasm_check_sw_scale(void);
void checkasm_check_takdsp(void);
void checkasm_check_utvideodsp(void);
void checkasm_check_v210dec(void);
void checkasm_check_v210enc(void);

68
tests/checkasm/takdsp.c Normal file
View File

@ -0,0 +1,68 @@
/*
* Copyright (c) 2023 Institue of Software Chinese Academy of Sciences (ISCAS).
*
* 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 <string.h>
#include "libavutil/mem.h"
#include "libavutil/mem_internal.h"
#include "libavcodec/takdsp.h"
#include "checkasm.h"
#define randomize(buf, len) \
do { \
for (int i = 0; i < len; i++) \
buf[i] = rnd(); \
} while (0)
static void test_decorrelate_ls(TAKDSPContext *s) {
#define BUF_SIZE 1024
declare_func(void, int32_t *, int32_t *, int);
if (check_func(s->decorrelate_ls, "decorrelate_ls")) {
LOCAL_ALIGNED_32(int32_t, p1, [BUF_SIZE]);
LOCAL_ALIGNED_32(int32_t, p2, [BUF_SIZE]);
LOCAL_ALIGNED_32(int32_t, p2_2, [BUF_SIZE]);
randomize(p1, BUF_SIZE);
randomize(p2, BUF_SIZE);
memcpy(p2_2, p2, BUF_SIZE);
call_ref(p1, p2, BUF_SIZE);
call_new(p1, p2_2, BUF_SIZE);
if (memcmp(p2, p2_2, BUF_SIZE) != 0){
fail();
}
bench_new(p1, p2, BUF_SIZE);
}
report("decorrelate_ls");
}
void checkasm_check_takdsp(void)
{
TAKDSPContext s = { 0 };
ff_takdsp_init(&s);
test_decorrelate_ls(&s);
}

View File

@ -37,6 +37,7 @@ FATE_CHECKASM = fate-checkasm-aacencdsp \
fate-checkasm-sw_gbrp \
fate-checkasm-sw_rgb \
fate-checkasm-sw_scale \
fate-checkasm-takdsp \
fate-checkasm-utvideodsp \
fate-checkasm-v210dec \
fate-checkasm-v210enc \