diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-07 15:21:41 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-07 15:21:41 +0100 |
commit | af164d7d9f12f9c2a4b284957eb92ad74cd49b3d (patch) | |
tree | 942f8ceec8738f4436612742a0d08c180c67193d | |
parent | 8ca8b43d7108b9d7e6887fd553d13a71afa670c6 (diff) | |
parent | c25fc5c2bb6ae8c93541c9427df3e47206d95152 (diff) | |
download | ffmpeg-af164d7d9f12f9c2a4b284957eb92ad74cd49b3d.tar.gz |
Merge commit 'c25fc5c2bb6ae8c93541c9427df3e47206d95152'
* commit 'c25fc5c2bb6ae8c93541c9427df3e47206d95152':
fate: dpcm: Add dependencies
SBR DSP x86: implement SSE sbr_hf_gen
AAC SBR: use AVFloatDSPContext's vector_fmul
fate: image: Add dependencies
Changelog: add an entry for deprecating the avconv -vol option
x86: float_dsp: fix compilation of ff_vector_dmul_scalar_avx() on x86-32
Conflicts:
Changelog
libavutil/x86/float_dsp.asm
tests/fate/image.mak
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/aacsbr.c | 11 | ||||
-rw-r--r-- | libavcodec/x86/sbrdsp.asm | 73 | ||||
-rw-r--r-- | libavcodec/x86/sbrdsp_init.c | 4 | ||||
-rw-r--r-- | libavutil/x86/float_dsp.asm | 2 | ||||
-rw-r--r-- | tests/fate/dpcm.mak | 12 | ||||
-rw-r--r-- | tests/fate/image.mak | 27 |
6 files changed, 105 insertions, 24 deletions
diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c index e46b4a44b8..714e48c1ff 100644 --- a/libavcodec/aacsbr.c +++ b/libavcodec/aacsbr.c @@ -76,7 +76,6 @@ enum { static VLC vlc_sbr[10]; static const int8_t vlc_sbr_lav[10] = { 60, 60, 24, 24, 31, 31, 12, 12, 31, 12 }; -static const DECLARE_ALIGNED(16, float, zero64)[64]; #define SBR_INIT_VLC_STATIC(num, size) \ INIT_VLC_STATIC(&vlc_sbr[num], 9, sbr_tmp[num].table_size / sbr_tmp[num].elem_size, \ @@ -1180,7 +1179,7 @@ static void sbr_qmf_analysis(DSPContext *dsp, FFTContext *mdct, * (14496-3 sp04 p206) */ static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct, - SBRDSPContext *sbrdsp, + SBRDSPContext *sbrdsp, AVFloatDSPContext *fdsp, float *out, float X[2][38][64], float mdct_buf[2][64], float *v0, int *v_off, const unsigned int div) @@ -1211,7 +1210,7 @@ static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct, mdct->imdct_half(mdct, mdct_buf[1], X[1][i]); sbrdsp->qmf_deint_bfly(v, mdct_buf[1], mdct_buf[0]); } - dsp->vector_fmul_add(out, v , sbr_qmf_window , zero64, 64 >> div); + fdsp->vector_fmul (out, v , sbr_qmf_window , 64 >> div); dsp->vector_fmul_add(out, v + ( 192 >> div), sbr_qmf_window + ( 64 >> div), out , 64 >> div); dsp->vector_fmul_add(out, v + ( 256 >> div), sbr_qmf_window + (128 >> div), out , 64 >> div); dsp->vector_fmul_add(out, v + ( 448 >> div), sbr_qmf_window + (192 >> div), out , 64 >> div); @@ -1708,12 +1707,14 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac, nch = 2; } - sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, &sbr->dsp, L, sbr->X[0], sbr->qmf_filter_scratch, + sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, &sbr->dsp, &ac->fdsp, + L, sbr->X[0], sbr->qmf_filter_scratch, sbr->data[0].synthesis_filterbank_samples, &sbr->data[0].synthesis_filterbank_samples_offset, downsampled); if (nch == 2) - sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, &sbr->dsp, R, sbr->X[1], sbr->qmf_filter_scratch, + sbr_qmf_synthesis(&ac->dsp, &sbr->mdct, &sbr->dsp, &ac->fdsp, + R, sbr->X[1], sbr->qmf_filter_scratch, sbr->data[1].synthesis_filterbank_samples, &sbr->data[1].synthesis_filterbank_samples_offset, downsampled); diff --git a/libavcodec/x86/sbrdsp.asm b/libavcodec/x86/sbrdsp.asm index c351de4430..b87da4a072 100644 --- a/libavcodec/x86/sbrdsp.asm +++ b/libavcodec/x86/sbrdsp.asm @@ -21,8 +21,11 @@ %include "libavutil/x86/x86util.asm" -;SECTION_RODATA -SECTION .text +SECTION_RODATA +; mask equivalent for multiply by -1.0 1.0 +ps_mask times 2 dd 1<<31, 0 + +SECTION_TEXT INIT_XMM sse cglobal sbr_sum_square, 2, 3, 6 @@ -112,3 +115,69 @@ cglobal sbr_hf_g_filt, 5, 6, 5 jnz .loop1 .end: RET + +; static void sbr_hf_gen_c(float (*X_high)[2], const float (*X_low)[2], +; const float alpha0[2], const float alpha1[2], +; float bw, int start, int end) +; +cglobal sbr_hf_gen, 4,4,8, X_high, X_low, alpha0, alpha1, BW, S, E + ; load alpha factors +%define bw m0 +%if ARCH_X86_64 == 0 || WIN64 + movss bw, BWm +%endif + movlps m2, [alpha1q] + movlps m1, [alpha0q] + shufps bw, bw, 0 + mulps m2, bw ; (a1[0] a1[1])*bw + mulps m1, bw ; (a0[0] a0[1])*bw = (a2 a3) + mulps m2, bw ; (a1[0] a1[1])*bw*bw = (a0 a1) + mova m3, m1 + mova m4, m2 + mova m7, [ps_mask] + + ; Set pointers +%if ARCH_X86_64 == 0 || WIN64 + ; start and end 6th and 7th args on stack + mov r2d, Sm + mov r3d, Em +%define start r2q +%define end r3q +%else +; BW does not actually occupy a register, so shift by 1 +%define start BWq +%define end Sq +%endif + sub start, end ; neg num of loops + lea X_highq, [X_highq + end*2*4] + lea X_lowq, [X_lowq + end*2*4 - 2*2*4] + shl start, 3 ; offset from num loops + + mova m0, [X_lowq + start] + movlhps m1, m1 ; (a2 a3 a2 a3) + movlhps m2, m2 ; (a0 a1 a0 a1) + shufps m3, m3, q0101 ; (a3 a2 a3 a2) + shufps m4, m4, q0101 ; (a1 a0 a1 a0) + xorps m3, m7 ; (-a3 a2 -a3 a2) + xorps m4, m7 ; (-a1 a0 -a1 a0) +.loop2: + mova m5, m0 + mova m6, m0 + shufps m0, m0, q2200 ; {Xl[-2][0],",Xl[-1][0],"} + shufps m5, m5, q3311 ; {Xl[-2][1],",Xl[-1][1],"} + mulps m0, m2 + mulps m5, m4 + mova m7, m6 + addps m5, m0 + mova m0, [X_lowq + start + 2*2*4] + shufps m6, m0, q0022 ; {Xl[-1][0],",Xl[0][0],"} + shufps m7, m0, q1133 ; {Xl[-1][1],",Xl[1][1],"} + mulps m6, m1 + mulps m7, m3 + addps m5, m6 + addps m7, m0 + addps m5, m7 + mova [X_highq + start], m5 + add start, 16 + jnz .loop2 + RET diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c index d272896704..51c4bd4a16 100644 --- a/libavcodec/x86/sbrdsp_init.c +++ b/libavcodec/x86/sbrdsp_init.c @@ -27,6 +27,9 @@ float ff_sbr_sum_square_sse(float (*x)[2], int n); void ff_sbr_hf_g_filt_sse(float (*Y)[2], const float (*X_high)[40][2], const float *g_filt, int m_max, intptr_t ixh); +void ff_sbr_hf_gen_sse(float (*X_high)[2], const float (*X_low)[2], + const float alpha0[2], const float alpha1[2], + float bw, int start, int end); void ff_sbrdsp_init_x86(SBRDSPContext *s) { @@ -35,5 +38,6 @@ void ff_sbrdsp_init_x86(SBRDSPContext *s) if (EXTERNAL_SSE(mm_flags)) { s->sum_square = ff_sbr_sum_square_sse; s->hf_g_filt = ff_sbr_hf_g_filt_sse; + s->hf_gen = ff_sbr_hf_gen_sse; } } diff --git a/libavutil/x86/float_dsp.asm b/libavutil/x86/float_dsp.asm index 365bafea00..e01e1a8822 100644 --- a/libavutil/x86/float_dsp.asm +++ b/libavutil/x86/float_dsp.asm @@ -133,7 +133,7 @@ cglobal vector_dmul_scalar, 3,3,3, dst, src, len cglobal vector_dmul_scalar, 4,4,3, dst, src, mul, len %endif %if ARCH_X86_32 - VBROADCASTSD m0, mulm + VBROADCASTSD m0, mulm %else %if WIN64 movlhps xmm2, xmm2 diff --git a/tests/fate/dpcm.mak b/tests/fate/dpcm.mak index 14e77a20f4..abc25edc9b 100644 --- a/tests/fate/dpcm.mak +++ b/tests/fate/dpcm.mak @@ -1,14 +1,14 @@ -FATE_DPCM += fate-dpcm-idroq +FATE_DPCM-$(call DEMDEC, ROQ, ROQ_DPCM) += fate-dpcm-idroq fate-dpcm-idroq: CMD = framecrc -i $(SAMPLES)/idroq/idlogo.roq -vn -FATE_DPCM += fate-dpcm-interplay +FATE_DPCM-$(call DEMDEC, IPMOVIE, INTERPLAY_DPCM) += fate-dpcm-interplay fate-dpcm-interplay: CMD = framecrc -i $(SAMPLES)/interplay-mve/interplay-logo-2MB.mve -vn -FATE_DPCM += fate-dpcm-sierra +FATE_DPCM-$(call DEMDEC, SOL, SOL_DPCM) += fate-dpcm-sierra fate-dpcm-sierra: CMD = md5 -i $(SAMPLES)/sol/lsl7sample.sol -f s16le -FATE_DPCM += fate-dpcm-xan +FATE_DPCM-$(call DEMDEC, AVI, XAN_DPCM) += fate-dpcm-xan fate-dpcm-xan: CMD = md5 -i $(SAMPLES)/wc4-xan/wc4_2.avi -vn -f s16le -FATE_SAMPLES_AVCONV += $(FATE_DPCM) -fate-dpcm: $(FATE_DPCM) +FATE_SAMPLES_AVCONV += $(FATE_DPCM-yes) +fate-dpcm: $(FATE_DPCM-yes) diff --git a/tests/fate/image.mak b/tests/fate/image.mak index 8770c74e1b..abafd5f907 100644 --- a/tests/fate/image.mak +++ b/tests/fate/image.mak @@ -1,10 +1,10 @@ -FATE_IMAGE += fate-dpx +FATE_IMAGE-$(call DEMDEC, IMAGE2, DPX) += fate-dpx fate-dpx: CMD = framecrc -i $(SAMPLES)/dpx/lighthouse_rgb48.dpx -FATE_IMAGE += fate-pictor +FATE_IMAGE-$(call DEMDEC, IMAGE2, PICTOR) += fate-pictor fate-pictor: CMD = framecrc -i $(SAMPLES)/pictor/MFISH.PIC -pix_fmt rgb24 -FATE_IMAGE += fate-ptx +FATE_IMAGE-$(call DEMDEC, IMAGE2, PTX) += fate-ptx fate-ptx: CMD = framecrc -i $(SAMPLES)/ptx/_113kw_pic.ptx -pix_fmt rgb24 FATE_SUNRASTER += fate-sunraster-1bit-raw @@ -28,8 +28,10 @@ fate-sunraster-24bit-raw: CMD = framecrc -i $(SAMPLES)/sunraster/lena-24bit-raw. FATE_SUNRASTER += fate-sunraster-24bit-rle fate-sunraster-24bit-rle: CMD = framecrc -i $(SAMPLES)/sunraster/lena-24bit-rle.sun -FATE_IMAGE += $(FATE_SUNRASTER) -fate-sunraster: $(FATE_SUNRASTER) +FATE_SUNRASTER-$(call DEMDEC, IMAGE2, SUNRAST) += $(FATE_SUNRASTER) + +FATE_IMAGE += $(FATE_SUNRASTER-yes) +fate-sunraster: $(FATE_SUNRASTER-yes) FATE_TARGA = CBW8 \ CCM8 \ @@ -45,8 +47,10 @@ FATE_TARGA = CBW8 \ FATE_TARGA := $(FATE_TARGA:%=fate-targa-conformance-%) \ fate-targa-top-to-bottom -FATE_IMAGE += $(FATE_TARGA) -fate-targa: $(FATE_TARGA) +FATE_TARGA-$(call DEMDEC, IMAGE2, TARGA) += $(FATE_TARGA) + +FATE_IMAGE += $(FATE_TARGA-yes) +fate-targa: $(FATE_TARGA-yes) fate-targa-conformance-CBW8: CMD = framecrc -i $(SAMPLES)/targa-conformance/CBW8.TGA fate-targa-conformance-CCM8: CMD = framecrc -i $(SAMPLES)/targa-conformance/CCM8.TGA -pix_fmt rgba @@ -67,12 +71,15 @@ fate-tiff-fax-g3: CMD = framecrc -i $(SAMPLES)/CCITT_fax/G31D.TIF FATE_TIFF += fate-tiff-fax-g3s fate-tiff-fax-g3s: CMD = framecrc -i $(SAMPLES)/CCITT_fax/G31DS.TIF -FATE_IMAGE += $(FATE_TIFF) -fate-tiff: $(FATE_TIFF) +FATE_TIFF-$(call DEMDEC, IMAGE2, TIFF) += $(FATE_TIFF) + +FATE_IMAGE += $(FATE_TIFF-yes) +fate-tiff: $(FATE_TIFF-yes) FATE_IMAGE += fate-xface fate-xface: CMD = framecrc -i $(SAMPLES)/xface/lena.xface +FATE_IMAGE += $(FATE_IMAGE-yes) + FATE_SAMPLES_FFMPEG += $(FATE_IMAGE) fate-image: $(FATE_IMAGE) - |