Imported Debian version 2.5.0~trusty1.1
[deb_ffmpeg.git] / ffmpeg / libavcodec / x86 / hevcdsp.h
CommitLineData
2ba45a60
DM
1/*
2 * HEVC video decoder
3 *
4 * Copyright (C) 2012 - 2013 Guillaume Martres
5 * Copyright (C) 2013 - 2014 Pierre-Edouard Lepere
6 *
7 *
8 * This file is part of FFmpeg.
9 *
10 * FFmpeg is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * FFmpeg is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with FFmpeg; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24
25#ifndef AVCODEC_X86_HEVCDSP_H
26#define AVCODEC_X86_HEVCDSP_H
27
28#include <stddef.h>
29#include <stdint.h>
30
31
32#define idct_dc_proto(size, bitd, opt) \
33 void ff_hevc_idct##size##_dc_add_##bitd##_##opt(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride)
34
35#define PEL_LINK(dst, idx1, idx2, idx3, name, D, opt) \
36dst[idx1][idx2][idx3] = ff_hevc_put_hevc_ ## name ## _ ## D ## _##opt; \
37dst ## _bi[idx1][idx2][idx3] = ff_hevc_put_hevc_bi_ ## name ## _ ## D ## _##opt; \
38dst ## _uni[idx1][idx2][idx3] = ff_hevc_put_hevc_uni_ ## name ## _ ## D ## _##opt; \
39dst ## _uni_w[idx1][idx2][idx3] = ff_hevc_put_hevc_uni_w_ ## name ## _ ## D ## _##opt; \
40dst ## _bi_w[idx1][idx2][idx3] = ff_hevc_put_hevc_bi_w_ ## name ## _ ## D ## _##opt
41
42
43#define PEL_PROTOTYPE(name, D, opt) \
44void ff_hevc_put_hevc_ ## name ## _ ## D ## _##opt(int16_t *dst, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); \
45void ff_hevc_put_hevc_bi_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, intptr_t mx, intptr_t my, int width); \
46void ff_hevc_put_hevc_uni_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width); \
47void ff_hevc_put_hevc_uni_w_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width); \
48void ff_hevc_put_hevc_bi_w_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width)
49
50
51///////////////////////////////////////////////////////////////////////////////
52// MC functions
53///////////////////////////////////////////////////////////////////////////////
54
55#define EPEL_PROTOTYPES(fname, bitd, opt) \
56 PEL_PROTOTYPE(fname##4, bitd, opt); \
57 PEL_PROTOTYPE(fname##6, bitd, opt); \
58 PEL_PROTOTYPE(fname##8, bitd, opt); \
59 PEL_PROTOTYPE(fname##12, bitd, opt); \
60 PEL_PROTOTYPE(fname##16, bitd, opt); \
61 PEL_PROTOTYPE(fname##24, bitd, opt); \
62 PEL_PROTOTYPE(fname##32, bitd, opt); \
63 PEL_PROTOTYPE(fname##48, bitd, opt); \
64 PEL_PROTOTYPE(fname##64, bitd, opt)
65
66#define QPEL_PROTOTYPES(fname, bitd, opt) \
67 PEL_PROTOTYPE(fname##4, bitd, opt); \
68 PEL_PROTOTYPE(fname##8, bitd, opt); \
69 PEL_PROTOTYPE(fname##12, bitd, opt); \
70 PEL_PROTOTYPE(fname##16, bitd, opt); \
71 PEL_PROTOTYPE(fname##24, bitd, opt); \
72 PEL_PROTOTYPE(fname##32, bitd, opt); \
73 PEL_PROTOTYPE(fname##48, bitd, opt); \
74 PEL_PROTOTYPE(fname##64, bitd, opt)
75
76#define WEIGHTING_PROTOTYPE(width, bitd, opt) \
77void ff_hevc_put_hevc_uni_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, int16_t *_src, ptrdiff_t _srcstride, int height, int denom, int _wx, int _ox); \
78void ff_hevc_put_hevc_bi_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, int16_t *_src, ptrdiff_t _srcstride, int16_t *_src2, int height, int denom, int _wx0, int _wx1, int _ox0, int _ox1)
79
80#define WEIGHTING_PROTOTYPES(bitd, opt) \
81 WEIGHTING_PROTOTYPE(2, bitd, opt); \
82 WEIGHTING_PROTOTYPE(4, bitd, opt); \
83 WEIGHTING_PROTOTYPE(6, bitd, opt); \
84 WEIGHTING_PROTOTYPE(8, bitd, opt); \
85 WEIGHTING_PROTOTYPE(12, bitd, opt); \
86 WEIGHTING_PROTOTYPE(16, bitd, opt); \
87 WEIGHTING_PROTOTYPE(24, bitd, opt); \
88 WEIGHTING_PROTOTYPE(32, bitd, opt); \
89 WEIGHTING_PROTOTYPE(48, bitd, opt); \
90 WEIGHTING_PROTOTYPE(64, bitd, opt)
91
92
93///////////////////////////////////////////////////////////////////////////////
94// QPEL_PIXELS EPEL_PIXELS
95///////////////////////////////////////////////////////////////////////////////
96EPEL_PROTOTYPES(pel_pixels , 8, sse4);
97EPEL_PROTOTYPES(pel_pixels , 10, sse4);
98EPEL_PROTOTYPES(pel_pixels , 12, sse4);
99///////////////////////////////////////////////////////////////////////////////
100// EPEL
101///////////////////////////////////////////////////////////////////////////////
102EPEL_PROTOTYPES(epel_h , 8, sse4);
103EPEL_PROTOTYPES(epel_h , 10, sse4);
104EPEL_PROTOTYPES(epel_h , 12, sse4);
105
106EPEL_PROTOTYPES(epel_v , 8, sse4);
107EPEL_PROTOTYPES(epel_v , 10, sse4);
108EPEL_PROTOTYPES(epel_v , 12, sse4);
109
110EPEL_PROTOTYPES(epel_hv , 8, sse4);
111EPEL_PROTOTYPES(epel_hv , 10, sse4);
112EPEL_PROTOTYPES(epel_hv , 12, sse4);
113
114///////////////////////////////////////////////////////////////////////////////
115// QPEL
116///////////////////////////////////////////////////////////////////////////////
117QPEL_PROTOTYPES(qpel_h , 8, sse4);
118QPEL_PROTOTYPES(qpel_h , 10, sse4);
119QPEL_PROTOTYPES(qpel_h , 12, sse4);
120
121QPEL_PROTOTYPES(qpel_v, 8, sse4);
122QPEL_PROTOTYPES(qpel_v, 10, sse4);
123QPEL_PROTOTYPES(qpel_v, 12, sse4);
124
125QPEL_PROTOTYPES(qpel_hv, 8, sse4);
126QPEL_PROTOTYPES(qpel_hv, 10, sse4);
127QPEL_PROTOTYPES(qpel_hv, 12, sse4);
128
129
130WEIGHTING_PROTOTYPES(8, sse4);
131WEIGHTING_PROTOTYPES(10, sse4);
132WEIGHTING_PROTOTYPES(12, sse4);
133
134///////////////////////////////////////////////////////////////////////////////
135// TRANSFORM_ADD
136///////////////////////////////////////////////////////////////////////////////
137void ff_hevc_transform_add4_8_mmxext(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
138void ff_hevc_transform_add8_8_sse2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
139void ff_hevc_transform_add16_8_sse2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
140void ff_hevc_transform_add32_8_sse2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
141
142void ff_hevc_transform_add8_8_avx(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
143void ff_hevc_transform_add16_8_avx(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
144void ff_hevc_transform_add32_8_avx(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
145
146void ff_hevc_transform_add32_8_avx2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
147
148void ff_hevc_transform_add4_10_mmxext(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
149void ff_hevc_transform_add8_10_sse2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
150void ff_hevc_transform_add16_10_sse2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
151void ff_hevc_transform_add32_10_sse2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
152
153void ff_hevc_transform_add16_10_avx2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
154void ff_hevc_transform_add32_10_avx2(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride);
155
156#endif // AVCODEC_X86_HEVCDSP_H