Mercurial > libpostproc.hg
comparison postprocess.c @ 127:772a5a88c1bc libpostproc
configure: Add --enable-runtime-cpudetect
author | ramiro |
---|---|
date | Wed, 08 Apr 2009 20:26:18 +0000 |
parents | 1500ae6cf66c |
children | 1afabe715e63 |
comparison
equal
deleted
inserted
replaced
126:15664821cf1f | 127:772a5a88c1bc |
---|---|
552 }*/ | 552 }*/ |
553 } | 553 } |
554 | 554 |
555 //Note: we have C, MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one | 555 //Note: we have C, MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one |
556 //Plain C versions | 556 //Plain C versions |
557 #if !(HAVE_MMX || HAVE_ALTIVEC) || defined (RUNTIME_CPUDETECT) | 557 #if !(HAVE_MMX || HAVE_ALTIVEC) || CONFIG_RUNTIME_CPUDETECT |
558 #define COMPILE_C | 558 #define COMPILE_C |
559 #endif | 559 #endif |
560 | 560 |
561 #if HAVE_ALTIVEC | 561 #if HAVE_ALTIVEC |
562 #define COMPILE_ALTIVEC | 562 #define COMPILE_ALTIVEC |
563 #endif //HAVE_ALTIVEC | 563 #endif //HAVE_ALTIVEC |
564 | 564 |
565 #if ARCH_X86 | 565 #if ARCH_X86 |
566 | 566 |
567 #if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) | 567 #if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT |
568 #define COMPILE_MMX | 568 #define COMPILE_MMX |
569 #endif | 569 #endif |
570 | 570 |
571 #if HAVE_MMX2 || defined (RUNTIME_CPUDETECT) | 571 #if HAVE_MMX2 || CONFIG_RUNTIME_CPUDETECT |
572 #define COMPILE_MMX2 | 572 #define COMPILE_MMX2 |
573 #endif | 573 #endif |
574 | 574 |
575 #if (HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT) | 575 #if (HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT |
576 #define COMPILE_3DNOW | 576 #define COMPILE_3DNOW |
577 #endif | 577 #endif |
578 #endif /* ARCH_X86 */ | 578 #endif /* ARCH_X86 */ |
579 | 579 |
580 #undef HAVE_MMX | 580 #undef HAVE_MMX |
643 c->ppMode= *ppMode; //FIXME | 643 c->ppMode= *ppMode; //FIXME |
644 | 644 |
645 // Using ifs here as they are faster than function pointers although the | 645 // Using ifs here as they are faster than function pointers although the |
646 // difference would not be measurable here but it is much better because | 646 // difference would not be measurable here but it is much better because |
647 // someone might exchange the CPU whithout restarting MPlayer ;) | 647 // someone might exchange the CPU whithout restarting MPlayer ;) |
648 #ifdef RUNTIME_CPUDETECT | 648 #if CONFIG_RUNTIME_CPUDETECT |
649 #if ARCH_X86 | 649 #if ARCH_X86 |
650 // ordered per speed fastest first | 650 // ordered per speed fastest first |
651 if(c->cpuCaps & PP_CPU_CAPS_MMX2) | 651 if(c->cpuCaps & PP_CPU_CAPS_MMX2) |
652 postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); | 652 postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); |
653 else if(c->cpuCaps & PP_CPU_CAPS_3DNOW) | 653 else if(c->cpuCaps & PP_CPU_CAPS_3DNOW) |
662 postProcess_altivec(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); | 662 postProcess_altivec(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); |
663 else | 663 else |
664 #endif | 664 #endif |
665 postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); | 665 postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); |
666 #endif | 666 #endif |
667 #else //RUNTIME_CPUDETECT | 667 #else //CONFIG_RUNTIME_CPUDETECT |
668 #if HAVE_MMX2 | 668 #if HAVE_MMX2 |
669 postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); | 669 postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); |
670 #elif HAVE_AMD3DNOW | 670 #elif HAVE_AMD3DNOW |
671 postProcess_3DNow(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); | 671 postProcess_3DNow(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); |
672 #elif HAVE_MMX | 672 #elif HAVE_MMX |
674 #elif HAVE_ALTIVEC | 674 #elif HAVE_ALTIVEC |
675 postProcess_altivec(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); | 675 postProcess_altivec(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); |
676 #else | 676 #else |
677 postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); | 677 postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c); |
678 #endif | 678 #endif |
679 #endif //!RUNTIME_CPUDETECT | 679 #endif //!CONFIG_RUNTIME_CPUDETECT |
680 } | 680 } |
681 | 681 |
682 //static void postProcess(uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height, | 682 //static void postProcess(uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height, |
683 // QP_STORE_T QPs[], int QPStride, int isColor, struct PPMode *ppMode); | 683 // QP_STORE_T QPs[], int QPStride, int isColor, struct PPMode *ppMode); |
684 | 684 |