yading@10
|
1 /*
|
yading@10
|
2 * Half-pel DSP functions.
|
yading@10
|
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
|
yading@10
|
4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
|
yading@10
|
5 *
|
yading@10
|
6 * This file is part of FFmpeg.
|
yading@10
|
7 *
|
yading@10
|
8 * FFmpeg is free software; you can redistribute it and/or
|
yading@10
|
9 * modify it under the terms of the GNU Lesser General Public
|
yading@10
|
10 * License as published by the Free Software Foundation; either
|
yading@10
|
11 * version 2.1 of the License, or (at your option) any later version.
|
yading@10
|
12 *
|
yading@10
|
13 * FFmpeg is distributed in the hope that it will be useful,
|
yading@10
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
yading@10
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
yading@10
|
16 * Lesser General Public License for more details.
|
yading@10
|
17 *
|
yading@10
|
18 * You should have received a copy of the GNU Lesser General Public
|
yading@10
|
19 * License along with FFmpeg; if not, write to the Free Software
|
yading@10
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
yading@10
|
21 */
|
yading@10
|
22
|
yading@10
|
23 /**
|
yading@10
|
24 * @file
|
yading@10
|
25 * Half-pel DSP functions.
|
yading@10
|
26 */
|
yading@10
|
27
|
yading@10
|
28 #ifndef AVCODEC_HPELDSP_H
|
yading@10
|
29 #define AVCODEC_HPELDSP_H
|
yading@10
|
30
|
yading@10
|
31 #include <stdint.h>
|
yading@10
|
32 #include <stddef.h>
|
yading@10
|
33
|
yading@10
|
34 /* add and put pixel (decoding) */
|
yading@10
|
35 // blocksizes for hpel_pixels_func are 8x4,8x8 16x8 16x16
|
yading@10
|
36 // h for hpel_pixels_func is limited to {width/2, width} but never larger
|
yading@10
|
37 // than 16 and never smaller than 4
|
yading@10
|
38 typedef void (*op_pixels_func)(uint8_t *block /*align width (8 or 16)*/,
|
yading@10
|
39 const uint8_t *pixels /*align 1*/,
|
yading@10
|
40 ptrdiff_t line_size, int h);
|
yading@10
|
41
|
yading@10
|
42 /**
|
yading@10
|
43 * Half-pel DSP context.
|
yading@10
|
44 */
|
yading@10
|
45 typedef struct HpelDSPContext {
|
yading@10
|
46 /**
|
yading@10
|
47 * Halfpel motion compensation with rounding (a+b+1)>>1.
|
yading@10
|
48 * this is an array[4][4] of motion compensation functions for 4
|
yading@10
|
49 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
|
yading@10
|
50 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
|
yading@10
|
51 * @param block destination where the result is stored
|
yading@10
|
52 * @param pixels source
|
yading@10
|
53 * @param line_size number of bytes in a horizontal line of block
|
yading@10
|
54 * @param h height
|
yading@10
|
55 */
|
yading@10
|
56 op_pixels_func put_pixels_tab[4][4];
|
yading@10
|
57
|
yading@10
|
58 /**
|
yading@10
|
59 * Halfpel motion compensation with rounding (a+b+1)>>1.
|
yading@10
|
60 * This is an array[4][4] of motion compensation functions for 4
|
yading@10
|
61 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
|
yading@10
|
62 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
|
yading@10
|
63 * @param block destination into which the result is averaged (a+b+1)>>1
|
yading@10
|
64 * @param pixels source
|
yading@10
|
65 * @param line_size number of bytes in a horizontal line of block
|
yading@10
|
66 * @param h height
|
yading@10
|
67 */
|
yading@10
|
68 op_pixels_func avg_pixels_tab[4][4];
|
yading@10
|
69
|
yading@10
|
70 /**
|
yading@10
|
71 * Halfpel motion compensation with no rounding (a+b)>>1.
|
yading@10
|
72 * this is an array[4][4] of motion compensation functions for 2
|
yading@10
|
73 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
|
yading@10
|
74 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
|
yading@10
|
75 * @param block destination where the result is stored
|
yading@10
|
76 * @param pixels source
|
yading@10
|
77 * @param line_size number of bytes in a horizontal line of block
|
yading@10
|
78 * @param h height
|
yading@10
|
79 */
|
yading@10
|
80 op_pixels_func put_no_rnd_pixels_tab[4][4];
|
yading@10
|
81
|
yading@10
|
82 /**
|
yading@10
|
83 * Halfpel motion compensation with no rounding (a+b)>>1.
|
yading@10
|
84 * this is an array[4] of motion compensation functions for 1
|
yading@10
|
85 * horizontal blocksize (16) and the 4 halfpel positions<br>
|
yading@10
|
86 * *pixels_tab[0][ xhalfpel + 2*yhalfpel ]
|
yading@10
|
87 * @param block destination into which the result is averaged (a+b)>>1
|
yading@10
|
88 * @param pixels source
|
yading@10
|
89 * @param line_size number of bytes in a horizontal line of block
|
yading@10
|
90 * @param h height
|
yading@10
|
91 */
|
yading@10
|
92 op_pixels_func avg_no_rnd_pixels_tab[4];
|
yading@10
|
93 } HpelDSPContext;
|
yading@10
|
94
|
yading@10
|
95 void ff_hpeldsp_init(HpelDSPContext *c, int flags);
|
yading@10
|
96
|
yading@10
|
97 void ff_hpeldsp_init_alpha(HpelDSPContext *c, int flags);
|
yading@10
|
98 void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags);
|
yading@10
|
99 void ff_hpeldsp_init_bfin(HpelDSPContext *c, int flags);
|
yading@10
|
100 void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags);
|
yading@10
|
101 void ff_hpeldsp_init_sh4(HpelDSPContext *c, int flags);
|
yading@10
|
102 void ff_hpeldsp_init_vis(HpelDSPContext *c, int flags);
|
yading@10
|
103 void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags);
|
yading@10
|
104
|
yading@10
|
105 #endif /* AVCODEC_HPELDSP_H */
|