• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  * Copyright (C) 2015 The Android Open Source Project
4  *
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:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  *
17  *****************************************************************************
18  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19 */
20 
21 /**
22 *******************************************************************************
23 * @file
24 *  ih264e_fmt_conv.h
25 *
26 * @brief
27 *  The file contains extern declarations of color space conversion routines
28 *
29 * @author
30 *  ittiam
31 *
32 * @remarks
33 *  None
34 *
35 *******************************************************************************
36 */
37 
38 #ifndef IH264E_FMT_CONV_H_
39 #define IH264E_FMT_CONV_H_
40 
41 #define COEFF1          13073
42 #define COEFF2          -3207
43 #define COEFF3          -6664
44 #define COEFF4          16530
45 
46 IH264E_ERROR_T ih264e_fmt_conv(codec_t *ps_codec,
47                                pic_buf_t *ps_pic,
48                                UWORD8 *pu1_y_dst,
49                                UWORD8 *pu1_u_dst,
50                                UWORD8 *pu1_v_dst,
51                                UWORD32 u4_dst_y_strd,
52                                UWORD32 u4_dst_uv_strd,
53                                WORD32 cur_row,
54                                WORD32 num_rows);
55 
56 typedef void ih264e_fmt_conv_420sp_to_rgba8888_ft(UWORD8 *pu1_y_src,
57                                                   UWORD8 *pu1_uv_src,
58                                                   UWORD32 *pu4_rgba_dst,
59                                                   WORD32 wd,
60                                                   WORD32 ht,
61                                                   WORD32 src_y_strd,
62                                                   WORD32 src_uv_strd,
63                                                   WORD32 dst_strd,
64                                                   WORD32 is_u_first);
65 
66 typedef void ih264e_fmt_conv_420sp_to_rgb565_ft(UWORD8 *pu1_y_src,
67                                                 UWORD8 *pu1_uv_src,
68                                                 UWORD16 *pu2_rgb_dst,
69                                                 WORD32 wd,
70                                                 WORD32 ht,
71                                                 WORD32 src_y_strd,
72                                                 WORD32 src_uv_strd,
73                                                 WORD32 dst_strd,
74                                                 WORD32 is_u_first);
75 
76 typedef void ih264e_fmt_conv_420sp_to_420sp_ft(UWORD8 *pu1_y_src,
77                                                UWORD8 *pu1_uv_src,
78                                                UWORD8 *pu1_y_dst,
79                                                UWORD8 *pu1_uv_dst,
80                                                WORD32 wd,
81                                                WORD32 ht,
82                                                WORD32 src_y_strd,
83                                                WORD32 src_uv_strd,
84                                                WORD32 dst_y_strd,
85                                                WORD32 dst_uv_strd);
86 
87 typedef void ih264e_fmt_conv_420sp_to_420p_ft(UWORD8 *pu1_y_src,
88                                               UWORD8 *pu1_uv_src,
89                                               UWORD8 *pu1_y_dst,
90                                               UWORD8 *pu1_u_dst,
91                                               UWORD8 *pu1_v_dst,
92                                               WORD32 wd,
93                                               WORD32 ht,
94                                               WORD32 src_y_strd,
95                                               WORD32 src_uv_strd,
96                                               WORD32 dst_y_strd,
97                                               WORD32 dst_uv_strd,
98                                               WORD32 is_u_first,
99                                               WORD32 disable_luma_copy);
100 
101 typedef void ih264e_fmt_conv_420p_to_420sp_ft(UWORD8 *pu1_y_src, UWORD8 *pu1_u_src, UWORD8 *pu1_v_src,
102                                               UWORD8 *pu1_y_dst, UWORD8 *pu1_uv_dst,
103                                               UWORD16 u2_height, UWORD16 u2_width, UWORD16 src_y_strd,
104                                               UWORD16 src_u_strd, UWORD16 src_v_strd,
105                                               UWORD16 dst_y_strd, UWORD16 dst_uv_strd,
106                                               UWORD32 convert_uv_only);
107 
108 typedef void ih264e_fmt_conv_422i_to_420sp_ft(UWORD8 *pu1_y_buf,UWORD8 *pu1_u_buf,UWORD8 *pu1_v_buf,
109                                               UWORD8 *pu1_422i_buf,
110                                               WORD32 u4_y_width,WORD32 u4_y_height,
111                                               WORD32 u4_y_stride,WORD32 u4_u_stride,WORD32 u4_v_stride,
112                                               WORD32 u4_422i_stride);
113 
114 
115 /* C function declarations */
116 ih264e_fmt_conv_420sp_to_rgba8888_ft    ih264e_fmt_conv_420sp_to_rgba8888;
117 ih264e_fmt_conv_420sp_to_rgb565_ft      ih264e_fmt_conv_420sp_to_rgb565;
118 ih264e_fmt_conv_420sp_to_420sp_ft       ih264e_fmt_conv_420sp_to_420sp;
119 ih264e_fmt_conv_420sp_to_420p_ft        ih264e_fmt_conv_420sp_to_420p;
120 ih264e_fmt_conv_420p_to_420sp_ft        ih264e_fmt_conv_420p_to_420sp;
121 ih264e_fmt_conv_422i_to_420sp_ft        ih264e_fmt_conv_422i_to_420sp;
122 
123 /* A9Q function declarations */
124 ih264e_fmt_conv_420sp_to_rgba8888_ft    ih264e_fmt_conv_420sp_to_rgba8888_a9q;
125 ih264e_fmt_conv_420sp_to_420sp_ft       ih264e_fmt_conv_420sp_to_420sp_a9q;
126 ih264e_fmt_conv_420sp_to_420p_ft        ih264e_fmt_conv_420sp_to_420p_a9q;
127 ih264e_fmt_conv_420p_to_420sp_ft        ih264e_fmt_conv_420p_to_420sp_a9q;
128 ih264e_fmt_conv_422i_to_420sp_ft        ih264e_fmt_conv_422i_to_420sp_a9q;
129 
130 
131 /* A9A function declarations */
132 ih264e_fmt_conv_420sp_to_rgba8888_ft ih264e_fmt_conv_420sp_to_rgba8888_a9a;
133 ih264e_fmt_conv_420sp_to_420sp_ft ih264e_fmt_conv_420sp_to_420sp_a9a;
134 ih264e_fmt_conv_420sp_to_420p_ft ih264e_fmt_conv_420sp_to_420p_a9a;
135 
136 /* SSSe31 function declarations */
137 ih264e_fmt_conv_420sp_to_420p_ft ih264e_fmt_conv_420sp_to_420p_ssse31;
138 
139 /* SSE4 function declarations */
140 ih264e_fmt_conv_420sp_to_420p_ft ih264e_fmt_conv_420sp_to_420p_sse42;
141 
142 #endif /* IH264E_FMT_CONV_H_ */
143