]> git.sesse.net Git - vlc/blob - include/vpar_synchro.h
. suite de l'output 8 bits couleur/n&b
[vlc] / include / vpar_synchro.h
1 /*****************************************************************************
2  * vpar_synchro.h : video parser blocks management
3  * (c)1999 VideoLAN
4  *****************************************************************************
5  *****************************************************************************
6  * Requires:
7  *  "config.h"
8  *  "common.h"
9  *  "mtime.h"
10  *  "vlc_thread.h"
11  *  "input.h"
12  *  "video.h"
13  *  "video_output.h"
14  *  "decoder_fifo.h"
15  *  "video_fifo.h"
16  *****************************************************************************/
17
18 #define SAM_SYNCHRO
19
20 /*****************************************************************************
21  * video_synchro_t and video_synchro_tab_s : timers for the video synchro
22  *****************************************************************************/
23 #ifdef SAM_SYNCHRO
24 typedef struct video_synchro_tab_s
25 {
26     double mean;
27     double deviation;
28     
29 } video_synchro_tab_t;
30
31 typedef struct video_synchro_fifo_s
32 {
33     /* type of image to be decoded, and decoding date */
34     int i_image_type;
35     mtime_t i_decode_date;
36     mtime_t i_pts;
37     
38 } video_synchro_fifo_t;
39
40 typedef struct video_synchro_s
41 {
42     /* fifo containing decoding dates */
43     video_synchro_fifo_t fifo[16];
44     unsigned int i_fifo_start;
45     unsigned int i_fifo_stop;
46
47     /* mean decoding time */
48     mtime_t i_mean_decode_time;
49     /* dates */
50     mtime_t i_last_display_pts;            /* pts of the last displayed image */
51     mtime_t i_last_decode_pts;               /* pts of the last decoded image */
52     mtime_t i_last_i_pts;                          /* pts of the last I image */
53     mtime_t i_last_nondropped_i_pts;       /* pts of last non-dropped I image */
54     unsigned int i_images_since_pts;
55     
56     /* il manquait un compteur */
57     unsigned int modulo;
58
59     /* P images since the last I */
60     unsigned int current_p_count;
61     unsigned int nondropped_p_count;
62     double p_count_predict;
63     /* B images since the last I */
64     unsigned int current_b_count;
65     unsigned int nondropped_b_count;
66     double b_count_predict;
67
68     /* can we display pictures ? */
69     unsigned int    can_display_i;
70     unsigned int    can_display_p;
71     double          displayable_p;
72     unsigned int    can_display_b;
73     double          displayable_b;
74
75     /* 1 for linear count, 2 for binary count, 3 for ternary count */
76     video_synchro_tab_t tab_p[6];
77     video_synchro_tab_t tab_b[6];
78
79     double theorical_fps;
80     double actual_fps;
81
82 } video_synchro_t;
83 #else
84 typedef struct video_synchro_s
85 {
86     int         kludge_level, kludge_p, kludge_b, kludge_nbp, kludge_nbb;
87     int         kludge_nbframes;
88     mtime_t     kludge_date, kludge_prevdate;
89     int         i_coding_type;
90 } video_synchro_t;
91
92 #define SYNC_TOLERATE   10000 /* 10 ms */
93 #define SYNC_DELAY      500000
94 #endif
95
96 /*****************************************************************************
97  * Prototypes
98  *****************************************************************************/
99 boolean_t vpar_SynchroChoose( struct vpar_thread_s * p_vpar, int i_coding_type,
100                          int i_structure );
101 void vpar_SynchroTrash( struct vpar_thread_s * p_vpar, int i_coding_type,
102                         int i_structure );
103 void vpar_SynchroDecode( struct vpar_thread_s * p_vpar, int i_coding_type,
104                             int i_structure );
105 void vpar_SynchroEnd( struct vpar_thread_s * p_vpar );
106 mtime_t vpar_SynchroDate( struct vpar_thread_s * p_vpar );
107
108 #ifndef SAM_SYNCHRO
109 void vpar_SynchroKludge( struct vpar_thread_s *, mtime_t );
110 #endif