# HG changeset patch
# User Min Chen <[email protected]>
# Date 1394647344 25200
# Node ID ad1470a0e17e48d3d198da09fb8b251b84c59614
# Parent 265ddf73f344ba41fdb885a8b40795b4fb453f48
optimize: simplify operators on loop sigCoeffGroupFlag
diff -r 265ddf73f344 -r ad1470a0e17e source/Lib/TLibEncoder/TEncSbac.cpp
--- a/source/Lib/TLibEncoder/TEncSbac.cpp Wed Mar 12 11:01:32 2014 -0700
+++ b/source/Lib/TLibEncoder/TEncSbac.cpp Wed Mar 12 11:02:24 2014 -0700
@@ -2092,15 +2092,18 @@
uint32_t sigCoeffGroupFlag[MLS_GRP_NUM];
uint32_t cgNum = 1 << codingParameters.log2TrSizeCG * 2;
memset(sigCoeffGroupFlag, 0, sizeof(uint32_t) * cgNum);
+ const uint32_t maskPosXY = (1 << (log2TrSize - MLS_CG_LOG2_SIZE)) - 1;
do
{
posLast = codingParameters.scan[++scanPosLast];
if (coeff[posLast] != 0)
{
// get L1 sig map
- uint32_t posy = posLast >> log2TrSize;
- uint32_t posx = posLast - (posy << log2TrSize);
- uint32_t blkIdx = ((posy >> MLS_CG_LOG2_SIZE) <<
codingParameters.log2TrSizeCG) + (posx >> MLS_CG_LOG2_SIZE);
+ // NOTE: the new algorithm is complicated, so I keep reference
code here
+ //uint32_t posy = posLast >> log2TrSize;
+ //uint32_t posx = posLast - (posy << log2TrSize);
+ //uint32_t blkIdx0 = ((posy >> MLS_CG_LOG2_SIZE) <<
codingParameters.log2TrSizeCG) + (posx >> MLS_CG_LOG2_SIZE);
+ uint32_t blkIdx = ((posLast >> (2 * MLS_CG_LOG2_SIZE)) &
~maskPosXY) + ((posLast >> MLS_CG_LOG2_SIZE) & maskPosXY);
sigCoeffGroupFlag[blkIdx] = 1;
numSig--;
_______________________________________________
x265-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/x265-devel