annotate Modules/yuv.h @ 5817:48b94de85bf3 legacy-trunk

Extensive changes by AMK.
author Guido van Rossum <guido@python.org>
date Thu, 17 Jul 1997 16:29:42 +0000
parents 65d2d8e67da3
children 916fb024ce94
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 /***********************************************************
2061
172ba04a5191 Added 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
2 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
172ba04a5191 Added 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents: 1746
diff changeset
3 The Netherlands.
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1329
diff changeset
4
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1329
diff changeset
5 All Rights Reserved
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1329
diff changeset
6
4503
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
7 Permission to use, copy, modify, and distribute this software and its
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
8 documentation for any purpose and without fee is hereby granted,
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1329
diff changeset
9 provided that the above copyright notice appear in all copies and that
4503
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
10 both that copyright notice and this permission notice appear in
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1329
diff changeset
11 supporting documentation, and that the names of Stichting Mathematisch
4503
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
12 Centrum or CWI or Corporation for National Research Initiatives or
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
13 CNRI not be used in advertising or publicity pertaining to
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
14 distribution of the software without specific, written prior
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
15 permission.
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1329
diff changeset
16
4503
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
17 While CWI is the initial source for this software, a modified version
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
18 is made available by the Corporation for National Research Initiatives
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
19 (CNRI) at the Internet address ftp://ftp.python.org.
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
20
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
21 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
22 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
23 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
24 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
25 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
26 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
27 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
65d2d8e67da3 New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents: 2061
diff changeset
28 PERFORMANCE OF THIS SOFTWARE.
1746
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1329
diff changeset
29
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1329
diff changeset
30 ******************************************************************/
1940892d2fe3 Merge alpha100 branch back to main trunk
Guido van Rossum <guido@python.org>
parents: 1329
diff changeset
31
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
32 #ifndef Py_YUV_H
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
33 #define Py_YUV_H
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
34 #ifdef __cplusplus
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
35 extern "C" {
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
36 #endif
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
37
1253
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
38 /*
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
39 * SVideo YUV 4:1:1 format.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
40 *
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
41 * 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
42 * 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
43 * scan lines.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
44 *
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
45 * +-------------------+
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
46 * | 00 | 01 | 02 | 03 | . . .
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
47 * +-------------------+
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
48 * | 10 | 11 | 12 | 13 | . . .
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
49 * +-------------------+
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
50 */
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
51 struct yuv411 {
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
52 struct {
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
53 unsigned int dummy:8;
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
54 unsigned int y0:8;
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
55 unsigned int u0:2;
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
56 unsigned int v0:2;
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
57 unsigned int y1:8;
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
58 unsigned int u1:2;
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
59 unsigned int v1:2;
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
60 } v[4];
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
61 };
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 #define YUV411_Y00(y) (y).v[0].y0
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
64 #define YUV411_Y01(y) (y).v[1].y0
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
65 #define YUV411_Y02(y) (y).v[2].y0
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
66 #define YUV411_Y03(y) (y).v[3].y0
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
67 #define YUV411_Y10(y) (y).v[0].y1
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
68 #define YUV411_Y11(y) (y).v[1].y1
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
69 #define YUV411_Y12(y) (y).v[2].y1
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
70 #define YUV411_Y13(y) (y).v[3].y1
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
71 #define YUV411_U00(y) ((y).v[0].u0<<6|(y).v[1].u0<<4|(y).v[2].u0<<2|(y).v[3].u0)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
72 #define YUV411_U01(y) YUV411_U00(y)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
73 #define YUV411_U02(y) YUV411_U00(y)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
74 #define YUV411_U03(y) YUV411_U00(y)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
75 #define YUV411_U10(y) ((y).v[0].u1<<6|(y).v[1].u1<<4|(y).v[2].u1<<2|(y).v[3].u1)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
76 #define YUV411_U11(y) YUV411_U10(y)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
77 #define YUV411_U12(y) YUV411_U10(y)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
78 #define YUV411_U13(y) YUV411_U10(y)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
79 #define YUV411_V00(y) ((y).v[0].v0<<6|(y).v[1].v0<<4|(y).v[2].v0<<2|(y).v[3].v0)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
80 #define YUV411_V01(y) YUV411_V00(y)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
81 #define YUV411_V02(y) YUV411_V00(y)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
82 #define YUV411_V03(y) YUV411_V00(y)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
83 #define YUV411_V10(y) ((y).v[0].v1<<6|(y).v[1].v1<<4|(y).v[2].v1<<2|(y).v[3].v1)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
84 #define YUV411_V11(y) YUV411_V10(y)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
85 #define YUV411_V12(y) YUV411_V10(y)
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
86 #define YUV411_V13(y) YUV411_V10(y)
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 * Compression Library YUV 4:2:2 format.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
90 *
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
91 * 1 longword describes 2 pixels.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
92 *
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
93 * +-------+
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
94 * | 0 | 1 |
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
95 * +-------+
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
96 */
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
97 struct yuv422 {
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
98 unsigned int u:8;
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
99 unsigned int y0:8;
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
100 unsigned int v:8;
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
101 unsigned int y1:8;
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
102 };
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
103 #define YUV422_Y0(y) (y).y0
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
104 #define YUV422_Y1(y) (y).y1
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
105 #define YUV422_U0(y) (y).u
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
106 #define YUV422_U1(y) (y).u
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
107 #define YUV422_V0(y) (y).v
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
108 #define YUV422_V1(y) (y).v
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
109
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
110 /*
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
111 * Compression library YUV 4:2:2 Duplicate Chroma format.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
112 *
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
113 * 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
114 * 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
115 * 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
116 * values but different Y values.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
117 */
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
118
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
119 /*
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
120 * Conversion functions.
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
121 */
685b31fe89c6 Added conversion routines to sv module.
Sjoerd Mullender <sjoerd@acm.org>
parents:
diff changeset
122 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
123 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
124 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
125
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
126 #ifdef __cplusplus
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
127 }
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
128 #endif
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1253
diff changeset
129 #endif /* !Py_YUV_H */