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
7 ;* This file is part of FFmpeg.
9 ;* FFmpeg 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.
14 ;* FFmpeg 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.
19 ;* You should have received a copy of the GNU Lesser General Public
20 ;* License along with FFmpeg; if not, write to the Free Software
21 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 ;******************************************************************************
24 %include "libavutil/x86/x86util.asm"
38 ; void ff_put/avg_pixels(uint8_t *block, const uint8_t *pixels,
39 ; ptrdiff_t line_size, int h)
50 cglobal %1_pixels%2, 4,5,4
54 %if notcpuflag(mmxext)
63 LOAD m1, [r1+r2 + %%i]
64 LOAD m2, [r1+r2*2 + %%i]
65 LOAD m3, [r1+r4 + %%i]
67 %if notcpuflag(mmxext)
68 PAVGB_MMX [r0 + %%i], m0, m4, m6
69 PAVGB_MMX [r0+r2 + %%i], m1, m5, m6
70 PAVGB_MMX [r0+r2*2 + %%i], m2, m4, m6
71 PAVGB_MMX [r0+r4 + %%i], m3, m5, m6
74 pavgb m1, [r0+r2 + %%i]
75 pavgb m2, [r0+r2*2 + %%i]
76 pavgb m3, [r0+r4 + %%i]
80 SAVE [r0+r2 + %%i], m1
81 SAVE [r0+r2*2 + %%i], m2
82 SAVE [r0+r4 + %%i], m3
83 %assign %%i %%i+mmsize