2 * libzvbi -- Sliced VBI data
4 * Copyright (C) 2000, 2001 Michael H. Schimek
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA.
22 /* $Id: sliced.h,v 1.11 2008-02-24 14:17:02 mschimek Exp $ */
36 * @addtogroup Sliced Sliced VBI data
38 * @brief Definition of sliced VBI data.
40 * The output of the libzvbi raw VBI decoder, and input to the data
41 * service decoder, is VBI data in binary format as defined in this
42 * section. It is similar to the output of hardware VBI decoders
43 * and VBI data transmitted in digital TV streams.
47 * @name Data service symbols
54 * No data service, blank vbi_sliced structure.
56 #define VBI_SLICED_NONE 0
59 * Unknown data service (vbi_dvb_demux).
62 #define VBI_SLICED_UNKNOWN 0
65 * Antiope a.k.a. Teletext System A
67 * Reference: <a href="http://www.itu.ch">ITU-R BT.653
68 * "Teletext Systems"</a>
70 * vbi_sliced payload: Last 37 bytes, without clock run-in and
71 * framing code, lsb first transmitted.
75 #define VBI_SLICED_ANTIOPE 0x00002000
77 * Synonym of VBI_SLICED_ANTIOPE.
80 #define VBI_SLICED_TELETEXT_A 0x00002000
82 #define VBI_SLICED_TELETEXT_B_L10_625 0x00000001
83 #define VBI_SLICED_TELETEXT_B_L25_625 0x00000002
85 * Teletext System B for 625 line systems
87 * Note this is separated into Level 1.0 and Level 2.5+ since the latter
88 * permits occupation of scan line 6 which is frequently out of
89 * range of raw VBI capture drivers. Clients should request decoding of both,
90 * may then verify Level 2.5 is covered. vbi_sliced id can be
91 * VBI_SLICED_TELETEXT_B, _B_L10_625 or _B_L25_625 regardless of line number.
93 * Reference: <a href="http://www.etsi.org">EN 300 706
94 * "Enhanced Teletext specification"</a>, <a href="http://www.itu.ch">
95 * ITU-R BT.653 "Teletext Systems"</a>
97 * vbi_sliced payload: Last 42 of the 45 byte Teletext packet, that is
98 * without clock run-in and framing code, lsb first transmitted.
100 #define VBI_SLICED_TELETEXT_B (VBI_SLICED_TELETEXT_B_L10_625 | \
101 VBI_SLICED_TELETEXT_B_L25_625)
103 * Synonym of VBI_SLICED_TELETEXT_B.
106 #define VBI_SLICED_TELETEXT_B_625 VBI_SLICED_TELETEXT_B
109 * Teletext System C for 625 line systems
111 * Reference: <a href="http://www.itu.ch">ITU-R BT.653
112 * "Teletext Systems"</a>
114 * vbi_sliced payload: Last 33 bytes, without clock run-in and
115 * framing code, lsb first transmitted.
119 #define VBI_SLICED_TELETEXT_C_625 0x00004000
122 * Teletext System D for 625 line systems
124 * Reference: <a href="http://www.itu.ch">ITU-R BT.653
125 * "Teletext Systems"</a>
127 * vbi_sliced payload: Last 34 bytes, without clock run-in and
128 * framing code, lsb first transmitted.
132 #define VBI_SLICED_TELETEXT_D_625 0x00008000
135 * Video Program System
137 * Reference: <a href="http://www.etsi.org">ETS 300 231
138 * "Specification of the domestic video Programme
139 * Delivery Control system (PDC)"</a>, <a href="http://www.irt.de">
140 * IRT 8R2 "Video-Programm-System (VPS)"</a>.
142 * vbi_sliced payload: Byte number 3 to 15 according to ETS 300 231
143 * Figure 9, lsb first transmitted.
145 #define VBI_SLICED_VPS 0x00000004
148 * Pseudo-VPS signal transmitted on field 2
150 * vbi_sliced payload: 13 bytes.
154 #define VBI_SLICED_VPS_F2 0x00001000
156 #define VBI_SLICED_CAPTION_625_F1 0x00000008
157 #define VBI_SLICED_CAPTION_625_F2 0x00000010
159 * Closed Caption for 625 line systems
161 * Note this is split into field one and two services since for basic
162 * caption decoding only field one is required. vbi_sliced id can be
163 * VBI_SLICED_CAPTION_625, _625_F1 or _625_F2 regardless of line number.
165 * Reference: <a href="http://global.ihs.com">EIA 608
166 * "Recommended Practice for Line 21 Data Service"</a>.
168 * vbi_sliced payload: First and second byte including parity,
169 * lsb first transmitted.
171 #define VBI_SLICED_CAPTION_625 (VBI_SLICED_CAPTION_625_F1 | \
172 VBI_SLICED_CAPTION_625_F2)
175 * Wide Screen Signalling for 625 line systems
177 * Reference: <a href="http://www.etsi.org">EN 300 294
178 * "625-line television Wide Screen Signalling (WSS)"</a>.
180 * vbi_sliced payload:
184 * bit 7 6 5 4 3 2 1 0 x x 13 12 11 10 9 8<br></pre>
185 * according to EN 300 294, Table 1, lsb first transmitted.
187 #define VBI_SLICED_WSS_625 0x00000400
189 #define VBI_SLICED_CAPTION_525_F1 0x00000020
190 #define VBI_SLICED_CAPTION_525_F2 0x00000040
192 * Closed Caption for 525 line systems (NTSC).
194 * Note this is split into field one and two services since for basic
195 * caption decoding only field one is required. vbi_sliced id can be
196 * VBI_SLICED_CAPTION_525, _525_F1 or _525_F2 regardless of line number.
198 * VBI_SLICED_CAPTION_525 also covers XDS (Extended Data Service),
199 * V-Chip data and ITV / WebTV data.
201 * Reference: <a href="http://global.ihs.com">EIA 608
202 * "Recommended Practice for Line 21 Data Service"</a>.
204 * vbi_sliced payload: First and second byte including parity,
205 * lsb first transmitted.
207 #define VBI_SLICED_CAPTION_525 (VBI_SLICED_CAPTION_525_F1 | \
208 VBI_SLICED_CAPTION_525_F2)
210 * Closed Caption at double bit rate for 525 line systems.
214 * vbi_sliced payload: First to fourth byte including parity bit,
215 * lsb first transmitted.
217 #define VBI_SLICED_2xCAPTION_525 0x00000080
220 * Teletext System B for 525 line systems
222 * Reference: <a href="http://www.itu.ch">ITU-R BT.653
223 * "Teletext Systems"</a>
225 * vbi_sliced payload: Last 34 bytes, without clock run-in and
226 * framing code, lsb first transmitted.
230 #define VBI_SLICED_TELETEXT_B_525 0x00010000
233 * North American Basic Teletext Specification
234 * a.k.a. Teletext System C for 525 line systems
236 * Reference: <a href="http://global.ihs.com">EIA-516
237 * "North American Basic Teletext Specification (NABTS)"</a>,
238 * <a href="http://www.itu.ch">ITU-R BT.653 "Teletext Systems"</a>
240 * vbi_sliced payload: Last 33 bytes, without clock run-in and
241 * framing code, lsb first transmitted.
245 #define VBI_SLICED_NABTS 0x00000100
248 * Synonym of VBI_SLICED_NABTS.
251 #define VBI_SLICED_TELETEXT_C_525 0x00000100
256 * vbi_sliced payload: 34 bytes.
259 * This service was misdefined.
260 * Use VBI_SLICED_TELETEXT_B_525 or VBI_SLICED_TELETEXT_D_525 in new code.
262 #define VBI_SLICED_TELETEXT_BD_525 0x00000200
265 * Teletext System D for 525 line systems
267 * Reference: <a href="http://www.itu.ch">ITU-R BT.653
268 * "Teletext Systems"</a>
270 * vbi_sliced payload: Last 34 bytes, without clock run-in and
271 * framing code, lsb first transmitted.
275 #define VBI_SLICED_TELETEXT_D_525 0x00020000
278 * Wide Screen Signalling for NTSC Japan
280 * Reference: <a href="http://www.jeita.or.jp">EIA-J CPR-1204</a>
282 * vbi_sliced payload:
285 * msb lsb msb lsb msb lsb
286 * bit 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 x x x x 19 18 17 16
290 #define VBI_SLICED_WSS_CPR1204 0x00000800
293 * No actual data service. This symbol is used to request capturing
294 * of all PAL/SECAM VBI data lines from the libzvbi driver interface,
295 * as opposed to just those lines used to transmit the requested
298 #define VBI_SLICED_VBI_625 0x20000000
301 * No actual data service. This symbol is used to request capturing
302 * of all NTSC VBI data lines from the libzvbi driver interface,
303 * as opposed to just those lines used to transmit the requested
306 #define VBI_SLICED_VBI_525 0x40000000
310 typedef unsigned int vbi_service_set;
314 * @brief This structure holds one scan line of sliced vbi data.
316 * For example the contents of NTSC line 21, two bytes of Closed Caption
317 * data. Usually an array of vbi_sliced is used, covering all
318 * VBI lines of the two fields of a video frame.
322 * A @ref VBI_SLICED_ symbol identifying the data service. Under cirumstances
323 * (see VBI_SLICED_TELETEXT_B) this can be a set of VBI_SLICED_ symbols.
327 * Source line number according to the ITU-R line numbering scheme,
328 * a value of @c 0 if the exact line number is unknown. Note that some
329 * data services cannot be reliable decoded without line number.
331 * @image html zvbi_625.gif "ITU-R PAL/SECAM line numbering scheme"
332 * @image html zvbi_525.gif "ITU-R NTSC line numbering scheme"
336 * The actual payload. See the documentation of @ref VBI_SLICED_ symbols
347 vbi_sliced_name (vbi_service_set service)
350 vbi_sliced_payload_bits (vbi_service_set service)
360 #endif /* SLICED_H */