You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.8KB

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