interlace.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * This file is part of FFmpeg.
  3. *
  4. * FFmpeg is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * FFmpeg is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. /**
  19. * @file
  20. * progressive to interlaced content filter, inspired by heavy debugging of
  21. * tinterlace filter.
  22. */
  23. #ifndef AVFILTER_INTERLACE_H
  24. #define AVFILTER_INTERLACE_H
  25. #include "libavutil/common.h"
  26. #include "libavutil/imgutils.h"
  27. #include "libavutil/opt.h"
  28. #include "avfilter.h"
  29. #include "formats.h"
  30. #include "internal.h"
  31. #include "video.h"
  32. enum ScanMode {
  33. MODE_TFF = 0,
  34. MODE_BFF = 1,
  35. };
  36. enum FieldType {
  37. FIELD_UPPER = 0,
  38. FIELD_LOWER = 1,
  39. };
  40. typedef struct InterlaceContext {
  41. const AVClass *class;
  42. enum ScanMode scan; // top or bottom field first scanning
  43. int lowpass; // enable or disable low pass filterning
  44. AVFrame *cur, *next; // the two frames from which the new one is obtained
  45. void (*lowpass_line)(uint8_t *dstp, ptrdiff_t linesize, const uint8_t *srcp,
  46. const uint8_t *srcp_above, const uint8_t *srcp_below);
  47. } InterlaceContext;
  48. void ff_interlace_init_x86(InterlaceContext *interlace);
  49. #endif /* AVFILTER_INTERLACE_H */