1 ;*****************************************************************************
2 ;* x86-optimized functions for atadenoise filter
4 ;* Copyright (C) 2019 Paul B Mahol
6 ;* This file is part of FFmpeg.
8 ;* FFmpeg is free software; you can redistribute it and/or
9 ;* modify it under the terms of the GNU Lesser General Public
10 ;* License as published by the Free Software Foundation; either
11 ;* version 2.1 of the License, or (at your option) any later version.
13 ;* FFmpeg is distributed in the hope that it will be useful,
14 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ;* Lesser General Public License for more details.
18 ;* You should have received a copy of the GNU Lesser General Public
19 ;* License along with FFmpeg; if not, write to the Free Software
20 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 ;******************************************************************************
25 %include "libavutil/x86/x86util.asm"
29 pw_ones: times 8 dw 65535
33 ;------------------------------------------------------------------------------
34 ; void ff_filter_row(const uint8_t *src, uint8_t *dst,
35 ; const uint8_t **srcf,
36 ; int w, int mid, int size,
38 ;------------------------------------------------------------------------------
41 cglobal atadenoise_filter_row8, 8,10,13, src, dst, srcf, w, mid, size, i, j, srcfx, x
43 movsxdifnidn midq, midd
44 movsxdifnidn sizeq, sized
72 mov srcfxq, [srcfq + jq * 8]
75 movu m1, [srcfxq + xq]
93 mov srcfxq, [srcfq + iq * 8]
96 movu m1, [srcfxq + xq]
148 movd [dstq + xq + 4], m1
155 cglobal atadenoise_filter_row8_serial, 8,10,13, src, dst, srcf, w, mid, size, i, j, srcfx, x
157 movsxdifnidn midq, midd
158 movsxdifnidn sizeq, sized
185 mov srcfxq, [srcfq + jq * 8]
188 movu m1, [srcfxq + xq]
218 mov srcfxq, [srcfq + iq * 8]
221 movu m1, [srcfxq + xq]
273 movd [dstq + xq + 4], m1