2 * Copyright (C) 2012 Ronald S. Bultje
4 * This file is part of Libav.
6 * Libav 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.
11 * Libav 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.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with Libav; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 * Core video DSP helper functions
26 #ifndef AVCODEC_VIDEODSP_H
27 #define AVCODEC_VIDEODSP_H
32 typedef struct VideoDSPContext {
34 * Copy a rectangular area of samples to a temporary buffer and replicate
37 * @param buf destination buffer
38 * @param src source buffer
39 * @param linesize number of bytes between 2 vertically adjacent samples
40 * in both the source and destination buffers
41 * @param block_w width of block
42 * @param block_h height of block
43 * @param src_x x coordinate of the top left sample of the block in the
45 * @param src_y y coordinate of the top left sample of the block in the
47 * @param w width of the source buffer
48 * @param h height of the source buffer
50 void (*emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
51 ptrdiff_t linesize, int block_w, int block_h,
52 int src_x, int src_y, int w, int h);
55 * Prefetch memory into cache (if supported by hardware).
57 * @buf pointer to buffer to prefetch memory from
58 * @stride distance between two lines of buf (in bytes)
59 * @h number of lines to prefetch
61 void (*prefetch)(uint8_t *buf, ptrdiff_t stride, int h);
64 void ff_videodsp_init(VideoDSPContext *ctx, int bpc);
66 /* for internal use only (i.e. called by ff_videodsp_init() */
67 void ff_videodsp_init_arm(VideoDSPContext *ctx, int bpc);
68 void ff_videodsp_init_ppc(VideoDSPContext *ctx, int bpc);
69 void ff_videodsp_init_x86(VideoDSPContext *ctx, int bpc);
71 #endif /* AVCODEC_VIDEODSP_H */