r123: Merged HEAD and TEST. New stuff shall be committed to HEAD from now on.
[cinelerra_cv/mob.git] / libmpeg3 / video / mmxtest.c
blobdc531c5d08d9d828fc8e3ff00367bf07bdfa8ac1
1 #include "mpeg3private.h"
2 #include "mpeg3protos.h"
4 #include <stdio.h>
5 #include <string.h>
7 int mpeg3_mmx_test()
9 int result = 0;
10 FILE *proc;
11 char string[MPEG3_STRLEN];
14 #ifdef HAVE_MMX
15 if(!(proc = fopen(MPEG3_PROC_CPUINFO, "r")))
17 fprintf(stderr, "mpeg3_mmx_test: failed to open /proc/cpuinfo\n");
18 return 0;
21 while(!feof(proc))
23 fgets(string, MPEG3_STRLEN, proc);
24 /* Got the flags line */
25 if(!strncasecmp(string, "flags", 5))
27 char *needle;
28 needle = strstr(string, "mmx");
29 if(!needle)
31 fclose(proc);
32 return 0;
34 if(!strncasecmp(needle, "mmx", 3))
36 fclose(proc);
37 return 1;
41 fclose(proc);
42 #endif
44 return 0;