• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  * Copyright (C) 2018 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 * \file ihevce_cmn_utils_instr_set_router.h
23 *
24 * \brief
25 *    This file contains declarations related to common utilities used in encoder
26 *
27 * \date
28 *    15/07/2013
29 *
30 * \author
31 *    Ittiam
32 *
33 * List of Functions
34 *
35 *
36 ******************************************************************************
37 */
38 
39 #ifndef __IHEVCE_CMN_UTILS_INSTR_SET_ROUTER_H_
40 #define __IHEVCE_CMN_UTILS_INSTR_SET_ROUTER_H_
41 
42 #include "ihevc_typedefs.h"
43 #include "ihevc_defs.h"
44 #include "ihevce_defs.h"
45 
46 /*****************************************************************************/
47 /* Typedefs                                                                  */
48 /*****************************************************************************/
49 typedef UWORD32 FT_CALC_HAD_SATD_8BIT(UWORD8 *, WORD32, UWORD8 *, WORD32, WORD16 *, WORD32);
50 
51 typedef LWORD64 FT_SSD_CALCULATOR(
52     UWORD8 *, UWORD8 *, UWORD32, UWORD32, UWORD32, UWORD32, CHROMA_PLANE_ID_T);
53 
54 typedef LWORD64 FT_SSD_AND_SAD_CALCULATOR(UWORD8 *, WORD32, UWORD8 *, WORD32, WORD32, UWORD32 *);
55 
56 typedef void FT_CHROMA_INTERLEAVE_2D_COPY(
57     UWORD8 *, WORD32, UWORD8 *, WORD32, WORD32, WORD32, CHROMA_PLANE_ID_T);
58 
59 typedef void FT_COPY_2D(UWORD8 *, WORD32, UWORD8 *, WORD32, WORD32, WORD32);
60 
61 typedef void FT_2D_SQUARE_COPY(void *, WORD32, void *, WORD32, WORD32, WORD32);
62 
63 typedef void FT_WT_AVG_2D(
64     UWORD8 *,
65     UWORD8 *,
66     WORD32,
67     WORD32,
68     WORD32,
69     WORD32,
70     UWORD8 *,
71     WORD32,
72     WORD32,
73     WORD32,
74     WORD32,
75     WORD32,
76     WORD32);
77 
78 typedef void
79     FT_ITRANS_RECON_DC(UWORD8 *, WORD32, UWORD8 *, WORD32, WORD32, WORD16, CHROMA_PLANE_ID_T);
80 
81 typedef WORD32 FT_SCAN_COEFFS(WORD16 *, WORD32 *, WORD32, WORD32, UWORD8 *, UWORD8 *, WORD32);
82 
83 typedef void FT_GET_EO_SAO_PARAMS(void *, WORD32, WORD32 *, WORD32 *);
84 
85 /*****************************************************************************/
86 /* Structure                                                                 */
87 /*****************************************************************************/
88 typedef struct
89 {
90     FT_CALC_HAD_SATD_8BIT *pf_HAD_4x4_8bit;
91     FT_CALC_HAD_SATD_8BIT *pf_HAD_8x8_8bit;
92     FT_CALC_HAD_SATD_8BIT *pf_HAD_16x16_8bit;
93     FT_CALC_HAD_SATD_8BIT *pf_HAD_32x32_8bit;
94     FT_CALC_HAD_SATD_8BIT *pf_AC_HAD_8x8_8bit;
95     FT_CALC_HAD_SATD_8BIT *pf_chroma_HAD_4x4_8bit;
96     FT_CALC_HAD_SATD_8BIT *pf_chroma_AC_HAD_4x4_8bit;
97     FT_CALC_HAD_SATD_8BIT *pf_chroma_HAD_8x8_8bit;
98     FT_CALC_HAD_SATD_8BIT *pf_chroma_HAD_16x16_8bit;
99     FT_SSD_CALCULATOR *pf_ssd_calculator;
100     FT_SSD_CALCULATOR *pf_chroma_interleave_ssd_calculator;
101     FT_SSD_AND_SAD_CALCULATOR *pf_ssd_and_sad_calculator;
102     FT_CHROMA_INTERLEAVE_2D_COPY *pf_chroma_interleave_2d_copy;
103     FT_COPY_2D *pf_copy_2d;
104     FT_2D_SQUARE_COPY *pf_2d_square_copy;
105     FT_WT_AVG_2D *pf_wt_avg_2d;
106     FT_ITRANS_RECON_DC *pf_itrans_recon_dc;
107     FT_SCAN_COEFFS *pf_scan_coeffs;
108     FT_GET_EO_SAO_PARAMS *pf_get_luma_eo_sao_params;
109     FT_GET_EO_SAO_PARAMS *pf_get_chroma_eo_sao_params;
110 } ihevce_cmn_opt_func_t;
111 
112 /*****************************************************************************/
113 /* Extern Function Declarations                                              */
114 /*****************************************************************************/
115 void ihevce_cmn_utils_instr_set_router(
116     ihevce_cmn_opt_func_t *ps_func_list, UWORD8 u1_is_popcnt_available, IV_ARCH_T e_arch);
117 
118 /* Function List - C */
119 FT_CALC_HAD_SATD_8BIT ihevce_HAD_4x4_8bit;
120 FT_CALC_HAD_SATD_8BIT ihevce_HAD_8x8_8bit;
121 FT_CALC_HAD_SATD_8BIT ihevce_HAD_16x16_8bit;
122 FT_CALC_HAD_SATD_8BIT ihevce_HAD_32x32_8bit;
123 FT_CALC_HAD_SATD_8BIT ihevce_compute_ac_had_8x8_8bit;
124 FT_CALC_HAD_SATD_8BIT ihevce_chroma_HAD_4x4_8bit;
125 FT_CALC_HAD_SATD_8BIT ihevce_chroma_compute_AC_HAD_4x4_8bit;
126 FT_CALC_HAD_SATD_8BIT ihevce_chroma_HAD_8x8_8bit;
127 FT_CALC_HAD_SATD_8BIT ihevce_chroma_HAD_16x16_8bit;
128 FT_SSD_CALCULATOR ihevce_ssd_calculator;
129 FT_SSD_CALCULATOR ihevce_chroma_interleave_ssd_calculator;
130 FT_SSD_AND_SAD_CALCULATOR ihevce_ssd_and_sad_calculator;
131 FT_CHROMA_INTERLEAVE_2D_COPY ihevce_chroma_interleave_2d_copy;
132 FT_COPY_2D ihevce_copy_2d;
133 FT_2D_SQUARE_COPY ihevce_2d_square_copy_luma;
134 FT_WT_AVG_2D ihevce_wt_avg_2d;
135 FT_ITRANS_RECON_DC ihevce_itrans_recon_dc;
136 FT_SCAN_COEFFS ihevce_scan_coeffs;
137 FT_GET_EO_SAO_PARAMS ihevce_get_luma_eo_sao_params;
138 FT_GET_EO_SAO_PARAMS ihevce_get_chroma_eo_sao_params;
139 
140 #ifdef ENABLE_NEON
141 FT_CALC_HAD_SATD_8BIT ihevce_HAD_4x4_8bit_neon;
142 FT_CALC_HAD_SATD_8BIT ihevce_HAD_8x8_8bit_neon;
143 FT_CALC_HAD_SATD_8BIT ihevce_chroma_compute_AC_HAD_4x4_8bit_neon;
144 FT_CALC_HAD_SATD_8BIT ihevce_compute_ac_had_8x8_8bit_neon;
145 FT_CALC_HAD_SATD_8BIT ihevce_HAD_16x16_8bit_neon;
146 FT_CALC_HAD_SATD_8BIT ihevce_chroma_HAD_4x4_8bit_neon;
147 FT_CALC_HAD_SATD_8BIT ihevce_chroma_HAD_8x8_8bit_neon;
148 FT_CALC_HAD_SATD_8BIT ihevce_chroma_HAD_16x16_8bit_neon;
149 FT_CALC_HAD_SATD_8BIT ihevce_HAD_32x32_8bit_neon;
150 FT_SSD_CALCULATOR ihevce_ssd_calculator_neon;
151 FT_SSD_CALCULATOR ihevce_chroma_interleave_ssd_calculator_neon;
152 FT_SSD_AND_SAD_CALCULATOR ihevce_ssd_and_sad_calculator_neon;
153 FT_2D_SQUARE_COPY ihevce_2d_square_copy_luma_neon;
154 FT_CHROMA_INTERLEAVE_2D_COPY ihevce_chroma_interleave_2d_copy_neon;
155 FT_COPY_2D ihevce_copy_2d_neon;
156 FT_GET_EO_SAO_PARAMS ihevce_get_luma_eo_sao_params_neon;
157 FT_ITRANS_RECON_DC ihevce_itrans_recon_dc_neon;
158 FT_GET_EO_SAO_PARAMS ihevce_get_chroma_eo_sao_params_neon;
159 FT_SCAN_COEFFS ihevce_scan_coeffs_neon;
160 FT_WT_AVG_2D ihevce_wt_avg_2d_neon;
161 #endif
162 
163 #endif
164