FFmpeg
videodsp.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Ronald S. Bultje
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 /**
22  * @file
23  * Core video DSP helper functions
24  */
25 
26 #ifndef AVCODEC_VIDEODSP_H
27 #define AVCODEC_VIDEODSP_H
28 
29 #include <stddef.h>
30 #include <stdint.h>
31 
32 typedef struct VideoDSPContext {
33  /**
34  * Copy a rectangular area of samples to a temporary buffer and replicate
35  * the border samples.
36  *
37  * @param dst destination buffer
38  * @param dst_stride number of bytes between 2 vertically adjacent samples
39  * in destination buffer
40  * @param src source buffer
41  * @param dst_linesize number of bytes between 2 vertically adjacent
42  * samples in the destination buffer
43  * @param src_linesize number of bytes between 2 vertically adjacent
44  * samples in both the source buffer
45  * @param block_w width of block
46  * @param block_h height of block
47  * @param src_x x coordinate of the top left sample of the block in the
48  * source buffer
49  * @param src_y y coordinate of the top left sample of the block in the
50  * source buffer
51  * @param w width of the source buffer
52  * @param h height of the source buffer
53  */
54  void (*emulated_edge_mc)(uint8_t *dst, const uint8_t *src,
55  ptrdiff_t dst_linesize,
56  ptrdiff_t src_linesize,
57  int block_w, int block_h,
58  int src_x, int src_y, int w, int h);
59 
60  /**
61  * Prefetch memory into cache (if supported by hardware).
62  *
63  * @param buf pointer to buffer to prefetch memory from
64  * @param stride distance between two lines of buf (in bytes)
65  * @param h number of lines to prefetch
66  */
67  void (*prefetch)(const uint8_t *buf, ptrdiff_t stride, int h);
69 
70 void ff_videodsp_init(VideoDSPContext *ctx, int bpc);
71 
72 /* for internal use only (i.e. called by ff_videodsp_init() */
80 
81 #endif /* AVCODEC_VIDEODSP_H */
ff_videodsp_init_arm
void ff_videodsp_init_arm(VideoDSPContext *ctx, int bpc)
Definition: videodsp_init_arm.c:26
ff_videodsp_init_loongarch
void ff_videodsp_init_loongarch(VideoDSPContext *ctx, int bpc)
Definition: videodsp_init.c:42
VideoDSPContext::prefetch
void(* prefetch)(const uint8_t *buf, ptrdiff_t stride, int h)
Prefetch memory into cache (if supported by hardware).
Definition: videodsp.h:67
ff_videodsp_init_x86
void ff_videodsp_init_x86(VideoDSPContext *ctx, int bpc)
Definition: videodsp_init.c:219
ff_videodsp_init_mips
void ff_videodsp_init_mips(VideoDSPContext *ctx, int bpc)
Definition: videodsp_init.c:45
ctx
static AVFormatContext * ctx
Definition: movenc.c:49
ff_videodsp_init_ppc
void ff_videodsp_init_ppc(VideoDSPContext *ctx, int bpc)
Definition: videodsp.c:33
ff_videodsp_init_aarch64
void ff_videodsp_init_aarch64(VideoDSPContext *ctx, int bpc)
Definition: videodsp_init.c:26
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:87
VideoDSPContext::emulated_edge_mc
void(* emulated_edge_mc)(uint8_t *dst, const uint8_t *src, ptrdiff_t dst_linesize, ptrdiff_t src_linesize, int block_w, int block_h, int src_x, int src_y, int w, int h)
Copy a rectangular area of samples to a temporary buffer and replicate the border samples.
Definition: videodsp.h:54
ff_videodsp_init_riscv
void ff_videodsp_init_riscv(VideoDSPContext *ctx, int bpc)
Definition: videodsp_init.c:26
VideoDSPContext
Definition: videodsp.h:32
w
uint8_t w
Definition: llvidencdsp.c:39
h
h
Definition: vp9dsp_template.c:2070
stride
#define stride
Definition: h264pred_template.c:536
src
#define src
Definition: vp8dsp.c:248
ff_videodsp_init
void ff_videodsp_init(VideoDSPContext *ctx, int bpc)
Definition: videodsp.c:39