/src/theora/lib/x86/x86enc.c
Line | Count | Source |
1 | | /******************************************************************** |
2 | | * * |
3 | | * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * |
4 | | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * |
5 | | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * |
6 | | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * |
7 | | * * |
8 | | * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * |
9 | | * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * |
10 | | * * |
11 | | ******************************************************************** |
12 | | |
13 | | function: |
14 | | last mod: $Id: x86state.c 15675 2009-02-06 09:43:27Z tterribe $ |
15 | | |
16 | | ********************************************************************/ |
17 | | #include "x86enc.h" |
18 | | |
19 | | #if defined(OC_X86_ASM) |
20 | | |
21 | 3.44k | void oc_enc_accel_init_x86(oc_enc_ctx *_enc){ |
22 | 3.44k | ogg_uint32_t cpu_flags; |
23 | 3.44k | cpu_flags=_enc->state.cpu_flags; |
24 | 3.44k | oc_enc_accel_init_c(_enc); |
25 | | # if defined(OC_ENC_USE_VTABLE) |
26 | | if(cpu_flags&OC_CPU_X86_MMX){ |
27 | | _enc->opt_vtable.frag_sub=oc_enc_frag_sub_mmx; |
28 | | _enc->opt_vtable.frag_sub_128=oc_enc_frag_sub_128_mmx; |
29 | | _enc->opt_vtable.frag_recon_intra=oc_frag_recon_intra_mmx; |
30 | | _enc->opt_vtable.frag_recon_inter=oc_frag_recon_inter_mmx; |
31 | | } |
32 | | if(cpu_flags&OC_CPU_X86_MMXEXT){ |
33 | | _enc->opt_vtable.frag_sad=oc_enc_frag_sad_mmxext; |
34 | | _enc->opt_vtable.frag_sad_thresh=oc_enc_frag_sad_thresh_mmxext; |
35 | | _enc->opt_vtable.frag_sad2_thresh=oc_enc_frag_sad2_thresh_mmxext; |
36 | | _enc->opt_vtable.frag_satd=oc_enc_frag_satd_mmxext; |
37 | | _enc->opt_vtable.frag_satd2=oc_enc_frag_satd2_mmxext; |
38 | | _enc->opt_vtable.frag_intra_satd=oc_enc_frag_intra_satd_mmxext; |
39 | | _enc->opt_vtable.frag_copy2=oc_enc_frag_copy2_mmxext; |
40 | | _enc->opt_vtable.fdct8x8=oc_enc_fdct8x8_mmxext; |
41 | | } |
42 | | if(cpu_flags&OC_CPU_X86_SSE2){ |
43 | | # if defined(OC_X86_64_ASM) |
44 | | _enc->opt_vtable.fdct8x8=oc_enc_fdct8x8_x86_64sse2; |
45 | | # endif |
46 | | _enc->opt_vtable.frag_ssd=oc_enc_frag_ssd_sse2; |
47 | | _enc->opt_vtable.frag_border_ssd=oc_enc_frag_border_ssd_sse2; |
48 | | _enc->opt_vtable.frag_satd=oc_enc_frag_satd_sse2; |
49 | | _enc->opt_vtable.frag_satd2=oc_enc_frag_satd2_sse2; |
50 | | _enc->opt_vtable.frag_intra_satd=oc_enc_frag_intra_satd_sse2; |
51 | | _enc->opt_vtable.enquant_table_init=oc_enc_enquant_table_init_x86; |
52 | | _enc->opt_vtable.enquant_table_fixup=oc_enc_enquant_table_fixup_x86; |
53 | | _enc->opt_vtable.quantize=oc_enc_quantize_sse2; |
54 | | # else |
55 | 3.44k | (void) cpu_flags; |
56 | 3.44k | # endif |
57 | 3.44k | _enc->opt_data.enquant_table_size=128*sizeof(ogg_uint16_t); |
58 | 3.44k | _enc->opt_data.enquant_table_alignment=16; |
59 | | # if defined(OC_ENC_USE_VTABLE) |
60 | | } |
61 | | # endif |
62 | 3.44k | } |
63 | | #endif |