|
|
|
@ -48,7 +48,7 @@ internal static class YuvConversion |
|
|
|
uint uv0 = ((3 * tluv) + luv + 0x00020002u) >> 2; |
|
|
|
YuvToBgr(topY[0], (int)(uv0 & 0xff), (int)(uv0 >> 16), topDst); |
|
|
|
|
|
|
|
if (bottomY != default) |
|
|
|
if (!bottomY.IsEmpty) |
|
|
|
{ |
|
|
|
uv0 = ((3 * luv) + tluv + 0x00020002u) >> 2; |
|
|
|
YuvToBgr(bottomY[0], (int)uv0 & 0xff, (int)(uv0 >> 16), bottomDst); |
|
|
|
@ -69,7 +69,7 @@ internal static class YuvConversion |
|
|
|
YuvToBgr(topY[xMul2 - 1], (int)(uv0 & 0xff), (int)(uv0 >> 16), topDst[((xMul2 - 1) * xStep)..]); |
|
|
|
YuvToBgr(topY[xMul2 - 0], (int)(uv1 & 0xff), (int)(uv1 >> 16), topDst[((xMul2 - 0) * xStep)..]); |
|
|
|
|
|
|
|
if (bottomY != default) |
|
|
|
if (!bottomY.IsEmpty) |
|
|
|
{ |
|
|
|
uv0 = (diag03 + luv) >> 1; |
|
|
|
uv1 = (diag12 + uv) >> 1; |
|
|
|
@ -85,7 +85,7 @@ internal static class YuvConversion |
|
|
|
{ |
|
|
|
uv0 = ((3 * tluv) + luv + 0x00020002u) >> 2; |
|
|
|
YuvToBgr(topY[len - 1], (int)(uv0 & 0xff), (int)(uv0 >> 16), topDst[((len - 1) * xStep)..]); |
|
|
|
if (bottomY != default) |
|
|
|
if (!bottomY.IsEmpty) |
|
|
|
{ |
|
|
|
uv0 = ((3 * luv) + tluv + 0x00020002u) >> 2; |
|
|
|
YuvToBgr(bottomY[len - 1], (int)(uv0 & 0xff), (int)(uv0 >> 16), bottomDst[((len - 1) * xStep)..]); |
|
|
|
@ -120,7 +120,7 @@ internal static class YuvConversion |
|
|
|
int u0t = (topU[0] + uDiag) >> 1; |
|
|
|
int v0t = (topV[0] + vDiag) >> 1; |
|
|
|
YuvToBgr(topY[0], u0t, v0t, topDst); |
|
|
|
if (bottomY != default) |
|
|
|
if (!bottomY.IsEmpty) |
|
|
|
{ |
|
|
|
int u0b = (curU[0] + uDiag) >> 1; |
|
|
|
int v0b = (curV[0] + vDiag) >> 1; |
|
|
|
@ -134,7 +134,7 @@ internal static class YuvConversion |
|
|
|
ref byte topVRef = ref MemoryMarshal.GetReference(topV); |
|
|
|
ref byte curURef = ref MemoryMarshal.GetReference(curU); |
|
|
|
ref byte curVRef = ref MemoryMarshal.GetReference(curV); |
|
|
|
if (bottomY != default) |
|
|
|
if (!bottomY.IsEmpty) |
|
|
|
{ |
|
|
|
for (pos = 1, uvPos = 0; pos + 32 + 1 <= len; pos += 32, uvPos += 16) |
|
|
|
{ |
|
|
|
@ -160,12 +160,12 @@ internal static class YuvConversion |
|
|
|
Span<byte> tmpTopDst = ru[(4 * 32)..]; |
|
|
|
Span<byte> tmpBottomDst = tmpTopDst[(4 * 32)..]; |
|
|
|
Span<byte> tmpTop = tmpBottomDst[(4 * 32)..]; |
|
|
|
Span<byte> tmpBottom = (bottomY == default) ? null : tmpTop[32..]; |
|
|
|
Span<byte> tmpBottom = bottomY.IsEmpty ? null : tmpTop[32..]; |
|
|
|
UpSampleLastBlock(topU[uvPos..], curU[uvPos..], leftOver, ru); |
|
|
|
UpSampleLastBlock(topV[uvPos..], curV[uvPos..], leftOver, rv); |
|
|
|
|
|
|
|
topY[pos..len].CopyTo(tmpTop); |
|
|
|
if (bottomY != default) |
|
|
|
if (!bottomY.IsEmpty) |
|
|
|
{ |
|
|
|
bottomY[pos..len].CopyTo(tmpBottom); |
|
|
|
ConvertYuvToBgrWithBottomYSse41(tmpTop, tmpBottom, tmpTopDst, tmpBottomDst, ru, rv, 0, xStep); |
|
|
|
@ -176,7 +176,7 @@ internal static class YuvConversion |
|
|
|
} |
|
|
|
|
|
|
|
tmpTopDst[..((len - pos) * xStep)].CopyTo(topDst[(pos * xStep)..]); |
|
|
|
if (bottomY != default) |
|
|
|
if (!bottomY.IsEmpty) |
|
|
|
{ |
|
|
|
tmpBottomDst[..((len - pos) * xStep)].CopyTo(bottomDst[(pos * xStep)..]); |
|
|
|
} |
|
|
|
|