ih264e_function_selector.c revision 8d3d303c7942ced6a987a52db8977d768dc3605f
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_structs.h" 62#include "ih264_defs.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 72#include "ih264_macros.h" 73#include "ih264_platform_macros.h" 74#include "ih264e_defs.h" 75#include "irc_cntrl_param.h" 76#include "irc_frame_info_collector.h" 77#include "ih264e_rate_control.h" 78#include "ih264e_structs.h" 79#include "ih264e_platform_macros.h" 80 81/** 82******************************************************************************* 83* 84* @brief Initialize the intra/inter/transform/deblk function pointers of 85* codec context 86* 87* @par Description: the current routine initializes the function pointers of 88* codec context basing on the architecture in use 89* 90* @param[in] ps_codec 91* Codec context pointer 92* 93* @returns none 94* 95* @remarks none 96* 97******************************************************************************* 98*/ 99void ih264e_init_function_ptr(void *pv_codec) 100{ 101 codec_t *ps_codec = (codec_t *)pv_codec; 102 ih264e_init_function_ptr_generic(ps_codec); 103 switch(ps_codec->s_cfg.e_arch) 104 { 105 case ARCH_X86_GENERIC: 106 ih264e_init_function_ptr_generic(ps_codec); 107 break; 108 case ARCH_X86_SSSE3: 109 ih264e_init_function_ptr_ssse3(ps_codec); 110 break; 111 case ARCH_X86_SSE42: 112 default: 113 ih264e_init_function_ptr_ssse3(ps_codec); 114 ih264e_init_function_ptr_sse42(ps_codec); 115 break; 116 } 117} 118 119/** 120******************************************************************************* 121* 122* @brief Determine the architecture of the encoder executing environment 123* 124* @par Description: This routine returns the architecture of the enviro- 125* ment in which the current encoder is being tested 126* 127* @param[in] void 128* 129* @returns IV_ARCH_T 130* architecture 131* 132* @remarks none 133* 134******************************************************************************* 135*/ 136IV_ARCH_T ih264e_default_arch(void) 137{ 138 return ARCH_X86_SSE42; 139} 140 141 142