1 /* 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 12 /**************************************************************************** 13 * 14 * Module Title : system_dependent.c 15 * 16 * Description : Miscellaneous system dependent functions 17 * 18 ****************************************************************************/ 19 20 /**************************************************************************** 21 * Header Files 22 ****************************************************************************/ 23 #include "vpx_scale/vpxscale.h" 24 #include "cpuidlib.h" 25 26 /**************************************************************************** 27 * Imports 28 *****************************************************************************/ 29 extern void register_generic_scalers(void); 30 extern void register_mmxscalers(void); 31 32 /**************************************************************************** 33 * 34 * ROUTINE : post_proc_machine_specific_config 35 * 36 * INPUTS : UINT32 Version : Codec version number. 37 * 38 * OUTPUTS : None. 39 * 40 * RETURNS : void 41 * 42 * FUNCTION : Checks for machine specifc features such as MMX support 43 * sets appropriate flags and function pointers. 44 * 45 * SPECIAL NOTES : None. 46 * 47 ****************************************************************************/ 48 void 49 vp8_scale_machine_specific_config(void) 50 { 51 // If MMX supported then set to use MMX versions of functions else 52 // use original 'C' versions. 53 int mmx_enabled; 54 int xmm_enabled; 55 int wmt_enabled; 56 57 vpx_get_processor_flags(&mmx_enabled, &xmm_enabled, &wmt_enabled); 58 59 if (mmx_enabled || xmm_enabled || wmt_enabled) 60 { 61 register_mmxscalers(); 62 } 63 else 64 { 65 vp8_horizontal_line_1_2_scale = vp8cx_horizontal_line_1_2_scale_c; 66 vp8_vertical_band_1_2_scale = vp8cx_vertical_band_1_2_scale_c; 67 vp8_last_vertical_band_1_2_scale = vp8cx_last_vertical_band_1_2_scale_c; 68 vp8_horizontal_line_3_5_scale = vp8cx_horizontal_line_3_5_scale_c; 69 vp8_vertical_band_3_5_scale = vp8cx_vertical_band_3_5_scale_c; 70 vp8_last_vertical_band_3_5_scale = vp8cx_last_vertical_band_3_5_scale_c; 71 vp8_horizontal_line_3_4_scale = vp8cx_horizontal_line_3_4_scale_c; 72 vp8_vertical_band_3_4_scale = vp8cx_vertical_band_3_4_scale_c; 73 vp8_last_vertical_band_3_4_scale = vp8cx_last_vertical_band_3_4_scale_c; 74 vp8_horizontal_line_2_3_scale = vp8cx_horizontal_line_2_3_scale_c; 75 vp8_vertical_band_2_3_scale = vp8cx_vertical_band_2_3_scale_c; 76 vp8_last_vertical_band_2_3_scale = vp8cx_last_vertical_band_2_3_scale_c; 77 vp8_horizontal_line_4_5_scale = vp8cx_horizontal_line_4_5_scale_c; 78 vp8_vertical_band_4_5_scale = vp8cx_vertical_band_4_5_scale_c; 79 vp8_last_vertical_band_4_5_scale = vp8cx_last_vertical_band_4_5_scale_c; 80 81 82 vp8_vertical_band_5_4_scale = vp8cx_vertical_band_5_4_scale_c; 83 vp8_vertical_band_5_3_scale = vp8cx_vertical_band_5_3_scale_c; 84 vp8_vertical_band_2_1_scale = vp8cx_vertical_band_2_1_scale_c; 85 vp8_vertical_band_2_1_scale_i = vp8cx_vertical_band_2_1_scale_i_c; 86 vp8_horizontal_line_2_1_scale = vp8cx_horizontal_line_2_1_scale_c; 87 vp8_horizontal_line_5_3_scale = vp8cx_horizontal_line_5_3_scale_c; 88 vp8_horizontal_line_5_4_scale = vp8cx_horizontal_line_5_4_scale_c; 89 90 } 91 } 92