1 ;*******************************************************************************
2 ;* SIMD-optimized IDCT functions for HEVC decoding
3 ;* Copyright (c) 2014 Pierre-Edouard LEPERE
4 ;* Copyright (c) 2014 James Almer
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 ; void ff_hevc_idct_HxW_dc_{8,10}_<opt>(int16_t *coeffs)
29 ; %2 = number of loops
32 cglobal hevc_idct_%1x%1_dc_%3, 1, 2, 1, coeff, tmp
33 movsx tmpd, word [coeffq]
34 add tmpd, (1 << (14 - %3)) + 1
38 DEFINE_ARGS coeff, cnt
41 mova [coeffq+mmsize*0], m0
42 mova [coeffq+mmsize*1], m0
43 mova [coeffq+mmsize*2], m0
44 mova [coeffq+mmsize*3], m0
46 mova [coeffq+mmsize*-4], m0
47 mova [coeffq+mmsize*-3], m0
48 mova [coeffq+mmsize*-2], m0
49 mova [coeffq+mmsize*-1], m0
57 %macro IDCT_DC_NL 2 ; No loop
58 cglobal hevc_idct_%1x%1_dc_%2, 1, 2, 1, coeff, tmp
59 movsx tmpd, word [coeffq]
60 add tmpd, (1 << (14 - %2)) + 1
64 mova [coeffq+mmsize*0], m0
65 mova [coeffq+mmsize*1], m0
66 mova [coeffq+mmsize*2], m0
67 mova [coeffq+mmsize*3], m0
69 mova [coeffq+mmsize*4], m0
70 mova [coeffq+mmsize*5], m0
71 mova [coeffq+mmsize*6], m0
72 mova [coeffq+mmsize*7], m0
87 %if HAVE_AVX2_EXTERNAL
91 %endif ;HAVE_AVX2_EXTERNAL
103 %if HAVE_AVX2_EXTERNAL
107 %endif ;HAVE_AVX2_EXTERNAL
119 %if HAVE_AVX2_EXTERNAL
123 %endif ;HAVE_AVX2_EXTERNAL