Added gst-plugins-base-subtitles0.10-0.10.34 for Meego Harmattan 1.2
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / docs / design / part-interlaced-video.txt
1 Interlaced Video
2 ================
3
4 Video buffers have a number of states identifiable through a combination of caps
5 and buffer flags.
6
7 Possible states:
8 - Progressive
9 - Interlaced
10   - Plain
11     - One field
12     - Two fields
13     - Three fields - this should be a progressive buffer with a repeated 'first'
14       field that can be used for telecine pulldown
15   - Telecine
16     - One field
17     - Two fields
18       - Progressive
19       - Interlaced (a.k.a. 'mixed'; the fields are from different frames)
20     - Three fields - this should be a progressive buffer with a repeated 'first'
21       field that can be used for telecine pulldown
22
23 Note: it can be seen that the different between the plain interlaced and
24 telecine states is that in the telecine state, buffers containing two fields may
25 be progressive.
26
27 Tools for identification:
28 - Caps
29   - interlaced - boolean
30   - interlacing-method - string - "unknown"/"telecine"
31 - Flags - GST_VIDEO_BUFFER_...
32   - TFF
33   - RFF
34   - ONEFIELD
35   - PROGRESSIVE
36
37
38 Identification of Buffer States
39 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40
41 Note that flags are not necessarily interpreted in the same way for all
42 different states nor are they necessarily required nor make sense in all cases.
43
44
45 Progressive
46 ...........
47
48 If the caps have no interlaced field, or have interlaced=false, then the buffer
49 is progressive. Note the possibility for progressive buffers in telecine streams
50 as well.
51
52
53 Plain Interlaced
54 ................
55
56 If the caps have interlaced=true and either do not contain the
57 interlacing-method field or contain interlacing-method=unknown, then the buffer
58 is plain interlaced.
59
60 GST_VIDEO_BUFFER_TFF indicates whether the top or bottom field is to be
61 displayed first. The timestamp on the buffer corresponds to the first field.
62 (FIXME - is the duration of the buffer the duration of both fields; each field's
63 duration is half the buffer duration)
64
65 GST_VIDEO_BUFFER_RFF indicates that the first field (indicated by the TFF flag)
66 should be repeated. This is generally only used for telecine purposes but as the
67 telecine state was added long after the interlaced state was added and defined,
68 this flag remains valid for plain interlaced buffers.
69
70 GST_VIDEO_BUFFER_ONEFIELD means that only the field indicated through the TFF
71 flag is to be used. The other field should be ignored.
72
73
74 Telecine
75 ........
76
77 If the caps have interlaced=true and interlacing-method=telecine then the
78 buffers are in some form of telecine state.
79
80 The TFF and ONEFIELD flags have the same semantics as for the plain interlaced
81 state.
82
83 GST_VIDEO_BUFFER_RFF in the telecine state indicates that the buffer contains
84 only repeated fields that are present in other buffers and are as such
85 unneeded. For example, in a sequence of three telecined frames, we might have:
86
87 AtAb AtBb BtBb
88
89 In this situation, we only need the first and third buffers as the second
90 buffer contains fields present in the first and third.
91
92 The telecine state require one additional flag to be able to identify
93 progressive buffers.
94
95 GST_VIDEO_BUFFER_PROGRESSIVE means that the buffer containing two fields is a
96 progressive frame. The implication is that if this flag is not set, the buffer
97 is an 'interlaced' or 'mixed' buffer that contains two fields that, when
98 combined with fields from adjacent buffers, allow reconstruction of progressive
99 frames.