61 printf(
"motion-test [-h]\n"
62 "test motion implementations\n");
68 gettimeofday(&tv,
NULL);
69 return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
82 printf(
"testing '%s'\n", name);
85 for(it=0;it<20;it++) {
90 for(y=0;y<HEIGHT-17;y++) {
91 for(x=0;x<
WIDTH-17;x++) {
92 ptr =
img2 + y * WIDTH + x;
93 d1 = test_func(
NULL,
img1, ptr, WIDTH, 1);
94 d2 = ref_func(
NULL,
img1, ptr, WIDTH, 1);
96 printf(
"error: mmx=%d c=%d\n", d1, d2);
106 for(it=0;it<
NB_ITS;it++) {
107 for(y=0;y<
HEIGHT-17;y++) {
108 for(x=0;x<
WIDTH-17;x++) {
109 ptr =
img2 + y * WIDTH + x;
110 d1 += test_func(
NULL,
img1, ptr, WIDTH, 1);
120 (
double)(ti / 1000.0));
124 int main(
int argc,
char **argv)
133 c = getopt(argc, argv,
"h");
143 printf(
"Libav motion test\n");
148 for (c = 0; c < flags_size; c++) {
153 for (x = 0; x < 2; x++) {
154 printf(
"%s for %dx%d pixels\n", c ?
"mmx2" :
"mmx",
155 x ? 8 : 16, x ? 8 : 16);
int(* me_cmp_func)(void *s, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
#define AV_CPU_FLAG_MMX2
SSE integer functions or AMD MMX ext.
int main(int argc, char **argv)
unsigned dsp_mask
dsp_mask could be add used to disable unwanted CPU features CPU features (i.e.
AVCodecContext * avcodec_alloc_context3(AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
av_cold void dsputil_init(DSPContext *c, AVCodecContext *avctx)
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)
static av_always_inline void emms_c(void)
Empty mmx state.
#define AV_CPU_FLAG_FORCE
main external API structure.
#define AV_CPU_FLAG_MMX
standard MMX
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
static uint8_t img2[WIDTH *HEIGHT]
void av_cold av_lfg_init(AVLFG *c, unsigned int seed)
static int64_t gettime(void)
static void fill_random(uint8_t *tab, int size)
static const struct @46 tab
TwinVQ codebooks.
me_cmp_func pix_abs[2][4]