pullup.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * This file is part of MPlayer.
  3. *
  4. * MPlayer 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. * MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. #ifndef MPLAYER_PULLUP_H
  19. #define MPLAYER_PULLUP_H
  20. #define PULLUP_CPU_MMX 1
  21. #define PULLUP_CPU_MMX2 2
  22. #define PULLUP_CPU_3DNOW 4
  23. #define PULLUP_CPU_3DNOWEXT 8
  24. #define PULLUP_CPU_SSE 16
  25. #define PULLUP_CPU_SSE2 32
  26. #define PULLUP_FMT_Y 1
  27. #define PULLUP_FMT_YUY2 2
  28. #define PULLUP_FMT_UYVY 3
  29. #define PULLUP_FMT_RGB32 4
  30. struct pullup_buffer
  31. {
  32. int lock[2];
  33. unsigned char **planes;
  34. };
  35. struct pullup_field
  36. {
  37. int parity;
  38. struct pullup_buffer *buffer;
  39. unsigned int flags;
  40. int breaks;
  41. int affinity;
  42. int *diffs;
  43. int *comb;
  44. int *var;
  45. struct pullup_field *prev, *next;
  46. };
  47. struct pullup_frame
  48. {
  49. int lock;
  50. int length;
  51. int parity;
  52. struct pullup_buffer **ifields, *ofields[2];
  53. struct pullup_buffer *buffer;
  54. };
  55. struct pullup_context
  56. {
  57. /* Public interface */
  58. int format;
  59. int nplanes;
  60. int *bpp, *w, *h, *stride, *background;
  61. unsigned int cpu;
  62. int junk_left, junk_right, junk_top, junk_bottom;
  63. int verbose;
  64. int metric_plane;
  65. int strict_breaks;
  66. int strict_pairs;
  67. /* Internal data */
  68. struct pullup_field *first, *last, *head;
  69. struct pullup_buffer *buffers;
  70. int nbuffers;
  71. int (*diff)(unsigned char *, unsigned char *, int);
  72. int (*comb)(unsigned char *, unsigned char *, int);
  73. int (*var)(unsigned char *, unsigned char *, int);
  74. int metric_w, metric_h, metric_len, metric_offset;
  75. struct pullup_frame *frame;
  76. };
  77. struct pullup_buffer *pullup_lock_buffer(struct pullup_buffer *b, int parity);
  78. void pullup_release_buffer(struct pullup_buffer *b, int parity);
  79. struct pullup_buffer *pullup_get_buffer(struct pullup_context *c, int parity);
  80. void pullup_submit_field(struct pullup_context *c, struct pullup_buffer *b, int parity);
  81. void pullup_flush_fields(struct pullup_context *c);
  82. struct pullup_frame *pullup_get_frame(struct pullup_context *c);
  83. void pullup_pack_frame(struct pullup_context *c, struct pullup_frame *fr);
  84. void pullup_release_frame(struct pullup_frame *fr);
  85. struct pullup_context *pullup_alloc_context(void);
  86. void pullup_preinit_context(struct pullup_context *c);
  87. void pullup_init_context(struct pullup_context *c);
  88. void pullup_free_context(struct pullup_context *c);
  89. #endif /* MPLAYER_PULLUP_H */