<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 12, 2013 at 2:17 AM, Min Chen <span dir="ltr"><<a href="mailto:chenm003@163.com" target="_blank">chenm003@163.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Min Chen <<a href="mailto:chenm003@163.com">chenm003@163.com</a>><br>
# Date 1384244049 -28800<br>
# Node ID 8c731f8c71ff6f42718a80934433a154417caeec<br>
# Parent  1ca01c82609fbb173a665c31adf07c429806d4f1<br>
cleanup: hardcoded m_qtTempTComYuv[qtLayer].m_width to MAX_CU_SIZE<br></blockquote><div><br></div><div>neither of these apply cleanly</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
diff -r 1ca01c82609f -r 8c731f8c71ff source/Lib/TLibEncoder/TEncSearch.cpp<br>
--- a/source/Lib/TLibEncoder/TEncSearch.cpp     Mon Nov 11 15:46:00 2013 +0530<br>
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp     Tue Nov 12 16:14:09 2013 +0800<br>
@@ -436,7 +436,7 @@<br>
     TCoeff*  coeff          = m_qtTempCoeffY[qtLayer] + numCoeffPerInc * absPartIdx;<br>
<br>
     int16_t* reconQt        = m_qtTempTComYuv[qtLayer].getLumaAddr(absPartIdx);<br>
-    uint32_t reconQtStride  = m_qtTempTComYuv[qtLayer].m_width;<br>
+    assert(m_qtTempTComYuv[qtLayer].m_width == MAX_CU_SIZE);<br>
<br>
     uint32_t zorder           = cu->getZorderIdxInCU() + absPartIdx;<br>
     Pel*     reconIPred       = cu->getPic()->getPicYuvRec()->getLumaAddr(cu->getAddr(), zorder);<br>
@@ -502,7 +502,7 @@<br>
     }<br>
<br>
     //===== reconstruction =====<br>
-    primitives.calcrecon[size](pred, residual, recon, reconQt, reconIPred, stride, reconQtStride, reconIPredStride);<br>
+    primitives.calcrecon[size](pred, residual, recon, reconQt, reconIPred, stride, MAX_CU_SIZE, reconIPredStride);<br>
<br>
     //===== update distortion =====<br>
     outDist += primitives.sse_pp[part](fenc, stride, recon, stride);<br>
@@ -548,7 +548,7 @@<br>
     uint32_t numCoeffPerInc = (cu->getSlice()->getSPS()->getMaxCUWidth() * cu->getSlice()->getSPS()->getMaxCUHeight() >> (cu->getSlice()->getSPS()->getMaxCUDepth() << 1)) >> 2;<br>

     TCoeff*  coeff          = (chromaId > 0 ? m_qtTempCoeffCr[qtlayer] : m_qtTempCoeffCb[qtlayer]) + numCoeffPerInc * absPartIdx;<br>
     int16_t* reconQt        = (chromaId > 0 ? m_qtTempTComYuv[qtlayer].getCrAddr(absPartIdx) : m_qtTempTComYuv[qtlayer].getCbAddr(absPartIdx));<br>
-    uint32_t reconQtStride  = m_qtTempTComYuv[qtlayer].m_cwidth;<br>
+    assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE / 2);<br>
<br>
     uint32_t zorder           = cu->getZorderIdxInCU() + absPartIdx;<br>
     Pel*     reconIPred       = (chromaId > 0 ? cu->getPic()->getPicYuvRec()->getCrAddr(cu->getAddr(), zorder) : cu->getPic()->getPicYuvRec()->getCbAddr(cu->getAddr(), zorder));<br>
@@ -636,7 +636,7 @@<br>
     }<br>
<br>
     //===== reconstruction =====<br>
-    primitives.calcrecon[size](pred, residual, recon, reconQt, reconIPred, stride, reconQtStride, reconIPredStride);<br>
+    primitives.calcrecon[size](pred, residual, recon, reconQt, reconIPred, stride, MAX_CU_SIZE / 2, reconIPredStride);<br>
<br>
     //===== update distortion =====<br>
     uint32_t dist = primitives.sse_pp[part](fenc, stride, recon, stride);<br>
@@ -954,24 +954,24 @@<br>
         uint32_t qtLayer   = cu->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() - trSizeLog2;<br>
         uint32_t zorder    = cu->getZorderIdxInCU() + absPartIdx;<br>
         int16_t* src       = m_qtTempTComYuv[qtLayer].getLumaAddr(absPartIdx);<br>
