1 /******************************************************************************
2 *
3 * Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore
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 
19 /**
20  *******************************************************************************
21  * @file
22  *  ihevcd_function_selector.h
23  *
24  * @brief
25  *  Structure definitions used in the decoder
26  *
27  * @author
28  *  Harish
29  *
30  * @par List of Functions:
31  *
32  * @remarks
33  *  None
34  *
35  *******************************************************************************
36  */
37 
38 #ifndef _IHEVCD_FUNCTION_SELECTOR_H_
39 #define _IHEVCD_FUNCTION_SELECTOR_H_
40 
41 #include "ihevc_deblk.h"
42 #include "ihevc_itrans.h"
43 #include "ihevc_itrans_recon.h"
44 #include "ihevc_chroma_itrans_recon.h"
45 #include "ihevc_chroma_intra_pred.h"
46 #include "ihevc_recon.h"
47 #include "ihevc_chroma_recon.h"
48 #include "ihevc_intra_pred.h"
49 #include "ihevc_inter_pred.h"
50 #include "ihevc_mem_fns.h"
51 #include "ihevc_padding.h"
52 #include "ihevc_weighted_pred.h"
53 #include "ihevc_sao.h"
54 #include "ihevcd_fmt_conv.h"
55 #include "ihevcd_itrans_recon_dc.h"
56 
57 #define D_ARCH_NA                   1
58 #define D_ARCH_ARM_NONEON           2
59 #define D_ARCH_ARM_A9Q              3
60 #define D_ARCH_ARM_A9A              4
61 #define D_ARCH_ARM_A9               5
62 #define D_ARCH_ARM_A7               6
63 #define D_ARCH_ARM_A5               7
64 #define D_ARCH_ARM_A15              8
65 #define D_ARCH_ARM_NEONINTR         9
66 #define D_ARCH_ARMV8_GENERIC        10
67 #define D_ARCH_X86_GENERIC          11
68 #define D_ARCH_X86_SSSE3            12
69 #define D_ARCH_X86_SSE42            13
70 #define D_ARCH_X86_AVX2             14
71 #define D_ARCH_MIPS_GENERIC         15
72 #define D_ARCH_MIPS_32              16
73 
74 void ihevcd_init_arch(void *pv_codec);
75 
76 void ihevcd_init_function_ptr(void *pv_codec);
77 
78 void ihevcd_init_function_ptr_generic(void *pv_codec);
79 void ihevcd_init_function_ptr_ssse3(void *pv_codec);
80 void ihevcd_init_function_ptr_sse42(void *pv_codec);
81 
82 #ifndef DISABLE_AVX2
83 void ihevcd_init_function_ptr_avx2(void *pv_codec);
84 #endif
85 
86 typedef struct
87 {
88     ihevc_deblk_chroma_horz_ft *ihevc_deblk_chroma_horz_fptr;
89     ihevc_deblk_chroma_vert_ft *ihevc_deblk_chroma_vert_fptr;
90     ihevc_deblk_luma_vert_ft *ihevc_deblk_luma_vert_fptr;
91     ihevc_deblk_luma_horz_ft *ihevc_deblk_luma_horz_fptr;
92 
93     ihevc_inter_pred_ft *ihevc_inter_pred_chroma_copy_fptr;
94     ihevc_inter_pred_w16out_ft *ihevc_inter_pred_chroma_copy_w16out_fptr;
95     ihevc_inter_pred_ft *ihevc_inter_pred_chroma_horz_fptr;
96     ihevc_inter_pred_w16out_ft *ihevc_inter_pred_chroma_horz_w16out_fptr;
97     ihevc_inter_pred_ft *ihevc_inter_pred_chroma_vert_fptr;
98     ihevc_inter_pred_w16inp_ft *ihevc_inter_pred_chroma_vert_w16inp_fptr;
99     ihevc_inter_pred_w16inp_w16out_ft *ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr;
100     ihevc_inter_pred_w16out_ft *ihevc_inter_pred_chroma_vert_w16out_fptr;
101     ihevc_inter_pred_ft *ihevc_inter_pred_luma_horz_fptr;
102     ihevc_inter_pred_ft *ihevc_inter_pred_luma_vert_fptr;
103     ihevc_inter_pred_w16out_ft *ihevc_inter_pred_luma_vert_w16out_fptr;
104     ihevc_inter_pred_w16inp_ft *ihevc_inter_pred_luma_vert_w16inp_fptr;
105     ihevc_inter_pred_ft *ihevc_inter_pred_luma_copy_fptr;
106     ihevc_inter_pred_w16out_ft *ihevc_inter_pred_luma_copy_w16out_fptr;
107     ihevc_inter_pred_w16out_ft *ihevc_inter_pred_luma_horz_w16out_fptr;
108     ihevc_inter_pred_w16inp_w16out_ft *ihevc_inter_pred_luma_vert_w16inp_w16out_fptr;
109 
110     ihevc_intra_pred_chroma_ref_substitution_ft *ihevc_intra_pred_chroma_ref_substitution_fptr;
111     ihevc_intra_pred_luma_ref_substitution_ft *ihevc_intra_pred_luma_ref_substitution_fptr;
112     ihevc_intra_pred_luma_ref_subst_all_avlble_ft *ihevc_intra_pred_luma_ref_subst_all_avlble_fptr;
113     ihevc_intra_pred_ref_filtering_ft *ihevc_intra_pred_ref_filtering_fptr;
114     ihevc_intra_pred_chroma_dc_ft *ihevc_intra_pred_chroma_dc_fptr;
115     ihevc_intra_pred_chroma_horz_ft *ihevc_intra_pred_chroma_horz_fptr;
116     ihevc_intra_pred_chroma_mode2_ft *ihevc_intra_pred_chroma_mode2_fptr;
117     ihevc_intra_pred_chroma_mode_18_34_ft *ihevc_intra_pred_chroma_mode_18_34_fptr;
118     ihevc_intra_pred_chroma_mode_27_to_33_ft *ihevc_intra_pred_chroma_mode_27_to_33_fptr;
119     ihevc_intra_pred_chroma_mode_3_to_9_ft *ihevc_intra_pred_chroma_mode_3_to_9_fptr;
120     ihevc_intra_pred_chroma_planar_ft *ihevc_intra_pred_chroma_planar_fptr;
121     ihevc_intra_pred_chroma_ver_ft *ihevc_intra_pred_chroma_ver_fptr;
122     ihevc_intra_pred_chroma_mode_11_to_17_ft *ihevc_intra_pred_chroma_mode_11_to_17_fptr;
123     ihevc_intra_pred_chroma_mode_19_to_25_ft *ihevc_intra_pred_chroma_mode_19_to_25_fptr;
124     ihevc_intra_pred_luma_mode_11_to_17_ft *ihevc_intra_pred_luma_mode_11_to_17_fptr;
125     ihevc_intra_pred_luma_mode_19_to_25_ft *ihevc_intra_pred_luma_mode_19_to_25_fptr;
126     ihevc_intra_pred_luma_dc_ft *ihevc_intra_pred_luma_dc_fptr;
127     ihevc_intra_pred_luma_horz_ft *ihevc_intra_pred_luma_horz_fptr;
128     ihevc_intra_pred_luma_mode2_ft *ihevc_intra_pred_luma_mode2_fptr;
129     ihevc_intra_pred_luma_mode_18_34_ft *ihevc_intra_pred_luma_mode_18_34_fptr;
130     ihevc_intra_pred_luma_mode_27_to_33_ft *ihevc_intra_pred_luma_mode_27_to_33_fptr;
131     ihevc_intra_pred_luma_mode_3_to_9_ft *ihevc_intra_pred_luma_mode_3_to_9_fptr;
132     ihevc_intra_pred_luma_planar_ft *ihevc_intra_pred_luma_planar_fptr;
133     ihevc_intra_pred_luma_ver_ft *ihevc_intra_pred_luma_ver_fptr;
134     ihevc_itrans_4x4_ttype1_ft *ihevc_itrans_4x4_ttype1_fptr;
135     ihevc_itrans_4x4_ft *ihevc_itrans_4x4_fptr;
136     ihevc_itrans_8x8_ft *ihevc_itrans_8x8_fptr;
137     ihevc_itrans_16x16_ft *ihevc_itrans_16x16_fptr;
138     ihevc_itrans_32x32_ft *ihevc_itrans_32x32_fptr;
139     ihevc_itrans_recon_4x4_ttype1_ft *ihevc_itrans_recon_4x4_ttype1_fptr;
140     ihevc_itrans_recon_4x4_ft *ihevc_itrans_recon_4x4_fptr;
141     ihevc_itrans_recon_8x8_ft *ihevc_itrans_recon_8x8_fptr;
142     ihevc_itrans_recon_16x16_ft *ihevc_itrans_recon_16x16_fptr;
143     ihevc_itrans_recon_32x32_ft *ihevc_itrans_recon_32x32_fptr;
144     ihevc_chroma_itrans_recon_4x4_ft *ihevc_chroma_itrans_recon_4x4_fptr;
145     ihevc_chroma_itrans_recon_8x8_ft *ihevc_chroma_itrans_recon_8x8_fptr;
146     ihevc_chroma_itrans_recon_16x16_ft *ihevc_chroma_itrans_recon_16x16_fptr;
147     ihevc_recon_4x4_ttype1_ft *ihevc_recon_4x4_ttype1_fptr;
148     ihevc_recon_4x4_ft *ihevc_recon_4x4_fptr;
149     ihevc_recon_8x8_ft *ihevc_recon_8x8_fptr;
150     ihevc_recon_16x16_ft *ihevc_recon_16x16_fptr;
151     ihevc_recon_32x32_ft *ihevc_recon_32x32_fptr;
152     ihevc_chroma_recon_4x4_ft *ihevc_chroma_recon_4x4_fptr;
153     ihevc_chroma_recon_8x8_ft *ihevc_chroma_recon_8x8_fptr;
154     ihevc_chroma_recon_16x16_ft *ihevc_chroma_recon_16x16_fptr;
155     ihevc_memcpy_mul_8_ft *ihevc_memcpy_mul_8_fptr;
156     ihevc_memcpy_ft *ihevc_memcpy_fptr;
157     ihevc_memset_mul_8_ft *ihevc_memset_mul_8_fptr;
158     ihevc_memset_ft *ihevc_memset_fptr;
159     ihevc_memset_16bit_mul_8_ft *ihevc_memset_16bit_mul_8_fptr;
160     ihevc_memset_16bit_ft *ihevc_memset_16bit_fptr;
161     ihevc_pad_left_luma_ft *ihevc_pad_left_luma_fptr;
162     ihevc_pad_left_chroma_ft *ihevc_pad_left_chroma_fptr;
163     ihevc_pad_right_luma_ft *ihevc_pad_right_luma_fptr;
164     ihevc_pad_right_chroma_ft *ihevc_pad_right_chroma_fptr;
165     ihevc_weighted_pred_bi_ft *ihevc_weighted_pred_bi_fptr;
166     ihevc_weighted_pred_bi_default_ft *ihevc_weighted_pred_bi_default_fptr;
167     ihevc_weighted_pred_uni_ft *ihevc_weighted_pred_uni_fptr;
168     ihevc_weighted_pred_chroma_bi_ft *ihevc_weighted_pred_chroma_bi_fptr;
169     ihevc_weighted_pred_chroma_bi_default_ft *ihevc_weighted_pred_chroma_bi_default_fptr;
170     ihevc_weighted_pred_chroma_uni_ft *ihevc_weighted_pred_chroma_uni_fptr;
171     ihevc_sao_band_offset_luma_ft *ihevc_sao_band_offset_luma_fptr;
172     ihevc_sao_band_offset_chroma_ft *ihevc_sao_band_offset_chroma_fptr;
173     ihevc_sao_edge_offset_class0_ft *ihevc_sao_edge_offset_class0_fptr;
174     ihevc_sao_edge_offset_class0_chroma_ft *ihevc_sao_edge_offset_class0_chroma_fptr;
175     ihevc_sao_edge_offset_class1_ft *ihevc_sao_edge_offset_class1_fptr;
176     ihevc_sao_edge_offset_class1_chroma_ft *ihevc_sao_edge_offset_class1_chroma_fptr;
177     ihevc_sao_edge_offset_class2_ft *ihevc_sao_edge_offset_class2_fptr;
178     ihevc_sao_edge_offset_class2_chroma_ft *ihevc_sao_edge_offset_class2_chroma_fptr;
179     ihevc_sao_edge_offset_class3_ft *ihevc_sao_edge_offset_class3_fptr;
180     ihevc_sao_edge_offset_class3_chroma_ft *ihevc_sao_edge_offset_class3_chroma_fptr;
181     ihevcd_fmt_conv_420sp_to_rgba8888_ft *ihevcd_fmt_conv_420sp_to_rgba8888_fptr;
182     ihevcd_fmt_conv_420sp_to_rgb565_ft *ihevcd_fmt_conv_420sp_to_rgb565_fptr;
183     ihevcd_fmt_conv_420sp_to_420sp_ft *ihevcd_fmt_conv_420sp_to_420sp_fptr;
184     ihevcd_fmt_conv_420sp_to_420p_ft *ihevcd_fmt_conv_420sp_to_420p_fptr;
185     ihevcd_itrans_recon_dc_luma_ft *ihevcd_itrans_recon_dc_luma_fptr;
186     ihevcd_itrans_recon_dc_chroma_ft *ihevcd_itrans_recon_dc_chroma_fptr;
187 }func_selector_t;
188 
189 #endif /* _IHEVCD_FUNCTION_SELECTOR_H_ */
190