00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 #ifndef MPLAYER_PULLUP_H
00020 #define MPLAYER_PULLUP_H
00021 
00022 #define PULLUP_CPU_MMX 1
00023 #define PULLUP_CPU_MMX2 2
00024 #define PULLUP_CPU_3DNOW 4
00025 #define PULLUP_CPU_3DNOWEXT 8
00026 #define PULLUP_CPU_SSE 16
00027 #define PULLUP_CPU_SSE2 32
00028 
00029 #define PULLUP_FMT_Y 1
00030 #define PULLUP_FMT_YUY2 2
00031 #define PULLUP_FMT_UYVY 3
00032 #define PULLUP_FMT_RGB32 4
00033 
00034 struct pullup_buffer
00035 {
00036     int lock[2];
00037     unsigned char **planes;
00038 };
00039 
00040 struct pullup_field
00041 {
00042     int parity;
00043     struct pullup_buffer *buffer;
00044     unsigned int flags;
00045     int breaks;
00046     int affinity;
00047     int *diffs;
00048     int *comb;
00049     int *var;
00050     struct pullup_field *prev, *next;
00051 };
00052 
00053 struct pullup_frame
00054 {
00055     int lock;
00056     int length;
00057     int parity;
00058     struct pullup_buffer **ifields, *ofields[2];
00059     struct pullup_buffer *buffer;
00060 };
00061 
00062 struct pullup_context
00063 {
00064     
00065     int format;
00066     int nplanes;
00067     int *bpp, *w, *h, *stride, *background;
00068     unsigned int cpu;
00069     int junk_left, junk_right, junk_top, junk_bottom;
00070     int verbose;
00071     int metric_plane;
00072     int strict_breaks;
00073     int strict_pairs;
00074     
00075     struct pullup_field *first, *last, *head;
00076     struct pullup_buffer *buffers;
00077     int nbuffers;
00078     int (*diff)(unsigned char *, unsigned char *, int);
00079     int (*comb)(unsigned char *, unsigned char *, int);
00080     int (*var)(unsigned char *, unsigned char *, int);
00081     int metric_w, metric_h, metric_len, metric_offset;
00082     struct pullup_frame *frame;
00083 };
00084 
00085 
00086 struct pullup_buffer *pullup_lock_buffer(struct pullup_buffer *b, int parity);
00087 void pullup_release_buffer(struct pullup_buffer *b, int parity);
00088 struct pullup_buffer *pullup_get_buffer(struct pullup_context *c, int parity);
00089 
00090 void pullup_submit_field(struct pullup_context *c, struct pullup_buffer *b, int parity);
00091 void pullup_flush_fields(struct pullup_context *c);
00092 
00093 struct pullup_frame *pullup_get_frame(struct pullup_context *c);
00094 void pullup_pack_frame(struct pullup_context *c, struct pullup_frame *fr);
00095 void pullup_release_frame(struct pullup_frame *fr);
00096 
00097 struct pullup_context *pullup_alloc_context(void);
00098 void pullup_preinit_context(struct pullup_context *c);
00099 void pullup_init_context(struct pullup_context *c);
00100 void pullup_free_context(struct pullup_context *c);
00101 
00102 #endif