diff options
author | radu.velea <radu.velea@intel.com> | 2015-12-10 08:44:54 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-10 16:45:59 +0000 |
commit | bf9f7f7b3d8deb378d0550ffd706be812978073f (patch) | |
tree | 20183c96e6f2b82e481455f0e53cfed0d03ba4cd /cc/raster | |
parent | c8882c05e51f03b00a3f54f8f815c2bfb76ab197 (diff) | |
download | chromium_src-bf9f7f7b3d8deb378d0550ffd706be812978073f.zip chromium_src-bf9f7f7b3d8deb378d0550ffd706be812978073f.tar.gz chromium_src-bf9f7f7b3d8deb378d0550ffd706be812978073f.tar.bz2 |
Fix static initializers in cc/raster/texture_compressor_etc1_sse.cc
Perftests for *TextureCompressorPerfTest*
Before:
*RESULT Compress256x256BlackAndWhiteGradientImage: ETC1 Low= 1.0986825227737427 us
*RESULT Compress256x256BlackAndWhiteGradientImage: ETC1 Medium= 1.0968447923660278 us
*RESULT Compress256x256BlackAndWhiteGradientImage: ETC1 High= 1.0986814498901367 us
*RESULT Compress256x256SolidBlackImage: ETC1 Low= .2650042474269867 us
*RESULT Compress256x256SolidBlackImage: ETC1 Medium= .26646843552589417 us
*RESULT Compress256x256SolidBlackImage: ETC1 High= .27297326922416687 us
*RESULT Compress256x256SolidColorImage: ETC1 Low= .2867283523082733 us
*RESULT Compress256x256SolidColorImage: ETC1 Medium= .28761234879493713 us
*RESULT Compress256x256SolidColorImage: ETC1 High= .2860330045223236 us
*RESULT Compress256x256RandomColorImage: ETC1 Low= 1.9297336339950562 us
*RESULT Compress256x256RandomColorImage: ETC1 Medium= 1.9182685613632202 us
*RESULT Compress256x256RandomColorImage: ETC1 High= 1.9214648008346558 us
After:
*RESULT Compress256x256BlackAndWhiteGradientImage: ETC1 Low= 1.0688649415969849 us
*RESULT Compress256x256BlackAndWhiteGradientImage: ETC1 Medium= 1.0757253170013428 us
*RESULT Compress256x256BlackAndWhiteGradientImage: ETC1 High= 1.077048420906067 us
*RESULT Compress256x256SolidBlackImage: ETC1 Low= .26659414172172546 us
*RESULT Compress256x256SolidBlackImage: ETC1 Medium= .2658853828907013 us
*RESULT Compress256x256SolidBlackImage: ETC1 High= .26466891169548035 us
*RESULT Compress256x256SolidColorImage: ETC1 Low= .2858351469039917 us
*RESULT Compress256x256SolidColorImage: ETC1 Medium= .2861722409725189 us
*RESULT Compress256x256SolidColorImage: ETC1 High= .2875249981880188 us
*RESULT Compress256x256RandomColorImage: ETC1 Low= 1.8891329765319824 us
*RESULT Compress256x256RandomColorImage: ETC1 Medium= 1.8881990909576416 us
*RESULT Compress256x256RandomColorImage: ETC1 High= 1.8776999711990356 us
Unittests for *TextureCompressorETC1Test*
Note: Google Test filter = TextureCompressorETC1Test.Compress256x256Ratio
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from TextureCompressorETC1Test
[ RUN ] TextureCompressorETC1Test.Compress256x256Ratio
[ OK ] TextureCompressorETC1Test.Compress256x256Ratio (1 ms)
[----------] 1 test from TextureCompressorETC1Test (1 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (2 ms total)
[ PASSED ] 1 test.
[1/1] TextureCompressorETC1Test.Compress256x256Ratio (1 ms)
SUCCESS: all tests passed.
Tests took 0 seconds.
BUG=568332
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1515753003
Cr-Commit-Position: refs/heads/master@{#364379}
Diffstat (limited to 'cc/raster')
-rw-r--r-- | cc/raster/texture_compressor_etc1_sse.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/cc/raster/texture_compressor_etc1_sse.cc b/cc/raster/texture_compressor_etc1_sse.cc index 2297822..6f1005b 100644 --- a/cc/raster/texture_compressor_etc1_sse.cc +++ b/cc/raster/texture_compressor_etc1_sse.cc @@ -38,13 +38,9 @@ struct __sse_data { __m128i* red; }; -// Commonly used registers throughout the code. -static const __m128i __sse_zero = _mm_set1_epi32(0); -static const __m128i __sse_max_int = _mm_set1_epi32(0x7FFFFFFF); - inline __m128i AddAndClamp(const __m128i x, const __m128i y) { static const __m128i color_max = _mm_set1_epi32(0xFF); - return _mm_max_epi16(__sse_zero, + return _mm_max_epi16(_mm_setzero_si128(), _mm_min_epi16(_mm_add_epi16(x, y), color_max)); } @@ -72,7 +68,7 @@ inline uint32_t GetVerticalError(const __sse_data* data, const __m128i* green_avg, const __m128i* red_avg, uint32_t* verror) { - __m128i error = __sse_zero; + __m128i error = _mm_setzero_si128(); for (int i = 0; i < 4; i++) { error = _mm_add_epi32(error, GetColorErrorSSE(data->blue[i], blue_avg[0])); @@ -94,7 +90,7 @@ inline uint32_t GetHorizontalError(const __sse_data* data, const __m128i* green_avg, const __m128i* red_avg, uint32_t* verror) { - __m128i error = __sse_zero; + __m128i error = _mm_setzero_si128(); int first_index, second_index; for (int i = 0; i < 2; i++) { @@ -301,11 +297,11 @@ void ComputeLuminance(uint8_t* block, test_green = AddAndClamp(tmp, base_green); test_red = AddAndClamp(tmp, base_red); - first_half_min = __sse_max_int; - second_half_min = __sse_max_int; + first_half_min = _mm_set1_epi32(0x7FFFFFFF); + second_half_min = _mm_set1_epi32(0x7FFFFFFF); - first_half_pattern = __sse_zero; - second_half_pattern = __sse_zero; + first_half_pattern = _mm_setzero_si128(); + second_half_pattern = _mm_setzero_si128(); for (uint8_t imm8 : shuffle_mask) { switch (imm8) { |