-        uint32_t srcstride = m_qtTempTComYuv[qtLayer].m_width;<br>
+        assert(m_qtTempTComYuv[qtLayer].m_width == MAX_CU_SIZE);<br>
         Pel*     dst       = cu->getPic()->getPicYuvRec()->getLumaAddr(cu->getAddr(), zorder);<br>
         uint32_t dststride = cu->getPic()->getPicYuvRec()->getStride();<br>
-        primitives.blockcpy_ps(width, height, dst, dststride, src, srcstride);<br>
+        primitives.blockcpy_ps(width, height, dst, dststride, src, MAX_CU_SIZE);<br>
<br>
         if (!bLumaOnly)<br>
         {<br>
             width >>= 1;<br>
             height >>= 1;<br>
             src       = m_qtTempTComYuv[qtLayer].getCbAddr(absPartIdx);<br>
-            srcstride = m_qtTempTComYuv[qtLayer].m_cwidth;<br>
+            assert(m_qtTempTComYuv[qtLayer].m_cwidth == MAX_CU_SIZE / 2);<br>
             dst       = cu->getPic()->getPicYuvRec()->getCbAddr(cu->getAddr(), zorder);<br>
             dststride = cu->getPic()->getPicYuvRec()->getCStride();<br>
-            primitives.blockcpy_ps(width, height, dst, dststride, src, srcstride);<br>
+            primitives.blockcpy_ps(width, height, dst, dststride, src, MAX_CU_SIZE / 2);<br>
<br>
             src = m_qtTempTComYuv[qtLayer].getCrAddr(absPartIdx);<br>
             dst = cu->getPic()->getPicYuvRec()->getCrAddr(cu->getAddr(), zorder);<br>
-            primitives.blockcpy_ps(width, height, dst, dststride, src, srcstride);<br>
+            primitives.blockcpy_ps(width, height, dst, dststride, src, MAX_CU_SIZE / 2);<br>
         }<br>
     }<br>
<br>
@@ -1134,10 +1134,10 @@<br>
     Pel*   reconIPred       = cu->getPic()->getPicYuvRec()->getLumaAddr(cu->getAddr(), zOrder);<br>
     uint32_t   reconIPredStride = cu->getPic()->getPicYuvRec()->getStride();<br>
     int16_t* reconQt          = m_qtTempTComYuv[qtlayer].getLumaAddr(absPartIdx);<br>
-    uint32_t   reconQtStride    = m_qtTempTComYuv[qtlayer].m_width;<br>
+    assert(m_qtTempTComYuv[qtlayer].m_width == MAX_CU_SIZE);<br>
     uint32_t   width            = cu->getWidth(0) >> trDepth;<br>
     uint32_t   height           = cu->getHeight(0) >> trDepth;<br>
-    primitives.blockcpy_ps(width, height, reconIPred, reconIPredStride, reconQt, reconQtStride);<br>
+    primitives.blockcpy_ps(width, height, reconIPred, reconIPredStride, reconQt, MAX_CU_SIZE);<br>
<br>
     if (!bLumaOnly && !bSkipChroma)<br>
     {<br>
@@ -1146,12 +1146,12 @@<br>
         reconIPred = cu->getPic()->getPicYuvRec()->getCbAddr(cu->getAddr(), zOrder);<br>
         reconIPredStride = cu->getPic()->getPicYuvRec()->getCStride();<br>
         reconQt = m_qtTempTComYuv[qtlayer].getCbAddr(absPartIdx);<br>
-        reconQtStride = m_qtTempTComYuv[qtlayer].m_cwidth;<br>
-        primitives.blockcpy_ps(width, height, reconIPred, reconIPredStride, reconQt, reconQtStride);<br>
+        assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE / 2);<br>
+        primitives.blockcpy_ps(width, height, reconIPred, reconIPredStride, reconQt, MAX_CU_SIZE / 2);<br>
<br>
         reconIPred = cu->getPic()->getPicYuvRec()->getCrAddr(cu->getAddr(), zOrder);<br>
         reconQt    = m_qtTempTComYuv[qtlayer].getCrAddr(absPartIdx);<br>
-        primitives.blockcpy_ps(width, height, reconIPred, reconIPredStride, reconQt, reconQtStride);<br>
+        primitives.blockcpy_ps(width, height, reconIPred, reconIPredStride, reconQt, MAX_CU_SIZE / 2);<br>
     }<br>
 }<br>
