Chromium Code Reviews| Index: media/base/yuv_convert.cc |
| diff --git a/media/base/yuv_convert.cc b/media/base/yuv_convert.cc |
| index 7aa16cc063a630833378c557bf0b05bdf8130b97..e64ea48c458be2a6dd3d5e3cdddee9c1d70dd5dd 100644 |
| --- a/media/base/yuv_convert.cc |
| +++ b/media/base/yuv_convert.cc |
| @@ -33,6 +33,11 @@ |
| #endif |
| #endif |
| +// Assembly functions are declared without namespace. |
| +extern "C" { |
| +void EmptyRegisterState_MMX(void); |
|
scherkus (not reviewing)
2013/02/01 01:13:17
nit: we don't typically put the void type in for p
wolenetz
2013/02/01 02:42:07
Done.
|
| +} // extern "C" |
| + |
| namespace media { |
| static FilterYUVRowsProc ChooseFilterYUVRowsProc() { |
| @@ -40,9 +45,12 @@ static FilterYUVRowsProc ChooseFilterYUVRowsProc() { |
| base::CPU cpu; |
| if (cpu.has_sse2()) |
| return &FilterYUVRows_SSE2; |
| + |
| +#if !defined(MEDIA_DO_NOT_USE_MMX_INTRINSICS) |
| if (cpu.has_mmx()) |
| return &FilterYUVRows_MMX; |
| -#endif |
| +#endif // !defined(MEDIA_DO_NOT_USE_MMX_INTRINSICS) |
| +#endif // defined(ARCH_CPU_X86_FAMILY) |
| return &FilterYUVRows_C; |
| } |
| @@ -97,9 +105,16 @@ void EmptyRegisterState() { |
| has_mmx = cpu.has_mmx(); |
| checked = true; |
| } |
| - if (has_mmx) |
| + |
| + if (has_mmx) { |
| +#if defined(MEDIA_DO_NOT_USE_MMX_INTRINSICS) |
| + EmptyRegisterState_MMX(); |
| +#else |
| _mm_empty(); |
| -#endif |
| +#endif // defined(MEDIA_DO_NOT_USE_MMX_INTRINSICS) |
| + } |
| + |
| +#endif // defined(ARCH_CPU_X86_FAMILY) |
| } |
| // 16.16 fixed point arithmetic |