Mercurial > libavcodec.hg
comparison motion_test.c @ 644:641708b5c33c libavcodec
fixing tests
author | michaelni |
---|---|
date | Thu, 05 Sep 2002 08:48:34 +0000 |
parents | 718a22dc121f |
children | 0c32f81b42b2 |
comparison
equal
deleted
inserted
replaced
643:3db611caee55 | 644:641708b5c33c |
---|---|
8 | 8 |
9 #include "dsputil.h" | 9 #include "dsputil.h" |
10 | 10 |
11 #include "i386/mmx.h" | 11 #include "i386/mmx.h" |
12 | 12 |
13 int pix_abs16x16_mmx(UINT8 *blk1, UINT8 *blk2, int lx, int h); | 13 int pix_abs16x16_mmx(UINT8 *blk1, UINT8 *blk2, int lx); |
14 int pix_abs16x16_mmx1(UINT8 *blk1, UINT8 *blk2, int lx, int h); | 14 int pix_abs16x16_mmx1(UINT8 *blk1, UINT8 *blk2, int lx); |
15 int pix_abs16x16_x2_mmx(UINT8 *blk1, UINT8 *blk2, int lx, int h); | 15 int pix_abs16x16_x2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); |
16 int pix_abs16x16_x2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx, int h); | 16 int pix_abs16x16_x2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx); |
17 int pix_abs16x16_x2_c(UINT8 *blk1, UINT8 *blk2, int lx, int h); | 17 int pix_abs16x16_x2_c(UINT8 *blk1, UINT8 *blk2, int lx); |
18 int pix_abs16x16_y2_mmx(UINT8 *blk1, UINT8 *blk2, int lx, int h); | 18 int pix_abs16x16_y2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); |
19 int pix_abs16x16_y2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx, int h); | 19 int pix_abs16x16_y2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx); |
20 int pix_abs16x16_y2_c(UINT8 *blk1, UINT8 *blk2, int lx, int h); | 20 int pix_abs16x16_y2_c(UINT8 *blk1, UINT8 *blk2, int lx); |
21 int pix_abs16x16_xy2_mmx(UINT8 *blk1, UINT8 *blk2, int lx, int h); | 21 int pix_abs16x16_xy2_mmx(UINT8 *blk1, UINT8 *blk2, int lx); |
22 int pix_abs16x16_xy2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx, int h); | 22 int pix_abs16x16_xy2_mmx1(UINT8 *blk1, UINT8 *blk2, int lx); |
23 int pix_abs16x16_xy2_c(UINT8 *blk1, UINT8 *blk2, int lx, int h); | 23 int pix_abs16x16_xy2_c(UINT8 *blk1, UINT8 *blk2, int lx); |
24 | 24 |
25 typedef int motion_func(UINT8 *blk1, UINT8 *blk2, int lx, int h); | 25 typedef int motion_func(UINT8 *blk1, UINT8 *blk2, int lx); |
26 | 26 |
27 #define WIDTH 64 | 27 #define WIDTH 64 |
28 #define HEIGHT 64 | 28 #define HEIGHT 64 |
29 | 29 |
30 UINT8 img1[WIDTH * HEIGHT]; | 30 UINT8 img1[WIDTH * HEIGHT]; |
75 fill_random(img2, WIDTH * HEIGHT); | 75 fill_random(img2, WIDTH * HEIGHT); |
76 | 76 |
77 for(y=0;y<HEIGHT-17;y++) { | 77 for(y=0;y<HEIGHT-17;y++) { |
78 for(x=0;x<WIDTH-17;x++) { | 78 for(x=0;x<WIDTH-17;x++) { |
79 ptr = img2 + y * WIDTH + x; | 79 ptr = img2 + y * WIDTH + x; |
80 d1 = test_func(img1, ptr, WIDTH, 16); | 80 d1 = test_func(img1, ptr, WIDTH); |
81 d2 = ref_func(img1, ptr, WIDTH, 16); | 81 d2 = ref_func(img1, ptr, WIDTH); |
82 if (d1 != d2) { | 82 if (d1 != d2) { |
83 printf("error: mmx=%d c=%d\n", d1, d2); | 83 printf("error: mmx=%d c=%d\n", d1, d2); |
84 } | 84 } |
85 } | 85 } |
86 } | 86 } |
92 d1 = 0; | 92 d1 = 0; |
93 for(it=0;it<NB_ITS;it++) { | 93 for(it=0;it<NB_ITS;it++) { |
94 for(y=0;y<HEIGHT-17;y++) { | 94 for(y=0;y<HEIGHT-17;y++) { |
95 for(x=0;x<WIDTH-17;x++) { | 95 for(x=0;x<WIDTH-17;x++) { |
96 ptr = img2 + y * WIDTH + x; | 96 ptr = img2 + y * WIDTH + x; |
97 d1 += test_func(img1, ptr, WIDTH, 16); | 97 d1 += test_func(img1, ptr, WIDTH); |
98 } | 98 } |
99 } | 99 } |
100 } | 100 } |
101 emms(); | 101 emms(); |
102 dummy = d1; /* avoid optimisation */ | 102 dummy = d1; /* avoid optimisation */ |