MCPcopy Create free account
hub / github.com/Aleksoid1978/VideoRenderer / CopyFrameRGB24

Function CopyFrameRGB24

Source/Helper.cpp:446–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446void CopyFrameRGB24(const UINT lines, BYTE* dst, UINT dst_pitch, const BYTE* src, int src_pitch)
447{
448 UINT line_pixels = abs(src_pitch) / 3;
449 UINT line_pixels4 = line_pixels & ~(4u - 1);
450
451 for (UINT y = 0; y < lines; ++y) {
452 uint32_t* src32 = (uint32_t*)src;
453 uint32_t* dst32 = (uint32_t*)dst;
454
455 UINT i = 0;
456 for (; i < line_pixels4; i += 4) {
457 uint32_t sa = *src32++;
458 uint32_t sb = *src32++;
459 uint32_t sc = *src32++;
460
461 *dst32++ = sa;
462 *dst32++ = (sa >> 24) | (sb << 8);
463 *dst32++ = (sb >> 16) | (sc << 16);
464 *dst32++ = sc >> 8;
465 }
466
467 if (i < line_pixels) {
468 if (line_pixels & 1) {
469 *dst32 = *src32;
470 } else {
471 uint32_t sa = *src32++;
472 uint32_t sb = *src32;
473
474 *dst32++ = sa;
475 *dst32 = (sa >> 24) | (sb << 8);
476 }
477 }
478
479 src += src_pitch;
480 dst += dst_pitch;
481 }
482}
483
484void CopyFrameRGB24_SSSE3(const UINT lines, BYTE* dst, UINT dst_pitch, const BYTE* src, int src_pitch)
485{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected