| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 | 11 |
| 12 #include "vpx_ports/config.h" | 12 #include "vpx_ports/config.h" |
| 13 #include "vpx_ports/x86.h" | 13 #include "vpx_ports/x86.h" |
| 14 #include "vp8/decoder/onyxd_int.h" | 14 #include "vp8/decoder/onyxd_int.h" |
| 15 | 15 |
| 16 | 16 |
| 17 #if HAVE_MMX | 17 #if HAVE_MMX |
| 18 void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q); | 18 void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q); |
| 19 | 19 |
| 20 static void dequantize_b_mmx(BLOCKD *d) | 20 void vp8_dequantize_b_mmx(BLOCKD *d) |
| 21 { | 21 { |
| 22 short *sq = (short *) d->qcoeff; | 22 short *sq = (short *) d->qcoeff; |
| 23 short *dq = (short *) d->dqcoeff; | 23 short *dq = (short *) d->dqcoeff; |
| 24 short *q = (short *) d->dequant; | 24 short *q = (short *) d->dequant; |
| 25 vp8_dequantize_b_impl_mmx(sq, dq, q); | 25 vp8_dequantize_b_impl_mmx(sq, dq, q); |
| 26 } | 26 } |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 void vp8_arch_x86_decode_init(VP8D_COMP *pbi) | 29 void vp8_arch_x86_decode_init(VP8D_COMP *pbi) |
| 30 { | 30 { |
| 31 #if CONFIG_RUNTIME_CPU_DETECT |
| 31 int flags = x86_simd_caps(); | 32 int flags = x86_simd_caps(); |
| 32 | 33 |
| 33 /* Note: | 34 /* Note: |
| 34 * | 35 * |
| 35 * This platform can be built without runtime CPU detection as well. If | 36 * This platform can be built without runtime CPU detection as well. If |
| 36 * you modify any of the function mappings present in this file, be sure | 37 * you modify any of the function mappings present in this file, be sure |
| 37 * to also update them in static mapings (<arch>/filename_<arch>.h) | 38 * to also update them in static mapings (<arch>/filename_<arch>.h) |
| 38 */ | 39 */ |
| 39 #if CONFIG_RUNTIME_CPU_DETECT | |
| 40 /* Override default functions with fastest ones for this CPU. */ | 40 /* Override default functions with fastest ones for this CPU. */ |
| 41 #if HAVE_MMX | 41 #if HAVE_MMX |
| 42 if (flags & HAS_MMX) | 42 if (flags & HAS_MMX) |
| 43 { | 43 { |
| 44 pbi->dequant.block = dequantize_b_mmx; | 44 pbi->dequant.block = vp8_dequantize_b_mmx; |
| 45 pbi->dequant.idct_add = vp8_dequant_idct_add_mmx; | 45 pbi->dequant.idct_add = vp8_dequant_idct_add_mmx; |
| 46 pbi->dequant.dc_idct_add = vp8_dequant_dc_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; | 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; | 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; | 49 pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_mmx; |
| 50 } | 50 } |
| 51 #endif | 51 #endif |
| 52 #if HAVE_SSE2 | 52 #if HAVE_SSE2 |
| 53 if (flags & HAS_SSE2) | 53 if (flags & HAS_SSE2) |
| 54 { | 54 { |
| 55 pbi->dequant.dc_idct_add_y_block = vp8_dequant_dc_idct_add_y_block_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; | 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; | 57 pbi->dequant.idct_add_uv_block = vp8_dequant_idct_add_uv_block_sse2; |
| 58 } | 58 } |
| 59 #endif | 59 #endif |
| 60 | 60 |
| 61 #endif | 61 #endif |
| 62 } | 62 } |
| OLD | NEW |