comparison dct-test.c @ 9295:b225f51903af libavcodec

Mark non-exported functions in test and example programs as static.
author diego
date Tue, 31 Mar 2009 09:32:59 +0000
parents dc9005dec909
children 2313bf51945b
comparison
equal deleted inserted replaced
9294:bf264662cd6b 9295:b225f51903af
148 148
149 #define AANSCALE_BITS 12 149 #define AANSCALE_BITS 12
150 150
151 uint8_t cropTbl[256 + 2 * MAX_NEG_CROP]; 151 uint8_t cropTbl[256 + 2 * MAX_NEG_CROP];
152 152
153 int64_t gettime(void) 153 static int64_t gettime(void)
154 { 154 {
155 struct timeval tv; 155 struct timeval tv;
156 gettimeofday(&tv,NULL); 156 gettimeofday(&tv,NULL);
157 return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec; 157 return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
158 } 158 }
173 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F, 173 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F,
174 }; 174 };
175 175
176 static const uint8_t idct_sse2_row_perm[8] = {0, 4, 1, 5, 2, 6, 3, 7}; 176 static const uint8_t idct_sse2_row_perm[8] = {0, 4, 1, 5, 2, 6, 3, 7};
177 177
178 void idct_mmx_init(void) 178 static void idct_mmx_init(void)
179 { 179 {
180 int i; 180 int i;
181 181
182 /* the mmx/mmxext idct uses a reordered input, so we patch scan tables */ 182 /* the mmx/mmxext idct uses a reordered input, so we patch scan tables */
183 for (i = 0; i < 64; i++) { 183 for (i = 0; i < 64; i++) {
196 if (cpu_flags & FF_MM_MMX) 196 if (cpu_flags & FF_MM_MMX)
197 __asm__ volatile ("emms\n\t"); 197 __asm__ volatile ("emms\n\t");
198 #endif 198 #endif
199 } 199 }
200 200
201 void dct_error(const char *name, int is_idct, 201 static void dct_error(const char *name, int is_idct,
202 void (*fdct_func)(DCTELEM *block), 202 void (*fdct_func)(DCTELEM *block),
203 void (*fdct_ref)(DCTELEM *block), int form, int test) 203 void (*fdct_ref)(DCTELEM *block), int form, int test)
204 { 204 {
205 int it, i, scale; 205 int it, i, scale;
206 int err_inf, v; 206 int err_inf, v;
385 } 385 }
386 386
387 static uint8_t img_dest[64] __attribute__ ((aligned (8))); 387 static uint8_t img_dest[64] __attribute__ ((aligned (8)));
388 static uint8_t img_dest1[64] __attribute__ ((aligned (8))); 388 static uint8_t img_dest1[64] __attribute__ ((aligned (8)));
389 389
390 void idct248_ref(uint8_t *dest, int linesize, int16_t *block) 390 static void idct248_ref(uint8_t *dest, int linesize, int16_t *block)
391 { 391 {
392 static int init; 392 static int init;
393 static double c8[8][8]; 393 static double c8[8][8];
394 static double c4[4][4]; 394 static double c4[4][4];
395 double block1[64], block2[64], block3[64]; 395 double block1[64], block2[64], block3[64];
465 dest[i * linesize + j] = (int)rint(v); 465 dest[i * linesize + j] = (int)rint(v);
466 } 466 }
467 } 467 }
468 } 468 }
469 469
470 void idct248_error(const char *name, 470 static void idct248_error(const char *name,
471 void (*idct248_put)(uint8_t *dest, int line_size, int16_t *block)) 471 void (*idct248_put)(uint8_t *dest, int line_size, int16_t *block))
472 { 472 {
473 int it, i, it1, ti, ti1, err_max, v; 473 int it, i, it1, ti, ti1, err_max, v;
474 474
475 AVLFG prn; 475 AVLFG prn;
543 printf("%s %s: %0.1f kdct/s\n", 543 printf("%s %s: %0.1f kdct/s\n",
544 1 ? "IDCT248" : "DCT248", 544 1 ? "IDCT248" : "DCT248",
545 name, (double)it1 * 1000.0 / (double)ti1); 545 name, (double)it1 * 1000.0 / (double)ti1);
546 } 546 }
547 547
548 void help(void) 548 static void help(void)
549 { 549 {
550 printf("dct-test [-i] [<test-number>]\n" 550 printf("dct-test [-i] [<test-number>]\n"
551 "test-number 0 -> test with random matrixes\n" 551 "test-number 0 -> test with random matrixes\n"
552 " 1 -> test with random sparse matrixes\n" 552 " 1 -> test with random sparse matrixes\n"
553 " 2 -> do 3. test from mpeg4 std\n" 553 " 2 -> do 3. test from mpeg4 std\n"