/src/libavc/encoder/x86/ih264e_function_selector.c
Line | Count | Source (jump to first uncovered line) |
1 | | /****************************************************************************** |
2 | | * |
3 | | * Copyright (C) 2015 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 | | ******************************************************************************* |
23 | | * @file |
24 | | * ih264e_function_selector.c |
25 | | * |
26 | | * @brief |
27 | | * Contains functions to initialize function pointers used in h264 |
28 | | * |
29 | | * @author |
30 | | * ittiam |
31 | | * |
32 | | * @par List of Functions: |
33 | | * - ih264e_init_function_ptr |
34 | | * - ih264e_default_arch |
35 | | * |
36 | | * @remarks |
37 | | * none |
38 | | * |
39 | | ******************************************************************************* |
40 | | */ |
41 | | |
42 | | /*****************************************************************************/ |
43 | | /* File Includes */ |
44 | | /*****************************************************************************/ |
45 | | |
46 | | /* System Include Files */ |
47 | | #include <stdio.h> |
48 | | #include <stddef.h> |
49 | | #include <stdlib.h> |
50 | | #include <string.h> |
51 | | |
52 | | /* User Include Files */ |
53 | | #include "ih264_typedefs.h" |
54 | | #include "iv2.h" |
55 | | #include "ive2.h" |
56 | | |
57 | | #include "ih264_macros.h" |
58 | | #include "ih264_error.h" |
59 | | #include "ih264_defs.h" |
60 | | #include "ih264_mem_fns.h" |
61 | | #include "ih264_padding.h" |
62 | | #include "ih264_structs.h" |
63 | | #include "ih264_size_defs.h" |
64 | | #include "ih264_trans_quant_itrans_iquant.h" |
65 | | #include "ih264_inter_pred_filters.h" |
66 | | #include "ih264_intra_pred_filters.h" |
67 | | #include "ih264_deblk_edge_filters.h" |
68 | | #include "ih264_cabac_tables.h" |
69 | | #include "ih264_platform_macros.h" |
70 | | |
71 | | #include "ime_defs.h" |
72 | | #include "ime_distortion_metrics.h" |
73 | | #include "ime_structs.h" |
74 | | |
75 | | #include "irc_cntrl_param.h" |
76 | | #include "irc_frame_info_collector.h" |
77 | | |
78 | | #include "ih264e_error.h" |
79 | | #include "ih264e_defs.h" |
80 | | #include "ih264e_rate_control.h" |
81 | | #include "ih264e_bitstream.h" |
82 | | #include "ih264e_cabac_structs.h" |
83 | | #include "ih264e_structs.h" |
84 | | #include "ih264e_cabac.h" |
85 | | #include "ih264e_platform_macros.h" |
86 | | |
87 | | |
88 | | /*****************************************************************************/ |
89 | | /* Function Definitions */ |
90 | | /*****************************************************************************/ |
91 | | |
92 | | /** |
93 | | ******************************************************************************* |
94 | | * |
95 | | * @brief Initialize the intra/inter/transform/deblk/entropy function pointers |
96 | | * |
97 | | * @par Description: the current routine initializes the function pointers of |
98 | | * codec context basing on the architecture in use |
99 | | * |
100 | | * @param[in] ps_codec |
101 | | * Codec context pointer |
102 | | * |
103 | | * @returns none |
104 | | * |
105 | | * @remarks none |
106 | | * |
107 | | ******************************************************************************* |
108 | | */ |
109 | | void ih264e_init_function_ptr(void *pv_codec) |
110 | 4.22k | { |
111 | 4.22k | codec_t *ps_codec = (codec_t *)pv_codec; |
112 | | |
113 | 4.22k | ih264e_init_function_ptr_generic(ps_codec); |
114 | 4.22k | switch(ps_codec->s_cfg.e_arch) |
115 | 4.22k | { |
116 | 0 | case ARCH_X86_GENERIC: |
117 | 0 | ih264e_init_function_ptr_generic(ps_codec); |
118 | 0 | break; |
119 | 0 | case ARCH_X86_SSSE3: |
120 | 0 | ih264e_init_function_ptr_ssse3(ps_codec); |
121 | 0 | break; |
122 | 0 | case ARCH_X86_SSE42: |
123 | 4.22k | default: |
124 | 4.22k | ih264e_init_function_ptr_ssse3(ps_codec); |
125 | 4.22k | ih264e_init_function_ptr_sse42(ps_codec); |
126 | 4.22k | break; |
127 | 4.22k | } |
128 | 4.22k | } |
129 | | |
130 | | /** |
131 | | ******************************************************************************* |
132 | | * |
133 | | * @brief Determine the architecture of the encoder executing environment |
134 | | * |
135 | | * @par Description: This routine returns the architecture of the enviro- |
136 | | * ment in which the current encoder is being tested |
137 | | * |
138 | | * @param[in] void |
139 | | * |
140 | | * @returns IV_ARCH_T |
141 | | * architecture |
142 | | * |
143 | | * @remarks none |
144 | | * |
145 | | ******************************************************************************* |
146 | | */ |
147 | | IV_ARCH_T ih264e_default_arch(void) |
148 | 8.45k | { |
149 | 8.45k | return ARCH_X86_SSE42; |
150 | 8.45k | } |
151 | | |