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