Path: blob/master/thirdparty/libtheora/x86/x86state.c
9898 views
/********************************************************************1* *2* THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *3* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *4* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *5* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *6* *7* THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 *8* by the Xiph.Org Foundation and contributors *9* https://www.xiph.org/ *10* *11********************************************************************1213function:1415********************************************************************/1617#include "x86int.h"1819#if defined(OC_X86_ASM)2021#if defined(OC_STATE_USE_VTABLE)22/*This table has been modified from OC_FZIG_ZAG by baking a 4x4 transpose into23each quadrant of the destination.*/24static const unsigned char OC_FZIG_ZAG_MMX[128]={250, 8, 1, 2, 9,16,24,17,2610, 3,32,11,18,25, 4,12,275,26,19,40,33,34,41,48,2827, 6,13,20,28,21,14, 7,2956,49,42,35,43,50,57,36,3015,22,29,30,23,44,37,58,3151,59,38,45,52,31,60,53,3246,39,47,54,61,62,55,63,3364,64,64,64,64,64,64,64,3464,64,64,64,64,64,64,64,3564,64,64,64,64,64,64,64,3664,64,64,64,64,64,64,64,3764,64,64,64,64,64,64,64,3864,64,64,64,64,64,64,64,3964,64,64,64,64,64,64,64,4064,64,64,64,64,64,64,6441};42#endif4344/*This table has been modified from OC_FZIG_ZAG by baking an 8x8 transpose into45the destination.*/46static const unsigned char OC_FZIG_ZAG_SSE2[128]={470, 8, 1, 2, 9,16,24,17,4810, 3, 4,11,18,25,32,40,4933,26,19,12, 5, 6,13,20,5027,34,41,48,56,49,42,35,5128,21,14, 7,15,22,29,36,5243,50,57,58,51,44,37,30,5323,31,38,45,52,59,60,53,5446,39,47,54,61,62,55,63,5564,64,64,64,64,64,64,64,5664,64,64,64,64,64,64,64,5764,64,64,64,64,64,64,64,5864,64,64,64,64,64,64,64,5964,64,64,64,64,64,64,64,6064,64,64,64,64,64,64,64,6164,64,64,64,64,64,64,64,6264,64,64,64,64,64,64,6463};6465void oc_state_accel_init_x86(oc_theora_state *_state){66oc_state_accel_init_c(_state);67_state->cpu_flags=oc_cpu_flags_get();68# if defined(OC_STATE_USE_VTABLE)69if(_state->cpu_flags&OC_CPU_X86_MMX){70_state->opt_vtable.frag_copy=oc_frag_copy_mmx;71_state->opt_vtable.frag_copy_list=oc_frag_copy_list_mmx;72_state->opt_vtable.frag_recon_intra=oc_frag_recon_intra_mmx;73_state->opt_vtable.frag_recon_inter=oc_frag_recon_inter_mmx;74_state->opt_vtable.frag_recon_inter2=oc_frag_recon_inter2_mmx;75_state->opt_vtable.idct8x8=oc_idct8x8_mmx;76_state->opt_vtable.state_frag_recon=oc_state_frag_recon_mmx;77_state->opt_vtable.loop_filter_init=oc_loop_filter_init_mmx;78_state->opt_vtable.state_loop_filter_frag_rows=79oc_state_loop_filter_frag_rows_mmx;80_state->opt_vtable.restore_fpu=oc_restore_fpu_mmx;81_state->opt_data.dct_fzig_zag=OC_FZIG_ZAG_MMX;82}83if(_state->cpu_flags&OC_CPU_X86_MMXEXT){84_state->opt_vtable.loop_filter_init=oc_loop_filter_init_mmxext;85_state->opt_vtable.state_loop_filter_frag_rows=86oc_state_loop_filter_frag_rows_mmxext;87}88if(_state->cpu_flags&OC_CPU_X86_SSE2){89_state->opt_vtable.idct8x8=oc_idct8x8_sse2;90# endif91_state->opt_data.dct_fzig_zag=OC_FZIG_ZAG_SSE2;92# if defined(OC_STATE_USE_VTABLE)93}94# endif95}96#endif979899