diff options
Diffstat (limited to 'src/blitter/32bpp_ssse3.hpp')
-rw-r--r-- | src/blitter/32bpp_ssse3.hpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/blitter/32bpp_ssse3.hpp b/src/blitter/32bpp_ssse3.hpp index d8d7dd204..23e6e4878 100644 --- a/src/blitter/32bpp_ssse3.hpp +++ b/src/blitter/32bpp_ssse3.hpp @@ -37,7 +37,7 @@ __m128i colAB = _mm_unpacklo_epi8(m_colourX2, zero); \ \ __m128i briAB = _mm_cvtsi32_si128(m_brightnessX2); \ - briAB = _mm_shuffle_epi8(briAB, briAB_cm); /* DEFAULT_BRIGHTNESS in 0, 0x00 in 2. */ \ + briAB = _mm_shuffle_epi8(briAB, BRIGHTNESS_LOW_CONTROL_MASK); /* DEFAULT_BRIGHTNESS in 0, 0x00 in 2. */ \ colAB = _mm_mullo_epi16(colAB, briAB); \ __m128i colAB_ob = _mm_srli_epi16(colAB, 8+7); \ colAB = _mm_srli_epi16(colAB, 7); \ @@ -46,19 +46,19 @@ * Maximum for each rgb is 508 => 9 bits. The highest bit tells if there is overbright. * -255 is changed in -256 so we just have to take the 8 lower bits into account. */ \ - colAB = _mm_and_si128(colAB, div_cleaner); \ - colAB_ob = _mm_and_si128(colAB_ob, ob_check); \ - colAB_ob = _mm_mullo_epi16(colAB_ob, ob_mask); \ + colAB = _mm_and_si128(colAB, BRIGHTNESS_DIV_CLEANER); \ + colAB_ob = _mm_and_si128(colAB_ob, OVERBRIGHT_PRESENCE_MASK); \ + colAB_ob = _mm_mullo_epi16(colAB_ob, OVERBRIGHT_VALUE_MASK); \ colAB_ob = _mm_and_si128(colAB_ob, colAB); \ __m128i obAB = _mm_hadd_epi16(_mm_hadd_epi16(colAB_ob, zero), zero); \ \ - obAB = _mm_srli_epi16(obAB, 1); /* Reduce overbright strength. */ \ - obAB = _mm_shuffle_epi8(obAB, ob_cm); \ - __m128i retAB = ob_mask; /* ob_mask is equal to white. */ \ - retAB = _mm_subs_epu16(retAB, colAB); /* (255 - rgb) */ \ - retAB = _mm_mullo_epi16(retAB, obAB); /* ob*(255 - rgb) */ \ - retAB = _mm_srli_epi16(retAB, 8); /* ob*(255 - rgb)/256 */ \ - retAB = _mm_add_epi16(retAB, colAB); /* ob*(255 - rgb)/256 + rgb */ \ + obAB = _mm_srli_epi16(obAB, 1); /* Reduce overbright strength. */ \ + obAB = _mm_shuffle_epi8(obAB, OVERBRIGHT_CONTROL_MASK); \ + __m128i retAB = OVERBRIGHT_VALUE_MASK; /* ob_mask is equal to white. */ \ + retAB = _mm_subs_epu16(retAB, colAB); /* (255 - rgb) */ \ + retAB = _mm_mullo_epi16(retAB, obAB); /* ob*(255 - rgb) */ \ + retAB = _mm_srli_epi16(retAB, 8); /* ob*(255 - rgb)/256 */ \ + retAB = _mm_add_epi16(retAB, colAB); /* ob*(255 - rgb)/256 + rgb */ \ \ m_colourX2 = _mm_packus_epi16(retAB, retAB); |