FFmpeg
Loading...
Searching...
No Matches
dsp.h
Go to the documentation of this file.
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_HEVC_DSP_H
26#define AVCODEC_X86_HEVC_DSP_H
27
28#include <stddef.h>
29#include <stdint.h>
30
31typedef void bi_pel_func(uint8_t *_dst, ptrdiff_t _dststride,
32 const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2,
33 int height, intptr_t mx, intptr_t my, int width);
34
35#define BI_PEL_PROTOTYPE(name, W, D, opt) \
36bi_pel_func ff_hevc_put_bi_ ## name ## W ## _ ## D ## _##opt
37
38///////////////////////////////////////////////////////////////////////////////
39// MC functions
40///////////////////////////////////////////////////////////////////////////////
41
42#define WEIGHTING_PROTOTYPE(width, bitd, opt) \
43void ff_hevc_put_uni_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, const int16_t *_src, int height, int denom, int _wx, int _ox); \
44void ff_hevc_put_bi_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, const int16_t *_src, const int16_t *_src2, int height, int denom, int wx0, int wx1, int ox)
45
46#define WEIGHTING_PROTOTYPES(bitd, opt) \
47 WEIGHTING_PROTOTYPE(4, bitd, opt); \
48 WEIGHTING_PROTOTYPE(6, bitd, opt); \
49 WEIGHTING_PROTOTYPE(8, bitd, opt); \
50 WEIGHTING_PROTOTYPE(12, bitd, opt); \
51 WEIGHTING_PROTOTYPE(16, bitd, opt); \
52 WEIGHTING_PROTOTYPE(24, bitd, opt); \
53 WEIGHTING_PROTOTYPE(32, bitd, opt); \
54 WEIGHTING_PROTOTYPE(48, bitd, opt); \
55 WEIGHTING_PROTOTYPE(64, bitd, opt)
56
57
58///////////////////////////////////////////////////////////////////////////////
59// EPEL_PIXELS
60///////////////////////////////////////////////////////////////////////////////
61
62BI_PEL_PROTOTYPE(pel_pixels, 4, 8, sse4);
63BI_PEL_PROTOTYPE(pel_pixels, 4, 10, sse4);
64BI_PEL_PROTOTYPE(pel_pixels, 4, 12, sse4);
65BI_PEL_PROTOTYPE(pel_pixels, 6, 8, sse4);
66BI_PEL_PROTOTYPE(pel_pixels, 6, 10, sse4);
67BI_PEL_PROTOTYPE(pel_pixels, 6, 12, sse4);
68BI_PEL_PROTOTYPE(pel_pixels, 8, 8, sse4);
69BI_PEL_PROTOTYPE(pel_pixels, 8, 10, sse4);
70BI_PEL_PROTOTYPE(pel_pixels, 8, 12, sse4);
71BI_PEL_PROTOTYPE(pel_pixels, 12, 8, sse4);
72BI_PEL_PROTOTYPE(pel_pixels, 16, 8, sse4);
73BI_PEL_PROTOTYPE(pel_pixels, 16, 10, avx2);
74BI_PEL_PROTOTYPE(pel_pixels, 32, 8, avx2);
75
76///////////////////////////////////////////////////////////////////////////////
77// EPEL
78///////////////////////////////////////////////////////////////////////////////
79
80BI_PEL_PROTOTYPE(epel_h, 4, 8, sse4);
81BI_PEL_PROTOTYPE(epel_h, 4, 10, sse4);
82BI_PEL_PROTOTYPE(epel_h, 4, 12, sse4);
83BI_PEL_PROTOTYPE(epel_h, 6, 8, sse4);
84BI_PEL_PROTOTYPE(epel_h, 6, 10, sse4);
85BI_PEL_PROTOTYPE(epel_h, 6, 12, sse4);
86BI_PEL_PROTOTYPE(epel_h, 8, 8, sse4);
87BI_PEL_PROTOTYPE(epel_h, 8, 10, sse4);
88BI_PEL_PROTOTYPE(epel_h, 8, 12, sse4);
89BI_PEL_PROTOTYPE(epel_h, 12, 8, sse4);
90BI_PEL_PROTOTYPE(epel_h, 16, 8, sse4);
91BI_PEL_PROTOTYPE(epel_h, 16, 10, avx2);
92BI_PEL_PROTOTYPE(epel_h, 32, 8, avx2);
93
94BI_PEL_PROTOTYPE(epel_hv, 4, 8, sse4);
95BI_PEL_PROTOTYPE(epel_hv, 4, 10, sse4);
96BI_PEL_PROTOTYPE(epel_hv, 4, 12, sse4);
97BI_PEL_PROTOTYPE(epel_hv, 6, 8, sse4);
98BI_PEL_PROTOTYPE(epel_hv, 6, 10, sse4);
99BI_PEL_PROTOTYPE(epel_hv, 6, 12, sse4);
100BI_PEL_PROTOTYPE(epel_hv, 8, 8, sse4);
101BI_PEL_PROTOTYPE(epel_hv, 8, 10, sse4);
102BI_PEL_PROTOTYPE(epel_hv, 8, 12, sse4);
103BI_PEL_PROTOTYPE(epel_hv, 16, 8, sse4);
104BI_PEL_PROTOTYPE(epel_hv, 16, 10, avx2);
105BI_PEL_PROTOTYPE(epel_hv, 32, 8, avx2);
106
107BI_PEL_PROTOTYPE(epel_v, 4, 8, sse4);
108BI_PEL_PROTOTYPE(epel_v, 4, 10, sse4);
109BI_PEL_PROTOTYPE(epel_v, 4, 12, sse4);
110BI_PEL_PROTOTYPE(epel_v, 6, 8, sse4);
111BI_PEL_PROTOTYPE(epel_v, 6, 10, sse4);
112BI_PEL_PROTOTYPE(epel_v, 6, 12, sse4);
113BI_PEL_PROTOTYPE(epel_v, 8, 8, sse4);
114BI_PEL_PROTOTYPE(epel_v, 8, 10, sse4);
115BI_PEL_PROTOTYPE(epel_v, 8, 12, sse4);
116BI_PEL_PROTOTYPE(epel_v, 12, 8, sse4);
117BI_PEL_PROTOTYPE(epel_v, 16, 8, sse4);
118BI_PEL_PROTOTYPE(epel_v, 16, 10, avx2);
119BI_PEL_PROTOTYPE(epel_v, 32, 8, avx2);
120
121///////////////////////////////////////////////////////////////////////////////
122// QPEL
123///////////////////////////////////////////////////////////////////////////////
124
125BI_PEL_PROTOTYPE(qpel_h, 4, 8, sse4);
126BI_PEL_PROTOTYPE(qpel_h, 4, 10, sse4);
127BI_PEL_PROTOTYPE(qpel_h, 4, 12, sse4);
128BI_PEL_PROTOTYPE(qpel_h, 8, 8, sse4);
129BI_PEL_PROTOTYPE(qpel_h, 8, 10, sse4);
130BI_PEL_PROTOTYPE(qpel_h, 8, 12, sse4);
131BI_PEL_PROTOTYPE(qpel_h, 12, 8, sse4);
132BI_PEL_PROTOTYPE(qpel_h, 16, 8, sse4);
133BI_PEL_PROTOTYPE(qpel_h, 16, 10, avx2);
134BI_PEL_PROTOTYPE(qpel_h, 32, 8, avx2);
135
136BI_PEL_PROTOTYPE(qpel_hv, 4, 8, sse4);
137BI_PEL_PROTOTYPE(qpel_hv, 4, 10, sse4);
138BI_PEL_PROTOTYPE(qpel_hv, 4, 12, sse4);
139BI_PEL_PROTOTYPE(qpel_hv, 8, 8, sse4);
140BI_PEL_PROTOTYPE(qpel_hv, 8, 10, sse4);
141BI_PEL_PROTOTYPE(qpel_hv, 8, 12, sse4);
142BI_PEL_PROTOTYPE(qpel_hv, 16, 10, avx2);
143
144BI_PEL_PROTOTYPE(qpel_v, 4, 8, sse4);
145BI_PEL_PROTOTYPE(qpel_v, 4, 10, sse4);
146BI_PEL_PROTOTYPE(qpel_v, 4, 12, sse4);
147BI_PEL_PROTOTYPE(qpel_v, 8, 8, sse4);
148BI_PEL_PROTOTYPE(qpel_v, 8, 10, sse4);
149BI_PEL_PROTOTYPE(qpel_v, 8, 12, sse4);
150BI_PEL_PROTOTYPE(qpel_v, 12, 8, sse4);
151BI_PEL_PROTOTYPE(qpel_v, 16, 8, sse4);
152BI_PEL_PROTOTYPE(qpel_v, 16, 10, avx2);
153BI_PEL_PROTOTYPE(qpel_v, 32, 8, avx2);
154
158
159void ff_hevc_put_qpel_h4_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width);
160void ff_hevc_put_qpel_h8_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width);
161void ff_hevc_put_qpel_h16_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width);
162void ff_hevc_put_qpel_h32_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width);
163void ff_hevc_put_qpel_h64_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width);
164void ff_hevc_put_qpel_hv8_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width);
165
166///////////////////////////////////////////////////////////////////////////////
167// TRANSFORM_ADD
168///////////////////////////////////////////////////////////////////////////////
169
170void ff_hevc_add_residual_4_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
171void ff_hevc_add_residual_8_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
172void ff_hevc_add_residual_16_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
173void ff_hevc_add_residual_32_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
174
175void ff_hevc_add_residual_32_8_avx2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
176
177void ff_hevc_add_residual_4_10_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
178void ff_hevc_add_residual_8_10_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
179void ff_hevc_add_residual_16_10_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
180void ff_hevc_add_residual_32_10_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
181
182void ff_hevc_add_residual_16_10_avx2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
183void ff_hevc_add_residual_32_10_avx2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
184
185#endif // AVCODEC_X86_HEVC_DSP_H
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t my
Definition dsp.h:57
uint8_t ptrdiff_t _dststride
Definition dsp.h:56
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t mx
Definition dsp.h:57
uint8_t * _dst
Definition dsp.h:56
uint8_t ptrdiff_t const uint8_t ptrdiff_t _srcstride
Definition dsp.h:57
uint8_t ptrdiff_t const uint8_t * _src
Definition dsp.h:56
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
const pixel * src2
#define stride
#define height
Definition dsp.h:89
#define width
Definition dsp.h:89
void ff_hevc_add_residual_32_10_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride)
void ff_hevc_add_residual_16_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride)
void ff_hevc_add_residual_16_10_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride)
void ff_hevc_put_qpel_h64_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_add_residual_32_8_avx2(uint8_t *dst, const int16_t *res, ptrdiff_t stride)
void ff_hevc_add_residual_4_10_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride)
void ff_hevc_put_qpel_h32_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
#define WEIGHTING_PROTOTYPES(bitd, opt)
Definition dsp.h:46
void ff_hevc_add_residual_32_10_avx2(uint8_t *dst, const int16_t *res, ptrdiff_t stride)
void ff_hevc_add_residual_16_10_avx2(uint8_t *dst, const int16_t *res, ptrdiff_t stride)
void ff_hevc_put_qpel_h8_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_put_qpel_h4_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void bi_pel_func(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width)
Definition dsp.h:31
void ff_hevc_put_qpel_h16_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
#define BI_PEL_PROTOTYPE(name, W, D, opt)
Definition dsp.h:35
void ff_hevc_add_residual_8_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride)
void ff_hevc_add_residual_8_10_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride)
void ff_hevc_add_residual_32_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride)
void ff_hevc_put_qpel_hv8_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width)
void ff_hevc_add_residual_4_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride)