Coverage Report

Created: 2026-08-31 06:32

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libhevc/encoder/ihevce_function_selector.c
Line
Count
Source
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
23
*  ihevce_function_selector.c
24
*
25
* @brief
26
*  Contains functions to initialize function pointers used in hevc
27
*
28
* @author
29
*  ittiam
30
*
31
* @par List of Functions:
32
*  ihevce_default_arch()
33
*  ihevce_init_function_ptr_generic()
34
*  ihevce_init_function_ptr_av8()
35
*  ihevce_init_function_ptr_a9q()
36
*  ihevce_init_function_ptr()
37
*
38
* @remarks
39
*  None
40
*
41
*******************************************************************************
42
*/
43
44
/*****************************************************************************/
45
/* File Includes                                                             */
46
/*****************************************************************************/
47
/* System include files */
48
#include <stdio.h>
49
#include <string.h>
50
#include <stddef.h>
51
#include <stdlib.h>
52
#include <assert.h>
53
54
/* User include files */
55
#include "ihevc_typedefs.h"
56
#include "itt_video_api.h"
57
#include "ihevce_api.h"
58
59
#include "rc_cntrl_param.h"
60
#include "rc_frame_info_collector.h"
61
#include "rc_look_ahead_params.h"
62
63
#include "ihevc_defs.h"
64
#include "ihevc_structs.h"
65
#include "ihevc_platform_macros.h"
66
#include "ihevc_deblk.h"
67
#include "ihevc_itrans_recon.h"
68
#include "ihevc_chroma_itrans_recon.h"
69
#include "ihevc_chroma_intra_pred.h"
70
#include "ihevc_intra_pred.h"
71
#include "ihevc_inter_pred.h"
72
#include "ihevc_mem_fns.h"
73
#include "ihevc_padding.h"
74
#include "ihevc_weighted_pred.h"
75
#include "ihevc_sao.h"
76
#include "ihevc_resi_trans.h"
77
#include "ihevc_quant_iquant_ssd.h"
78
#include "ihevc_cabac_tables.h"
79
80
#include "ihevce_defs.h"
81
#include "ihevce_lap_enc_structs.h"
82
#include "ihevce_multi_thrd_structs.h"
83
#include "ihevce_multi_thrd_funcs.h"
84
#include "ihevce_me_common_defs.h"
85
#include "ihevce_had_satd.h"
86
#include "ihevce_error_codes.h"
87
#include "ihevce_bitstream.h"
88
#include "ihevce_cabac.h"
89
#include "ihevce_rdoq_macros.h"
90
#include "ihevce_function_selector.h"
91
#include "ihevce_enc_structs.h"
92
#include "ihevce_cmn_utils_instr_set_router.h"
93
94
/*****************************************************************************/
95
/* Function Definitions                                                      */
96
/*****************************************************************************/
97
98
/*!
99
******************************************************************************
100
* \if Function name : ihevce_default_arch \endif
101
*
102
* \brief
103
*    Get Default architecture
104
*
105
*****************************************************************************
106
*/
107
IV_ARCH_T ihevce_default_arch(void)
108
0
{
109
#if(defined(ENABLE_NEON) && defined(ARMV8))
110
    return ARCH_ARM_V8_NEON;
111
#elif(defined(ENABLE_NEON) && defined(ARM))
112
    return ARCH_ARM_A9Q;
113
#else
114
0
    return ARCH_ARM_NONEON;
115
0
#endif
116
0
}
117
118
// clang-format off
119
/*!
120
******************************************************************************
121
* \if Function name : ihevce_init_function_ptr_generic \endif
122
*
123
* \brief
124
*    Function pointer initialization of encoder context struct
125
*
126
*****************************************************************************
127
*/
128
static void ihevce_init_function_ptr_generic(enc_ctxt_t *ps_enc_ctxt)
129
201
{
130
201
    ps_enc_ctxt->s_func_selector.ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz;
131
201
    ps_enc_ctxt->s_func_selector.ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert;
132
201
    ps_enc_ctxt->s_func_selector.ihevc_deblk_422chroma_horz_fptr = &ihevc_deblk_422chroma_horz;
133
201
    ps_enc_ctxt->s_func_selector.ihevc_deblk_422chroma_vert_fptr = &ihevc_deblk_422chroma_vert;
134
201
    ps_enc_ctxt->s_func_selector.ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert;
135
201
    ps_enc_ctxt->s_func_selector.ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz;
136
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy;
137
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out;
138
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz;
139
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out;
140
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert;
141
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp;
142
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out;
143
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out;
144
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz;
145
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert;
146
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out;
147
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp;
148
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy;
149
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out;
150
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out;
151
201
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out;
152
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution;
153
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution;
154
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering;
155
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc;
156
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz;
157
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2;
158
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34;
159
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33;
160
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9;
161
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar;
162
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver;
163
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17;
164
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25;
165
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17;
166
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25;
167
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc;
168
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz;
169
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2;
170
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34;
171
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33;
172
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9;
173
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar;
174
201
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver;
175
176
201
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1;
177
201
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4;
178
201
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8;
179
201
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16;
180
201
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32;
181
201
    ps_enc_ctxt->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4;
182
201
    ps_enc_ctxt->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8;
183
201
    ps_enc_ctxt->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16;
184
185
201
    ps_enc_ctxt->s_func_selector.ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8;
186
201
    ps_enc_ctxt->s_func_selector.ihevc_memset_16bit_fptr = &ihevc_memset_16bit;
187
188
201
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi;
189
201
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default;
190
201
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni;
191
201
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi;
192
201
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default;
193
201
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni;
194
195
201
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_4x4_ttype1_fptr = &ihevc_resi_trans_4x4_ttype1;
196
201
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_4x4_fptr = &ihevc_resi_trans_4x4;
197
201
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_8x8_fptr = &ihevc_resi_trans_8x8;
198
201
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_16x16_fptr = &ihevc_resi_trans_16x16;
199
201
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_32x32_fptr = &ihevc_resi_trans_32x32;
200
201
201
    ps_enc_ctxt->s_func_selector.ihevc_quant_iquant_ssd_fptr = &ihevc_quant_iquant_ssd;
202
201
    ps_enc_ctxt->s_func_selector.ihevc_quant_iquant_ssd_rdoq_fptr = &ihevc_quant_iquant_ssd_rdoq;
203
201
    ps_enc_ctxt->s_func_selector.ihevc_quant_iquant_ssd_flat_scale_mat_fptr = &ihevc_quant_iquant_ssd_flat_scale_mat;
204
201
    ps_enc_ctxt->s_func_selector.ihevc_quant_iquant_ssd_flat_scale_mat_rdoq_fptr = &ihevc_quant_iquant_ssd_flat_scale_mat_rdoq;
205
201
    ps_enc_ctxt->s_func_selector.ihevc_q_iq_ssd_var_rnd_fact_fptr = &ihevc_q_iq_ssd_var_rnd_fact;
206
201
    ps_enc_ctxt->s_func_selector.ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_fptr = &ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact;
207
208
201
    ps_enc_ctxt->s_func_selector.ihevc_quant_iquant_fptr = &ihevc_quant_iquant;
209
201
    ps_enc_ctxt->s_func_selector.ihevc_quant_iquant_rdoq_fptr = &ihevc_quant_iquant_rdoq;
210
201
    ps_enc_ctxt->s_func_selector.ihevc_quant_iquant_flat_scale_mat_fptr = &ihevc_quant_iquant_flat_scale_mat;
211
201
    ps_enc_ctxt->s_func_selector.ihevc_quant_iquant_flat_scale_mat_rdoq_fptr = &ihevc_quant_iquant_flat_scale_mat_rdoq;
212
201
    ps_enc_ctxt->s_func_selector.ihevc_q_iq_var_rnd_fact_fptr = &ihevc_q_iq_var_rnd_fact;
213
201
    ps_enc_ctxt->s_func_selector.ihevc_q_iq_flat_scale_mat_var_rnd_fact_fptr = &ihevc_q_iq_flat_scale_mat_var_rnd_fact;
214
201
    ps_enc_ctxt->s_func_selector.ihevc_pad_bottom_fptr = &ihevc_pad_bottom;
215
201
    ps_enc_ctxt->s_func_selector.ihevc_pad_horz_chroma_fptr = &ihevc_pad_horz_chroma;
216
201
    ps_enc_ctxt->s_func_selector.ihevc_pad_horz_luma_fptr = &ihevc_pad_horz_luma;
217
201
    ps_enc_ctxt->s_func_selector.ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma;
218
201
    ps_enc_ctxt->s_func_selector.ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma;
219
201
    ps_enc_ctxt->s_func_selector.ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma;
220
201
    ps_enc_ctxt->s_func_selector.ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma;
221
201
    ps_enc_ctxt->s_func_selector.ihevc_pad_top_fptr = &ihevc_pad_top;
222
201
    ps_enc_ctxt->s_func_selector.ihevc_pad_vert_fptr = &ihevc_pad_vert;
223
201
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0;
224
201
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1;
225
201
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2;
226
201
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3;
227
228
201
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma;
229
201
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma;
230
201
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma;
231
201
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma;
232
201
}
233
234
#ifdef ENABLE_NEON
235
#ifdef ARMV8
236
/*!
237
******************************************************************************
238
* \if Function name : ihevce_init_function_ptr_av8 \endif
239
*
240
* \brief
241
*    Function pointer initialization of encoder context struct
242
*
243
*****************************************************************************
244
*/
245
static void ihevce_init_function_ptr_av8(enc_ctxt_t *ps_enc_ctxt)
246
{
247
    ps_enc_ctxt->s_func_selector.ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz_av8;
248
    ps_enc_ctxt->s_func_selector.ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert_av8;
249
    ps_enc_ctxt->s_func_selector.ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert_av8;
250
    ps_enc_ctxt->s_func_selector.ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz_av8;
251
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy_av8;
252
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out_av8;
253
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz;
254
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out_av8;
255
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert;
256
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp_av8;
257
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out_av8;
258
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out_av8;
259
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz_av8;
260
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert_av8;
261
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out_av8;
262
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp_av8;
263
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy_av8;
264
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out_av8;
265
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out_av8;
266
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out_av8;
267
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution;
268
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution;
269
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering_neonintr;
270
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc_av8;
271
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz_av8;
272
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2_av8;
273
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34_av8;
274
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33_av8;
275
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9_av8;
276
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar_av8;
277
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver_av8;
278
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17_av8;
279
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25_av8;
280
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17_av8;
281
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25_av8;
282
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc_av8;
283
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz_av8;
284
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2_av8;
285
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34_av8;
286
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33_av8;
287
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9_av8;
288
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar_av8;
289
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver_av8;
290
291
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1_av8;
292
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4_av8;
293
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8_av8;
294
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16_av8;
295
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32;
296
297
    ps_enc_ctxt->s_func_selector.ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8_av8;
298
    ps_enc_ctxt->s_func_selector.ihevc_memset_16bit_fptr = &ihevc_memset_16bit_av8;
299
300
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi_av8;
301
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default_av8;
302
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni_av8;
303
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi_neonintr;
304
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default_neonintr;
305
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni_neonintr;
306
307
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_4x4_ttype1_fptr = &ihevc_resi_trans_4x4_ttype1_neon;
308
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_4x4_fptr = &ihevc_resi_trans_4x4_neon;
309
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_8x8_fptr = &ihevc_resi_trans_8x8_neon;
310
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_16x16_fptr = &ihevc_resi_trans_16x16_neon;
311
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_32x32_fptr = &ihevc_resi_trans_32x32_neon;
312
313
    ps_enc_ctxt->s_func_selector.ihevc_quant_iquant_ssd_flat_scale_mat_fptr = &ihevc_quant_iquant_ssd_flat_scale_mat_neon;
314
    ps_enc_ctxt->s_func_selector.ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_fptr = &ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_neon;
315
316
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0_av8;
317
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1_av8;
318
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2_av8;
319
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3_av8;
320
321
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma_av8;
322
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma_av8;
323
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma_av8;
324
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma_av8;
325
}
326
327
#else
328
329
/*!
330
******************************************************************************
331
* \if Function name : ihevce_init_function_ptr_a9q \endif
332
*
333
* \brief
334
*    Function pointer initialization of encoder context struct
335
*
336
*****************************************************************************
337
*/
338
static void ihevce_init_function_ptr_a9q(enc_ctxt_t *ps_enc_ctxt)
339
{
340
    ps_enc_ctxt->s_func_selector.ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz_a9q;
341
    ps_enc_ctxt->s_func_selector.ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert_a9q;
342
    ps_enc_ctxt->s_func_selector.ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert_a9q;
343
    ps_enc_ctxt->s_func_selector.ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz_a9q;
344
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy_a9q;
345
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out_a9q;
346
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz;
347
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out_a9q;
348
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert_a9q;
349
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp_a9q;
350
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out_a9q;
351
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out_a9q;
352
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz_a9q;
353
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert_a9q;
354
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out_a9q;
355
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp_a9q;
356
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy_a9q;
357
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out_a9q;
358
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out_a9q;
359
    ps_enc_ctxt->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out_a9q;
360
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution;
361
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution_a9q;
362
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering;
363
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc_a9q;
364
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz_a9q;
365
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2_a9q;
366
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34_a9q;
367
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33_a9q;
368
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9_a9q;
369
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar_a9q;
370
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver_a9q;
371
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17_a9q;
372
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25_a9q;
373
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17_a9q;
374
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25_a9q;
375
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc_a9q;
376
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz_a9q;
377
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2_a9q;
378
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34_a9q;
379
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33_a9q;
380
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9_a9q;
381
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar_a9q;
382
    ps_enc_ctxt->s_func_selector.ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver_a9q;
383
384
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1_a9q;
385
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4_a9q;
386
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8_a9q;
387
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16_a9q;
388
    ps_enc_ctxt->s_func_selector.ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32;
389
390
    ps_enc_ctxt->s_func_selector.ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8_a9q;
391
    ps_enc_ctxt->s_func_selector.ihevc_memset_16bit_fptr = &ihevc_memset_16bit_a9q;
392
393
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi_a9q;
394
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default_a9q;
395
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni_a9q;
396
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi;
397
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default;
398
    ps_enc_ctxt->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni;
399
400
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_4x4_ttype1_fptr = &ihevc_resi_trans_4x4_ttype1_a9q;
401
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_4x4_fptr = &ihevc_resi_trans_4x4_a9q;
402
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_8x8_fptr = &ihevc_resi_trans_8x8_a9q;
403
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_16x16_fptr = &ihevc_resi_trans_16x16_a9q;
404
    ps_enc_ctxt->s_func_selector.ihevc_resi_trans_32x32_fptr = &ihevc_resi_trans_32x32_a9q;
405
406
    ps_enc_ctxt->s_func_selector.ihevc_quant_iquant_ssd_flat_scale_mat_fptr = &ihevc_quant_iquant_ssd_flat_scale_mat_neon;
407
    ps_enc_ctxt->s_func_selector.ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_fptr = &ihevc_q_iq_ssd_flat_scale_mat_var_rnd_fact_neon;
408
409
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0_a9q;
410
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1_a9q;
411
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2_a9q;
412
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3_a9q;
413
414
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma_a9q;
415
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma_a9q;
416
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma_a9q;
417
    ps_enc_ctxt->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma_a9q;
418
}
419
#endif
420
#endif
421
// clang-format on
422
423
/*!
424
******************************************************************************
425
* \if Function name : ihevce_init_function_ptr \endif
426
*
427
* \brief
428
*    Function pointer initialization of encoder context struct
429
*
430
*****************************************************************************
431
*/
432
void ihevce_init_function_ptr(void *pv_enc_ctxt, IV_ARCH_T e_processor_arch)
433
201
{
434
201
    (void)e_processor_arch;
435
201
    ihevce_init_function_ptr_generic(pv_enc_ctxt);
436
#ifdef ENABLE_NEON
437
    switch(e_processor_arch)
438
    {
439
#ifdef ARMV8
440
    case ARCH_ARM_V8_NEON:
441
        ihevce_init_function_ptr_av8(pv_enc_ctxt);
442
        break;
443
#else
444
    case ARCH_ARM_A9Q:
445
        ihevce_init_function_ptr_a9q(pv_enc_ctxt);
446
        break;
447
#endif
448
    default:
449
        break;
450
    }
451
#endif
452
201
}