xref: /third_party/ffmpeg/libavcodec/qpeldsp.h (revision cabdff1a)
1cabdff1aSopenharmony_ci/*
2cabdff1aSopenharmony_ci * quarterpel DSP functions
3cabdff1aSopenharmony_ci *
4cabdff1aSopenharmony_ci * This file is part of FFmpeg.
5cabdff1aSopenharmony_ci *
6cabdff1aSopenharmony_ci * FFmpeg is free software; you can redistribute it and/or
7cabdff1aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public
8cabdff1aSopenharmony_ci * License as published by the Free Software Foundation; either
9cabdff1aSopenharmony_ci * version 2.1 of the License, or (at your option) any later version.
10cabdff1aSopenharmony_ci *
11cabdff1aSopenharmony_ci * FFmpeg is distributed in the hope that it will be useful,
12cabdff1aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of
13cabdff1aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14cabdff1aSopenharmony_ci * Lesser General Public License for more details.
15cabdff1aSopenharmony_ci *
16cabdff1aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public
17cabdff1aSopenharmony_ci * License along with FFmpeg; if not, write to the Free Software
18cabdff1aSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19cabdff1aSopenharmony_ci */
20cabdff1aSopenharmony_ci
21cabdff1aSopenharmony_ci/**
22cabdff1aSopenharmony_ci * @file
23cabdff1aSopenharmony_ci * quarterpel DSP functions
24cabdff1aSopenharmony_ci */
25cabdff1aSopenharmony_ci
26cabdff1aSopenharmony_ci#ifndef AVCODEC_QPELDSP_H
27cabdff1aSopenharmony_ci#define AVCODEC_QPELDSP_H
28cabdff1aSopenharmony_ci
29cabdff1aSopenharmony_ci#include <stddef.h>
30cabdff1aSopenharmony_ci#include <stdint.h>
31cabdff1aSopenharmony_ci
32cabdff1aSopenharmony_civoid ff_put_pixels8x8_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
33cabdff1aSopenharmony_civoid ff_avg_pixels8x8_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
34cabdff1aSopenharmony_civoid ff_put_pixels16x16_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
35cabdff1aSopenharmony_civoid ff_avg_pixels16x16_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
36cabdff1aSopenharmony_ci
37cabdff1aSopenharmony_civoid ff_put_pixels8_l2_8(uint8_t *dst, const uint8_t *src1, const uint8_t *src2,
38cabdff1aSopenharmony_ci                         int dst_stride, int src_stride1, int src_stride2,
39cabdff1aSopenharmony_ci                         int h);
40cabdff1aSopenharmony_ci
41cabdff1aSopenharmony_ci#define DEF_OLD_QPEL(name)                                              \
42cabdff1aSopenharmony_civoid ff_put_        ## name(uint8_t *dst /* align width (8 or 16) */,   \
43cabdff1aSopenharmony_ci                            const uint8_t *src /* align 1 */,           \
44cabdff1aSopenharmony_ci                            ptrdiff_t stride);                          \
45cabdff1aSopenharmony_civoid ff_put_no_rnd_ ## name(uint8_t *dst /* align width (8 or 16) */,   \
46cabdff1aSopenharmony_ci                            const uint8_t *src /* align 1 */,           \
47cabdff1aSopenharmony_ci                            ptrdiff_t stride);                          \
48cabdff1aSopenharmony_civoid ff_avg_        ## name(uint8_t *dst /* align width (8 or 16) */,   \
49cabdff1aSopenharmony_ci                            const uint8_t *src /* align 1 */,           \
50cabdff1aSopenharmony_ci                            ptrdiff_t stride);
51cabdff1aSopenharmony_ci
52cabdff1aSopenharmony_ciDEF_OLD_QPEL(qpel16_mc11_old_c)
53cabdff1aSopenharmony_ciDEF_OLD_QPEL(qpel16_mc31_old_c)
54cabdff1aSopenharmony_ciDEF_OLD_QPEL(qpel16_mc12_old_c)
55cabdff1aSopenharmony_ciDEF_OLD_QPEL(qpel16_mc32_old_c)
56cabdff1aSopenharmony_ciDEF_OLD_QPEL(qpel16_mc13_old_c)
57cabdff1aSopenharmony_ciDEF_OLD_QPEL(qpel16_mc33_old_c)
58cabdff1aSopenharmony_ciDEF_OLD_QPEL(qpel8_mc11_old_c)
59cabdff1aSopenharmony_ciDEF_OLD_QPEL(qpel8_mc31_old_c)
60cabdff1aSopenharmony_ciDEF_OLD_QPEL(qpel8_mc12_old_c)
61cabdff1aSopenharmony_ciDEF_OLD_QPEL(qpel8_mc32_old_c)
62cabdff1aSopenharmony_ciDEF_OLD_QPEL(qpel8_mc13_old_c)
63cabdff1aSopenharmony_ciDEF_OLD_QPEL(qpel8_mc33_old_c)
64cabdff1aSopenharmony_ci
65cabdff1aSopenharmony_citypedef void (*qpel_mc_func)(uint8_t *dst /* align width (8 or 16) */,
66cabdff1aSopenharmony_ci                             const uint8_t *src /* align 1 */,
67cabdff1aSopenharmony_ci                             ptrdiff_t stride);
68cabdff1aSopenharmony_ci
69cabdff1aSopenharmony_ci/**
70cabdff1aSopenharmony_ci * quarterpel DSP context
71cabdff1aSopenharmony_ci */
72cabdff1aSopenharmony_citypedef struct QpelDSPContext {
73cabdff1aSopenharmony_ci    qpel_mc_func put_qpel_pixels_tab[2][16];
74cabdff1aSopenharmony_ci    qpel_mc_func avg_qpel_pixels_tab[2][16];
75cabdff1aSopenharmony_ci    qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16];
76cabdff1aSopenharmony_ci} QpelDSPContext;
77cabdff1aSopenharmony_ci
78cabdff1aSopenharmony_civoid ff_qpeldsp_init(QpelDSPContext *c);
79cabdff1aSopenharmony_ci
80cabdff1aSopenharmony_civoid ff_qpeldsp_init_x86(QpelDSPContext *c);
81cabdff1aSopenharmony_civoid ff_qpeldsp_init_mips(QpelDSPContext *c);
82cabdff1aSopenharmony_ci
83cabdff1aSopenharmony_ci#endif /* AVCODEC_QPELDSP_H */
84