[x265-commits] [x265] TEncSearch: fix gcc warning, remove redundant assignemnt
Steve Borho
steve at borho.org
Mon Mar 10 21:43:44 CET 2014
details: http://hg.videolan.org/x265/rev/f76a92a2b00b
branches:
changeset: 6431:f76a92a2b00b
user: Steve Borho <steve at borho.org>
date: Mon Mar 10 12:16:50 2014 -0500
description:
TEncSearch: fix gcc warning, remove redundant assignemnt
Subject: [x265] TEncSearch: fix bMergeOnly override check, did not intend to change behavior
details: http://hg.videolan.org/x265/rev/505d4a83704a
branches:
changeset: 6432:505d4a83704a
user: Steve Borho <steve at borho.org>
date: Mon Mar 10 15:13:30 2014 -0500
description:
TEncSearch: fix bMergeOnly override check, did not intend to change behavior
Subject: [x265] cleanup unused intra !bLumaOnly path
details: http://hg.videolan.org/x265/rev/ee6e6fd867eb
branches:
changeset: 6433:ee6e6fd867eb
user: Satoshi Nakagawa <nakagawa424 at oki.com>
date: Mon Mar 10 15:12:47 2014 +0900
description:
cleanup unused intra !bLumaOnly path
Subject: [x265] tencsbac: subLayerOrderingInfoPresentFlag always true, the if() loop will never executed
details: http://hg.videolan.org/x265/rev/752bdc470b06
branches:
changeset: 6434:752bdc470b06
user: Gopu Govindaswamy
date: Mon Mar 10 12:09:54 2014 +0530
description:
tencsbac: subLayerOrderingInfoPresentFlag always true, the if() loop will never executed
vps_sub_layer_ordering_info_present_flag is always set to true, not required to have extra storage for this,
removed subLayerOrderingInfoPresentFlag
Subject: [x265] tencsbac: remove unused SCALING_LIST_OUTPUT_RESULT macro
details: http://hg.videolan.org/x265/rev/9c57962437b6
branches:
changeset: 6435:9c57962437b6
user: Gopu Govindaswamy
date: Mon Mar 10 12:14:41 2014 +0530
description:
tencsbac: remove unused SCALING_LIST_OUTPUT_RESULT macro
Subject: [x265] tcommotion: use Checked malloc to allocate memory
details: http://hg.videolan.org/x265/rev/728df17d1e5f
branches:
changeset: 6436:728df17d1e5f
user: Gopu Govindaswamy
date: Mon Mar 10 16:55:28 2014 +0530
description:
tcommotion: use Checked malloc to allocate memory
Subject: [x265] tcommotion: cleanup removed unused methods
details: http://hg.videolan.org/x265/rev/37a33cbf5b57
branches:
changeset: 6437:37a33cbf5b57
user: Gopu Govindaswamy
date: Mon Mar 10 17:09:31 2014 +0530
description:
tcommotion: cleanup removed unused methods
Subject: [x265] vbv: use row wise IntraSatdCost to predict vbv intra frame bits.
details: http://hg.videolan.org/x265/rev/092bc3753097
branches:
changeset: 6438:092bc3753097
user: Aarthi Thirumalai
date: Tue Mar 11 00:17:53 2014 +0530
description:
vbv: use row wise IntraSatdCost to predict vbv intra frame bits.
If P/B slice is predominatly intra coded, use intra SatdCost to predict the row
bits in vbv.
Subject: [x265] vbv: bug fixes - move row Predictors, frameSizeEstimated to Frame Encoder scope.
details: http://hg.videolan.org/x265/rev/925b4b3a01c0
branches:
changeset: 6439:925b4b3a01c0
user: Aarthi Thirumalai
date: Tue Mar 11 01:05:50 2014 +0530
description:
vbv: bug fixes - move row Predictors, frameSizeEstimated to Frame Encoder scope.
Improves quality and controls buffer underflow when Frame parallelism is enabled.
Subject: [x265] rc: move qp2qscale and qscale2qp function to common
details: http://hg.videolan.org/x265/rev/5fb584576fc9
branches:
changeset: 6440:5fb584576fc9
user: Aarthi Thirumalai
date: Tue Mar 11 01:16:28 2014 +0530
description:
rc: move qp2qscale and qscale2qp function to common
Subject: [x265] shortyuv: integrated asm primitives for blockcopy
details: http://hg.videolan.org/x265/rev/1417ba917211
branches:
changeset: 6441:1417ba917211
user: Murugan Vairavel <murugan at multicorewareinc.com>
date: Mon Mar 10 16:59:22 2014 +0530
description:
shortyuv: integrated asm primitives for blockcopy
diffstat:
source/Lib/TLibCommon/TComDataCU.cpp | 27 +-
source/Lib/TLibCommon/TComDataCU.h | 2 -
source/Lib/TLibCommon/TComMotionInfo.cpp | 26 +-
source/Lib/TLibCommon/TComMotionInfo.h | 15 +-
source/Lib/TLibCommon/TComPic.cpp | 8 +
source/Lib/TLibCommon/TComPic.h | 2 +
source/Lib/TLibCommon/TComYuv.cpp | 20 +-
source/Lib/TLibCommon/TComYuv.h | 2 +-
source/Lib/TLibEncoder/TEncCu.cpp | 16 +-
source/Lib/TLibEncoder/TEncSbac.cpp | 25 +-
source/Lib/TLibEncoder/TEncSearch.cpp | 448 ++++--------------------------
source/Lib/TLibEncoder/TEncSearch.h | 17 +-
source/common/common.cpp | 12 +
source/common/common.h | 2 +
source/common/shortyuv.cpp | 111 ++-----
source/common/shortyuv.h | 10 +-
source/encoder/compress.cpp | 9 +-
source/encoder/encoder.cpp | 7 +-
source/encoder/ratecontrol.cpp | 107 +++---
source/encoder/ratecontrol.h | 27 +-
20 files changed, 245 insertions(+), 648 deletions(-)
diffs (truncated from 2036 to 300 lines):
diff -r 50d7910ddd61 -r 1417ba917211 source/Lib/TLibCommon/TComDataCU.cpp
--- a/source/Lib/TLibCommon/TComDataCU.cpp Sun Mar 09 22:10:39 2014 -0500
+++ b/source/Lib/TLibCommon/TComDataCU.cpp Mon Mar 10 16:59:22 2014 +0530
@@ -120,8 +120,9 @@ bool TComDataCU::create(uint32_t numPart
tmp = g_convertToBit[tmp] + 2;
m_unitMask = ~((1 << tmp) - 1);
- m_cuMvField[0].create(numPartition);
- m_cuMvField[1].create(numPartition);
+ bool ok = true;
+ ok &= m_cuMvField[0].create(numPartition);
+ ok &= m_cuMvField[1].create(numPartition);
CHECKED_MALLOC(m_qp, char, numPartition);
CHECKED_MALLOC(m_depth, UChar, numPartition);
@@ -159,10 +160,11 @@ bool TComDataCU::create(uint32_t numPart
CHECKED_MALLOC(m_pattern, TComPattern, 1);
memset(m_partSizes, SIZE_NONE, numPartition * sizeof(*m_partSizes));
- return m_pattern;
+ return ok;
fail:
- return false;
+ ok = false;
+ return ok;
}
void TComDataCU::destroy()
@@ -2442,23 +2444,6 @@ void TComDataCU::clipMv(MV& outMV)
outMV.y = X265_MIN(ymax, X265_MAX(ymin, (int)outMV.y));
}
-uint32_t TComDataCU::getIntraSizeIdx(uint32_t absPartIdx)
-{
- uint32_t shift = (m_partSizes[absPartIdx] == SIZE_NxN ? 1 : 0);
-
- UChar width = m_cuSize[absPartIdx] >> shift;
- uint32_t cnt = 0;
-
- while (width)
- {
- cnt++;
- width >>= 1;
- }
-
- cnt -= 2;
- return cnt > 6 ? 6 : cnt;
-}
-
/** Set a I_PCM flag for all sub-partitions of a partition.
* \param bIpcmFlag I_PCM flag
* \param absPartIdx partition index
diff -r 50d7910ddd61 -r 1417ba917211 source/Lib/TLibCommon/TComDataCU.h
--- a/source/Lib/TLibCommon/TComDataCU.h Sun Mar 09 22:10:39 2014 -0500
+++ b/source/Lib/TLibCommon/TComDataCU.h Mon Mar 10 16:59:22 2014 +0530
@@ -445,8 +445,6 @@ public:
// member functions for symbol prediction (most probable / mode conversion)
// -------------------------------------------------------------------------------------------------------------------
- uint32_t getIntraSizeIdx(uint32_t absPartIdx);
-
void getAllowedChromaDir(uint32_t absPartIdx, uint32_t* modeList);
int getIntraDirLumaPredictor(uint32_t absPartIdx, int32_t* intraDirPred);
diff -r 50d7910ddd61 -r 1417ba917211 source/Lib/TLibCommon/TComMotionInfo.cpp
--- a/source/Lib/TLibCommon/TComMotionInfo.cpp Sun Mar 09 22:10:39 2014 -0500
+++ b/source/Lib/TLibCommon/TComMotionInfo.cpp Mon Mar 10 16:59:22 2014 +0530
@@ -51,28 +51,24 @@ using namespace x265;
// Create / destroy
// --------------------------------------------------------------------------------------------------------------------
-void TComCUMvField::create(uint32_t numPartition)
+bool TComCUMvField::create(uint32_t numPartition)
{
- assert(m_mv == NULL);
- assert(m_mvd == NULL);
- assert(m_refIdx == NULL);
-
- m_mv = new MV[numPartition];
- m_mvd = new MV[numPartition];
- m_refIdx = new char[numPartition];
+ CHECKED_MALLOC(m_mv, MV, numPartition);
+ CHECKED_MALLOC(m_mvd, MV, numPartition);
+ CHECKED_MALLOC(m_refIdx, char, numPartition);
m_numPartitions = numPartition;
+
+ return true;
+fail:
+ return false;
}
void TComCUMvField::destroy()
{
- assert(m_mv != NULL);
- assert(m_mvd != NULL);
- assert(m_refIdx != NULL);
-
- delete[] m_mv;
- delete[] m_mvd;
- delete[] m_refIdx;
+ X265_FREE(m_mv);
+ X265_FREE(m_mvd);
+ X265_FREE(m_refIdx);
m_mv = NULL;
m_mvd = NULL;
diff -r 50d7910ddd61 -r 1417ba917211 source/Lib/TLibCommon/TComMotionInfo.h
--- a/source/Lib/TLibCommon/TComMotionInfo.h Sun Mar 09 22:10:39 2014 -0500
+++ b/source/Lib/TLibCommon/TComMotionInfo.h Mon Mar 10 16:59:22 2014 +0530
@@ -102,7 +102,7 @@ public:
// create / destroy
// ------------------------------------------------------------------------------------------------------------------
- void create(uint32_t numPartition);
+ bool create(uint32_t numPartition);
void destroy();
// ------------------------------------------------------------------------------------------------------------------
@@ -134,19 +134,6 @@ public:
void setAllMvField(const TComMvField& mvField, PartSize mbMode, int partAddr, uint32_t depth, int partIdx = 0);
void setMvd(int idx, const MV& mvd) { m_mvd[idx] = mvd; }
- void setNumPartition(int numPart)
- {
- m_numPartitions = numPart;
- }
-
- void linkToWithOffset(const TComCUMvField* src, int offset)
- {
- m_mv = src->m_mv + offset;
- m_mvd = src->m_mvd + offset;
- m_refIdx = src->m_refIdx + offset;
- }
-
- void compress(char* pePredMode, int scale);
};
}
diff -r 50d7910ddd61 -r 1417ba917211 source/Lib/TLibCommon/TComPic.cpp
--- a/source/Lib/TLibCommon/TComPic.cpp Sun Mar 09 22:10:39 2014 -0500
+++ b/source/Lib/TLibCommon/TComPic.cpp Mon Mar 10 16:59:22 2014 +0530
@@ -59,10 +59,12 @@ TComPic::TComPic()
, m_rowDiagQp(NULL)
, m_rowDiagQScale(NULL)
, m_rowDiagSatd(NULL)
+ , m_rowDiagIntraSatd(NULL)
, m_rowEncodedBits(NULL)
, m_numEncodedCusPerRow(NULL)
, m_rowSatdForVbv(NULL)
, m_cuCostsForVbv(NULL)
+ , m_intraCuCostsForVbv(NULL)
{
m_reconRowCount = 0;
m_countRefEncoders = 0;
@@ -119,10 +121,12 @@ bool TComPic::create(Encoder* cfg)
CHECKED_MALLOC(m_rowDiagQp, double, numRows);
CHECKED_MALLOC(m_rowDiagQScale, double, numRows);
CHECKED_MALLOC(m_rowDiagSatd, uint32_t, numRows);
+ CHECKED_MALLOC(m_rowDiagIntraSatd, uint32_t, numRows);
CHECKED_MALLOC(m_rowEncodedBits, uint32_t, numRows);
CHECKED_MALLOC(m_numEncodedCusPerRow, uint32_t, numRows);
CHECKED_MALLOC(m_rowSatdForVbv, uint32_t, numRows);
CHECKED_MALLOC(m_cuCostsForVbv, uint32_t, numRows * numCols);
+ CHECKED_MALLOC(m_intraCuCostsForVbv, uint32_t, numRows * numCols);
CHECKED_MALLOC(m_qpaRc, double, numRows);
}
reInit(cfg);
@@ -144,10 +148,12 @@ void TComPic::reInit(Encoder* cfg)
memset(m_rowDiagQp, 0, numRows * sizeof(double));
memset(m_rowDiagQScale, 0, numRows * sizeof(double));
memset(m_rowDiagSatd, 0, numRows * sizeof(uint32_t));
+ memset(m_rowDiagIntraSatd, 0, numRows * sizeof(uint32_t));
memset(m_rowEncodedBits, 0, numRows * sizeof(uint32_t));
memset(m_numEncodedCusPerRow, 0, numRows * sizeof(uint32_t));
memset(m_rowSatdForVbv, 0, numRows * sizeof(uint32_t));
memset(m_cuCostsForVbv, 0, numRows * numCols * sizeof(uint32_t));
+ memset(m_intraCuCostsForVbv, 0, numRows * numCols * sizeof(uint32_t));
memset(m_qpaRc, 0, numRows * sizeof(double));
}
if (cfg->param->rc.aqMode)
@@ -181,10 +187,12 @@ void TComPic::destroy()
X265_FREE(m_rowDiagQp);
X265_FREE(m_rowDiagQScale);
X265_FREE(m_rowDiagSatd);
+ X265_FREE(m_rowDiagIntraSatd);
X265_FREE(m_rowEncodedBits);
X265_FREE(m_numEncodedCusPerRow);
X265_FREE(m_rowSatdForVbv);
X265_FREE(m_cuCostsForVbv);
+ X265_FREE(m_intraCuCostsForVbv);
X265_FREE(m_qpaAq);
X265_FREE(m_qpaRc);
}
diff -r 50d7910ddd61 -r 1417ba917211 source/Lib/TLibCommon/TComPic.h
--- a/source/Lib/TLibCommon/TComPic.h Sun Mar 09 22:10:39 2014 -0500
+++ b/source/Lib/TLibCommon/TComPic.h Mon Mar 10 16:59:22 2014 +0530
@@ -106,10 +106,12 @@ public:
double* m_rowDiagQp;
double* m_rowDiagQScale;
uint32_t* m_rowDiagSatd;
+ uint32_t* m_rowDiagIntraSatd;
uint32_t* m_rowEncodedBits;
uint32_t* m_numEncodedCusPerRow;
uint32_t* m_rowSatdForVbv;
uint32_t* m_cuCostsForVbv;
+ uint32_t* m_intraCuCostsForVbv;
double* m_qpaAq;
double* m_qpaRc;
double m_avgQpRc; //avg QP as decided by ratecontrol
diff -r 50d7910ddd61 -r 1417ba917211 source/Lib/TLibCommon/TComYuv.cpp
--- a/source/Lib/TLibCommon/TComYuv.cpp Sun Mar 09 22:10:39 2014 -0500
+++ b/source/Lib/TLibCommon/TComYuv.cpp Mon Mar 10 16:59:22 2014 +0530
@@ -189,7 +189,7 @@ void TComYuv::copyPartToPartYuv(TComYuv*
}
}
-void TComYuv::copyPartToPartShort(ShortYuv* dstPicYuv, uint32_t partIdx, uint32_t lumaSize, bool bChroma, bool bChromaSame)
+void TComYuv::copyPartToPartLuma(ShortYuv* dstPicYuv, uint32_t partIdx, uint32_t lumaSize)
{
int part = partitionFromSizes(lumaSize, lumaSize);
@@ -197,24 +197,6 @@ void TComYuv::copyPartToPartShort(ShortY
uint32_t dststride = dstPicYuv->m_width;
primitives.luma_copy_ps[part](dst, dststride, getLumaAddr(partIdx), getStride());
-
- if (bChroma)
- {
- int16_t* dstU = dstPicYuv->getCbAddr(partIdx);
- int16_t* dstV = dstPicYuv->getCrAddr(partIdx);
- dststride = dstPicYuv->m_cwidth;
-
- if (bChromaSame)
- {
- primitives.luma_copy_ps[part](dstU, dststride, getCbAddr(partIdx), getCStride());
- primitives.luma_copy_ps[part](dstV, dststride, getCrAddr(partIdx), getCStride());
- }
- else
- {
- primitives.chroma[m_csp].copy_ps[part](dstU, dststride, getCbAddr(partIdx), getCStride());
- primitives.chroma[m_csp].copy_ps[part](dstV, dststride, getCrAddr(partIdx), getCStride());
- }
- }
}
void TComYuv::copyPartToPartChroma(ShortYuv* dstPicYuv, uint32_t partIdx, uint32_t lumaSize, uint32_t chromaId)
diff -r 50d7910ddd61 -r 1417ba917211 source/Lib/TLibCommon/TComYuv.h
--- a/source/Lib/TLibCommon/TComYuv.h Sun Mar 09 22:10:39 2014 -0500
+++ b/source/Lib/TLibCommon/TComYuv.h Mon Mar 10 16:59:22 2014 +0530
@@ -132,7 +132,7 @@ public:
// Copy YUV partition buffer to other YUV partition buffer
void copyPartToPartYuv(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, bool bLuma, bool bChroma);
- void copyPartToPartShort(ShortYuv* dstPicYuv, uint32_t partIdx, uint32_t lumaSize, bool bChroma, bool bChromaSame);
+ void copyPartToPartLuma(ShortYuv* dstPicYuv, uint32_t partIdx, uint32_t lumaSize);
void copyPartToPartChroma(ShortYuv* dstPicYuv, uint32_t partIdx, uint32_t lumaSize, uint32_t chromaId);
// ------------------------------------------------------------------------------------------------------------------
diff -r 50d7910ddd61 -r 1417ba917211 source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp Sun Mar 09 22:10:39 2014 -0500
+++ b/source/Lib/TLibEncoder/TEncCu.cpp Mon Mar 10 16:59:22 2014 +0530
@@ -1374,16 +1374,15 @@ void TEncCu::xCheckRDCostIntra(TComDataC
{
//PPAScopeEvent(TEncCU_xCheckRDCostIntra + depth);
uint32_t depth = outTempCU->getDepth(0);
- uint32_t preCalcDistC = 0;
outTempCU->setSkipFlagSubParts(false, 0, depth);
outTempCU->setPartSizeSubParts(partSize, 0, depth);
outTempCU->setPredModeSubParts(MODE_INTRA, 0, depth);
outTempCU->setCUTransquantBypassSubParts(m_CUTransquantBypassFlagValue, 0, depth);
- m_search->estIntraPredQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth], preCalcDistC, true);
+ m_search->estIntraPredQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
- m_search->estIntraPredChromaQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth], preCalcDistC);
+ m_search->estIntraPredChromaQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
m_entropyCoder->resetBits();
if (outTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
@@ -1421,16 +1420,9 @@ void TEncCu::xCheckRDCostIntraInInter(TC
outTempCU->setPredModeSubParts(MODE_INTRA, 0, depth);
outTempCU->setCUTransquantBypassSubParts(m_CUTransquantBypassFlagValue, 0, depth);
- bool bSeparateLumaChroma = true; // choose estimation mode
- uint32_t preCalcDistC = 0;
- if (!bSeparateLumaChroma)
- {
- m_search->preestChromaPredMode(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth]);
- }
- m_search->estIntraPredQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth],
- preCalcDistC, bSeparateLumaChroma);
+ m_search->estIntraPredQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
- m_search->estIntraPredChromaQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth], preCalcDistC);
+ m_search->estIntraPredChromaQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
m_entropyCoder->resetBits();
More information about the x265-commits
mailing list