summaryrefslogtreecommitdiffstats
path: root/sec_mm/sec_omx/sec_codecs/video/mfc_c110/include/color_space_convertor.h
blob: c5cef08ec450d05c9a98b3215e37811bfd1eab07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/*
 *
 * Copyright 2011 Samsung Electronics S.LSI Co. LTD
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * @file    color_space_convertor.h
 * @brief   SEC_OMX specific define.
 *   NV12T(tiled) layout:
 *   Each element is not pixel. It is 64x32 pixel block.
 *   uv pixel block is interleaved as u v u v u v ...
 *   y1    y2    y7    y8    y9    y10   y15   y16
 *   y3    y4    y5    y6    y11   y12   y13   y14
 *   y17   y18   y23   y24   y25   y26   y31   y32
 *   y19   y20   y21   y22   y27   y28   y29   y30
 *   uv1   uv2   uv7   uv8   uv9   uv10  uv15  uv16
 *   uv3   uv4   uv5   uv6   uv11  uv12  uv13  uv14
 *   YUV420Planar(linear) layout:
 *   Each element is not pixel. It is 64x32 pixel block.
 *   y1    y2    y3    y4    y5    y6    y7    y8
 *   y9    y10   y11   y12   y13   y14   y15   y16
 *   y17   y18   y19   y20   y21   y22   y23   y24
 *   y25   y26   y27   y28   y29   y30   y31   y32
 *   u1    u2    u3    u4    u5    u6    u7    u8
 *   v1    v2    v3    v4    v5    v6    v7    v8
 *   YUV420Semiplanar(linear) layout:
 *   Each element is not pixel. It is 64x32 pixel block.
 *   uv pixel block is interleaved as u v u v u v ...
 *   y1    y2    y3    y4    y5    y6    y7    y8
 *   y9    y10   y11   y12   y13   y14   y15   y16
 *   y17   y18   y19   y20   y21   y22   y23   y24
 *   y25   y26   y27   y28   y29   y30   y31   y32
 *   uv1   uv2   uv3   uv4   uv5   uv6   uv7   uv8
 *   uv9   uv10  uv11  uv12  uv13  uv14  uv15  uv16
 * @author  ShinWon Lee (shinwon.lee@samsung.com)
 * @version 1.0
 * @history
 *   2011.7.01 : Create
 */

#ifndef COLOR_SPACE_CONVERTOR_H_
#define COLOR_SPACE_CONVERTOR_H_

/*--------------------------------------------------------------------------------*/
/* Format Conversion API                                                          */
/*--------------------------------------------------------------------------------*/
/* Neon Code */
/*
 * De-interleaves src to dest1, dest2
 *
 * @param dest1
 *   Address of de-interleaved data[out]
 *
 * @param dest2
 *   Address of de-interleaved data[out]
 *
 * @param src
 *   Address of interleaved data[in]
 *
 * @param src_size
 *   Size of interleaved data[in]
 */
void csc_deinterleave_memcpy_neon(char *dest1, char *dest2, char *src, int src_size);

/*
 * Interleaves src1, src2 to dest
 *
 * @param dest
 *   Address of interleaved data[out]
 *
 * @param src1
 *   Address of de-interleaved data[in]
 *
 * @param src2
 *   Address of de-interleaved data[in]
 *
 * @param src_size
 *   Size of de-interleaved data[in]
 */
void csc_interleave_memcpy_neon(char *dest, char *src1, char *src2, int src_size);

/*
 * Converts tiled data to linear.
 * 1. Y of NV12T to Y of YUV420P
 * 2. Y of NV12T to Y of YUV420S
 * 3. UV of NV12T to UV of YUV420S
 *
 * @param yuv420_dest
 *   Y or UV plane address of YUV420[out]
 *
 * @param nv12t_src
 *   Y or UV plane address of NV12T[in]
 *
 * @param yuv420_width
 *   Width of YUV420[in]
 *
 * @param yuv420_height
 *   Y: Height of YUV420, UV: Height/2 of YUV420[in]
 */
void csc_tiled_to_linear_neon(char *yuv420p_y_dest, char *nv12t_y_src, int yuv420p_width, int yuv420p_y_height);

/*
 * Converts and Deinterleaves tiled data to linear
 * 1. UV of NV12T to UV of YUV420P
 *
 * @param yuv420_u_dest
 *   U plane address of YUV420P[out]
 *
 * @param yuv420_v_dest
 *   V plane address of YUV420P[out]
 *
 * @param nv12t_src
 *   UV plane address of NV12T[in]
 *
 * @param yuv420_width
 *   Width of YUV420[in]
 *
 * @param yuv420_uv_height
 *   Height/2 of YUV420[in]
 */
void csc_tiled_to_linear_deinterleave_neon(char *yuv420p_u_dest, char *yuv420p_v_dest, char *nv12t_uv_src, int yuv420p_width, int yuv420p_uv_height);

/*
 * Converts linear data to tiled.
 * 1. Y of YUV420P to Y of NV12T
 * 2. Y of YUV420S to Y of NV12T
 * 3. UV of YUV420S to UV of NV12T
 *
 * @param nv12t_dest
 *   Y or UV plane address of NV12T[out]
 *
 * @param yuv420_src
 *   Y or UV plane address of YUV420P(S)[in]
 *
 * @param yuv420_width
 *   Width of YUV420[in]
 *
 * @param yuv420_height
 *   Y: Height of YUV420, UV: Height/2 of YUV420[in]
 */
void csc_linear_to_tiled_neon(char *nv12t_dest, char *yuv420p_src, int yuv420p_width, int yuv420p_y_height);

/*
 * Converts and Interleaves linear to tiled
 * 1. UV of YUV420P to UV of NV12T
 *
 * @param nv12t_uv_dest
 *   UV plane address of NV12T[out]
 *
 * @param yuv420p_u_src
 *   U plane address of YUV420P[in]
 *
 * @param yuv420p_v_src
 *   V plane address of YUV420P[in]
 *
 * @param yuv420_width
 *   Width of YUV420[in]
 *
 * @param yuv420_uv_height
 *   Height/2 of YUV420[in]
 */
void csc_linear_to_tiled_interleave_neon(char *nv12t_uv_dest, char *yuv420p_u_src, char *yuv420p_v_src, int yuv420p_width, int yuv420p_uv_height);

#endif /*COLOR_SPACE_CONVERTOR_H_*/