1;*****************************************************************************
2;* Copyright 2016 Anton Khirnov
3;*
4;* This file is part of FFmpeg.
5;*
6;* FFmpeg is free software; you can redistribute it and/or
7;* modify it under the terms of the GNU Lesser General Public
8;* License as published by the Free Software Foundation; either
9;* version 2.1 of the License, or (at your option) any later version.
10;*
11;* FFmpeg is distributed in the hope that it will be useful,
12;* but WITHOUT ANY WARRANTY; without even the implied warranty of
13;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14;* Lesser General Public License for more details.
15;*
16;* You should have received a copy of the GNU Lesser General Public
17;* License along with FFmpeg; if not, write to the Free Software
18;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19;******************************************************************************
20
21%include "libavutil/x86/x86util.asm"
22
23SECTION .text
24
25INIT_XMM sse4
26cglobal image_copy_plane_uc_from, 6, 7, 4, dst, dst_linesize, src, src_linesize, bw, height, rowpos
27    add dstq, bwq
28    add srcq, bwq
29    neg bwq
30
31.row_start:
32    mov rowposq, bwq
33
34.loop:
35    movntdqa m0, [srcq + rowposq + 0 * mmsize]
36    movntdqa m1, [srcq + rowposq + 1 * mmsize]
37    movntdqa m2, [srcq + rowposq + 2 * mmsize]
38    movntdqa m3, [srcq + rowposq + 3 * mmsize]
39
40    mova [dstq + rowposq + 0 * mmsize], m0
41    mova [dstq + rowposq + 1 * mmsize], m1
42    mova [dstq + rowposq + 2 * mmsize], m2
43    mova [dstq + rowposq + 3 * mmsize], m3
44
45    add rowposq, 4 * mmsize
46    jnz .loop
47
48    add srcq, src_linesizeq
49    add dstq, dst_linesizeq
50    dec heightd
51    jnz .row_start
52
53    RET
54