MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / Store

Method Store

src/OpenColorIO/SSE2.h:255–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253 }
254
255 static inline void Store(Type *out, __m128 r, __m128 g, __m128 b, __m128 a)
256 {
257 const __m128 maxValue = _mm_set1_ps((float)BitDepthInfo<BD>::maxValue);
258
259 __m128i rrrr = _mm_cvtps_epi32(sse2_clamp(r, maxValue));
260 __m128i gggg = _mm_cvtps_epi32(sse2_clamp(g, maxValue));
261 __m128i bbbb = _mm_cvtps_epi32(sse2_clamp(b, maxValue));
262 __m128i aaaa = _mm_cvtps_epi32(sse2_clamp(a, maxValue));
263
264 __m128i rgrg_rgrg = _mm_or_si128(rrrr, _mm_slli_si128(gggg, 2));
265 __m128i baba_baba = _mm_or_si128(bbbb, _mm_slli_si128(aaaa, 2));
266
267 __m128i rgba_00_01 = _mm_unpacklo_epi32(rgrg_rgrg, baba_baba);
268 __m128i rgba_02_03 = _mm_unpackhi_epi32(rgrg_rgrg, baba_baba);
269
270 _mm_storeu_si128((__m128i*)(out + 0), rgba_00_01);
271 _mm_storeu_si128((__m128i*)(out + 8), rgba_02_03);
272 }
273};
274
275template <>

Callers

nothing calls this directly

Calls 1

sse2_clampFunction · 0.85

Tested by

no test coverage detected