<div dir="ltr">This patch was sent last week . Before sending this patch, it was not their in the repo. After sending this patch only, it has been pushed to the repo<div><br></div><div>Regards</div><div>Sumalatha<br><div><br>
</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 21, 2013 at 3:32 PM, Deepthi Nandakumar <span dir="ltr"><<a href="mailto:deepthi@multicorewareinc.com" target="_blank">deepthi@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This has already been accepted.<br><div><div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
<div><div class="h5">On Wed, Oct 16, 2013 at 5:18 PM, <span dir="ltr"><<a href="mailto:sumalatha@multicorewareinc.com" target="_blank">sumalatha@multicorewareinc.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"># HG changeset patch<br>
# User Sumalatha Polureddy<br>
# Date 1381924099 -19800<br>
# Node ID ac7aa89eae11d264992fd8495f6dcad8da85f243<br>
# Parent 3cdbc62783e197cd5cf6dcf5b1cc76e2cd6d93c2<br>
pass bLuma and bChroma parameters for functions<br>
<br>
Based on the values of two parameters, luma and chroma operations are done.<br>
Default value for both is set as true todo both operations<br>
<br>
diff -r 3cdbc62783e1 -r ac7aa89eae11 source/Lib/TLibCommon/TComPrediction.cpp<br>
--- a/source/Lib/TLibCommon/TComPrediction.cpp Wed Oct 16 12:17:21 2013 +0530<br>
+++ b/source/Lib/TLibCommon/TComPrediction.cpp Wed Oct 16 17:18:19 2013 +0530<br>
@@ -245,7 +245,7 @@<br>
return false;<br>
}<br>
<br>
-void TComPrediction::motionCompensation(TComDataCU* cu, TComYuv* predYuv, RefPicList picList, int partIdx)<br>
+void TComPrediction::motionCompensation(TComDataCU* cu, TComYuv* predYuv, RefPicList picList, int partIdx, bool bLuma, bool bChroma)<br>
{<br>
int width;<br>
int height;<br>
@@ -264,26 +264,27 @@<br>
<br>
MV mv = cu->getCUMvField(picList)->getMv(partAddr);<br>
cu->clipMv(mv);<br>
+ if (bLuma)<br>
+ xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);<br>
+ if (bChroma)<br>
+ xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);<br>
<br>
- xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);<br>
- xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);<br>
-<br>
- xWeightedPredictionUni(cu, pcMbYuv, partAddr, width, height, picList, predYuv);<br>
+ xWeightedPredictionUni(cu, pcMbYuv, partAddr, width, height, picList, predYuv, bLuma, bChroma);<br>
}<br>
else<br>
{<br>
- xPredInterUni(cu, partAddr, width, height, picList, predYuv);<br>
+ xPredInterUni(cu, partAddr, width, height, picList, predYuv, bLuma, bChroma);<br>
}<br>
}<br>
else<br>
{<br>
if (xCheckIdenticalMotion(cu, partAddr))<br>
{<br>
- xPredInterUni(cu, partAddr, width, height, REF_PIC_LIST_0, predYuv);<br>
+ xPredInterUni(cu, partAddr, width, height, REF_PIC_LIST_0, predYuv, bLuma, bChroma);<br>
}<br>
else<br>
{<br>
- xPredInterBi(cu, partAddr, width, height, predYuv);<br>
+ xPredInterBi(cu, partAddr, width, height, predYuv, bLuma, bChroma);<br>
}<br>
}<br>
return;<br>
@@ -305,31 +306,33 @@<br>
MV mv = cu->getCUMvField(picList)->getMv(partAddr);<br>
cu->clipMv(mv);<br>
<br>
- xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);<br>
- xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);<br>
+ if (bLuma)<br>
+ xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);<br>
+ if (bChroma)<br>
+ xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);<br>
<br>
- xWeightedPredictionUni(cu, pcMbYuv, partAddr, width, height, picList, predYuv);<br>
+ xWeightedPredictionUni(cu, pcMbYuv, partAddr, width, height, picList, predYuv, bLuma, bChroma);<br>
}<br>
else<br>
{<br>
- xPredInterUni(cu, partAddr, width, height, picList, predYuv);<br>
+ xPredInterUni(cu, partAddr, width, height, picList, predYuv, bLuma, bChroma);<br>
}<br>
}<br>
else<br>
{<br>
if (xCheckIdenticalMotion(cu, partAddr))<br>
{<br>
- xPredInterUni(cu, partAddr, width, height, REF_PIC_LIST_0, predYuv);<br>
+ xPredInterUni(cu, partAddr, width, height, REF_PIC_LIST_0, predYuv, bLuma, bChroma);<br>
}<br>
else<br>
{<br>
- xPredInterBi(cu, partAddr, width, height, predYuv);<br>
+ xPredInterBi(cu, partAddr, width, height, predYuv, bLuma, bChroma);<br>
}<br>
}<br>
}<br>
}<br>
<br>
-void TComPrediction::xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TComYuv* outPredYuv)<br>
+void TComPrediction::xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TComYuv* outPredYuv, bool bLuma, bool bChroma)<br>
{<br>
int refIdx = cu->getCUMvField(picList)->getRefIdx(partAddr);<br>
<br>
@@ -338,12 +341,14 @@<br>
MV mv = cu->getCUMvField(picList)->getMv(partAddr);<br>
cu->clipMv(mv);<br>
<br>
- xPredInterLumaBlk(cu, cu->getSlice()->m_mref[picList][refIdx], partAddr, &mv, width, height, outPredYuv);<br>
+ if (bLuma)<br>
+ xPredInterLumaBlk(cu, cu->getSlice()->m_mref[picList][refIdx], partAddr, &mv, width, height, outPredYuv);<br>
<br>
- xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refIdx)->getPicYuvRec(), partAddr, &mv, width, height, outPredYuv);<br>
+ if (bChroma)<br>
+ xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refIdx)->getPicYuvRec(), partAddr, &mv, width, height, outPredYuv);<br>
}<br>
<br>
-void TComPrediction::xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TShortYUV* outPredYuv)<br>
+void TComPrediction::xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TShortYUV* outPredYuv, bool bLuma, bool bChroma)<br>
{<br>
int refIdx = cu->getCUMvField(picList)->getRefIdx(partAddr);<br>
<br>
@@ -352,11 +357,13 @@<br>
MV mv = cu->getCUMvField(picList)->getMv(partAddr);<br>
cu->clipMv(mv);<br>
<br>
- xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refIdx)->getPicYuvRec(), partAddr, &mv, width, height, outPredYuv);<br>
- xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refIdx)->getPicYuvRec(), partAddr, &mv, width, height, outPredYuv);<br>
+ if (bLuma)<br>
+ xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refIdx)->getPicYuvRec(), partAddr, &mv, width, height, outPredYuv);<br>
+ if (bChroma)<br>
+ xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refIdx)->getPicYuvRec(), partAddr, &mv, width, height, outPredYuv);<br>
}<br>
<br>
-void TComPrediction::xPredInterBi(TComDataCU* cu, UInt partAddr, int width, int height, TComYuv*& outPredYuv)<br>
+void TComPrediction::xPredInterBi(TComDataCU* cu, UInt partAddr, int width, int height, TComYuv*& outPredYuv, bool bLuma, bool bChroma)<br>
{<br>
int refIdx[2] = { -1, -1 };<br>
<br>
@@ -371,16 +378,16 @@<br>
assert(refIdx[refList] < cu->getSlice()->getNumRefIdx(picList));<br>
<br>
pcMbYuv = &m_predShortYuv[refList];<br>
- xPredInterUni(cu, partAddr, width, height, picList, pcMbYuv);<br>
+ xPredInterUni(cu, partAddr, width, height, picList, pcMbYuv, bLuma, bChroma);<br>
}<br>
<br>
if (cu->getSlice()->getPPS()->getWPBiPred() && cu->getSlice()->getSliceType() == B_SLICE)<br>
{<br>
- xWeightedPredictionBi(cu, &m_predShortYuv[0], &m_predShortYuv[1], refIdx[0], refIdx[1], partAddr, width, height, outPredYuv);<br>
+ xWeightedPredictionBi(cu, &m_predShortYuv[0], &m_predShortYuv[1], refIdx[0], refIdx[1], partAddr, width, height, outPredYuv, bLuma, bChroma);<br>
}<br>
else<br>
{<br>
- outPredYuv->addAvg(&m_predShortYuv[0], &m_predShortYuv[1], partAddr, width, height);<br>
+ outPredYuv->addAvg(&m_predShortYuv[0], &m_predShortYuv[1], partAddr, width, height, bLuma, bChroma);<br>
}<br>
}<br>
else if (cu->getSlice()->getPPS()->getWPBiPred() && cu->getSlice()->getSliceType() == B_SLICE)<br>
@@ -399,10 +406,10 @@<br>
assert(refIdx[refList] < cu->getSlice()->getNumRefIdx(picList));<br>
<br>
pcMbYuv = &m_predShortYuv[refList];<br>
- xPredInterUni(cu, partAddr, width, height, picList, pcMbYuv);<br>
+ xPredInterUni(cu, partAddr, width, height, picList, pcMbYuv, bLuma, bChroma);<br>
}<br>
<br>
- xWeightedPredictionBi(cu, &m_predShortYuv[0], &m_predShortYuv[1], refIdx[0], refIdx[1], partAddr, width, height, outPredYuv);<br>
+ xWeightedPredictionBi(cu, &m_predShortYuv[0], &m_predShortYuv[1], refIdx[0], refIdx[1], partAddr, width, height, outPredYuv, bLuma, bChroma);<br>
}<br>
else if (cu->getSlice()->getPPS()->getUseWP() && cu->getSlice()->getSliceType() == P_SLICE)<br>
{<br>
@@ -421,11 +428,12 @@<br>
<br>
MV mv = cu->getCUMvField(picList)->getMv(partAddr);<br>
cu->clipMv(mv);<br>
+ if (bLuma)<br>
+ xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);<br>
+ if (bChroma)<br>
+ xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);<br>
<br>
- xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);<br>
- xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);<br>
-<br>
- xWeightedPredictionUni(cu, &m_predShortYuv[0], partAddr, width, height, REF_PIC_LIST_0, outPredYuv);<br>
+ xWeightedPredictionUni(cu, &m_predShortYuv[0], partAddr, width, height, REF_PIC_LIST_0, outPredYuv, bLuma, bChroma);<br>
}<br>
}<br>
else<br>
@@ -443,10 +451,10 @@<br>
assert(refIdx[refList] < cu->getSlice()->getNumRefIdx(picList));<br>
<br>
TComYuv* yuv = &m_predYuv[refList];<br>
- xPredInterUni(cu, partAddr, width, height, picList, yuv);<br>
+ xPredInterUni(cu, partAddr, width, height, picList, yuv, bLuma, bChroma);<br>
}<br>
<br>
- xWeightedAverage(&m_predYuv[0], &m_predYuv[1], refIdx[0], refIdx[1], partAddr, width, height, outPredYuv);<br>
+ xWeightedAverage(&m_predYuv[0], &m_predYuv[1], refIdx[0], refIdx[1], partAddr, width, height, outPredYuv, bLuma, bChroma);<br>
}<br>
}<br>
<br>
@@ -635,19 +643,19 @@<br>
}<br>
}<br>
<br>
-void TComPrediction::xWeightedAverage(TComYuv* srcYuv0, TComYuv* srcYuv1, int refIdx0, int refIdx1, UInt partIdx, int width, int height, TComYuv*& outDstYuv)<br>
+void TComPrediction::xWeightedAverage(TComYuv* srcYuv0, TComYuv* srcYuv1, int refIdx0, int refIdx1, UInt partIdx, int width, int height, TComYuv*& outDstYuv, bool bLuma, bool bChroma)<br>
{<br>
if (refIdx0 >= 0 && refIdx1 >= 0)<br>
{<br>
- outDstYuv->addAvg(srcYuv0, srcYuv1, partIdx, width, height);<br>
+ outDstYuv->addAvg(srcYuv0, srcYuv1, partIdx, width, height, bLuma, bChroma);<br>
}<br>
else if (refIdx0 >= 0 && refIdx1 < 0)<br>
{<br>
- srcYuv0->copyPartToPartYuv(outDstYuv, partIdx, width, height);<br>
+ srcYuv0->copyPartToPartYuv(outDstYuv, partIdx, width, height, bLuma, bChroma);<br>
}<br>
else if (refIdx0 < 0 && refIdx1 >= 0)<br>
{<br>
- srcYuv1->copyPartToPartYuv(outDstYuv, partIdx, width, height);<br>
+ srcYuv1->copyPartToPartYuv(outDstYuv, partIdx, width, height, bLuma, bChroma);<br>
}<br>
}<br>
<br>
diff -r 3cdbc62783e1 -r ac7aa89eae11 source/Lib/TLibCommon/TComPrediction.h<br>
--- a/source/Lib/TLibCommon/TComPrediction.h Wed Oct 16 12:17:21 2013 +0530<br>
+++ b/source/Lib/TLibCommon/TComPrediction.h Wed Oct 16 17:18:19 2013 +0530<br>
@@ -83,15 +83,15 @@<br>
int m_lumaRecStride; ///< stride of m_lumaRecBuffer<br>
<br>
// motion compensation functions<br>
- void xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TComYuv* outPredYuv);<br>
- void xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TShortYUV* outPredYuv);<br>
+ void xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TComYuv* outPredYuv, bool bLuma = true, bool bChroma = true);<br>
+ void xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TShortYUV* outPredYuv, bool bLuma = true, bool bChroma = true);<br>
void xPredInterLumaBlk(TComDataCU *cu, MotionReference *refPic, UInt partAddr, MV *mv, int width, int height, TComYuv *dstPic);<br>
void xPredInterLumaBlk(TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, MV *mv, int width, int height, TShortYUV *dstPic);<br>
void xPredInterChromaBlk(TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, MV *mv, int width, int height, TComYuv *dstPic);<br>
void xPredInterChromaBlk(TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, MV *mv, int width, int height, TShortYUV *dstPic);<br>
<br>
- void xPredInterBi(TComDataCU* cu, UInt partAddr, int width, int height, TComYuv*& outPredYuv);<br>
- void xWeightedAverage(TComYuv* srcYuv0, TComYuv* srcYuv1, int refIdx0, int refIdx1, UInt partAddr, int width, int height, TComYuv*& outDstYuv);<br>
+ void xPredInterBi(TComDataCU* cu, UInt partAddr, int width, int height, TComYuv*& outPredYuv, bool bLuma = true, bool bChroma = true);<br>
+ void xWeightedAverage(TComYuv* srcYuv0, TComYuv* srcYuv1, int refIdx0, int refIdx1, UInt partAddr, int width, int height, TComYuv*& outDstYuv, bool bLuma = true, bool bChroma = true);<br>
<br>
void xGetLLSPrediction(TComPattern* pcPattern, int* src0, int srcstride, Pel* dst0, int dststride, UInt width, UInt height, UInt ext0);<br>
<br>
@@ -107,7 +107,7 @@<br>
void initTempBuff();<br>
<br>
// inter<br>
- void motionCompensation(TComDataCU* cu, TComYuv* predYuv, RefPicList picList = REF_PIC_LIST_X, int partIdx = -1);<br>
+ void motionCompensation(TComDataCU* cu, TComYuv* predYuv, RefPicList picList = REF_PIC_LIST_X, int partIdx = -1, bool bLuma = true, bool bChroma = true);<br>
<br>
// motion vector prediction<br>
void getMvPredAMVP(TComDataCU* cu, UInt partIdx, UInt partAddr, RefPicList picList, MV& mvPred);<br>
diff -r 3cdbc62783e1 -r ac7aa89eae11 source/Lib/TLibCommon/TComWeightPrediction.cpp<br>
--- a/source/Lib/TLibCommon/TComWeightPrediction.cpp Wed Oct 16 12:17:21 2013 +0530<br>
+++ b/source/Lib/TLibCommon/TComWeightPrediction.cpp Wed Oct 16 17:18:19 2013 +0530<br>
@@ -80,7 +80,7 @@<br>
* \param TComYuv* outDstYuv<br>
* \returns void<br>
*/<br>
-void TComWeightPrediction::addWeightBi(TComYuv* srcYuv0, TComYuv* srcYuv1, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* outDstYuv, bool bRound)<br>
+void TComWeightPrediction::addWeightBi(TComYuv* srcYuv0, TComYuv* srcYuv1, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* outDstYuv, bool bRound, bool bLuma, bool bChroma)<br>
{<br>
int x, y;<br>
<br>
@@ -96,90 +96,96 @@<br>
Pel* dstU = outDstYuv->getCbAddr(partUnitIdx);<br>
Pel* dstV = outDstYuv->getCrAddr(partUnitIdx);<br>
<br>
- // Luma : --------------------------------------------<br>
- int w0 = wp0[0].w;<br>
- int offset = wp0[0].offset;<br>
- int shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
- int shift = wp0[0].shift + shiftNum;<br>
- int round = shift ? (1 << (shift - 1)) * bRound : 0;<br>
- int w1 = wp1[0].w;<br>
+ if (bLuma)<br>
+ {<br>
+ // Luma : --------------------------------------------<br>
+ int w0 = wp0[0].w;<br>
+ int offset = wp0[0].offset;<br>
+ int shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
+ int shift = wp0[0].shift + shiftNum;<br>
+ int round = shift ? (1 << (shift - 1)) * bRound : 0;<br>
+ int w1 = wp1[0].w;<br>
<br>
- UInt src0Stride = srcYuv0->getStride();<br>
- UInt src1Stride = srcYuv1->getStride();<br>
- UInt dststride = outDstYuv->getStride();<br>
+ UInt src0Stride = srcYuv0->getStride();<br>
+ UInt src1Stride = srcYuv1->getStride();<br>
+ UInt dststride = outDstYuv->getStride();<br>
<br>
- for (y = height - 1; y >= 0; y--)<br>
+ for (y = height - 1; y >= 0; y--)<br>
+ {<br>
+ for (x = width - 1; x >= 0; )<br>
+ {<br>
+ // note: luma min width is 4<br>
+ pDstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
+ x--;<br>
+ pDstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
+ x--;<br>
+ pDstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
+ x--;<br>
+ pDstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
+ x--;<br>
+ }<br>
+<br>
+ srcY0 += src0Stride;<br>
+ srcY1 += src1Stride;<br>
+ pDstY += dststride;<br>
+ }<br>
+ }<br>
+<br>
+ if (bChroma)<br>
{<br>
- for (x = width - 1; x >= 0; )<br>
+ // Chroma U : --------------------------------------------<br>
+ int w0 = wp0[1].w;<br>
+ int offset = wp0[1].offset;<br>
+ int shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
+ int shift = wp0[1].shift + shiftNum;<br>
+ int round = shift ? (1 << (shift - 1)) : 0;<br>
+ int w1 = wp1[1].w;<br>
+<br>
+ UInt src0Stride = srcYuv0->getCStride();<br>
+ UInt src1Stride = srcYuv1->getCStride();<br>
+ UInt dststride = outDstYuv->getCStride();<br>
+<br>
+ width >>= 1;<br>
+ height >>= 1;<br>
+<br>
+ for (y = height - 1; y >= 0; y--)<br>
{<br>
- // note: luma min width is 4<br>
- pDstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
- x--;<br>
- pDstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
- x--;<br>
- pDstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
- x--;<br>
- pDstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
- x--;<br>
+ for (x = width - 1; x >= 0; )<br>
+ {<br>
+ // note: chroma min width is 2<br>
+ dstU[x] = weightBidirC(w0, srcU0[x], w1, srcU1[x], round, shift, offset);<br>
+ x--;<br>
+ dstU[x] = weightBidirC(w0, srcU0[x], w1, srcU1[x], round, shift, offset);<br>
+ x--;<br>
+ }<br>
+<br>
+ srcU0 += src0Stride;<br>
+ srcU1 += src1Stride;<br>
+ dstU += dststride;<br>
}<br>
<br>
- srcY0 += src0Stride;<br>
- srcY1 += src1Stride;<br>
- pDstY += dststride;<br>
- }<br>
+ // Chroma V : --------------------------------------------<br>
+ w0 = wp0[2].w;<br>
+ offset = wp0[2].offset;<br>
+ shift = wp0[2].shift + shiftNum;<br>
+ round = shift ? (1 << (shift - 1)) : 0;<br>
+ w1 = wp1[2].w;<br>
<br>
- // Chroma U : --------------------------------------------<br>
- w0 = wp0[1].w;<br>
- offset = wp0[1].offset;<br>
- shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
- shift = wp0[1].shift + shiftNum;<br>
- round = shift ? (1 << (shift - 1)) : 0;<br>
- w1 = wp1[1].w;<br>
+ for (y = height - 1; y >= 0; y--)<br>
+ {<br>
+ for (x = width - 1; x >= 0; )<br>
+ {<br>
+ // note: chroma min width is 2<br>
+ dstV[x] = weightBidirC(w0, srcV0[x], w1, srcV1[x], round, shift, offset);<br>
+ x--;<br>
+ dstV[x] = weightBidirC(w0, srcV0[x], w1, srcV1[x], round, shift, offset);<br>
+ x--;<br>
+ }<br>
<br>
- src0Stride = srcYuv0->getCStride();<br>
- src1Stride = srcYuv1->getCStride();<br>
- dststride = outDstYuv->getCStride();<br>
-<br>
- width >>= 1;<br>
- height >>= 1;<br>
-<br>
- for (y = height - 1; y >= 0; y--)<br>
- {<br>
- for (x = width - 1; x >= 0; )<br>
- {<br>
- // note: chroma min width is 2<br>
- dstU[x] = weightBidirC(w0, srcU0[x], w1, srcU1[x], round, shift, offset);<br>
- x--;<br>
- dstU[x] = weightBidirC(w0, srcU0[x], w1, srcU1[x], round, shift, offset);<br>
- x--;<br>
+ srcV0 += src0Stride;<br>
+ srcV1 += src1Stride;<br>
+ dstV += dststride;<br>
}<br>
-<br>
- srcU0 += src0Stride;<br>
- srcU1 += src1Stride;<br>
- dstU += dststride;<br>
- }<br>
-<br>
- // Chroma V : --------------------------------------------<br>
- w0 = wp0[2].w;<br>
- offset = wp0[2].offset;<br>
- shift = wp0[2].shift + shiftNum;<br>
- round = shift ? (1 << (shift - 1)) : 0;<br>
- w1 = wp1[2].w;<br>
-<br>
- for (y = height - 1; y >= 0; y--)<br>
- {<br>
- for (x = width - 1; x >= 0; )<br>
- {<br>
- // note: chroma min width is 2<br>
- dstV[x] = weightBidirC(w0, srcV0[x], w1, srcV1[x], round, shift, offset);<br>
- x--;<br>
- dstV[x] = weightBidirC(w0, srcV0[x], w1, srcV1[x], round, shift, offset);<br>
- x--;<br>
- }<br>
-<br>
- srcV0 += src0Stride;<br>
- srcV1 += src1Stride;<br>
- dstV += dststride;<br>
}<br>
}<br>
<br>
@@ -194,10 +200,13 @@<br>
* \param TComYuv* outDstYuv<br>
* \returns void<br>
*/<br>
-void TComWeightPrediction::addWeightBi(TShortYUV* srcYuv0, TShortYUV* srcYuv1, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* outDstYuv, bool bRound)<br>
+void TComWeightPrediction::addWeightBi(TShortYUV* srcYuv0, TShortYUV* srcYuv1, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* outDstYuv, bool bRound, bool bLuma, bool bChroma)<br>
{<br>
int x, y;<br>
<br>
+ int w0,w1, offset, shiftNum, shift, round;<br>
+ UInt src0Stride, src1Stride, dststride;<br>
+<br>
short* srcY0 = srcYuv0->getLumaAddr(partUnitIdx);<br>
short* srcU0 = srcYuv0->getCbAddr(partUnitIdx);<br>
short* srcV0 = srcYuv0->getCrAddr(partUnitIdx);<br>
@@ -210,90 +219,96 @@<br>
Pel* dstU = outDstYuv->getCbAddr(partUnitIdx);<br>
Pel* dstV = outDstYuv->getCrAddr(partUnitIdx);<br>
<br>
- // Luma : --------------------------------------------<br>
- int w0 = wp0[0].w;<br>
- int offset = wp0[0].offset;<br>
- int shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
- int shift = wp0[0].shift + shiftNum;<br>
- int round = shift ? (1 << (shift - 1)) * bRound : 0;<br>
- int w1 = wp1[0].w;<br>
+ if (bLuma)<br>
+ {<br>
+ // Luma : --------------------------------------------<br>
+ w0 = wp0[0].w;<br>
+ offset = wp0[0].offset;<br>
+ shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
+ shift = wp0[0].shift + shiftNum;<br>
+ round = shift ? (1 << (shift - 1)) * bRound : 0;<br>
+ w1 = wp1[0].w;<br>
<br>
- UInt src0Stride = srcYuv0->m_width;<br>
- UInt src1Stride = srcYuv1->m_width;<br>
- UInt dststride = outDstYuv->getStride();<br>
+ src0Stride = srcYuv0->m_width;<br>
+ src1Stride = srcYuv1->m_width;<br>
+ dststride = outDstYuv->getStride();<br>
<br>
- for (y = height - 1; y >= 0; y--)<br>
+ for (y = height - 1; y >= 0; y--)<br>
+ {<br>
+ for (x = width - 1; x >= 0; )<br>
+ {<br>
+ // note: luma min width is 4<br>
+ dstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
+ x--;<br>
+ dstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
+ x--;<br>
+ dstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
+ x--;<br>
+ dstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
+ x--;<br>
+ }<br>
+<br>
+ srcY0 += src0Stride;<br>
+ srcY1 += src1Stride;<br>
+ dstY += dststride;<br>
+ }<br>
+ }<br>
+<br>
+ if (bChroma)<br>
{<br>
- for (x = width - 1; x >= 0; )<br>
+ // Chroma U : --------------------------------------------<br>
+ w0 = wp0[1].w;<br>
+ offset = wp0[1].offset;<br>
+ shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
+ shift = wp0[1].shift + shiftNum;<br>
+ round = shift ? (1 << (shift - 1)) : 0;<br>
+ w1 = wp1[1].w;<br>
+<br>
+ src0Stride = srcYuv0->m_cwidth;<br>
+ src1Stride = srcYuv1->m_cwidth;<br>
+ dststride = outDstYuv->getCStride();<br>
+<br>
+ width >>= 1;<br>
+ height >>= 1;<br>
+<br>
+ for (y = height - 1; y >= 0; y--)<br>
{<br>
- // note: luma min width is 4<br>
- dstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
- x--;<br>
- dstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
- x--;<br>
- dstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
- x--;<br>
- dstY[x] = weightBidirY(w0, srcY0[x], w1, srcY1[x], round, shift, offset);<br>
- x--;<br>
+ for (x = width - 1; x >= 0; )<br>
+ {<br>
+ // note: chroma min width is 2<br>
+ dstU[x] = weightBidirC(w0, srcU0[x], w1, srcU1[x], round, shift, offset);<br>
+ x--;<br>
+ dstU[x] = weightBidirC(w0, srcU0[x], w1, srcU1[x], round, shift, offset);<br>
+ x--;<br>
+ }<br>
+<br>
+ srcU0 += src0Stride;<br>
+ srcU1 += src1Stride;<br>
+ dstU += dststride;<br>
}<br>
<br>
- srcY0 += src0Stride;<br>
- srcY1 += src1Stride;<br>
- dstY += dststride;<br>
- }<br>
+ // Chroma V : --------------------------------------------<br>
+ w0 = wp0[2].w;<br>
+ offset = wp0[2].offset;<br>
+ shift = wp0[2].shift + shiftNum;<br>
+ round = shift ? (1 << (shift - 1)) : 0;<br>
+ w1 = wp1[2].w;<br>
<br>
- // Chroma U : --------------------------------------------<br>
- w0 = wp0[1].w;<br>
- offset = wp0[1].offset;<br>
- shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
- shift = wp0[1].shift + shiftNum;<br>
- round = shift ? (1 << (shift - 1)) : 0;<br>
- w1 = wp1[1].w;<br>
+ for (y = height - 1; y >= 0; y--)<br>
+ {<br>
+ for (x = width - 1; x >= 0; )<br>
+ {<br>
+ // note: chroma min width is 2<br>
+ dstV[x] = weightBidirC(w0, srcV0[x], w1, srcV1[x], round, shift, offset);<br>
+ x--;<br>
+ dstV[x] = weightBidirC(w0, srcV0[x], w1, srcV1[x], round, shift, offset);<br>
+ x--;<br>
+ }<br>
<br>
- src0Stride = srcYuv0->m_cwidth;<br>
- src1Stride = srcYuv1->m_cwidth;<br>
- dststride = outDstYuv->getCStride();<br>
-<br>
- width >>= 1;<br>
- height >>= 1;<br>
-<br>
- for (y = height - 1; y >= 0; y--)<br>
- {<br>
- for (x = width - 1; x >= 0; )<br>
- {<br>
- // note: chroma min width is 2<br>
- dstU[x] = weightBidirC(w0, srcU0[x], w1, srcU1[x], round, shift, offset);<br>
- x--;<br>
- dstU[x] = weightBidirC(w0, srcU0[x], w1, srcU1[x], round, shift, offset);<br>
- x--;<br>
+ srcV0 += src0Stride;<br>
+ srcV1 += src1Stride;<br>
+ dstV += dststride;<br>
}<br>
-<br>
- srcU0 += src0Stride;<br>
- srcU1 += src1Stride;<br>
- dstU += dststride;<br>
- }<br>
-<br>
- // Chroma V : --------------------------------------------<br>
- w0 = wp0[2].w;<br>
- offset = wp0[2].offset;<br>
- shift = wp0[2].shift + shiftNum;<br>
- round = shift ? (1 << (shift - 1)) : 0;<br>
- w1 = wp1[2].w;<br>
-<br>
- for (y = height - 1; y >= 0; y--)<br>
- {<br>
- for (x = width - 1; x >= 0; )<br>
- {<br>
- // note: chroma min width is 2<br>
- dstV[x] = weightBidirC(w0, srcV0[x], w1, srcV1[x], round, shift, offset);<br>
- x--;<br>
- dstV[x] = weightBidirC(w0, srcV0[x], w1, srcV1[x], round, shift, offset);<br>
- x--;<br>
- }<br>
-<br>
- srcV0 += src0Stride;<br>
- srcV1 += src1Stride;<br>
- dstV += dststride;<br>
}<br>
}<br>
<br>
@@ -306,10 +321,13 @@<br>
* \param TComYuv* outDstYuv<br>
* \returns void<br>
*/<br>
-void TComWeightPrediction::addWeightUni(TComYuv* srcYuv0, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, TComYuv* outDstYuv)<br>
+void TComWeightPrediction::addWeightUni(TComYuv* srcYuv0, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, TComYuv* outDstYuv, bool bLuma, bool bChroma)<br>
{<br>
int x, y;<br>
<br>
+ int w0, offset, shiftNum, shift, round;<br>
+ UInt src0Stride, dststride;<br>
+<br>
Pel* srcY0 = srcYuv0->getLumaAddr(partUnitIdx);<br>
Pel* srcU0 = srcYuv0->getCbAddr(partUnitIdx);<br>
Pel* srcV0 = srcYuv0->getCrAddr(partUnitIdx);<br>
@@ -318,81 +336,87 @@<br>
Pel* dstU = outDstYuv->getCbAddr(partUnitIdx);<br>
Pel* dstV = outDstYuv->getCrAddr(partUnitIdx);<br>
<br>
- // Luma : --------------------------------------------<br>
- int w0 = wp0[0].w;<br>
- int offset = wp0[0].offset;<br>
- int shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
- int shift = wp0[0].shift + shiftNum;<br>
- int round = shift ? (1 << (shift - 1)) : 0;<br>
- UInt src0Stride = srcYuv0->getStride();<br>
- UInt dststride = outDstYuv->getStride();<br>
+ if (bLuma)<br>
+ {<br>
+ // Luma : --------------------------------------------<br>
+ w0 = wp0[0].w;<br>
+ offset = wp0[0].offset;<br>
+ shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
+ shift = wp0[0].shift + shiftNum;<br>
+ round = shift ? (1 << (shift - 1)) : 0;<br>
+ src0Stride = srcYuv0->getStride();<br>
+ dststride = outDstYuv->getStride();<br>
<br>
- for (y = height - 1; y >= 0; y--)<br>
+ for (y = height - 1; y >= 0; y--)<br>
+ {<br>
+ for (x = width - 1; x >= 0; )<br>
+ {<br>
+ // note: luma min width is 4<br>
+ dstY[x] = weightUnidirY(w0, srcY0[x], round, shift, offset);<br>
+ x--;<br>
+ dstY[x] = weightUnidirY(w0, srcY0[x], round, shift, offset);<br>
+ x--;<br>
+ dstY[x] = weightUnidirY(w0, srcY0[x], round, shift, offset);<br>
+ x--;<br>
+ dstY[x] = weightUnidirY(w0, srcY0[x], round, shift, offset);<br>
+ x--;<br>
+ }<br>
+<br>
+ srcY0 += src0Stride;<br>
+ dstY += dststride;<br>
+ }<br>
+ }<br>
+<br>
+ if (bChroma)<br>
{<br>
- for (x = width - 1; x >= 0; )<br>
+ // Chroma U : --------------------------------------------<br>
+ w0 = wp0[1].w;<br>
+ offset = wp0[1].offset;<br>
+ shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
+ shift = wp0[1].shift + shiftNum;<br>
+ round = shift ? (1 << (shift - 1)) : 0;<br>
+<br>
+ src0Stride = srcYuv0->getCStride();<br>
+ dststride = outDstYuv->getCStride();<br>
+<br>
+ width >>= 1;<br>
+ height >>= 1;<br>
+<br>
+ for (y = height - 1; y >= 0; y--)<br>
{<br>
- // note: luma min width is 4<br>
- dstY[x] = weightUnidirY(w0, srcY0[x], round, shift, offset);<br>
- x--;<br>
- dstY[x] = weightUnidirY(w0, srcY0[x], round, shift, offset);<br>
- x--;<br>
- dstY[x] = weightUnidirY(w0, srcY0[x], round, shift, offset);<br>
- x--;<br>
- dstY[x] = weightUnidirY(w0, srcY0[x], round, shift, offset);<br>
- x--;<br>
+ for (x = width - 1; x >= 0; )<br>
+ {<br>
+ // note: chroma min width is 2<br>
+ dstU[x] = weightUnidirC(w0, srcU0[x], round, shift, offset);<br>
+ x--;<br>
+ dstU[x] = weightUnidirC(w0, srcU0[x], round, shift, offset);<br>
+ x--;<br>
+ }<br>
+<br>
+ srcU0 += src0Stride;<br>
+ dstU += dststride;<br>
}<br>
<br>
- srcY0 += src0Stride;<br>
- dstY += dststride;<br>
- }<br>
+ // Chroma V : --------------------------------------------<br>
+ w0 = wp0[2].w;<br>
+ offset = wp0[2].offset;<br>
+ shift = wp0[2].shift + shiftNum;<br>
+ round = shift ? (1 << (shift - 1)) : 0;<br>
<br>
- // Chroma U : --------------------------------------------<br>
- w0 = wp0[1].w;<br>
- offset = wp0[1].offset;<br>
- shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
- shift = wp0[1].shift + shiftNum;<br>
- round = shift ? (1 << (shift - 1)) : 0;<br>
+ for (y = height - 1; y >= 0; y--)<br>
+ {<br>
+ for (x = width - 1; x >= 0; )<br>
+ {<br>
+ // note: chroma min width is 2<br>
+ dstV[x] = weightUnidirC(w0, srcV0[x], round, shift, offset);<br>
+ x--;<br>
+ dstV[x] = weightUnidirC(w0, srcV0[x], round, shift, offset);<br>
+ x--;<br>
+ }<br>
<br>
- src0Stride = srcYuv0->getCStride();<br>
- dststride = outDstYuv->getCStride();<br>
-<br>
- width >>= 1;<br>
- height >>= 1;<br>
-<br>
- for (y = height - 1; y >= 0; y--)<br>
- {<br>
- for (x = width - 1; x >= 0; )<br>
- {<br>
- // note: chroma min width is 2<br>
- dstU[x] = weightUnidirC(w0, srcU0[x], round, shift, offset);<br>
- x--;<br>
- dstU[x] = weightUnidirC(w0, srcU0[x], round, shift, offset);<br>
- x--;<br>
+ srcV0 += src0Stride;<br>
+ dstV += dststride;<br>
}<br>
-<br>
- srcU0 += src0Stride;<br>
- dstU += dststride;<br>
- }<br>
-<br>
- // Chroma V : --------------------------------------------<br>
- w0 = wp0[2].w;<br>
- offset = wp0[2].offset;<br>
- shift = wp0[2].shift + shiftNum;<br>
- round = shift ? (1 << (shift - 1)) : 0;<br>
-<br>
- for (y = height - 1; y >= 0; y--)<br>
- {<br>
- for (x = width - 1; x >= 0; )<br>
- {<br>
- // note: chroma min width is 2<br>
- dstV[x] = weightUnidirC(w0, srcV0[x], round, shift, offset);<br>
- x--;<br>
- dstV[x] = weightUnidirC(w0, srcV0[x], round, shift, offset);<br>
- x--;<br>
- }<br>
-<br>
- srcV0 += src0Stride;<br>
- dstV += dststride;<br>
}<br>
}<br>
<br>
@@ -406,7 +430,7 @@<br>
* \returns void<br>
*/<br>
<br>
-void TComWeightPrediction::addWeightUni(TShortYUV* srcYuv0, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, TComYuv* outDstYuv, bool justChroma)<br>
+void TComWeightPrediction::addWeightUni(TShortYUV* srcYuv0, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, TComYuv* outDstYuv, bool bLuma, bool bChroma)<br>
{<br>
short* srcY0 = srcYuv0->getLumaAddr(partUnitIdx);<br>
short* srcU0 = srcYuv0->getCbAddr(partUnitIdx);<br>
@@ -420,7 +444,7 @@<br>
int w0, offset, shiftNum, shift, round;<br>
UInt srcStride, dstStride;<br>
<br>
- if(!justChroma)<br>
+ if (bLuma)<br>
{<br>
// Luma : --------------------------------------------<br>
w0 = wp0[0].w;<br>
@@ -434,28 +458,31 @@<br>
primitives.weightpUni((int16_t *)srcY0, dstY, srcStride, dstStride, width, height, w0, round, shift, offset);<br>
}<br>
<br>
- // Chroma U : --------------------------------------------<br>
- w0 = wp0[1].w;<br>
- offset = wp0[1].offset;<br>
- shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
- shift = wp0[1].shift + shiftNum;<br>
- round = shift ? (1 << (shift - 1)) : 0;<br>
+ if (bChroma)<br>
+ {<br>
+ // Chroma U : --------------------------------------------<br>
+ w0 = wp0[1].w;<br>
+ offset = wp0[1].offset;<br>
+ shiftNum = IF_INTERNAL_PREC - X265_DEPTH;<br>
+ shift = wp0[1].shift + shiftNum;<br>
+ round = shift ? (1 << (shift - 1)) : 0;<br>
<br>
- srcStride = srcYuv0->m_cwidth;<br>
- dstStride = outDstYuv->getCStride();<br>
+ srcStride = srcYuv0->m_cwidth;<br>
+ dstStride = outDstYuv->getCStride();<br>
<br>
- width >>= 1;<br>
- height >>= 1;<br>
+ width >>= 1;<br>
+ height >>= 1;<br>
<br>
- primitives.weightpUni((int16_t *)srcU0, dstU, srcStride, dstStride, width, height, w0, round, shift, offset);<br>
+ primitives.weightpUni((int16_t *)srcU0, dstU, srcStride, dstStride, width, height, w0, round, shift, offset);<br>
<br>
- // Chroma V : --------------------------------------------<br>
- w0 = wp0[2].w;<br>
- offset = wp0[2].offset;<br>
- shift = wp0[2].shift + shiftNum;<br>
- round = shift ? (1 << (shift - 1)) : 0;<br>
+ // Chroma V : --------------------------------------------<br>
+ w0 = wp0[2].w;<br>
+ offset = wp0[2].offset;<br>
+ shift = wp0[2].shift + shiftNum;<br>
+ round = shift ? (1 << (shift - 1)) : 0;<br>
<br>
- primitives.weightpUni((int16_t *)srcV0, dstV, srcStride, dstStride, width, height, w0, round, shift, offset);<br>
+ primitives.weightpUni((int16_t *)srcV0, dstV, srcStride, dstStride, width, height, w0, round, shift, offset);<br>
+ }<br>
}<br>
<br>
//=======================================================<br>
@@ -546,7 +573,7 @@<br>
* \param TComYuv* outDstYuv<br>
* \returns void<br>
*/<br>
-void TComWeightPrediction::xWeightedPredictionBi(TComDataCU* cu, TComYuv* srcYuv0, TComYuv* srcYuv1, int refIdx0, int refIdx1, UInt partIdx, int width, int height, TComYuv* outDstYuv)<br>
+void TComWeightPrediction::xWeightedPredictionBi(TComDataCU* cu, TComYuv* srcYuv0, TComYuv* srcYuv1, int refIdx0, int refIdx1, UInt partIdx, int width, int height, TComYuv* outDstYuv, bool bLuma, bool bChroma)<br>
{<br>
wpScalingParam *pwp0, *pwp1;<br>
<br>
@@ -554,15 +581,15 @@<br>
<br>
if (refIdx0 >= 0 && refIdx1 >= 0)<br>
{<br>
- addWeightBi(srcYuv0, srcYuv1, partIdx, width, height, pwp0, pwp1, outDstYuv);<br>
+ addWeightBi(srcYuv0, srcYuv1, partIdx, width, height, pwp0, pwp1, outDstYuv, bLuma, bChroma);<br>
}<br>
else if (refIdx0 >= 0 && refIdx1 < 0)<br>
{<br>
- addWeightUni(srcYuv0, partIdx, width, height, pwp0, outDstYuv);<br>
+ addWeightUni(srcYuv0, partIdx, width, height, pwp0, outDstYuv, bLuma, bChroma);<br>
}<br>
else if (refIdx0 < 0 && refIdx1 >= 0)<br>
{<br>
- addWeightUni(srcYuv1, partIdx, width, height, pwp1, outDstYuv);<br>
+ addWeightUni(srcYuv1, partIdx, width, height, pwp1, outDstYuv, bLuma, bChroma);<br>
}<br>
else<br>
{<br>
@@ -582,7 +609,7 @@<br>
* \param TComYuv* outDstYuv<br>
* \returns void<br>
*/<br>
-void TComWeightPrediction::xWeightedPredictionBi(TComDataCU* cu, TShortYUV* srcYuv0, TShortYUV* srcYuv1, int refIdx0, int refIdx1, UInt partIdx, int width, int height, TComYuv* outDstYuv)<br>
+void TComWeightPrediction::xWeightedPredictionBi(TComDataCU* cu, TShortYUV* srcYuv0, TShortYUV* srcYuv1, int refIdx0, int refIdx1, UInt partIdx, int width, int height, TComYuv* outDstYuv, bool bLuma, bool bChroma)<br>
{<br>
wpScalingParam *pwp0, *pwp1;<br>
<br>
@@ -590,15 +617,15 @@<br>
<br>
if (refIdx0 >= 0 && refIdx1 >= 0)<br>
{<br>
- addWeightBi(srcYuv0, srcYuv1, partIdx, width, height, pwp0, pwp1, outDstYuv);<br>
+ addWeightBi(srcYuv0, srcYuv1, partIdx, width, height, pwp0, pwp1, outDstYuv, bLuma, bChroma);<br>
}<br>
else if (refIdx0 >= 0 && refIdx1 < 0)<br>
{<br>
- addWeightUni(srcYuv0, partIdx, width, height, pwp0, outDstYuv);<br>
+ addWeightUni(srcYuv0, partIdx, width, height, pwp0, outDstYuv, bLuma, bChroma);<br>
}<br>
else if (refIdx0 < 0 && refIdx1 >= 0)<br>
{<br>
- addWeightUni(srcYuv1, partIdx, width, height, pwp1, outDstYuv);<br>
+ addWeightUni(srcYuv1, partIdx, width, height, pwp1, outDstYuv, bLuma, bChroma);<br>
}<br>
else<br>
{<br>
@@ -618,7 +645,7 @@<br>
* \param refIdx<br>
* \returns void<br>
*/<br>
-void TComWeightPrediction::xWeightedPredictionUni(TComDataCU* cu, TComYuv* srcYuv, UInt partAddr, int width, int height, RefPicList picList, TComYuv*& outPredYuv, int refIdx)<br>
+void TComWeightPrediction::xWeightedPredictionUni(TComDataCU* cu, TComYuv* srcYuv, UInt partAddr, int width, int height, RefPicList picList, TComYuv*& outPredYuv, int refIdx, bool bLuma, bool bChroma)<br>
{<br>
wpScalingParam *pwp, *pwpTmp;<br>
<br>
@@ -636,7 +663,7 @@<br>
{<br>
getWpScaling(cu, -1, refIdx, pwpTmp, pwp);<br>
}<br>
- addWeightUni(srcYuv, partAddr, width, height, pwp, outPredYuv);<br>
+ addWeightUni(srcYuv, partAddr, width, height, pwp, outPredYuv, bLuma, bChroma);<br>
}<br>
<br>
/** weighted prediction for uni-pred<br>
@@ -651,7 +678,7 @@<br>
* \param refIdx<br>
* \returns void<br>
*/<br>
-void TComWeightPrediction::xWeightedPredictionUni(TComDataCU* cu, TShortYUV* srcYuv, UInt partAddr, int width, int height, RefPicList picList, TComYuv*& outPredYuv, int refIdx)<br>
+void TComWeightPrediction::xWeightedPredictionUni(TComDataCU* cu, TShortYUV* srcYuv, UInt partAddr, int width, int height, RefPicList picList, TComYuv*& outPredYuv, int refIdx, bool bLuma, bool bChroma)<br>
{<br>
wpScalingParam *pwp, *pwpTmp;<br>
<br>
@@ -669,5 +696,5 @@<br>
{<br>
getWpScaling(cu, -1, refIdx, pwpTmp, pwp);<br>
}<br>
- addWeightUni(srcYuv, partAddr, width, height, pwp, outPredYuv);<br>
+ addWeightUni(srcYuv, partAddr, width, height, pwp, outPredYuv, bLuma, bChroma);<br>
}<br>
diff -r 3cdbc62783e1 -r ac7aa89eae11 source/Lib/TLibCommon/TComWeightPrediction.h<br>
--- a/source/Lib/TLibCommon/TComWeightPrediction.h Wed Oct 16 12:17:21 2013 +0530<br>
+++ b/source/Lib/TLibCommon/TComWeightPrediction.h Wed Oct 16 17:18:19 2013 +0530<br>
@@ -60,15 +60,15 @@<br>
<br>
void getWpScaling(TComDataCU* cu, int refIdx0, int refIdx1, wpScalingParam *&wp0, wpScalingParam *&wp1);<br>
<br>
- void addWeightBi(TComYuv* srcYuv0, TComYuv* srcYuv1, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* outDstYuv, bool bRound = true);<br>
- void addWeightBi(TShortYUV* srcYuv0, TShortYUV* srcYuv1, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* outDstYuv, bool bRound = true);<br>
- void addWeightUni(TComYuv* srcYuv0, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, TComYuv* outDstYuv);<br>
- void addWeightUni(TShortYUV* srcYuv0, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, TComYuv* outDstYuv, bool justChroma = false);<br>
+ void addWeightBi(TComYuv* srcYuv0, TComYuv* srcYuv1, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* outDstYuv, bool bRound = true, bool bLuma = true, bool bChroma = true);<br>
+ void addWeightBi(TShortYUV* srcYuv0, TShortYUV* srcYuv1, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* outDstYuv, bool bRound = true, bool bLuma = true, bool bChroma = true);<br>
+ void addWeightUni(TComYuv* srcYuv0, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, TComYuv* outDstYuv, bool bLuma = true, bool bChroma = true);<br>
+ void addWeightUni(TShortYUV* srcYuv0, UInt partUnitIdx, UInt width, UInt height, wpScalingParam *wp0, TComYuv* outDstYuv, bool bLuma = true, bool bChroma = true);<br>
<br>
- void xWeightedPredictionUni(TComDataCU* cu, TComYuv* srcYuv, UInt partAddr, int width, int height, RefPicList picList, TComYuv*& outPredYuv, int refIdx = -1);<br>
- void xWeightedPredictionUni(TComDataCU* cu, TShortYUV* srcYuv, UInt partAddr, int width, int height, RefPicList picList, TComYuv*& outPredYuv, int refIdx = -1);<br>
- void xWeightedPredictionBi(TComDataCU* cu, TComYuv* srcYuv0, TComYuv* srcYuv1, int refIdx0, int refIdx1, UInt partIdx, int width, int height, TComYuv* outDstYuv);<br>
- void xWeightedPredictionBi(TComDataCU* cu, TShortYUV* srcYuv0, TShortYUV* srcYuv1, int refIdx0, int refIdx1, UInt partIdx, int width, int height, TComYuv* outDstYuv);<br>
+ void xWeightedPredictionUni(TComDataCU* cu, TComYuv* srcYuv, UInt partAddr, int width, int height, RefPicList picList, TComYuv*& outPredYuv, int refIdx = -1, bool bLuma = true, bool bChroma = true);<br>
+ void xWeightedPredictionUni(TComDataCU* cu, TShortYUV* srcYuv, UInt partAddr, int width, int height, RefPicList picList, TComYuv*& outPredYuv, int refIdx = -1, bool bLuma = true, bool bChroma = true);<br>
+ void xWeightedPredictionBi(TComDataCU* cu, TComYuv* srcYuv0, TComYuv* srcYuv1, int refIdx0, int refIdx1, UInt partIdx, int width, int height, TComYuv* outDstYuv, bool bLuma = true, bool bChroma = true);<br>
+ void xWeightedPredictionBi(TComDataCU* cu, TShortYUV* srcYuv0, TShortYUV* srcYuv1, int refIdx0, int refIdx1, UInt partIdx, int width, int height, TComYuv* outDstYuv, bool bLuma = true, bool bChroma = true);<br>
};<br>
}<br>
<br>
diff -r 3cdbc62783e1 -r ac7aa89eae11 source/Lib/TLibCommon/TComYuv.cpp<br>
--- a/source/Lib/TLibCommon/TComYuv.cpp Wed Oct 16 12:17:21 2013 +0530<br>
+++ b/source/Lib/TLibCommon/TComYuv.cpp Wed Oct 16 17:18:19 2013 +0530<br>
@@ -234,16 +234,20 @@<br>
primitives.blockcpy_pp(uiCWidth, uiCHeight, dstV, dststride, srcV, srcstride);<br>
}<br>
<br>
-void TComYuv::copyPartToPartYuv(TComYuv* dstPicYuv, UInt partIdx, UInt width, UInt height)<br>
+void TComYuv::copyPartToPartYuv(TComYuv* dstPicYuv, UInt partIdx, UInt width, UInt height, bool bLuma, bool bChroma)<br>
{<br>
- copyPartToPartLuma(dstPicYuv, partIdx, width, height);<br>
- copyPartToPartChroma(dstPicYuv, partIdx, width >> 1, height >> 1);<br>
+ if(bLuma)<br>
+ copyPartToPartLuma(dstPicYuv, partIdx, width, height);<br>
+ if(bChroma)<br>
+ copyPartToPartChroma(dstPicYuv, partIdx, width >> 1, height >> 1);<br>
}<br>
<br>
-void TComYuv::copyPartToPartYuv(TShortYUV* dstPicYuv, UInt partIdx, UInt width, UInt height)<br>
+void TComYuv::copyPartToPartYuv(TShortYUV* dstPicYuv, UInt partIdx, UInt width, UInt height, bool bLuma, bool bChroma)<br>
{<br>
- copyPartToPartLuma(dstPicYuv, partIdx, width, height);<br>
- copyPartToPartChroma(dstPicYuv, partIdx, width >> 1, height >> 1);<br>
+ if(bLuma)<br>
+ copyPartToPartLuma(dstPicYuv, partIdx, width, height);<br>
+ if(bChroma)<br>
+ copyPartToPartChroma(dstPicYuv, partIdx, width >> 1, height >> 1);<br>
}<br>
<br>
void TComYuv::copyPartToPartLuma(TComYuv* dstPicYuv, UInt partIdx, UInt width, UInt height)<br>
@@ -529,9 +533,11 @@<br>
}<br>
}<br>
<br>
-void TComYuv::addAvg(TComYuv* srcYuv0, TComYuv* srcYuv1, UInt partUnitIdx, UInt width, UInt height)<br>
+void TComYuv::addAvg(TComYuv* srcYuv0, TComYuv* srcYuv1, UInt partUnitIdx, UInt width, UInt height, bool bLuma, bool bChroma)<br>
{<br>
int x, y;<br>
+ UInt src0Stride, src1Stride, dststride;<br>
+ int shiftNum, offset;<br>
<br>
Pel* srcY0 = srcYuv0->getLumaAddr(partUnitIdx);<br>
Pel* srcU0 = srcYuv0->getCbAddr(partUnitIdx);<br>
@@ -545,62 +551,69 @@<br>
Pel* dstU = getCbAddr(partUnitIdx);<br>
Pel* dstV = getCrAddr(partUnitIdx);<br>
<br>
- UInt src0Stride = srcYuv0->getStride();<br>
- UInt src1Stride = srcYuv1->getStride();<br>
- UInt dststride = getStride();<br>
- int shiftNum = IF_INTERNAL_PREC + 1 - X265_DEPTH;<br>
- int offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS;<br>
+ if(bLuma)<br>
+ {<br>
+ src0Stride = srcYuv0->getStride();<br>
+ src1Stride = srcYuv1->getStride();<br>
+ dststride = getStride();<br>
+ shiftNum = IF_INTERNAL_PREC + 1 - X265_DEPTH;<br>
+ offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS;<br>
<br>
- for (y = 0; y < height; y++)<br>
+ for (y = 0; y < height; y++)<br>
+ {<br>
+ for (x = 0; x < width; x += 4)<br>
+ {<br>
+ dstY[x + 0] = ClipY((srcY0[x + 0] + srcY1[x + 0] + offset) >> shiftNum);<br>
+ dstY[x + 1] = ClipY((srcY0[x + 1] + srcY1[x + 1] + offset) >> shiftNum);<br>
+ dstY[x + 2] = ClipY((srcY0[x + 2] + srcY1[x + 2] + offset) >> shiftNum);<br>
+ dstY[x + 3] = ClipY((srcY0[x + 3] + srcY1[x + 3] + offset) >> shiftNum);<br>
+ }<br>
+<br>
+ srcY0 += src0Stride;<br>
+ srcY1 += src1Stride;<br>
+ dstY += dststride;<br>
+ }<br>
+ }<br>
+ if(bChroma)<br>
{<br>
- for (x = 0; x < width; x += 4)<br>
+ shiftNum = IF_INTERNAL_PREC + 1 - X265_DEPTH;<br>
+ offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS;<br>
+<br>
+ src0Stride = srcYuv0->getCStride();<br>
+ src1Stride = srcYuv1->getCStride();<br>
+ dststride = getCStride();<br>
+<br>
+ width >>= 1;<br>
+ height >>= 1;<br>
+<br>
+ for (y = height - 1; y >= 0; y--)<br>
{<br>
- dstY[x + 0] = ClipY((srcY0[x + 0] + srcY1[x + 0] + offset) >> shiftNum);<br>
- dstY[x + 1] = ClipY((srcY0[x + 1] + srcY1[x + 1] + offset) >> shiftNum);<br>
- dstY[x + 2] = ClipY((srcY0[x + 2] + srcY1[x + 2] + offset) >> shiftNum);<br>
- dstY[x + 3] = ClipY((srcY0[x + 3] + srcY1[x + 3] + offset) >> shiftNum);<br>
+ for (x = width - 1; x >= 0; )<br>
+ {<br>
+ // note: chroma min width is 2<br>
+ dstU[x] = ClipC((srcU0[x] + srcU1[x] + offset) >> shiftNum);<br>
+ dstV[x] = ClipC((srcV0[x] + srcV1[x] + offset) >> shiftNum);<br>
+ x--;<br>
+ dstU[x] = ClipC((srcU0[x] + srcU1[x] + offset) >> shiftNum);<br>
+ dstV[x] = ClipC((srcV0[x] + srcV1[x] + offset) >> shiftNum);<br>
+ x--;<br>
+ }<br>
+<br>
+ srcU0 += src0Stride;<br>
+ srcU1 += src1Stride;<br>
+ srcV0 += src0Stride;<br>
+ srcV1 += src1Stride;<br>
+ dstU += dststride;<br>
+ dstV += dststride;<br>
}<br>
-<br>
- srcY0 += src0Stride;<br>
- srcY1 += src1Stride;<br>
- dstY += dststride;<br>
- }<br>
-<br>
- shiftNum = IF_INTERNAL_PREC + 1 - X265_DEPTH;<br>
- offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS;<br>
-<br>
- src0Stride = srcYuv0->getCStride();<br>
- src1Stride = srcYuv1->getCStride();<br>
- dststride = getCStride();<br>
-<br>
- width >>= 1;<br>
- height >>= 1;<br>
-<br>
- for (y = height - 1; y >= 0; y--)<br>
- {<br>
- for (x = width - 1; x >= 0; )<br>
- {<br>
- // note: chroma min width is 2<br>
- dstU[x] = ClipC((srcU0[x] + srcU1[x] + offset) >> shiftNum);<br>
- dstV[x] = ClipC((srcV0[x] + srcV1[x] + offset) >> shiftNum);<br>
- x--;<br>
- dstU[x] = ClipC((srcU0[x] + srcU1[x] + offset) >> shiftNum);<br>
- dstV[x] = ClipC((srcV0[x] + srcV1[x] + offset) >> shiftNum);<br>
- x--;<br>
- }<br>
-<br>
- srcU0 += src0Stride;<br>
- srcU1 += src1Stride;<br>
- srcV0 += src0Stride;<br>
- srcV1 += src1Stride;<br>
- dstU += dststride;<br>
- dstV += dststride;<br>
}<br>
}<br>
<br>
-void TComYuv::addAvg(TShortYUV* srcYuv0, TShortYUV* srcYuv1, UInt partUnitIdx, UInt width, UInt height)<br>
+void TComYuv::addAvg(TShortYUV* srcYuv0, TShortYUV* srcYuv1, UInt partUnitIdx, UInt width, UInt height, bool bLuma, bool bChroma)<br>
{<br>
int x, y;<br>
+ UInt src0Stride, src1Stride, dststride;<br>
+ int shiftNum, offset;<br>
<br>
short* srcY0 = srcYuv0->getLumaAddr(partUnitIdx);<br>
short* srcU0 = srcYuv0->getCbAddr(partUnitIdx);<br>
@@ -614,56 +627,61 @@<br>
Pel* dstU = getCbAddr(partUnitIdx);<br>
Pel* dstV = getCrAddr(partUnitIdx);<br>
<br>
- UInt src0Stride = srcYuv0->m_width;<br>
- UInt src1Stride = srcYuv1->m_width;<br>
- UInt dststride = getStride();<br>
- int shiftNum = IF_INTERNAL_PREC + 1 - X265_DEPTH;<br>
- int offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS;<br>
+ if(bLuma)<br>
+ {<br>
+ src0Stride = srcYuv0->m_width;<br>
+ src1Stride = srcYuv1->m_width;<br>
+ dststride = getStride();<br>
+ shiftNum = IF_INTERNAL_PREC + 1 - X265_DEPTH;<br>
+ offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS;<br>
<br>
- for (y = 0; y < height; y++)<br>
+ for (y = 0; y < height; y++)<br>
+ {<br>
+ for (x = 0; x < width; x += 4)<br>
+ {<br>
+ dstY[x + 0] = ClipY((srcY0[x + 0] + srcY1[x + 0] + offset) >> shiftNum);<br>
+ dstY[x + 1] = ClipY((srcY0[x + 1] + srcY1[x + 1] + offset) >> shiftNum);<br>
+ dstY[x + 2] = ClipY((srcY0[x + 2] + srcY1[x + 2] + offset) >> shiftNum);<br>
+ dstY[x + 3] = ClipY((srcY0[x + 3] + srcY1[x + 3] + offset) >> shiftNum);<br>
+ }<br>
+<br>
+ srcY0 += src0Stride;<br>
+ srcY1 += src1Stride;<br>
+ dstY += dststride;<br>
+ }<br>
+ }<br>
+ if(bChroma)<br>
{<br>
- for (x = 0; x < width; x += 4)<br>
+ shiftNum = IF_INTERNAL_PREC + 1 - X265_DEPTH;<br>
+ offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS;<br>
+<br>
+ src0Stride = srcYuv0->m_cwidth;<br>
+ src1Stride = srcYuv1->m_cwidth;<br>
+ dststride = getCStride();<br>
+<br>
+ width >>= 1;<br>
+ height >>= 1;<br>
+<br>
+ for (y = height - 1; y >= 0; y--)<br>
{<br>
- dstY[x + 0] = ClipY((srcY0[x + 0] + srcY1[x + 0] + offset) >> shiftNum);<br>
- dstY[x + 1] = ClipY((srcY0[x + 1] + srcY1[x + 1] + offset) >> shiftNum);<br>
- dstY[x + 2] = ClipY((srcY0[x + 2] + srcY1[x + 2] + offset) >> shiftNum);<br>
- dstY[x + 3] = ClipY((srcY0[x + 3] + srcY1[x + 3] + offset) >> shiftNum);<br>
+ for (x = width - 1; x >= 0; )<br>
+ {<br>
+ // note: chroma min width is 2<br>
+ dstU[x] = ClipC((srcU0[x] + srcU1[x] + offset) >> shiftNum);<br>
+ dstV[x] = ClipC((srcV0[x] + srcV1[x] + offset) >> shiftNum);<br>
+ x--;<br>
+ dstU[x] = ClipC((srcU0[x] + srcU1[x] + offset) >> shiftNum);<br>
+ dstV[x] = ClipC((srcV0[x] + srcV1[x] + offset) >> shiftNum);<br>
+ x--;<br>
+ }<br>
+<br>
+ srcU0 += src0Stride;<br>
+ srcU1 += src1Stride;<br>
+ srcV0 += src0Stride;<br>
+ srcV1 += src1Stride;<br>
+ dstU += dststride;<br>
+ dstV += dststride;<br>
}<br>
-<br>
- srcY0 += src0Stride;<br>
- srcY1 += src1Stride;<br>
- dstY += dststride;<br>
- }<br>
-<br>
- shiftNum = IF_INTERNAL_PREC + 1 - X265_DEPTH;<br>
- offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS;<br>
-<br>
- src0Stride = srcYuv0->m_cwidth;<br>
- src1Stride = srcYuv1->m_cwidth;<br>
- dststride = getCStride();<br>
-<br>
- width >>= 1;<br>
- height >>= 1;<br>
-<br>
- for (y = height - 1; y >= 0; y--)<br>
- {<br>
- for (x = width - 1; x >= 0; )<br>
- {<br>
- // note: chroma min width is 2<br>
- dstU[x] = ClipC((srcU0[x] + srcU1[x] + offset) >> shiftNum);<br>
- dstV[x] = ClipC((srcV0[x] + srcV1[x] + offset) >> shiftNum);<br>
- x--;<br>
- dstU[x] = ClipC((srcU0[x] + srcU1[x] + offset) >> shiftNum);<br>
- dstV[x] = ClipC((srcV0[x] + srcV1[x] + offset) >> shiftNum);<br>
- x--;<br>
- }<br>
-<br>
- srcU0 += src0Stride;<br>
- srcU1 += src1Stride;<br>
- srcV0 += src0Stride;<br>
- srcV1 += src1Stride;<br>
- dstU += dststride;<br>
- dstV += dststride;<br>
}<br>
}<br>
<br>
diff -r 3cdbc62783e1 -r ac7aa89eae11 source/Lib/TLibCommon/TComYuv.h<br>
--- a/source/Lib/TLibCommon/TComYuv.h Wed Oct 16 12:17:21 2013 +0530<br>
+++ b/source/Lib/TLibCommon/TComYuv.h Wed Oct 16 17:18:19 2013 +0530<br>
@@ -132,8 +132,8 @@<br>
void copyPartToChroma(TComYuv* dstPicYuv, UInt uiSrcPartIdx);<br>
<br>
// Copy YUV partition buffer to other YUV partition buffer<br>
- void copyPartToPartYuv(TComYuv* dstPicYuv, UInt partIdx, UInt width, UInt height);<br>
- void copyPartToPartYuv(TShortYUV* dstPicYuv, UInt partIdx, UInt width, UInt height);<br>
+ void copyPartToPartYuv(TComYuv* dstPicYuv, UInt partIdx, UInt width, UInt height, bool bLuma = true, bool bChroma = true);<br>
+ void copyPartToPartYuv(TShortYUV* dstPicYuv, UInt partIdx, UInt width, UInt height, bool bLuma = true, bool bChroma = true);<br>
void copyPartToPartLuma(TComYuv* dstPicYuv, UInt partIdx, UInt width, UInt height);<br>
void copyPartToPartLuma(TShortYUV* dstPicYuv, UInt partIdx, UInt width, UInt height);<br>
void copyPartToPartChroma(TComYuv* dstPicYuv, UInt partIdx, UInt width, UInt height);<br>
@@ -160,8 +160,8 @@<br>
void subtractChroma(TComYuv* srcYuv0, TComYuv* srcYuv1, UInt trUnitIdx, UInt partSize);<br>
<br>
// (srcYuv0 + srcYuv1)/2 for YUV partition<br>
- void addAvg(TComYuv* srcYuv0, TComYuv* srcYuv1, UInt partUnitIdx, UInt width, UInt height);<br>
- void addAvg(TShortYUV* srcYuv0, TShortYUV* srcYuv1, UInt partUnitIdx, UInt width, UInt height);<br>
+ void addAvg(TComYuv* srcYuv0, TComYuv* srcYuv1, UInt partUnitIdx, UInt width, UInt height, bool bLuma = true, bool bChroma = true);<br>
+ void addAvg(TShortYUV* srcYuv0, TShortYUV* srcYuv1, UInt partUnitIdx, UInt width, UInt height, bool bLuma = true, bool bChroma = true);<br>
<br>
// Remove High frequency<br>
void removeHighFreq(TComYuv* srcYuv, UInt partIdx, UInt width, UInt height);<br>
diff -r 3cdbc62783e1 -r ac7aa89eae11 source/Lib/TLibEncoder/TEncSearch.cpp<br>
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Wed Oct 16 12:17:21 2013 +0530<br>
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Wed Oct 16 17:18:19 2013 +0530<br>
@@ -2196,7 +2196,7 @@<br>
* \param bUseMRG<br>
* \returns void<br>
*/<br>
-void TEncSearch::predInterSearch(TComDataCU* cu, TComYuv* predYuv, bool bUseMRG)<br>
+void TEncSearch::predInterSearch(TComDataCU* cu, TComYuv* predYuv, bool bUseMRG, bool bLuma, bool bChroma)<br>
{<br>
MV mvzero(0, 0);<br>
MV mv[2];<br>
@@ -2521,7 +2521,7 @@<br>
#endif<br>
}<br>
}<br>
- motionCompensation(cu, predYuv, REF_PIC_LIST_X, partIdx);<br>
+ motionCompensation(cu, predYuv, REF_PIC_LIST_X, partIdx, bLuma, bChroma);<br>
}<br>
<br>
setWpScalingDistParam(cu, -1, REF_PIC_LIST_X);<br>
diff -r 3cdbc62783e1 -r ac7aa89eae11 source/Lib/TLibEncoder/TEncSearch.h<br>
--- a/source/Lib/TLibEncoder/TEncSearch.h Wed Oct 16 12:17:21 2013 +0530<br>
+++ b/source/Lib/TLibEncoder/TEncSearch.h Wed Oct 16 17:18:19 2013 +0530<br>
@@ -142,7 +142,7 @@<br>
TComYuv* reconYuv, UInt precalcDistC);<br>
<br>
/// encoder estimation - inter prediction (non-skip)<br>
- void predInterSearch(TComDataCU* cu, TComYuv* predYuv, bool bUseMRG = false);<br>
+ void predInterSearch(TComDataCU* cu, TComYuv* predYuv, bool bUseMRG = false, bool bLuma = true, bool bChroma = true);<br>
<br>
/// encode residual and compute rd-cost for inter mode<br>
void encodeResAndCalcRdInterCU(TComDataCU* cu, TComYuv* fencYuv, TComYuv* predYuv, TShortYUV* resiYuv, TShortYUV* bestResiYuv,<br></div></div>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org" target="_blank">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></div>
<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>
<br></blockquote></div><br></div>