33 #include "libavutil/lfg.h"
34 #include "libavutil/mem.h"
35 #include "libavutil/time.h"
58 printf(
"motion-test [-h]\n"
59 "test motion implementations\n");
72 printf(
"testing '%s'\n", name);
75 for(it=0;it<20;it++) {
80 for(y=0;y<HEIGHT-17;y++) {
81 for(x=0;x<
WIDTH-17;x++) {
82 ptr =
img2 + y * WIDTH + x;
83 d1 = test_func(NULL,
img1, ptr, WIDTH, 8);
84 d2 = ref_func(NULL,
img1, ptr, WIDTH, 8);
86 printf(
"error: mmx=%d c=%d\n", d1, d2);
98 for(x=0;x<
WIDTH-17;x++) {
99 ptr =
img2 + y * WIDTH + x;
100 d1 += test_func(NULL,
img1, ptr, WIDTH, 8);
108 printf(
" %0.0f kop/s\n",
110 (
double)(ti / 1000.0));
114 int main(
int argc,
char **argv)
127 printf(
"ffmpeg motion test\n");
131 memset(&cctx, 0,
sizeof(cctx));
133 for (c = 0; c < flags_size; c++) {
136 memset(&mmxctx, 0,
sizeof(mmxctx));
139 for (x = 0; x < 2; x++) {
140 printf(
"%s for %dx%d pixels\n", c ?
"mmx2" :
"mmx",
141 x ? 8 : 16, x ? 8 : 16);
av_cold void ff_dsputil_init(DSPContext *c, AVCodecContext *avctx)
#define AV_CPU_FLAG_MMXEXT
SSE integer functions or AMD MMX ext.
int(* me_cmp_func)(void *s, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
#define CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
static uint8_t img1[WIDTH *HEIGHT]
static void test_motion(const char *name, me_cmp_func test_func, me_cmp_func ref_func)
common internal API header
int64_t av_gettime(void)
Get the current time in microseconds.
void av_lfg_init(AVLFG *c, unsigned int seed)
#define AV_CPU_FLAG_MMX
standard MMX
main external API structure.
static uint8_t img2[WIDTH *HEIGHT]
static void fill_random(uint8_t *tab, int size)
void av_force_cpu_flags(int flags)
Disables cpu detection and forces the specified flags.
static struct twinvq_data tab
int main(int argc, char **argv)
me_cmp_func pix_abs[2][4]