- memcpy_interleaved(cb, cr, data + frame_size, frame_size / 2);
+ if (global_flags.bit_depth == 8) {
+ memcpy_interleaved(cb, cr, data + frame_size, frame_size / 2);
+ } else {
+ const uint16_t *src = reinterpret_cast<const uint16_t *>(data + frame_size);
+ uint16_t *cb16 = reinterpret_cast<uint16_t *>(cb);
+ uint16_t *cr16 = reinterpret_cast<uint16_t *>(cr);
+ memcpy_interleaved_word(cb16, cr16, src, frame_size / 4);
+ }