unsharp.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (C) 2013 Wei Gao <weigao@multicorewareinc.com>
  3. * Copyright (C) 2013 Lenny Wang
  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_UNSHARP_H
  22. #define AVFILTER_UNSHARP_H
  23. #include "config.h"
  24. #include "avfilter.h"
  25. #define MIN_MATRIX_SIZE 3
  26. #define MAX_MATRIX_SIZE 63
  27. typedef struct UnsharpFilterParam {
  28. int msize_x; ///< matrix width
  29. int msize_y; ///< matrix height
  30. int amount; ///< effect amount
  31. int steps_x; ///< horizontal step count
  32. int steps_y; ///< vertical step count
  33. int scalebits; ///< bits to shift pixel
  34. int32_t halfscale; ///< amount to add to pixel
  35. uint32_t *sr; ///< finite state machine storage within a row
  36. uint32_t **sc; ///< finite state machine storage across rows
  37. } UnsharpFilterParam;
  38. typedef struct UnsharpContext {
  39. const AVClass *class;
  40. int lmsize_x, lmsize_y, cmsize_x, cmsize_y;
  41. float lamount, camount;
  42. UnsharpFilterParam luma; ///< luma parameters (width, height, amount)
  43. UnsharpFilterParam chroma; ///< chroma parameters (width, height, amount)
  44. int hsub, vsub;
  45. int nb_threads;
  46. int opencl;
  47. int (* apply_unsharp)(AVFilterContext *ctx, AVFrame *in, AVFrame *out);
  48. } UnsharpContext;
  49. #endif /* AVFILTER_UNSHARP_H */