Commit 7a4cf671 authored by Anton Khirnov's avatar Anton Khirnov Committed by Michael Niedermayer

hevc: cleaning up SSE2 and SSSE3 deblocking filters

Signed-off-by: 's avatarMickaël Raulet <mraulet@insa-rennes.fr>

cherry picked from commit b432041d7d1eca38831590f13b4e5baffff8186f
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 5f08b417
......@@ -329,8 +329,10 @@ ALIGN 16
paddw m5, [pw_4]; +4
psraw m5, 3; >> 3
%if %1 > 8
psllw m4, %1-8; << (BIT_DEPTH - 8)
psllw m6, %1-8; << (BIT_DEPTH - 8)
%endif
pmaxsw m5, m4
pminsw m5, m6
paddw m1, m5; p0 + delta0
......@@ -420,11 +422,15 @@ ALIGN 16
;decide between strong and weak filtering
;tc25 calculations
mov r2d, [tcq];
%if %1 > 8
shl r2, %1 - 8
%endif
movd m8, r2d; tc0
add tcq, 4;
mov r3d, [tcq];
%if %1 > 8
shl r3, %1 - 8
%endif
movd m9, r3d; tc1
add r2d, r3d; tc0 + tc1
jz .bypassluma
......@@ -734,7 +740,7 @@ cglobal hevc_h_loop_filter_chroma_10, 3, 4, 7, pix, stride, tc, pix0
;-----------------------------------------------------------------------------
cglobal hevc_v_loop_filter_luma_8, 4, 15, 16, pix, stride, beta, tc
sub r0, 4
lea r5, [3*r1]
lea r5, [3 * r1]
mov r6, r0
add r0, r5
TRANSPOSE8x8B_LOAD PASS8ROWS(r6, r0, r1, r5)
......@@ -746,7 +752,7 @@ cglobal hevc_v_loop_filter_luma_8, 4, 15, 16, pix, stride, beta, tc
cglobal hevc_v_loop_filter_luma_10, 4, 15, 16, pix, stride, beta, tc
sub pixq, 8
lea r5, [3*strideq]
lea r5, [3 * strideq]
mov r6, pixq
add pixq, r5
TRANSPOSE8x8W_LOAD PASS8ROWS(r6, pixq, strideq, r5)
......@@ -760,18 +766,18 @@ cglobal hevc_v_loop_filter_luma_10, 4, 15, 16, pix, stride, beta, tc
; void ff_hevc_h_loop_filter_luma(uint8_t *_pix, ptrdiff_t _stride, int *_beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
;-----------------------------------------------------------------------------
cglobal hevc_h_loop_filter_luma_8, 4, 15, 16, pix, stride, beta, tc, count, pix0, src3stride
lea src3strideq, [3*strideq]
lea src3strideq, [3 * strideq]
mov pix0q, pixq
sub pix0q, src3strideq
sub pix0q, strideq
movdqu m0, [pix0q]; p3
movdqu m1, [pix0q+strideq]; p2
movdqu m2, [pix0q+2*strideq]; p1
movdqu m3, [pix0q+src3strideq]; p0
movdqu m1, [pix0q + strideq]; p2
movdqu m2, [pix0q + 2 * strideq]; p1
movdqu m3, [pix0q + src3strideq]; p0
movdqu m4, [pixq]; q0
movdqu m5, [pixq+strideq]; q1
movdqu m6, [pixq+2*strideq]; q2
movdqu m7, [pixq+src3strideq]; q3
movdqu m5, [pixq + strideq]; q1
movdqu m6, [pixq + 2 * strideq]; q2
movdqu m7, [pixq + src3strideq]; q3
pxor m8, m8
punpcklbw m0, m8
punpcklbw m1, m8
......@@ -799,18 +805,18 @@ cglobal hevc_h_loop_filter_luma_8, 4, 15, 16, pix, stride, beta, tc, count, pix0
RET
cglobal hevc_h_loop_filter_luma_10, 4, 15, 16, pix, stride, beta, tc, count, pix0, src3stride
lea src3strideq, [3*strideq]
lea src3strideq, [3 * strideq]
mov pix0q, pixq
sub pix0q, src3strideq
sub pix0q, strideq
movdqu m0, [pix0q]; p3
movdqu m1, [pix0q+strideq]; p2
movdqu m2, [pix0q+2*strideq]; p1
movdqu m3, [pix0q+src3strideq]; p0
movdqu m1, [pix0q + strideq]; p2
movdqu m2, [pix0q + 2 * strideq]; p1
movdqu m3, [pix0q + src3strideq]; p0
movdqu m4, [pixq]; q0
movdqu m5, [pixq+strideq]; q1
movdqu m6, [pixq+2*strideq]; q2
movdqu m7, [pixq+src3strideq]; q3
movdqu m5, [pixq + strideq]; q1
movdqu m6, [pixq + 2 * strideq]; q2
movdqu m7, [pixq + src3strideq]; q3
LUMA_DEBLOCK_BODY 10, h
.store:
pxor m8, m8; zeros reg
......@@ -820,12 +826,12 @@ cglobal hevc_h_loop_filter_luma_10, 4, 15, 16, pix, stride, beta, tc, count, pix
CLIPW m4, m8, [pw_pixel_max]
CLIPW m5, m8, [pw_pixel_max]
CLIPW m6, m8, [pw_pixel_max]
movdqu [pix0q+strideq], m1; p2
movdqu [pix0q+2*strideq], m2; p1
movdqu [pix0q+src3strideq], m3; p0
movdqu [pixq], m4; q0
movdqu [pixq+strideq], m5; q1
movdqu [pixq+2*strideq], m6; q2
movdqu [pix0q + strideq], m1; p2
movdqu [pix0q + 2 * strideq], m2; p1
movdqu [pix0q + src3strideq], m3; p0
movdqu [pixq ], m4; q0
movdqu [pixq + strideq], m5; q1
movdqu [pixq + 2 * strideq], m6; q2
.bypassluma:
RET
%endmacro
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment