• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

libavcodec/vp6dsp.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2006  Aurelien Jacobs <aurel@gnuage.org>
00003  *
00004  * This file is part of Libav.
00005  *
00006  * Libav is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * Libav is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with Libav; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00019  */
00020 
00026 #include "libavutil/common.h"
00027 #include "vp56dsp.h"
00028 
00029 
00030 void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride,
00031                            const int16_t *h_weights, const int16_t *v_weights)
00032 {
00033     int x, y;
00034     int tmp[8*11];
00035     int *t = tmp;
00036 
00037     src -= stride;
00038 
00039     for (y=0; y<11; y++) {
00040         for (x=0; x<8; x++) {
00041             t[x] = av_clip_uint8((  src[x-1] * h_weights[0]
00042                                + src[x  ] * h_weights[1]
00043                                + src[x+1] * h_weights[2]
00044                                + src[x+2] * h_weights[3] + 64) >> 7);
00045         }
00046         src += stride;
00047         t += 8;
00048     }
00049 
00050     t = tmp + 8;
00051     for (y=0; y<8; y++) {
00052         for (x=0; x<8; x++) {
00053             dst[x] = av_clip_uint8((  t[x-8 ] * v_weights[0]
00054                                  + t[x   ] * v_weights[1]
00055                                  + t[x+8 ] * v_weights[2]
00056                                  + t[x+16] * v_weights[3] + 64) >> 7);
00057         }
00058         dst += stride;
00059         t += 8;
00060     }
00061 }
Generated on Sat Mar 17 2012 12:57:51 for Libav by doxygen 1.7.1