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 SEC_OMX specific define. It support MFC 6.x tiled.
21 * NV12T(tiled) layout:
22 * Each element is not pixel. It is 64x32 pixel block.
23 * uv pixel block is interleaved as u v u v u v ...
24 * y1 y2 y7 y8 y9 y10 y15 y16
25 * y3 y4 y5 y6 y11 y12 y13 y14
26 * y17 y18 y23 y24 y25 y26 y31 y32
27 * y19 y20 y21 y22 y27 y28 y29 y30
28 * uv1 uv2 uv7 uv8 uv9 uv10 uv15 uv16
29 * uv3 uv4 uv5 uv6 uv11 uv12 uv13 uv14
30 * YUV420Planar(linear) layout:
31 * Each element is not pixel. It is 64x32 pixel block.
32 * y1 y2 y3 y4 y5 y6 y7 y8
33 * y9 y10 y11 y12 y13 y14 y15 y16
34 * y17 y18 y19 y20 y21 y22 y23 y24
35 * y25 y26 y27 y28 y29 y30 y31 y32
36 * u1 u2 u3 u4 u5 u6 u7 u8
37 * v1 v2 v3 v4 v5 v6 v7 v8
38 * YUV420Semiplanar(linear) layout:
39 * Each element is not pixel. It is 64x32 pixel block.
40 * uv pixel block is interleaved as u v u v u v ...
41 * y1 y2 y3 y4 y5 y6 y7 y8
42 * y9 y10 y11 y12 y13 y14 y15 y16
43 * y17 y18 y19 y20 y21 y22 y23 y24
44 * y25 y26 y27 y28 y29 y30 y31 y32
45 * uv1 uv2 uv3 uv4 uv5 uv6 uv7 uv8
46 * uv9 uv10 uv11 uv12 uv13 uv14 uv15 uv16
47 * @author ShinWon Lee (shinwon.lee@samsung.com)
53 #ifndef SW_CONVERTOR_H_
54 #define SW_CONVERTOR_H_
56 /*--------------------------------------------------------------------------------*/
57 /* Format Conversion API */
58 /*--------------------------------------------------------------------------------*/
61 * De-interleaves src to dest1, dest2
64 * Address of de-interleaved data[out]
67 * Address of de-interleaved data[out]
70 * Address of interleaved data[in]
73 * Size of interleaved data[in]
75 void csc_deinterleave_memcpy(
79 unsigned int src_size
);
82 * Interleaves src1, src2 to dest
85 * Address of interleaved data[out]
88 * Address of de-interleaved data[in]
91 * Address of de-interleaved data[in]
94 * Size of de-interleaved data[in]
96 void csc_interleave_memcpy(
100 unsigned int src_size
);
103 * Converts tiled data to linear
104 * It supports mfc 6.x tiled
105 * 1. y of nv12t to y of yuv420p
106 * 2. y of nv12t to y of yuv420s
109 * y address of yuv420[out]
112 * y address of nv12t[in]
114 * @param yuv420_width
115 * real width of yuv420[in]
118 * @param yuv420_height
119 * real height of yuv420[in]
123 void csc_tiled_to_linear_y(
124 unsigned char *y_dst
,
125 unsigned char *y_src
,
127 unsigned int height
);
130 * Converts tiled data to linear
131 * It supports mfc 6.x tiled
132 * 1. uv of nv12t to y of yuv420s
135 * uv address of yuv420s[out]
138 * uv address of nv12t[in]
140 * @param yuv420_width
141 * real width of yuv420s[in]
143 * @param yuv420_height
144 * real height of yuv420s[in]
147 void csc_tiled_to_linear_uv(
148 unsigned char *uv_dst
,
149 unsigned char *uv_src
,
151 unsigned int height
);
154 * Converts tiled data to linear
155 * It supports mfc 6.x tiled
156 * 1. uv of nt12t to uv of yuv420p
159 * u address of yuv420p[out]
162 * v address of yuv420p[out]
165 * uv address of nt12t[in]
167 * @param yuv420_width
168 * real width of yuv420p[in]
170 * @param yuv420_height
171 * real height of yuv420p[in]
173 void csc_tiled_to_linear_uv_deinterleave(
174 unsigned char *u_dst
,
175 unsigned char *v_dst
,
176 unsigned char *uv_src
,
178 unsigned int height
);
181 * Converts linear data to tiled
182 * It supports mfc 6.x tiled
183 * 1. y of yuv420 to y of nv12t
186 * y address of nv12t[out]
189 * y address of yuv420[in]
191 * @param yuv420_width
192 * real width of yuv420[in]
195 * @param yuv420_height
196 * real height of yuv420[in]
200 void csc_linear_to_tiled_y(
201 unsigned char *y_dst
,
202 unsigned char *y_src
,
204 unsigned int height
);
207 * Converts and interleaves linear data to tiled
208 * It supports mfc 6.x tiled
209 * 1. uv of nv12t to uv of yuv420
212 * uv address of nv12t[out]
215 * u address of yuv420[in]
218 * v address of yuv420[in]
220 * @param yuv420_width
221 * real width of yuv420[in]
223 * @param yuv420_height
224 * real height of yuv420[in]
227 void csc_linear_to_tiled_uv(
228 unsigned char *uv_dst
,
229 unsigned char *u_src
,
230 unsigned char *v_src
,
232 unsigned int height
);
235 * Converts RGB565 to YUV420P
238 * Y plane address of YUV420P[out]
241 * U plane address of YUV420P[out]
244 * V plane address of YUV420P[out]
247 * Address of RGB565[in]
250 * Width of RGB565[in]
253 * Height of RGB565[in]
255 void csc_RGB565_to_YUV420P(
256 unsigned char *y_dst
,
257 unsigned char *u_dst
,
258 unsigned char *v_dst
,
259 unsigned char *rgb_src
,
264 * Converts RGB565 to YUV420S
267 * Y plane address of YUV420S[out]
270 * UV plane address of YUV420S[out]
273 * Address of RGB565[in]
276 * Width of RGB565[in]
279 * Height of RGB565[in]
281 void csc_RGB565_to_YUV420SP(
282 unsigned char *y_dst
,
283 unsigned char *uv_dst
,
284 unsigned char *rgb_src
,
289 * Converts ARGB8888 to YUV420P
292 * Y plane address of YUV420P[out]
295 * U plane address of YUV420P[out]
298 * V plane address of YUV420P[out]
301 * Address of ARGB8888[in]
304 * Width of ARGB8888[in]
307 * Height of ARGB8888[in]
309 void csc_ARGB8888_to_YUV420P(
310 unsigned char *y_dst
,
311 unsigned char *u_dst
,
312 unsigned char *v_dst
,
313 unsigned char *rgb_src
,
315 unsigned int height
);
318 * Converts ARGB8888 to YUV420S
321 * Y plane address of YUV420S[out]
324 * UV plane address of YUV420S[out]
327 * Address of ARGB8888[in]
330 * Width of ARGB8888[in]
333 * Height of ARGB8888[in]
335 void csc_ARGB8888_to_YUV420SP(
336 unsigned char *y_dst
,
337 unsigned char *uv_dst
,
338 unsigned char *rgb_src
,
340 unsigned int height
);
343 * De-interleaves src to dest1, dest2
346 * Address of de-interleaved data[out]
349 * Address of de-interleaved data[out]
352 * Address of interleaved data[in]
355 * Size of interleaved data[in]
357 void csc_deinterleave_memcpy_neon(
358 unsigned char *dest1
,
359 unsigned char *dest2
,
361 unsigned int src_size
);
364 * Interleaves src1, src2 to dest
367 * Address of interleaved data[out]
370 * Address of de-interleaved data[in]
373 * Address of de-interleaved data[in]
376 * Size of de-interleaved data[in]
378 void csc_interleave_memcpy_neon(
382 unsigned int src_size
);
385 * Converts tiled data to linear for mfc 6.x
386 * 1. Y of NV12T to Y of YUV420P
387 * 2. Y of NV12T to Y of YUV420S
390 * Y address of YUV420[out]
393 * Y address of NV12T[in]
395 * @param yuv420_width
396 * real width of YUV420[in]
398 * @param yuv420_height
399 * Y: real height of YUV420[in]
402 void csc_tiled_to_linear_y_neon(
403 unsigned char *y_dst
,
404 unsigned char *y_src
,
406 unsigned int height
);
409 * Converts tiled data to linear for mfc 6.x
410 * 1. UV of NV12T to Y of YUV420S
413 * UV plane address of YUV420P[out]
416 * Y or UV plane address of NV12T[in]
418 * @param yuv420_width
419 * real width of YUV420[in]
421 * @param yuv420_height
422 * (real height)/2 of YUV420[in]
424 void csc_tiled_to_linear_uv_neon(
425 unsigned char *uv_dst
,
426 unsigned char *uv_src
,
428 unsigned int height
);
431 * Converts tiled data to linear for mfc 6.x
432 * Deinterleave src to u_dst, v_dst
433 * 1. UV of NV12T to Y of YUV420P
436 * U plane address of YUV420P[out]
439 * V plane address of YUV420P[out]
442 * Y or UV plane address of NV12T[in]
444 * @param yuv420_width
445 * real width of YUV420[in]
447 * @param yuv420_height
448 * (real height)/2 of YUV420[in]
450 void csc_tiled_to_linear_uv_deinterleave_neon(
451 unsigned char *u_dst
,
452 unsigned char *v_dst
,
453 unsigned char *uv_src
,
455 unsigned int height
);
458 * Converts linear data to tiled
459 * It supports mfc 6.x tiled
460 * 1. y of yuv420 to y of nv12t
463 * y address of nv12t[out]
466 * y address of yuv420[in]
468 * @param yuv420_width
469 * real width of yuv420[in]
472 * @param yuv420_height
473 * real height of yuv420[in]
477 void csc_linear_to_tiled_y_neon(
478 unsigned char *y_dst
,
479 unsigned char *y_src
,
481 unsigned int height
);
484 * Converts and interleave linear data to tiled
485 * It supports mfc 6.x tiled
486 * 1. uv of nv12t to uv of yuv420
489 * uv address of yuv420[out]
492 * uv address of nv12t[in]
494 * @param yuv420_width
495 * real width of yuv420[in]
497 * @param yuv420_height
498 * real height of yuv420[in]
501 void csc_linear_to_tiled_uv_neon(
502 unsigned char *uv_dst
,
503 unsigned char *uv_src
,
505 unsigned int height
);
507 void csc_ARGB8888_to_YUV420SP_NEON(
508 unsigned char *y_dst
,
509 unsigned char *uv_dst
,
510 unsigned char *rgb_src
,
512 unsigned int height
);
514 #endif /*COLOR_SPACE_CONVERTOR_H_*/