<br>
@@ -1255,20 +1255,20 @@<br>
         uint32_t zorder           = cu->getZorderIdxInCU() + absPartIdx;<br>
         uint32_t width            = cu->getWidth(0) >> (trDepth + 1);<br>
         uint32_t height           = cu->getHeight(0) >> (trDepth + 1);<br>
-        uint32_t reconQtStride    = m_qtTempTComYuv[qtlayer].m_cwidth;<br>
+        assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE / 2);<br>
         uint32_t reconIPredStride = cu->getPic()->getPicYuvRec()->getCStride();<br>
<br>
         if (stateU0V1Both2 == 0 || stateU0V1Both2 == 2)<br>
         {<br>
             Pel* reconIPred = cu->getPic()->getPicYuvRec()->getCbAddr(cu->getAddr(), zorder);<br>
             int16_t* reconQt  = m_qtTempTComYuv[qtlayer].getCbAddr(absPartIdx);<br>
-            primitives.blockcpy_ps(width, height, reconIPred, reconIPredStride, reconQt, reconQtStride);<br>
+            primitives.blockcpy_ps(width, height, reconIPred, reconIPredStride, reconQt, MAX_CU_SIZE / 2);<br>
         }<br>
         if (stateU0V1Both2 == 1 || stateU0V1Both2 == 2)<br>
         {<br>
             Pel* reconIPred = cu->getPic()->getPicYuvRec()->getCrAddr(cu->getAddr(), zorder);<br>
             int16_t* reconQt  = m_qtTempTComYuv[qtlayer].getCrAddr(absPartIdx);<br>
-            primitives.blockcpy_ps(width, height, reconIPred, reconIPredStride, reconQt, reconQtStride);<br>
+            primitives.blockcpy_ps(width, height, reconIPred, reconIPredStride, reconQt, MAX_CU_SIZE / 2);<br>
         }<br>
     }<br>
 }<br>
@@ -3182,10 +3182,10 @@<br>
<br>
             int scalingListType = 3 + g_eTTable[(int)TEXT_LUMA];<br>
             assert(scalingListType < 6);<br>
-            m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, curResiY, m_qtTempTComYuv[qtlayer].m_width,  coeffCurY, trWidth, trHeight, scalingListType, false, lastPosY); //this is for inter mode only<br>

-<br>
-            const uint32_t nonZeroDistY = primitives.sse_ss[partSize](resiYuv->getLumaAddr(absTUPartIdx), resiYuv->m_width, m_qtTempTComYuv[qtlayer].getLumaAddr(absTUPartIdx),<br>
-                                                                      m_qtTempTComYuv[qtlayer].m_width);<br>
+            assert(m_qtTempTComYuv[qtlayer].m_width == MAX_CU_SIZE);<br>
+            m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, curResiY, MAX_CU_SIZE,  coeffCurY, trWidth, trHeight, scalingListType, false, lastPosY); //this is for inter mode only<br>
+<br>
+            const uint32_t nonZeroDistY = primitives.sse_ss[partSize](resiYuv->getLumaAddr(absTUPartIdx), resiYuv->m_width, m_qtTempTComYuv[qtlayer].getLumaAddr(absTUPartIdx), MAX_CU_SIZE);<br>
             if (cu->isLosslessCoded(0))<br>
             {<br>
                 distY = nonZeroDistY;<br>
@@ -3227,10 +3227,10 @@<br>
         if (!absSumY)<br>
         {<br>
             int16_t *ptr =  m_qtTempTComYuv[qtlayer].getLumaAddr(absTUPartIdx);<br>
-            const uint32_t stride = m_qtTempTComYuv[qtlayer].m_width;<br>
+            assert(m_qtTempTComYuv[qtlayer].m_width == MAX_CU_SIZE);<br>
<br>
             assert(trWidth == trHeight);<br>
-            primitives.blockfill_s[(int)g_convertToBit[trWidth]](ptr, stride, 0);<br>
+            primitives.blockfill_s[(int)g_convertToBit[trWidth]](ptr, MAX_CU_SIZE, 0);<br>
         }<br>
<br>
         uint32_t distU = 0;<br>
@@ -3254,11 +3254,12 @@<br>
<br>
                 int scalingListType = 3 + g_eTTable[(int)TEXT_CHROMA_U];<br>
                 assert(scalingListType < 6);<br>
-                m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, pcResiCurrU, m_qtTempTComYuv[qtlayer].m_cwidth, coeffCurU, trWidthC, trHeightC, scalingListType, false, lastPosU);<br>
+                assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE / 2);<br>
+                m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, pcResiCurrU, MAX_CU_SIZE / 2, coeffCurU, trWidthC, trHeightC, scalingListType, false, lastPosU);<br>
<br>
                 uint32_t dist = primitives.sse_ss[partSizeC](resiYuv->getCbAddr(absTUPartIdxC), resiYuv->m_cwidth,<br>
                                                              m_qtTempTComYuv[qtlayer].getCbAddr(absTUPartIdxC),<br>
-                                                             m_qtTempTComYuv[qtlayer].m_cwidth);<br>
+                                                             MAX_CU_SIZE / 2);<br>
                 const uint32_t nonZeroDistU = m_rdCost->scaleChromaDistCb(dist);<br>
