1 /*
2 * Half-pel DSP functions.
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 /**
24 * @file
25 * Half-pel DSP functions.
26 */
27
28 #ifndef AVCODEC_HPELDSP_H
29 #define AVCODEC_HPELDSP_H
30
31 #include <stdint.h>
32 #include <stddef.h>
33
34 /**
35 * Average and put pixel
36 * Widths can be 16, 8, 4 or 2. For for widths 2 and 4, h is always a positive
37 * multiple of 2; otherwise, it is a positive multiple of 4.
38 */
40 const uint8_t *pixels /*align 1*/,
41 ptrdiff_t line_size,
int h);
42
43 /**
44 * Half-pel DSP context.
45 */
47 /**
48 * Halfpel motion compensation with rounding (a+b+1)>>1.
49 * this is an array[4][4] of motion compensation functions for 4
50 * horizontal blocksizes (2,4,8,16) and the 4 halfpel positions<br>
51 * *pixels_tab[ 0->16xH 1->8xH 2->4xH 3->2xH ][ xhalfpel + 2*yhalfpel ]
52 * @param block destination where the result is stored
53 * @param pixels source
54 * @param line_size number of bytes in a horizontal line of block
55 * @param h height
56 */
58
59 /**
60 * Halfpel motion compensation with rounding (a+b+1)>>1.
61 * This is an array[4][4] of motion compensation functions for 4
62 * horizontal blocksizes (2,4,8,16) and the 4 halfpel positions<br>
63 * *pixels_tab[ 0->16xH 1->8xH 2->4xH 3->2xH ][ xhalfpel + 2*yhalfpel ]
64 * @param block destination into which the result is averaged (a+b+1)>>1
65 * @param pixels source
66 * @param line_size number of bytes in a horizontal line of block
67 * @param h height
68 */
70
71 /**
72 * Halfpel motion compensation with no rounding (a+b)>>1.
73 * this is an array[4][4] of motion compensation functions for 2
74 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
75 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
76 * @param block destination where the result is stored
77 * @param pixels source
78 * @param line_size number of bytes in a horizontal line of block
79 * @param h height
80 * @note The size is kept at [3][4] to avoid out of bounds accesses
81 * in the motion estimation code.
82 */
84
85 /**
86 * Halfpel motion compensation with no rounding (a+b)>>1.
87 * this is an array[4] of motion compensation functions for 1
88 * horizontal blocksize (16) and the 4 halfpel positions<br>
89 * *pixels_tab[ xhalfpel + 2*yhalfpel ]
90 * @param block destination into which the result is averaged (a+b)>>1
91 * @param pixels source
92 * @param line_size number of bytes in a horizontal line of block
93 * @param h height
94 */
97
99
106
107 #endif /* AVCODEC_HPELDSP_H */