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.

65 lines
1.9KB

  1. /*
  2. * Copyright (c) 2012-2013 Oka Motofumi (chikuzen.mo at gmail dot com)
  3. * Copyright (c) 2015 Paul B Mahol
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #ifndef AVFILTER_CONVOLUTION_H
  22. #define AVFILTER_CONVOLUTION_H
  23. #include "avfilter.h"
  24. enum MatrixMode {
  25. MATRIX_SQUARE,
  26. MATRIX_ROW,
  27. MATRIX_COLUMN,
  28. MATRIX_NBMODES,
  29. };
  30. typedef struct ConvolutionContext {
  31. const AVClass *class;
  32. char *matrix_str[4];
  33. float rdiv[4];
  34. float bias[4];
  35. int mode[4];
  36. float scale;
  37. float delta;
  38. int planes;
  39. int size[4];
  40. int depth;
  41. int max;
  42. int bpc;
  43. int nb_planes;
  44. int nb_threads;
  45. int planewidth[4];
  46. int planeheight[4];
  47. int matrix[4][49];
  48. int matrix_length[4];
  49. int copy[4];
  50. void (*setup[4])(int radius, const uint8_t *c[], const uint8_t *src, int stride,
  51. int x, int width, int y, int height, int bpc);
  52. void (*filter[4])(uint8_t *dst, int width,
  53. float rdiv, float bias, const int *const matrix,
  54. const uint8_t *c[], int peak, int radius,
  55. int dstride, int stride);
  56. } ConvolutionContext;
  57. void ff_convolution_init_x86(ConvolutionContext *s);
  58. #endif