<br>
                 if (cu->isLosslessCoded(0))<br>
@@ -3301,10 +3302,10 @@<br>
             if (!absSumU)<br>
             {<br>
                 int16_t *ptr = m_qtTempTComYuv[qtlayer].getCbAddr(absTUPartIdxC);<br>
-                const uint32_t stride = m_qtTempTComYuv[qtlayer].m_cwidth;<br>
+                assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE / 2);<br>
<br>
                 assert(trWidthC == trHeightC);<br>
-                primitives.blockfill_s[(int)g_convertToBit[trWidthC]](ptr, stride, 0);<br>
+                primitives.blockfill_s[(int)g_convertToBit[trWidthC]](ptr, MAX_CU_SIZE / 2, 0);<br>
             }<br>
<br>
             distV = m_rdCost->scaleChromaDistCr(primitives.sse_sp[partSizeC](resiYuv->getCrAddr(absTUPartIdxC), resiYuv->m_cwidth, m_tempPel, trWidthC));<br>
@@ -3320,11 +3321,12 @@<br>
<br>
                 int scalingListType = 3 + g_eTTable[(int)TEXT_CHROMA_V];<br>
                 assert(scalingListType < 6);<br>
-                m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, curResiV, m_qtTempTComYuv[qtlayer].m_cwidth, coeffCurV, trWidthC, trHeightC, scalingListType, false, lastPosV);<br>
+                assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE / 2);<br>
+                m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, curResiV, MAX_CU_SIZE / 2, coeffCurV, trWidthC, trHeightC, scalingListType, false, lastPosV);<br>
<br>
                 uint32_t dist = primitives.sse_ss[partSizeC](resiYuv->getCrAddr(absTUPartIdxC), resiYuv->m_cwidth,<br>
                                                              m_qtTempTComYuv[qtlayer].getCrAddr(absTUPartIdxC),<br>
-                                                             m_qtTempTComYuv[qtlayer].m_cwidth);<br>
+                                                             MAX_CU_SIZE / 2);<br>
                 const uint32_t nonZeroDistV = m_rdCost->scaleChromaDistCr(dist);<br>
<br>
                 if (cu->isLosslessCoded(0))<br>
@@ -3367,10 +3369,10 @@<br>
             if (!absSumV)<br>
             {<br>
                 int16_t *ptr =  m_qtTempTComYuv[qtlayer].getCrAddr(absTUPartIdxC);<br>
-                const uint32_t stride = m_qtTempTComYuv[qtlayer].m_cwidth;<br>
+                assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE / 2);<br>
<br>
                 assert(trWidthC == trHeightC);<br>
-                primitives.blockfill_s[(int)g_convertToBit[trWidthC]](ptr, stride, 0);<br>
+                primitives.blockfill_s[(int)g_convertToBit[trWidthC]](ptr, MAX_CU_SIZE / 2, 0);<br>
             }<br>
         }<br>
         cu->setCbfSubParts(absSumY ? setCbf : 0, TEXT_LUMA, absPartIdx, depth);<br>
@@ -3387,7 +3389,7 @@<br>
             UInt64 singleCostY = MAX_INT64;<br>
<br>
             int16_t *curResiY = m_qtTempTComYuv[qtlayer].getLumaAddr(absTUPartIdx);<br>
-            uint32_t resiStride = m_qtTempTComYuv[qtlayer].m_width;<br>
+            assert(m_qtTempTComYuv[qtlayer].m_width == MAX_CU_SIZE);<br>
<br>
             TCoeff bestCoeffY[32 * 32];<br>
             memcpy(bestCoeffY, coeffCurY, sizeof(TCoeff) * numSamplesLuma);<br>
