1 ;******************************************************************************
2 ;* SIMD lossless video DSP utils
3 ;* Copyright (c) 2008 Loren Merritt
4 ;* Copyright (c) 2014 Michael Niedermayer
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 ;******************************************************************************
23 %include "libavutil/x86/x86util.asm"
27 pb_ef: times 8 db 14,15
28 pb_67: times 8 db 6, 7
29 pb_zzzz2323zzzzabab: db -1,-1,-1,-1, 2, 3, 2, 3,-1,-1,-1,-1,10,11,10,11
30 pb_zzzzzzzz67676767: db -1,-1,-1,-1,-1,-1,-1,-1, 6, 7, 6, 7, 6, 7, 6, 7
34 %macro ADD_INT16_LOOP 1 ; %1 = is_aligned
57 mova m2, [srcq+wq+mmsize]
58 mova m3, [dstq+wq+mmsize]
62 movu m2, [srcq+wq+mmsize]
63 movu m3, [dstq+wq+mmsize]
71 mova [dstq+wq+mmsize], m2
74 movu [dstq+wq+mmsize], m2
83 cglobal add_int16, 4,4,5, dst, src, mask, w
87 cglobal add_int16, 4,4,5, dst, src, mask, w
96 %macro ADD_HFYU_LEFT_LOOP_INT16 2 ; %1 = dst_is_aligned, %2 = src_is_aligned
126 movhps [dstq+wq+8], m0
141 ; int add_hfyu_left_prediction_int16(uint16_t *dst, const uint16_t *src, unsigned mask, int w, int left)
143 cglobal add_hfyu_left_prediction_int16, 4,4,8, dst, src, mask, w, left
146 mova m3, [pb_zzzz2323zzzzabab]
151 ADD_HFYU_LEFT_LOOP_INT16 1, 1
154 cglobal add_hfyu_left_prediction_int16, 4,4,8, dst, src, mask, w, left
156 mova m4, [pb_zzzzzzzz67676767]
157 mova m3, [pb_zzzz2323zzzzabab]
166 ADD_HFYU_LEFT_LOOP_INT16 1, 1
168 ADD_HFYU_LEFT_LOOP_INT16 0, 1
170 ADD_HFYU_LEFT_LOOP_INT16 0, 0