[FFmpeg-devel] [PATCH 2/2] tta/x86: add ff_ttafilter_process_dec_{ssse3, sse4}

Loren Merritt lorenm at u.washington.edu
Tue Feb 11 07:18:33 CET 2014


On Tue, 11 Feb 2014, James Almer wrote:

> +    ; Using horizontal add (phaddd) seems to be slower than shuffling stuff around
> +    paddd      m2, m3               ; int sum = filter->round +
> +                                    ;           filter->dl[0] * filter->qm[0] +
> +    punpckhqdq m3, m2, m2           ;           filter->dl[1] * filter->qm[1] +
> +    paddd      m2, m3               ;           filter->dl[2] * filter->qm[2] +
> +                                    ;           filter->dl[3] * filter->qm[3] +
> +    movd       m6, roundd           ;           filter->dl[4] * filter->qm[4] +
> +    paddd      m6, m2               ;           filter->dl[5] * filter->qm[5] +
> +    pshufd     m2, m2, 0x1          ;           filter->dl[6] * filter->qm[6] +
> +    paddd      m6, m2               ;           filter->dl[7] * filter->qm[7];
> +
> +    psrldq     m4, 4                ; filter->dx[0] = filter->dx[1]; filter->dx[1] = filter->dx[2];
> +    pslldq     m5, 12               ; filter->dx[2] = filter->dx[3]; filter->dx[3] = filter->dx[4];
> +    por        m4, m5               ;
> +
> +    psrldq     m0, 4                ; filter->dl[0] = filter->dl[1]; filter->dl[1] = filter->dl[2];
> +    pslldq     m2, m1, 12           ; filter->dl[2] = filter->dl[3]; filter->dl[3] = filter->dl[4];
> +    por        m0, m2               ;

palignr

> +
> +    psrad      m5, m1, 30           ; filter->dx[4] = ((filter->dl[4] >> 30) | 1);
> +    por        m5, [pd_1224]        ; filter->dx[5] = ((filter->dl[5] >> 30) | 2) & ~1;
> +    pand       m5, [pd_n0113]       ; filter->dx[6] = ((filter->dl[6] >> 30) | 2) & ~1;
> +                                    ; filter->dx[7] = ((filter->dl[7] >> 30) | 4) & ~3;
> +
> +    mova       [dlq       ], m0
> +    mova       [dxq       ], m4
> +    mova       [dxq + 0x10], m5
> +    movd       m0, [inq]            ; filter->error = *in;
> +    movd       [errorq], m0         ;
> +
> +    movd       m2, shiftd           ; *in += (sum >> filter->shift);
> +    psrad      m6, m2               ;
> +    paddd      m0, m6               ;
> +    movd       [inq], m0            ;
> +
> +    psignd     m1, [pd_m1]          ;
> +    psrldq     m1, 4                ;
> +    pslldq     m0, 12               ; filter->dl[4] = -filter->dl[5];
> +    pshufd     m0, m0, 0xf0         ; filter->dl[5] = -filter->dl[6];
> +    paddd      m1, m0               ; filter->dl[6] = *in - filter->dl[7];

psubd, and eliminate the psignd

> +    psrldq     m0, m1, 4            ; filter->dl[7] = *in;
> +    pshufd     m0, m0, 0xf4         ; filter->dl[5] += filter->dl[6];
> +    paddd      m1, m0               ; filter->dl[4] += filter->dl[5];
> +    psrldq     m0, 4                ;
> +    paddd      m1, m0               ;
> +    mova       [dlq + 0x10], m1     ;
> +    RET
> +%endmacro

--Loren Merritt


More information about the ffmpeg-devel mailing list