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

Function CopyFrameYV12

Source/Helper.cpp:679–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

677}
678
679void CopyFrameYV12(const UINT lines, BYTE* dst, UINT dst_pitch, const BYTE* src, int src_pitch)
680{
681 ASSERT(src_pitch > 0);
682
683 if (dst_pitch == src_pitch) {
684 memcpy(dst, src, dst_pitch * lines);
685 return;
686 }
687
688 const UINT chromaheight = lines / 3;
689 const UINT lumaheight = chromaheight * 2;
690
691 for (UINT y = 0; y < lumaheight; ++y) {
692 memcpy(dst, src, src_pitch);
693 src += src_pitch;
694 dst += dst_pitch;
695 }
696
697 src_pitch /= 2;
698 dst_pitch /= 2;
699 for (UINT y = 0; y < chromaheight; ++y) {
700 memcpy(dst, src, src_pitch);
701 src += src_pitch;
702 dst += dst_pitch;
703 memcpy(dst, src, src_pitch);
704 src += src_pitch;
705 dst += dst_pitch;
706 }
707}
708
709void CopyFrameV210(const UINT lines, BYTE* dst, UINT dst_pitch, const BYTE* src, int src_pitch)
710{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected