X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Flibzmpeg3%2Fvideo%2Fmmxtest.C;fp=cinelerra-5.1%2Flibzmpeg3%2Fvideo%2Fmmxtest.C;h=67a4705d4805ae8c5e5d1e5b0d9ff0cf9a943222;hb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;hp=0000000000000000000000000000000000000000;hpb=52fcc46226f9df46f9ce9d0566dc568455a7db0b;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/libzmpeg3/video/mmxtest.C b/cinelerra-5.1/libzmpeg3/video/mmxtest.C new file mode 100644 index 00000000..67a4705d --- /dev/null +++ b/cinelerra-5.1/libzmpeg3/video/mmxtest.C @@ -0,0 +1,26 @@ +#include "../libzmpeg3.h" + +int mpeg3_mmx_test() +{ + int result = 0; +#ifdef HAVE_MMX + FILE *proc; + char string[zmpeg3_t::STRLEN]; + + if(!(proc = fopen(zmpeg3_t::PROC_CPUINFO, "r"))) { + perrs("%s",zmpeg3_t::PROC_CPUINFO); + return 0; + } + + while( !feof(proc) && fgets(string, sizeof(string), proc) ) { + /* Get the flags line */ + if(!strncasecmp(string, "flags", 5)) { + result = !strstr(string, "mmx") ? 0 : 1; + break; + } + } + fclose(proc); +#endif + return result; +} +