1cabdff1aSopenharmony_ci/*
2cabdff1aSopenharmony_ci * RV30/40 decoder motion compensation functions
3cabdff1aSopenharmony_ci * Copyright (c) 2008 Konstantin Shishkov
4cabdff1aSopenharmony_ci *
5cabdff1aSopenharmony_ci * This file is part of FFmpeg.
6cabdff1aSopenharmony_ci *
7cabdff1aSopenharmony_ci * FFmpeg is free software; you can redistribute it and/or
8cabdff1aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public
9cabdff1aSopenharmony_ci * License as published by the Free Software Foundation; either
10cabdff1aSopenharmony_ci * version 2.1 of the License, or (at your option) any later version.
11cabdff1aSopenharmony_ci *
12cabdff1aSopenharmony_ci * FFmpeg is distributed in the hope that it will be useful,
13cabdff1aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of
14cabdff1aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15cabdff1aSopenharmony_ci * Lesser General Public License for more details.
16cabdff1aSopenharmony_ci *
17cabdff1aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public
18cabdff1aSopenharmony_ci * License along with FFmpeg; if not, write to the Free Software
19cabdff1aSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20cabdff1aSopenharmony_ci */
21cabdff1aSopenharmony_ci
22cabdff1aSopenharmony_ci/**
23cabdff1aSopenharmony_ci * @file
24cabdff1aSopenharmony_ci * RV30/40 decoder motion compensation functions
25cabdff1aSopenharmony_ci */
26cabdff1aSopenharmony_ci
27cabdff1aSopenharmony_ci#ifndef AVCODEC_RV34DSP_H
28cabdff1aSopenharmony_ci#define AVCODEC_RV34DSP_H
29cabdff1aSopenharmony_ci
30cabdff1aSopenharmony_ci#include "h264chroma.h"
31cabdff1aSopenharmony_ci#include "qpeldsp.h"
32cabdff1aSopenharmony_ci
33cabdff1aSopenharmony_citypedef void (*rv40_weight_func)(uint8_t *dst/*align width (8 or 16)*/,
34cabdff1aSopenharmony_ci                                 uint8_t *src1/*align width (8 or 16)*/,
35cabdff1aSopenharmony_ci                                 uint8_t *src2/*align width (8 or 16)*/,
36cabdff1aSopenharmony_ci                                 int w1, int w2, ptrdiff_t stride);
37cabdff1aSopenharmony_ci
38cabdff1aSopenharmony_citypedef void (*rv34_inv_transform_func)(int16_t *block);
39cabdff1aSopenharmony_ci
40cabdff1aSopenharmony_citypedef void (*rv34_idct_add_func)(uint8_t *dst, ptrdiff_t stride, int16_t *block);
41cabdff1aSopenharmony_citypedef void (*rv34_idct_dc_add_func)(uint8_t *dst, ptrdiff_t stride,
42cabdff1aSopenharmony_ci                                      int   dc);
43cabdff1aSopenharmony_ci
44cabdff1aSopenharmony_citypedef void (*rv40_weak_loop_filter_func)(uint8_t *src, ptrdiff_t stride,
45cabdff1aSopenharmony_ci                                           int filter_p1, int filter_q1,
46cabdff1aSopenharmony_ci                                           int alpha, int beta,
47cabdff1aSopenharmony_ci                                           int lims, int lim_q1, int lim_p1);
48cabdff1aSopenharmony_ci
49cabdff1aSopenharmony_citypedef void (*rv40_strong_loop_filter_func)(uint8_t *src, ptrdiff_t stride,
50cabdff1aSopenharmony_ci                                             int alpha, int lims,
51cabdff1aSopenharmony_ci                                             int dmode, int chroma);
52cabdff1aSopenharmony_ci
53cabdff1aSopenharmony_citypedef int (*rv40_loop_filter_strength_func)(uint8_t *src, ptrdiff_t stride,
54cabdff1aSopenharmony_ci                                              int beta, int beta2, int edge,
55cabdff1aSopenharmony_ci                                              int *p1, int *q1);
56cabdff1aSopenharmony_ci
57cabdff1aSopenharmony_citypedef struct RV34DSPContext {
58cabdff1aSopenharmony_ci    qpel_mc_func put_pixels_tab[4][16];
59cabdff1aSopenharmony_ci    qpel_mc_func avg_pixels_tab[4][16];
60cabdff1aSopenharmony_ci    h264_chroma_mc_func put_chroma_pixels_tab[3];
61cabdff1aSopenharmony_ci    h264_chroma_mc_func avg_chroma_pixels_tab[3];
62cabdff1aSopenharmony_ci    /**
63cabdff1aSopenharmony_ci     * Biweight functions, first dimension is transform size (16/8),
64cabdff1aSopenharmony_ci     * second is whether the weight is prescaled by 1/512 to skip
65cabdff1aSopenharmony_ci     * the intermediate shifting.
66cabdff1aSopenharmony_ci     */
67cabdff1aSopenharmony_ci    rv40_weight_func rv40_weight_pixels_tab[2][2];
68cabdff1aSopenharmony_ci    rv34_inv_transform_func rv34_inv_transform;
69cabdff1aSopenharmony_ci    rv34_inv_transform_func rv34_inv_transform_dc;
70cabdff1aSopenharmony_ci    rv34_idct_add_func rv34_idct_add;
71cabdff1aSopenharmony_ci    rv34_idct_dc_add_func rv34_idct_dc_add;
72cabdff1aSopenharmony_ci    rv40_weak_loop_filter_func rv40_weak_loop_filter[2];
73cabdff1aSopenharmony_ci    rv40_strong_loop_filter_func rv40_strong_loop_filter[2];
74cabdff1aSopenharmony_ci    rv40_loop_filter_strength_func rv40_loop_filter_strength[2];
75cabdff1aSopenharmony_ci} RV34DSPContext;
76cabdff1aSopenharmony_ci
77cabdff1aSopenharmony_civoid ff_rv30dsp_init(RV34DSPContext *c);
78cabdff1aSopenharmony_civoid ff_rv34dsp_init(RV34DSPContext *c);
79cabdff1aSopenharmony_civoid ff_rv40dsp_init(RV34DSPContext *c);
80cabdff1aSopenharmony_ci
81cabdff1aSopenharmony_civoid ff_rv34dsp_init_arm(RV34DSPContext *c);
82cabdff1aSopenharmony_civoid ff_rv34dsp_init_x86(RV34DSPContext *c);
83cabdff1aSopenharmony_ci
84cabdff1aSopenharmony_civoid ff_rv40dsp_init_aarch64(RV34DSPContext *c);
85cabdff1aSopenharmony_civoid ff_rv40dsp_init_x86(RV34DSPContext *c);
86cabdff1aSopenharmony_civoid ff_rv40dsp_init_arm(RV34DSPContext *c);
87cabdff1aSopenharmony_ci
88cabdff1aSopenharmony_ci#endif /* AVCODEC_RV34DSP_H */
89