comparison motion_test.c @ 1064:b32afefe7d33 libavcodec

* UINTX -> uintx_t INTX -> intx_t
author kabi
date Tue, 11 Feb 2003 16:35:48 +0000
parents 0c32f81b42b2
children 1e39f273ecd6
comparison
equal deleted inserted replaced
1063:fdeac9642346 1064:b32afefe7d33
7 7
8 #include "dsputil.h" 8 #include "dsputil.h"
9 9
10 #include "i386/mmx.h" 10 #include "i386/mmx.h"
11 11
12 int pix_abs16x16_mmx(UINT8 *blk1, UINT8 *blk2, int lx); 12 int pix_abs16x16_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
13 int pix_abs16x16_mmx1(UINT8 *blk1, UINT8 *blk2, int lx); 13 int pix_abs16x16_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
14 int pix_abs16x16_x2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); 14 int pix_abs16x16_x2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
15 int pix_abs16x16_x2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx); 15 int pix_abs16x16_x2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
16 int pix_abs16x16_x2_c(UINT8 *blk1, UINT8 *blk2, int lx); 16 int pix_abs16x16_x2_c(uint8_t *blk1, uint8_t *blk2, int lx);
17 int pix_abs16x16_y2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); 17 int pix_abs16x16_y2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
18 int pix_abs16x16_y2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx); 18 int pix_abs16x16_y2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
19 int pix_abs16x16_y2_c(UINT8 *blk1, UINT8 *blk2, int lx); 19 int pix_abs16x16_y2_c(uint8_t *blk1, uint8_t *blk2, int lx);
20 int pix_abs16x16_xy2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); 20 int pix_abs16x16_xy2_mmx(uint8_t *blk1, uint8_t *blk2, int lx);
21 int pix_abs16x16_xy2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx); 21 int pix_abs16x16_xy2_mmx1(uint8_t *blk1, uint8_t *blk2, int lx);
22 int pix_abs16x16_xy2_c(UINT8 *blk1, UINT8 *blk2, int lx); 22 int pix_abs16x16_xy2_c(uint8_t *blk1, uint8_t *blk2, int lx);
23 23
24 typedef int motion_func(UINT8 *blk1, UINT8 *blk2, int lx); 24 typedef int motion_func(uint8_t *blk1, uint8_t *blk2, int lx);
25 25
26 #define WIDTH 64 26 #define WIDTH 64
27 #define HEIGHT 64 27 #define HEIGHT 64
28 28
29 UINT8 img1[WIDTH * HEIGHT]; 29 uint8_t img1[WIDTH * HEIGHT];
30 UINT8 img2[WIDTH * HEIGHT]; 30 uint8_t img2[WIDTH * HEIGHT];
31 31
32 void fill_random(UINT8 *tab, int size) 32 void fill_random(uint8_t *tab, int size)
33 { 33 {
34 int i; 34 int i;
35 for(i=0;i<size;i++) { 35 for(i=0;i<size;i++) {
36 #if 1 36 #if 1
37 tab[i] = random() % 256; 37 tab[i] = random() % 256;
46 printf("motion-test [-h]\n" 46 printf("motion-test [-h]\n"
47 "test motion implementations\n"); 47 "test motion implementations\n");
48 exit(1); 48 exit(1);
49 } 49 }
50 50
51 INT64 gettime(void) 51 int64_t gettime(void)
52 { 52 {
53 struct timeval tv; 53 struct timeval tv;
54 gettimeofday(&tv,NULL); 54 gettimeofday(&tv,NULL);
55 return (INT64)tv.tv_sec * 1000000 + tv.tv_usec; 55 return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
56 } 56 }
57 57
58 #define NB_ITS 500 58 #define NB_ITS 500
59 59
60 int dummy; 60 int dummy;
61 61
62 void test_motion(const char *name, 62 void test_motion(const char *name,
63 motion_func *test_func, motion_func *ref_func) 63 motion_func *test_func, motion_func *ref_func)
64 { 64 {
65 int x, y, d1, d2, it; 65 int x, y, d1, d2, it;
66 UINT8 *ptr; 66 uint8_t *ptr;
67 INT64 ti; 67 int64_t ti;
68 printf("testing '%s'\n", name); 68 printf("testing '%s'\n", name);
69 69
70 /* test correctness */ 70 /* test correctness */
71 for(it=0;it<20;it++) { 71 for(it=0;it<20;it++) {
72 72