1 #ifndef MVI_H 2 #define MVI_H 3 4 #define MVI_MAX_X (256) 5 #define MVI_MAX_Y (256) 6 7 typedef struct mvi_t /* Movie-related stuff. */ 8 { 9 FILE *f; /* Current movie file. */ 10 int fr; /* Current movie frame #. */ 11 int last_fr; /* Last movie frame # (decode only) */ 12 int x_dim, y_dim; /* */ 13 uint8_t *vid; /* Previous movie frame. */ 14 uint8_t bbox[8][4]; /* Previous bounding boxes. */ 15 uint32_t tot_bytes; /* Total bytes in movie file. */ 16 uint32_t rpt_frames; /* Number of frames skipped */ 17 uint32_t rpt_rows; /* Number of repeated rows in frames */ 18 #ifndef NO_LZO 19 uint32_t tot_lzosave; /* Total bytes saved by LZO */ 20 #endif 21 } mvi_t; 22 23 24 void mvi_init(mvi_t *movie, int x_dim, int y_dim); 25 void mvi_wr_frame(mvi_t *movie, uint8_t *vid, uint8_t bbox[8][4]); 26 int mvi_rd_frame(mvi_t *movie, uint8_t *vid, uint8_t bbox[8][4]); 27 28 /* Flags returned by mvi_rd_frame */ 29 #define MVI_FR_SAME (1) /* set if movie file skipped the frame */ 30 #define MVI_BB_SAME (2) /* set if movie file skipped the bbox */ 31 #define MVI_NEW_DIM (4) /* set if movie changed dimensions. */ 32 33 #endif 34