History

avcodec/h264: mmxext 4:2:2 chroma deblock/loop filter

2.6 times faster (366 vs. 142 cycles)

James Darnley committed 10 years ago

Commit 7042a551 parent 95564462 files · +47 −3Browse files

Unified · Split

2 files
  1. libavcodec/x86/h264_deblock.asm +43 −3
  2. libavcodec/x86/h264dsp_init.c +4 −0
libavcodec/x86/h264_deblock.asm+43−3
@@ -864,7 +864,50 @@ ff_chroma_inter_body_mmxext: · 863 unmodified lines
864 DEBLOCK_P0_Q0864 DEBLOCK_P0_Q0
865 ret865 ret
866 866
867%define t5 r4
868%define t6 r5
869
870cglobal deblock_h_chroma422_8, 5, 6, 0, 0-(1+ARCH_X86_64*2)*mmsize
871 %if ARCH_X86_64
872 %define buf0 [rsp+16]
873 %define buf1 [rsp+8]
874 %else
875 %define buf0 r0m
876 %define buf1 r2m
877 %endif
878
879 movd m6, [r4]
880 punpcklbw m6, m6
881 movq [rsp], m6
882 CHROMA_H_START
883
884 TRANSPOSE4x8B_LOAD PASS8ROWS(t5, r0, r1, t6)
885 movq buf0, m0
886 movq buf1, m3
887 LOAD_MASK r2d, r3d
888 movd m6, [rsp]
889 punpcklwd m6, m6
890 pand m7, m6
891 DEBLOCK_P0_Q0
892 movq m0, buf0
893 movq m3, buf1
894 TRANSPOSE8x4B_STORE PASS8ROWS(t5, r0, r1, t6)
867 895
896 lea r0, [r0+r1*8]
897 lea t5, [t5+r1*8]
898
899 TRANSPOSE4x8B_LOAD PASS8ROWS(t5, r0, r1, t6)
900 movq buf0, m0
901 movq buf1, m3
902 LOAD_MASK r2d, r3d
903 movd m6, [rsp+4]
904 punpcklwd m6, m6
905 pand m7, m6
906 DEBLOCK_P0_Q0
907 movq m0, buf0
908 movq m3, buf1
909 TRANSPOSE8x4B_STORE PASS8ROWS(t5, r0, r1, t6)
910RET
868 911
869; in: %1=p0 %2=p1 %3=q1912; in: %1=p0 %2=p1 %3=q1
870; out: p0 = (p0 + q1 + 2*p1 + 2) >> 2913; out: p0 = (p0 + q1 + 2*p1 + 2) >> 2
@@ -877,9 +920,6 @@ ff_chroma_inter_body_mmxext: · 6 unmodified lines
877 pavgb %1, %2 ; dst = avg(p1, avg(p0,q1) - ((p0^q1)&1))920 pavgb %1, %2 ; dst = avg(p1, avg(p0,q1) - ((p0^q1)&1))
878%endmacro921%endmacro
879 922
880%define t5 r4
881%define t6 r5
882
883;------------------------------------------------------------------------------923;------------------------------------------------------------------------------
884; void ff_deblock_v_chroma_intra(uint8_t *pix, int stride, int alpha, int beta)924; void ff_deblock_v_chroma_intra(uint8_t *pix, int stride, int alpha, int beta)
885;------------------------------------------------------------------------------925;------------------------------------------------------------------------------
libavcodec/x86/h264dsp_init.c+4−0
@@ -129,6 +129,8 @@ LF_IFUNC(v, chroma_intra, depth, avx) · 128 unmodified lines
129LF_FUNCS(uint8_t, 8)129LF_FUNCS(uint8_t, 8)
130LF_FUNCS(uint16_t, 10)130LF_FUNCS(uint16_t, 10)
131 131
132void ff_deblock_h_chroma422_8_mmxext(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0);
133
132#if ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL134#if ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL
133LF_FUNC(v8, luma, 8, mmxext)135LF_FUNC(v8, luma, 8, mmxext)
134static void deblock_v_luma_8_mmxext(uint8_t *pix, int stride, int alpha,136static void deblock_v_luma_8_mmxext(uint8_t *pix, int stride, int alpha,
@@ -245,6 +247,8 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, · 110 unmodified lines
245 if (chroma_format_idc <= 1) {247 if (chroma_format_idc <= 1) {
246 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_8_mmxext;248 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_8_mmxext;
247 c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_8_mmxext;249 c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_8_mmxext;
250 } else {
251 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_8_mmxext;
248 }252 }
249#if ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL253#if ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL
250 c->h264_v_loop_filter_luma = deblock_v_luma_8_mmxext;254 c->h264_v_loop_filter_luma = deblock_v_luma_8_mmxext;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t