Commit 8dba3fb8 authored by James Almer's avatar James Almer

x86/vf_blend: add sse2 versions of blend_difference and blend_negation

Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 02f42805
...@@ -176,7 +176,7 @@ BLEND_INIT phoenix, 4 ...@@ -176,7 +176,7 @@ BLEND_INIT phoenix, 4
jl .loop jl .loop
BLEND_END BLEND_END
INIT_XMM ssse3 %macro BLEND_ABS 0
BLEND_INIT difference, 3 BLEND_INIT difference, 3
pxor m2, m2 pxor m2, m2
.nextrow: .nextrow:
...@@ -188,7 +188,7 @@ BLEND_INIT difference, 3 ...@@ -188,7 +188,7 @@ BLEND_INIT difference, 3
punpcklbw m0, m2 punpcklbw m0, m2
punpcklbw m1, m2 punpcklbw m1, m2
psubw m0, m1 psubw m0, m1
pabsw m0, m0 ABS1 m0, m1
packuswb m0, m0 packuswb m0, m0
movh [dstq + xq], m0 movh [dstq + xq], m0
add xq, mmsize / 2 add xq, mmsize / 2
...@@ -209,7 +209,7 @@ BLEND_INIT negation, 5 ...@@ -209,7 +209,7 @@ BLEND_INIT negation, 5
mova m3, m4 mova m3, m4
psubw m3, m0 psubw m3, m0
psubw m3, m1 psubw m3, m1
pabsw m3, m3 ABS1 m3, m1
mova m0, m4 mova m0, m4
psubw m0, m3 psubw m0, m3
packuswb m0, m0 packuswb m0, m0
...@@ -217,3 +217,9 @@ BLEND_INIT negation, 5 ...@@ -217,3 +217,9 @@ BLEND_INIT negation, 5
add xq, mmsize / 2 add xq, mmsize / 2
jl .loop jl .loop
BLEND_END BLEND_END
%endmacro
INIT_XMM sse2
BLEND_ABS
INIT_XMM ssse3
BLEND_ABS
...@@ -42,7 +42,9 @@ BLEND_FUNC(or, sse2) ...@@ -42,7 +42,9 @@ BLEND_FUNC(or, sse2)
BLEND_FUNC(phoenix, sse2) BLEND_FUNC(phoenix, sse2)
BLEND_FUNC(subtract, sse2) BLEND_FUNC(subtract, sse2)
BLEND_FUNC(xor, sse2) BLEND_FUNC(xor, sse2)
BLEND_FUNC(difference, sse2)
BLEND_FUNC(difference, ssse3) BLEND_FUNC(difference, ssse3)
BLEND_FUNC(negation, sse2)
BLEND_FUNC(negation, ssse3) BLEND_FUNC(negation, ssse3)
av_cold void ff_blend_init_x86(FilterParams *param, int is_16bit) av_cold void ff_blend_init_x86(FilterParams *param, int is_16bit)
...@@ -63,6 +65,8 @@ av_cold void ff_blend_init_x86(FilterParams *param, int is_16bit) ...@@ -63,6 +65,8 @@ av_cold void ff_blend_init_x86(FilterParams *param, int is_16bit)
case BLEND_PHOENIX: param->blend = ff_blend_phoenix_sse2; break; case BLEND_PHOENIX: param->blend = ff_blend_phoenix_sse2; break;
case BLEND_SUBTRACT: param->blend = ff_blend_subtract_sse2; break; case BLEND_SUBTRACT: param->blend = ff_blend_subtract_sse2; break;
case BLEND_XOR: param->blend = ff_blend_xor_sse2; break; case BLEND_XOR: param->blend = ff_blend_xor_sse2; break;
case BLEND_DIFFERENCE: param->blend = ff_blend_difference_sse2; break;
case BLEND_NEGATION: param->blend = ff_blend_negation_sse2; break;
} }
} }
if (EXTERNAL_SSSE3(cpu_flags) && param->opacity == 1 && !is_16bit) { if (EXTERNAL_SSSE3(cpu_flags) && param->opacity == 1 && !is_16bit) {
......
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