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