80 #if ADAPTIVE_QP_SELECTION
86 #if ADAPTIVE_QP_SELECTION
111 ,
TCoeff *pParentARLBuffer
159 const UInt totalSize = (uiWidth * uiHeight) >> chromaShift;
168 #if ADAPTIVE_QP_SELECTION
169 if( pParentARLBuffer != 0 )
173 pParentARLBuffer += totalSize;
316 #if ADAPTIVE_QP_SELECTION
404 return (((cuPosX+
getWidth( absPartIdx))%granularityWidth==0||(cuPosX+
getWidth( absPartIdx)==picWidth ))
405 && ((cuPosY+
getHeight(absPartIdx))%granularityWidth==0||(cuPosY+
getHeight(absPartIdx)==picHeight)));
472 const UInt numCoeffY = maxCUWidth*maxCUHeight;
477 #if ADAPTIVE_QP_SELECTION
580 const UInt numCoeffY = uhWidth*uhHeight;
587 #if ADAPTIVE_QP_SELECTION
598 assert( uiPartUnitIdx<4 );
623 memset(
m_phQP, qp, sizeInChar );
638 memset(
m_puhCbf[comp], 0, iSizeInUchar );
662 const UInt numCoeffY = uhWidth*uhHeight;
667 #if ADAPTIVE_QP_SELECTION
687 const UInt uiSizeInUchar =
sizeof(
UChar ) * uiNumPartition;
691 memset(
m_puhDepth + uiAbsPartIdx, uiDepth, uiSizeInUchar );
692 memset(
m_puhWidth + uiAbsPartIdx, uhWidth, uiSizeInUchar );
693 memset(
m_puhHeight + uiAbsPartIdx, uhHeight, uiSizeInUchar );
702 UInt uiPart = uiAbsPartIdx;
772 const UInt offset = uiCoffOffset >> componentShift;
774 #if ADAPTIVE_QP_SELECTION
823 assert( uiPartUnitIdx<4 );
834 Int iSizeInUchar =
sizeof(
UChar ) * uiNumPartition;
835 Int iSizeInBool =
sizeof(
Bool ) * uiNumPartition;
837 Int sizeInChar =
sizeof(
SChar ) * uiNumPartition;
839 memcpy(
m_phQP + uiOffset, pcCU->
getQP(), sizeInChar );
847 for (
UInt ch=0; ch<numValidChan; ch++)
855 for(
UInt comp=0; comp<numValidComp; comp++)
888 const UInt offsetY = uiPartUnitIdx*numCoeffY;
889 for (
UInt ch=0; ch<numValidComp; ch++)
893 const UInt offset = offsetY>>componentShift;
895 #if ADAPTIVE_QP_SELECTION
930 for (
UInt ch=0; ch<numValidChan; ch++)
938 for(
UInt comp=0; comp<numValidComp; comp++)
967 for (
UInt comp=0; comp<numValidComp; comp++)
971 memcpy( pCtu->
getCoeff(component) + (offsetY>>componentShift),
m_pcTrCoeff[component],
sizeof(
TCoeff)*(numCoeffY>>componentShift) );
972 #if ADAPTIVE_QP_SELECTION
986 UInt uiCurrPartUnitIdx,
987 Bool bEnforceSliceRestriction,
988 Bool bEnforceTileRestriction )
const
1018 UInt uiCurrPartUnitIdx,
1019 Bool bEnforceSliceRestriction,
1020 Bool planarAtCtuBoundary,
1021 Bool bEnforceTileRestriction )
const
1041 if(planarAtCtuBoundary)
1118 if ( uiCurrPartUnitIdx >
g_auiRasterToZscan[ uiAbsPartIdxLB + uiPartUnitOffset * numPartInCtuWidth - 1 ] )
1120 uiBLPartUnitIdx =
g_auiRasterToZscan[ uiAbsPartIdxLB + uiPartUnitOffset * numPartInCtuWidth - 1 ];
1134 uiBLPartUnitIdx =
g_auiRasterToZscan[ uiAbsPartIdxLB + (1+uiPartUnitOffset) * numPartInCtuWidth - 1 ];
1162 if ( uiCurrPartUnitIdx >
g_auiRasterToZscan[ uiAbsPartIdxRT - numPartInCtuWidth + uiPartUnitOffset ] )
1164 uiARPartUnitIdx =
g_auiRasterToZscan[ uiAbsPartIdxRT - numPartInCtuWidth + uiPartUnitOffset ];
1211 const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1);
1212 UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>doubleDepthDifference)<<doubleDepthDifference;
1238 const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1);
1239 UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>doubleDepthDifference)<<doubleDepthDifference;
1272 Int iLastValidPartIdx = iAbsPartIdx-1;
1273 while ( iLastValidPartIdx >= 0
1279 return iLastValidPartIdx;
1291 else if ( iLastValidPartIdx >= 0 )
1294 return getQP( iLastValidPartIdx );
1341 assert(4<NUM_CHROMA_MODE);
1345 for(
Int i = 0; i < NUM_CHROMA_MODE - 1; i++ )
1347 if( uiLumaMode == uiModeList[i] )
1366 Int iLeftIntraDir, iAboveIntraDir;
1388 iAboveIntraDir = pcCUAbove ? ( pcCUAbove->isIntra( AbovePartIdx ) ? pcCUAbove->getIntraDir( chType, AbovePartIdx ) :
DC_IDX ) :
DC_IDX;
1402 assert (2<NUM_MOST_PROBABLE_MODES);
1403 if(iLeftIntraDir == iAboveIntraDir)
1410 if (iLeftIntraDir > 1)
1412 uiIntraDirPred[0] = iLeftIntraDir;
1413 uiIntraDirPred[1] = ((iLeftIntraDir + 29) % 32) + 2;
1414 uiIntraDirPred[2] = ((iLeftIntraDir - 1 ) % 32) + 2;
1419 uiIntraDirPred[1] =
DC_IDX;
1429 uiIntraDirPred[0] = iLeftIntraDir;
1430 uiIntraDirPred[1] = iAboveIntraDir;
1432 if (iLeftIntraDir && iAboveIntraDir )
1438 uiIntraDirPred[2] = (iLeftIntraDir+iAboveIntraDir)<2?
VER_IDX :
DC_IDX;
1443 assert(uiIntraDirPred[i] < 35);
1454 uiCtx = ( pcTempCU ) ? ( ( pcTempCU->
getDepth( uiTempPartIdx ) > uiDepth ) ? 1 : 0 ) : 0;
1458 uiCtx += ( pcTempCU ) ? ( ( pcTempCU->
getDepth( uiTempPartIdx ) > uiDepth ) ? 1 : 0 ) : 0;
1469 return transformDepth;
1473 const UInt uiCtx = ( transformDepth == 0 ? 1 : 0 );
1484 Int interSplitFlag = ((quadtreeTUMaxDepth == 1) &&
isInter( absPartIdx ) && (partSize !=
SIZE_2Nx2N) );
1486 UInt log2MinTUSizeInCU = 0;
1495 log2MinTUSizeInCU = log2CbSize - ( quadtreeTUMaxDepth - 1 + interSplitFlag + intraSplitFlag);
1502 return log2MinTUSizeInCU;
1513 uiCtx = ( pcTempCU ) ? pcTempCU->
isSkipped( uiTempPartIdx ) : 0;
1517 uiCtx += ( pcTempCU ) ? pcTempCU->
isSkipped( uiTempPartIdx ) : 0;
1541 memset(
m_puhCbf[comp] + uiAbsPartIdx, uiCbf[comp],
sizeof(
UChar ) * uiCurrPartNumb );
1548 memset(
m_puhCbf[compID] + uiAbsPartIdx, uiCbf,
sizeof(
UChar ) * uiCurrPartNumb );
1560 setSubPart<UChar>( uiCbf,
m_puhCbf[compID], uiAbsPartIdx, uiDepth, uiPartIdx );
1565 memset((
m_puhCbf[compID] + uiAbsPartIdx), uiCbf, (
sizeof(
UChar) * uiCoveredPartIdxes));
1570 const UInt stopAbsPartIdx = uiAbsPartIdx + uiCoveredPartIdxes;
1572 for (
UInt subPartIdx = uiAbsPartIdx; subPartIdx < stopAbsPartIdx; subPartIdx++)
1574 m_puhCbf[compID][subPartIdx] |= uiCbf;
1581 memset(
m_puhDepth + uiAbsPartIdx, uiDepth,
sizeof(
UChar)*uiCurrPartNumb );
1622 UInt currPartNumQ = currPartNumb >> 2;
1625 if(!foundNonZeroCbf)
1629 for (
UInt partUnitIdx = 0; partUnitIdx < 4; partUnitIdx++ )
1631 setQPSubCUs( qp, absPartIdx+partUnitIdx*currPartNumQ, depth+1, foundNonZeroCbf );
1638 foundNonZeroCbf =
true;
1651 memset(
m_phQP+uiAbsPartIdx, qp, numPart);
1660 template<
typename T>
1663 assert(
sizeof(T) == 1 );
1669 memset( puhBaseCtu + uiCUAddr, uiParameter, 4 * uiCurrPartNumQ );
1672 memset( puhBaseCtu + uiCUAddr, uiParameter, 2 * uiCurrPartNumQ );
1675 memset( puhBaseCtu + uiCUAddr, uiParameter, uiCurrPartNumQ );
1676 memset( puhBaseCtu + uiCUAddr + 2 * uiCurrPartNumQ, uiParameter, uiCurrPartNumQ );
1679 memset( puhBaseCtu + uiCUAddr, uiParameter, uiCurrPartNumQ );
1684 memset( puhBaseCtu + uiCUAddr, uiParameter, (uiCurrPartNumQ >> 1) );
1685 memset( puhBaseCtu + uiCUAddr + uiCurrPartNumQ, uiParameter, (uiCurrPartNumQ >> 1) );
1687 else if ( uiPUIdx == 1 )
1689 memset( puhBaseCtu + uiCUAddr, uiParameter, (uiCurrPartNumQ >> 1) );
1690 memset( puhBaseCtu + uiCUAddr + uiCurrPartNumQ, uiParameter, ((uiCurrPartNumQ >> 1) + (uiCurrPartNumQ << 1)) );
1700 memset( puhBaseCtu + uiCUAddr, uiParameter, ((uiCurrPartNumQ << 1) + (uiCurrPartNumQ >> 1)) );
1701 memset( puhBaseCtu + uiCUAddr + (uiCurrPartNumQ << 1) + uiCurrPartNumQ, uiParameter, (uiCurrPartNumQ >> 1) );
1703 else if ( uiPUIdx == 1 )
1705 memset( puhBaseCtu + uiCUAddr, uiParameter, (uiCurrPartNumQ >> 1) );
1706 memset( puhBaseCtu + uiCUAddr + uiCurrPartNumQ, uiParameter, (uiCurrPartNumQ >> 1) );
1716 memset( puhBaseCtu + uiCUAddr, uiParameter, (uiCurrPartNumQ >> 2) );
1717 memset( puhBaseCtu + uiCUAddr + (uiCurrPartNumQ >> 1), uiParameter, (uiCurrPartNumQ >> 2) );
1718 memset( puhBaseCtu + uiCUAddr + (uiCurrPartNumQ << 1), uiParameter, (uiCurrPartNumQ >> 2) );
1719 memset( puhBaseCtu + uiCUAddr + (uiCurrPartNumQ << 1) + (uiCurrPartNumQ >> 1), uiParameter, (uiCurrPartNumQ >> 2) );
1721 else if ( uiPUIdx == 1 )
1723 memset( puhBaseCtu + uiCUAddr, uiParameter, (uiCurrPartNumQ >> 2) );
1724 memset( puhBaseCtu + uiCUAddr + (uiCurrPartNumQ >> 1), uiParameter, (uiCurrPartNumQ + (uiCurrPartNumQ >> 2)) );
1725 memset( puhBaseCtu + uiCUAddr + (uiCurrPartNumQ << 1), uiParameter, (uiCurrPartNumQ >> 2) );
1726 memset( puhBaseCtu + uiCUAddr + (uiCurrPartNumQ << 1) + (uiCurrPartNumQ >> 1), uiParameter, (uiCurrPartNumQ + (uiCurrPartNumQ >> 2)) );
1736 memset( puhBaseCtu + uiCUAddr, uiParameter, (uiCurrPartNumQ + (uiCurrPartNumQ >> 2)) );
1737 memset( puhBaseCtu + uiCUAddr + uiCurrPartNumQ + (uiCurrPartNumQ >> 1), uiParameter, (uiCurrPartNumQ >> 2) );
1738 memset( puhBaseCtu + uiCUAddr + (uiCurrPartNumQ << 1), uiParameter, (uiCurrPartNumQ + (uiCurrPartNumQ >> 2)) );
1739 memset( puhBaseCtu + uiCUAddr + (uiCurrPartNumQ << 1) + uiCurrPartNumQ + (uiCurrPartNumQ >> 1), uiParameter, (uiCurrPartNumQ >> 2) );
1741 else if ( uiPUIdx == 1 )
1743 memset( puhBaseCtu + uiCUAddr, uiParameter, (uiCurrPartNumQ >> 2) );
1744 memset( puhBaseCtu + uiCUAddr + (uiCurrPartNumQ >> 1), uiParameter, (uiCurrPartNumQ >> 2) );
1745 memset( puhBaseCtu + uiCUAddr + (uiCurrPartNumQ << 1), uiParameter, (uiCurrPartNumQ >> 2) );
1746 memset( puhBaseCtu + uiCUAddr + (uiCurrPartNumQ << 1) + (uiCurrPartNumQ >> 1), uiParameter, (uiCurrPartNumQ >> 2) );
1766 setSubPart<UChar>( uiMergeIndex,
m_puhMergeIndex, uiAbsPartIdx, uiDepth, uiPartIdx );
1771 setSubPart<UChar>( uiDir,
m_puhInterDir, uiAbsPartIdx, uiDepth, uiPartIdx );
1776 setSubPart<SChar>( iMVPIdx,
m_apiMVPIdx[eRefPicList], uiAbsPartIdx, uiDepth, uiPartIdx );
1781 setSubPart<SChar>( iMVPNum,
m_apiMVPNum[eRefPicList], uiAbsPartIdx, uiDepth, uiPartIdx );
1789 memset(
m_puhTrIdx + uiAbsPartIdx, uiTrIdx,
sizeof(
UChar)*uiCurrPartNumb );
1828 memset(
m_puhWidth + uiAbsPartIdx, uiWidth,
sizeof(
UChar)*uiCurrPartNumb );
1829 memset(
m_puhHeight + uiAbsPartIdx, uiHeight,
sizeof(
UChar)*uiCurrPartNumb );
1841 case SIZE_NxN: iNumPart = 4;
break;
1846 default: assert (0);
break;
1921 if ( uiPartIdx == 0 )
1925 else if ( uiPartIdx == 1 )
1935 if ( uiPartIdx == 0 )
1939 else if ( uiPartIdx == 1 )
1958 UInt uiPUHeight = 0;
1966 if ( uiPartIdx == 0 )
1970 else if ( uiPartIdx == 1 )
1980 if ( uiPartIdx == 0 )
1984 else if ( uiPartIdx == 1 )
2126 for (
UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
2128 if (
getInterDir( uiAbsPartIdx ) & ( 1 << uiRefListIdx ) )
2148 UInt uiAbsPartAddr = m_absZIdxInCtu + uiAbsPartIdx;
2150 for(
UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui )
2152 abCandIsInter[ui] =
false;
2153 pcMvFieldNeighbours[ ( ui << 1 ) ].setRefIdx(
NOT_VALID);
2154 pcMvFieldNeighbours[ ( ui << 1 ) + 1 ].setRefIdx(
NOT_VALID);
2156 numValidMergeCand = getSlice()->getMaxNumMergeCand();
2158 Int xP, yP, nPSW, nPSH;
2159 this->getPartPosition(uiPUIdx, xP, yP, nPSW, nPSH);
2163 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB;
2164 PartSize cCurPS = getPartitionSize( uiAbsPartIdx );
2165 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT );
2166 deriveLeftBottomIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLB );
2169 UInt uiLeftPartIdx = 0;
2170 const TComDataCU *pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB );
2172 Bool isAvailableA1 = pcCULeft &&
2173 pcCULeft->
isDiffMER(xP -1, yP+nPSH-1, xP, yP) &&
2175 pcCULeft->
isInter( uiLeftPartIdx ) ;
2177 if ( isAvailableA1 )
2179 abCandIsInter[iCount] =
true;
2181 puhInterDirNeighbours[iCount] = pcCULeft->
getInterDir( uiLeftPartIdx );
2184 if ( getSlice()->isInterB() )
2188 if ( mrgCandIdx == iCount )
2191 numSpatialMergeCandidates = iCount + 1;
2199 if (iCount == getSlice()->getMaxNumMergeCand())
2202 numSpatialMergeCandidates = iCount;
2207 UInt uiAbovePartIdx = 0;
2208 const TComDataCU *pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT );
2210 Bool isAvailableB1 = pcCUAbove &&
2211 pcCUAbove->
isDiffMER(xP+nPSW-1, yP-1, xP, yP) &&
2213 pcCUAbove->
isInter( uiAbovePartIdx );
2215 if ( isAvailableB1 && (!isAvailableA1 || !pcCULeft->
hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) )
2217 abCandIsInter[iCount] =
true;
2219 puhInterDirNeighbours[iCount] = pcCUAbove->
getInterDir( uiAbovePartIdx );
2222 if ( getSlice()->isInterB() )
2226 if ( mrgCandIdx == iCount )
2229 numSpatialMergeCandidates = iCount + 1;
2236 if (iCount == getSlice()->getMaxNumMergeCand())
2239 numSpatialMergeCandidates = iCount;
2245 UInt uiAboveRightPartIdx = 0;
2246 const TComDataCU *pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT );
2248 Bool isAvailableB0 = pcCUAboveRight &&
2249 pcCUAboveRight->
isDiffMER(xP+nPSW, yP-1, xP, yP) &&
2250 pcCUAboveRight->
isInter( uiAboveRightPartIdx );
2252 if ( isAvailableB0 && ( !isAvailableB1 || !pcCUAbove->
hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) )
2254 abCandIsInter[iCount] =
true;
2256 puhInterDirNeighbours[iCount] = pcCUAboveRight->
getInterDir( uiAboveRightPartIdx );
2259 if ( getSlice()->isInterB() )
2263 if ( mrgCandIdx == iCount )
2266 numSpatialMergeCandidates = iCount + 1;
2273 if (iCount == getSlice()->getMaxNumMergeCand())
2276 numSpatialMergeCandidates = iCount;
2282 UInt uiLeftBottomPartIdx = 0;
2283 const TComDataCU *pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB );
2285 Bool isAvailableA0 = pcCULeftBottom &&
2286 pcCULeftBottom->
isDiffMER(xP-1, yP+nPSH, xP, yP) &&
2287 pcCULeftBottom->
isInter( uiLeftBottomPartIdx ) ;
2289 if ( isAvailableA0 && ( !isAvailableA1 || !pcCULeft->
hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) )
2291 abCandIsInter[iCount] =
true;
2293 puhInterDirNeighbours[iCount] = pcCULeftBottom->
getInterDir( uiLeftBottomPartIdx );
2296 if ( getSlice()->isInterB() )
2300 if ( mrgCandIdx == iCount )
2303 numSpatialMergeCandidates = iCount + 1;
2310 if (iCount == getSlice()->getMaxNumMergeCand())
2313 numSpatialMergeCandidates = iCount;
2321 UInt uiAboveLeftPartIdx = 0;
2322 const TComDataCU *pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr );
2324 Bool isAvailableB2 = pcCUAboveLeft &&
2325 pcCUAboveLeft->
isDiffMER(xP-1, yP-1, xP, yP) &&
2326 pcCUAboveLeft->
isInter( uiAboveLeftPartIdx );
2328 if ( isAvailableB2 && ( !isAvailableA1 || !pcCULeft->
hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) )
2329 && ( !isAvailableB1 || !pcCUAbove->
hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) )
2331 abCandIsInter[iCount] =
true;
2333 puhInterDirNeighbours[iCount] = pcCUAboveLeft->
getInterDir( uiAboveLeftPartIdx );
2336 if ( getSlice()->isInterB() )
2340 if ( mrgCandIdx == iCount )
2343 numSpatialMergeCandidates = iCount + 1;
2351 if (iCount == getSlice()->getMaxNumMergeCand())
2354 numSpatialMergeCandidates = iCount;
2359 numSpatialMergeCandidates = iCount;
2361 if ( getSlice()->getEnableTMVPFlag() )
2366 deriveRightBottomIdx( uiPUIdx, uiPartIdxRB );
2369 const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth();
2370 const UInt numPartInCtuHeight = m_pcPic->getNumPartInCtuHeight();
2376 if ( ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() +
g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth () ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples () )
2377 && ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() +
g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) )
2379 if ( ( uiAbsPartIdxTmp % numPartInCtuWidth < numPartInCtuWidth - 1 ) &&
2380 ( uiAbsPartIdxTmp / numPartInCtuWidth < numPartInCtuHeight - 1 ) )
2383 ctuRsAddr = getCtuRsAddr();
2385 else if ( uiAbsPartIdxTmp % numPartInCtuWidth < numPartInCtuWidth - 1 )
2387 uiAbsPartAddr =
g_auiRasterToZscan[ (uiAbsPartIdxTmp + numPartInCtuWidth + 1) % m_pcPic->getNumPartitionsInCtu() ];
2389 else if ( uiAbsPartIdxTmp / numPartInCtuWidth < numPartInCtuHeight - 1 )
2392 ctuRsAddr = getCtuRsAddr() + 1;
2402 Bool bExistMV =
false;
2403 UInt uiPartIdxCenter;
2405 UInt uiArrayAddr = iCount;
2406 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter );
2407 bExistMV = ctuRsAddr >= 0 && xGetColMVP(
REF_PIC_LIST_0, ctuRsAddr, uiAbsPartAddr, cColMv, iRefIdx );
2408 if( bExistMV ==
false )
2410 bExistMV = xGetColMVP(
REF_PIC_LIST_0, getCtuRsAddr(), uiPartIdxCenter, cColMv, iRefIdx );
2415 pcMvFieldNeighbours[ 2 * uiArrayAddr ].setMvField( cColMv, iRefIdx );
2418 if ( getSlice()->isInterB() )
2420 bExistMV = ctuRsAddr >= 0 && xGetColMVP(
REF_PIC_LIST_1, ctuRsAddr, uiAbsPartAddr, cColMv, iRefIdx);
2421 if( bExistMV ==
false )
2423 bExistMV = xGetColMVP(
REF_PIC_LIST_1, getCtuRsAddr(), uiPartIdxCenter, cColMv, iRefIdx );
2428 pcMvFieldNeighbours[ 2 * uiArrayAddr + 1 ].setMvField( cColMv, iRefIdx );
2434 puhInterDirNeighbours[uiArrayAddr] = dir;
2435 abCandIsInter[uiArrayAddr] =
true;
2437 if ( mrgCandIdx == iCount )
2445 if (iCount == getSlice()->getMaxNumMergeCand())
2450 UInt uiArrayAddr = iCount;
2451 UInt uiCutoff = uiArrayAddr;
2453 if ( getSlice()->isInterB() )
2455 static const UInt NUM_PRIORITY_LIST=12;
2456 static const UInt uiPriorityList0[NUM_PRIORITY_LIST] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3};
2457 static const UInt uiPriorityList1[NUM_PRIORITY_LIST] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2};
2459 for (
Int idx=0; idx<uiCutoff*(uiCutoff-1) && uiArrayAddr!= getSlice()->getMaxNumMergeCand(); idx++)
2461 assert(idx<NUM_PRIORITY_LIST);
2462 Int i = uiPriorityList0[idx];
2463 Int j = uiPriorityList1[idx];
2464 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2))
2466 abCandIsInter[uiArrayAddr] =
true;
2467 puhInterDirNeighbours[uiArrayAddr] = 3;
2470 pcMvFieldNeighbours[uiArrayAddr << 1].setMvField(pcMvFieldNeighbours[i<<1].getMv(), pcMvFieldNeighbours[i<<1].getRefIdx());
2471 pcMvFieldNeighbours[( uiArrayAddr << 1 ) + 1].setMvField(pcMvFieldNeighbours[(j<<1)+1].getMv(), pcMvFieldNeighbours[(j<<1)+1].getRefIdx());
2473 Int iRefPOCL0 = m_pcSlice->getRefPOC(
REF_PIC_LIST_0, pcMvFieldNeighbours[(uiArrayAddr<<1)].getRefIdx() );
2474 Int iRefPOCL1 = m_pcSlice->getRefPOC(
REF_PIC_LIST_1, pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getRefIdx() );
2475 if (iRefPOCL0 == iRefPOCL1 && pcMvFieldNeighbours[(uiArrayAddr<<1)].getMv() == pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv())
2477 abCandIsInter[uiArrayAddr] =
false;
2487 if (uiArrayAddr == getSlice()->getMaxNumMergeCand())
2496 while (uiArrayAddr < getSlice()->getMaxNumMergeCand())
2498 abCandIsInter[uiArrayAddr] =
true;
2499 puhInterDirNeighbours[uiArrayAddr] = 1;
2500 pcMvFieldNeighbours[uiArrayAddr << 1].setMvField(
TComMv(0, 0), r);
2502 if ( getSlice()->isInterB() )
2504 puhInterDirNeighbours[uiArrayAddr] = 3;
2505 pcMvFieldNeighbours[(uiArrayAddr << 1) + 1].setMvField(
TComMv(0, 0), r);
2509 if ( refcnt == iNumRefIdx - 1 )
2519 numValidMergeCand = uiArrayAddr;
2530 if ((xN>>plevel)!= (xP>>plevel))
2534 if ((yN>>plevel)!= (yP>>plevel))
2557 yP = (partIdx ==0)? row: row + nPSH;
2562 xP = (partIdx ==0)? col: col + nPSW;
2568 xP = col + (partIdx&0x1)*nPSW;
2569 yP = row + (partIdx>>1)*nPSH;
2575 yP = (partIdx ==0)? row: row +
getHeight(0) - nPSH;
2582 yP = (partIdx ==0)? row: row +
getHeight(0) - nPSH;
2587 xP = (partIdx ==0)? col: col +
getWidth(0) - nPSW;
2593 xP = (partIdx ==0)? col: col +
getWidth(0) - nPSW;
2626 UInt partIdxLT, partIdxRT, partIdxLB;
2630 Bool isScaledFlagLX =
false;
2634 isScaledFlagLX = (tmpCU !=
NULL) && (tmpCU->
isInter(idx));
2635 if (!isScaledFlagLX)
2638 isScaledFlagLX = (tmpCU !=
NULL) && (tmpCU->
isInter(idx));
2686 if ( pInfo->
iN == 2 )
2701 const Int refIdx_Col = refIdx;
2715 if ( ( absPartIdx % numPartInCtuWidth < numPartInCtuWidth - 1 ) &&
2716 ( absPartIdx / numPartInCtuWidth < numPartInCtuHeight - 1 ) )
2721 else if ( absPartIdx % numPartInCtuWidth < numPartInCtuWidth - 1 )
2725 else if ( absPartIdx / numPartInCtuWidth < numPartInCtuHeight - 1 )
2735 if ( ctuRsAddr >= 0 &&
xGetColMVP( eRefPicList, ctuRsAddr, absPartAddr, cColMv, refIdx_Col ) )
2741 UInt uiPartIdxCenter;
2767 if (
getWidth(0) == 8 && (width < 8 || height < 8) )
2786 rcMv.
setHor( min (iHorMax, max (iHorMin, rcMv.
getHor())) );
2787 rcMv.
setVer( min (iVerMax, max (iVerMin, rcMv.
getVer())) );
2803 return uiCnt > 6 ? 6 : uiCnt;
2808 memset( &
m_puhCbf[compID][uiIdx], 0,
sizeof(
UChar)*uiNumParts);
2821 memset(
m_pbIPCMFlag + uiAbsPartIdx, bIpcmFlag,
sizeof(
Bool)*uiCurrPartNumb );
2845 neibCU =
getPULeft(neibPUPartIdx, uiPartUnitIdx);
2850 neibCU =
getPUAbove(neibPUPartIdx, uiPartUnitIdx);
2874 if ( neibCU ==
NULL )
2882 for(
Int predictorSource=0; predictorSource<2; predictorSource++)
2884 const RefPicList eRefPicListIndex = (predictorSource==0) ? eRefPicList : eRefPicList2nd;
2887 if ( neibRefIdx >= 0 && currRefPOC == neibCU->
getSlice()->
getRefPOC( eRefPicListIndex, neibRefIdx ))
2913 neibCU =
getPULeft(neibPUPartIdx, uiPartUnitIdx);
2918 neibCU =
getPUAbove(neibPUPartIdx, uiPartUnitIdx);
2942 if ( neibCU ==
NULL )
2952 const Int neibPOC = currPOC;
2954 for(
Int predictorSource=0; predictorSource<2; predictorSource++)
2956 const RefPicList eRefPicListIndex = (predictorSource==0) ? eRefPicList : eRefPicList2nd;
2958 if( neibRefIdx >= 0)
2962 if ( bIsCurrRefLongTerm == bIsNeibRefLongTerm )
2966 if ( bIsCurrRefLongTerm )
2974 if ( scale == 4096 )
2980 rcMv = cMvPred.
scaleMv( scale );
2994 const UInt absPartAddr = partUnitIdx;
2998 #if REDUCED_ENCODER_MEMORY
3014 #if REDUCED_ENCODER_MEMORY
3015 if (!pColDpbCtu->
isInter(absPartAddr))
3017 if (!pColCtu->isInter(absPartAddr))
3024 #if REDUCED_ENCODER_MEMORY
3027 Int iColRefIdx = pColCtu->getCUMvField(
RefPicList(eColRefPicList))->getRefIdx(absPartAddr);
3030 if (iColRefIdx < 0 )
3032 eColRefPicList =
RefPicList(1 - eColRefPicList);
3033 #if REDUCED_ENCODER_MEMORY
3036 iColRefIdx = pColCtu->getCUMvField(
RefPicList(eColRefPicList))->getRefIdx(absPartAddr);
3039 if (iColRefIdx < 0 )
3046 #if REDUCED_ENCODER_MEMORY
3049 const Bool bIsColRefLongTerm = pColCtu->getSlice()->getIsUsedAsLongTerm(eColRefPicList, iColRefIdx);
3052 if ( bIsCurrRefLongTerm != bIsColRefLongTerm )
3058 #if REDUCED_ENCODER_MEMORY
3061 const TComMv &cColMv = pColCtu->getCUMvField(eColRefPicList)->getMv(absPartAddr);
3063 if ( bIsCurrRefLongTerm )
3070 #if REDUCED_ENCODER_MEMORY
3072 const Int colRefPOC = pColSlice->
getRefPOC(eColRefPicList, iColRefIdx);
3074 const Int colPOC = pColCtu->getSlice()->getPOC();
3075 const Int colRefPOC = pColCtu->getSlice()->getRefPOC(eColRefPicList, iColRefIdx);
3079 if ( scale == 4096 )
3085 rcMv = cColMv.
scaleMv( scale );
3095 Int iDiffPocD = iColPOC - iColRefPOC;
3096 Int iDiffPocB = iCurrPOC - iCurrRefPOC;
3098 if( iDiffPocD == iDiffPocB )
3104 Int iTDB =
Clip3( -128, 127, iDiffPocB );
3105 Int iTDD =
Clip3( -128, 127, iDiffPocD );
3106 Int iX = (0x4000 + abs(iTDD/2)) / iTDD;
3107 Int iScale =
Clip3( -4096, 4095, (iTDB * iX + 32) >> 6 );
3127 #if REDUCED_ENCODER_MEMORY
3140 if (scaleFactor > 0)
3170 if ((uiWidth > maximumWidth) || (uiHeight > maximumHeight))
3218 return (rightEdgeCTUPosInCurrentTile == ctuXPosInCtus);
SChar g_aucConvertToBit[MAX_CU_SIZE+1]
Void copyPartFrom(TComDataCU *pcCU, UInt uiPartUnitIdx, UInt uiDepth)
UInt getQuadtreeTULog2MinSizeInCU(UInt uiIdx) const
static const Int MDCS_MAXIMUM_HEIGHT
(measured in pixels) TUs with height greater than this can only use diagonal scan ...
UChar getNumPartitions(const UInt uiAbsPartIdx=0) const
static const Int NOT_VALID
Void setMVPNumSubParts(Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
Void initEstData(const UInt uiDepth, const Int qp, const Bool bTransquantBypass)
Int getMVPIdx(RefPicList eRefPicList, UInt uiIdx) const
SChar * m_crossComponentPredictionAlpha[MAX_NUM_COMPONENT]
array of cross-component prediction alpha values
UInt m_absZIdxInCtu
absolute address in a CTU. It's Z scan order
Int getRefIdx(Int iIdx) const
Void setSkipFlagSubParts(Bool skip, UInt absPartIdx, UInt depth)
UInt m_uiTotalBins
sum of partition bins
SChar * getPartitionSize()
Void linkToWithOffset(TComCUMvField const *src, Int offset)
TCoeff * getArlCoeff(ComponentID component)
UChar * m_puhDepth
array of depths
static const Int AMVP_DECIMATION_FACTOR
static const Int HOR_IDX
index for intra HORIZONTAL mode
Bool CUIsFromSameTile(const TComDataCU *pCU) const
picture class (symbol + YUV buffers)
Void initSubCU(TComDataCU *pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp)
Void getInterMergeCandidates(UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField *pcMFieldNeighbours, UChar *puhInterDirNeighbours, Int &numValidMergeCand, UInt &numSpatialMergeCandidates, Int mrgCandIdx=-1) const
Construct a list of merging candidates.
UChar * getExplicitRdpcmMode(ComponentID component)
Void deriveRightBottomIdx(UInt uiPartIdx, UInt &ruiPartIdxRB) const
static const Int DM_CHROMA_IDX
chroma mode index for derived from luma intra mode
static const Int NUM_CHROMA_MODE
total number of chroma modes
Void deriveLeftBottomIdx(UInt uiPartIdx, UInt &ruiPartIdxLB) const
static const Int MRG_MAX_NUM_CANDS
MERGE.
SChar * getCrossComponentPredictionAlpha(ComponentID compID)
Void deriveLeftRightTopIdxGeneral(UInt uiAbsPartIdx, UInt uiPartIdx, UInt &ruiPartIdxLT, UInt &ruiPartIdxRT) const
const TComDataCU * getPUBelowLeft(UInt &uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset=1, Bool bEnforceSliceRestriction=true) const
returns CU and part index of the PU left of the lefthand column of the current uiCurrPartUnitIdx of t...
Int getMVPNum(RefPicList eRefPicList, UInt uiIdx) const
Void fillMvpCand(const UInt uiPartIdx, const UInt uiPartAddr, const RefPicList eRefPicList, const Int iRefIdx, AMVPInfo *pInfo) const
Void setMergeFlagSubParts(Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
UChar * getTransformIdx()
UChar getQtRootCbf(UInt uiIdx) const
Void initCtu(TComPic *pcPic, UInt ctuRsAddr)
const TComSlice * getSlice() const
TComSlice * getSlice(Int i)
class for motion vector with reference index
static Bool isEqualCol(Int addrA, Int addrB, Int numUnitsPerRow)
UInt m_uiTotalBits
sum of partition bits
Bool isLastColumnCTUInTile() const
SChar * getPredictionMode()
UInt getNumPartitionsInCtu() const
Void setExplicitRdpcmModePartRange(UInt rdpcmMode, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
TComPic * m_pcPic
picture class pointer
TComDataCU * getCtuAboveLeft()
Bool getIsLongTerm() const
Void setQPSubCUs(Int qp, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf)
Void setTransformSkipPartRange(UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
Bool CUIsFromSameSliceTileAndWavefrontRow(const TComDataCU *pCU) const
symmetric motion partition, 2Nx N
UInt getMinCUHeight() const
TComDataCU * getCtuAboveRight()
static Bool isEqualRowOrCol(Int addrA, Int addrB, Int numUnitsPerRow)
UInt getMaxCUHeight() const
Void setCbfPartRange(UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
Bool xAddMVPCandUnscaled(AMVPInfo &info, const RefPicList eRefPicList, const Int iRefIdx, const UInt uiPartUnitIdx, const MVP_DIR eDir) const
adds a single possible motion vector predictor candidate
UChar * m_puhCbf[MAX_NUM_COMPONENT]
array of coded block flags (CBF)
Bool isInter(const UInt absPartAddr) const
UInt GetTransformDepthRel() const
Int getNumberValidComponents() const
UInt getCtxSkipFlag(UInt uiAbsPartIdx) const
UChar * m_puhMergeIndex
array of merge candidate indices
Void copyInterPredInfoFrom(TComDataCU *pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList)
UChar getCbf(UInt uiIdx, ComponentID eType) const
UInt getCtxInterDir(UInt uiAbsPartIdx) const
const TComDataCU * getPUAboveRight(UInt &uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset=1, Bool bEnforceSliceRestriction=true) const
returns CU and part index of the PU above the top row of the current uiCurrPartUnitIdx of the CU...
UInt getMinCUWidth() const
UChar * m_puhTrIdx
array of transform indices
TComMv m_acMvCand[AMVP_MAX_NUM_CANDS]
array of motion vector predictor candidates
UInt getFrameWidthInCtus() const
Void clearCbf(UInt uiIdx, ComponentID eType, UInt uiNumParts)
UInt getZorderIdxInCtu() const
Distortion & getTotalDistortion()
Bool m_bDecSubCu
indicates decoder-mode
static Bool lessThanCol(Int addr, Int val, Int numUnitsPerRow)
Void getAllowedChromaDir(UInt uiAbsPartIdx, UInt *uiModeList) const
Void setCUTransquantBypassSubParts(Bool flag, UInt uiAbsPartIdx, UInt uiDepth)
Bool CUIsFromSameSlice(const TComDataCU *pCU) const
TComDataCU * m_pCtuAboveRight
pointer of above-right CTU.
Bool isInter(UInt uiPartIdx) const
const TComDataCU * getQpMinCuAbove(UInt &uiAPartUnitIdx, UInt uiCurrAbsIdxInCtu) const
UInt getNumPartInCtuHeight() const
Void setInterDirSubParts(UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
SChar * m_pePartSize
array of partition sizes
Void setOutsideCUPart(UInt uiAbsPartIdx, UInt uiDepth)
Void copyFrom(TComCUMvField const *pcCUMvFieldSrc, Int iNumPartSrc, Int iPartAddrDst)
class for motion information in one CU
static Bool isEqualRow(Int addrA, Int addrB, Int numUnitsPerRow)
UInt getMaxTotalCUDepth() const
SChar * m_apiMVPIdx[NUM_REF_PIC_LIST_01]
array of motion vector predictor candidates
const TComDataCU * getQpMinCuLeft(UInt &uiLPartUnitIdx, UInt uiCurrAbsIdxInCtu) const
Void setChromaQpAdjSubParts(UChar val, Int absPartIdx, Int depth)
PartSize
supported partition shape
UInt getNumPartInCtuWidth() const
Void setDepthSubParts(UInt uiDepth, UInt uiAbsPartIdx)
UInt m_uiCUPelY
CU position in a pixel (Y)
Bool hasEqualMotion(UInt uiAbsPartIdx, const TComDataCU *pcCandCU, UInt uiCandAbsPartIdx) const
UInt getIntraSizeIdx(UInt uiAbsPartIdx) const
UInt getCoefScanIdx(const UInt uiAbsPartIdx, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) const
UChar * getIntraDir(const ChannelType channelType) const
Void setMvField(TComMv const &cMv, Int iRefIdx)
UChar * m_puhInterDir
array of inter directions
PartSize getPartitionSize(const UInt absPartAddr) const
UInt getTileIdxMap(Int ctuRsAddr) const
Int iN
number of motion vector predictor candidates
symmetric motion partition, 2Nx2N
Void setCrossComponentPredictionAlphaPartRange(SChar alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
static Bool lessThanRow(Int addr, Int val, Int numUnitsPerRow)
Bool isIntra(UInt uiPartIdx) const
Void setPartSizeSubParts(PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth)
Void setTransformSkipSubParts(UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiDepth)
TComDataCU * m_pCtuAbove
pointer of above CTU.
const TComDataCU * getPULeft(UInt &uiLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceTileRestriction=true) const
#define ADAPTIVE_QP_SELECTION
G382: Adaptive reconstruction levels, non-normative part for adaptive QP selection.
Double m_dTotalCost
sum of partition RD costs
Void clipMv(TComMv &rcMv) const
static const Int VER_IDX
index for intra VERTICAL mode
TCoeff * m_pcTrCoeff[MAX_NUM_COMPONENT]
array of transform coefficient buffers (0->Y, 1->Cb, 2->Cr)
Pel * m_pcIPCMSample[MAX_NUM_COMPONENT]
PCM sample buffer (0->Y, 1->Cb, 2->Cr)
Bool isLosslessCoded(UInt absPartIdx) const
static const Int AMVP_MAX_NUM_CANDS
AMVP: advanced motion vector prediction - max number of final candidates.
static Bool isZeroRow(Int addr, Int numUnitsPerRow)
Void setIntraDirSubParts(const ChannelType channelType, const UInt uiDir, const UInt uiAbsPartIdx, const UInt uiDepth)
UInt getMinCUHeight() const
UInt getQuadtreeTUMaxDepthIntra() const
UInt getCtxSplitFlag(UInt uiAbsPartIdx, UInt uiDepth) const
asymmetric motion partition, 2Nx( N/2) + 2Nx(3N/2)
Void getPartPosition(UInt partIdx, Int &xP, Int &yP, Int &nPSW, Int &nPSH) const
Bool isFirstAbsZorderIdxInDepth(UInt uiAbsPartIdx, UInt uiDepth) const
Void setNumPartition(Int iNumPart)
asymmetric motion partition, (3N/2)x2N + ( N/2)x2N
MVP_DIR
motion vector predictor direction used in AMVP
UInt getPicHeightInLumaSamples() const
TComDataCU * getCtuLeft()
Void getIntraDirPredictor(UInt uiAbsPartIdx, Int uiIntraDirPred[NUM_MOST_PROBABLE_MODES], const ComponentID compID, Int *piMode=0) const
MVP of above right block.
T Clip3(const T minVal, const T maxVal, const T a)
general min/max clip
TComMv const & getMv(Int iIdx) const
Int getRefPOC(RefPicList e, Int iRefIdx) const
static const Int DC_IDX
index for intra DC mode
UChar * m_puhTransformSkip[MAX_NUM_COMPONENT]
array of transform skipping flags
Int TCoeff
transform coefficient
Int getComponentScaleX(const ComponentID id) const
UChar * m_ChromaQpAdj
array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0...
RefPicList
reference list index
UInt getMaxCuDQPDepth() const
ChromaFormat
chroma formats (according to semantics of chroma_format_idc)
UInt getQuadtreeTULog2MinSize() const
Void setSubPart(T bParameter, T *pbBaseCtu, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx)
Bool hasDPBPerCtuData() const
Distortion m_uiTotalDistortion
sum of partition distortion
UInt m_uiCUPelX
CU position in a pixel (X)
Void copyTo(TComCUMvField *pcCUMvFieldDst, Int iPartAddrDst) const
TComCUMvField m_acCUMvField[NUM_REF_PIC_LIST_01]
array of motion vectors.
Bool isSkipped(UInt uiPartIdx) const
returns true, if the partiton is skipped
Bool getIsUsedAsLongTerm(Int i, Int j) const
UInt g_auiZscanToRaster[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
const TComPPS * getPPS() const
UInt getPicWidthInLumaSamples() const
Void setQPSubParts(Int qp, UInt uiAbsPartIdx, UInt uiDepth)
Void copyToPic(UChar uiDepth)
UInt g_auiRasterToZscan[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
Void copySubCU(TComDataCU *pcCU, UInt uiPartUnitIdx)
static Void getMvField(const TComDataCU *pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField &rcMvField)
UChar * getTransformSkip(ComponentID compID)
ChromaFormat getChromaFormat() const
Void setIPCMFlagSubParts(Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth)
Void getPartIndexAndSize(UInt uiPartIdx, UInt &ruiPartAddr, Int &riWidth, Int &riHeight) const
#define xMalloc(type, len)
static const Int MDCS_ANGLE_LIMIT
0 = Horizontal/vertical only, 1 = Horizontal/vertical +/- 1, 2 = Horizontal/vertical +/- 2 etc...
static Int xGetDistScaleFactor(Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC)
compute scaling factor from POC difference
Void compress(SChar *pePredMode, const SChar *pePredModeSource, const Int scale, const TComCUMvField &source)
UInt getCurrSliceIdx() const
const TComSPS & getSPS() const
Bool getEntropyCodingSyncEnabledFlag() const
TComDataCU * m_pCtuLeft
pointer of left CTU
Void setSizeSubParts(UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth)
Void xDeriveCenterIdx(UInt uiPartIdx, UInt &ruiPartIdxCenter) const
Int getLog2DiffMaxMinCodingBlockSize() const
static Bool isZeroCol(Int addr, Int numUnitsPerRow)
Bool * getCUTransquantBypass()
UInt getSliceCurStartCtuTsAddr() const
Bool xGetColMVP(const RefPicList eRefPicList, const Int ctuRsAddr, const Int partUnitIdx, TComMv &rcMv, const Int refIdx) const
Bool xAddMVPCandWithScaling(AMVPInfo &info, const RefPicList eRefPicList, const Int iRefIdx, const UInt uiPartUnitIdx, const MVP_DIR eDir) const
asymmetric motion partition, ( N/2)x2N + (3N/2)x2N
UChar * m_puhWidth
array of widths
const TComCUMvField * getCUMvField(RefPicList e) const
Bool isDiffMER(Int xN, Int yN, Int xP, Int yP) const
const TComDataCU * getPUAboveLeft(UInt &uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true) const
Void create(ChromaFormat chromaFormatIDC, UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize, TCoeff *pParentARLBuffer=0)
TComDataCU * getCtu(UInt ctuRsAddr)
UInt m_uiNumPartition
total number of minimum partitions in a CU
const UChar g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE]
const TComDataCU * getPUAbove(UInt &uiAPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool planarAtCTUBoundary=false, Bool bEnforceTileRestriction=true) const
UInt m_ctuRsAddr
CTU (also known as LCU) address in a slice (Raster-scan address, as opposed to tile-scan/encoding ord...
Int getLastValidPartIdx(Int iAbsPartIdx) const
TComDataCU * getCtuAbove()
Bool m_ArlCoeffIsAliasedAllocation
ARL coefficient buffer is an alias of the global buffer and must not be free()'d. ...
Void setCbfSubParts(const UInt uiCbf[MAX_NUM_COMPONENT], UInt uiAbsPartIdx, UInt uiDepth)
static const Double MAX_DOUBLE
max. value of Double-type value
static const Int PLANAR_IDX
SChar * m_pePredMode
array of prediction modes
TComTile * getTComTile(UInt tileIdx)
UInt getCtxQtCbf(TComTU &rTu, const ChannelType chType) const
TComCUMvField * getCUMvField(RefPicList e)
UInt getLog2ParallelMergeLevelMinus2() const
TCoeff * getCoeff(ComponentID component)
Bool isLastSubCUOfCtu(const UInt absPartIdx) const
Bool * m_CUTransquantBypass
array of cu_transquant_bypass flags
basic motion vector class
Bool CUIsFromSameSliceAndTile(const TComDataCU *pCU) const
UInt numSpatialMVPCandidates
SChar getLastCodedQP(UInt uiAbsPartIdx) const
UInt getQuadtreeTULog2MaxSize() const
static const UInt MAX_UINT
max. value of unsigned 32-bit integer
Int getComponentScaleY(const ComponentID id) const
PredMode
supported prediction type
Void deriveLeftRightTopIdx(UInt uiPartIdx, UInt &ruiPartIdxLT, UInt &ruiPartIdxRT) const
Void setPredModeSubParts(PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth)
TCoeff * m_pcArlCoeff[MAX_NUM_COMPONENT]
ARL coefficient buffer (0->Y, 1->Cb, 2->Cr)
Void setMergeIndexSubParts(UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
TComSlice * m_pcSlice
slice header pointer
UInt getRightEdgePosInCtus() const
Bool isBipredRestriction(UInt puIdx) const
SChar getRefQP(UInt uiCurrAbsIdxInCtu) const
asymmetric motion partition, 2Nx(3N/2) + 2Nx( N/2)
TComDataCU * m_pCtuAboveLeft
pointer of above-left CTU.
UChar * m_puhHeight
array of heights
Bool * m_skipFlag
array of skip flags
symmetric motion partition, Nx N
TComCUMvField m_CUMvField[NUM_REF_PIC_LIST_01]
Void create(UInt uiNumPartition)
static const Int MDCS_MAXIMUM_WIDTH
(measured in pixels) TUs with width greater than this can only use diagonal scan
Pel * getPCMSample(ComponentID component)
const TComMv scaleMv(Int iScale) const
Void set(Short iHor, Short iVer)
UInt g_auiRasterToPelX[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
Bool * m_pbIPCMFlag
array of intra_pcm flags
SChar * m_phQP
array of QP values
UInt getQuadtreeTUMaxDepthInter() const
Void setMVPIdxSubParts(Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth)
CU data structure (header)
static const UInt NUM_MOST_PROBABLE_MODES
UChar * getChromaQpAdj()
array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0...
UInt getFrameWidthInCtus() const
TComPic * getRefPic(RefPicList e, Int iRefIdx)
Int m_unitSize
size of a "minimum partition"
symmetric motion partition, Nx2N
Void bitwiseOrCbfPartRange(UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes)
UChar * m_explicitRdpcmMode[MAX_NUM_COMPONENT]
Stores the explicit RDPCM mode for all TUs belonging to this CU.
Void deriveLeftBottomIdxGeneral(UInt uiAbsPartIdx, UInt uiPartIdx, UInt &ruiPartIdxLB) const
Bool * m_pbMergeFlag
array of merge flags
UInt g_auiRasterToPelY[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
UInt getMaxCUWidth() const
const TComSPS * getSPS() const
SChar * m_apiMVPNum[NUM_REF_PIC_LIST_01]
array of number of possible motion vectors predictors
DPBPerCtuData & getDPBPerCtuData(UInt ctuRsAddr)
Void setTrIdxSubParts(UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth)
UChar * m_puhIntraDir[MAX_NUM_CHANNEL_TYPE]