diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-27 23:42:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-27 23:42:19 +0200 |
commit | c6963a220d5849fd5399c056b21ec66de7a0df37 (patch) | |
tree | 142ce617e997fd542f0f2ccd460212b5a3dc6835 /libavcodec/x86 | |
parent | 94c3e11a6f62bf13a7e6f1b9287c6112bf6ee445 (diff) | |
parent | 5361e10a5e8740146c09a115477310c77b927215 (diff) | |
download | ffmpeg-c6963a220d5849fd5399c056b21ec66de7a0df37.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
proresdsp: port x86 assembly to cpuflags.
lavr: x86: improve non-SSE4 version of S16_TO_S32_SX macro
lavfi: better channel layout negotiation
alac: check for truncated packets
alac: reverse lpc coeff order, simplify filter
lavr: add x86-optimized mixing functions
x86: add support for fmaddps fma4 instruction with abstraction to avx/sse
tscc2: fix typo in array index
build: use COMPILE template for HOSTOBJS
build: do full flag handling for all compiler-type tools
eval: fix printing of NaN in eval fate test.
build: Rename aandct component to more descriptive aandcttables
mpegaudio: bury inline asm under HAVE_INLINE_ASM.
x86inc: automatically insert vzeroupper for YMM functions.
rtmp: Check the buffer length of ping packets
rtmp: Allow having more unknown data at the end of a chunk size packet without failing
rtmp: Prevent reading outside of an allocate buffer when receiving server bandwidth packets
Conflicts:
Makefile
configure
libavcodec/x86/proresdsp.asm
libavutil/eval.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86')
-rw-r--r-- | libavcodec/x86/dsputil_yasm.asm | 14 | ||||
-rw-r--r-- | libavcodec/x86/fft_mmx.asm | 6 | ||||
-rw-r--r-- | libavcodec/x86/mpegaudiodec_mmx.c | 5 | ||||
-rw-r--r-- | libavcodec/x86/proresdsp.asm | 37 |
4 files changed, 30 insertions, 32 deletions
diff --git a/libavcodec/x86/dsputil_yasm.asm b/libavcodec/x86/dsputil_yasm.asm index d2e5439e61..5a6c3d1eae 100644 --- a/libavcodec/x86/dsputil_yasm.asm +++ b/libavcodec/x86/dsputil_yasm.asm @@ -1158,12 +1158,7 @@ ALIGN 16 add src1q, 2*mmsize sub lenq, 2*mmsize jge .loop -%if mmsize == 32 - vzeroupper - RET -%else REP_RET -%endif %endmacro INIT_XMM sse @@ -1193,12 +1188,7 @@ ALIGN 16 sub lenq, 2*mmsize jge .loop -%if mmsize == 32 - vzeroupper - RET -%else REP_RET -%endif %endmacro INIT_XMM sse @@ -1243,10 +1233,6 @@ cglobal butterflies_float_interleave, 4,4,3, dst, src0, src1, len %endif add lenq, mmsize jl .loop -%if mmsize == 32 - vzeroupper - RET -%endif .end: REP_RET %endmacro diff --git a/libavcodec/x86/fft_mmx.asm b/libavcodec/x86/fft_mmx.asm index 5bf0e2f259..5e5004ca97 100644 --- a/libavcodec/x86/fft_mmx.asm +++ b/libavcodec/x86/fft_mmx.asm @@ -750,9 +750,6 @@ section .text ; The others pass args in registers and don't spill anything. cglobal fft_dispatch%2, 2,5,8, z, nbits FFT_DISPATCH fullsuffix, nbits -%if mmsize == 32 - vzeroupper -%endif RET %endmacro ; DECL_FFT @@ -958,9 +955,6 @@ cglobal imdct_half, 3,12,8; FFTContext *s, FFTSample *output, const FFTSample *i %if ARCH_X86_64 == 0 add esp, 12 %endif -%if mmsize == 32 - vzeroupper -%endif RET %endmacro diff --git a/libavcodec/x86/mpegaudiodec_mmx.c b/libavcodec/x86/mpegaudiodec_mmx.c index 939b441277..0d6cc08305 100644 --- a/libavcodec/x86/mpegaudiodec_mmx.c +++ b/libavcodec/x86/mpegaudiodec_mmx.c @@ -36,6 +36,8 @@ void ff_four_imdct36_float_avx(float *out, float *buf, float *in, float *win, DECLARE_ALIGNED(16, static float, mdct_win_sse)[2][4][4*40]; +#if HAVE_INLINE_ASM + #define MACS(rt, ra, rb) rt+=(ra)*(rb) #define MLSS(rt, ra, rb) rt-=(ra)*(rb) @@ -178,6 +180,7 @@ static void apply_window_mp3(float *in, float *win, int *unused, float *out, *out = sum; } +#endif /* HAVE_INLINE_ASM */ #define DECL_IMDCT_BLOCKS(CPU1, CPU2) \ static void imdct36_blocks_ ## CPU1(float *out, float *buf, float *in, \ @@ -241,9 +244,11 @@ void ff_mpadsp_init_mmx(MPADSPContext *s) } } +#if HAVE_INLINE_ASM if (mm_flags & AV_CPU_FLAG_SSE2) { s->apply_window_float = apply_window_mp3; } +#endif /* HAVE_INLINE_ASM */ #if HAVE_YASM if (0) { #if HAVE_AVX diff --git a/libavcodec/x86/proresdsp.asm b/libavcodec/x86/proresdsp.asm index a09d871fda..01e5deec93 100644 --- a/libavcodec/x86/proresdsp.asm +++ b/libavcodec/x86/proresdsp.asm @@ -83,8 +83,7 @@ section .text align=16 ; %1 = row or col (for rounding variable) ; %2 = number of bits to shift at the end -; %3 = optimization -%macro IDCT_1D 3 +%macro IDCT_1D 2 ; a0 = (W4 * row[0]) + (1 << (15 - 1)); ; a1 = a0; ; a2 = a0; @@ -235,8 +234,8 @@ section .text align=16 ; void prores_idct_put_10_<opt>(uint8_t *pixels, int stride, ; DCTELEM *block, const int16_t *qmat); -%macro idct_put_fn 2 -cglobal prores_idct_put_10_%1, 4, 4, %2 +%macro idct_put_fn 1 +cglobal prores_idct_put_10, 4, 4, %1 movsxd r1, r1d pxor m15, m15 ; zero @@ -252,7 +251,7 @@ cglobal prores_idct_put_10_%1, 4, 4, %2 pmullw m13,[r3+64] pmullw m12,[r3+96] - IDCT_1D row, 15, %1 + IDCT_1D row, 15 ; transpose for second part of IDCT TRANSPOSE8x8W 8, 0, 1, 2, 4, 11, 9, 10, 3 @@ -267,7 +266,7 @@ cglobal prores_idct_put_10_%1, 4, 4, %2 ; for (i = 0; i < 8; i++) ; idctSparseColAdd(dest + i, line_size, block + i); - IDCT_1D col, 18, %1 + IDCT_1D col, 18 ; clip/store mova m3, [pw_4] @@ -302,13 +301,27 @@ cglobal prores_idct_put_10_%1, 4, 4, %2 RET %endmacro -INIT_XMM -idct_put_fn sse2, 16 -INIT_XMM -idct_put_fn sse4, 16 +%macro SIGNEXTEND 2-3 ; dstlow, dsthigh, tmp +%if cpuflag(sse4) + movhlps %2, %1 + pmovsxwd %1, %1 + pmovsxwd %2, %2 +%else ; sse2 + pxor %3, %3 + pcmpgtw %3, %1 + mova %2, %1 + punpcklwd %1, %3 + punpckhwd %2, %3 +%endif +%endmacro + +INIT_XMM sse2 +idct_put_fn 16 +INIT_XMM sse4 +idct_put_fn 16 %if HAVE_AVX -INIT_AVX -idct_put_fn avx, 16 +INIT_XMM avx +idct_put_fn 16 %endif %endif |