FFmpeg
Loading...
Searching...
No Matches
hpeldsp.h
Go to the documentation of this file.
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 */
39typedef void (*op_pixels_func)(uint8_t *block /* align width */,
40 const uint8_t *pixels /*align 1*/,
41 ptrdiff_t line_size, int h);
42
43/**
44 * Half-pel DSP context.
45 */
46typedef struct HpelDSPContext {
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 */
#define flags(name, subs,...)
Definition cbs_h264.c:74
static int16_t block[64]
Definition dct.c:125
void ff_hpeldsp_init_loongarch(HpelDSPContext *c, int flags)
void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags)
void(* op_pixels_func)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
Average and put pixel Widths can be 16, 8, 4 or 2.
Definition hpeldsp.h:39
void ff_hpeldsp_init_mips(HpelDSPContext *c, int flags)
void ff_hpeldsp_init_aarch64(HpelDSPContext *c, int flags)
void ff_hpeldsp_init(HpelDSPContext *c, int flags)
Definition hpeldsp.c:337
void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags)
Half-pel DSP context.
Definition hpeldsp.h:46
op_pixels_func avg_pixels_tab[4][4]
Halfpel motion compensation with rounding (a+b+1)>>1.
Definition hpeldsp.h:69
op_pixels_func avg_no_rnd_pixels_tab[4]
Halfpel motion compensation with no rounding (a+b)>>1.
Definition hpeldsp.h:95
op_pixels_func put_pixels_tab[4][4]
Halfpel motion compensation with rounding (a+b+1)>>1.
Definition hpeldsp.h:57
op_pixels_func put_no_rnd_pixels_tab[3][4]
Halfpel motion compensation with no rounding (a+b)>>1.
Definition hpeldsp.h:83
static double c[64]