diff options
author | thestig <thestig@chromium.org> | 2014-08-26 23:34:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-27 06:35:31 +0000 |
commit | 55234498566db7ff749af32df42eafce48d2837c (patch) | |
tree | b8c4b4d5b4fbc7204c71abb27ae2e3167f179059 /media/base/yuv_convert.cc | |
parent | 17e71b798adba6be1c3c96df6f891e730e8a89f9 (diff) | |
download | chromium_src-55234498566db7ff749af32df42eafce48d2837c.zip chromium_src-55234498566db7ff749af32df42eafce48d2837c.tar.gz chromium_src-55234498566db7ff749af32df42eafce48d2837c.tar.bz2 |
Revert of Cleanup: Remove unneeded SSE2 checks and unused code. (patchset #4 of https://codereview.chromium.org/459603003/)
Reason for revert:
Passed the win x64 trybot, but failed on the win 64 builder.
Original issue's description:
> Cleanup: Remove unneeded SSE2 checks and unused code.
>
> BUG=349320
>
> Committed: https://chromium.googlesource.com/chromium/src/+/b2cd99b39c3744f61231f8818f6c7a3d2881f0f0
TBR=cpu@chromium.org,dalecurtis@chromium.org,senorblanco@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=349320
Review URL: https://codereview.chromium.org/513663002
Cr-Commit-Position: refs/heads/master@{#292101}
Diffstat (limited to 'media/base/yuv_convert.cc')
-rw-r--r-- | media/base/yuv_convert.cc | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/media/base/yuv_convert.cc b/media/base/yuv_convert.cc index 4c53067..5ad8f30 100644 --- a/media/base/yuv_convert.cc +++ b/media/base/yuv_convert.cc @@ -165,33 +165,42 @@ void InitializeCPUSpecificYUVConversions() { // Assembly code confuses MemorySanitizer. #if defined(ARCH_CPU_X86_FAMILY) && !defined(MEMORY_SANITIZER) base::CPU cpu; - - g_convert_yuva_to_argb_proc_ = ConvertYUVAToARGB_MMX; + if (cpu.has_mmx()) { + g_convert_yuv_to_rgb32_row_proc_ = ConvertYUVToRGB32Row_MMX; + g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_MMX; + g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_MMX; + g_convert_yuva_to_argb_proc_ = ConvertYUVAToARGB_MMX; + g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_MMX; #if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) - g_filter_yuv_rows_proc_ = FilterYUVRows_MMX; - g_empty_register_state_proc_ = EmptyRegisterStateIntrinsic; + g_filter_yuv_rows_proc_ = FilterYUVRows_MMX; + g_empty_register_state_proc_ = EmptyRegisterStateIntrinsic; #else - g_empty_register_state_proc_ = EmptyRegisterState_MMX; + g_empty_register_state_proc_ = EmptyRegisterState_MMX; #endif + } - g_convert_yuv_to_rgb32_row_proc_ = ConvertYUVToRGB32Row_SSE; - g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE; - g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_SSE; - g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_SSE; + if (cpu.has_sse()) { + g_convert_yuv_to_rgb32_row_proc_ = ConvertYUVToRGB32Row_SSE; + g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE; + g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_SSE; + g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_SSE; + } - g_filter_yuv_rows_proc_ = FilterYUVRows_SSE2; - g_convert_rgb32_to_yuv_proc_ = ConvertRGB32ToYUV_SSE2; + if (cpu.has_sse2()) { + g_filter_yuv_rows_proc_ = FilterYUVRows_SSE2; + g_convert_rgb32_to_yuv_proc_ = ConvertRGB32ToYUV_SSE2; #if defined(ARCH_CPU_X86_64) - g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE2_X64; + g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE2_X64; - // Technically this should be in the MMX section, but MSVC will optimize out - // the export of LinearScaleYUVToRGB32Row_MMX, which is required by the unit - // tests, if that decision can be made at compile time. Since all X64 CPUs - // have SSE2, we can hack around this by making the selection here. - g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_MMX_X64; + // Technically this should be in the MMX section, but MSVC will optimize out + // the export of LinearScaleYUVToRGB32Row_MMX, which is required by the unit + // tests, if that decision can be made at compile time. Since all X64 CPUs + // have SSE2, we can hack around this by making the selection here. + g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_MMX_X64; #endif + } if (cpu.has_ssse3()) { g_convert_rgb24_to_yuv_proc_ = &ConvertRGB24ToYUV_SSSE3; |