[x265] [PATCH] cleanup transformNxN function

praveen at multicorewareinc.com praveen at multicorewareinc.com
Tue Jul 9 10:38:36 CEST 2013


# HG changeset patch
# User praveentiwari
# Date 1373359104 -19800
# Node ID 330843e6f7c09a0919e0fd6849a6afd384a148c7
# Parent  fabbfc41936d3be622b1f390f8fff3f576f95ce2
cleanup transformNxN function

diff -r fabbfc41936d -r 330843e6f7c0 source/Lib/TLibCommon/TComTrQuant.cpp
--- a/source/Lib/TLibCommon/TComTrQuant.cpp	Tue Jul 09 12:56:43 2013 +0530
+++ b/source/Lib/TLibCommon/TComTrQuant.cpp	Tue Jul 09 14:08:24 2013 +0530
@@ -906,61 +906,61 @@
     m_useTransformSkipFast = useTransformSkipFast;
 }
 
-Void TComTrQuant::transformNxN(TComDataCU* pcCU,
-                               Short*      pcResidual,
-                               UInt        uiStride,
+Void TComTrQuant::transformNxN(TComDataCU* CU,
+                               Short*      residual,
+                               UInt        stride,
                                TCoeff*     rpcCoeff,
                                Int*&       rpcArlCoeff,
-                               UInt        uiWidth,
-                               UInt        uiHeight,
-                               UInt&       uiAbsSum,
+                               UInt        width,
+                               UInt        height,
+                               UInt&       absSum,
                                TextType    eTType,
-                               UInt        uiAbsPartIdx,
+                               UInt        absPartIdx,
                                Bool        useTransformSkip
                                )
 {
-    if (pcCU->getCUTransquantBypass(uiAbsPartIdx))
+    if (CU->getCUTransquantBypass(absPartIdx))
     {
-        uiAbsSum = 0;
-        for (UInt k = 0; k < uiHeight; k++)
+        absSum = 0;
+        for (UInt k = 0; k < height; k++)
         {
-            for (UInt j = 0; j < uiWidth; j++)
+            for (UInt j = 0; j < width; j++)
             {
-                rpcCoeff[k * uiWidth + j] = ((Short)pcResidual[k * uiStride + j]);
-                uiAbsSum += abs(pcResidual[k * uiStride + j]);
+                rpcCoeff[k * width + j] = ((Short)residual[k * stride + j]);
+                absSum += abs(residual[k * stride + j]);
             }
         }
 
         return;
     }
     UInt uiMode; //luma intra pred
-    if (eTType == TEXT_LUMA && pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA)
+    if (eTType == TEXT_LUMA && CU->getPredictionMode(absPartIdx) == MODE_INTRA)
     {
-        uiMode = pcCU->getLumaIntraDir(uiAbsPartIdx);
+        uiMode = CU->getLumaIntraDir(absPartIdx);
     }
     else
     {
         uiMode = REG_DCT;
     }
 
-    uiAbsSum = 0;
-    assert((pcCU->getSlice()->getSPS()->getMaxTrSize() >= uiWidth));
+    absSum = 0;
+    assert((CU->getSlice()->getSPS()->getMaxTrSize() >= width));
     Int bitDepth = eTType == TEXT_LUMA ? g_bitDepthY : g_bitDepthC;
     if (useTransformSkip)
     {
-        xTransformSkip(bitDepth, pcResidual, uiStride, m_plTempCoeff, uiWidth, uiHeight);
+        xTransformSkip(bitDepth, residual, stride, m_plTempCoeff, width, height);
     }
     else
     {
         // CHECK_ME: we can't use Short when HIGH_BIT_DEPTH=1
         assert(bitDepth == 8);
 
-        const UInt uiLog2BlockSize = g_aucConvertToBit[uiWidth];
-        x265::primitives.dct[x265::DCT_4x4 + uiLog2BlockSize - ((uiWidth == 4) && (uiMode != REG_DCT))](pcResidual, m_plTempCoeff, uiStride);
+        const UInt uiLog2BlockSize = g_aucConvertToBit[width];
+        x265::primitives.dct[x265::DCT_4x4 + uiLog2BlockSize - ((width == 4) && (uiMode != REG_DCT))](residual, m_plTempCoeff, stride);
 
-        assert(uiWidth == uiHeight);
+        assert(width == height);
     }
-    xQuant(pcCU, m_plTempCoeff, rpcCoeff, rpcArlCoeff, uiWidth, uiHeight, uiAbsSum, eTType, uiAbsPartIdx);
+    xQuant(CU, m_plTempCoeff, rpcCoeff, rpcArlCoeff, width, height, absSum, eTType, absPartIdx);
 }
 
 Void TComTrQuant::invtransformNxN(Bool transQuantBypass, TextType eText, UInt uiMode, Short* rpcResidual, UInt uiStride, TCoeff*   pcCoeff, UInt uiWidth, UInt uiHeight,  Int scalingListType, Bool useTransformSkip)


More information about the x265-devel mailing list