{
int tuSize = 1 << log2TrSize;
- pixel *refLft, *refAbv;
+ pixel* refLft;
+ pixel* refAbv;
if (!(g_intraFilterFlags[dirMode] & tuSize))
{
ShortYuv& shortYuv = m_predShortYuv[0];
if (bLuma)
- predInterLumaShort(shortYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPicYuv, m_clippedMv[0]);
+ predInterLumaShort(shortYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPic, m_clippedMv[0]);
if (bChroma)
- predInterChromaShort(shortYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPicYuv, m_clippedMv[0]);
+ predInterChromaShort(shortYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPic, m_clippedMv[0]);
addWeightUni(predYuv, shortYuv, wv0, bLuma, bChroma);
}
else
{
if (bLuma)
- predInterLumaPixel(predYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPicYuv, m_clippedMv[0]);
+ predInterLumaPixel(predYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPic, m_clippedMv[0]);
if (bChroma)
- predInterChromaPixel(predYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPicYuv, m_clippedMv[0]);
+ predInterChromaPixel(predYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPic, m_clippedMv[0]);
}
}
else
if (bLuma)
{
- predInterLumaShort(m_predShortYuv[0], *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPicYuv, m_clippedMv[0]);
- predInterLumaShort(m_predShortYuv[1], *m_predSlice->m_refPicList[1][m_refIdx1]->m_reconPicYuv, m_clippedMv[1]);
+ predInterLumaShort(m_predShortYuv[0], *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPic, m_clippedMv[0]);
+ predInterLumaShort(m_predShortYuv[1], *m_predSlice->m_refPicList[1][m_refIdx1]->m_reconPic, m_clippedMv[1]);
}
if (bChroma)
{
- predInterChromaShort(m_predShortYuv[0], *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPicYuv, m_clippedMv[0]);
- predInterChromaShort(m_predShortYuv[1], *m_predSlice->m_refPicList[1][m_refIdx1]->m_reconPicYuv, m_clippedMv[1]);
+ predInterChromaShort(m_predShortYuv[0], *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPic, m_clippedMv[0]);
+ predInterChromaShort(m_predShortYuv[1], *m_predSlice->m_refPicList[1][m_refIdx1]->m_reconPic, m_clippedMv[1]);
}
if (pwp0 && pwp1 && (pwp0->bPresentFlag || pwp1->bPresentFlag))
ShortYuv& shortYuv = m_predShortYuv[0];
if (bLuma)
- predInterLumaShort(shortYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPicYuv, m_clippedMv[0]);
+ predInterLumaShort(shortYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPic, m_clippedMv[0]);
if (bChroma)
- predInterChromaShort(shortYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPicYuv, m_clippedMv[0]);
+ predInterChromaShort(shortYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPic, m_clippedMv[0]);
addWeightUni(predYuv, shortYuv, wv0, bLuma, bChroma);
}
else
{
if (bLuma)
- predInterLumaPixel(predYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPicYuv, m_clippedMv[0]);
+ predInterLumaPixel(predYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPic, m_clippedMv[0]);
if (bChroma)
- predInterChromaPixel(predYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPicYuv, m_clippedMv[0]);
+ predInterChromaPixel(predYuv, *m_predSlice->m_refPicList[0][m_refIdx0]->m_reconPic, m_clippedMv[0]);
}
}
else
ShortYuv& shortYuv = m_predShortYuv[0];
if (bLuma)
- predInterLumaShort(shortYuv, *m_predSlice->m_refPicList[1][m_refIdx1]->m_reconPicYuv, m_clippedMv[1]);
+ predInterLumaShort(shortYuv, *m_predSlice->m_refPicList[1][m_refIdx1]->m_reconPic, m_clippedMv[1]);
if (bChroma)
- predInterChromaShort(shortYuv, *m_predSlice->m_refPicList[1][m_refIdx1]->m_reconPicYuv, m_clippedMv[1]);
+ predInterChromaShort(shortYuv, *m_predSlice->m_refPicList[1][m_refIdx1]->m_reconPic, m_clippedMv[1]);
addWeightUni(predYuv, shortYuv, wv0, bLuma, bChroma);
}
else
{
if (bLuma)
- predInterLumaPixel(predYuv, *m_predSlice->m_refPicList[1][m_refIdx1]->m_reconPicYuv, m_clippedMv[1]);
+ predInterLumaPixel(predYuv, *m_predSlice->m_refPicList[1][m_refIdx1]->m_reconPic, m_clippedMv[1]);
if (bChroma)
- predInterChromaPixel(predYuv, *m_predSlice->m_refPicList[1][m_refIdx1]->m_reconPicYuv, m_clippedMv[1]);
+ predInterChromaPixel(predYuv, *m_predSlice->m_refPicList[1][m_refIdx1]->m_reconPic, m_clippedMv[1]);
}
}
}
void Predict::predInterLumaPixel(Yuv& dstYuv, const PicYuv& refPic, const MV& mv) const
{
- pixel *dst = dstYuv.getLumaAddr(m_puAbsPartIdx);
+ pixel* dst = dstYuv.getLumaAddr(m_puAbsPartIdx);
intptr_t dstStride = dstYuv.m_size;
intptr_t srcStride = refPic.m_stride;
intptr_t srcOffset = (mv.x >> 2) + (mv.y >> 2) * srcStride;
int partEnum = partitionFromSizes(m_puWidth, m_puHeight);
- pixel* src = const_cast<PicYuv&>(refPic).getLumaAddr(m_ctuAddr, m_cuAbsPartIdx + m_puAbsPartIdx) + srcOffset;
+ const pixel* src = refPic.getLumaAddr(m_ctuAddr, m_cuAbsPartIdx + m_puAbsPartIdx) + srcOffset;
int xFrac = mv.x & 0x3;
int yFrac = mv.y & 0x3;
void Predict::predInterLumaShort(ShortYuv& dstSYuv, const PicYuv& refPic, const MV& mv) const
{
- int16_t *dst = dstSYuv.getLumaAddr(m_puAbsPartIdx);
+ int16_t* dst = dstSYuv.getLumaAddr(m_puAbsPartIdx);
int dstStride = dstSYuv.m_size;
intptr_t srcStride = refPic.m_stride;
intptr_t srcOffset = (mv.x >> 2) + (mv.y >> 2) * srcStride;
- pixel *src = const_cast<PicYuv&>(refPic).getLumaAddr(m_ctuAddr, m_cuAbsPartIdx + m_puAbsPartIdx) + srcOffset;
+ const pixel* src = refPic.getLumaAddr(m_ctuAddr, m_cuAbsPartIdx + m_puAbsPartIdx) + srcOffset;
int xFrac = mv.x & 0x3;
int yFrac = mv.y & 0x3;
intptr_t refOffset = (mv.x >> shiftHor) + (mv.y >> shiftVer) * refStride;
- pixel* refCb = const_cast<PicYuv&>(refPic).getCbAddr(m_ctuAddr, m_cuAbsPartIdx + m_puAbsPartIdx) + refOffset;
- pixel* refCr = const_cast<PicYuv&>(refPic).getCrAddr(m_ctuAddr, m_cuAbsPartIdx + m_puAbsPartIdx) + refOffset;
+ const pixel* refCb = refPic.getCbAddr(m_ctuAddr, m_cuAbsPartIdx + m_puAbsPartIdx) + refOffset;
+ const pixel* refCr = refPic.getCrAddr(m_ctuAddr, m_cuAbsPartIdx + m_puAbsPartIdx) + refOffset;
pixel* dstCb = dstYuv.getCbAddr(m_puAbsPartIdx);
pixel* dstCr = dstYuv.getCrAddr(m_puAbsPartIdx);
intptr_t refOffset = (mv.x >> shiftHor) + (mv.y >> shiftVer) * refStride;
- pixel* refCb = const_cast<PicYuv&>(refPic).getCbAddr(m_ctuAddr, m_cuAbsPartIdx + m_puAbsPartIdx) + refOffset;
- pixel* refCr = const_cast<PicYuv&>(refPic).getCrAddr(m_ctuAddr, m_cuAbsPartIdx + m_puAbsPartIdx) + refOffset;
+ const pixel* refCb = refPic.getCbAddr(m_ctuAddr, m_cuAbsPartIdx + m_puAbsPartIdx) + refOffset;
+ const pixel* refCr = refPic.getCrAddr(m_ctuAddr, m_cuAbsPartIdx + m_puAbsPartIdx) + refOffset;
int16_t* dstCb = dstSYuv.getCbAddr(m_puAbsPartIdx);
int16_t* dstCr = dstSYuv.getCrAddr(m_puAbsPartIdx);
if (!(yFrac | xFrac))
{
- primitives.chroma_p2s[m_csp](refCb, refStride, dstCb, cxWidth, cxHeight);
- primitives.chroma_p2s[m_csp](refCr, refStride, dstCr, cxWidth, cxHeight);
+ primitives.chroma[m_csp].p2s(refCb, refStride, dstCb, cxWidth, cxHeight);
+ primitives.chroma[m_csp].p2s(refCr, refStride, dstCr, cxWidth, cxHeight);
}
else if (!yFrac)
{
int w0, w1, offset, shiftNum, shift, round;
uint32_t src0Stride, src1Stride, dststride;
- pixel* dstY = predYuv.getLumaAddr(m_puAbsPartIdx);
- pixel* dstU = predYuv.getCbAddr(m_puAbsPartIdx);
- pixel* dstV = predYuv.getCrAddr(m_puAbsPartIdx);
-
- const int16_t* srcY0 = srcYuv0.getLumaAddr(m_puAbsPartIdx);
- const int16_t* srcU0 = srcYuv0.getCbAddr(m_puAbsPartIdx);
- const int16_t* srcV0 = srcYuv0.getCrAddr(m_puAbsPartIdx);
-
- const int16_t* srcY1 = srcYuv1.getLumaAddr(m_puAbsPartIdx);
- const int16_t* srcU1 = srcYuv1.getCbAddr(m_puAbsPartIdx);
- const int16_t* srcV1 = srcYuv1.getCrAddr(m_puAbsPartIdx);
-
if (bLuma)
{
+ pixel* dstY = predYuv.getLumaAddr(m_puAbsPartIdx);
+ const int16_t* srcY0 = srcYuv0.getLumaAddr(m_puAbsPartIdx);
+ const int16_t* srcY1 = srcYuv1.getLumaAddr(m_puAbsPartIdx);
+
// Luma
w0 = wp0[0].w;
offset = wp0[0].o + wp1[0].o;
if (bChroma)
{
+ pixel* dstU = predYuv.getCbAddr(m_puAbsPartIdx);
+ pixel* dstV = predYuv.getCrAddr(m_puAbsPartIdx);
+ const int16_t* srcU0 = srcYuv0.getCbAddr(m_puAbsPartIdx);
+ const int16_t* srcV0 = srcYuv0.getCrAddr(m_puAbsPartIdx);
+ const int16_t* srcU1 = srcYuv1.getCbAddr(m_puAbsPartIdx);
+ const int16_t* srcV1 = srcYuv1.getCrAddr(m_puAbsPartIdx);
+
// Chroma U
w0 = wp0[1].w;
offset = wp0[1].o + wp1[1].o;
/* weighted averaging for uni-pred */
void Predict::addWeightUni(Yuv& predYuv, const ShortYuv& srcYuv, const WeightValues wp[3], bool bLuma, bool bChroma) const
{
- pixel* dstY = predYuv.getLumaAddr(m_puAbsPartIdx);
- pixel* dstU = predYuv.getCbAddr(m_puAbsPartIdx);
- pixel* dstV = predYuv.getCrAddr(m_puAbsPartIdx);
-
- const int16_t* srcY0 = srcYuv.getLumaAddr(m_puAbsPartIdx);
- const int16_t* srcU0 = srcYuv.getCbAddr(m_puAbsPartIdx);
- const int16_t* srcV0 = srcYuv.getCrAddr(m_puAbsPartIdx);
-
int w0, offset, shiftNum, shift, round;
uint32_t srcStride, dstStride;
if (bLuma)
{
+ pixel* dstY = predYuv.getLumaAddr(m_puAbsPartIdx);
+ const int16_t* srcY0 = srcYuv.getLumaAddr(m_puAbsPartIdx);
+
// Luma
w0 = wp[0].w;
offset = wp[0].offset;
srcStride = srcYuv.m_size;
dstStride = predYuv.m_size;
- primitives.weight_sp(const_cast<int16_t*>(srcY0), dstY, srcStride, dstStride, m_puWidth, m_puHeight, w0, round, shift, offset);
+ primitives.weight_sp(srcY0, dstY, srcStride, dstStride, m_puWidth, m_puHeight, w0, round, shift, offset);
}
if (bChroma)
{
+ pixel* dstU = predYuv.getCbAddr(m_puAbsPartIdx);
+ pixel* dstV = predYuv.getCrAddr(m_puAbsPartIdx);
+ const int16_t* srcU0 = srcYuv.getCbAddr(m_puAbsPartIdx);
+ const int16_t* srcV0 = srcYuv.getCrAddr(m_puAbsPartIdx);
+
// Chroma U
w0 = wp[1].w;
offset = wp[1].offset;
uint32_t cwidth = m_puWidth >> srcYuv.m_hChromaShift;
uint32_t cheight = m_puHeight >> srcYuv.m_vChromaShift;
- primitives.weight_sp(const_cast<int16_t*>(srcU0), dstU, srcStride, dstStride, cwidth, cheight, w0, round, shift, offset);
+ primitives.weight_sp(srcU0, dstU, srcStride, dstStride, cwidth, cheight, w0, round, shift, offset);
// Chroma V
w0 = wp[2].w;
shift = wp[2].shift + shiftNum;
round = shift ? (1 << (shift - 1)) : 0;
- primitives.weight_sp(const_cast<int16_t*>(srcV0), dstV, srcStride, dstStride, cwidth, cheight, w0, round, shift, offset);
+ primitives.weight_sp(srcV0, dstV, srcStride, dstStride, cwidth, cheight, w0, round, shift, offset);
}
}
int tuSize = intraNeighbors.tuSize;
int tuSize2 = tuSize << 1;
- pixel* adiOrigin = cu.m_encData->m_reconPicYuv->getLumaAddr(cu.m_cuAddr, cuGeom.encodeIdx + absPartIdx);
- intptr_t picStride = cu.m_encData->m_reconPicYuv->m_stride;
+ pixel* adiOrigin = cu.m_encData->m_reconPic->getLumaAddr(cu.m_cuAddr, cuGeom.encodeIdx + absPartIdx);
+ intptr_t picStride = cu.m_encData->m_reconPic->m_stride;
fillReferenceSamples(adiOrigin, picStride, adiBuf, intraNeighbors);
initIntraNeighbors(cu, absPartIdx, partDepth, false, &intraNeighbors);
uint32_t tuSize = intraNeighbors.tuSize;
- const pixel* adiOrigin = cu.m_encData->m_reconPicYuv->getChromaAddr(chromaId, cu.m_cuAddr, cuGeom.encodeIdx + absPartIdx);
- intptr_t picStride = cu.m_encData->m_reconPicYuv->m_strideC;
+ const pixel* adiOrigin = cu.m_encData->m_reconPic->getChromaAddr(chromaId, cu.m_cuAddr, cuGeom.encodeIdx + absPartIdx);
+ intptr_t picStride = cu.m_encData->m_reconPic->m_strideC;
pixel* adiRef = getAdiChromaBuf(chromaId, tuSize);
fillReferenceSamples(adiOrigin, picStride, adiRef, intraNeighbors);
}
int numIntraNeighbor = 0;
- bool *bNeighborFlags = intraNeighbors->bNeighborFlags;
+ bool* bNeighborFlags = intraNeighbors->bNeighborFlags;
uint32_t partIdxLT, partIdxRT, partIdxLB;
}
else // reference samples are partially available
{
- const bool *bNeighborFlags = intraNeighbors.bNeighborFlags;
- const bool *pNeighborFlags;
+ const bool* bNeighborFlags = intraNeighbors.bNeighborFlags;
+ const bool* pNeighborFlags;
int aboveUnits = intraNeighbors.aboveUnits;
int leftUnits = intraNeighbors.leftUnits;
int unitWidth = intraNeighbors.unitWidth;
int unitHeight = intraNeighbors.unitHeight;
int totalSamples = (leftUnits * unitHeight) + ((aboveUnits + 1) * unitWidth);
pixel adiLineBuffer[5 * MAX_CU_SIZE];
- pixel *adi;
+ pixel* adi;
// Initialize
for (int i = 0; i < totalSamples; i++)
while (next < totalUnits && !bNeighborFlags[next])
next++;
- pixel *pAdiLineNext = adiLineBuffer + ((next < leftUnits) ? (next * unitHeight) : (pAdiLineTopRowOffset + (next * unitWidth)));
+ pixel* pAdiLineNext = adiLineBuffer + ((next < leftUnits) ? (next * unitHeight) : (pAdiLineTopRowOffset + (next * unitWidth)));
const pixel refSample = *pAdiLineNext;
// Pad unavailable samples with new value
int nextOrTop = X265_MIN(next, leftUnits);
return cuAboveLeft && cuAboveLeft->isIntra(partAboveLeft);
}
-int Predict::isAboveAvailable(const CUData& cu, uint32_t partIdxLT, uint32_t partIdxRT, bool *bValidFlags)
+int Predict::isAboveAvailable(const CUData& cu, uint32_t partIdxLT, uint32_t partIdxRT, bool* bValidFlags)
{
const uint32_t rasterPartBegin = g_zscanToRaster[partIdxLT];
const uint32_t rasterPartEnd = g_zscanToRaster[partIdxRT] + 1;
const uint32_t idxStep = 1;
- bool *validFlagPtr = bValidFlags;
+ bool* validFlagPtr = bValidFlags;
int numIntra = 0;
for (uint32_t rasterPart = rasterPartBegin; rasterPart < rasterPartEnd; rasterPart += idxStep)
return numIntra;
}
-int Predict::isLeftAvailable(const CUData& cu, uint32_t partIdxLT, uint32_t partIdxLB, bool *bValidFlags)
+int Predict::isLeftAvailable(const CUData& cu, uint32_t partIdxLT, uint32_t partIdxLB, bool* bValidFlags)
{
const uint32_t rasterPartBegin = g_zscanToRaster[partIdxLT];
const uint32_t rasterPartEnd = g_zscanToRaster[partIdxLB] + 1;
const uint32_t idxStep = cu.m_slice->m_sps->numPartInCUSize;
- bool *validFlagPtr = bValidFlags;
+ bool* validFlagPtr = bValidFlags;
int numIntra = 0;
for (uint32_t rasterPart = rasterPartBegin; rasterPart < rasterPartEnd; rasterPart += idxStep)
return numIntra;
}
-int Predict::isAboveRightAvailable(const CUData& cu, uint32_t partIdxLT, uint32_t partIdxRT, bool *bValidFlags)
+int Predict::isAboveRightAvailable(const CUData& cu, uint32_t partIdxLT, uint32_t partIdxRT, bool* bValidFlags)
{
const uint32_t numUnitsInPU = g_zscanToRaster[partIdxRT] - g_zscanToRaster[partIdxLT] + 1;
- bool *validFlagPtr = bValidFlags;
+ bool* validFlagPtr = bValidFlags;
int numIntra = 0;
for (uint32_t offset = 1; offset <= numUnitsInPU; offset++)
return numIntra;
}
-int Predict::isBelowLeftAvailable(const CUData& cu, uint32_t partIdxLT, uint32_t partIdxLB, bool *bValidFlags)
+int Predict::isBelowLeftAvailable(const CUData& cu, uint32_t partIdxLT, uint32_t partIdxLB, bool* bValidFlags)
{
const uint32_t numUnitsInPU = (g_zscanToRaster[partIdxLB] - g_zscanToRaster[partIdxLT]) / cu.m_slice->m_sps->numPartInCUSize + 1;
- bool *validFlagPtr = bValidFlags;
+ bool* validFlagPtr = bValidFlags;
int numIntra = 0;
for (uint32_t offset = 1; offset <= numUnitsInPU; offset++)