@@ -3395,7 +3397,7 @@<br>
             int16_t bestResiY[32 * 32];<br>
             for (int i = 0; i < trHeight; ++i)<br>
             {<br>
-                memcpy(bestResiY + i * trWidth, curResiY + i * resiStride, sizeof(int16_t) * trWidth);<br>
+                memcpy(bestResiY + i * trWidth, curResiY + i * MAX_CU_SIZE, sizeof(int16_t) * trWidth);<br>
             }<br>
<br>
             m_rdGoOnSbacCoder->load(m_rdSbacCoders[depth][CI_QT_TRAFO_ROOT]);<br>
@@ -3425,12 +3427,13 @@<br>
<br>
                 int scalingListType = 3 + g_eTTable[(int)TEXT_LUMA];<br>
                 assert(scalingListType < 6);<br>
-<br>
-                m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, curResiY, m_qtTempTComYuv[qtlayer].m_width,  coeffCurY, trWidth, trHeight, scalingListType, true, lastPosTransformSkipY);<br>

+                assert(m_qtTempTComYuv[qtlayer].m_width == MAX_CU_SIZE);<br>
+<br>
+                m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, curResiY, MAX_CU_SIZE,  coeffCurY, trWidth, trHeight, scalingListType, true, lastPosTransformSkipY);<br>
<br>
                 nonZeroDistY = primitives.sse_ss[partSize](resiYuv->getLumaAddr(absTUPartIdx), resiYuv->m_width,<br>
                                                            m_qtTempTComYuv[qtlayer].getLumaAddr(absTUPartIdx),<br>
-                                                           m_qtTempTComYuv[qtlayer].m_width);<br>
+                                                           MAX_CU_SIZE);<br>
<br>
                 singleCostY = m_rdCost->calcRdCost(nonZeroDistY, skipSingleBitsY);<br>
             }<br>
@@ -3441,7 +3444,7 @@<br>
                 memcpy(coeffCurY, bestCoeffY, sizeof(TCoeff) * numSamplesLuma);<br>
                 for (int i = 0; i < trHeight; ++i)<br>
                 {<br>
-                    memcpy(curResiY + i * resiStride, &bestResiY[i * trWidth], sizeof(int16_t) * trWidth);<br>
+                    memcpy(curResiY + i * MAX_CU_SIZE, &bestResiY[i * trWidth], sizeof(int16_t) * trWidth);<br>
                 }<br>
             }<br>
             else<br>
@@ -3463,7 +3466,7 @@<br>
<br>
             int16_t *curResiU = m_qtTempTComYuv[qtlayer].getCbAddr(absTUPartIdxC);<br>
             int16_t *curResiV = m_qtTempTComYuv[qtlayer].getCrAddr(absTUPartIdxC);<br>
-            uint32_t stride = m_qtTempTComYuv[qtlayer].m_cwidth;<br>
+            assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE / 2);<br>
<br>
             TCoeff bestCoeffU[32 * 32], bestCoeffV[32 * 32];<br>
             memcpy(bestCoeffU, coeffCurU, sizeof(TCoeff) * numSamplesChroma);<br>
@@ -3472,8 +3475,8 @@<br>
             int16_t bestResiU[32 * 32], bestResiV[32 * 32];<br>
             for (int i = 0; i < trHeightC; ++i)<br>
             {<br>
-                memcpy(&bestResiU[i * trWidthC], curResiU + i * stride, sizeof(int16_t) * trWidthC);<br>
-                memcpy(&bestResiV[i * trWidthC], curResiV + i * stride, sizeof(int16_t) * trWidthC);<br>
+                memcpy(&bestResiU[i * trWidthC], curResiU + i * (MAX_CU_SIZE / 2), sizeof(int16_t) * trWidthC);<br>
+                memcpy(&bestResiV[i * trWidthC], curResiV + i * (MAX_CU_SIZE / 2), sizeof(int16_t) * trWidthC);<br>
             }<br>
<br>
             m_rdGoOnSbacCoder->load(m_rdSbacCoders[depth][CI_QT_TRAFO_ROOT]);<br>
@@ -3515,12 +3518,13 @@<br>
<br>
                 int scalingListType = 3 + g_eTTable[(int)TEXT_CHROMA_U];<br>
                 assert(scalingListType < 6);<br>
