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.

85 lines
2.4KB

  1. /*
  2. * Copyright (c) 2011 Stefano Sabatini
  3. * Copyright (c) 2010 Baptiste Coudurier
  4. * Copyright (c) 2003 Michael Zucchi <notzed@ximian.com>
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * FFmpeg is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. */
  22. /**
  23. * @file
  24. * temporal field interlace filter, ported from MPlayer/libmpcodecs
  25. */
  26. #ifndef AVFILTER_TINTERLACE_H
  27. #define AVFILTER_TINTERLACE_H
  28. #include "libavutil/bswap.h"
  29. #include "libavutil/opt.h"
  30. #include "libavutil/pixdesc.h"
  31. #include "drawutils.h"
  32. #include "avfilter.h"
  33. #define TINTERLACE_FLAG_VLPF 01
  34. #define TINTERLACE_FLAG_CVLPF 2
  35. #define TINTERLACE_FLAG_EXACT_TB 4
  36. #define TINTERLACE_FLAG_BYPASS_IL 8
  37. enum VLPFilter {
  38. VLPF_OFF = 0,
  39. VLPF_LIN = 1,
  40. VLPF_CMP = 2,
  41. };
  42. enum TInterlaceMode {
  43. MODE_MERGE = 0,
  44. MODE_DROP_EVEN,
  45. MODE_DROP_ODD,
  46. MODE_PAD,
  47. MODE_INTERLEAVE_TOP,
  48. MODE_INTERLEAVE_BOTTOM,
  49. MODE_INTERLACEX2,
  50. MODE_MERGEX2,
  51. MODE_NB,
  52. };
  53. enum InterlaceScanMode {
  54. MODE_TFF = 0,
  55. MODE_BFF,
  56. };
  57. typedef struct TInterlaceContext {
  58. const AVClass *class;
  59. int mode; ///< TInterlaceMode, interlace mode selected
  60. AVRational preout_time_base;
  61. int flags; ///< flags affecting interlacing algorithm
  62. int lowpass; ///< legacy interlace filter lowpass mode
  63. int vsub; ///< chroma vertical subsampling
  64. AVFrame *cur;
  65. AVFrame *next;
  66. uint8_t *black_data[4]; ///< buffer used to fill padded lines
  67. int black_linesize[4];
  68. FFDrawContext draw;
  69. FFDrawColor color;
  70. const AVPixFmtDescriptor *csp;
  71. void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
  72. ptrdiff_t mref, ptrdiff_t pref, int clip_max);
  73. } TInterlaceContext;
  74. void ff_tinterlace_init_x86(TInterlaceContext *interlace);
  75. #endif /* AVFILTER_TINTERLACE_H */