vpar_synchro.h 2.55 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*****************************************************************************
 * vpar_synchro.h : video parser blocks management
 * (c)1999 VideoLAN
 *****************************************************************************
 *****************************************************************************
 * Requires:
 *  "config.h"
 *  "common.h"
 *  "mtime.h"
 *  "vlc_thread.h"
 *  "input.h"
 *  "video.h"
 *  "video_output.h"
 *  "decoder_fifo.h"
 *  "video_fifo.h"
 *****************************************************************************/

/*****************************************************************************
19
 * video_synchro_t and video_synchro_tab_s : timers for the video synchro
20
 *****************************************************************************/
21
22
23
24
25
26
27
typedef struct video_synchro_tab_s
{
    double mean;
    double deviation;
    
} video_synchro_tab_t;

28
29
30
31
typedef struct video_synchro_fifo_s
{
    /* type of image to be decoded, and decoding date */
    int i_image_type;
32
33
    mtime_t i_decode_date;
    mtime_t i_pts;
34
35
36
    
} video_synchro_fifo_t;

37
38
typedef struct video_synchro_s
{
39
40
41
42
43
    /* fifo containing decoding dates */
    video_synchro_fifo_t fifo[16];
    unsigned int i_fifo_start;
    unsigned int i_fifo_stop;

44
45
46
47
48
49
50
51
    /* mean decoding time */
    mtime_t i_mean_decode_time;
    /* tells whether we accumulated delay */
    mtime_t i_delay;
    /* dates */
    mtime_t i_last_pts;
    mtime_t i_last_i_pts;
    unsigned int i_images_since_pts;
52
53
54
    
    /* il manquait un compteur */
    unsigned int modulo;
55
56

    /* P images since the last I */
57
    unsigned int current_p_count;
58
59
    double p_count_predict;
    /* B images since the last I */
60
    unsigned int current_b_count;
61
62
63
64
65
    double b_count_predict;

    /* 1 for linear count, 2 for binary count, 3 for ternary count */
    video_synchro_tab_t tab_p[6];
    video_synchro_tab_t tab_b[6];
66

67
68
69
    double theorical_fps;
    double actual_fps;

70
71
72
73
74
} video_synchro_t;

/*****************************************************************************
 * Prototypes
 *****************************************************************************/
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
75
boolean_t vpar_SynchroChoose( struct vpar_thread_s * p_vpar, int i_coding_type, 
76
77
78
                         int i_structure );
void vpar_SynchroTrash( struct vpar_thread_s * p_vpar, int i_coding_type,
                        int i_structure );
79
void vpar_SynchroDecode( struct vpar_thread_s * p_vpar, int i_coding_type,
80
                            int i_structure );
81
82
void vpar_SynchroEnd( struct vpar_thread_s * p_vpar );
mtime_t vpar_SynchroDate( struct vpar_thread_s * p_vpar );