-<br>
-                m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, curResiU, m_qtTempTComYuv[qtlayer].m_cwidth, coeffCurU, trWidthC, trHeightC, scalingListType, true, lastPosTransformSkipU);<br>

+                assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE / 2);<br>
+<br>
+                m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, curResiU, MAX_CU_SIZE / 2, coeffCurU, trWidthC, trHeightC, scalingListType, true, lastPosTransformSkipU);<br>
<br>
                 uint32_t dist = primitives.sse_ss[partSizeC](resiYuv->getCbAddr(absTUPartIdxC), resiYuv->m_cwidth,<br>
                                                              m_qtTempTComYuv[qtlayer].getCbAddr(absTUPartIdxC),<br>
-                                                             m_qtTempTComYuv[qtlayer].m_cwidth);<br>
+                                                             MAX_CU_SIZE / 2);<br>
                 nonZeroDistU = m_rdCost->scaleChromaDistCb(dist);<br>
                 singleCostU = m_rdCost->calcRdCost(nonZeroDistU, singleBitsU);<br>
             }<br>
@@ -3532,7 +3536,7 @@<br>
                 memcpy(coeffCurU, bestCoeffU, sizeof(TCoeff) * numSamplesChroma);<br>
                 for (int i = 0; i < trHeightC; ++i)<br>
                 {<br>
-                    memcpy(curResiU + i * stride, &bestResiU[i * trWidthC], sizeof(int16_t) * trWidthC);<br>
+                    memcpy(curResiU + i * (MAX_CU_SIZE / 2), &bestResiU[i * trWidthC], sizeof(int16_t) * trWidthC);<br>
                 }<br>
             }<br>
             else<br>
@@ -3553,12 +3557,13 @@<br>
<br>
                 int scalingListType = 3 + g_eTTable[(int)TEXT_CHROMA_V];<br>
                 assert(scalingListType < 6);<br>
-<br>
-                m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, curResiV, m_qtTempTComYuv[qtlayer].m_cwidth, coeffCurV, trWidthC, trHeightC, scalingListType, true, lastPosTransformSkipV);<br>

+                assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE / 2);<br>
+<br>
+                m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT, curResiV, MAX_CU_SIZE / 2, coeffCurV, trWidthC, trHeightC, scalingListType, true, lastPosTransformSkipV);<br>
<br>
                 uint32_t dist = primitives.sse_ss[partSizeC](resiYuv->getCrAddr(absTUPartIdxC), resiYuv->m_cwidth,<br>
                                                              m_qtTempTComYuv[qtlayer].getCrAddr(absTUPartIdxC),<br>
-                                                             m_qtTempTComYuv[qtlayer].m_cwidth);<br>
+                                                             MAX_CU_SIZE / 2);<br>
                 nonZeroDistV = m_rdCost->scaleChromaDistCr(dist);<br>
                 singleCostV = m_rdCost->calcRdCost(nonZeroDistV, singleBitsV);<br>
             }<br>
@@ -3570,7 +3575,7 @@<br>
                 memcpy(coeffCurV, bestCoeffV, sizeof(TCoeff) * numSamplesChroma);<br>
                 for (int i = 0; i < trHeightC; ++i)<br>
                 {<br>
-                    memcpy(curResiV + i * stride, &bestResiV[i * trWidthC], sizeof(int16_t) * trWidthC);<br>
+                    memcpy(curResiV + i * (MAX_CU_SIZE / 2), &bestResiV[i * trWidthC], sizeof(int16_t) * trWidthC);<br>
                 }<br>
             }<br>
             else<br>
diff -r 1ca01c82609f -r 8c731f8c71ff source/common/TShortYUV.cpp<br>
--- a/source/common/TShortYUV.cpp       Mon Nov 11 15:46:00 2013 +0530<br>
+++ b/source/common/TShortYUV.cpp       Tue Nov 12 16:14:09 2013 +0800<br>
@@ -123,10 +123,6 @@<br>
     addClipChroma(srcYuv0, srcYuv1, trUnitIdx, partSize >> m_hChromaShift);<br>
 }<br>
<br>
-#if _MSC_VER<br>
-#pragma warning (disable: 4244)<br>
-#endif<br>
-<br>
 void TShortYUV::addClipLuma(TShortYUV* srcYuv0, TShortYUV* srcYuv1, unsigned int trUnitIdx, unsigned int partSize)<br>
 {<br>
     int16_t* src0 = srcYuv0->getLumaAddr(trUnitIdx, partSize);<br>
<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Steve Borho
</div></div>