• 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 "ihevce_defs.h"
44 
45 /*****************************************************************************/
46 /* Typedefs                                                                  */
47 /*****************************************************************************/
48 typedef UWORD32 FT_CALC_HAD_SATD_8BIT(UWORD8 *, WORD32, UWORD8 *, WORD32, WORD16 *, WORD32);
49 
50 typedef LWORD64 FT_SSD_CALCULATOR(UWORD8 *, UWORD8 *, UWORD32, UWORD32, UWORD32, UWORD32);
51 
52 typedef LWORD64 FT_SSD_AND_SAD_CALCULATOR(UWORD8 *, WORD32, UWORD8 *, WORD32, WORD32, UWORD32 *);
53 
54 typedef void FT_CHROMA_INTERLEAVE_2D_COPY(
55     UWORD8 *, WORD32, UWORD8 *, WORD32, WORD32, WORD32, CHROMA_PLANE_ID_T);
56 
57 typedef void FT_COPY_2D(UWORD8 *, WORD32, UWORD8 *, WORD32, WORD32, WORD32);
58 
59 typedef void FT_2D_SQUARE_COPY(void *, WORD32, void *, WORD32, WORD32, WORD32);
60 
61 typedef void FT_WT_AVG_2D(
62     UWORD8 *,
63     UWORD8 *,
64     WORD32,
65     WORD32,
66     WORD32,
67     WORD32,
68     UWORD8 *,
69     WORD32,
70     WORD32,
71     WORD32,
72     WORD32,
73     WORD32,
74     WORD32);
75 
76 typedef void
77     FT_ITRANS_RECON_DC(UWORD8 *, WORD32, UWORD8 *, WORD32, WORD32, WORD16, CHROMA_PLANE_ID_T);
78 
79 typedef WORD32 FT_SCAN_COEFFS(WORD16 *, WORD32 *, WORD32, WORD32, UWORD8 *, UWORD8 *, WORD32);
80 
81 typedef void FT_GET_EO_SAO_PARAMS(void *, WORD32, WORD32 *, WORD32 *);
82 
83 /*****************************************************************************/
84 /* Structure                                                                 */
85 /*****************************************************************************/
86 typedef struct
87 {
88     FT_CALC_HAD_SATD_8BIT *pf_HAD_4x4_8bit;
89     FT_CALC_HAD_SATD_8BIT *pf_HAD_8x8_8bit;
90     FT_CALC_HAD_SATD_8BIT *pf_HAD_16x16_8bit;
91     FT_CALC_HAD_SATD_8BIT *pf_HAD_32x32_8bit;
92     FT_CALC_HAD_SATD_8BIT *pf_AC_HAD_8x8_8bit;
93     FT_CALC_HAD_SATD_8BIT *pf_chroma_HAD_4x4_8bit;
94     FT_CALC_HAD_SATD_8BIT *pf_chroma_AC_HAD_4x4_8bit;
95     FT_CALC_HAD_SATD_8BIT *pf_chroma_HAD_8x8_8bit;
96     FT_CALC_HAD_SATD_8BIT *pf_chroma_HAD_16x16_8bit;
97     FT_SSD_CALCULATOR *pf_ssd_calculator;
98     FT_SSD_CALCULATOR *pf_chroma_interleave_ssd_calculator;
99     FT_SSD_AND_SAD_CALCULATOR *pf_ssd_and_sad_calculator;
100     FT_CHROMA_INTERLEAVE_2D_COPY *pf_chroma_interleave_2d_copy;
101     FT_COPY_2D *pf_copy_2d;
102     FT_2D_SQUARE_COPY *pf_2d_square_copy;
103     FT_WT_AVG_2D *pf_wt_avg_2d;
104     FT_ITRANS_RECON_DC *pf_itrans_recon_dc;
105     FT_SCAN_COEFFS *pf_scan_coeffs;
106     FT_GET_EO_SAO_PARAMS *pf_get_luma_eo_sao_params;
107     FT_GET_EO_SAO_PARAMS *pf_get_chroma_eo_sao_params;
108 } ihevce_cmn_opt_func_t;
109 
110 /*****************************************************************************/
111 /* Extern Function Declarations                                              */
112 /*****************************************************************************/
113 void ihevce_cmn_utils_instr_set_router(
114     ihevce_cmn_opt_func_t *ps_func_list, UWORD8 u1_is_popcnt_available, IV_ARCH_T e_arch);
115 
116 /* Function List - C */
117 FT_CALC_HAD_SATD_8BIT ihevce_HAD_4x4_8bit;
118 FT_CALC_HAD_SATD_8BIT ihevce_HAD_8x8_8bit;
119 FT_CALC_HAD_SATD_8BIT ihevce_HAD_16x16_8bit;
120 FT_CALC_HAD_SATD_8BIT ihevce_HAD_32x32_8bit;
121 FT_CALC_HAD_SATD_8BIT ihevce_compute_ac_had_8x8_8bit;
122 FT_CALC_HAD_SATD_8BIT ihevce_chroma_HAD_4x4_8bit;
123 FT_CALC_HAD_SATD_8BIT ihevce_chroma_compute_AC_HAD_4x4_8bit;
124 FT_CALC_HAD_SATD_8BIT ihevce_chroma_HAD_8x8_8bit;
125 FT_CALC_HAD_SATD_8BIT ihevce_chroma_HAD_16x16_8bit;
126 FT_SSD_CALCULATOR ihevce_ssd_calculator;
127 FT_SSD_CALCULATOR ihevce_chroma_interleave_ssd_calculator;
128 FT_SSD_AND_SAD_CALCULATOR ihevce_ssd_and_sad_calculator;
129 FT_CHROMA_INTERLEAVE_2D_COPY ihevce_chroma_interleave_2d_copy;
130 FT_COPY_2D ihevce_copy_2d;
131 FT_2D_SQUARE_COPY ihevce_2d_square_copy_luma;
132 FT_WT_AVG_2D ihevce_wt_avg_2d;
133 FT_ITRANS_RECON_DC ihevce_itrans_recon_dc;
134 FT_SCAN_COEFFS ihevce_scan_coeffs;
135 FT_GET_EO_SAO_PARAMS ihevce_get_luma_eo_sao_params;
136 FT_GET_EO_SAO_PARAMS ihevce_get_chroma_eo_sao_params;
137 
138 #ifdef ENABLE_NEON
139 FT_CALC_HAD_SATD_8BIT ihevce_HAD_4x4_8bit_neon;
140 FT_CALC_HAD_SATD_8BIT ihevce_HAD_8x8_8bit_neon;
141 FT_CALC_HAD_SATD_8BIT ihevce_chroma_compute_AC_HAD_4x4_8bit_neon;
142 FT_CALC_HAD_SATD_8BIT ihevce_compute_ac_had_8x8_8bit_neon;
143 FT_CALC_HAD_SATD_8BIT ihevce_HAD_16x16_8bit_neon;
144 FT_CALC_HAD_SATD_8BIT ihevce_chroma_HAD_4x4_8bit_neon;
145 FT_CALC_HAD_SATD_8BIT ihevce_chroma_HAD_8x8_8bit_neon;
146 FT_CALC_HAD_SATD_8BIT ihevce_chroma_HAD_16x16_8bit_neon;
147 FT_CALC_HAD_SATD_8BIT ihevce_HAD_32x32_8bit_neon;
148 FT_SSD_CALCULATOR ihevce_ssd_calculator_neon;
149 FT_SSD_CALCULATOR ihevce_chroma_interleave_ssd_calculator_neon;
150 FT_SSD_AND_SAD_CALCULATOR ihevce_ssd_and_sad_calculator_neon;
151 FT_2D_SQUARE_COPY ihevce_2d_square_copy_luma_neon;
152 FT_CHROMA_INTERLEAVE_2D_COPY ihevce_chroma_interleave_2d_copy_neon;
153 FT_COPY_2D ihevce_copy_2d_neon;
154 FT_GET_EO_SAO_PARAMS ihevce_get_luma_eo_sao_params_neon;
155 FT_ITRANS_RECON_DC ihevce_itrans_recon_dc_neon;
156 FT_GET_EO_SAO_PARAMS ihevce_get_chroma_eo_sao_params_neon;
157 FT_SCAN_COEFFS ihevce_scan_coeffs_neon;
158 FT_WT_AVG_2D ihevce_wt_avg_2d_neon;
159 #endif
160 
161 #endif
162