ref: 29ccdebad9531218eed4222ba29fe10054e69b4f
parent: d81f3d5037b7bf1e638377738e1b91803c4ea706
author: Martin Storsjö <martin@martin.st>
date: Tue Feb 11 07:25:05 EST 2014
Correct the plane naming within the D3D code Within I420 (as the decoder outputs), the first chroma plane is U and the second is V, and similarly, in NV12, the chroma components are written in the order U, V. This doesn't have any practical effect, it only makes the variable naming while it previously was misleading.
--- a/codec/console/dec/src/d3d9_utils.cpp
+++ b/codec/console/dec/src/d3d9_utils.cpp
@@ -492,13 +492,13 @@
for (int j = 0; j < iHeight; j++)
memcpy (pOutY + j * iOutStride, pInY + j * iStride[0], iWidth); //confirmed_safe_unsafe_usage
- unsigned char* pInV = (unsigned char*)pDst[1];
- unsigned char* pInU = (unsigned char*)pDst[2];
+ unsigned char* pInU = (unsigned char*)pDst[1];
+ unsigned char* pInV = (unsigned char*)pDst[2];
unsigned char* pOutC = pOutY + iOutStride * iHeight;
for (int i = 0; i < iHeight / 2; i++) {
for (int j = 0; j < iWidth; j += 2) {
- pOutC[i * iOutStride + j ] = pInV[i * iStride[1] + j / 2];
- pOutC[i * iOutStride + j + 1] = pInU[i * iStride[1] + j / 2];
+ pOutC[i * iOutStride + j ] = pInU[i * iStride[1] + j / 2];
+ pOutC[i * iOutStride + j + 1] = pInV[i * iStride[1] + j / 2];
}
}