diff options
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale.c | 4 | ||||
-rw-r--r-- | libswscale/swscale.h | 3 | ||||
-rw-r--r-- | libswscale/utils.c | 12 | ||||
-rw-r--r-- | libswscale/version.h | 2 | ||||
-rw-r--r-- | libswscale/x86/rgb2rgb.c | 12 | ||||
-rw-r--r-- | libswscale/x86/rgb2rgb_template.c | 18 | ||||
-rw-r--r-- | libswscale/x86/swscale.c | 16 | ||||
-rw-r--r-- | libswscale/x86/swscale_template.c | 20 | ||||
-rw-r--r-- | libswscale/x86/yuv2rgb.c | 16 | ||||
-rw-r--r-- | libswscale/x86/yuv2rgb_template.c | 12 |
10 files changed, 59 insertions, 56 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 5a28ce1d58..ae79eb66e8 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -663,8 +663,8 @@ static int swScale(SwsContext *c, const uint8_t *src[], if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) fillPlane(dst[3], dstStride[3], dstW, dstY - lastDstY, lastDstY, 255); -#if HAVE_MMX2 && HAVE_INLINE_ASM - if (av_get_cpu_flags() & AV_CPU_FLAG_MMX2) +#if HAVE_MMXEXT && HAVE_INLINE_ASM + if (av_get_cpu_flags() & AV_CPU_FLAG_MMXEXT) __asm__ volatile ("sfence" ::: "memory"); #endif emms_c(); diff --git a/libswscale/swscale.h b/libswscale/swscale.h index ba781803dd..da29d47e3a 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -82,7 +82,10 @@ const char *swscale_license(void); * are only provided for API compatibility. */ #define SWS_CPU_CAPS_MMX 0x80000000 +#define SWS_CPU_CAPS_MMXEXT 0x20000000 +#if LIBSWSCALE_VERSION_MAJOR < 3 #define SWS_CPU_CAPS_MMX2 0x20000000 +#endif #define SWS_CPU_CAPS_3DNOW 0x40000000 #define SWS_CPU_CAPS_ALTIVEC 0x10000000 #define SWS_CPU_CAPS_BFIN 0x01000000 diff --git a/libswscale/utils.c b/libswscale/utils.c index f4d3546845..2e387b52eb 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -599,7 +599,7 @@ fail: return ret; } -#if HAVE_MMX2 && HAVE_INLINE_ASM +#if HAVE_MMXEXT && HAVE_INLINE_ASM static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode, int16_t *filter, int32_t *filterPos, int numSplits) { @@ -762,7 +762,7 @@ static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode, return fragmentPos + 1; } -#endif /* HAVE_MMX2 && HAVE_INLINE_ASM */ +#endif /* HAVE_MMXEXT && HAVE_INLINE_ASM */ static void getSubSampleFactors(int *h, int *v, enum PixelFormat format) { @@ -1024,7 +1024,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, c->srcBpc = 16; if (c->dstBpc == 16) dst_stride <<= 1; - if (HAVE_MMX2 && HAVE_INLINE_ASM && cpu_flags & AV_CPU_FLAG_MMX2 && + if (HAVE_MMXEXT && HAVE_INLINE_ASM && cpu_flags & AV_CPU_FLAG_MMXEXT && c->srcBpc == 8 && c->dstBpc <= 14) { c->canMMX2BeUsed = (dstW >= srcW && (dstW & 31) == 0 && (srcW & 15) == 0) ? 1 : 0; @@ -1063,7 +1063,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, /* precalculate horizontal scaler filter coefficients */ { -#if HAVE_MMX2 && HAVE_INLINE_ASM +#if HAVE_MMXEXT && HAVE_INLINE_ASM // can't downscale !!! if (c->canMMX2BeUsed && (flags & SWS_FAST_BILINEAR)) { c->lumMmx2FilterCodeSize = initMMX2HScaler(dstW, c->lumXInc, NULL, @@ -1107,7 +1107,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, mprotect(c->chrMmx2FilterCode, c->chrMmx2FilterCodeSize, PROT_EXEC | PROT_READ); #endif } else -#endif /* HAVE_MMX2 && HAVE_INLINE_ASM */ +#endif /* HAVE_MMXEXT && HAVE_INLINE_ASM */ { const int filterAlign = (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX) ? 4 : @@ -1273,7 +1273,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, #endif av_get_pix_fmt_name(dstFormat)); - if (HAVE_MMX2 && cpu_flags & AV_CPU_FLAG_MMX2) + if (HAVE_MMXEXT && cpu_flags & AV_CPU_FLAG_MMXEXT) av_log(c, AV_LOG_INFO, "using MMX2\n"); else if (HAVE_AMD3DNOW && cpu_flags & AV_CPU_FLAG_3DNOW) av_log(c, AV_LOG_INFO, "using 3DNOW\n"); diff --git a/libswscale/version.h b/libswscale/version.h index ef0e0298f6..37dcc96572 100644 --- a/libswscale/version.h +++ b/libswscale/version.h @@ -28,7 +28,7 @@ #define LIBSWSCALE_VERSION_MAJOR 2 #define LIBSWSCALE_VERSION_MINOR 1 -#define LIBSWSCALE_VERSION_MICRO 100 +#define LIBSWSCALE_VERSION_MICRO 101 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ LIBSWSCALE_VERSION_MINOR, \ diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c index cd46df719d..9e4938a81a 100644 --- a/libswscale/x86/rgb2rgb.c +++ b/libswscale/x86/rgb2rgb.c @@ -88,7 +88,7 @@ DECLARE_ASM_CONST(8, uint64_t, mul16_mid) = 0x2080208020802080ULL; //Note: We have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW + MMX2 one. -#define COMPILE_TEMPLATE_MMX2 0 +#define COMPILE_TEMPLATE_MMXEXT 0 #define COMPILE_TEMPLATE_AMD3DNOW 0 #define COMPILE_TEMPLATE_SSE2 0 @@ -99,8 +99,8 @@ DECLARE_ASM_CONST(8, uint64_t, mul16_mid) = 0x2080208020802080ULL; //MMX2 versions #undef RENAME -#undef COMPILE_TEMPLATE_MMX2 -#define COMPILE_TEMPLATE_MMX2 1 +#undef COMPILE_TEMPLATE_MMXEXT +#define COMPILE_TEMPLATE_MMXEXT 1 #define RENAME(a) a ## _MMX2 #include "rgb2rgb_template.c" @@ -113,10 +113,10 @@ DECLARE_ASM_CONST(8, uint64_t, mul16_mid) = 0x2080208020802080ULL; //3DNOW versions #undef RENAME -#undef COMPILE_TEMPLATE_MMX2 +#undef COMPILE_TEMPLATE_MMXEXT #undef COMPILE_TEMPLATE_SSE2 #undef COMPILE_TEMPLATE_AMD3DNOW -#define COMPILE_TEMPLATE_MMX2 0 +#define COMPILE_TEMPLATE_MMXEXT 0 #define COMPILE_TEMPLATE_SSE2 0 #define COMPILE_TEMPLATE_AMD3DNOW 1 #define RENAME(a) a ## _3DNOW @@ -140,7 +140,7 @@ av_cold void rgb2rgb_init_x86(void) rgb2rgb_init_MMX(); if (HAVE_AMD3DNOW && cpu_flags & AV_CPU_FLAG_3DNOW) rgb2rgb_init_3DNOW(); - if (HAVE_MMX2 && cpu_flags & AV_CPU_FLAG_MMX2) + if (HAVE_MMXEXT && cpu_flags & AV_CPU_FLAG_MMXEXT) rgb2rgb_init_MMX2(); if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2) rgb2rgb_init_SSE2(); diff --git a/libswscale/x86/rgb2rgb_template.c b/libswscale/x86/rgb2rgb_template.c index bb97a0b4a1..594524d9ed 100644 --- a/libswscale/x86/rgb2rgb_template.c +++ b/libswscale/x86/rgb2rgb_template.c @@ -35,7 +35,7 @@ #if COMPILE_TEMPLATE_AMD3DNOW #define PREFETCH "prefetch" #define PAVGB "pavgusb" -#elif COMPILE_TEMPLATE_MMX2 +#elif COMPILE_TEMPLATE_MMXEXT #define PREFETCH "prefetchnta" #define PAVGB "pavgb" #else @@ -49,7 +49,7 @@ #define EMMS "emms" #endif -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT #define MOVNTQ "movntq" #define SFENCE "sfence" #else @@ -1136,7 +1136,7 @@ static inline void RENAME(shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, PREFETCH" 32(%1, %0) \n\t" "movq (%1, %0), %%mm0 \n\t" "movq 8(%1, %0), %%mm1 \n\t" -# if COMPILE_TEMPLATE_MMX2 +# if COMPILE_TEMPLATE_MMXEXT "pshufw $177, %%mm0, %%mm3 \n\t" "pshufw $177, %%mm1, %%mm5 \n\t" "pand %%mm7, %%mm0 \n\t" @@ -1500,7 +1500,7 @@ static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t } #endif /* !COMPILE_TEMPLATE_AMD3DNOW */ -#if COMPILE_TEMPLATE_MMX2 || COMPILE_TEMPLATE_AMD3DNOW +#if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWidth, int srcHeight, int srcStride, int dstStride) { int x,y; @@ -1590,7 +1590,7 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWid SFENCE" \n\t" :::"memory"); } -#endif /* COMPILE_TEMPLATE_MMX2 || COMPILE_TEMPLATE_AMD3DNOW */ +#endif /* COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW */ #if !COMPILE_TEMPLATE_AMD3DNOW /** @@ -1798,7 +1798,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ "1: \n\t" PREFETCH" 64(%0, %%"REG_d") \n\t" PREFETCH" 64(%1, %%"REG_d") \n\t" -#if COMPILE_TEMPLATE_MMX2 || COMPILE_TEMPLATE_AMD3DNOW +#if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW "movq (%0, %%"REG_d"), %%mm0 \n\t" "movq (%1, %%"REG_d"), %%mm1 \n\t" "movq 6(%0, %%"REG_d"), %%mm2 \n\t" @@ -1859,7 +1859,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ "packssdw %%mm1, %%mm0 \n\t" // V1 V0 U1 U0 "psraw $7, %%mm0 \n\t" -#if COMPILE_TEMPLATE_MMX2 || COMPILE_TEMPLATE_AMD3DNOW +#if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW "movq 12(%0, %%"REG_d"), %%mm4 \n\t" "movq 12(%1, %%"REG_d"), %%mm1 \n\t" "movq 18(%0, %%"REG_d"), %%mm2 \n\t" @@ -2580,9 +2580,9 @@ static inline void RENAME(rgb2rgb_init)(void) yuyvtoyuv422 = RENAME(yuyvtoyuv422); #endif /* !COMPILE_TEMPLATE_SSE2 */ -#if COMPILE_TEMPLATE_MMX2 || COMPILE_TEMPLATE_AMD3DNOW +#if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW planar2x = RENAME(planar2x); -#endif /* COMPILE_TEMPLATE_MMX2 || COMPILE_TEMPLATE_AMD3DNOW */ +#endif /* COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW */ rgb24toyv12 = RENAME(rgb24toyv12); yuyvtoyuv420 = RENAME(yuyvtoyuv420); diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index eb33788168..132ec3e570 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -74,16 +74,16 @@ DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL; //MMX versions #if HAVE_MMX #undef RENAME -#define COMPILE_TEMPLATE_MMX2 0 +#define COMPILE_TEMPLATE_MMXEXT 0 #define RENAME(a) a ## _MMX #include "swscale_template.c" #endif //MMX2 versions -#if HAVE_MMX2 +#if HAVE_MMXEXT #undef RENAME -#undef COMPILE_TEMPLATE_MMX2 -#define COMPILE_TEMPLATE_MMX2 1 +#undef COMPILE_TEMPLATE_MMXEXT +#define COMPILE_TEMPLATE_MMXEXT 1 #define RENAME(a) a ## _MMX2 #include "swscale_template.c" #endif @@ -375,8 +375,8 @@ av_cold void ff_sws_init_swScale_mmx(SwsContext *c) #if HAVE_INLINE_ASM if (cpu_flags & AV_CPU_FLAG_MMX) sws_init_swScale_MMX(c); -#if HAVE_MMX2 - if (cpu_flags & AV_CPU_FLAG_MMX2) +#if HAVE_MMXEXT + if (cpu_flags & AV_CPU_FLAG_MMXEXT) sws_init_swScale_MMX2(c); if (cpu_flags & AV_CPU_FLAG_SSE3){ if(c->use_mmx_vfilter && !(c->flags & SWS_ACCURATE_RND)) @@ -439,7 +439,7 @@ switch(c->dstBpc){ \ if (cpu_flags & AV_CPU_FLAG_MMX) { ASSIGN_MMX_SCALE_FUNC(c->hyScale, c->hLumFilterSize, mmx, mmx); ASSIGN_MMX_SCALE_FUNC(c->hcScale, c->hChrFilterSize, mmx, mmx); - ASSIGN_VSCALE_FUNC(c->yuv2plane1, mmx, mmx2, cpu_flags & AV_CPU_FLAG_MMX2); + ASSIGN_VSCALE_FUNC(c->yuv2plane1, mmx, mmx2, cpu_flags & AV_CPU_FLAG_MMXEXT); switch (c->srcFormat) { case PIX_FMT_Y400A: @@ -471,7 +471,7 @@ switch(c->dstBpc){ \ break; } } - if (cpu_flags & AV_CPU_FLAG_MMX2) { + if (cpu_flags & AV_CPU_FLAG_MMXEXT) { ASSIGN_VSCALEX_FUNC(c->yuv2planeX, mmx2, , 1); } #endif diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c index 245bfdeadd..370a0ebe1b 100644 --- a/libswscale/x86/swscale_template.c +++ b/libswscale/x86/swscale_template.c @@ -23,13 +23,13 @@ #undef MOVNTQ2 #undef PREFETCH -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT #define PREFETCH "prefetchnta" #else #define PREFETCH " # nop" #endif -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT #define REAL_MOVNTQ(a,b) "movntq " #a ", " #b " \n\t" #define MOVNTQ2 "movntq " #else @@ -38,7 +38,7 @@ #endif #define MOVNTQ(a,b) REAL_MOVNTQ(a,b) -#if !COMPILE_TEMPLATE_MMX2 +#if !COMPILE_TEMPLATE_MMXEXT static av_always_inline void dither_8to16(const uint8_t *srcDither, int rot) { @@ -641,7 +641,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter, "cmp "#dstw", "#index" \n\t"\ " jb 1b \n\t" -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT #undef WRITEBGR24 #define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX2(dst, dstw, index) #else @@ -1445,7 +1445,7 @@ static void RENAME(yuv2yuyv422_1)(SwsContext *c, const int16_t *buf0, } } -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, int dstWidth, const uint8_t *src, int srcW, int xInc) @@ -1627,7 +1627,7 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2, dst2[i] = src2[srcW-1]*128; } } -#endif /* COMPILE_TEMPLATE_MMX2 */ +#endif /* COMPILE_TEMPLATE_MMXEXT */ static av_cold void RENAME(sws_init_swScale)(SwsContext *c) { @@ -1691,17 +1691,17 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c) if (c->srcBpc == 8 && c->dstBpc <= 14) { // Use the new MMX scaler if the MMX2 one can't be used (it is faster than the x86 ASM one). -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT if (c->flags & SWS_FAST_BILINEAR && c->canMMX2BeUsed) { c->hyscale_fast = RENAME(hyscale_fast); c->hcscale_fast = RENAME(hcscale_fast); } else { -#endif /* COMPILE_TEMPLATE_MMX2 */ +#endif /* COMPILE_TEMPLATE_MMXEXT */ c->hyscale_fast = NULL; c->hcscale_fast = NULL; -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT } -#endif /* COMPILE_TEMPLATE_MMX2 */ +#endif /* COMPILE_TEMPLATE_MMXEXT */ } } diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c index 2a76716335..8cb7f1ae0d 100644 --- a/libswscale/x86/yuv2rgb.c +++ b/libswscale/x86/yuv2rgb.c @@ -52,20 +52,20 @@ DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL; //MMX versions #if HAVE_MMX #undef RENAME -#undef COMPILE_TEMPLATE_MMX2 -#define COMPILE_TEMPLATE_MMX2 0 +#undef COMPILE_TEMPLATE_MMXEXT +#define COMPILE_TEMPLATE_MMXEXT 0 #define RENAME(a) a ## _MMX #include "yuv2rgb_template.c" #endif /* HAVE_MMX */ //MMX2 versions -#if HAVE_MMX2 +#if HAVE_MMXEXT #undef RENAME -#undef COMPILE_TEMPLATE_MMX2 -#define COMPILE_TEMPLATE_MMX2 1 +#undef COMPILE_TEMPLATE_MMXEXT +#define COMPILE_TEMPLATE_MMXEXT 1 #define RENAME(a) a ## _MMX2 #include "yuv2rgb_template.c" -#endif /* HAVE_MMX2 */ +#endif /* HAVE_MMXEXT */ #endif /* HAVE_INLINE_ASM */ @@ -74,8 +74,8 @@ av_cold SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c) #if HAVE_INLINE_ASM int cpu_flags = av_get_cpu_flags(); -#if HAVE_MMX2 - if (cpu_flags & AV_CPU_FLAG_MMX2) { +#if HAVE_MMXEXT + if (cpu_flags & AV_CPU_FLAG_MMXEXT) { switch (c->dstFormat) { case PIX_FMT_RGB24: return yuv420_rgb24_MMX2; case PIX_FMT_BGR24: return yuv420_bgr24_MMX2; diff --git a/libswscale/x86/yuv2rgb_template.c b/libswscale/x86/yuv2rgb_template.c index 624de14252..79e48fd7f0 100644 --- a/libswscale/x86/yuv2rgb_template.c +++ b/libswscale/x86/yuv2rgb_template.c @@ -25,7 +25,7 @@ #undef EMMS #undef SFENCE -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT #define MOVNTQ "movntq" #define SFENCE "sfence" #else @@ -181,7 +181,7 @@ "paddusb "GREEN_DITHER"(%4), %%mm2\n\t" \ "paddusb "RED_DITHER"(%4), %%mm1\n\t" \ -#if !COMPILE_TEMPLATE_MMX2 +#if !COMPILE_TEMPLATE_MMXEXT static inline int RENAME(yuv420_rgb15)(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, @@ -237,7 +237,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, const uint8_t *src[], YUV2RGB_OPERANDS YUV2RGB_ENDFUNC } -#endif /* !COMPILE_TEMPLATE_MMX2 */ +#endif /* !COMPILE_TEMPLATE_MMXEXT */ #define RGB_PACK24(blue, red)\ "packuswb %%mm3, %%mm0 \n" /* R0 R2 R4 R6 R1 R3 R5 R7 */\ @@ -254,7 +254,7 @@ static inline int RENAME(yuv420_rgb16)(SwsContext *c, const uint8_t *src[], "punpckhwd %%mm6, %%mm5 \n" /* R4 G4 B4 R5 R6 G6 B6 R7 */\ RGB_PACK24_B -#if COMPILE_TEMPLATE_MMX2 +#if COMPILE_TEMPLATE_MMXEXT DECLARE_ASM_CONST(8, int16_t, mask1101[4]) = {-1,-1, 0,-1}; DECLARE_ASM_CONST(8, int16_t, mask0010[4]) = { 0, 0,-1, 0}; DECLARE_ASM_CONST(8, int16_t, mask0110[4]) = { 0,-1,-1, 0}; @@ -361,7 +361,7 @@ static inline int RENAME(yuv420_bgr24)(SwsContext *c, const uint8_t *src[], MOVNTQ " %%mm5, 16(%1)\n\t" \ MOVNTQ " %%mm"alpha", 24(%1)\n\t" \ -#if !COMPILE_TEMPLATE_MMX2 +#if !COMPILE_TEMPLATE_MMXEXT static inline int RENAME(yuv420_rgb32)(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, @@ -448,4 +448,4 @@ static inline int RENAME(yuva420_bgr32)(SwsContext *c, const uint8_t *src[], } #endif -#endif /* !COMPILE_TEMPLATE_MMX2 */ +#endif /* !COMPILE_TEMPLATE_MMXEXT */ |