mmxtest.c
来自「MPEG-4编解码的实现(包括MPEG4视音频编解码)」· C语言 代码 · 共 45 行
C
45 行
#include "../mpeg3private.inc"
#include <stdio.h>
#include <string.h>
int mpeg3_mmx_test()
{
int result = 0;
FILE *proc;
char string[MPEG3_STRLEN];
#ifdef HAVE_MMX
if(!(proc = fopen(MPEG3_PROC_CPUINFO, "r")))
{
fprintf(stderr, "mpeg3_mmx_test: failed to open /proc/cpuinfo\n");
return 0;
}
while(!feof(proc))
{
fgets(string, MPEG3_STRLEN, proc);
/* Got the flags line */
if(!strncasecmp(string, "flags", 5))
{
char *needle;
needle = strstr(string, "mmx");
if(!needle)
{
fclose(proc);
return 0;
}
if(!strncasecmp(needle, "mmx", 3))
{
fclose(proc);
return 1;
}
}
}
fclose(proc);
#endif
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?