Fix fromPlanaerSSE

This commit is contained in:
2024-08-25 17:55:59 +02:00
parent 21b4e0934c
commit 79dd7d91eb
+3 -3
View File
@@ -84,15 +84,15 @@ void fromPlanarSSE(const void *in, void *out, size_t count)
switch(sizeof(T)) switch(sizeof(T))
{ {
case 1: case 1:
for(uint32_t o=0; o<ch; o++)static_cast<uint8_t*>(out)[i + o] = static_cast<const uint8_t*>(in)[i + o + s2]; for(uint32_t o=0; o<ch; o++)static_cast<uint8_t*>(out)[i*4 + o] = static_cast<const uint8_t*>(in)[i + o*s2];
if(ch==3)static_cast<uint8_t*>(out)[i*4 + 3] = 0xff; if(ch==3)static_cast<uint8_t*>(out)[i*4 + 3] = 0xff;
break; break;
case 2: case 2:
for(uint32_t o=0; o<ch; o++)static_cast<uint16_t*>(out)[i + o] = static_cast<const uint16_t*>(in)[i + o + s2]; for(uint32_t o=0; o<ch; o++)static_cast<uint16_t*>(out)[i*4 + o] = static_cast<const uint16_t*>(in)[i + o*s2];
if(ch==3)static_cast<uint16_t*>(out)[i*4 + 3] = 0xffff; if(ch==3)static_cast<uint16_t*>(out)[i*4 + 3] = 0xffff;
break; break;
case 4: case 4:
for(uint32_t o=0; o<ch; o++)static_cast<uint32_t*>(out)[i + o] = static_cast<const uint32_t*>(in)[i + o + s2]; for(uint32_t o=0; o<ch; o++)static_cast<uint32_t*>(out)[i*4 + o] = static_cast<const uint32_t*>(in)[i + o*s2];
if(ch==3) if(ch==3)
{ {
if(!std::numeric_limits<T>::is_integer)static_cast<float*>(out)[i*4 + 3] = 1.0; if(!std::numeric_limits<T>::is_integer)static_cast<float*>(out)[i*4 + 3] = 1.0;