- uint8_t ycbcr[] = { y, cb, y, cr };
- memset4(video_frame.data, ycbcr, width * height / 2);
+ if (current_pixel_format == PixelFormat_10BitYCbCr) {
+ // Just use the 8-bit-values shifted left by 2.
+ // It's not 100% correct, but it's close enough.
+ uint32_t pix[4];
+ pix[0] = (cb << 2) | (y << 12) | (cr << 22);
+ pix[1] = (y << 2) | (cb << 12) | ( y << 22);
+ pix[2] = (cr << 2) | (y << 12) | (cb << 22);
+ pix[3] = (y << 2) | (cr << 12) | ( y << 22);
+ memset16(video_frame.data, pix, video_format.stride * height / sizeof(pix));
+ } else {
+ uint8_t ycbcr[] = { y, cb, y, cr };
+ memset4(video_frame.data, ycbcr, width * height / 2);
+ }