History

dct-test: use emms_c() from libavutil instead of duplicating it

Mans Rullgard committed 14 years ago

Commit db7d8fb1 parent f1f37c71 file · +3 −11Browse files

Unified · Split

libavcodec/dct-test.c+3−11
@@ -181,14 +181,6 @@ static void idct_mmx_init(void) · 180 unmodified lines
181DECLARE_ALIGNED(16, static DCTELEM, block)[64];181DECLARE_ALIGNED(16, static DCTELEM, block)[64];
182DECLARE_ALIGNED(8, static DCTELEM, block1)[64];182DECLARE_ALIGNED(8, static DCTELEM, block1)[64];
183 183
184static inline void mmx_emms(void)
185{
186#if HAVE_MMX
187 if (cpu_flags & AV_CPU_FLAG_MMX)
188 __asm__ volatile ("emms\n\t");
189#endif
190}
191
192static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng)184static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng)
193{185{
194 int i, j;186 int i, j;
@@ -263,7 +255,7 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed) · 68 unmodified lines
263 permute(block, block1, dct->format);255 permute(block, block1, dct->format);
264 256
265 dct->func(block);257 dct->func(block);
266 mmx_emms();258 emms_c();
267 259
268 if (dct->format == SCALE_PERM) {260 if (dct->format == SCALE_PERM) {
269 for (i = 0; i < 64; i++) {261 for (i = 0; i < 64; i++) {
@@ -330,7 +322,7 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed) · 60 unmodified lines
330 it1 += NB_ITS_SPEED;322 it1 += NB_ITS_SPEED;
331 ti1 = gettime() - ti;323 ti1 = gettime() - ti;
332 } while (ti1 < 1000000);324 } while (ti1 < 1000000);
333 mmx_emms();325 emms_c();
334 326
335 printf("%s %s: %0.1f kdct/s\n", is_idct ? "IDCT" : "DCT", dct->name,327 printf("%s %s: %0.1f kdct/s\n", is_idct ? "IDCT" : "DCT", dct->name,
336 (double) it1 * 1000.0 / (double) ti1);328 (double) it1 * 1000.0 / (double) ti1);
@@ -472,7 +464,7 @@ static void idct248_error(const char *name, · 135 unmodified lines
472 it1 += NB_ITS_SPEED;464 it1 += NB_ITS_SPEED;
473 ti1 = gettime() - ti;465 ti1 = gettime() - ti;
474 } while (ti1 < 1000000);466 } while (ti1 < 1000000);
475 mmx_emms();467 emms_c();
476 468
477 printf("%s %s: %0.1f kdct/s\n", 1 ? "IDCT248" : "DCT248", name,469 printf("%s %s: %0.1f kdct/s\n", 1 ? "IDCT248" : "DCT248", name,
478 (double) it1 * 1000.0 / (double) ti1);470 (double) it1 * 1000.0 / (double) ti1);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t