Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(951)

Side by Side Diff: media/base/yuv_convert.cc

Issue 513663002: Revert of Cleanup: Remove unneeded SSE2 checks and unused code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/simd/convert_yuv_to_rgb_x86.cc ('k') | media/base/yuv_convert_perftest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This webpage shows layout of YV12 and other YUV formats 5 // This webpage shows layout of YV12 and other YUV formats
6 // http://www.fourcc.org/yuv.php 6 // http://www.fourcc.org/yuv.php
7 // The actual conversion is best described here 7 // The actual conversion is best described here
8 // http://en.wikipedia.org/wiki/YUV 8 // http://en.wikipedia.org/wiki/YUV
9 // An article on optimizing YUV conversion using tables instead of multiplies 9 // An article on optimizing YUV conversion using tables instead of multiplies
10 // http://lestourtereaux.free.fr/papers/data/yuvrgb.pdf 10 // http://lestourtereaux.free.fr/papers/data/yuvrgb.pdf
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_C; 158 g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_C;
159 g_convert_rgb32_to_yuv_proc_ = ConvertRGB32ToYUV_C; 159 g_convert_rgb32_to_yuv_proc_ = ConvertRGB32ToYUV_C;
160 g_convert_rgb24_to_yuv_proc_ = ConvertRGB24ToYUV_C; 160 g_convert_rgb24_to_yuv_proc_ = ConvertRGB24ToYUV_C;
161 g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_C; 161 g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_C;
162 g_convert_yuva_to_argb_proc_ = ConvertYUVAToARGB_C; 162 g_convert_yuva_to_argb_proc_ = ConvertYUVAToARGB_C;
163 g_empty_register_state_proc_ = EmptyRegisterStateStub; 163 g_empty_register_state_proc_ = EmptyRegisterStateStub;
164 164
165 // Assembly code confuses MemorySanitizer. 165 // Assembly code confuses MemorySanitizer.
166 #if defined(ARCH_CPU_X86_FAMILY) && !defined(MEMORY_SANITIZER) 166 #if defined(ARCH_CPU_X86_FAMILY) && !defined(MEMORY_SANITIZER)
167 base::CPU cpu; 167 base::CPU cpu;
168 168 if (cpu.has_mmx()) {
169 g_convert_yuva_to_argb_proc_ = ConvertYUVAToARGB_MMX; 169 g_convert_yuv_to_rgb32_row_proc_ = ConvertYUVToRGB32Row_MMX;
170 g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_MMX;
171 g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_MMX;
172 g_convert_yuva_to_argb_proc_ = ConvertYUVAToARGB_MMX;
173 g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_MMX;
170 174
171 #if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) 175 #if defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
172 g_filter_yuv_rows_proc_ = FilterYUVRows_MMX; 176 g_filter_yuv_rows_proc_ = FilterYUVRows_MMX;
173 g_empty_register_state_proc_ = EmptyRegisterStateIntrinsic; 177 g_empty_register_state_proc_ = EmptyRegisterStateIntrinsic;
174 #else 178 #else
175 g_empty_register_state_proc_ = EmptyRegisterState_MMX; 179 g_empty_register_state_proc_ = EmptyRegisterState_MMX;
176 #endif 180 #endif
181 }
177 182
178 g_convert_yuv_to_rgb32_row_proc_ = ConvertYUVToRGB32Row_SSE; 183 if (cpu.has_sse()) {
179 g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE; 184 g_convert_yuv_to_rgb32_row_proc_ = ConvertYUVToRGB32Row_SSE;
180 g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_SSE; 185 g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE;
181 g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_SSE; 186 g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_SSE;
187 g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_SSE;
188 }
182 189
183 g_filter_yuv_rows_proc_ = FilterYUVRows_SSE2; 190 if (cpu.has_sse2()) {
184 g_convert_rgb32_to_yuv_proc_ = ConvertRGB32ToYUV_SSE2; 191 g_filter_yuv_rows_proc_ = FilterYUVRows_SSE2;
192 g_convert_rgb32_to_yuv_proc_ = ConvertRGB32ToYUV_SSE2;
185 193
186 #if defined(ARCH_CPU_X86_64) 194 #if defined(ARCH_CPU_X86_64)
187 g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE2_X64; 195 g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE2_X64;
188 196
189 // Technically this should be in the MMX section, but MSVC will optimize out 197 // Technically this should be in the MMX section, but MSVC will optimize out
190 // the export of LinearScaleYUVToRGB32Row_MMX, which is required by the unit 198 // the export of LinearScaleYUVToRGB32Row_MMX, which is required by the unit
191 // tests, if that decision can be made at compile time. Since all X64 CPUs 199 // tests, if that decision can be made at compile time. Since all X64 CPUs
192 // have SSE2, we can hack around this by making the selection here. 200 // have SSE2, we can hack around this by making the selection here.
193 g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_MMX_X64; 201 g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_MMX_X64;
194 #endif 202 #endif
203 }
195 204
196 if (cpu.has_ssse3()) { 205 if (cpu.has_ssse3()) {
197 g_convert_rgb24_to_yuv_proc_ = &ConvertRGB24ToYUV_SSSE3; 206 g_convert_rgb24_to_yuv_proc_ = &ConvertRGB24ToYUV_SSSE3;
198 207
199 // TODO(hclam): Add ConvertRGB32ToYUV_SSSE3 when the cyan problem is solved. 208 // TODO(hclam): Add ConvertRGB32ToYUV_SSSE3 when the cyan problem is solved.
200 // See: crbug.com/100462 209 // See: crbug.com/100462
201 } 210 }
202 #endif 211 #endif
203 } 212 }
204 213
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 width, 692 width,
684 height, 693 height,
685 ystride, 694 ystride,
686 uvstride, 695 uvstride,
687 astride, 696 astride,
688 rgbstride, 697 rgbstride,
689 yuv_type); 698 yuv_type);
690 } 699 }
691 700
692 } // namespace media 701 } // namespace media
OLDNEW
« no previous file with comments | « media/base/simd/convert_yuv_to_rgb_x86.cc ('k') | media/base/yuv_convert_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698