shithub: openh264

Download patch

ref: 3091f00b9dbe2020351f6b6475f9aadc36908dd0
parent: d81f3d5037b7bf1e638377738e1b91803c4ea706
parent: 29ccdebad9531218eed4222ba29fe10054e69b4f
author: Licai Guo <licaguo@cisco.com>
date: Tue Feb 11 16:00:05 EST 2014

Merge pull request #280 from mstorsjo/d3d-plane-naming

Correct the plane naming within the D3D code

--- 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];
     }
   }