]> git.sesse.net Git - ffmpeg/blob - libavcodec/x86/fpel.asm
x86: Make function prototype comments in assembly code consistent
[ffmpeg] / libavcodec / x86 / fpel.asm
1 ;******************************************************************************
2 ;* SIMD-optimized fullpel functions
3 ;* Copyright (c) 2008 Loren Merritt
4 ;* Copyright (c) 2003-2013 Michael Niedermayer
5 ;* Copyright (c) 2013 Daniel Kang
6 ;*
7 ;* This file is part of Libav.
8 ;*
9 ;* Libav is free software; you can redistribute it and/or
10 ;* modify it under the terms of the GNU Lesser General Public
11 ;* License as published by the Free Software Foundation; either
12 ;* version 2.1 of the License, or (at your option) any later version.
13 ;*
14 ;* Libav is distributed in the hope that it will be useful,
15 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 ;* Lesser General Public License for more details.
18 ;*
19 ;* You should have received a copy of the GNU Lesser General Public
20 ;* License along with Libav; if not, write to the Free Software
21 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 ;******************************************************************************
23
24 %include "libavutil/x86/x86util.asm"
25
26 SECTION .text
27
28 INIT_MMX mmxext
29 ; void ff_put/avg_pixels(uint8_t *block, const uint8_t *pixels,
30 ;                        ptrdiff_t line_size, int h)
31 %macro PIXELS48 2
32 %if %2 == 4
33 %define OP movh
34 %else
35 %define OP mova
36 %endif
37 cglobal %1_pixels%2, 4,5
38     movsxdifnidn r2, r2d
39     lea          r4, [r2*3]
40 .loop:
41     OP           m0, [r1]
42     OP           m1, [r1+r2]
43     OP           m2, [r1+r2*2]
44     OP           m3, [r1+r4]
45     lea          r1, [r1+r2*4]
46 %ifidn %1, avg
47     pavgb        m0, [r0]
48     pavgb        m1, [r0+r2]
49     pavgb        m2, [r0+r2*2]
50     pavgb        m3, [r0+r4]
51 %endif
52     OP         [r0], m0
53     OP      [r0+r2], m1
54     OP    [r0+r2*2], m2
55     OP      [r0+r4], m3
56     sub         r3d, 4
57     lea          r0, [r0+r2*4]
58     jne       .loop
59     RET
60 %endmacro
61
62 PIXELS48 put, 4
63 PIXELS48 avg, 4
64 PIXELS48 put, 8
65 PIXELS48 avg, 8
66
67
68 INIT_XMM sse2
69 ; void ff_put_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
70 ;                           ptrdiff_t line_size, int h)
71 cglobal put_pixels16, 4,5,4
72     lea          r4, [r2*3]
73 .loop:
74     movu         m0, [r1]
75     movu         m1, [r1+r2]
76     movu         m2, [r1+r2*2]
77     movu         m3, [r1+r4]
78     lea          r1, [r1+r2*4]
79     mova       [r0], m0
80     mova    [r0+r2], m1
81     mova  [r0+r2*2], m2
82     mova    [r0+r4], m3
83     sub         r3d, 4
84     lea          r0, [r0+r2*4]
85     jnz       .loop
86     REP_RET
87
88 ; void ff_avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
89 ;                           ptrdiff_t line_size, int h)
90 cglobal avg_pixels16, 4,5,4
91     lea          r4, [r2*3]
92 .loop:
93     movu         m0, [r1]
94     movu         m1, [r1+r2]
95     movu         m2, [r1+r2*2]
96     movu         m3, [r1+r4]
97     lea          r1, [r1+r2*4]
98     pavgb        m0, [r0]
99     pavgb        m1, [r0+r2]
100     pavgb        m2, [r0+r2*2]
101     pavgb        m3, [r0+r4]
102     mova       [r0], m0
103     mova    [r0+r2], m1
104     mova  [r0+r2*2], m2
105     mova    [r0+r4], m3
106     sub         r3d, 4
107     lea          r0, [r0+r2*4]
108     jnz       .loop
109     REP_RET