+void fill_color_noninterleaved(uint8_t *dst, uint8_t y, uint8_t cb, uint8_t cr, const VideoFormat &video_format, bool ten_bit)
+{
+ if (ten_bit) {
+ // 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(dst, pix, video_format.stride * video_format.height / sizeof(pix));
+ } else {
+ uint8_t ycbcr[] = { y, cb, y, cr };
+ memset4(dst, ycbcr, video_format.width * video_format.height / 2);
+ }
+}
+