<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><DIV>the code is right</DIV>
<DIV>if possible, I suggest do "dec srcq" before loop, so we can modify [srcq -1] to [srcq], it is faster and less a byte</DIV>
<DIV><BR>At 2013-11-12 23:06:55,nabajit@multicorewareinc.com wrote:<BR>># HG changeset patch<BR>># User Nabajit Deka<BR>># Date 1384268074 -19800<BR>># Tue Nov 12 20:24:34 2013 +0530<BR>># Node ID c9851effbce88c9a70f712fbfaf7e83616c5615f<BR>># Parent 968f6df6d50f70d2a4cf569a8c0426f65d927b00<BR>>asm: routines for chroma hps filter functions for 2xN, 4xN, 6x8 and 12x16 block sizes.<BR>><BR>>diff -r 968f6df6d50f -r c9851effbce8 source/common/x86/ipfilter8.asm<BR>>--- a/source/common/x86/ipfilter8.asm Tue Nov 12 17:34:19 2013 +0530<BR>>+++ b/source/common/x86/ipfilter8.asm Tue Nov 12 20:24:34 2013 +0530<BR>>@@ -3417,3 +3417,186 @@<BR>> FILTER_VER_CHROMA_SP_W8_H2 8, 8<BR>> FILTER_VER_CHROMA_SP_W8_H2 8, 16<BR>> FILTER_VER_CHROMA_SP_W8_H2 8, 32<BR>>+<BR>>+%macro PROCESS_CHROMA_W2 3<BR>>+ movh %2, [srcq - 1]<BR>>+ pshufb %2, %2, Tm0<BR>>+ movh %1, [srcq + srcstrideq - 1]<BR>>+ pshufb %1, %1, Tm0<BR>>+ punpcklqdq %2, %1<BR>>+ pmaddubsw %2, coef2<BR>>+ phaddw %2, %2<BR>>+ psubw %2, %3<BR>>+ movd [dstq], %2<BR>>+ pshufd %2, %2, 1<BR>>+ movd [dstq + dststrideq], %2<BR>>+%endmacro<BR>>+<BR>>+;-------------------------------------------------------------------------------------------------------------<BR>>+; void interp_4tap_horiz_ps_2x%2(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride, int coeffIdx)<BR>>+;-------------------------------------------------------------------------------------------------------------<BR>>+%macro FILTER_HORIZ_CHROMA_2xN 2<BR>>+INIT_XMM sse4<BR>>+cglobal interp_4tap_horiz_ps_%1x%2, 4, 6, 6, src, srcstride, dst, dststride<BR>>+%define coef2 m5<BR>>+%define Tm0 m4<BR>>+%define Tm1 m3<BR>>+%define t2 m2<BR>>+%define t1 m1<BR>>+%define t0 m0<BR>>+<BR>>+mov r4d, r4m<BR>>+add dststrided, dststrided<BR>>+<BR>>+%ifdef PIC<BR>>+lea r5, [tab_ChromaCoeff]<BR>>+movd coef2, [r5 + r4 * 4]<BR>>+%else<BR>>+movd coef2, [tab_ChromaCoeff + r4 * 4]<BR>>+%endif<BR>>+<BR>>+pshufd coef2, coef2, 0<BR>>+mova t2, [tab_c_8192]<BR>>+mova Tm0, [tab_Tm]<BR>>+<BR>>+%rep %2/2<BR>>+PROCESS_CHROMA_W2 t0, t1, t2<BR>>+lea srcq, [srcq + srcstrideq * 2]<BR>>+lea dstq, [dstq + dststrideq * 2]<BR>>+%endrep<BR>>+<BR>>+RET<BR>>+%endmacro<BR>>+<BR>>+FILTER_HORIZ_CHROMA_2xN 2, 4<BR>>+FILTER_HORIZ_CHROMA_2xN 2, 8<BR>>+<BR>>+<BR>>+%macro PROCESS_CHROMA_W4 3<BR>>+ movh %2, [srcq - 1]<BR>>+ pshufb %2, %2, Tm0<BR>>+ pmaddubsw %2, coef2<BR>>+ movh %1, [srcq + srcstrideq - 1]<BR>>+ pshufb %1, %1, Tm0<BR>>+ pmaddubsw %1, coef2<BR>>+ phaddw %2, %1<BR>>+ psubw %2, %3<BR>>+ movlps [dstq], %2<BR>>+ movhps [dstq + dststrideq], %2<BR>>+%endmacro<BR>>+<BR>>+;-------------------------------------------------------------------------------------------------------------<BR>>+; void interp_4tap_horiz_ps_4x%2(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride, int coeffIdx)<BR>>+;-------------------------------------------------------------------------------------------------------------<BR>>+%macro FILTER_HORIZ_CHROMA_4xN 2<BR>>+INIT_XMM sse4<BR>>+cglobal interp_4tap_horiz_ps_%1x%2, 4, 6, 6, src, srcstride, dst, dststride<BR>>+%define coef2 m5<BR>>+%define Tm0 m4<BR>>+%define Tm1 m3<BR>>+%define t2 m2<BR>>+%define t1 m1<BR>>+%define t0 m0<BR>>+<BR>>+mov r4d, r4m<BR>>+add dststrided, dststrided<BR>>+<BR>>+%ifdef PIC<BR>>+lea r5, [tab_ChromaCoeff]<BR>>+movd coef2, [r5 + r4 * 4]<BR>>+%else<BR>>+movd coef2, [tab_ChromaCoeff + r4 * 4]<BR>>+%endif<BR>>+<BR>>+pshufd coef2, coef2, 0<BR>>+mova t2, [tab_c_8192]<BR>>+mova Tm0, [tab_Tm]<BR>>+<BR>>+%rep %2/2<BR>>+PROCESS_CHROMA_W4 t0, t1, t2<BR>>+lea srcq, [srcq + srcstrideq * 2]<BR>>+lea dstq, [dstq + dststrideq * 2]<BR>>+%endrep<BR>>+<BR>>+RET<BR>>+%endmacro<BR>>+<BR>>+FILTER_HORIZ_CHROMA_4xN 4, 2<BR>>+FILTER_HORIZ_CHROMA_4xN 4, 4<BR>>+FILTER_HORIZ_CHROMA_4xN 4, 8<BR>>+FILTER_HORIZ_CHROMA_4xN 4, 16<BR>>+<BR>>+<BR>>+%macro PROCESS_CHROMA_W6 3<BR>>+ movu %1, [srcq - 1]<BR>>+ pshufb %2, %1, Tm0<BR>>+ pmaddubsw %2, coef2<BR>>+ pshufb %1, %1, Tm1<BR>>+ pmaddubsw %1, coef2<BR>>+ phaddw %2, %1<BR>>+ psubw %2, %3<BR>>+ movh [dstq], %2<BR>>+ pshufd %2, %2, 2<BR>>+ movd [dstq + 8], %2<BR>>+%endmacro<BR>>+<BR>>+%macro PROCESS_CHROMA_W12 3<BR>>+ movu %1, [srcq - 1]<BR>>+ pshufb %2, %1, Tm0<BR>>+ pmaddubsw %2, coef2<BR>>+ pshufb %1, %1, Tm1<BR>>+ pmaddubsw %1, coef2<BR>>+ phaddw %2, %1<BR>>+ psubw %2, %3<BR>>+ movu [dstq], %2<BR>>+ movu %1, [srcq - 1 + 8]<BR>>+ pshufb %1, %1, Tm0<BR>>+ pmaddubsw %1, coef2<BR>>+ phaddw %1, %1<BR>>+ psubw %1, %3<BR>>+ movh [dstq + 16], %1<BR>>+%endmacro<BR>>+<BR>>+;-----------------------------------------------------------------------------<BR>>+; void interp_4tap_horiz_ps_6x%2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)<BR>>+;-----------------------------------------------------------------------------<BR>>+%macro FILTER_HORIZ_CHROMA 2<BR>>+INIT_XMM sse4<BR>>+cglobal interp_4tap_horiz_ps_%1x%2, 4, 6, 6, src, srcstride, dst, dststride<BR>>+%define coef2 m5<BR>>+%define Tm0 m4<BR>>+%define Tm1 m3<BR>>+%define t2 m2<BR>>+%define t1 m1<BR>>+%define t0 m0<BR>>+<BR>>+mov r4d, r4m<BR>>+add dststrided, dststrided<BR>>+<BR>>+%ifdef PIC<BR>>+lea r5, [tab_ChromaCoeff]<BR>>+movd coef2, [r5 + r4 * 4]<BR>>+%else<BR>>+movd coef2, [tab_ChromaCoeff + r4 * 4]<BR>>+%endif<BR>>+<BR>>+mov r5d, %2<BR>>+<BR>>+pshufd coef2, coef2, 0<BR>>+mova t2, [tab_c_8192]<BR>>+mova Tm0, [tab_Tm]<BR>>+mova Tm1, [tab_Tm + 16]<BR>>+<BR>>+.loop<BR>>+PROCESS_CHROMA_W%1 t0, t1, t2<BR>>+add srcq, srcstrideq<BR>>+add dstq, dststrideq<BR>>+<BR>>+dec r5d<BR>>+jnz .loop<BR>>+<BR>>+RET<BR>>+%endmacro<BR>>+<BR>>+FILTER_HORIZ_CHROMA 6, 8<BR>>+FILTER_HORIZ_CHROMA 12, 16<BR>>_______________________________________________<BR>>x265-devel mailing list<BR>>x265-devel@videolan.org<BR>>https://mailman.videolan.org/listinfo/x265-devel<BR></DIV></div>