comparison postproc/swscale.c @ 15523:92d2852a0f15

Should fix altivec detection for g3 system.
author nplourde
date Fri, 20 May 2005 12:08:31 +0000
parents 0deaa53ed5ad
children 4a1faa9c8f07
comparison
equal deleted inserted replaced
15522:7bd5a7fb8a75 15523:92d2852a0f15
731 #if !defined (HAVE_MMX) || defined (RUNTIME_CPUDETECT) 731 #if !defined (HAVE_MMX) || defined (RUNTIME_CPUDETECT)
732 #define COMPILE_C 732 #define COMPILE_C
733 #endif 733 #endif
734 734
735 #ifdef ARCH_POWERPC 735 #ifdef ARCH_POWERPC
736 #ifdef HAVE_ALTIVEC 736 #if defined (HAVE_ALTIVEC) || defined (RUNTIME_CPUDETECT)
737 #define COMPILE_ALTIVEC 737 #define COMPILE_ALTIVEC
738 #endif //HAVE_ALTIVEC 738 #endif //HAVE_ALTIVEC
739 #endif //ARCH_POWERPC 739 #endif //ARCH_POWERPC
740 740
741 #if defined(ARCH_X86) || defined(ARCH_X86_64) 741 #if defined(ARCH_X86) || defined(ARCH_X86_64)
1794 c->yOffset= roundToInt16(oy * 8) * 0x0001000100010001ULL; 1794 c->yOffset= roundToInt16(oy * 8) * 0x0001000100010001ULL;
1795 1795
1796 yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness, contrast, saturation); 1796 yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness, contrast, saturation);
1797 //FIXME factorize 1797 //FIXME factorize
1798 1798
1799 #ifdef HAVE_ALTIVEC 1799 #ifdef COMPILE_ALTIVEC
1800 yuv2rgb_altivec_init_tables (c, inv_table, brightness, contrast, saturation); 1800 if (c->flags & SWS_CPU_CAPS_ALTIVEC)
1801 yuv2rgb_altivec_init_tables (c, inv_table, brightness, contrast, saturation);
1801 #endif 1802 #endif
1802 return 0; 1803 return 0;
1803 } 1804 }
1804 1805
1805 /** 1806 /**
1984 else 1985 else
1985 c->swScale= PlanarToUyvyWrapper; 1986 c->swScale= PlanarToUyvyWrapper;
1986 } 1987 }
1987 } 1988 }
1988 1989
1989 #ifdef HAVE_ALTIVEC 1990 #ifdef COMPILE_ALTIVEC
1990 if ((c->flags & SWS_CPU_CAPS_ALTIVEC) && 1991 if ((c->flags & SWS_CPU_CAPS_ALTIVEC) &&
1991 ((srcFormat == IMGFMT_YV12 && 1992 ((srcFormat == IMGFMT_YV12 &&
1992 (dstFormat == IMGFMT_YUY2 || dstFormat == IMGFMT_UYVY)))) { 1993 (dstFormat == IMGFMT_YUY2 || dstFormat == IMGFMT_UYVY)))) {
1993 // unscaled YV12 -> packed YUV, we want speed 1994 // unscaled YV12 -> packed YUV, we want speed
1994 if (dstFormat == IMGFMT_YUY2) 1995 if (dstFormat == IMGFMT_YUY2)