[x265] square transform only
Deepthi Nandakumar
deepthi at multicorewareinc.com
Sat Feb 15 03:02:18 CET 2014
Thanks, Satoshi.
Your patch was imported, but unfortunately conflicts with our extensive
changes for 444 support that I have just pushed in (this series of patches
has been waiting in the wings for a while).
I have temporarily backed out your patch. Will apply it again, after
resolving conflicts with 444 support. Alternatively, you can also send a
new patch based on the latest tip.
Thanks for all your effort,
Deepthi
On Fri, Feb 14, 2014 at 11:00 AM, Satoshi Nakagawa <nakagawa424 at oki.com>wrote:
> # HG changeset patch
> # User Satoshi Nakagawa <nakagawa424 at oki.com>
> # Date 1392355617 -32400
> # Fri Feb 14 14:26:57 2014 +0900
> # Node ID fe7afa6a2e1290817d3469505b856c55f8d46a1d
> # Parent 757b127f8ede6a4b5b7f74186fa06be20df2a0ea
> square transform only
>
> diff -r 757b127f8ede -r fe7afa6a2e12 source/Lib/TLibCommon/TComTrQuant.cpp
> --- a/source/Lib/TLibCommon/TComTrQuant.cpp Thu Feb 13 21:29:08 2014
> -0600
> +++ b/source/Lib/TLibCommon/TComTrQuant.cpp Fri Feb 14 14:26:57 2014
> +0900
> @@ -129,13 +129,13 @@
> }
>
> // To minimize the distortion only. No rate is considered.
> -void TComTrQuant::signBitHidingHDQ(TCoeff* qCoef, TCoeff* coef, uint32_t
> const *scan, int32_t* deltaU, int width, int height)
> +void TComTrQuant::signBitHidingHDQ(TCoeff* qCoef, TCoeff* coef, uint32_t
> const *scan, int32_t* deltaU, int trSize)
> {
> int lastCG = -1;
> int absSum = 0;
> int n;
>
> - for (int subSet = (width * height - 1) >> LOG2_SCAN_SET_SIZE; subSet
> >= 0; subSet--)
> + for (int subSet = (trSize * trSize - 1) >> LOG2_SCAN_SET_SIZE; subSet
> >= 0; subSet--)
> {
> int subPos = subSet << LOG2_SCAN_SET_SIZE;
> int firstNZPosInCG = SCAN_SET_SIZE, lastNZPosInCG = -1;
> @@ -252,31 +252,29 @@
> } // TU loop
> }
>
> -uint32_t TComTrQuant::xQuant(TComDataCU* cu, int32_t* coef, TCoeff*
> qCoef, int width, int height,
> +uint32_t TComTrQuant::xQuant(TComDataCU* cu, int32_t* coef, TCoeff*
> qCoef, int trSize,
> TextType ttype, uint32_t absPartIdx, int32_t
> *lastPos, bool curUseRDOQ)
> {
> uint32_t acSum = 0;
> int add = 0;
> bool useRDOQ = (cu->getTransformSkip(absPartIdx, ttype) ? m_useRDOQTS
> : m_useRDOQ) && curUseRDOQ;
>
> - assert(width == height);
> -
> #if _MSC_VER
> #pragma warning(disable: 4127) // conditional expression is constant
> #endif
> if (useRDOQ && (ttype == TEXT_LUMA || RDOQ_CHROMA))
> {
> - acSum = xRateDistOptQuant(cu, coef, qCoef, width, height, ttype,
> absPartIdx, lastPos);
> + acSum = xRateDistOptQuant(cu, coef, qCoef, trSize, ttype,
> absPartIdx, lastPos);
> }
> else
> {
> - const uint32_t log2BlockSize = g_convertToBit[width] + 2;
> - uint32_t scanIdx = cu->getCoefScanIdx(absPartIdx, width, ttype ==
> TEXT_LUMA, cu->isIntra(absPartIdx));
> + const uint32_t log2TrSize = g_convertToBit[trSize] + 2;
> + const uint32_t log2BlockSize = log2TrSize;
> + uint32_t scanIdx = cu->getCoefScanIdx(absPartIdx, trSize, ttype
> == TEXT_LUMA, cu->isIntra(absPartIdx));
> const uint32_t *scan = g_sigLastScan[scanIdx][log2BlockSize - 1];
>
> int deltaU[32 * 32];
>
> - uint32_t log2TrSize = g_convertToBit[width] + 2;
> int scalingListType = (cu->isIntra(absPartIdx) ? 0 : 3) + ttype;
> assert(scalingListType < 6);
> int32_t *quantCoeff = 0;
> @@ -287,11 +285,11 @@
> int qbits = QUANT_SHIFT + m_qpParam.m_per + transformShift;
> add = (cu->getSlice()->getSliceType() == I_SLICE ? 171 : 85) <<
> (qbits - 9);
>
> - int numCoeff = width * height;
> + int numCoeff = trSize * trSize;
> acSum += primitives.quant(coef, quantCoeff, deltaU, qCoef, qbits,
> add, numCoeff, lastPos);
>
> if (cu->getSlice()->getPPS()->getSignHideFlag() && acSum >= 2)
> - signBitHidingHDQ(qCoef, coef, scan, deltaU, width, height);
> + signBitHidingHDQ(qCoef, coef, scan, deltaU, trSize);
> }
>
> return acSum;
> @@ -309,8 +307,7 @@
> int16_t* residual,
> uint32_t stride,
> TCoeff* coeff,
> - uint32_t width,
> - uint32_t height,
> + uint32_t trSize,
> TextType ttype,
> uint32_t absPartIdx,
> int32_t* lastPos,
> @@ -320,11 +317,11 @@
> if (cu->getCUTransquantBypass(absPartIdx))
> {
> uint32_t absSum = 0;
> - for (uint32_t k = 0; k < height; k++)
> + for (uint32_t k = 0; k < trSize; k++)
> {
> - for (uint32_t j = 0; j < width; j++)
> + for (uint32_t j = 0; j < trSize; j++)
> {
> - coeff[k * width + j] = ((int16_t)residual[k * stride +
> j]);
> + coeff[k * trSize + j] = ((int16_t)residual[k * stride +
> j]);
> absSum += abs(residual[k * stride + j]);
> }
> }
> @@ -342,29 +339,29 @@
> mode = REG_DCT;
> }
>
> - assert((cu->getSlice()->getSPS()->getMaxTrSize() >= width));
> + assert((cu->getSlice()->getSPS()->getMaxTrSize() >= trSize));
> if (useTransformSkip)
> {
> - xTransformSkip(residual, stride, m_tmpCoeff, width, height);
> + xTransformSkip(residual, stride, m_tmpCoeff, trSize);
> }
> else
> {
> // TODO: this may need larger data types for X265_DEPTH > 8
> - const uint32_t log2BlockSize = g_convertToBit[width];
> - primitives.dct[DCT_4x4 + log2BlockSize - ((width == 4) && (mode
> != REG_DCT))](residual, m_tmpCoeff, stride);
> + const uint32_t log2BlockSize = g_convertToBit[trSize];
> + primitives.dct[DCT_4x4 + log2BlockSize - ((trSize == 4) && (mode
> != REG_DCT))](residual, m_tmpCoeff, stride);
> }
> - return xQuant(cu, m_tmpCoeff, coeff, width, height, ttype,
> absPartIdx, lastPos, curUseRDOQ);
> + return xQuant(cu, m_tmpCoeff, coeff, trSize, ttype, absPartIdx,
> lastPos, curUseRDOQ);
> }
>
> -void TComTrQuant::invtransformNxN(bool transQuantBypass, uint32_t mode,
> int16_t* residual, uint32_t stride, TCoeff* coeff, uint32_t width, uint32_t
> height, int scalingListType, bool useTransformSkip, int lastPos)
> +void TComTrQuant::invtransformNxN(bool transQuantBypass, uint32_t mode,
> int16_t* residual, uint32_t stride, TCoeff* coeff, uint32_t trSize, int
> scalingListType, bool useTransformSkip, int lastPos)
> {
> if (transQuantBypass)
> {
> - for (uint32_t k = 0; k < height; k++)
> + for (uint32_t k = 0; k < trSize; k++)
> {
> - for (uint32_t j = 0; j < width; j++)
> + for (uint32_t j = 0; j < trSize; j++)
> {
> - residual[k * stride + j] = (int16_t)(coeff[k * width +
> j]);
> + residual[k * stride + j] = (int16_t)(coeff[k * trSize +
> j]);
> }
> }
>
> @@ -375,7 +372,7 @@
> int per = m_qpParam.m_per;
> int rem = m_qpParam.m_rem;
> bool useScalingList = getUseScalingList();
> - uint32_t log2TrSize = g_convertToBit[width] + 2;
> + const uint32_t log2TrSize = g_convertToBit[trSize] + 2;
> int transformShift = MAX_TR_DYNAMIC_RANGE - X265_DEPTH - log2TrSize;
> int shift = QUANT_IQUANT_SHIFT - QUANT_SHIFT - transformShift;
> int32_t *dequantCoef = getDequantCoeff(scalingListType,
> m_qpParam.m_rem, log2TrSize - 2);
> @@ -384,30 +381,30 @@
> {
> static const int invQuantScales[6] = { 40, 45, 51, 57, 64, 72 };
> int scale = invQuantScales[rem] << per;
> - primitives.dequant_normal(coeff, m_tmpCoeff, width * height,
> scale, shift);
> + primitives.dequant_normal(coeff, m_tmpCoeff, trSize * trSize,
> scale, shift);
> }
> else
> {
> // CHECK_ME: the code is not verify since this is DEAD path
> - primitives.dequant_scaling(coeff, dequantCoef, m_tmpCoeff, width
> * height, per, shift);
> + primitives.dequant_scaling(coeff, dequantCoef, m_tmpCoeff, trSize
> * trSize, per, shift);
> }
>
> if (useTransformSkip == true)
> {
> - xITransformSkip(m_tmpCoeff, residual, stride, width, height);
> + xITransformSkip(m_tmpCoeff, residual, stride, trSize);
> }
> else
> {
> // CHECK_ME: we can't here when no any coeff
> assert(lastPos >= 0);
>
> - const uint32_t log2BlockSize = g_convertToBit[width];
> + const uint32_t log2BlockSize = log2TrSize - 2;
>
> #if HIGH_BIT_DEPTH
> lastPos = !lastPos; // prevent warning
> #else
> // DC only
> - if (lastPos == 0 && !((width == 4) && (mode != REG_DCT)))
> + if (lastPos == 0 && !((trSize == 4) && (mode != REG_DCT)))
> {
> int dc_val = (((m_tmpCoeff[0] * 64 + 64) >> 7) * 64 + 2048)
> >> 12;
> primitives.blockfill_s[log2BlockSize](residual, stride,
> dc_val);
> @@ -417,7 +414,7 @@
> #endif
>
> // TODO: this may need larger data types for X265_DEPTH > 8
> - primitives.idct[IDCT_4x4 + log2BlockSize - ((width == 4) && (mode
> != REG_DCT))](m_tmpCoeff, residual, stride);
> + primitives.idct[IDCT_4x4 + log2BlockSize - ((trSize == 4) &&
> (mode != REG_DCT))](m_tmpCoeff, residual, stride);
> }
> }
>
> @@ -431,16 +428,15 @@
> * \param stride stride of input residual data
> * \param size transform size (size x size)
> */
> -void TComTrQuant::xTransformSkip(int16_t* resiBlock, uint32_t stride,
> int32_t* coeff, int width, int height)
> +void TComTrQuant::xTransformSkip(int16_t* resiBlock, uint32_t stride,
> int32_t* coeff, int trSize)
> {
> - assert(width == height);
> - uint32_t log2TrSize = g_convertToBit[width] + 2;
> + uint32_t log2TrSize = g_convertToBit[trSize] + 2;
> int shift = MAX_TR_DYNAMIC_RANGE - X265_DEPTH - log2TrSize;
> uint32_t transformSkipShift;
> int j, k;
> if (shift >= 0)
> {
> - primitives.cvt16to32_shl(coeff, resiBlock, stride, shift, width);
> + primitives.cvt16to32_shl(coeff, resiBlock, stride, shift, trSize);
> }
> else
> {
> @@ -448,11 +444,11 @@
> int offset;
> transformSkipShift = -shift;
> offset = (1 << (transformSkipShift - 1));
> - for (j = 0; j < height; j++)
> + for (j = 0; j < trSize; j++)
> {
> - for (k = 0; k < width; k++)
> + for (k = 0; k < trSize; k++)
> {
> - coeff[j * height + k] = (resiBlock[j * stride + k] +
> offset) >> transformSkipShift;
> + coeff[j * trSize + k] = (resiBlock[j * stride + k] +
> offset) >> transformSkipShift;
> }
> }
> }
> @@ -464,26 +460,24 @@
> * \param stride stride of input residual data
> * \param size transform size (size x size)
> */
> -void TComTrQuant::xITransformSkip(int32_t* coef, int16_t* residual,
> uint32_t stride, int width, int height)
> +void TComTrQuant::xITransformSkip(int32_t* coef, int16_t* residual,
> uint32_t stride, int trSize)
> {
> - assert(width == height);
> - uint32_t log2TrSize = g_convertToBit[width] + 2;
> + uint32_t log2TrSize = g_convertToBit[trSize] + 2;
> int shift = MAX_TR_DYNAMIC_RANGE - X265_DEPTH - log2TrSize;
> int j, k;
> if (shift > 0)
> {
> - assert(width == height);
> - primitives.cvt32to16_shr(residual, coef, stride, shift, width);
> + primitives.cvt32to16_shr(residual, coef, stride, shift, trSize);
> }
> else
> {
> //The case when X265_DEPTH >= 13
> uint32_t transformSkipShift = -shift;
> - for (j = 0; j < height; j++)
> + for (j = 0; j < trSize; j++)
> {
> - for (k = 0; k < width; k++)
> + for (k = 0; k < trSize; k++)
> {
> - residual[j * stride + k] = coef[j * width + k] <<
> transformSkipShift;
> + residual[j * stride + k] = coef[j * trSize + k] <<
> transformSkipShift;
> }
> }
> }
> @@ -502,15 +496,15 @@
> * Rate distortion optimized quantization for entropy
> * coding engines using probability models like CABAC
> */
> -uint32_t TComTrQuant::xRateDistOptQuant(TComDataCU* cu, int32_t*
> srcCoeff, TCoeff* dstCoeff, uint32_t width, uint32_t height,
> +uint32_t TComTrQuant::xRateDistOptQuant(TComDataCU* cu, int32_t*
> srcCoeff, TCoeff* dstCoeff, uint32_t trSize,
> TextType ttype, uint32_t
> absPartIdx, int32_t *lastPos)
> {
> - uint32_t log2TrSize = g_convertToBit[width] + 2;
> + const uint32_t log2TrSize = g_convertToBit[trSize] + 2;
> + const uint32_t log2BlkSize = log2TrSize;
> uint32_t absSum = 0;
> int transformShift = MAX_TR_DYNAMIC_RANGE - X265_DEPTH - log2TrSize;
> // Represents scaling through forward transform
> uint32_t goRiceParam = 0;
> double blockUncodedCost = 0;
> - const uint32_t log2BlkSize = g_convertToBit[width] + 2;
> int scalingListType = (cu->isIntra(absPartIdx) ? 0 : 3) + ttype;
>
> assert(scalingListType < 6);
> @@ -520,7 +514,7 @@
> int32_t *qCoefOrg = getQuantCoeff(scalingListType, m_qpParam.m_rem,
> log2TrSize - 2);
> int32_t *qCoef = qCoefOrg;
> double *errScale = errScaleOrg;
> - uint32_t scanIdx = cu->getCoefScanIdx(absPartIdx, width, ttype ==
> TEXT_LUMA, cu->isIntra(absPartIdx));
> + uint32_t scanIdx = cu->getCoefScanIdx(absPartIdx, trSize, ttype ==
> TEXT_LUMA, cu->isIntra(absPartIdx));
>
> double costCoeff[32 * 32];
> double costSig[32 * 32];
> @@ -545,7 +539,7 @@
> double costCoeffGroupSig[MLS_GRP_NUM];
> uint32_t sigCoeffGroupFlag[MLS_GRP_NUM];
>
> - uint32_t numBlkSide = width / MLS_CG_SIZE;
> + uint32_t numBlkSide = trSize / MLS_CG_SIZE;
> uint32_t ctxSet = 0;
> int c1 = 1;
> int c2 = 0;
> @@ -560,7 +554,7 @@
>
> ::memset(sigCoeffGroupFlag, 0, sizeof(uint32_t) * MLS_GRP_NUM);
>
> - uint32_t cgNum = width * height >> MLS_CG_SIZE;
> + uint32_t cgNum = trSize * trSize >> MLS_CG_SIZE;
> int scanPos;
> coeffGroupRDStats rdStats;
>
> @@ -868,7 +862,7 @@
> int tmpSum = 0;
> int n;
>
> - for (int subSet = (width * height - 1) >> LOG2_SCAN_SET_SIZE;
> subSet >= 0; subSet--)
> + for (int subSet = (trSize * trSize - 1) >> LOG2_SCAN_SET_SIZE;
> subSet >= 0; subSet--)
> {
> int subPos = subSet << LOG2_SCAN_SET_SIZE;
> int firstNZPosInCG = SCAN_SET_SIZE, lastNZPosInCG = -1;
> diff -r 757b127f8ede -r fe7afa6a2e12 source/Lib/TLibCommon/TComTrQuant.h
> --- a/source/Lib/TLibCommon/TComTrQuant.h Thu Feb 13 21:29:08 2014
> -0600
> +++ b/source/Lib/TLibCommon/TComTrQuant.h Fri Feb 14 14:26:57 2014
> +0900
> @@ -127,10 +127,10 @@
> void init(uint32_t maxTrSize, int useRDOQ, int useRDOQTS, int
> useTransformSkipFast);
>
> // transform & inverse transform functions
> - uint32_t transformNxN(TComDataCU* cu, int16_t* residual, uint32_t
> stride, TCoeff* coeff, uint32_t width, uint32_t height,
> + uint32_t transformNxN(TComDataCU* cu, int16_t* residual, uint32_t
> stride, TCoeff* coeff, uint32_t trSize,
> TextType ttype, uint32_t absPartIdx, int32_t*
> lastPos, bool useTransformSkip = false, bool curUseRDOQ = true);
>
> - void invtransformNxN(bool transQuantBypass, uint32_t mode, int16_t*
> residual, uint32_t stride, TCoeff* coeff, uint32_t width, uint32_t height,
> int scalingListType, bool useTransformSkip = false, int lastPos = MAX_INT);
> + void invtransformNxN(bool transQuantBypass, uint32_t mode, int16_t*
> residual, uint32_t stride, TCoeff* coeff, uint32_t trSize, int
> scalingListType, bool useTransformSkip = false, int lastPos = MAX_INT);
>
> // Misc functions
> void setQPforQuant(int qpy, TextType ttype, int qpBdOffset, int
> chromaQPOffset);
> @@ -190,14 +190,14 @@
>
> private:
>
> - void xTransformSkip(int16_t* resiBlock, uint32_t stride, int32_t*
> coeff, int width, int height);
> + void xTransformSkip(int16_t* resiBlock, uint32_t stride, int32_t*
> coeff, int trSize);
>
> - void signBitHidingHDQ(TCoeff* qcoeff, TCoeff* coeff, const uint32_t*
> scan, int32_t* deltaU, int width, int height);
> + void signBitHidingHDQ(TCoeff* qcoeff, TCoeff* coeff, const uint32_t*
> scan, int32_t* deltaU, int trSize);
>
> - uint32_t xQuant(TComDataCU* cu, int32_t* src, TCoeff* dst, int width,
> int height, TextType ttype, uint32_t absPartIdx, int32_t *lastPos, bool
> curUseRDOQ = true);
> + uint32_t xQuant(TComDataCU* cu, int32_t* src, TCoeff* dst, int
> trSize, TextType ttype, uint32_t absPartIdx, int32_t *lastPos, bool
> curUseRDOQ = true);
>
> // RDOQ functions
> - uint32_t xRateDistOptQuant(TComDataCU* cu, int32_t* srcCoeff, TCoeff*
> dstCoeff, uint32_t width, uint32_t height, TextType ttype, uint32_t
> absPartIdx, int32_t *lastPos);
> + uint32_t xRateDistOptQuant(TComDataCU* cu, int32_t* srcCoeff, TCoeff*
> dstCoeff, uint32_t trSize, TextType ttype, uint32_t absPartIdx, int32_t
> *lastPos);
>
> inline uint32_t xGetCodedLevel(double& codedCost, double& codedCost0,
> double& codedCostSig, int levelDouble,
> uint32_t maxAbsLevel, uint16_t
> ctxNumSig, uint16_t ctxNumOne, uint16_t ctxNumAbs, uint16_t absGoRice,
> @@ -217,7 +217,7 @@
>
> inline uint32_t xGetIEPRate() const { return 32768; }
> ///< Get the cost of an equal probable bit
>
> - void xITransformSkip(int32_t* coeff, int16_t* residual, uint32_t
> stride, int width, int height);
> + void xITransformSkip(int32_t* coeff, int16_t* residual, uint32_t
> stride, int trSize);
> };
> }
> //! \}
> diff -r 757b127f8ede -r fe7afa6a2e12 source/Lib/TLibEncoder/TEncSearch.cpp
> --- a/source/Lib/TLibEncoder/TEncSearch.cpp Thu Feb 13 21:29:08 2014
> -0600
> +++ b/source/Lib/TLibEncoder/TEncSearch.cpp Fri Feb 14 14:26:57 2014
> +0900
> @@ -466,7 +466,7 @@
> m_trQuant->setQPforQuant(cu->getQP(0), TEXT_LUMA,
> cu->getSlice()->getSPS()->getQpBDOffsetY(), 0);
> m_trQuant->selectLambda(TEXT_LUMA);
>
> - absSum = m_trQuant->transformNxN(cu, residual, stride, coeff, width,
> height, TEXT_LUMA, absPartIdx, &lastPos, useTransformSkip);
> + absSum = m_trQuant->transformNxN(cu, residual, stride, coeff, width,
> TEXT_LUMA, absPartIdx, &lastPos, useTransformSkip);
>
> //--- set coded block flag ---
> cu->setCbfSubParts((absSum ? 1 : 0) << trDepth, TEXT_LUMA,
> absPartIdx, fullDepth);
> @@ -477,7 +477,7 @@
> {
> int scalingListType = 0 + TEXT_LUMA;
> assert(scalingListType < 6);
> - m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx),
> cu->getLumaIntraDir(absPartIdx), residual, stride, coeff, width, height,
> scalingListType, useTransformSkip, lastPos);
> + m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx),
> cu->getLumaIntraDir(absPartIdx), residual, stride, coeff, width,
> scalingListType, useTransformSkip, lastPos);
> }
> else
> {
> @@ -602,7 +602,7 @@
>
> m_trQuant->selectLambda(TEXT_CHROMA);
>
> - absSum = m_trQuant->transformNxN(cu, residual, stride, coeff,
> width, height, ttype, absPartIdx, &lastPos, useTransformSkipChroma);
> + absSum = m_trQuant->transformNxN(cu, residual, stride, coeff,
> width, ttype, absPartIdx, &lastPos, useTransformSkipChroma);
>
> //--- set coded block flag ---
> cu->setCbfSubParts((absSum ? 1 : 0) << origTrDepth, ttype,
> absPartIdx, cu->getDepth(0) + trDepth);
> @@ -612,7 +612,7 @@
> {
> int scalingListType = 0 + ttype;
> assert(scalingListType < 6);
> -
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> residual, stride, coeff, width, height, scalingListType,
> useTransformSkipChroma, lastPos);
> +
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> residual, stride, coeff, width, scalingListType, useTransformSkipChroma,
> lastPos);
> }
> else
> {
> @@ -1035,7 +1035,7 @@
>
> m_trQuant->setQPforQuant(cu->getQP(0), TEXT_LUMA,
> cu->getSlice()->getSPS()->getQpBDOffsetY(), 0);
> m_trQuant->selectLambda(TEXT_LUMA);
> - absSum = m_trQuant->transformNxN(cu, residual, stride, coeff,
> width, height, TEXT_LUMA, absPartIdx, &lastPos, useTransformSkip);
> + absSum = m_trQuant->transformNxN(cu, residual, stride, coeff,
> width, TEXT_LUMA, absPartIdx, &lastPos, useTransformSkip);
>
> //--- set coded block flag ---
> cu->setCbfSubParts((absSum ? 1 : 0) << trDepth, TEXT_LUMA,
> absPartIdx, fullDepth);
> @@ -1046,7 +1046,7 @@
> {
> int scalingListType = 0 + TEXT_LUMA;
> assert(scalingListType < 6);
> -
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx),
> cu->getLumaIntraDir(absPartIdx), residual, stride, coeff, width, height,
> scalingListType, useTransformSkip, lastPos);
> +
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx),
> cu->getLumaIntraDir(absPartIdx), residual, stride, coeff, width,
> scalingListType, useTransformSkip, lastPos);
> }
> else
> {
> @@ -1664,7 +1664,7 @@
>
> m_trQuant->selectLambda(TEXT_CHROMA);
>
> - absSum = m_trQuant->transformNxN(cu, residual, stride, coeff,
> width, height, ttype, absPartIdx, &lastPos, useTransformSkipChroma);
> + absSum = m_trQuant->transformNxN(cu, residual, stride, coeff,
> width, ttype, absPartIdx, &lastPos, useTransformSkipChroma);
>
> //--- set coded block flag ---
> cu->setCbfSubParts((absSum ? 1 : 0) << trDepth, ttype,
> absPartIdx, cu->getDepth(0) + trDepth);
> @@ -1674,7 +1674,7 @@
> {
> int scalingListType = 0 + ttype;
> assert(scalingListType < 6);
> -
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> residual, stride, coeff, width, height, scalingListType,
> useTransformSkipChroma, lastPos);
> +
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> residual, stride, coeff, width, scalingListType, useTransformSkipChroma,
> lastPos);
> }
> else
> {
> @@ -3247,7 +3247,7 @@
> m_trQuant->selectLambda(TEXT_LUMA);
>
> absSumY = m_trQuant->transformNxN(cu,
> resiYuv->getLumaAddr(absTUPartIdx), resiYuv->m_width, coeffCurY,
> - trWidth, trHeight, TEXT_LUMA,
> absPartIdx, &lastPosY, false, curuseRDOQ);
> + trWidth, TEXT_LUMA, absPartIdx,
> &lastPosY, false, curuseRDOQ);
>
> cu->setCbfSubParts(absSumY ? setCbf : 0, TEXT_LUMA, absPartIdx,
> depth);
>
> @@ -3259,12 +3259,12 @@
> m_trQuant->selectLambda(TEXT_CHROMA);
>
> absSumU = m_trQuant->transformNxN(cu,
> resiYuv->getCbAddr(absTUPartIdxC), resiYuv->m_cwidth, coeffCurU,
> - trWidthC, trHeightC,
> TEXT_CHROMA_U, absPartIdx, &lastPosU, false, curuseRDOQ);
> + trWidthC, TEXT_CHROMA_U,
> absPartIdx, &lastPosU, false, curuseRDOQ);
>
> curChromaQpOffset =
> cu->getSlice()->getPPS()->getChromaCrQpOffset() +
> cu->getSlice()->getSliceQpDeltaCr();
> m_trQuant->setQPforQuant(cu->getQP(0), TEXT_CHROMA,
> cu->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset);
> absSumV = m_trQuant->transformNxN(cu,
> resiYuv->getCrAddr(absTUPartIdxC), resiYuv->m_cwidth, coeffCurV,
> - trWidthC, trHeightC,
> TEXT_CHROMA_V, absPartIdx, &lastPosV, false, curuseRDOQ);
> + trWidthC, TEXT_CHROMA_V,
> absPartIdx, &lastPosV, false, curuseRDOQ);
>
> cu->setCbfSubParts(absSumU ? setCbf : 0, TEXT_CHROMA_U,
> absPartIdx, cu->getDepth(0) + trModeC);
> cu->setCbfSubParts(absSumV ? setCbf : 0, TEXT_CHROMA_V,
> absPartIdx, cu->getDepth(0) + trModeC);
> @@ -3278,7 +3278,7 @@
>
> int scalingListType = 3 + TEXT_LUMA;
> assert(scalingListType < 6);
> -
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiY, resiYuv->m_width, coeffCurY, trWidth, trHeight, scalingListType,
> false, lastPosY); //this is for inter mode only
> +
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiY, resiYuv->m_width, coeffCurY, trWidth, scalingListType, false,
> lastPosY); //this is for inter mode only
> }
> else
> {
> @@ -3298,7 +3298,7 @@
>
> int scalingListType = 3 + TEXT_CHROMA_U;
> assert(scalingListType < 6);
> -
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> pcResiCurrU, resiYuv->m_cwidth, coeffCurU, trWidthC, trHeightC,
> scalingListType, false, lastPosU);
> +
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> pcResiCurrU, resiYuv->m_cwidth, coeffCurU, trWidthC, scalingListType,
> false, lastPosU);
> }
> else
> {
> @@ -3314,7 +3314,7 @@
>
> int scalingListType = 3 + TEXT_CHROMA_V;
> assert(scalingListType < 6);
> -
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiV, resiYuv->m_cwidth, coeffCurV, trWidthC, trHeightC,
> scalingListType, false, lastPosV);
> +
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiV, resiYuv->m_cwidth, coeffCurV, trWidthC, scalingListType, false,
> lastPosV);
> }
> else
> {
> @@ -3456,7 +3456,7 @@
> m_trQuant->selectLambda(TEXT_LUMA);
>
> absSumY = m_trQuant->transformNxN(cu,
> resiYuv->getLumaAddr(absTUPartIdx), resiYuv->m_width, coeffCurY,
> - trWidth, trHeight, TEXT_LUMA,
> absPartIdx, &lastPosY, false, curuseRDOQ);
> + trWidth, TEXT_LUMA, absPartIdx,
> &lastPosY, false, curuseRDOQ);
>
> cu->setCbfSubParts(absSumY ? setCbf : 0, TEXT_LUMA, absPartIdx,
> depth);
>
> @@ -3473,12 +3473,12 @@
> m_trQuant->selectLambda(TEXT_CHROMA);
>
> absSumU = m_trQuant->transformNxN(cu,
> resiYuv->getCbAddr(absTUPartIdxC), resiYuv->m_cwidth, coeffCurU,
> - trWidthC, trHeightC,
> TEXT_CHROMA_U, absPartIdx, &lastPosU, false, curuseRDOQ);
> + trWidthC, TEXT_CHROMA_U,
> absPartIdx, &lastPosU, false, curuseRDOQ);
>
> curChromaQpOffset =
> cu->getSlice()->getPPS()->getChromaCrQpOffset() +
> cu->getSlice()->getSliceQpDeltaCr();
> m_trQuant->setQPforQuant(cu->getQP(0), TEXT_CHROMA,
> cu->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset);
> absSumV = m_trQuant->transformNxN(cu,
> resiYuv->getCrAddr(absTUPartIdxC), resiYuv->m_cwidth, coeffCurV,
> - trWidthC, trHeightC,
> TEXT_CHROMA_V, absPartIdx, &lastPosV, false, curuseRDOQ);
> + trWidthC, TEXT_CHROMA_V,
> absPartIdx, &lastPosV, false, curuseRDOQ);
>
> cu->setCbfSubParts(absSumU ? setCbf : 0, TEXT_CHROMA_U,
> absPartIdx, cu->getDepth(0) + trModeC);
> cu->setCbfSubParts(absSumV ? setCbf : 0, TEXT_CHROMA_V,
> absPartIdx, cu->getDepth(0) + trModeC);
> @@ -3523,7 +3523,7 @@
> int scalingListType = 3 + TEXT_LUMA;
> assert(scalingListType < 6);
> assert(m_qtTempTComYuv[qtlayer].m_width == MAX_CU_SIZE);
> -
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiY, MAX_CU_SIZE, coeffCurY, trWidth, trHeight, scalingListType,
> false, lastPosY); //this is for inter mode only
> +
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiY, MAX_CU_SIZE, coeffCurY, trWidth, scalingListType, false,
> lastPosY); //this is for inter mode only
>
> const uint32_t nonZeroDistY =
> primitives.sse_ss[partSize](resiYuv->getLumaAddr(absTUPartIdx),
> resiYuv->m_width, m_qtTempTComYuv[qtlayer].getLumaAddr(absTUPartIdx),
> MAX_CU_SIZE);
> if (cu->isLosslessCoded(0))
> @@ -3595,7 +3595,7 @@
> int scalingListType = 3 + TEXT_CHROMA_U;
> assert(scalingListType < 6);
> assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE /
> 2);
> -
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> pcResiCurrU, MAX_CU_SIZE / 2, coeffCurU, trWidthC, trHeightC,
> scalingListType, false, lastPosU);
> +
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> pcResiCurrU, MAX_CU_SIZE / 2, coeffCurU, trWidthC, scalingListType, false,
> lastPosU);
>
> uint32_t dist =
> primitives.sse_ss[partSizeC](resiYuv->getCbAddr(absTUPartIdxC),
> resiYuv->m_cwidth,
>
> m_qtTempTComYuv[qtlayer].getCbAddr(absTUPartIdxC),
> @@ -3662,7 +3662,7 @@
> int scalingListType = 3 + TEXT_CHROMA_V;
> assert(scalingListType < 6);
> assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE /
> 2);
> -
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiV, MAX_CU_SIZE / 2, coeffCurV, trWidthC, trHeightC, scalingListType,
> false, lastPosV);
> +
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiV, MAX_CU_SIZE / 2, coeffCurV, trWidthC, scalingListType, false,
> lastPosV);
>
> uint32_t dist =
> primitives.sse_ss[partSizeC](resiYuv->getCrAddr(absTUPartIdxC),
> resiYuv->m_cwidth,
>
> m_qtTempTComYuv[qtlayer].getCrAddr(absTUPartIdxC),
> @@ -3753,7 +3753,7 @@
>
> m_trQuant->selectLambda(TEXT_LUMA);
> absSumTransformSkipY = m_trQuant->transformNxN(cu,
> resiYuv->getLumaAddr(absTUPartIdx), resiYuv->m_width, coeffCurY,
> - trWidth,
> trHeight, TEXT_LUMA, absPartIdx, &lastPosTransformSkipY, true, curuseRDOQ);
> + trWidth,
> TEXT_LUMA, absPartIdx, &lastPosTransformSkipY, true, curuseRDOQ);
> cu->setCbfSubParts(absSumTransformSkipY ? setCbf : 0,
> TEXT_LUMA, absPartIdx, depth);
>
> if (absSumTransformSkipY != 0)
> @@ -3769,7 +3769,7 @@
> assert(scalingListType < 6);
> assert(m_qtTempTComYuv[qtlayer].m_width == MAX_CU_SIZE);
>
> -
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiY, MAX_CU_SIZE, coeffCurY, trWidth, trHeight, scalingListType,
> true, lastPosTransformSkipY);
> +
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiY, MAX_CU_SIZE, coeffCurY, trWidth, scalingListType, true,
> lastPosTransformSkipY);
>
> nonZeroDistY =
> primitives.sse_ss[partSize](resiYuv->getLumaAddr(absTUPartIdx),
> resiYuv->m_width,
>
> m_qtTempTComYuv[qtlayer].getLumaAddr(absTUPartIdx),
> @@ -3834,11 +3834,11 @@
> m_trQuant->selectLambda(TEXT_CHROMA);
>
> absSumTransformSkipU = m_trQuant->transformNxN(cu,
> resiYuv->getCbAddr(absTUPartIdxC), resiYuv->m_cwidth, coeffCurU,
> - trWidthC,
> trHeightC, TEXT_CHROMA_U, absPartIdx, &lastPosTransformSkipU, true,
> curuseRDOQ);
> + trWidthC,
> TEXT_CHROMA_U, absPartIdx, &lastPosTransformSkipU, true, curuseRDOQ);
> curChromaQpOffset =
> cu->getSlice()->getPPS()->getChromaCrQpOffset() +
> cu->getSlice()->getSliceQpDeltaCr();
> m_trQuant->setQPforQuant(cu->getQP(0), TEXT_CHROMA,
> cu->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset);
> absSumTransformSkipV = m_trQuant->transformNxN(cu,
> resiYuv->getCrAddr(absTUPartIdxC), resiYuv->m_cwidth, coeffCurV,
> - trWidthC,
> trHeightC, TEXT_CHROMA_V, absPartIdx, &lastPosTransformSkipV, true,
> curuseRDOQ);
> + trWidthC,
> TEXT_CHROMA_V, absPartIdx, &lastPosTransformSkipV, true, curuseRDOQ);
>
> cu->setCbfSubParts(absSumTransformSkipU ? setCbf : 0,
> TEXT_CHROMA_U, absPartIdx, cu->getDepth(0) + trModeC);
> cu->setCbfSubParts(absSumTransformSkipV ? setCbf : 0,
> TEXT_CHROMA_V, absPartIdx, cu->getDepth(0) + trModeC);
> @@ -3859,7 +3859,7 @@
> assert(scalingListType < 6);
> assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE /
> 2);
>
> -
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiU, MAX_CU_SIZE / 2, coeffCurU, trWidthC, trHeightC, scalingListType,
> true, lastPosTransformSkipU);
> +
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiU, MAX_CU_SIZE / 2, coeffCurU, trWidthC, scalingListType, true,
> lastPosTransformSkipU);
>
> uint32_t dist =
> primitives.sse_ss[partSizeC](resiYuv->getCbAddr(absTUPartIdxC),
> resiYuv->m_cwidth,
>
> m_qtTempTComYuv[qtlayer].getCbAddr(absTUPartIdxC),
> @@ -3898,7 +3898,7 @@
> assert(scalingListType < 6);
> assert(m_qtTempTComYuv[qtlayer].m_cwidth == MAX_CU_SIZE /
> 2);
>
> -
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiV, MAX_CU_SIZE / 2, coeffCurV, trWidthC, trHeightC, scalingListType,
> true, lastPosTransformSkipV);
> +
> m_trQuant->invtransformNxN(cu->getCUTransquantBypass(absPartIdx), REG_DCT,
> curResiV, MAX_CU_SIZE / 2, coeffCurV, trWidthC, scalingListType, true,
> lastPosTransformSkipV);
>
> uint32_t dist =
> primitives.sse_ss[partSizeC](resiYuv->getCrAddr(absTUPartIdxC),
> resiYuv->m_cwidth,
>
> m_qtTempTComYuv[qtlayer].getCrAddr(absTUPartIdxC),
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20140215/7ed8bb62/attachment-0001.html>
More information about the x265-devel
mailing list