5 yuv_sv411_to_cl422dc(int invert
, void *data
, void *yuv
, int width
, int height
)
7 struct yuv411
*in
= data
;
8 struct yuv422
*out_even
= yuv
;
9 struct yuv422
*out_odd
= out_even
+ width
/ 2;
10 int i
, j
; /* counters */
12 for (i
= height
/ 2; i
--; ) {
13 for (j
= width
/ 4; j
--; ) {
14 YUV422_Y0(*out_even
) = YUV411_Y00(*in
);
15 YUV422_U0(*out_even
) = YUV411_U00(*in
);
16 YUV422_V0(*out_even
) = YUV411_V00(*in
);
17 YUV422_Y1(*out_even
) = YUV411_Y01(*in
);
19 YUV422_Y0(*out_even
) = YUV411_Y02(*in
);
20 YUV422_U0(*out_even
) = YUV411_U02(*in
);
21 YUV422_V0(*out_even
) = YUV411_V02(*in
);
22 YUV422_Y1(*out_even
) = YUV411_Y03(*in
);
24 YUV422_Y0(*out_odd
) = YUV411_Y10(*in
);
25 YUV422_U0(*out_odd
) = YUV411_U10(*in
);
26 YUV422_V0(*out_odd
) = YUV411_V10(*in
);
27 YUV422_Y1(*out_odd
) = YUV411_Y11(*in
);
29 YUV422_Y0(*out_odd
) = YUV411_Y12(*in
);
30 YUV422_U0(*out_odd
) = YUV411_U12(*in
);
31 YUV422_V0(*out_odd
) = YUV411_V12(*in
);
32 YUV422_Y1(*out_odd
) = YUV411_Y13(*in
);
36 out_even
+= width
/ 2;
42 yuv_sv411_to_cl422dc_quartersize(int invert
, void *data
, void *yuv
,
43 int width
, int height
)
45 int w4
= width
/ 4; /* quarter of width is used often */
46 struct yuv411
*in_even
= data
;
47 struct yuv411
*in_odd
= in_even
+ w4
;
48 struct yuv422
*out_even
= yuv
;
49 struct yuv422
*out_odd
= out_even
+ w4
;
50 int i
, j
; /* counters */
51 int u
, v
; /* U and V values */
53 for (i
= height
/ 4; i
--; ) {
55 u
= YUV411_U00(*in_even
);
56 v
= YUV411_V00(*in_even
);
58 YUV422_Y0(*out_even
) = YUV411_Y00(*in_even
);
59 YUV422_U0(*out_even
) = u
;
60 YUV422_V0(*out_even
) = v
;
61 YUV422_Y1(*out_even
) = YUV411_Y02(*in_even
);
63 YUV422_Y0(*out_odd
) = YUV411_Y10(*in_odd
);
64 YUV422_U0(*out_odd
) = u
;
65 YUV422_V0(*out_odd
) = v
;
66 YUV422_Y1(*out_odd
) = YUV411_Y12(*in_odd
);
81 yuv_sv411_to_cl422dc_sixteenthsize(int invert
, void *data
, void *yuv
,
82 int width
, int height
)
84 int w4_3
= 3 * width
/ 4; /* three quarters of width is used often */
85 int w8
= width
/ 8; /* and so is one eighth */
86 struct yuv411
*in_even
= data
;
87 struct yuv411
*in_odd
= in_even
+ width
/ 2;
88 struct yuv422
*out_even
= yuv
;
89 struct yuv422
*out_odd
= out_even
+ w8
;
90 int i
, j
; /* counters */
91 int u
, v
; /* U and V values */
93 for (i
= height
/ 8; i
--; ) {
95 u
= YUV411_U00(in_even
[0]);
96 v
= YUV411_V00(in_even
[0]);
98 YUV422_Y0(*out_even
) = YUV411_Y00(in_even
[0]);
99 YUV422_U0(*out_even
) = u
;
100 YUV422_V0(*out_even
) = v
;
101 YUV422_Y1(*out_even
) = YUV411_Y00(in_even
[1]);
103 YUV422_Y0(*out_odd
) = YUV411_Y00(in_odd
[0]);
104 YUV422_U0(*out_odd
) = u
;
105 YUV422_V0(*out_odd
) = v
;
106 YUV422_Y1(*out_odd
) = YUV411_Y00(in_even
[1]);