libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / ffmpeg / libavcodec / vp6dsp.c
blob69a11ee1883abcd14be60344b5990389b74e545e
1 /**
2 * @file
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"
25 #include "dsputil.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)
31 int x, y;
32 int tmp[8*11];
33 int *t = tmp;
35 src -= stride;
37 for (y=0; y<11; y++) {
38 for (x=0; x<8; x++) {
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);
44 src += stride;
45 t += 8;
48 t = tmp + 8;
49 for (y=0; y<8; y++) {
50 for (x=0; x<8; x++) {
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);
56 dst += stride;
57 t += 8;