[x265] [PATCH] TShortYUV : Removed Get*() Method and Moved Member variables private to Public
gopu at multicorewareinc.com
gopu at multicorewareinc.com
Fri Jul 5 10:30:30 CEST 2013
# HG changeset patch
# User ggopu
# Date 1373013013 -19800
# Node ID 32e74af300c2f7099ae7168110dee114037f79df
# Parent 133b907bb8eeaae5a2486dbca6631fedce87c823
TShortYUV : Removed Get*() Method and Moved Member variables private to Public
diff -r 133b907bb8ee -r 32e74af300c2 source/Lib/TLibCommon/TComPrediction.cpp
--- a/source/Lib/TLibCommon/TComPrediction.cpp Wed Jul 03 17:35:55 2013 +0530
+++ b/source/Lib/TLibCommon/TComPrediction.cpp Fri Jul 05 14:00:13 2013 +0530
@@ -62,8 +62,7 @@
, m_piPredAngBufs(NULL)
, m_pLumaRecBuffer(0)
, m_iLumaRecStride(0)
-{
-}
+{}
TComPrediction::~TComPrediction()
{
@@ -379,14 +378,14 @@
// Create the prediction
Pel refAbv[3 * MAX_CU_SIZE];
Pel refLft[3 * MAX_CU_SIZE];
- int limit = (uiDirMode <= 25 && uiDirMode >= 11) ? (iWidth + 1) : (2*iWidth+1);
+ int limit = (uiDirMode <= 25 && uiDirMode >= 11) ? (iWidth + 1) : (2 * iWidth + 1);
memcpy(refAbv + iWidth - 1, ptrSrc, (limit) * sizeof(Pel));
for (int k = 0; k < limit; k++)
{
refLft[k + iWidth - 1] = ptrSrc[k * sw];
}
- primitives.getIPredAng(g_bitDepthC, (pixel*)pDst, uiStride, iWidth, uiDirMode, false, (pixel*)refLft + iWidth -1, (pixel*)refAbv + iWidth -1);
+ primitives.getIPredAng(g_bitDepthC, (pixel*)pDst, uiStride, iWidth, uiDirMode, false, (pixel*)refLft + iWidth - 1, (pixel*)refAbv + iWidth - 1);
}
}
@@ -416,7 +415,7 @@
Int iWidth;
Int iHeight;
UInt uiPartAddr;
-
+
if (iPartIdx >= 0)
{
pcCU->getPartIndexAndSize(iPartIdx, uiPartAddr, iWidth, iHeight);
@@ -478,10 +477,9 @@
}
}
-
Void TComPrediction::xPredInterUni(TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi)
{
- assert (bi == false);
+ assert(bi == false);
Int iRefIdx = pcCU->getCUMvField(eRefPicList)->getRefIdx(uiPartAddr);
assert(iRefIdx >= 0);
@@ -494,7 +492,7 @@
Void TComPrediction::xPredInterUni(TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TShortYUV*& rpcYuvPred, Bool bi)
{
- assert (bi == true);
+ assert(bi == true);
Int iRefIdx = pcCU->getCUMvField(eRefPicList)->getRefIdx(uiPartAddr);
@@ -521,8 +519,9 @@
assert(iRefIdx[iRefList] < pcCU->getSlice()->getNumRefIdx(eRefPicList));
pcMbYuv = &m_acShortPred[iRefList];
- xPredInterUni(pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, true);
+ xPredInterUni(pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, true);
}
+
if (pcCU->getSlice()->getPPS()->getWPBiPred() && pcCU->getSlice()->getSliceType() == B_SLICE)
{
xWeightedPredictionBi(pcCU, &m_acShortPred[0], &m_acShortPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred);
@@ -548,8 +547,9 @@
assert(iRefIdx[iRefList] < pcCU->getSlice()->getNumRefIdx(eRefPicList));
pcMbYuv = &m_acShortPred[iRefList];
- xPredInterUni(pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, true);
+ xPredInterUni(pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, true);
}
+
xWeightedPredictionBi(pcCU, &m_acShortPred[0], &m_acShortPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred);
}
else if (pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType() == P_SLICE)
@@ -568,8 +568,9 @@
assert(iRefIdx[iRefList] < pcCU->getSlice()->getNumRefIdx(eRefPicList));
pcMbYuv = &m_acShortPred[iRefList];
- xPredInterUni(pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, true);
+ xPredInterUni(pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, true);
}
+
xWeightedPredictionUni(pcCU, &m_acShortPred[0], uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, rpcYuvPred);
}
else
@@ -588,8 +589,9 @@
assert(iRefIdx[iRefList] < pcCU->getSlice()->getNumRefIdx(eRefPicList));
pcMbYuv = &m_acYuvPred[iRefList];
- xPredInterUni(pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv);
+ xPredInterUni(pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv);
}
+
xWeightedAverage(&m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred);
}
}
@@ -607,7 +609,7 @@
* \param bi Flag indicating whether bipred is used
*/
Void TComPrediction::xPredInterLumaBlk(TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, MV *mv, Int width, Int height, TComYuv *&dstPic, Bool bi)
-{
+{
assert(bi == false);
Int refStride = refPic->getStride();
@@ -635,7 +637,7 @@
Int refOffset = (mv->x >> 2) + (mv->y >> 2) * refStride;
Pel *ref = refPic->getLumaAddr(cu->getAddr(), cu->getZorderIdxInCU() + partAddr) + refOffset;
- Int dstStride = dstPic->getStride();
+ Int dstStride = dstPic->width;
Short *dst = dstPic->getLumaAddr(partAddr);
Int xFrac = mv->x & 0x3;
@@ -646,18 +648,18 @@
if (yFrac == 0)
{
- if(xFrac==0)
+ if (xFrac == 0)
{
- x265::primitives.ipfilterConvert_p_s(g_bitDepthY, (pixel*)ref , refStride, dst, dstStride, width, height);
+ x265::primitives.ipfilterConvert_p_s(g_bitDepthY, (pixel*)ref, refStride, dst, dstStride, width, height);
}
else
{
- x265::primitives.ipFilter_p_s[FILTER_H_P_S_8](g_bitDepthY, (pixel*)ref , refStride, dst, dstStride, width, height, TComInterpolationFilter::m_lumaFilter[xFrac]);
+ x265::primitives.ipFilter_p_s[FILTER_H_P_S_8](g_bitDepthY, (pixel*)ref, refStride, dst, dstStride, width, height, TComInterpolationFilter::m_lumaFilter[xFrac]);
}
}
else if (xFrac == 0)
{
- x265::primitives.ipFilter_p_s[FILTER_V_P_S_8](g_bitDepthY, (pixel*)ref , refStride, dst, dstStride, width, height, TComInterpolationFilter::m_lumaFilter[yFrac]);
+ x265::primitives.ipFilter_p_s[FILTER_V_P_S_8](g_bitDepthY, (pixel*)ref, refStride, dst, dstStride, width, height, TComInterpolationFilter::m_lumaFilter[yFrac]);
}
else
{
@@ -666,8 +668,8 @@
Int halfFilterSize = (filterSize >> 1);
Short *tmp = (Short*)xMalloc(Short, width * (height + filterSize - 1));
- x265::primitives.ipFilter_p_s[FILTER_H_P_S_8](g_bitDepthY, (pixel*)(ref - (halfFilterSize - 1) * refStride) , refStride, tmp, tmpStride, width, height + filterSize - 1, TComInterpolationFilter::m_lumaFilter[xFrac]);
- x265::primitives.ipFilter_s_s[FILTER_V_S_S_8](g_bitDepthY, tmp + (halfFilterSize - 1) * tmpStride ,tmpStride, dst, dstStride, width, height, TComInterpolationFilter::m_lumaFilter[yFrac]);
+ x265::primitives.ipFilter_p_s[FILTER_H_P_S_8](g_bitDepthY, (pixel*)(ref - (halfFilterSize - 1) * refStride), refStride, tmp, tmpStride, width, height + filterSize - 1, TComInterpolationFilter::m_lumaFilter[xFrac]);
+ x265::primitives.ipFilter_s_s[FILTER_V_S_S_8](g_bitDepthY, tmp + (halfFilterSize - 1) * tmpStride, tmpStride, dst, dstStride, width, height, TComInterpolationFilter::m_lumaFilter[yFrac]);
xFree(tmp);
}
@@ -745,10 +747,10 @@
//Generate motion compensated block when biprediction
Void TComPrediction::xPredInterChromaBlk(TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, MV *mv, Int width, Int height, TShortYUV *&dstPic, Bool bi)
{
- assert (bi==true);
+ assert(bi == true);
Int refStride = refPic->getCStride();
- Int dstStride = dstPic->getCStride();
+ Int dstStride = dstPic->Cwidth;
Int refOffset = (mv->x >> 3) + (mv->y >> 3) * refStride;
@@ -769,15 +771,15 @@
if (yFrac == 0)
{
- if(xFrac==0)
+ if (xFrac == 0)
{
- x265::primitives.ipfilterConvert_p_s(g_bitDepthC, (pixel*)refCb , refStride, dstCb, dstStride, cxWidth, cxHeight);
- x265::primitives.ipfilterConvert_p_s(g_bitDepthC, (pixel*)refCr , refStride, dstCr, dstStride, cxWidth, cxHeight);
+ x265::primitives.ipfilterConvert_p_s(g_bitDepthC, (pixel*)refCb, refStride, dstCb, dstStride, cxWidth, cxHeight);
+ x265::primitives.ipfilterConvert_p_s(g_bitDepthC, (pixel*)refCr, refStride, dstCr, dstStride, cxWidth, cxHeight);
}
else
{
- x265::primitives.ipFilter_p_s[FILTER_H_P_S_4](g_bitDepthC, (pixel*)refCb , refStride, dstCb, dstStride, cxWidth, cxHeight, TComInterpolationFilter::m_chromaFilter[xFrac]);
- x265::primitives.ipFilter_p_s[FILTER_H_P_S_4](g_bitDepthC, (pixel*)refCr , refStride, dstCr, dstStride, cxWidth, cxHeight, TComInterpolationFilter::m_chromaFilter[xFrac]);
+ x265::primitives.ipFilter_p_s[FILTER_H_P_S_4](g_bitDepthC, (pixel*)refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, TComInterpolationFilter::m_chromaFilter[xFrac]);
+ x265::primitives.ipFilter_p_s[FILTER_H_P_S_4](g_bitDepthC, (pixel*)refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, TComInterpolationFilter::m_chromaFilter[xFrac]);
}
}
else if (xFrac == 0)
diff -r 133b907bb8ee -r 32e74af300c2 source/Lib/TLibCommon/TComWeightPrediction.cpp
--- a/source/Lib/TLibCommon/TComWeightPrediction.cpp Wed Jul 03 17:35:55 2013 +0530
+++ b/source/Lib/TLibCommon/TComWeightPrediction.cpp Fri Jul 05 14:00:13 2013 +0530
@@ -60,7 +60,6 @@
return ClipC(((w0 * (P0 + IF_INTERNAL_OFFS) + round) >> shift) + offset);
}
-
// ====================================================================================================================
// Class definition
// ====================================================================================================================
@@ -216,8 +215,8 @@
Int round = shift ? (1 << (shift - 1)) * bRound : 0;
Int w1 = wp1[0].w;
- UInt iSrc0Stride = pcYuvSrc0->getStride();
- UInt iSrc1Stride = pcYuvSrc1->getStride();
+ UInt iSrc0Stride = pcYuvSrc0->width;
+ UInt iSrc1Stride = pcYuvSrc1->width;
UInt iDstStride = rpcYuvDst->getStride();
for (y = iHeight - 1; y >= 0; y--)
@@ -248,8 +247,8 @@
round = shift ? (1 << (shift - 1)) : 0;
w1 = wp1[1].w;
- iSrc0Stride = pcYuvSrc0->getCStride();
- iSrc1Stride = pcYuvSrc1->getCStride();
+ iSrc0Stride = pcYuvSrc0->Cwidth;
+ iSrc1Stride = pcYuvSrc1->Cwidth;
iDstStride = rpcYuvDst->getCStride();
iWidth >>= 1;
@@ -295,7 +294,6 @@
}
}
-
/** weighted averaging for uni-pred
* \param TComYuv* pcYuvSrc0
* \param iPartUnitIdx
@@ -422,7 +420,7 @@
Int shiftNum = IF_INTERNAL_PREC - g_bitDepthY;
Int shift = wp0[0].shift + shiftNum;
Int round = shift ? (1 << (shift - 1)) : 0;
- UInt iSrc0Stride = pcYuvSrc0->getStride();
+ UInt iSrc0Stride = pcYuvSrc0->width;
UInt iDstStride = rpcYuvDst->getStride();
for (y = iHeight - 1; y >= 0; y--)
@@ -451,7 +449,7 @@
shift = wp0[1].shift + shiftNum;
round = shift ? (1 << (shift - 1)) : 0;
- iSrc0Stride = pcYuvSrc0->getCStride();
+ iSrc0Stride = pcYuvSrc0->Cwidth;
iDstStride = rpcYuvDst->getCStride();
iWidth >>= 1;
@@ -683,7 +681,6 @@
addWeightUni(pcYuvSrc, uiPartAddr, iWidth, iHeight, pwp, rpcYuvPred);
}
-
/** weighted prediction for uni-pred
* \param TComDataCU* pcCU
* \param TShortYuv* pcYuvSrc
diff -r 133b907bb8ee -r 32e74af300c2 source/Lib/TLibCommon/TComYuv.cpp
--- a/source/Lib/TLibCommon/TComYuv.cpp Wed Jul 03 17:35:55 2013 +0530
+++ b/source/Lib/TLibCommon/TComYuv.cpp Fri Jul 05 14:00:13 2013 +0530
@@ -268,7 +268,7 @@
Short* pDst = pcYuvDst->getLumaAddr(uiPartIdx);
UInt iSrcStride = getStride();
- UInt iDstStride = pcYuvDst->getStride();
+ UInt iDstStride = pcYuvDst->width;
x265::primitives.cpyblock_s_p(iWidth, iHeight, pDst, iDstStride, (pixel*)pSrc, iSrcStride);
}
@@ -302,7 +302,7 @@
Short* pDstV = pcYuvDst->getCrAddr(uiPartIdx);
UInt iSrcStride = getCStride();
- UInt iDstStride = pcYuvDst->getCStride();
+ UInt iDstStride = pcYuvDst->Cwidth;
x265::primitives.cpyblock_s_p(iWidth, iHeight, pDstU, iDstStride, (pixel*)pSrcU, iSrcStride);
x265::primitives.cpyblock_s_p(iWidth, iHeight, pDstV, iDstStride, (pixel*)pSrcV, iSrcStride);
@@ -362,7 +362,7 @@
Short* pDstU = pcYuvDst->getCbAddr(uiPartIdx);
UInt iSrcStride = getCStride();
- UInt iDstStride = pcYuvDst->getCStride();
+ UInt iDstStride = pcYuvDst->Cwidth;
x265::primitives.cpyblock_s_p(iWidth, iHeight, pDstU, iDstStride, (pixel*)pSrcU, iSrcStride);
}
@@ -372,7 +372,7 @@
Short* pDstV = pcYuvDst->getCrAddr(uiPartIdx);
UInt iSrcStride = getCStride();
- UInt iDstStride = pcYuvDst->getCStride();
+ UInt iDstStride = pcYuvDst->Cwidth;
x265::primitives.cpyblock_s_p(iWidth, iHeight, pDstV, iDstStride, (pixel*)pSrcV, iSrcStride);
}
@@ -384,7 +384,7 @@
Short* pDstV = pcYuvDst->getCrAddr(uiPartIdx);
UInt iSrcStride = getCStride();
- UInt iDstStride = pcYuvDst->getCStride();
+ UInt iDstStride = pcYuvDst->Cwidth;
x265::primitives.cpyblock_s_p(iWidth, iHeight, pDstU, iDstStride, (pixel*)pSrcU, iSrcStride);
x265::primitives.cpyblock_s_p(iWidth, iHeight, pDstV, iDstStride, (pixel*)pSrcV, iSrcStride);
@@ -437,7 +437,7 @@
Pel* pDst = getLumaAddr(uiTrUnitIdx, uiPartSize);
UInt iSrc0Stride = pcYuvSrc0->getStride();
- UInt iSrc1Stride = pcYuvSrc1->getStride();
+ UInt iSrc1Stride = pcYuvSrc1->width;
UInt iDstStride = getStride();
for (y = uiPartSize - 1; y >= 0; y--)
@@ -497,7 +497,7 @@
Pel* pDstV = getCrAddr(uiTrUnitIdx, uiPartSize);
UInt iSrc0Stride = pcYuvSrc0->getCStride();
- UInt iSrc1Stride = pcYuvSrc1->getCStride();
+ UInt iSrc1Stride = pcYuvSrc1->Cwidth;
UInt iDstStride = getCStride();
for (y = uiPartSize - 1; y >= 0; y--)
@@ -665,8 +665,8 @@
Pel* pDstU = getCbAddr(iPartUnitIdx);
Pel* pDstV = getCrAddr(iPartUnitIdx);
- UInt iSrc0Stride = pcYuvSrc0->getStride();
- UInt iSrc1Stride = pcYuvSrc1->getStride();
+ UInt iSrc0Stride = pcYuvSrc0->width;
+ UInt iSrc1Stride = pcYuvSrc1->width;
UInt iDstStride = getStride();
Int shiftNum = IF_INTERNAL_PREC + 1 - g_bitDepthY;
Int offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS;
@@ -689,8 +689,8 @@
shiftNum = IF_INTERNAL_PREC + 1 - g_bitDepthC;
offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS;
- iSrc0Stride = pcYuvSrc0->getCStride();
- iSrc1Stride = pcYuvSrc1->getCStride();
+ iSrc0Stride = pcYuvSrc0->Cwidth;
+ iSrc1Stride = pcYuvSrc1->Cwidth;
iDstStride = getCStride();
iWidth >>= 1;
diff -r 133b907bb8ee -r 32e74af300c2 source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Wed Jul 03 17:35:55 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Fri Jul 05 14:00:13 2013 +0530
@@ -279,7 +279,7 @@
UInt uiSad;
Pel* piRefSrch = rcStruct.piRefY + iSearchY * rcStruct.iYStride + iSearchX;
-
+
m_pcRdCost->setDistParam(pcPatternKey, piRefSrch, rcStruct.iYStride, m_cDistParam);
if (m_cDistParam.iRows > 12)
@@ -291,7 +291,7 @@
// distortion
m_cDistParam.bitDepth = g_bitDepthY;
uiSad = m_cDistParam.DistFunc(&m_cDistParam);
-
+
// motion cost
uiSad += m_bc.mvcost(MV(iSearchX, iSearchY) << m_pcRdCost->m_iCostScale);
@@ -913,12 +913,13 @@
Int* pcArlCoeff = m_ppcQTTempArlCoeffY[uiQTLayer] + uiNumCoeffPerInc * uiAbsPartIdx;
Short* piRecQt = m_pcQTTempTComYuv[uiQTLayer].getLumaAddr(uiAbsPartIdx);
- UInt uiRecQtStride = m_pcQTTempTComYuv[uiQTLayer].getStride();
+ UInt uiRecQtStride = m_pcQTTempTComYuv[uiQTLayer].width;
UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
Pel* piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), uiZOrder);
UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride();
Bool useTransformSkip = pcCU->getTransformSkip(uiAbsPartIdx, TEXT_LUMA);
+
//===== init availability pattern =====
if (default0Save1Load2 != 2)
@@ -930,12 +931,12 @@
// save prediction
if (default0Save1Load2 == 1)
{
- primitives.cpyblock((int)uiWidth, uiHeight, (pixel *)m_pSharedPredTransformSkip[0], uiWidth, (pixel *)piPred, uiStride);
+ primitives.cpyblock((int)uiWidth, uiHeight, (pixel*)m_pSharedPredTransformSkip[0], uiWidth, (pixel*)piPred, uiStride);
}
}
else
{
- primitives.cpyblock((int)uiWidth, uiHeight, (pixel *)piPred, uiStride, (pixel *)m_pSharedPredTransformSkip[0], uiWidth);
+ primitives.cpyblock((int)uiWidth, uiHeight, (pixel*)piPred, uiStride, (pixel*)m_pSharedPredTransformSkip[0], uiWidth);
}
//===== get residual signal =====
@@ -978,7 +979,7 @@
}
}
- //===== reconstruction =====
+ //===== reconstruction =====
primitives.calcrecon[(Int)g_aucConvertToBit[uiWidth]]((pixel*)piPred, piResi, (pixel*)piReco, piRecQt, (pixel*)piRecIPred, uiStride, uiRecQtStride, uiRecIPredStride);
@@ -1028,7 +1029,7 @@
TCoeff* pcCoeff = (uiChromaId > 0 ? m_ppcQTTempCoeffCr[uiQTLayer] : m_ppcQTTempCoeffCb[uiQTLayer]) + uiNumCoeffPerInc * uiAbsPartIdx;
Int* pcArlCoeff = (uiChromaId > 0 ? m_ppcQTTempArlCoeffCr[uiQTLayer] : m_ppcQTTempArlCoeffCb[uiQTLayer]) + uiNumCoeffPerInc * uiAbsPartIdx;
Short* piRecQt = (uiChromaId > 0 ? m_pcQTTempTComYuv[uiQTLayer].getCrAddr(uiAbsPartIdx) : m_pcQTTempTComYuv[uiQTLayer].getCbAddr(uiAbsPartIdx));
- UInt uiRecQtStride = m_pcQTTempTComYuv[uiQTLayer].getCStride();
+ UInt uiRecQtStride = m_pcQTTempTComYuv[uiQTLayer].Cwidth;
UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
Pel* piRecIPred = (uiChromaId > 0 ? pcCU->getPic()->getPicYuvRec()->getCrAddr(pcCU->getAddr(), uiZOrder) : pcCU->getPic()->getPicYuvRec()->getCbAddr(pcCU->getAddr(), uiZOrder));
@@ -1054,9 +1055,9 @@
if (default0Save1Load2 == 1)
{
Pel* pPred = piPred;
- Pel* pPredBuf = m_pSharedPredTransformSkip[1 + uiChromaId];
-
- primitives.cpyblock((int)uiWidth,uiHeight,(pixel *)pPredBuf,uiWidth, (pixel *)pPred, uiStride);
+ Pel* pPredBuf = m_pSharedPredTransformSkip[1 + uiChromaId];
+
+ primitives.cpyblock((int)uiWidth, uiHeight, (pixel*)pPredBuf, uiWidth, (pixel*)pPred, uiStride);
}
}
else
@@ -1064,12 +1065,12 @@
// load prediction
Pel* pPred = piPred;
Pel* pPredBuf = m_pSharedPredTransformSkip[1 + uiChromaId];
-
- primitives.cpyblock((int)uiWidth,uiHeight,(pixel *)pPred,uiStride,(pixel *)pPredBuf,uiWidth);
+
+ primitives.cpyblock((int)uiWidth, uiHeight, (pixel*)pPred, uiStride, (pixel*)pPredBuf, uiWidth);
}
- //===== get residual signal =====
-
- primitives.calcresidual[(Int)g_aucConvertToBit[uiWidth]]((pixel*)piOrg,(pixel*)piPred,piResi, uiStride);
+ //===== get residual signal =====
+
+ primitives.calcresidual[(Int)g_aucConvertToBit[uiWidth]]((pixel*)piOrg, (pixel*)piPred, piResi, uiStride);
//===== transform and quantization =====
{
@@ -1117,7 +1118,7 @@
}
//===== reconstruction =====
-
+
primitives.calcrecon[(Int)g_aucConvertToBit[uiWidth]]((pixel*)piPred, piResi, (pixel*)piReco, piRecQt, (pixel*)piRecIPred, uiStride, uiRecQtStride, uiRecIPredStride);
//===== update distortion =====
@@ -1435,7 +1436,7 @@
UInt uiQTLayer = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() - uiLog2TrSize;
UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
Short* piSrc = m_pcQTTempTComYuv[uiQTLayer].getLumaAddr(uiAbsPartIdx);
- UInt uiSrcStride = m_pcQTTempTComYuv[uiQTLayer].getStride();
+ UInt uiSrcStride = m_pcQTTempTComYuv[uiQTLayer].width;
Pel* piDes = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), uiZOrder);
UInt uiDesStride = pcCU->getPic()->getPicYuvRec()->getStride();
for (UInt uiY = 0; uiY < uiHeight; uiY++, piSrc += uiSrcStride, piDes += uiDesStride)
@@ -1451,7 +1452,7 @@
uiWidth >>= 1;
uiHeight >>= 1;
piSrc = m_pcQTTempTComYuv[uiQTLayer].getCbAddr(uiAbsPartIdx);
- uiSrcStride = m_pcQTTempTComYuv[uiQTLayer].getCStride();
+ uiSrcStride = m_pcQTTempTComYuv[uiQTLayer].Cwidth;
piDes = pcCU->getPic()->getPicYuvRec()->getCbAddr(pcCU->getAddr(), uiZOrder);
uiDesStride = pcCU->getPic()->getPicYuvRec()->getCStride();
for (UInt uiY = 0; uiY < uiHeight; uiY++, piSrc += uiSrcStride, piDes += uiDesStride)
@@ -1670,7 +1671,7 @@
Pel* piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), uiZOrder);
UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride();
Short* piRecQt = m_pcQTTempTComYuv[uiQTLayer].getLumaAddr(uiAbsPartIdx);
- UInt uiRecQtStride = m_pcQTTempTComYuv[uiQTLayer].getStride();
+ UInt uiRecQtStride = m_pcQTTempTComYuv[uiQTLayer].width;
UInt uiWidth = pcCU->getWidth(0) >> uiTrDepth;
UInt uiHeight = pcCU->getHeight(0) >> uiTrDepth;
Short* pRecQt = piRecQt;
@@ -1839,7 +1840,7 @@
UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
UInt uiWidth = pcCU->getWidth(0) >> (uiTrDepth + 1);
UInt uiHeight = pcCU->getHeight(0) >> (uiTrDepth + 1);
- UInt uiRecQtStride = m_pcQTTempTComYuv[uiQTLayer].getCStride();
+ UInt uiRecQtStride = m_pcQTTempTComYuv[uiQTLayer].Cwidth;
UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getCStride();
if (stateU0V1Both2 == 0 || stateU0V1Both2 == 2)
@@ -2132,6 +2133,7 @@
uiBestMode = uiMode;
}
}
+
x265_emms();
//===== set chroma pred mode =====
@@ -2209,7 +2211,7 @@
uiSads[DC_IDX] = sa8d((pixel*)piOrg, uiStride, (pixel*)piPred, uiStride);
// 0
- if (uiWidth >=8 && uiWidth <=32)
+ if (uiWidth >= 8 && uiWidth <= 32)
{
ptrSrc += ADI_BUF_STRIDE * (2 * uiWidth + 1);
}
@@ -2714,6 +2716,7 @@
{
UInt uiAbsPartIdx;
Int iWidth, iHeight;
+
motionCompensation(pcCU, &m_tmpYuvPred, REF_PIC_LIST_X, iPartIdx);
pcCU->getPartIndexAndSize(iPartIdx, uiAbsPartIdx, iWidth, iHeight);
ruiErr = m_me.bufSA8D((pixel*)m_tmpYuvPred.getLumaAddr(uiAbsPartIdx), m_tmpYuvPred.getStride());
@@ -2872,7 +2875,7 @@
TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
Int numValidMergeCand = 0;
- if(!m_pcEncCfg->getUseRDO())
+ if (!m_pcEncCfg->getUseRDO())
pcCU->getTotalCost() = 0;
for (Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++)
@@ -3319,7 +3322,7 @@
#if CU_STAT_LOGFILE
meCost += uiMRGCost;
#endif
- if(!m_pcEncCfg->getUseRDO())
+ if (!m_pcEncCfg->getUseRDO())
pcCU->getTotalCost() += uiMRGCost;
}
else
@@ -3334,17 +3337,16 @@
#if CU_STAT_LOGFILE
meCost += uiMECost;
#endif
- if(!m_pcEncCfg->getUseRDO())
+ if (!m_pcEncCfg->getUseRDO())
pcCU->getTotalCost() += uiMECost;
}
}
else
{
- if(!m_pcEncCfg->getUseRDO())
+ if (!m_pcEncCfg->getUseRDO())
pcCU->getTotalCost() += uiCostTemp;
}
motionCompensation(pcCU, rpcPredYuv, REF_PIC_LIST_X, iPartIdx);
-
}
setWpScalingDistParam(pcCU, -1, REF_PIC_LIST_X);
@@ -3644,7 +3646,7 @@
// Do integer search
m_pcRdCost->setCostScale(2);
- if (bBi || m_iSearchMethod == X265_FULL_SEARCH )
+ if (bBi || m_iSearchMethod == X265_FULL_SEARCH)
{
xPatternSearch(pcPatternKey, piRefY, iRefStride, &cMvSrchRngLT, &cMvSrchRngRB, rcMv, ruiCost);
}
@@ -3675,7 +3677,7 @@
{
pcCU->clipMv(mvp);
- MV dist(merange<<2, merange<<2);
+ MV dist(merange << 2, merange << 2);
mvmin = mvp - dist;
mvmax = mvp + dist;
@@ -3953,9 +3955,9 @@
pcYuvPred->copyToPartYuv(rpcYuvRec, 0);
- uiDistortion = primitives.sse_pp[PartitionFromSizes(uiWidth, uiHeight)]((pixel *)pcYuvOrg->getLumaAddr(), (intptr_t)pcYuvOrg->getStride(), (pixel *)rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride());
- uiDistortion += m_pcRdCost->scaleChromaDistCb(primitives.sse_pp[PartitionFromSizes(uiWidth >> 1, uiHeight >> 1)]((pixel *)pcYuvOrg->getCbAddr(), (intptr_t)pcYuvOrg->getCStride(), (pixel *)rpcYuvRec->getCbAddr(), rpcYuvRec->getCStride()));
- uiDistortion += m_pcRdCost->scaleChromaDistCr(primitives.sse_pp[PartitionFromSizes(uiWidth >> 1, uiHeight >> 1)]((pixel *)pcYuvOrg->getCrAddr(), (intptr_t)pcYuvOrg->getCStride(), (pixel *)rpcYuvRec->getCrAddr(), rpcYuvRec->getCStride()));
+ uiDistortion = primitives.sse_pp[PartitionFromSizes(uiWidth, uiHeight)]((pixel*)pcYuvOrg->getLumaAddr(), (intptr_t)pcYuvOrg->getStride(), (pixel*)rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride());
+ uiDistortion += m_pcRdCost->scaleChromaDistCb(primitives.sse_pp[PartitionFromSizes(uiWidth >> 1, uiHeight >> 1)]((pixel*)pcYuvOrg->getCbAddr(), (intptr_t)pcYuvOrg->getCStride(), (pixel*)rpcYuvRec->getCbAddr(), rpcYuvRec->getCStride()));
+ uiDistortion += m_pcRdCost->scaleChromaDistCr(primitives.sse_pp[PartitionFromSizes(uiWidth >> 1, uiHeight >> 1)]((pixel*)pcYuvOrg->getCrAddr(), (intptr_t)pcYuvOrg->getCStride(), (pixel*)rpcYuvRec->getCrAddr(), rpcYuvRec->getCStride()));
m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST]);
m_pcEntropyCoder->resetBits();
@@ -4078,16 +4080,14 @@
rpcYuvRec->addClip(pcYuvPred, rpcYuvResiBest, 0, uiWidth);
// update with clipped distortion and cost (qp estimation loop uses unclipped values)
- uiDistortionBest = primitives.sse_pp[PartitionFromSizes(uiWidth, uiHeight)]((pixel *)pcYuvOrg->getLumaAddr(), (intptr_t)pcYuvOrg->getStride(), (pixel *)rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride());
- uiDistortionBest += m_pcRdCost->scaleChromaDistCb(primitives.sse_pp[PartitionFromSizes(uiWidth >> 1, uiHeight >> 1)]((pixel *)pcYuvOrg->getCbAddr(), (intptr_t)pcYuvOrg->getCStride(), (pixel *)rpcYuvRec->getCbAddr(), rpcYuvRec->getCStride()));
- uiDistortionBest += m_pcRdCost->scaleChromaDistCr(primitives.sse_pp[PartitionFromSizes(uiWidth >> 1, uiHeight >> 1)]((pixel *)pcYuvOrg->getCrAddr(), (intptr_t)pcYuvOrg->getCStride(), (pixel *)rpcYuvRec->getCrAddr(), rpcYuvRec->getCStride()));
+ uiDistortionBest = primitives.sse_pp[PartitionFromSizes(uiWidth, uiHeight)]((pixel*)pcYuvOrg->getLumaAddr(), (intptr_t)pcYuvOrg->getStride(), (pixel*)rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride());
+ uiDistortionBest += m_pcRdCost->scaleChromaDistCb(primitives.sse_pp[PartitionFromSizes(uiWidth >> 1, uiHeight >> 1)]((pixel*)pcYuvOrg->getCbAddr(), (intptr_t)pcYuvOrg->getCStride(), (pixel*)rpcYuvRec->getCbAddr(), rpcYuvRec->getCStride()));
+ uiDistortionBest += m_pcRdCost->scaleChromaDistCr(primitives.sse_pp[PartitionFromSizes(uiWidth >> 1, uiHeight >> 1)]((pixel*)pcYuvOrg->getCrAddr(), (intptr_t)pcYuvOrg->getCStride(), (pixel*)rpcYuvRec->getCrAddr(), rpcYuvRec->getCStride()));
uiCostBest = m_pcRdCost->calcRdCost(uiDistortionBest, uiBitsBest);
-
pcCU->getTotalBits() = uiBitsBest;
pcCU->getTotalDistortion() = uiDistortionBest;
- pcCU->getTotalCost() = uiCostBest;
-
+ pcCU->getTotalCost() = uiCostBest;
if (pcCU->isSkipped(0))
{
@@ -4191,7 +4191,7 @@
m_pcTrQuant->selectLambda(TEXT_LUMA);
- m_pcTrQuant->transformNxN(pcCU, pcResi->getLumaAddr(absTUPartIdx), pcResi->getStride(), pcCoeffCurrY,
+ m_pcTrQuant->transformNxN(pcCU, pcResi->getLumaAddr(absTUPartIdx), pcResi->width, pcCoeffCurrY,
pcArlCoeffCurrY, trWidth, trHeight, uiAbsSumY, TEXT_LUMA, uiAbsPartIdx);
pcCU->setCbfSubParts(uiAbsSumY ? uiSetCbf : 0, TEXT_LUMA, uiAbsPartIdx, uiDepth);
@@ -4208,12 +4208,12 @@
m_pcTrQuant->selectLambda(TEXT_CHROMA);
- m_pcTrQuant->transformNxN(pcCU, pcResi->getCbAddr(absTUPartIdxC), pcResi->getCStride(), pcCoeffCurrU,
+ m_pcTrQuant->transformNxN(pcCU, pcResi->getCbAddr(absTUPartIdxC), pcResi->Cwidth, pcCoeffCurrU,
pcArlCoeffCurrU, trWidthC, trHeightC, uiAbsSumU, TEXT_CHROMA_U, uiAbsPartIdx);
curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr();
m_pcTrQuant->setQPforQuant(pcCU->getQP(0), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset);
- m_pcTrQuant->transformNxN(pcCU, pcResi->getCrAddr(absTUPartIdxC), pcResi->getCStride(), pcCoeffCurrV,
+ m_pcTrQuant->transformNxN(pcCU, pcResi->getCrAddr(absTUPartIdxC), pcResi->Cwidth, pcCoeffCurrV,
pcArlCoeffCurrV, trWidthC, trHeightC, uiAbsSumV, TEXT_CHROMA_V, uiAbsPartIdx);
pcCU->setCbfSubParts(uiAbsSumU ? uiSetCbf : 0, TEXT_CHROMA_U, uiAbsPartIdx, pcCU->getDepth(0) + uiTrModeC);
@@ -4252,7 +4252,7 @@
::memset(m_pTempPel, 0, sizeof(Pel) * uiNumSamplesLuma); // not necessary needed for inside of recursion (only at the beginning)
int Part = PartitionFromSizes(trWidth, trHeight);
- UInt uiDistY = primitives.sse_sp[Part](pcResi->getLumaAddr(absTUPartIdx), (intptr_t)pcResi->getStride(), (pixel *)m_pTempPel, trWidth);
+ UInt uiDistY = primitives.sse_sp[Part](pcResi->getLumaAddr(absTUPartIdx), (intptr_t)pcResi->width, (pixel*)m_pTempPel, trWidth);
if (puiZeroDist)
{
@@ -4266,10 +4266,10 @@
Int scalingListType = 3 + g_eTTable[(Int)TEXT_LUMA];
assert(scalingListType < 6);
- m_pcTrQuant->invtransformNxN(pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA, REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType); //this is for inter mode only
-
- const UInt uiNonzeroDistY = primitives.sse_ss[Part](pcResi->getLumaAddr(absTUPartIdx), pcResi->getStride(), m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr(absTUPartIdx),
- m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride());
+ m_pcTrQuant->invtransformNxN(pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA, REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].width, pcCoeffCurrY, trWidth, trHeight, scalingListType); //this is for inter mode only
+
+ const UInt uiNonzeroDistY = primitives.sse_ss[Part](pcResi->getLumaAddr(absTUPartIdx), pcResi->width, m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr(absTUPartIdx),
+ m_pcQTTempTComYuv[uiQTTempAccessLayer].width);
if (pcCU->isLosslessCoded(0))
{
uiDistY = uiNonzeroDistY;
@@ -4311,7 +4311,7 @@
if (!uiAbsSumY)
{
Short *pcPtr = m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr(absTUPartIdx);
- const UInt uiStride = m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride();
+ const UInt uiStride = m_pcQTTempTComYuv[uiQTTempAccessLayer].width;
for (UInt uiY = 0; uiY < trHeight; ++uiY)
{
::memset(pcPtr, 0, sizeof(Short) * trWidth);
@@ -4325,7 +4325,7 @@
int PartC = x265::PartitionFromSizes(trWidthC, trHeightC);
if (bCodeChroma)
{
- uiDistU = m_pcRdCost->scaleChromaDistCb(primitives.sse_sp[PartC](pcResi->getCbAddr(absTUPartIdxC), (intptr_t)pcResi->getCStride(), (pixel *)m_pTempPel, trWidthC));
+ uiDistU = m_pcRdCost->scaleChromaDistCb(primitives.sse_sp[PartC](pcResi->getCbAddr(absTUPartIdxC), (intptr_t)pcResi->Cwidth, (pixel*)m_pTempPel, trWidthC));
if (puiZeroDist)
{
@@ -4340,10 +4340,10 @@
Int scalingListType = 3 + g_eTTable[(Int)TEXT_CHROMA_U];
assert(scalingListType < 6);
- m_pcTrQuant->invtransformNxN(pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_CHROMA, REG_DCT, pcResiCurrU, m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(), pcCoeffCurrU, trWidthC, trHeightC, scalingListType);
-
- const UInt uiNonzeroDistU = m_pcRdCost->scaleChromaDistCb(primitives.sse_ss[PartC](pcResi->getCbAddr(absTUPartIdxC), pcResi->getCStride(),
- m_pcQTTempTComYuv[uiQTTempAccessLayer].getCbAddr(absTUPartIdxC), m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride()));
+ m_pcTrQuant->invtransformNxN(pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_CHROMA, REG_DCT, pcResiCurrU, m_pcQTTempTComYuv[uiQTTempAccessLayer].Cwidth, pcCoeffCurrU, trWidthC, trHeightC, scalingListType);
+
+ const UInt uiNonzeroDistU = m_pcRdCost->scaleChromaDistCb(primitives.sse_ss[PartC](pcResi->getCbAddr(absTUPartIdxC), pcResi->Cwidth,
+ m_pcQTTempTComYuv[uiQTTempAccessLayer].getCbAddr(absTUPartIdxC), m_pcQTTempTComYuv[uiQTTempAccessLayer].Cwidth));
if (pcCU->isLosslessCoded(0))
{
uiDistU = uiNonzeroDistU;
@@ -4384,7 +4384,7 @@
if (!uiAbsSumU)
{
Short *pcPtr = m_pcQTTempTComYuv[uiQTTempAccessLayer].getCbAddr(absTUPartIdxC);
- const UInt uiStride = m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride();
+ const UInt uiStride = m_pcQTTempTComYuv[uiQTTempAccessLayer].Cwidth;
for (UInt uiY = 0; uiY < trHeightC; ++uiY)
{
::memset(pcPtr, 0, sizeof(Short) * trWidthC);
@@ -4392,7 +4392,7 @@
}
}
- uiDistV = m_pcRdCost->scaleChromaDistCr(primitives.sse_sp[PartC](pcResi->getCrAddr(absTUPartIdxC), (intptr_t)pcResi->getCStride(), (pixel *)m_pTempPel, trWidthC));
+ uiDistV = m_pcRdCost->scaleChromaDistCr(primitives.sse_sp[PartC](pcResi->getCrAddr(absTUPartIdxC), (intptr_t)pcResi->Cwidth, (pixel*)m_pTempPel, trWidthC));
if (puiZeroDist)
{
*puiZeroDist += uiDistV;
@@ -4405,10 +4405,10 @@
Int scalingListType = 3 + g_eTTable[(Int)TEXT_CHROMA_V];
assert(scalingListType < 6);
- m_pcTrQuant->invtransformNxN(pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_CHROMA, REG_DCT, pcResiCurrV, m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(), pcCoeffCurrV, trWidthC, trHeightC, scalingListType);
-
- const UInt uiNonzeroDistV = m_pcRdCost->scaleChromaDistCr(primitives.sse_ss[PartC](pcResi->getCrAddr(absTUPartIdxC), pcResi->getCStride(),
- m_pcQTTempTComYuv[uiQTTempAccessLayer].getCrAddr(absTUPartIdxC), m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride()));
+ m_pcTrQuant->invtransformNxN(pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_CHROMA, REG_DCT, pcResiCurrV, m_pcQTTempTComYuv[uiQTTempAccessLayer].Cwidth, pcCoeffCurrV, trWidthC, trHeightC, scalingListType);
+
+ const UInt uiNonzeroDistV = m_pcRdCost->scaleChromaDistCr(primitives.sse_ss[PartC](pcResi->getCrAddr(absTUPartIdxC), pcResi->Cwidth,
+ m_pcQTTempTComYuv[uiQTTempAccessLayer].getCrAddr(absTUPartIdxC), m_pcQTTempTComYuv[uiQTTempAccessLayer].Cwidth));
if (pcCU->isLosslessCoded(0))
{
@@ -4450,7 +4450,7 @@
if (!uiAbsSumV)
{
Short *pcPtr = m_pcQTTempTComYuv[uiQTTempAccessLayer].getCrAddr(absTUPartIdxC);
- const UInt uiStride = m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride();
+ const UInt uiStride = m_pcQTTempTComYuv[uiQTTempAccessLayer].Cwidth;
for (UInt uiY = 0; uiY < trHeightC; ++uiY)
{
::memset(pcPtr, 0, sizeof(Short) * trWidthC);
@@ -4471,7 +4471,7 @@
UInt64 dSingleCostY = MAX_INT64;
Short *pcResiCurrY = m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr(absTUPartIdx);
- UInt resiYStride = m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride();
+ UInt resiYStride = m_pcQTTempTComYuv[uiQTTempAccessLayer].width;
TCoeff bestCoeffY[32 * 32];
memcpy(bestCoeffY, pcCoeffCurrY, sizeof(TCoeff) * uiNumSamplesLuma);
@@ -4497,7 +4497,7 @@
m_pcTrQuant->setQPforQuant(pcCU->getQP(0), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0);
m_pcTrQuant->selectLambda(TEXT_LUMA);
- m_pcTrQuant->transformNxN(pcCU, pcResi->getLumaAddr(absTUPartIdx), pcResi->getStride(), pcCoeffCurrY,
+ m_pcTrQuant->transformNxN(pcCU, pcResi->getLumaAddr(absTUPartIdx), pcResi->width, pcCoeffCurrY,
pcArlCoeffCurrY, trWidth, trHeight, uiAbsSumTransformSkipY, TEXT_LUMA, uiAbsPartIdx, true);
pcCU->setCbfSubParts(uiAbsSumTransformSkipY ? uiSetCbf : 0, TEXT_LUMA, uiAbsPartIdx, uiDepth);
@@ -4513,10 +4513,10 @@
Int scalingListType = 3 + g_eTTable[(Int)TEXT_LUMA];
assert(scalingListType < 6);
- m_pcTrQuant->invtransformNxN(pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA, REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType, true);
-
- uiNonzeroDistY = primitives.sse_ss[Part](pcResi->getLumaAddr(absTUPartIdx), pcResi->getStride(),
- m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr(absTUPartIdx), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride());
+ m_pcTrQuant->invtransformNxN(pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA, REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].width, pcCoeffCurrY, trWidth, trHeight, scalingListType, true);
+
+ uiNonzeroDistY = primitives.sse_ss[Part](pcResi->getLumaAddr(absTUPartIdx), pcResi->width,
+ m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr(absTUPartIdx), m_pcQTTempTComYuv[uiQTTempAccessLayer].width);
dSingleCostY = m_pcRdCost->calcRdCost(uiNonzeroDistY, uiTsSingleBitsY);
}
@@ -4549,7 +4549,7 @@
Short *pcResiCurrU = m_pcQTTempTComYuv[uiQTTempAccessLayer].getCbAddr(absTUPartIdxC);
Short *pcResiCurrV = m_pcQTTempTComYuv[uiQTTempAccessLayer].getCrAddr(absTUPartIdxC);
- UInt resiCStride = m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride();
+ UInt resiCStride = m_pcQTTempTComYuv[uiQTTempAccessLayer].Cwidth;
TCoeff bestCoeffU[32 * 32], bestCoeffV[32 * 32];
memcpy(bestCoeffU, pcCoeffCurrU, sizeof(TCoeff) * uiNumSamplesChro);
@@ -4581,11 +4581,11 @@
m_pcTrQuant->selectLambda(TEXT_CHROMA);
- m_pcTrQuant->transformNxN(pcCU, pcResi->getCbAddr(absTUPartIdxC), pcResi->getCStride(), pcCoeffCurrU,
+ m_pcTrQuant->transformNxN(pcCU, pcResi->getCbAddr(absTUPartIdxC), pcResi->Cwidth, pcCoeffCurrU,
pcArlCoeffCurrU, trWidthC, trHeightC, uiAbsSumTransformSkipU, TEXT_CHROMA_U, uiAbsPartIdx, true);
curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr();
m_pcTrQuant->setQPforQuant(pcCU->getQP(0), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset);
- m_pcTrQuant->transformNxN(pcCU, pcResi->getCrAddr(absTUPartIdxC), pcResi->getCStride(), pcCoeffCurrV,
+ m_pcTrQuant->transformNxN(pcCU, pcResi->getCrAddr(absTUPartIdxC), pcResi->Cwidth, pcCoeffCurrV,
pcArlCoeffCurrV, trWidthC, trHeightC, uiAbsSumTransformSkipV, TEXT_CHROMA_V, uiAbsPartIdx, true);
pcCU->setCbfSubParts(uiAbsSumTransformSkipU ? uiSetCbf : 0, TEXT_CHROMA_U, uiAbsPartIdx, pcCU->getDepth(0) + uiTrModeC);
@@ -4607,10 +4607,10 @@
Int scalingListType = 3 + g_eTTable[(Int)TEXT_CHROMA_U];
assert(scalingListType < 6);
- m_pcTrQuant->invtransformNxN(pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_CHROMA, REG_DCT, pcResiCurrU, m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(), pcCoeffCurrU, trWidthC, trHeightC, scalingListType, true);
-
- uiNonzeroDistU = m_pcRdCost->scaleChromaDistCb(primitives.sse_ss[PartC](pcResi->getCbAddr(absTUPartIdxC), pcResi->getCStride(),
- m_pcQTTempTComYuv[uiQTTempAccessLayer].getCbAddr(absTUPartIdxC), m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride()));
+ m_pcTrQuant->invtransformNxN(pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_CHROMA, REG_DCT, pcResiCurrU, m_pcQTTempTComYuv[uiQTTempAccessLayer].Cwidth, pcCoeffCurrU, trWidthC, trHeightC, scalingListType, true);
+
+ uiNonzeroDistU = m_pcRdCost->scaleChromaDistCb(primitives.sse_ss[PartC](pcResi->getCbAddr(absTUPartIdxC), pcResi->Cwidth,
+ m_pcQTTempTComYuv[uiQTTempAccessLayer].getCbAddr(absTUPartIdxC), m_pcQTTempTComYuv[uiQTTempAccessLayer].Cwidth));
dSingleCostU = m_pcRdCost->calcRdCost(uiNonzeroDistU, uiSingleBitsU);
}
@@ -4644,10 +4644,10 @@
Int scalingListType = 3 + g_eTTable[(Int)TEXT_CHROMA_V];
assert(scalingListType < 6);
- m_pcTrQuant->invtransformNxN(pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_CHROMA, REG_DCT, pcResiCurrV, m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(), pcCoeffCurrV, trWidthC, trHeightC, scalingListType, true);
-
- uiNonzeroDistV = m_pcRdCost->scaleChromaDistCr(primitives.sse_ss[PartC](pcResi->getCrAddr(absTUPartIdxC), pcResi->getCStride(),
- m_pcQTTempTComYuv[uiQTTempAccessLayer].getCrAddr(absTUPartIdxC), m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride()));
+ m_pcTrQuant->invtransformNxN(pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_CHROMA, REG_DCT, pcResiCurrV, m_pcQTTempTComYuv[uiQTTempAccessLayer].Cwidth, pcCoeffCurrV, trWidthC, trHeightC, scalingListType, true);
+
+ uiNonzeroDistV = m_pcRdCost->scaleChromaDistCr(primitives.sse_ss[PartC](pcResi->getCrAddr(absTUPartIdxC), pcResi->Cwidth,
+ m_pcQTTempTComYuv[uiQTTempAccessLayer].getCrAddr(absTUPartIdxC), m_pcQTTempTComYuv[uiQTTempAccessLayer].Cwidth));
dSingleCostV = m_pcRdCost->calcRdCost(uiNonzeroDistV, uiSingleBitsV);
}
@@ -5082,17 +5082,15 @@
{
m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true);
}
-
+
m_pcEntropyCoder->encodePredMode(pcCU, 0, true);
-
+
m_pcEntropyCoder->encodePartSize(pcCU, 0, pcCU->getDepth(0), true);
bits += m_pcEntropyCoder->getNumberOfWrittenBits();
return bits;
-
}
-
/**
* \brief Generate half-sample interpolated block
*
@@ -5107,7 +5105,7 @@
Int height = pattern->getROIYHeight();
Int srcStride = pattern->getPatternLStride();
- Int intStride = filteredBlockTmp[0].getWidth();
+ Int intStride = filteredBlockTmp[0].width;
Int dstStride = m_filteredBlock[0][0].getStride();
Pel *srcPtr; //Contains raw pixels
@@ -5159,7 +5157,7 @@
Int height = pattern->getROIYHeight();
Int srcStride = pattern->getPatternLStride();
- Int intStride = filteredBlockTmp[0].getWidth();
+ Int intStride = filteredBlockTmp[0].width;
Int dstStride = m_filteredBlock[0][0].getStride();
Pel *srcPtr; //Contains raw pixels
diff -r 133b907bb8ee -r 32e74af300c2 source/common/TShortYUV.cpp
--- a/source/common/TShortYUV.cpp Wed Jul 03 17:35:55 2013 +0530
+++ b/source/common/TShortYUV.cpp Fri Jul 05 14:00:13 2013 +0530
@@ -86,7 +86,7 @@
int iSrc0Stride = pcYuvSrc0->getStride();
int iSrc1Stride = pcYuvSrc1->getStride();
- int iDstStride = getStride();
+ int iDstStride = width;
for (y = uiPartSize - 1; y >= 0; y--)
{
@@ -114,7 +114,7 @@
int iSrc0Stride = pcYuvSrc0->getCStride();
int iSrc1Stride = pcYuvSrc1->getCStride();
- int iDstStride = getCStride();
+ int iDstStride = Cwidth;
for (y = uiPartSize - 1; y >= 0; y--)
{
@@ -151,9 +151,9 @@
short* pSrc1 = pcYuvSrc1->getLumaAddr(uiTrUnitIdx, uiPartSize);
short* pDst = getLumaAddr(uiTrUnitIdx, uiPartSize);
- unsigned int iSrc0Stride = pcYuvSrc0->getStride();
- unsigned int iSrc1Stride = pcYuvSrc1->getStride();
- unsigned int iDstStride = getStride();
+ unsigned int iSrc0Stride = pcYuvSrc0->width;
+ unsigned int iSrc1Stride = pcYuvSrc1->width;
+ unsigned int iDstStride = width;
for (y = uiPartSize - 1; y >= 0; y--)
{
@@ -179,9 +179,9 @@
short* pDstU = getCbAddr(uiTrUnitIdx, uiPartSize);
short* pDstV = getCrAddr(uiTrUnitIdx, uiPartSize);
- unsigned int iSrc0Stride = pcYuvSrc0->getCStride();
- unsigned int iSrc1Stride = pcYuvSrc1->getCStride();
- unsigned int iDstStride = getCStride();
+ unsigned int iSrc0Stride = pcYuvSrc0->Cwidth;
+ unsigned int iSrc1Stride = pcYuvSrc1->Cwidth;
+ unsigned int iDstStride = Cwidth;
for (y = uiPartSize - 1; y >= 0; y--)
{
@@ -228,8 +228,8 @@
return;
}
- unsigned int iSrcStride = getStride();
- unsigned int iDstStride = pcYuvDst->getStride();
+ unsigned int iSrcStride = width;
+ unsigned int iDstStride = pcYuvDst->width;
for (unsigned int y = iHeight; y != 0; y--)
{
::memcpy(pDst, pSrc, iWidth * sizeof(short));
@@ -243,7 +243,7 @@
short* pSrc = getLumaAddr(uiPartIdx);
Pel* pDst = pcYuvDst->getLumaAddr(uiPartIdx);
- unsigned int iSrcStride = getStride();
+ unsigned int iSrcStride = width;
unsigned int iDstStride = pcYuvDst->getStride();
for (unsigned int y = iHeight; y != 0; y--)
@@ -272,8 +272,8 @@
return;
}
- unsigned int iSrcStride = getCStride();
- unsigned int iDstStride = pcYuvDst->getCStride();
+ unsigned int iSrcStride = Cwidth;
+ unsigned int iDstStride = pcYuvDst->Cwidth;
for (unsigned int y = iHeight; y != 0; y--)
{
::memcpy(pDstU, pSrcU, iWidth * sizeof(short));
@@ -292,7 +292,7 @@
Pel* pDstU = pcYuvDst->getCbAddr(uiPartIdx);
Pel* pDstV = pcYuvDst->getCrAddr(uiPartIdx);
- unsigned int iSrcStride = getCStride();
+ unsigned int iSrcStride = Cwidth;
unsigned int iDstStride = pcYuvDst->getCStride();
for (unsigned int y = iHeight; y != 0; y--)
@@ -320,8 +320,8 @@
{
return;
}
- unsigned int iSrcStride = getCStride();
- unsigned int iDstStride = pcYuvDst->getCStride();
+ unsigned int iSrcStride = Cwidth;
+ unsigned int iDstStride = pcYuvDst->Cwidth;
for (unsigned int y = iHeight; y != 0; y--)
{
::memcpy(pDstU, pSrcU, iWidth * sizeof(short));
@@ -337,8 +337,8 @@
{
return;
}
- unsigned int iSrcStride = getCStride();
- unsigned int iDstStride = pcYuvDst->getCStride();
+ unsigned int iSrcStride = Cwidth;
+ unsigned int iDstStride = pcYuvDst->Cwidth;
for (unsigned int y = iHeight; y != 0; y--)
{
::memcpy(pDstV, pSrcV, iWidth * sizeof(short));
@@ -359,8 +359,8 @@
//th best would be to fix the caller
return;
}
- unsigned int iSrcStride = getCStride();
- unsigned int iDstStride = pcYuvDst->getCStride();
+ unsigned int iSrcStride = Cwidth;
+ unsigned int iDstStride = pcYuvDst->Cwidth;
for (unsigned int y = iHeight; y != 0; y--)
{
::memcpy(pDstU, pSrcU, iWidth * sizeof(short));
@@ -379,7 +379,7 @@
{
short* pSrcU = getCbAddr(uiPartIdx);
Pel* pDstU = pcYuvDst->getCbAddr(uiPartIdx);
- unsigned int iSrcStride = getCStride();
+ unsigned int iSrcStride = Cwidth;
unsigned int iDstStride = pcYuvDst->getCStride();
for (unsigned int y = iHeight; y != 0; y--)
{
@@ -396,7 +396,7 @@
{
short* pSrcV = getCrAddr(uiPartIdx);
Pel* pDstV = pcYuvDst->getCrAddr(uiPartIdx);
- unsigned int iSrcStride = getCStride();
+ unsigned int iSrcStride = Cwidth;
unsigned int iDstStride = pcYuvDst->getCStride();
for (unsigned int y = iHeight; y != 0; y--)
{
@@ -416,7 +416,7 @@
Pel* pDstU = pcYuvDst->getCbAddr(uiPartIdx);
Pel* pDstV = pcYuvDst->getCrAddr(uiPartIdx);
- unsigned int iSrcStride = getCStride();
+ unsigned int iSrcStride = Cwidth;
unsigned int iDstStride = pcYuvDst->getCStride();
for (unsigned int y = iHeight; y != 0; y--)
{
diff -r 133b907bb8ee -r 32e74af300c2 source/common/TShortYUV.h
--- a/source/common/TShortYUV.h Wed Jul 03 17:35:55 2013 +0530
+++ b/source/common/TShortYUV.h Fri Jul 05 14:00:13 2013 +0530
@@ -35,15 +35,6 @@
{
private:
- short* YBuf;
- short* CbBuf;
- short* CrBuf;
-
- unsigned int width;
- unsigned int height;
- unsigned int Cwidth;
- unsigned int Cheight;
-
static int getAddrOffset(unsigned int uiPartUnitIdx, unsigned int width)
{
int blkX = g_auiRasterToPelX[g_auiZscanToRaster[uiPartUnitIdx]];
@@ -62,6 +53,15 @@
public:
+ short* YBuf;
+ short* CbBuf;
+ short* CrBuf;
+
+ unsigned int width;
+ unsigned int height;
+ unsigned int Cwidth;
+ unsigned int Cheight;
+
TShortYUV();
virtual ~TShortYUV();
@@ -106,18 +106,6 @@
void copyPartToPartLuma(TComYuv* pcYuvDst, unsigned int uiPartIdx, unsigned int uiWidth, unsigned int uiHeight);
void copyPartToPartChroma(TComYuv* pcYuvDst, unsigned int uiPartIdx, unsigned int uiWidth, unsigned int uiHeight);
void copyPartToPartChroma(TComYuv* pcYuvDst, unsigned int uiPartIdx, unsigned int iWidth, unsigned int iHeight, unsigned int chromaId);
-
- unsigned int getHeight() { return height; }
-
- unsigned int getWidth() { return width; }
-
- unsigned int getCHeight() { return Cheight; }
-
- unsigned int getCWidth() { return Cwidth; }
-
- unsigned int getStride() { return width; }
-
- unsigned int getCStride() { return Cwidth; }
};
#endif //end __TSHORTYUV__
More information about the x265-devel
mailing list