xref: /aosp_15_r20/external/libavc/encoder/ih264e_fmt_conv.h (revision 495ae853bb871d1e5a258cb02c2cc13cde8ddb9a)
1*495ae853SAndroid Build Coastguard Worker /******************************************************************************
2*495ae853SAndroid Build Coastguard Worker  *
3*495ae853SAndroid Build Coastguard Worker  * Copyright (C) 2015 The Android Open Source Project
4*495ae853SAndroid Build Coastguard Worker  *
5*495ae853SAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
6*495ae853SAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
7*495ae853SAndroid Build Coastguard Worker  * You may obtain a copy of the License at:
8*495ae853SAndroid Build Coastguard Worker  *
9*495ae853SAndroid Build Coastguard Worker  * http://www.apache.org/licenses/LICENSE-2.0
10*495ae853SAndroid Build Coastguard Worker  *
11*495ae853SAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
12*495ae853SAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
13*495ae853SAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*495ae853SAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
15*495ae853SAndroid Build Coastguard Worker  * limitations under the License.
16*495ae853SAndroid Build Coastguard Worker  *
17*495ae853SAndroid Build Coastguard Worker  *****************************************************************************
18*495ae853SAndroid Build Coastguard Worker  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19*495ae853SAndroid Build Coastguard Worker */
20*495ae853SAndroid Build Coastguard Worker 
21*495ae853SAndroid Build Coastguard Worker /**
22*495ae853SAndroid Build Coastguard Worker *******************************************************************************
23*495ae853SAndroid Build Coastguard Worker * @file
24*495ae853SAndroid Build Coastguard Worker *  ih264e_fmt_conv.h
25*495ae853SAndroid Build Coastguard Worker *
26*495ae853SAndroid Build Coastguard Worker * @brief
27*495ae853SAndroid Build Coastguard Worker *  The file contains declarations of color space conversion routines
28*495ae853SAndroid Build Coastguard Worker *
29*495ae853SAndroid Build Coastguard Worker * @author
30*495ae853SAndroid Build Coastguard Worker *  ittiam
31*495ae853SAndroid Build Coastguard Worker *
32*495ae853SAndroid Build Coastguard Worker * @remarks
33*495ae853SAndroid Build Coastguard Worker *  none
34*495ae853SAndroid Build Coastguard Worker *
35*495ae853SAndroid Build Coastguard Worker *******************************************************************************
36*495ae853SAndroid Build Coastguard Worker */
37*495ae853SAndroid Build Coastguard Worker 
38*495ae853SAndroid Build Coastguard Worker #ifndef _IH264E_FMT_CONV_H_
39*495ae853SAndroid Build Coastguard Worker #define _IH264E_FMT_CONV_H_
40*495ae853SAndroid Build Coastguard Worker 
41*495ae853SAndroid Build Coastguard Worker /*****************************************************************************/
42*495ae853SAndroid Build Coastguard Worker /* Constant Macros                                                           */
43*495ae853SAndroid Build Coastguard Worker /*****************************************************************************/
44*495ae853SAndroid Build Coastguard Worker 
45*495ae853SAndroid Build Coastguard Worker #define COEFF1          13073
46*495ae853SAndroid Build Coastguard Worker #define COEFF2          -3207
47*495ae853SAndroid Build Coastguard Worker #define COEFF3          -6664
48*495ae853SAndroid Build Coastguard Worker #define COEFF4          16530
49*495ae853SAndroid Build Coastguard Worker 
50*495ae853SAndroid Build Coastguard Worker /*****************************************************************************/
51*495ae853SAndroid Build Coastguard Worker /* Function Declarations                                                     */
52*495ae853SAndroid Build Coastguard Worker /*****************************************************************************/
53*495ae853SAndroid Build Coastguard Worker 
54*495ae853SAndroid Build Coastguard Worker IH264E_ERROR_T ih264e_fmt_conv(codec_t *ps_codec,
55*495ae853SAndroid Build Coastguard Worker                                pic_buf_t *ps_pic,
56*495ae853SAndroid Build Coastguard Worker                                UWORD8 *pu1_y_dst,
57*495ae853SAndroid Build Coastguard Worker                                UWORD8 *pu1_u_dst,
58*495ae853SAndroid Build Coastguard Worker                                UWORD8 *pu1_v_dst,
59*495ae853SAndroid Build Coastguard Worker                                UWORD32 u4_dst_y_strd,
60*495ae853SAndroid Build Coastguard Worker                                UWORD32 u4_dst_uv_strd,
61*495ae853SAndroid Build Coastguard Worker                                WORD32 cur_row,
62*495ae853SAndroid Build Coastguard Worker                                WORD32 num_rows);
63*495ae853SAndroid Build Coastguard Worker 
64*495ae853SAndroid Build Coastguard Worker typedef void ih264e_fmt_conv_420sp_to_rgba8888_ft(UWORD8 *pu1_y_src,
65*495ae853SAndroid Build Coastguard Worker                                                   UWORD8 *pu1_uv_src,
66*495ae853SAndroid Build Coastguard Worker                                                   UWORD32 *pu4_rgba_dst,
67*495ae853SAndroid Build Coastguard Worker                                                   WORD32 wd,
68*495ae853SAndroid Build Coastguard Worker                                                   WORD32 ht,
69*495ae853SAndroid Build Coastguard Worker                                                   WORD32 src_y_strd,
70*495ae853SAndroid Build Coastguard Worker                                                   WORD32 src_uv_strd,
71*495ae853SAndroid Build Coastguard Worker                                                   WORD32 dst_strd,
72*495ae853SAndroid Build Coastguard Worker                                                   WORD32 is_u_first);
73*495ae853SAndroid Build Coastguard Worker 
74*495ae853SAndroid Build Coastguard Worker typedef void ih264e_fmt_conv_420sp_to_rgb565_ft(UWORD8 *pu1_y_src,
75*495ae853SAndroid Build Coastguard Worker                                                 UWORD8 *pu1_uv_src,
76*495ae853SAndroid Build Coastguard Worker                                                 UWORD16 *pu2_rgb_dst,
77*495ae853SAndroid Build Coastguard Worker                                                 WORD32 wd,
78*495ae853SAndroid Build Coastguard Worker                                                 WORD32 ht,
79*495ae853SAndroid Build Coastguard Worker                                                 WORD32 src_y_strd,
80*495ae853SAndroid Build Coastguard Worker                                                 WORD32 src_uv_strd,
81*495ae853SAndroid Build Coastguard Worker                                                 WORD32 dst_strd,
82*495ae853SAndroid Build Coastguard Worker                                                 WORD32 is_u_first);
83*495ae853SAndroid Build Coastguard Worker 
84*495ae853SAndroid Build Coastguard Worker typedef void ih264e_fmt_conv_420sp_to_420sp_ft(UWORD8 *pu1_y_src,
85*495ae853SAndroid Build Coastguard Worker                                                UWORD8 *pu1_uv_src,
86*495ae853SAndroid Build Coastguard Worker                                                UWORD8 *pu1_y_dst,
87*495ae853SAndroid Build Coastguard Worker                                                UWORD8 *pu1_uv_dst,
88*495ae853SAndroid Build Coastguard Worker                                                WORD32 wd,
89*495ae853SAndroid Build Coastguard Worker                                                WORD32 ht,
90*495ae853SAndroid Build Coastguard Worker                                                WORD32 src_y_strd,
91*495ae853SAndroid Build Coastguard Worker                                                WORD32 src_uv_strd,
92*495ae853SAndroid Build Coastguard Worker                                                WORD32 dst_y_strd,
93*495ae853SAndroid Build Coastguard Worker                                                WORD32 dst_uv_strd);
94*495ae853SAndroid Build Coastguard Worker 
95*495ae853SAndroid Build Coastguard Worker typedef void ih264e_fmt_conv_420sp_to_420p_ft(UWORD8 *pu1_y_src,
96*495ae853SAndroid Build Coastguard Worker                                               UWORD8 *pu1_uv_src,
97*495ae853SAndroid Build Coastguard Worker                                               UWORD8 *pu1_y_dst,
98*495ae853SAndroid Build Coastguard Worker                                               UWORD8 *pu1_u_dst,
99*495ae853SAndroid Build Coastguard Worker                                               UWORD8 *pu1_v_dst,
100*495ae853SAndroid Build Coastguard Worker                                               WORD32 wd,
101*495ae853SAndroid Build Coastguard Worker                                               WORD32 ht,
102*495ae853SAndroid Build Coastguard Worker                                               WORD32 src_y_strd,
103*495ae853SAndroid Build Coastguard Worker                                               WORD32 src_uv_strd,
104*495ae853SAndroid Build Coastguard Worker                                               WORD32 dst_y_strd,
105*495ae853SAndroid Build Coastguard Worker                                               WORD32 dst_uv_strd,
106*495ae853SAndroid Build Coastguard Worker                                               WORD32 is_u_first,
107*495ae853SAndroid Build Coastguard Worker                                               WORD32 disable_luma_copy);
108*495ae853SAndroid Build Coastguard Worker 
109*495ae853SAndroid Build Coastguard Worker typedef void ih264e_fmt_conv_420p_to_420sp_ft(UWORD8 *pu1_y_src, UWORD8 *pu1_u_src, UWORD8 *pu1_v_src,
110*495ae853SAndroid Build Coastguard Worker                                               UWORD8 *pu1_y_dst, UWORD8 *pu1_uv_dst,
111*495ae853SAndroid Build Coastguard Worker                                               UWORD16 u2_height, UWORD16 u2_width, UWORD16 src_y_strd,
112*495ae853SAndroid Build Coastguard Worker                                               UWORD16 src_u_strd, UWORD16 src_v_strd,
113*495ae853SAndroid Build Coastguard Worker                                               UWORD16 dst_y_strd, UWORD16 dst_uv_strd,
114*495ae853SAndroid Build Coastguard Worker                                               UWORD32 convert_uv_only);
115*495ae853SAndroid Build Coastguard Worker 
116*495ae853SAndroid Build Coastguard Worker typedef void ih264e_fmt_conv_422i_to_420sp_ft(UWORD8 *pu1_y_buf,UWORD8 *pu1_u_buf,UWORD8 *pu1_v_buf,
117*495ae853SAndroid Build Coastguard Worker                                               UWORD8 *pu1_422i_buf,
118*495ae853SAndroid Build Coastguard Worker                                               WORD32 u4_y_width,WORD32 u4_y_height,
119*495ae853SAndroid Build Coastguard Worker                                               WORD32 u4_y_stride,WORD32 u4_u_stride,WORD32 u4_v_stride,
120*495ae853SAndroid Build Coastguard Worker                                               WORD32 u4_422i_stride);
121*495ae853SAndroid Build Coastguard Worker 
122*495ae853SAndroid Build Coastguard Worker 
123*495ae853SAndroid Build Coastguard Worker /* C function declarations */
124*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420sp_to_rgba8888_ft ih264e_fmt_conv_420sp_to_rgba8888;
125*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420sp_to_rgb565_ft ih264e_fmt_conv_420sp_to_rgb565;
126*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420sp_to_420sp_ft ih264e_fmt_conv_420sp_to_420sp;
127*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420sp_to_420p_ft ih264e_fmt_conv_420sp_to_420p;
128*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420p_to_420sp_ft ih264e_fmt_conv_420p_to_420sp;
129*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_422i_to_420sp_ft ih264e_fmt_conv_422i_to_420sp;
130*495ae853SAndroid Build Coastguard Worker 
131*495ae853SAndroid Build Coastguard Worker /* A9Q function declarations */
132*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420sp_to_rgba8888_ft ih264e_fmt_conv_420sp_to_rgba8888_a9q;
133*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420sp_to_420sp_ft ih264e_fmt_conv_420sp_to_420sp_a9q;
134*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420sp_to_420p_ft ih264e_fmt_conv_420sp_to_420p_a9q;
135*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420p_to_420sp_ft ih264e_fmt_conv_420p_to_420sp_a9q;
136*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_422i_to_420sp_ft ih264e_fmt_conv_422i_to_420sp_a9q;
137*495ae853SAndroid Build Coastguard Worker 
138*495ae853SAndroid Build Coastguard Worker /* A9A function declarations */
139*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420sp_to_rgba8888_ft ih264e_fmt_conv_420sp_to_rgba8888_a9a;
140*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420sp_to_420sp_ft ih264e_fmt_conv_420sp_to_420sp_a9a;
141*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420sp_to_420p_ft ih264e_fmt_conv_420sp_to_420p_a9a;
142*495ae853SAndroid Build Coastguard Worker 
143*495ae853SAndroid Build Coastguard Worker /* SSSe31 function declarations */
144*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420sp_to_420p_ft ih264e_fmt_conv_420sp_to_420p_ssse31;
145*495ae853SAndroid Build Coastguard Worker 
146*495ae853SAndroid Build Coastguard Worker /* SSE4 function declarations */
147*495ae853SAndroid Build Coastguard Worker ih264e_fmt_conv_420sp_to_420p_ft ih264e_fmt_conv_420sp_to_420p_sse42;
148*495ae853SAndroid Build Coastguard Worker 
149*495ae853SAndroid Build Coastguard Worker #endif /* _IH264E_FMT_CONV_H_ */
150