3 * VP6 DSP-oriented functions
5 * Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
7 * This file is part of FFmpeg.
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #include "libavutil/common.h"
28 void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride,
29 const int16_t *h_weights, const int16_t *v_weights)
37 for (y=0; y<11; y++) {
39 t[x] = av_clip_uint8(( src[x-1] * h_weights[0]
40 + src[x ] * h_weights[1]
41 + src[x+1] * h_weights[2]
42 + src[x+2] * h_weights[3] + 64) >> 7);
51 dst[x] = av_clip_uint8(( t[x-8 ] * v_weights[0]
52 + t[x ] * v_weights[1]
53 + t[x+8 ] * v_weights[2]
54 + t[x+16] * v_weights[3] + 64) >> 7);