g1 = src[5];
b = 0.5f*(src[2] + src[6]);
- value = float_to_ubyte(r);
- value |= float_to_ubyte(g0) << 8;
- value |= float_to_ubyte(b) << 16;
- value |= float_to_ubyte(g1) << 24;
+ value = (uint32_t)float_to_ubyte(r);
+ value |= (uint32_t)float_to_ubyte(g0) << 8;
+ value |= (uint32_t)float_to_ubyte(b) << 16;
+ value |= (uint32_t)float_to_ubyte(g1) << 24;
*dst++ = util_le32_to_cpu(value);
g1 = 0;
b = src[2];
- value = float_to_ubyte(r);
- value |= float_to_ubyte(g0) << 8;
- value |= float_to_ubyte(b) << 16;
- value |= float_to_ubyte(g1) << 24;
+ value = (uint32_t)float_to_ubyte(r);
+ value |= (uint32_t)float_to_ubyte(g0) << 8;
+ value |= (uint32_t)float_to_ubyte(b) << 16;
+ value |= (uint32_t)float_to_ubyte(g1) << 24;
*dst = util_le32_to_cpu(value);
}
b = (src[2] + src[6] + 1) >> 1;
value = r;
- value |= g0 << 8;
- value |= b << 16;
- value |= g1 << 24;
+ value |= (uint32_t)g0 << 8;
+ value |= (uint32_t)b << 16;
+ value |= (uint32_t)g1 << 24;
*dst++ = util_le32_to_cpu(value);
b = src[2];
value = r;
- value |= g0 << 8;
- value |= b << 16;
- value |= g1 << 24;
+ value |= (uint32_t)g0 << 8;
+ value |= (uint32_t)b << 16;
+ value |= (uint32_t)g1 << 24;
*dst = util_le32_to_cpu(value);
}
g1 = src[5];
b = 0.5f*(src[2] + src[6]);
- value = float_to_ubyte(g0);
- value |= float_to_ubyte(r) << 8;
- value |= float_to_ubyte(g1) << 16;
- value |= float_to_ubyte(b) << 24;
+ value = (uint32_t)float_to_ubyte(g0);
+ value |= (uint32_t)float_to_ubyte(r) << 8;
+ value |= (uint32_t)float_to_ubyte(g1) << 16;
+ value |= (uint32_t)float_to_ubyte(b) << 24;
*dst++ = util_le32_to_cpu(value);
g1 = 0;
b = src[2];
- value = float_to_ubyte(g0);
- value |= float_to_ubyte(r) << 8;
- value |= float_to_ubyte(g1) << 16;
- value |= float_to_ubyte(b) << 24;
+ value = (uint32_t)float_to_ubyte(g0);
+ value |= (uint32_t)float_to_ubyte(r) << 8;
+ value |= (uint32_t)float_to_ubyte(g1) << 16;
+ value |= (uint32_t)float_to_ubyte(b) << 24;
*dst = util_le32_to_cpu(value);
}
b = (src[2] + src[6] + 1) >> 1;
value = g0;
- value |= r << 8;
- value |= g1 << 16;
- value |= b << 24;
+ value |= (uint32_t)r << 8;
+ value |= (uint32_t)g1 << 16;
+ value |= (uint32_t)b << 24;
*dst++ = util_le32_to_cpu(value);
b = src[2];
value = g0;
- value |= r << 8;
- value |= g1 << 16;
- value |= b << 24;
+ value |= (uint32_t)r << 8;
+ value |= (uint32_t)g1 << 16;
+ value |= (uint32_t)b << 24;
*dst = util_le32_to_cpu(value);
}
v = (v0 + v1 + 1) >> 1;
value = u;
- value |= y0 << 8;
- value |= v << 16;
- value |= y1 << 24;
+ value |= (uint32_t)y0 << 8;
+ value |= (uint32_t)v << 16;
+ value |= (uint32_t)y1 << 24;
*dst++ = util_le32_to_cpu(value);
y1 = 0;
value = u;
- value |= y0 << 8;
- value |= v << 16;
- value |= y1 << 24;
+ value |= (uint32_t)y0 << 8;
+ value |= (uint32_t)v << 16;
+ value |= (uint32_t)y1 << 24;
*dst = util_le32_to_cpu(value);
}
v = (v0 + v1 + 1) >> 1;
value = u;
- value |= y0 << 8;
- value |= v << 16;
- value |= y1 << 24;
+ value |= (uint32_t)y0 << 8;
+ value |= (uint32_t)v << 16;
+ value |= (uint32_t)y1 << 24;
*dst++ = util_le32_to_cpu(value);
y1 = 0;
value = u;
- value |= y0 << 8;
- value |= v << 16;
- value |= y1 << 24;
+ value |= (uint32_t)y0 << 8;
+ value |= (uint32_t)v << 16;
+ value |= (uint32_t)y1 << 24;
*dst = util_le32_to_cpu(value);
}
v = (v0 + v1 + 1) >> 1;
value = y0;
- value |= u << 8;
- value |= y1 << 16;
- value |= v << 24;
+ value |= (uint32_t)u << 8;
+ value |= (uint32_t)y1 << 16;
+ value |= (uint32_t)v << 24;
*dst++ = util_le32_to_cpu(value);
y1 = 0;
value = y0;
- value |= u << 8;
- value |= y1 << 16;
- value |= v << 24;
+ value |= (uint32_t)u << 8;
+ value |= (uint32_t)y1 << 16;
+ value |= (uint32_t)v << 24;
*dst = util_le32_to_cpu(value);
}
v = (v0 + v1 + 1) >> 1;
value = y0;
- value |= u << 8;
- value |= y1 << 16;
- value |= v << 24;
+ value |= (uint32_t)u << 8;
+ value |= (uint32_t)y1 << 16;
+ value |= (uint32_t)v << 24;
*dst++ = util_le32_to_cpu(value);
y1 = 0;
value = y0;
- value |= u << 8;
- value |= y1 << 16;
- value |= v << 24;
+ value |= (uint32_t)u << 8;
+ value |= (uint32_t)y1 << 16;
+ value |= (uint32_t)v << 24;
*dst = util_le32_to_cpu(value);
}