You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-12-04 14:00:22 +02:00
53 lines
1.6 KiB
C
53 lines
1.6 KiB
C
|
|
/*
|
||
|
|
* 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();
|
||
|
|
}
|