yadif.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * This file is part of FFmpeg.
  3. *
  4. * FFmpeg is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (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 GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with FFmpeg; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef AVFILTER_YADIF_H
  19. #define AVFILTER_YADIF_H
  20. #include "libavutil/pixdesc.h"
  21. #include "avfilter.h"
  22. enum YADIFMode {
  23. YADIF_MODE_SEND_FRAME = 0, ///< send 1 frame for each frame
  24. YADIF_MODE_SEND_FIELD = 1, ///< send 1 frame for each field
  25. YADIF_MODE_SEND_FRAME_NOSPATIAL = 2, ///< send 1 frame for each frame but skips spatial interlacing check
  26. YADIF_MODE_SEND_FIELD_NOSPATIAL = 3, ///< send 1 frame for each field but skips spatial interlacing check
  27. };
  28. enum YADIFParity {
  29. YADIF_PARITY_TFF = 0, ///< top field first
  30. YADIF_PARITY_BFF = 1, ///< bottom field first
  31. YADIF_PARITY_AUTO = -1, ///< auto detection
  32. };
  33. enum YADIFDeint {
  34. YADIF_DEINT_ALL = 0, ///< deinterlace all frames
  35. YADIF_DEINT_INTERLACED = 1, ///< only deinterlace frames marked as interlaced
  36. };
  37. typedef struct YADIFContext {
  38. const AVClass *class;
  39. enum YADIFMode mode;
  40. enum YADIFParity parity;
  41. enum YADIFDeint deint;
  42. int frame_pending;
  43. AVFrame *cur;
  44. AVFrame *next;
  45. AVFrame *prev;
  46. AVFrame *out;
  47. /**
  48. * Required alignment for filter_line
  49. */
  50. void (*filter_line)(void *dst,
  51. void *prev, void *cur, void *next,
  52. int w, int prefs, int mrefs, int parity, int mode);
  53. void (*filter_edges)(void *dst, void *prev, void *cur, void *next,
  54. int w, int prefs, int mrefs, int parity, int mode);
  55. const AVPixFmtDescriptor *csp;
  56. int eof;
  57. uint8_t *temp_line;
  58. int temp_line_size;
  59. } YADIFContext;
  60. void ff_yadif_init_x86(YADIFContext *yadif);
  61. #endif /* AVFILTER_YADIF_H */