fix --disable-runtime-cpu-detect on x86
[libvpx.git] / vp8 / decoder / x86 / x86_dsystemdependent.c
bloba244a3a98b0a68482774d7e1149c9744870c57ec
1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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 */
12 #include "vpx_ports/config.h"
13 #include "vpx_ports/x86.h"
14 #include "vp8/decoder/onyxd_int.h"
17 #if HAVE_MMX
18 void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q);
20 void vp8_dequantize_b_mmx(BLOCKD *d)
22 short *sq = (short *) d->qcoeff;
23 short *dq = (short *) d->dqcoeff;
24 short *q = (short *) d->dequant;
25 vp8_dequantize_b_impl_mmx(sq, dq, q);
27 #endif
29 void vp8_arch_x86_decode_init(VP8D_COMP *pbi)
31 #if CONFIG_RUNTIME_CPU_DETECT
32 int flags = x86_simd_caps();
34 /* Note:
36 * This platform can be built without runtime CPU detection as well. If
37 * you modify any of the function mappings present in this file, be sure
38 * to also update them in static mapings (<arch>/filename_<arch>.h)
40 /* Override default functions with fastest ones for this CPU. */
41 #if HAVE_MMX
42 if (flags & HAS_MMX)
44 pbi->dequant.block = vp8_dequantize_b_mmx;
45 pbi->dequant.idct_add = vp8_dequant_idct_add_mmx;
46 pbi->dequant.dc_idct_add = vp8_dequant_dc_idct_add_mmx;
47 pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_mmx;
48 pbi->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_mmx;
49 pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_mmx;
51 #endif
52 #if HAVE_SSE2
53 if (flags & HAS_SSE2)
55 pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_sse2;
56 pbi->dequant.idct_add_y_block = vp8_dequant_idct_add_y_block_sse2;
57 pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_sse2;
59 #endif
61 #endif