This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit ee89beda21284d0cf5f44cbe0af24f1c9320eb8b Author: Andreas Rheinhardt <[email protected]> AuthorDate: Fri Aug 7 01:07:35 2026 +0200 Commit: Andreas Rheinhardt <[email protected]> CommitDate: Sun Aug 9 17:10:52 2026 +0200 tests/checkasm: Add ttadsp test Reviewed-by: Lynne <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]> --- tests/checkasm/Makefile | 1 + tests/checkasm/checkasm.c | 3 ++ tests/checkasm/checkasm.h | 1 + tests/checkasm/ttadsp.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++ tests/fate/checkasm.mak | 1 + 5 files changed, 80 insertions(+) diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile index c154d19ed4..7f9b78dfca 100644 --- a/tests/checkasm/Makefile +++ b/tests/checkasm/Makefile @@ -55,6 +55,7 @@ AVCODECOBJS-$(CONFIG_SBC_ENCODER) += sbcdsp.o AVCODECOBJS-$(CONFIG_SNOW_DECODER) += snowdsp.o AVCODECOBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o AVCODECOBJS-$(CONFIG_TAK_DECODER) += takdsp.o +AVCODECOBJS-$(CONFIG_TTA_DECODER) += ttadsp.o AVCODECOBJS-$(CONFIG_UTVIDEO_DECODER) += utvideodsp.o AVCODECOBJS-$(CONFIG_V210_DECODER) += v210dec.o AVCODECOBJS-$(CONFIG_V210_ENCODER) += v210enc.o diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index cce47ecafb..06d86bb679 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -202,6 +202,9 @@ static const CheckasmTest tests[] = { #if CONFIG_TAK_DECODER { "takdsp", checkasm_check_takdsp }, #endif + #if CONFIG_TTA_DECODER + { "ttadsp", checkasm_check_ttadsp }, + #endif #if CONFIG_UTVIDEO_DECODER { "utvideodsp", checkasm_check_utvideodsp }, #endif diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index a6e47d8b85..40c4b39f88 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -106,6 +106,7 @@ void checkasm_check_sw_yuv2rgb(void); void checkasm_check_sw_yuv2yuv(void); void checkasm_check_sw_ops(void); void checkasm_check_takdsp(void); +void checkasm_check_ttadsp(void); void checkasm_check_utvideodsp(void); void checkasm_check_v210dec(void); void checkasm_check_v210enc(void); diff --git a/tests/checkasm/ttadsp.c b/tests/checkasm/ttadsp.c new file mode 100644 index 0000000000..5dd44eb77f --- /dev/null +++ b/tests/checkasm/ttadsp.c @@ -0,0 +1,74 @@ +/* + * 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 "checkasm.h" + +#include "libavcodec/ttadata.h" +#include "libavcodec/ttadsp.h" +#include "libavutil/mem_internal.h" + +#define randomize_buffer(NAME) \ +do { \ + checkasm_randomize(NAME ## _ref, sizeof(NAME ## _ref)); \ + memcpy(NAME ## _new, NAME ## _ref, sizeof(NAME ## _new)); \ +} while (0) + +static void check_filter_process(void) +{ + DECLARE_ALIGNED_16(int32_t, qm_ref)[MAX_ORDER]; + DECLARE_ALIGNED_16(int32_t, dx_ref)[MAX_ORDER]; + DECLARE_ALIGNED_16(int32_t, dl_ref)[MAX_ORDER]; + DECLARE_ALIGNED_16(int32_t, qm_new)[MAX_ORDER]; + DECLARE_ALIGNED_16(int32_t, dx_new)[MAX_ORDER]; + DECLARE_ALIGNED_16(int32_t, dl_new)[MAX_ORDER]; + int bps = 1 + rnd() % 3; + int32_t shift = ff_tta_filter_configs[bps - 1], round = ff_tta_shift_1[shift - 1]; + int32_t in_ref = rnd(), in_new = in_ref; + int32_t error_ref = rnd(), error_new = error_ref; + + declare_func(void, int32_t *qm, int32_t *dx, int32_t *dl, int32_t *error, + int32_t *in, int32_t shift, int32_t round); + + randomize_buffer(qm); + randomize_buffer(dx); + randomize_buffer(dl); + + call_ref(qm_ref, dx_ref, dl_ref, &error_ref, &in_ref, shift, round); + call_new(qm_new, dx_new, dl_new, &error_new, &in_new, shift, round); + + if (in_ref != in_new || error_ref != error_new || + memcmp(qm_ref, qm_new, sizeof(qm_ref)) || + memcmp(dx_ref, dx_new, sizeof(dx_ref)) || + memcmp(dl_ref, dl_new, sizeof(dl_ref))) + fail(); +#define alt(var) checkasm_alternate(var ## _ref, var ## _new) + bench_new(alt(qm), alt(dx), alt(dl), alt(&error), alt(&in), shift, round); +} + +void checkasm_check_ttadsp(void) +{ + TTADSPContext ttadsp; + + ff_ttadsp_init(&ttadsp); + + if (check_func(ttadsp.filter_process, "filter_process")) + check_filter_process(); + report("filter_process"); +} diff --git a/tests/fate/checkasm.mak b/tests/fate/checkasm.mak index 249fb91d4f..082ff99bb8 100644 --- a/tests/fate/checkasm.mak +++ b/tests/fate/checkasm.mak @@ -69,6 +69,7 @@ FATE_CHECKASM = fate-checkasm-aacencdsp \ fate-checkasm-sw_yuv2rgb \ fate-checkasm-sw_yuv2yuv \ fate-checkasm-takdsp \ + fate-checkasm-ttadsp \ fate-checkasm-utvideodsp \ fate-checkasm-v210dec \ fate-checkasm-v210enc \ _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
