annotate Modules/yuv.h @ 79675:c0a2294de787 2.7

Issue #16199: Backport 2to3 typo fix from 3.2.
author Chris Jerdonek <chris.jerdonek@gmail.com>
date Thu, 11 Oct 2012 16:15:46 -0700
parents fd25030223b0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1329
diff changeset
1
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
2 #ifndef Py_YUV_H
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
3 #define Py_YUV_H
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
4 #ifdef __cplusplus
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
5 extern "C" {
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
6 #endif
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
7
1253
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
8 /*
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
9 * SVideo YUV 4:1:1 format.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
10 *
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
11 * 4 consecutive quadwords describe 8 pixels on 2 lines, as depicted
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
12 * below. An array of (width/4) of the below structure describes 2
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
13 * scan lines.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
14 *
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
15 * +-------------------+
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
16 * | 00 | 01 | 02 | 03 | . . .
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
17 * +-------------------+
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
18 * | 10 | 11 | 12 | 13 | . . .
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
19 * +-------------------+
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
20 */
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
21 struct yuv411 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
22 struct {
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
23 unsigned int dummy:8;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
24 unsigned int y0:8;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
25 unsigned int u0:2;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
26 unsigned int v0:2;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
27 unsigned int y1:8;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
28 unsigned int u1:2;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
29 unsigned int v1:2;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
30 } v[4];
1253
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
31 };
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
32
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
33 #define YUV411_Y00(y) (y).v[0].y0
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
34 #define YUV411_Y01(y) (y).v[1].y0
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
35 #define YUV411_Y02(y) (y).v[2].y0
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
36 #define YUV411_Y03(y) (y).v[3].y0
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
37 #define YUV411_Y10(y) (y).v[0].y1
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
38 #define YUV411_Y11(y) (y).v[1].y1
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
39 #define YUV411_Y12(y) (y).v[2].y1
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
40 #define YUV411_Y13(y) (y).v[3].y1
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
41 #define YUV411_U00(y) ((y).v[0].u0<<6|(y).v[1].u0<<4|(y).v[2].u0<<2|(y).v[3].u0)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
42 #define YUV411_U01(y) YUV411_U00(y)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
43 #define YUV411_U02(y) YUV411_U00(y)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
44 #define YUV411_U03(y) YUV411_U00(y)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
45 #define YUV411_U10(y) ((y).v[0].u1<<6|(y).v[1].u1<<4|(y).v[2].u1<<2|(y).v[3].u1)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
46 #define YUV411_U11(y) YUV411_U10(y)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
47 #define YUV411_U12(y) YUV411_U10(y)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
48 #define YUV411_U13(y) YUV411_U10(y)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
49 #define YUV411_V00(y) ((y).v[0].v0<<6|(y).v[1].v0<<4|(y).v[2].v0<<2|(y).v[3].v0)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
50 #define YUV411_V01(y) YUV411_V00(y)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
51 #define YUV411_V02(y) YUV411_V00(y)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
52 #define YUV411_V03(y) YUV411_V00(y)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
53 #define YUV411_V10(y) ((y).v[0].v1<<6|(y).v[1].v1<<4|(y).v[2].v1<<2|(y).v[3].v1)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
54 #define YUV411_V11(y) YUV411_V10(y)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
55 #define YUV411_V12(y) YUV411_V10(y)
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
56 #define YUV411_V13(y) YUV411_V10(y)
1253
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
57
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
58 /*
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
59 * Compression Library YUV 4:2:2 format.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
60 *
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
61 * 1 longword describes 2 pixels.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
62 *
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
63 * +-------+
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
64 * | 0 | 1 |
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
65 * +-------+
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
66 */
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
67 struct yuv422 {
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
68 unsigned int u:8;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
69 unsigned int y0:8;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
70 unsigned int v:8;
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
71 unsigned int y1:8;
1253
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
72 };
61463
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
73 #define YUV422_Y0(y) (y).y0
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
74 #define YUV422_Y1(y) (y).y1
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
75 #define YUV422_U0(y) (y).u
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
76 #define YUV422_U1(y) (y).u
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
77 #define YUV422_V0(y) (y).v
fd25030223b0 Untabify C files. Will watch buildbots.
Antoine Pitrou <solipsis@pitrou.net>
parents: 14375
diff changeset
78 #define YUV422_V1(y) (y).v
1253
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
79
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
80 /*
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
81 * Compression library YUV 4:2:2 Duplicate Chroma format.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
82 *
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
83 * This is like the previous format, but the U and V values are
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
84 * duplicated vertically (and hence there is some redundancy in the
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
85 * data). With other words, lines 2*n and 2*n+1 have the same U and V
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
86 * values but different Y values.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
87 */
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
88
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
89 /*
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
90 * Conversion functions.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
91 */
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
92 void yuv_sv411_to_cl422dc(int, void *, void *, int, int);
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
93 void yuv_sv411_to_cl422dc_quartersize(int, void *, void *, int, int);
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
94 void yuv_sv411_to_cl422dc_sixteenthsize(int, void *, void *, int, int);
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
95
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
96 #ifdef __cplusplus
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
97 }
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
98 #endif
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
99 #endif /* !Py_YUV_H */