diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-01 12:53:19 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-01 13:11:51 +0100 |
commit | add7513e64e6db255e30fba544068ed2ab5e7b3e (patch) | |
tree | 59bf00c7b1d6f75c5bc034500e3669cb76462396 /libswscale | |
parent | 14f1fa56b2aef1f4b2036ebdc7c6665ef68052c0 (diff) | |
parent | fa8fcab1e0d31074c0644c4ac5194474c6c26415 (diff) | |
download | ffmpeg-add7513e64e6db255e30fba544068ed2ab5e7b3e.tar.gz |
Merge commit 'fa8fcab1e0d31074c0644c4ac5194474c6c26415'
* commit 'fa8fcab1e0d31074c0644c4ac5194474c6c26415':
x86: h264_chromamc_10bit: drop pointless PAVG %define
x86: mmx2 ---> mmxext in function names
swscale: do not forget to swap data in formats with different endianness
Conflicts:
libavcodec/x86/dsputil_mmx.c
libavfilter/x86/gradfun.c
libswscale/input.c
libswscale/utils.c
libswscale/x86/swscale.c
tests/ref/lavfi/pixfmts_scale
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/input.c | 12 | ||||
-rw-r--r-- | libswscale/utils.c | 21 | ||||
-rw-r--r-- | libswscale/x86/rgb2rgb.c | 4 | ||||
-rw-r--r-- | libswscale/x86/swscale.c | 6 | ||||
-rw-r--r-- | libswscale/x86/yuv2rgb.c | 8 |
5 files changed, 30 insertions, 21 deletions
diff --git a/libswscale/input.c b/libswscale/input.c index 43a67aac90..d3aeb22151 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -935,6 +935,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_YUV420P14LE: case AV_PIX_FMT_YUV420P16LE: case AV_PIX_FMT_YUV422P16LE: + case AV_PIX_FMT_YUV444P16LE: case AV_PIX_FMT_YUVA444P9LE: case AV_PIX_FMT_YUVA422P9LE: @@ -945,7 +946,6 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_YUVA420P16LE: case AV_PIX_FMT_YUVA422P16LE: case AV_PIX_FMT_YUVA444P16LE: - case AV_PIX_FMT_YUV444P16LE: c->chrToYV12 = bswap16UV_c; break; #else @@ -1186,6 +1186,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_YUV422P16LE: case AV_PIX_FMT_YUV444P16LE: + case AV_PIX_FMT_GRAY16LE: + c->lumToYV12 = bswap16Y_c; + break; case AV_PIX_FMT_YUVA444P9LE: case AV_PIX_FMT_YUVA422P9LE: case AV_PIX_FMT_YUVA420P9LE: @@ -1195,8 +1198,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_YUVA420P16LE: case AV_PIX_FMT_YUVA422P16LE: case AV_PIX_FMT_YUVA444P16LE: - case AV_PIX_FMT_GRAY16LE: c->lumToYV12 = bswap16Y_c; + c->alpToYV12 = bswap16Y_c; break; #else case AV_PIX_FMT_YUV444P9BE: @@ -1215,6 +1218,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_YUV422P16BE: case AV_PIX_FMT_YUV444P16BE: + case AV_PIX_FMT_GRAY16BE: + c->lumToYV12 = bswap16Y_c; + break; case AV_PIX_FMT_YUVA444P9BE: case AV_PIX_FMT_YUVA422P9BE: case AV_PIX_FMT_YUVA420P9BE: @@ -1224,8 +1230,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_YUVA420P16BE: case AV_PIX_FMT_YUVA422P16BE: case AV_PIX_FMT_YUVA444P16BE: - case AV_PIX_FMT_GRAY16BE: c->lumToYV12 = bswap16Y_c; + c->alpToYV12 = bswap16Y_c; break; #endif case AV_PIX_FMT_YUYV422: diff --git a/libswscale/utils.c b/libswscale/utils.c index f0f8a91b8f..7761441fcf 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -627,8 +627,9 @@ fail: } #if HAVE_MMXEXT_INLINE -static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode, - int16_t *filter, int32_t *filterPos, int numSplits) +static int init_hscaler_mmxext(int dstW, int xInc, uint8_t *filterCode, + int16_t *filter, int32_t *filterPos, + int numSplits) { uint8_t *fragmentA; x86_reg imm8OfPShufW1A; @@ -1107,10 +1108,10 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, #if HAVE_MMXEXT_INLINE // can't downscale !!! if (c->canMMXEXTBeUsed && (flags & SWS_FAST_BILINEAR)) { - c->lumMmxextFilterCodeSize = initMMX2HScaler(dstW, c->lumXInc, NULL, - NULL, NULL, 8); - c->chrMmxextFilterCodeSize = initMMX2HScaler(c->chrDstW, c->chrXInc, - NULL, NULL, NULL, 4); + c->lumMmxextFilterCodeSize = init_hscaler_mmxext(dstW, c->lumXInc, NULL, + NULL, NULL, 8); + c->chrMmxextFilterCodeSize = init_hscaler_mmxext(c->chrDstW, c->chrXInc, + NULL, NULL, NULL, 4); #if USE_MMAP c->lumMmxextFilterCode = mmap(NULL, c->lumMmxextFilterCodeSize, @@ -1150,10 +1151,10 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, FF_ALLOCZ_OR_GOTO(c, c->hLumFilterPos, (dstW / 2 / 8 + 8) * sizeof(int32_t), fail); FF_ALLOCZ_OR_GOTO(c, c->hChrFilterPos, (c->chrDstW / 2 / 4 + 8) * sizeof(int32_t), fail); - initMMX2HScaler( dstW, c->lumXInc, c->lumMmxextFilterCode, - c->hLumFilter, (uint32_t*)c->hLumFilterPos, 8); - initMMX2HScaler(c->chrDstW, c->chrXInc, c->chrMmxextFilterCode, - c->hChrFilter, (uint32_t*)c->hChrFilterPos, 4); + init_hscaler_mmxext( dstW, c->lumXInc, c->lumMmxextFilterCode, + c->hLumFilter, (uint32_t*)c->hLumFilterPos, 8); + init_hscaler_mmxext(c->chrDstW, c->chrXInc, c->chrMmxextFilterCode, + c->hChrFilter, (uint32_t*)c->hChrFilterPos, 4); #if USE_MMAP mprotect(c->lumMmxextFilterCode, c->lumMmxextFilterCodeSize, PROT_EXEC | PROT_READ); diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c index f7288d3e44..1e20176a03 100644 --- a/libswscale/x86/rgb2rgb.c +++ b/libswscale/x86/rgb2rgb.c @@ -102,7 +102,7 @@ DECLARE_ASM_CONST(8, uint64_t, mul16_mid) = 0x2080208020802080ULL; #undef RENAME #undef COMPILE_TEMPLATE_MMXEXT #define COMPILE_TEMPLATE_MMXEXT 1 -#define RENAME(a) a ## _MMX2 +#define RENAME(a) a ## _MMXEXT #include "rgb2rgb_template.c" //SSE2 versions @@ -142,7 +142,7 @@ av_cold void rgb2rgb_init_x86(void) if (INLINE_AMD3DNOW(cpu_flags)) rgb2rgb_init_3DNOW(); if (INLINE_MMXEXT(cpu_flags)) - rgb2rgb_init_MMX2(); + rgb2rgb_init_MMXEXT(); if (INLINE_SSE2(cpu_flags)) rgb2rgb_init_SSE2(); #endif /* HAVE_INLINE_ASM */ diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index e82666bec9..fd14021e1f 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -85,7 +85,7 @@ DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL; #undef RENAME #undef COMPILE_TEMPLATE_MMXEXT #define COMPILE_TEMPLATE_MMXEXT 1 -#define RENAME(a) a ## _MMX2 +#define RENAME(a) a ## _MMXEXT #include "swscale_template.c" #endif @@ -211,7 +211,7 @@ static void yuv2yuvX_sse3(const int16_t *filter, int filterSize, const uint8_t *dither, int offset) { if(((int)dest) & 15){ - return yuv2yuvX_MMX2(filter, filterSize, src, dest, dstW, dither, offset); + return yuv2yuvX_MMXEXT(filter, filterSize, src, dest, dstW, dither, offset); } if (offset) { __asm__ volatile("movq (%0), %%xmm3\n\t" @@ -381,7 +381,7 @@ av_cold void ff_sws_init_swScale_mmx(SwsContext *c) sws_init_swScale_MMX(c); #if HAVE_MMXEXT_INLINE if (cpu_flags & AV_CPU_FLAG_MMXEXT) - sws_init_swScale_MMX2(c); + sws_init_swScale_MMXEXT(c); if (cpu_flags & AV_CPU_FLAG_SSE3){ if(c->use_mmx_vfilter && !(c->flags & SWS_ACCURATE_RND)) c->yuv2planeX = yuv2yuvX_sse3; diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c index ea52e3c71b..3938e6bae3 100644 --- a/libswscale/x86/yuv2rgb.c +++ b/libswscale/x86/yuv2rgb.c @@ -63,7 +63,7 @@ DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL; #undef RENAME #undef COMPILE_TEMPLATE_MMXEXT #define COMPILE_TEMPLATE_MMXEXT 1 -#define RENAME(a) a ## _MMX2 +#define RENAME(a) a ## _MMXEXT #include "yuv2rgb_template.c" #endif /* HAVE_MMXEXT_INLINE */ @@ -77,8 +77,10 @@ av_cold SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c) #if HAVE_MMXEXT_INLINE if (cpu_flags & AV_CPU_FLAG_MMXEXT) { switch (c->dstFormat) { - case AV_PIX_FMT_RGB24: return yuv420_rgb24_MMX2; - case AV_PIX_FMT_BGR24: return yuv420_bgr24_MMX2; + case AV_PIX_FMT_RGB24: + return yuv420_rgb24_MMXEXT; + case AV_PIX_FMT_BGR24: + return yuv420_bgr24_MMXEXT; } } #endif |