1 ;*****************************************************************************
2 ;* x86-optimized functions for framerate filter
4 ;* Copyright (C) 2018 Marton Balint
6 ;* Based on vf_blend.asm, Copyright (C) 2015 Paul B Mahol
8 ;* This file is part of FFmpeg.
10 ;* FFmpeg is free software; you can redistribute it and/or
11 ;* modify it under the terms of the GNU Lesser General Public
12 ;* License as published by the Free Software Foundation; either
13 ;* version 2.1 of the License, or (at your option) any later version.
15 ;* FFmpeg is distributed in the hope that it will be useful,
16 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;* Lesser General Public License for more details.
20 ;* You should have received a copy of the GNU Lesser General Public
21 ;* License along with FFmpeg; if not, write to the Free Software
22 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 ;******************************************************************************
25 %include "libavutil/x86/x86util.asm"
46 cglobal blend_frames%1, 6, 9, 5, src1, src1_linesize, src2, src2_linesize, dst, dst_linesize, width, end, x
47 mov widthd, dword widthm
49 cglobal blend_frames%1, 5, 7, 5, src1, src1_linesize, src2, src2_linesize, dst, end, x
50 %define dst_linesizeq r5mp
68 SBUTTERFLY %1%2, 0, 1, 4 ; aAbBcCdD
75 psrl%2 m0, %4 ; 0A0B0C0D
76 psrl%2 m1, %4 ; 0E0F0G0H
78 packus%2%1 m0, m1 ; ABCDEFGH
82 add src1q, src1_linesizeq
83 add src2q, src2_linesizeq
84 add dstq, dst_linesizeq
94 XSPLAT m2, r8m, w ; factor1
95 XSPLAT m3, r9m, w ; factor2
98 por m2, m3 ; interleaved factors
100 XSPLAT m3, r10m, w ; half
102 BLEND_LOOP b, w, ubsw, 7
106 %macro BLEND_FRAMES16 0
109 XSPLAT m2, r8m, d ; factor1
110 XSPLAT m3, r9m, d ; factor2
113 por m2, m3 ; interleaved factors
115 XSPLAT m3, r10m, d ; half
117 BLEND_LOOP w, d, wd, 15
128 %if HAVE_AVX2_EXTERNAL