[x265-commits] [x265] Removed code that will never be executed.
David T Yuen
dtyx265 at gmail.com
Wed Aug 20 21:59:19 CEST 2014
details: http://hg.videolan.org/x265/rev/4f2556521155
branches:
changeset: 7839:4f2556521155
user: David T Yuen <dtyx265 at gmail.com>
date: Tue Aug 19 14:29:26 2014 -0700
description:
Removed code that will never be executed.
Subject: [x265] search: do not skip intra tu 32x32 unless TU intra depth is deep (refs #71)
details: http://hg.videolan.org/x265/rev/203c87c55bb3
branches: stable
changeset: 7840:203c87c55bb3
user: Steve Borho <steve at borho.org>
date: Wed Aug 20 14:22:12 2014 -0500
description:
search: do not skip intra tu 32x32 unless TU intra depth is deep (refs #71)
This may not be the best workaround for the bug, and needs a proper long term
fix.
Subject: [x265] Merge with stable
details: http://hg.videolan.org/x265/rev/b4f833d41667
branches:
changeset: 7841:b4f833d41667
user: Steve Borho <steve at borho.org>
date: Wed Aug 20 14:22:27 2014 -0500
description:
Merge with stable
Subject: [x265] search: nit
details: http://hg.videolan.org/x265/rev/ed7509b29be2
branches:
changeset: 7842:ed7509b29be2
user: Steve Borho <steve at borho.org>
date: Wed Aug 20 14:22:43 2014 -0500
description:
search: nit
Subject: [x265] encoder: do not allow scaling lists to be used with 4:4:4 color space (refs #72)
details: http://hg.videolan.org/x265/rev/3badda1ceda6
branches: stable
changeset: 7843:3badda1ceda6
user: Steve Borho <steve at borho.org>
date: Wed Aug 20 14:56:00 2014 -0500
description:
encoder: do not allow scaling lists to be used with 4:4:4 color space (refs #72)
It causes hash mistakes
Subject: [x265] Merge with stable
details: http://hg.videolan.org/x265/rev/2585ce839546
branches:
changeset: 7844:2585ce839546
user: Steve Borho <steve at borho.org>
date: Wed Aug 20 14:57:21 2014 -0500
description:
Merge with stable
Subject: [x265] encoder: nit, remove obsolete comment
details: http://hg.videolan.org/x265/rev/9461fc801cd2
branches:
changeset: 7845:9461fc801cd2
user: Steve Borho <steve at borho.org>
date: Wed Aug 20 14:57:41 2014 -0500
description:
encoder: nit, remove obsolete comment
diffstat:
source/Lib/TLibEncoder/TEncSearch.cpp | 231 ++++++++++++++++-----------------
source/encoder/encoder.cpp | 8 +-
2 files changed, 118 insertions(+), 121 deletions(-)
diffs (287 lines):
diff -r 80129b1b6260 -r 9461fc801cd2 source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Tue Aug 19 12:16:34 2014 -0700
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Wed Aug 20 14:57:41 2014 -0500
@@ -525,7 +525,7 @@ void TEncSearch::xRecurIntraCodingQT(TCo
bool bCheckFirst,
uint64_t& rdCost)
{
- uint32_t fullDepth = cu->getDepth(0) + trDepth;
+ uint32_t fullDepth = cu->getDepth(0) + trDepth;
uint32_t log2TrSize = g_maxLog2CUSize - fullDepth;
bool bCheckFull = (log2TrSize <= cu->m_slice->m_sps->quadtreeTULog2MaxSize);
bool bCheckSplit = (log2TrSize > cu->getQuadtreeTULog2MinSizeInCU(absPartIdx));
@@ -541,8 +541,9 @@ void TEncSearch::xRecurIntraCodingQT(TCo
// in addition don't check split if TU size is less or equal to 16x16 TU size for non-intra slice
noSplitIntraMaxTuSize = (log2TrSize <= (uint32_t)X265_MIN(maxTuSize, 4));
- // if maximum RD-penalty don't check TU size 32x32
- if (m_param->rdPenalty == 2)
+ // TODO: this check for tuQTMaxIntraDepth depth is a hack, it needs a better fix
+ if (m_param->rdPenalty == 2 && m_param->tuQTMaxIntraDepth > fullDepth)
+ // if maximum RD-penalty don't check TU size 32x32
bCheckFull = (log2TrSize <= (uint32_t)X265_MIN(maxTuSize, 4));
}
if (bCheckFirst && noSplitIntraMaxTuSize)
@@ -1385,129 +1386,121 @@ void TEncSearch::estIntraPredQT(TComData
uint32_t rdModeList[FAST_UDI_MAX_RDMODE_NUM];
int numModesForFullRD = intraModeNumFast[sizeIdx];
- bool doFastSearch = (numModesForFullRD != numModesAvailable);
- if (doFastSearch)
+ X265_CHECK(numModesForFullRD < numModesAvailable, "numModesAvailable too large\n");
+
+ for (int i = 0; i < numModesForFullRD; i++)
+ candCostList[i] = MAX_INT64;
+
+ candNum = 0;
+ uint32_t modeCosts[35];
+
+ pixel *above = m_refAbove + tuSize - 1;
+ pixel *aboveFiltered = m_refAboveFlt + tuSize - 1;
+ pixel *left = m_refLeft + tuSize - 1;
+ pixel *leftFiltered = m_refLeftFlt + tuSize - 1;
+
+ // 33 Angle modes once
+ ALIGN_VAR_32(pixel, buf_trans[32 * 32]);
+ ALIGN_VAR_32(pixel, tmp[33 * 32 * 32]);
+ ALIGN_VAR_32(pixel, bufScale[32 * 32]);
+ pixel _above[4 * 32 + 1];
+ pixel _left[4 * 32 + 1];
+ int scaleTuSize = tuSize;
+ int scaleStride = stride;
+ int costShift = 0;
+
+ if (tuSize > 32)
{
- X265_CHECK(numModesForFullRD < numModesAvailable, "numModesAvailable too large\n");
+ pixel *aboveScale = _above + 2 * 32;
+ pixel *leftScale = _left + 2 * 32;
+
+ // origin is 64x64, we scale to 32x32 and setup required parameters
+ primitives.scale2D_64to32(bufScale, fenc, stride);
+ fenc = bufScale;
+
+ // reserve space in case primitives need to store data in above
+ // or left buffers
+ aboveScale[0] = leftScale[0] = above[0];
+ primitives.scale1D_128to64(aboveScale + 1, above + 1, 0);
+ primitives.scale1D_128to64(leftScale + 1, left + 1, 0);
+
+ scaleTuSize = 32;
+ scaleStride = 32;
+ costShift = 2;
+ sizeIdx = 5 - 2; // log2(scaleTuSize) - 2
+
+ // Filtered and Unfiltered refAbove and refLeft pointing to above and left.
+ above = aboveScale;
+ left = leftScale;
+ aboveFiltered = aboveScale;
+ leftFiltered = leftScale;
+ }
+
+ pixelcmp_t sa8d = primitives.sa8d[sizeIdx];
+
+ // DC
+ primitives.intra_pred[sizeIdx][DC_IDX](tmp, scaleStride, left, above, 0, (scaleTuSize <= 16));
+ modeCosts[DC_IDX] = sa8d(fenc, scaleStride, tmp, scaleStride) << costShift;
+
+ pixel *abovePlanar = above;
+ pixel *leftPlanar = left;
+
+ if (tuSize >= 8 && tuSize <= 32)
+ {
+ abovePlanar = aboveFiltered;
+ leftPlanar = leftFiltered;
+ }
+
+ // PLANAR
+ primitives.intra_pred[sizeIdx][PLANAR_IDX](tmp, scaleStride, leftPlanar, abovePlanar, 0, 0);
+ modeCosts[PLANAR_IDX] = sa8d(fenc, scaleStride, tmp, scaleStride) << costShift;
+
+ // Transpose NxN
+ primitives.transpose[sizeIdx](buf_trans, fenc, scaleStride);
+
+ primitives.intra_pred_allangs[sizeIdx](tmp, above, left, aboveFiltered, leftFiltered, (scaleTuSize <= 16));
+
+ for (int mode = 2; mode < numModesAvailable; mode++)
+ {
+ bool modeHor = (mode < 18);
+ pixel *cmp = (modeHor ? buf_trans : fenc);
+ intptr_t srcStride = (modeHor ? scaleTuSize : scaleStride);
+ modeCosts[mode] = sa8d(cmp, srcStride, &tmp[(mode - 2) * (scaleTuSize * scaleTuSize)], scaleTuSize) << costShift;
+ }
+
+ uint32_t preds[3];
+ int numCand = cu->getIntraDirLumaPredictor(partOffset, preds);
+
+ uint64_t mpms;
+ uint32_t rbits = xModeBitsRemIntra(cu, partOffset, depth, preds, mpms);
+
+ // Find N least cost modes. N = numModesForFullRD
+ for (int mode = 0; mode < numModesAvailable; mode++)
+ {
+ uint32_t sad = modeCosts[mode];
+ uint32_t bits = !(mpms & ((uint64_t)1 << mode)) ? rbits : xModeBitsIntra(cu, mode, partOffset, depth);
+ uint64_t cost = m_rdCost.calcRdSADCost(sad, bits);
+ candNum += xUpdateCandList(mode, cost, numModesForFullRD, rdModeList, candCostList);
+ }
+
+ for (int j = 0; j < numCand; j++)
+ {
+ bool mostProbableModeIncluded = false;
+ uint32_t mostProbableMode = preds[j];
for (int i = 0; i < numModesForFullRD; i++)
- candCostList[i] = MAX_INT64;
-
- candNum = 0;
- uint32_t modeCosts[35];
-
- pixel *above = m_refAbove + tuSize - 1;
- pixel *aboveFiltered = m_refAboveFlt + tuSize - 1;
- pixel *left = m_refLeft + tuSize - 1;
- pixel *leftFiltered = m_refLeftFlt + tuSize - 1;
-
- // 33 Angle modes once
- ALIGN_VAR_32(pixel, buf_trans[32 * 32]);
- ALIGN_VAR_32(pixel, tmp[33 * 32 * 32]);
- ALIGN_VAR_32(pixel, bufScale[32 * 32]);
- pixel _above[4 * 32 + 1];
- pixel _left[4 * 32 + 1];
- int scaleTuSize = tuSize;
- int scaleStride = stride;
- int costShift = 0;
-
- if (tuSize > 32)
{
- pixel *aboveScale = _above + 2 * 32;
- pixel *leftScale = _left + 2 * 32;
-
- // origin is 64x64, we scale to 32x32 and setup required parameters
- primitives.scale2D_64to32(bufScale, fenc, stride);
- fenc = bufScale;
-
- // reserve space in case primitives need to store data in above
- // or left buffers
- aboveScale[0] = leftScale[0] = above[0];
- primitives.scale1D_128to64(aboveScale + 1, above + 1, 0);
- primitives.scale1D_128to64(leftScale + 1, left + 1, 0);
-
- scaleTuSize = 32;
- scaleStride = 32;
- costShift = 2;
- sizeIdx = 5 - 2; // log2(scaleTuSize) - 2
-
- // Filtered and Unfiltered refAbove and refLeft pointing to above and left.
- above = aboveScale;
- left = leftScale;
- aboveFiltered = aboveScale;
- leftFiltered = leftScale;
+ if (mostProbableMode == rdModeList[i])
+ {
+ mostProbableModeIncluded = true;
+ break;
+ }
}
- pixelcmp_t sa8d = primitives.sa8d[sizeIdx];
-
- // DC
- primitives.intra_pred[sizeIdx][DC_IDX](tmp, scaleStride, left, above, 0, (scaleTuSize <= 16));
- modeCosts[DC_IDX] = sa8d(fenc, scaleStride, tmp, scaleStride) << costShift;
-
- pixel *abovePlanar = above;
- pixel *leftPlanar = left;
-
- if (tuSize >= 8 && tuSize <= 32)
- {
- abovePlanar = aboveFiltered;
- leftPlanar = leftFiltered;
- }
-
- // PLANAR
- primitives.intra_pred[sizeIdx][PLANAR_IDX](tmp, scaleStride, leftPlanar, abovePlanar, 0, 0);
- modeCosts[PLANAR_IDX] = sa8d(fenc, scaleStride, tmp, scaleStride) << costShift;
-
- // Transpose NxN
- primitives.transpose[sizeIdx](buf_trans, fenc, scaleStride);
-
- primitives.intra_pred_allangs[sizeIdx](tmp, above, left, aboveFiltered, leftFiltered, (scaleTuSize <= 16));
-
- for (int mode = 2; mode < numModesAvailable; mode++)
- {
- bool modeHor = (mode < 18);
- pixel *cmp = (modeHor ? buf_trans : fenc);
- intptr_t srcStride = (modeHor ? scaleTuSize : scaleStride);
- modeCosts[mode] = sa8d(cmp, srcStride, &tmp[(mode - 2) * (scaleTuSize * scaleTuSize)], scaleTuSize) << costShift;
- }
-
- uint32_t preds[3];
- int numCand = cu->getIntraDirLumaPredictor(partOffset, preds);
-
- uint64_t mpms;
- uint32_t rbits = xModeBitsRemIntra(cu, partOffset, depth, preds, mpms);
-
- // Find N least cost modes. N = numModesForFullRD
- for (int mode = 0; mode < numModesAvailable; mode++)
- {
- uint32_t sad = modeCosts[mode];
- uint32_t bits = !(mpms & ((uint64_t)1 << mode)) ? rbits : xModeBitsIntra(cu, mode, partOffset, depth);
- uint64_t cost = m_rdCost.calcRdSADCost(sad, bits);
- candNum += xUpdateCandList(mode, cost, numModesForFullRD, rdModeList, candCostList);
- }
-
- for (int j = 0; j < numCand; j++)
- {
- bool mostProbableModeIncluded = false;
- uint32_t mostProbableMode = preds[j];
-
- for (int i = 0; i < numModesForFullRD; i++)
- {
- if (mostProbableMode == rdModeList[i])
- {
- mostProbableModeIncluded = true;
- break;
- }
- }
-
- if (!mostProbableModeIncluded)
- rdModeList[numModesForFullRD++] = mostProbableMode;
- }
+ if (!mostProbableModeIncluded)
+ rdModeList[numModesForFullRD++] = mostProbableMode;
}
- else
- {
- for (int i = 0; i < numModesForFullRD; i++)
- rdModeList[i] = i;
- }
+
x265_emms();
//===== check modes (using r-d costs) =====
diff -r 80129b1b6260 -r 9461fc801cd2 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp Tue Aug 19 12:16:34 2014 -0700
+++ b/source/encoder/encoder.cpp Wed Aug 20 14:57:41 2014 -0500
@@ -1328,6 +1328,12 @@ void Encoder::configure(x265_param *p)
x265_log(p, X265_LOG_WARNING, "!! This output bitstream may not be compliant with the final spec !!\n");
}
+ if (p->scalingLists && p->internalCsp == X265_CSP_I444)
+ {
+ x265_log(p, X265_LOG_WARNING, "Scaling lists are not yet supported for 4:4:4 color space\n");
+ p->scalingLists = 0;
+ }
+
if (p->interlaceMode)
x265_log(p, X265_LOG_WARNING, "Support for interlaced video is experimental\n");
@@ -1371,8 +1377,6 @@ void Encoder::configure(x265_param *p)
x265_log(p, X265_LOG_WARNING, "--tune %s should be used if attempting to benchmark %s!\n", s, s);
}
- //====== Coding Tools ========
-
uint32_t tuQTMaxLog2Size = maxLog2CUSize - 1;
m_quadtreeTULog2MaxSize = tuQTMaxLog2Size;
uint32_t tuQTMinLog2Size = 2; //log2(4)
More information about the x265-commits
mailing list