From 29ccdebad9531218eed4222ba29fe10054e69b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 11 Feb 2014 12:25:05 +0100 Subject: [PATCH] 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. --- codec/console/dec/src/d3d9_utils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codec/console/dec/src/d3d9_utils.cpp b/codec/console/dec/src/d3d9_utils.cpp index 1fb9caeb..95aeb4ae 100644 --- a/codec/console/dec/src/d3d9_utils.cpp +++ b/codec/console/dec/src/d3d9_utils.cpp @@ -492,13 +492,13 @@ HRESULT Dump2Surface (void* pDst[3], void* pSurface, int iWidth, int iHeight, in 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]; } }