/* * RV30 decoder motion compensation functions * Copyright (c) 2007 Konstantin Shishkov * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file rv30dsp.c * RV30 decoder motion compensation functions */ #include "avcodec.h" #include "dsputil.h" #define RV30_LOWPASS(OPNAME, OP) \ static av_unused void OPNAME ## rv30_tpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, const int C1, const int C2){\ const int h=8;\ uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\ int i;\ for(i=0; i>4]+1)>>1) #define op_put(a, b) a = cm[((b) + 8)>>4] RV30_LOWPASS(put_ , op_put) RV30_LOWPASS(avg_ , op_avg) RV30_MC(put_, 8) RV30_MC(put_, 16) RV30_MC(avg_, 8) RV30_MC(avg_, 16) void ff_rv30dsp_init(DSPContext* c, AVCodecContext *avctx) { c->put_rv30_tpel_pixels_tab[0][ 0] = c->put_h264_qpel_pixels_tab[0][0]; c->put_rv30_tpel_pixels_tab[0][ 1] = put_rv30_tpel16_mc10_c; c->put_rv30_tpel_pixels_tab[0][ 2] = put_rv30_tpel16_mc20_c; c->put_rv30_tpel_pixels_tab[0][ 4] = put_rv30_tpel16_mc01_c; c->put_rv30_tpel_pixels_tab[0][ 5] = put_rv30_tpel16_mc11_c; c->put_rv30_tpel_pixels_tab[0][ 6] = put_rv30_tpel16_mc21_c; c->put_rv30_tpel_pixels_tab[0][ 8] = put_rv30_tpel16_mc02_c; c->put_rv30_tpel_pixels_tab[0][ 9] = put_rv30_tpel16_mc12_c; c->put_rv30_tpel_pixels_tab[0][10] = put_rv30_tpel16_mc22_c; c->avg_rv30_tpel_pixels_tab[0][ 0] = c->avg_h264_qpel_pixels_tab[0][0]; c->avg_rv30_tpel_pixels_tab[0][ 1] = avg_rv30_tpel16_mc10_c; c->avg_rv30_tpel_pixels_tab[0][ 2] = avg_rv30_tpel16_mc20_c; c->avg_rv30_tpel_pixels_tab[0][ 4] = avg_rv30_tpel16_mc01_c; c->avg_rv30_tpel_pixels_tab[0][ 5] = avg_rv30_tpel16_mc11_c; c->avg_rv30_tpel_pixels_tab[0][ 6] = avg_rv30_tpel16_mc21_c; c->avg_rv30_tpel_pixels_tab[0][ 8] = avg_rv30_tpel16_mc02_c; c->avg_rv30_tpel_pixels_tab[0][ 9] = avg_rv30_tpel16_mc12_c; c->avg_rv30_tpel_pixels_tab[0][10] = avg_rv30_tpel16_mc22_c; c->put_rv30_tpel_pixels_tab[1][ 0] = c->put_h264_qpel_pixels_tab[1][0]; c->put_rv30_tpel_pixels_tab[1][ 1] = put_rv30_tpel8_mc10_c; c->put_rv30_tpel_pixels_tab[1][ 2] = put_rv30_tpel8_mc20_c; c->put_rv30_tpel_pixels_tab[1][ 4] = put_rv30_tpel8_mc01_c; c->put_rv30_tpel_pixels_tab[1][ 5] = put_rv30_tpel8_mc11_c; c->put_rv30_tpel_pixels_tab[1][ 6] = put_rv30_tpel8_mc21_c; c->put_rv30_tpel_pixels_tab[1][ 8] = put_rv30_tpel8_mc02_c; c->put_rv30_tpel_pixels_tab[1][ 9] = put_rv30_tpel8_mc12_c; c->put_rv30_tpel_pixels_tab[1][10] = put_rv30_tpel8_mc22_c; c->avg_rv30_tpel_pixels_tab[1][ 0] = c->avg_h264_qpel_pixels_tab[1][0]; c->avg_rv30_tpel_pixels_tab[1][ 1] = avg_rv30_tpel8_mc10_c; c->avg_rv30_tpel_pixels_tab[1][ 2] = avg_rv30_tpel8_mc20_c; c->avg_rv30_tpel_pixels_tab[1][ 4] = avg_rv30_tpel8_mc01_c; c->avg_rv30_tpel_pixels_tab[1][ 5] = avg_rv30_tpel8_mc11_c; c->avg_rv30_tpel_pixels_tab[1][ 6] = avg_rv30_tpel8_mc21_c; c->avg_rv30_tpel_pixels_tab[1][ 8] = avg_rv30_tpel8_mc02_c; c->avg_rv30_tpel_pixels_tab[1][ 9] = avg_rv30_tpel8_mc12_c; c->avg_rv30_tpel_pixels_tab[1][10] = avg_rv30_tpel8_mc22_c; }