yading@10: /* yading@10: * Copyright (C) 2012 Ronald S. Bultje yading@10: * yading@10: * This file is part of FFmpeg. yading@10: * yading@10: * FFmpeg is free software; you can redistribute it and/or yading@10: * modify it under the terms of the GNU Lesser General Public yading@10: * License as published by the Free Software Foundation; either yading@10: * version 2.1 of the License, or (at your option) any later version. yading@10: * yading@10: * FFmpeg is distributed in the hope that it will be useful, yading@10: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@10: * Lesser General Public License for more details. yading@10: * yading@10: * You should have received a copy of the GNU Lesser General Public yading@10: * License along with FFmpeg; if not, write to the Free Software yading@10: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@10: */ yading@10: yading@10: /** yading@10: * @file yading@10: * Core video DSP helper functions yading@10: */ yading@10: yading@10: #ifndef AVCODEC_VIDEODSP_H yading@10: #define AVCODEC_VIDEODSP_H yading@10: yading@10: #include yading@10: #include yading@10: yading@10: #define EMULATED_EDGE(depth) \ yading@10: void ff_emulated_edge_mc_ ## depth (uint8_t *buf, const uint8_t *src, ptrdiff_t linesize,\ yading@10: int block_w, int block_h,\ yading@10: int src_x, int src_y, int w, int h); yading@10: yading@10: EMULATED_EDGE(8) yading@10: EMULATED_EDGE(16) yading@10: yading@10: typedef struct VideoDSPContext { yading@10: /** yading@10: * Copy a rectangular area of samples to a temporary buffer and replicate yading@10: * the border samples. yading@10: * yading@10: * @param buf destination buffer yading@10: * @param src source buffer yading@10: * @param linesize number of bytes between 2 vertically adjacent samples yading@10: * in both the source and destination buffers yading@10: * @param block_w width of block yading@10: * @param block_h height of block yading@10: * @param src_x x coordinate of the top left sample of the block in the yading@10: * source buffer yading@10: * @param src_y y coordinate of the top left sample of the block in the yading@10: * source buffer yading@10: * @param w width of the source buffer yading@10: * @param h height of the source buffer yading@10: */ yading@10: void (*emulated_edge_mc)(uint8_t *buf, const uint8_t *src, yading@10: ptrdiff_t linesize, int block_w, int block_h, yading@10: int src_x, int src_y, int w, int h); yading@10: yading@10: /** yading@10: * Prefetch memory into cache (if supported by hardware). yading@10: * yading@10: * @buf pointer to buffer to prefetch memory from yading@10: * @stride distance between two lines of buf (in bytes) yading@10: * @h number of lines to prefetch yading@10: */ yading@10: void (*prefetch)(uint8_t *buf, ptrdiff_t stride, int h); yading@10: } VideoDSPContext; yading@10: yading@10: void ff_videodsp_init(VideoDSPContext *ctx, int bpc); yading@10: yading@10: /* for internal use only (i.e. called by ff_videodsp_init() */ yading@10: void ff_videodsp_init_arm(VideoDSPContext *ctx, int bpc); yading@10: void ff_videodsp_init_ppc(VideoDSPContext *ctx, int bpc); yading@10: void ff_videodsp_init_x86(VideoDSPContext *ctx, int bpc); yading@10: yading@10: #endif /* AVCODEC_VIDEODSP_H */