yading@10: /* yading@10: * Half-pel DSP functions. yading@10: * Copyright (c) 2000, 2001, 2002 Fabrice Bellard yading@10: * Copyright (c) 2002-2004 Michael Niedermayer 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: * Half-pel DSP functions. yading@10: */ yading@10: yading@10: #ifndef AVCODEC_HPELDSP_H yading@10: #define AVCODEC_HPELDSP_H yading@10: yading@10: #include yading@10: #include yading@10: yading@10: /* add and put pixel (decoding) */ yading@10: // blocksizes for hpel_pixels_func are 8x4,8x8 16x8 16x16 yading@10: // h for hpel_pixels_func is limited to {width/2, width} but never larger yading@10: // than 16 and never smaller than 4 yading@10: typedef void (*op_pixels_func)(uint8_t *block /*align width (8 or 16)*/, yading@10: const uint8_t *pixels /*align 1*/, yading@10: ptrdiff_t line_size, int h); yading@10: yading@10: /** yading@10: * Half-pel DSP context. yading@10: */ yading@10: typedef struct HpelDSPContext { yading@10: /** yading@10: * Halfpel motion compensation with rounding (a+b+1)>>1. yading@10: * this is an array[4][4] of motion compensation functions for 4 yading@10: * horizontal blocksizes (8,16) and the 4 halfpel positions
yading@10: * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ] yading@10: * @param block destination where the result is stored yading@10: * @param pixels source yading@10: * @param line_size number of bytes in a horizontal line of block yading@10: * @param h height yading@10: */ yading@10: op_pixels_func put_pixels_tab[4][4]; yading@10: yading@10: /** yading@10: * Halfpel motion compensation with rounding (a+b+1)>>1. yading@10: * This is an array[4][4] of motion compensation functions for 4 yading@10: * horizontal blocksizes (8,16) and the 4 halfpel positions
yading@10: * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ] yading@10: * @param block destination into which the result is averaged (a+b+1)>>1 yading@10: * @param pixels source yading@10: * @param line_size number of bytes in a horizontal line of block yading@10: * @param h height yading@10: */ yading@10: op_pixels_func avg_pixels_tab[4][4]; yading@10: yading@10: /** yading@10: * Halfpel motion compensation with no rounding (a+b)>>1. yading@10: * this is an array[4][4] of motion compensation functions for 2 yading@10: * horizontal blocksizes (8,16) and the 4 halfpel positions
yading@10: * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ] yading@10: * @param block destination where the result is stored yading@10: * @param pixels source yading@10: * @param line_size number of bytes in a horizontal line of block yading@10: * @param h height yading@10: */ yading@10: op_pixels_func put_no_rnd_pixels_tab[4][4]; yading@10: yading@10: /** yading@10: * Halfpel motion compensation with no rounding (a+b)>>1. yading@10: * this is an array[4] of motion compensation functions for 1 yading@10: * horizontal blocksize (16) and the 4 halfpel positions
yading@10: * *pixels_tab[0][ xhalfpel + 2*yhalfpel ] yading@10: * @param block destination into which the result is averaged (a+b)>>1 yading@10: * @param pixels source yading@10: * @param line_size number of bytes in a horizontal line of block yading@10: * @param h height yading@10: */ yading@10: op_pixels_func avg_no_rnd_pixels_tab[4]; yading@10: } HpelDSPContext; yading@10: yading@10: void ff_hpeldsp_init(HpelDSPContext *c, int flags); yading@10: yading@10: void ff_hpeldsp_init_alpha(HpelDSPContext *c, int flags); yading@10: void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags); yading@10: void ff_hpeldsp_init_bfin(HpelDSPContext *c, int flags); yading@10: void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags); yading@10: void ff_hpeldsp_init_sh4(HpelDSPContext *c, int flags); yading@10: void ff_hpeldsp_init_vis(HpelDSPContext *c, int flags); yading@10: void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags); yading@10: yading@10: #endif /* AVCODEC_HPELDSP_H */