| 1 | ;***************************************************************************** |
| 2 | ;* x86-optimized functions for interlace filter |
| 3 | ;* |
| 4 | ;* Copyright (C) 2014 Kieran Kunhya <kierank@obe.tv> |
| 5 | ;* Copyright (c) 2014 Michael Niedermayer <michaelni@gmx.at> |
| 6 | ;* |
| 7 | ;* This file is part of FFmpeg. |
| 8 | ;* |
| 9 | ;* FFmpeg is free software; you can redistribute it and/or modify |
| 10 | ;* it under the terms of the GNU General Public License as published by |
| 11 | ;* the Free Software Foundation; either version 2 of the License, or |
| 12 | ;* (at your option) any later version. |
| 13 | ;* |
| 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 |
| 17 | ;* GNU General Public License for more details. |
| 18 | ;* |
| 19 | ;* You should have received a copy of the GNU General Public License along |
| 20 | ;* with FFmpeg; if not, write to the Free Software Foundation, Inc., |
| 21 | ;* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 22 | ;****************************************************************************** |
| 23 | |
| 24 | %include "libavutil/x86/x86util.asm" |
| 25 | |
| 26 | SECTION_RODATA |
| 27 | |
| 28 | SECTION .text |
| 29 | |
| 30 | %macro LOWPASS_LINE 0 |
| 31 | cglobal lowpass_line, 5, 5, 7 |
| 32 | add r0, r1 |
| 33 | add r2, r1 |
| 34 | add r3, r1 |
| 35 | add r4, r1 |
| 36 | neg r1 |
| 37 | |
| 38 | pcmpeqb m6, m6 |
| 39 | |
| 40 | .loop |
| 41 | mova m0, [r3+r1] |
| 42 | mova m1, [r3+r1+mmsize] |
| 43 | pavgb m0, [r4+r1] |
| 44 | pavgb m1, [r4+r1+mmsize] |
| 45 | pxor m0, m6 |
| 46 | pxor m1, m6 |
| 47 | pxor m2, m6, [r2+r1] |
| 48 | pxor m3, m6, [r2+r1+mmsize] |
| 49 | pavgb m0, m2 |
| 50 | pavgb m1, m3 |
| 51 | pxor m0, m6 |
| 52 | pxor m1, m6 |
| 53 | mova [r0+r1], m0 |
| 54 | mova [r0+r1+mmsize], m1 |
| 55 | |
| 56 | add r1, 2*mmsize |
| 57 | jl .loop |
| 58 | REP_RET |
| 59 | %endmacro |
| 60 | |
| 61 | INIT_XMM sse2 |
| 62 | LOWPASS_LINE |
| 63 | |
| 64 | INIT_XMM avx |
| 65 | LOWPASS_LINE |