3 * Copyright 2012 Samsung Electronics S.LSI Co. LTD
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
20 * @brief Exynos_OMX specific define. It support MFC's tiled format.
21 * NV12T(tiled) layout:
22 * Each element is not pixel.
23 * MFC 5.x : It is 64x32 pixel block.
24 * MFC 6.x : It is 16x16 pixel block.
25 * uv pixel block is interleaved as u v u v u v ...
26 * y1 y2 y7 y8 y9 y10 y15 y16
27 * y3 y4 y5 y6 y11 y12 y13 y14
28 * y17 y18 y23 y24 y25 y26 y31 y32
29 * y19 y20 y21 y22 y27 y28 y29 y30
30 * uv1 uv2 uv7 uv8 uv9 uv10 uv15 uv16
31 * uv3 uv4 uv5 uv6 uv11 uv12 uv13 uv14
32 * YUV420Planar(linear) layout:
33 * Each element is not pixel. It is 64x32 pixel block.
34 * y1 y2 y3 y4 y5 y6 y7 y8
35 * y9 y10 y11 y12 y13 y14 y15 y16
36 * y17 y18 y19 y20 y21 y22 y23 y24
37 * y25 y26 y27 y28 y29 y30 y31 y32
38 * u1 u2 u3 u4 u5 u6 u7 u8
39 * v1 v2 v3 v4 v5 v6 v7 v8
40 * YUV420Semiplanar(linear) layout:
41 * Each element is not pixel. It is 64x32 pixel block.
42 * uv pixel block is interleaved as u v u v u v ...
43 * y1 y2 y3 y4 y5 y6 y7 y8
44 * y9 y10 y11 y12 y13 y14 y15 y16
45 * y17 y18 y19 y20 y21 y22 y23 y24
46 * y25 y26 y27 y28 y29 y30 y31 y32
47 * uv1 uv2 uv3 uv4 uv5 uv6 uv7 uv8
48 * uv9 uv10 uv11 uv12 uv13 uv14 uv15 uv16
49 * @author ShinWon Lee (shinwon.lee@samsung.com)
55 #ifndef SW_CONVERTOR_H_
56 #define SW_CONVERTOR_H_
58 /*--------------------------------------------------------------------------------*/
59 /* Format Conversion API */
60 /*--------------------------------------------------------------------------------*/
63 * De-interleaves src to dest1, dest2
66 * Address of de-interleaved data[out]
69 * Address of de-interleaved data[out]
72 * Address of interleaved data[in]
75 * Size of interleaved data[in]
77 void csc_deinterleave_memcpy(
81 unsigned int src_size
);
85 * Interleaves src1, src2 to dest
88 * Address of interleaved data[out]
91 * Address of de-interleaved data[in]
94 * Address of de-interleaved data[in]
97 * Size of de-interleaved data[in]
99 void csc_interleave_memcpy(
103 unsigned int src_size
);
107 * Converts tiled data to linear
108 * 1. y of nv12t to y of yuv420p
109 * 2. y of nv12t to y of yuv420s
112 * y address of yuv420[out]
115 * y address of nv12t[in]
117 * @param yuv420_width
118 * real width of yuv420[in]
121 * @param yuv420_height
122 * real height of yuv420[in]
126 void csc_tiled_to_linear_y(
127 unsigned char *y_dst
,
128 unsigned char *y_src
,
130 unsigned int height
);
134 * Converts tiled data to linear
135 * 1. uv of nv12t to y of yuv420s
138 * uv address of yuv420s[out]
141 * uv address of nv12t[in]
143 * @param yuv420_width
144 * real width of yuv420s[in]
146 * @param yuv420_height
147 * real height of yuv420s[in]
150 void csc_tiled_to_linear_uv(
151 unsigned char *uv_dst
,
152 unsigned char *uv_src
,
154 unsigned int height
);
158 * Converts tiled data to linear
159 * 1. uv of nt12t to uv of yuv420p
162 * u address of yuv420p[out]
165 * v address of yuv420p[out]
168 * uv address of nt12t[in]
170 * @param yuv420_width
171 * real width of yuv420p[in]
173 * @param yuv420_height
174 * real height of yuv420p[in]
176 void csc_tiled_to_linear_uv_deinterleave(
177 unsigned char *u_dst
,
178 unsigned char *v_dst
,
179 unsigned char *uv_src
,
181 unsigned int height
);
185 * Converts linear data to tiled
186 * 1. y of yuv420 to y of nv12t
189 * y address of nv12t[out]
192 * y address of yuv420[in]
194 * @param yuv420_width
195 * real width of yuv420[in]
198 * @param yuv420_height
199 * real height of yuv420[in]
203 void csc_linear_to_tiled_y(
204 unsigned char *y_dst
,
205 unsigned char *y_src
,
207 unsigned int height
);
211 * Converts and interleaves linear data to tiled
212 * 1. uv of nv12t to uv of yuv420
215 * uv address of nv12t[out]
218 * u address of yuv420[in]
221 * v address of yuv420[in]
223 * @param yuv420_width
224 * real width of yuv420[in]
226 * @param yuv420_height
227 * real height of yuv420[in]
230 void csc_linear_to_tiled_uv(
231 unsigned char *uv_dst
,
232 unsigned char *u_src
,
233 unsigned char *v_src
,
235 unsigned int height
);
239 * Converts RGB565 to YUV420P
242 * Y plane address of YUV420P[out]
245 * U plane address of YUV420P[out]
248 * V plane address of YUV420P[out]
251 * Address of RGB565[in]
254 * Width of RGB565[in]
257 * Height of RGB565[in]
259 void csc_RGB565_to_YUV420P(
260 unsigned char *y_dst
,
261 unsigned char *u_dst
,
262 unsigned char *v_dst
,
263 unsigned char *rgb_src
,
269 * Converts RGB565 to YUV420SP
272 * Y plane address of YUV420SP[out]
275 * UV plane address of YUV420SP[out]
278 * Address of RGB565[in]
281 * Width of RGB565[in]
284 * Height of RGB565[in]
286 void csc_RGB565_to_YUV420SP(
287 unsigned char *y_dst
,
288 unsigned char *uv_dst
,
289 unsigned char *rgb_src
,
295 * Converts BGRA8888 to YUV420P
298 * Y plane address of YUV420P[out]
301 * U plane address of YUV420P[out]
304 * V plane address of YUV420P[out]
307 * Address of BGRA8888[in]
310 * Width of BGRA8888[in]
313 * Height of BGRA8888[in]
315 void csc_BGRA8888_to_YUV420P(
316 unsigned char *y_dst
,
317 unsigned char *u_dst
,
318 unsigned char *v_dst
,
319 unsigned char *rgb_src
,
321 unsigned int height
);
325 * Converts BGRA8888 to YUV420SP
328 * Y plane address of YUV420SP[out]
331 * UV plane address of YUV420SP[out]
334 * Address of BGRA8888[in]
337 * Width of BGRA8888[in]
340 * Height of BGRA8888[in]
342 void csc_BGRA8888_to_YUV420SP(
343 unsigned char *y_dst
,
344 unsigned char *uv_dst
,
345 unsigned char *rgb_src
,
347 unsigned int height
);
351 * Converts RGBA8888 to YUV420P
354 * Y plane address of YUV420P[out]
357 * U plane address of YUV420P[out]
360 * V plane address of YUV420P[out]
363 * Address of RGBA8888[in]
366 * Width of RGBA8888[in]
369 * Height of RGBA8888[in]
371 void csc_RGBA8888_to_YUV420P(
372 unsigned char *y_dst
,
373 unsigned char *u_dst
,
374 unsigned char *v_dst
,
375 unsigned char *rgb_src
,
377 unsigned int height
);
381 * Converts RGBA8888 to YUV420SP
384 * Y plane address of YUV420SP[out]
387 * UV plane address of YUV420SP[out]
390 * Address of RGBA8888[in]
393 * Width of RGBA8888[in]
396 * Height of RGBA8888[in]
398 void csc_RGBA8888_to_YUV420SP(
399 unsigned char *y_dst
,
400 unsigned char *uv_dst
,
401 unsigned char *rgb_src
,
403 unsigned int height
);
405 #endif /*COLOR_SPACE_CONVERTOR_H_*/