tinterlace.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. enum TInterlaceMode {
  37. MODE_MERGE = 0,
  38. MODE_DROP_EVEN,
  39. MODE_DROP_ODD,
  40. MODE_PAD,
  41. MODE_INTERLEAVE_TOP,
  42. MODE_INTERLEAVE_BOTTOM,
  43. MODE_INTERLACEX2,
  44. MODE_MERGEX2,
  45. MODE_NB,
  46. };
  47. enum InterlaceScanMode {
  48. MODE_TFF = 0,
  49. MODE_BFF,
  50. };
  51. typedef struct TInterlaceContext {
  52. const AVClass *class;
  53. int mode; ///< TInterlaceMode, interlace mode selected
  54. AVRational preout_time_base;
  55. int flags; ///< flags affecting interlacing algorithm
  56. int frame; ///< number of the output frame
  57. int vsub; ///< chroma vertical subsampling
  58. AVFrame *cur;
  59. AVFrame *next;
  60. uint8_t *black_data[4]; ///< buffer used to fill padded lines
  61. int black_linesize[4];
  62. FFDrawContext draw;
  63. FFDrawColor color;
  64. const AVPixFmtDescriptor *csp;
  65. void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
  66. ptrdiff_t mref, ptrdiff_t pref, int clip_max);
  67. } TInterlaceContext;
  68. void ff_tinterlace_init_x86(TInterlaceContext *interlace);
  69. #endif /* AVFILTER_TINTERLACE_H */