Changeset 1290 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon
- Timestamp:
- 18 Jul 2015, 01:59:29 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibCommon
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComChromaFormat.h
r1287 r1290 127 127 //returns the part index of the luma region that is co-located with the specified chroma region 128 128 129 static inline UInt getChromasCorrespondingPULumaIdx(const UInt lumaZOrderIdxInCtu, const ChromaFormat chFmt) 130 { 131 return enable4ChromaPUsInIntraNxNCU(chFmt) ? lumaZOrderIdxInCtu : lumaZOrderIdxInCtu & (~((1<<(2*g_uiAddCUDepth))-1)); //(lumaZOrderIdxInCtu/numParts)*numParts; 129 static inline UInt 130 getChromasCorrespondingPULumaIdx(const UInt lumaZOrderIdxInCtu, 131 const ChromaFormat chFmt, 132 const Int partsPerMinCU // 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize())) 133 ) 134 { 135 return enable4ChromaPUsInIntraNxNCU(chFmt) ? lumaZOrderIdxInCtu : lumaZOrderIdxInCtu & (~(partsPerMinCU-1)); 132 136 } 133 137 -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
r1289 r1290 1392 1392 { 1393 1393 const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth(); 1394 UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))<<((g_uiMaxCUDepth -getSlice()->getPPS()->getMaxCuDQPDepth())<<1); 1394 const UInt maxCUDepth = getSlice()->getSPS()->getMaxTotalCUDepth(); 1395 const UInt maxCuDQPDepth = getSlice()->getPPS()->getMaxCuDQPDepth(); 1396 const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1); 1397 UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>doubleDepthDifference)<<doubleDepthDifference; 1395 1398 UInt absRorderQpMinCUIdx = g_auiZscanToRaster[absZorderQpMinCUIdx]; 1396 1399 … … 1416 1419 { 1417 1420 const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth(); 1418 UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))<<((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1); 1421 const UInt maxCUDepth = getSlice()->getSPS()->getMaxTotalCUDepth(); 1422 const UInt maxCuDQPDepth = getSlice()->getPPS()->getMaxCuDQPDepth(); 1423 const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1); 1424 UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>doubleDepthDifference)<<doubleDepthDifference; 1419 1425 UInt absRorderQpMinCUIdx = g_auiZscanToRaster[absZorderQpMinCUIdx]; 1420 1426 … … 1461 1467 Char TComDataCU::getLastCodedQP( UInt uiAbsPartIdx ) 1462 1468 { 1463 UInt uiQUPartIdxMask = ~((1<<((g _uiMaxCUDepth- getSlice()->getPPS()->getMaxCuDQPDepth())<<1))-1);1469 UInt uiQUPartIdxMask = ~((1<<((getSlice()->getSPS()->getMaxTotalCUDepth() - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))-1); 1464 1470 Int iLastValidPartIdx = getLastValidPartIdx( uiAbsPartIdx&uiQUPartIdxMask ); // A idx will be invalid if it is off the right or bottom edge of the picture. 1465 1471 // If this CU is in the first CTU of the slice and there is no valid part before this one, use slice QP … … 1545 1551 UInt AbovePartIdx = MAX_UINT; 1546 1552 Int iLeftIntraDir, iAboveIntraDir; 1553 const TComSPS *sps=getSlice()->getSPS(); 1554 const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize())); 1547 1555 1548 1556 const ChannelType chType = toChannelType(compID); … … 1553 1561 if (isChroma(compID)) 1554 1562 { 1555 LeftPartIdx = getChromasCorrespondingPULumaIdx(LeftPartIdx, chForm );1563 LeftPartIdx = getChromasCorrespondingPULumaIdx(LeftPartIdx, chForm, partsPerMinCU); 1556 1564 } 1557 1565 iLeftIntraDir = pcCULeft ? ( pcCULeft->isIntra( LeftPartIdx ) ? pcCULeft->getIntraDir( chType, LeftPartIdx ) : DC_IDX ) : DC_IDX; … … 1562 1570 if (isChroma(compID)) 1563 1571 { 1564 AbovePartIdx = getChromasCorrespondingPULumaIdx(AbovePartIdx, chForm );1572 AbovePartIdx = getChromasCorrespondingPULumaIdx(AbovePartIdx, chForm, partsPerMinCU); 1565 1573 } 1566 1574 iAboveIntraDir = pcCUAbove ? ( pcCUAbove->isIntra( AbovePartIdx ) ? pcCUAbove->getIntraDir( chType, AbovePartIdx ) : DC_IDX ) : DC_IDX; … … 3406 3414 if (uiDirMode==DM_CHROMA_IDX) 3407 3415 { 3408 uiDirMode = getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, getPic()->getChromaFormat())); 3416 const TComSPS *sps=getSlice()->getSPS(); 3417 const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize())); 3418 uiDirMode = getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, getPic()->getChromaFormat(), partsPerMinCU)); 3409 3419 } 3410 3420 -
branches/SHM-dev/source/Lib/TLibCommon/TComLoopFilter.cpp
r1289 r1290 202 202 xSetEdgefilterPU ( pcCU, uiAbsZorderIdx ); 203 203 204 const UInt uiPelsInPart = sps.getMaxCUWidth() >> g_uiMaxCUDepth;204 const UInt uiPelsInPart = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth(); 205 205 206 206 for( UInt uiPartIdx = uiAbsZorderIdx; uiPartIdx < uiAbsZorderIdx + uiCurNumParts; uiPartIdx++ ) … … 294 294 const TComSPS &sps=*(pcCU->getSlice()->getSPS()); 295 295 296 const UInt uiWidthInBaseUnits = rect.width / (sps.getMaxCUWidth() >> g_uiMaxCUDepth);297 const UInt uiHeightInBaseUnits = rect.height / (sps.getMaxCUHeight() >> g_uiMaxCUDepth);296 const UInt uiWidthInBaseUnits = rect.width / (sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth()); 297 const UInt uiHeightInBaseUnits = rect.height / (sps.getMaxCUHeight() >> sps.getMaxTotalCUDepth()); 298 298 299 299 xSetEdgefilterMultiple( pcCU, rTu.GetAbsPartIdxCU(), uiTransDepthTotal, EDGE_VER, 0, m_stLFCUParam.bInternalEdge, uiWidthInBaseUnits, uiHeightInBaseUnits, &rect ); … … 584 584 UInt uiNumParts = pcCU->getPic()->getNumPartInCtuWidth()>>uiDepth; 585 585 586 UInt uiPelsInPart = sps.getMaxCUWidth() >> g_uiMaxCUDepth;586 UInt uiPelsInPart = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth(); 587 587 UInt uiBsAbsIdx = 0, uiBs = 0; 588 588 Int iOffset, iSrcStep; … … 693 693 Pel *piSrcCb = pcPicYuvRec->getAddr( COMPONENT_Cb, pcCU->getCtuRsAddr(), uiAbsZorderIdx ); 694 694 Pel *piSrcCr = pcPicYuvRec->getAddr( COMPONENT_Cr, pcCU->getCtuRsAddr(), uiAbsZorderIdx ); 695 696 695 const TComSPS &sps = *(pcCU->getSlice()->getSPS()); 697 696 #if SVC_EXTENSION … … 701 700 #endif 702 701 703 const UInt uiPelsInPartChromaH = sps.getMaxCUWidth() >> ( g_uiMaxCUDepth+pcPicYuvRec->getComponentScaleX(COMPONENT_Cb));704 const UInt uiPelsInPartChromaV = sps.getMaxCUHeight() >> ( g_uiMaxCUDepth+pcPicYuvRec->getComponentScaleY(COMPONENT_Cb));702 const UInt uiPelsInPartChromaH = sps.getMaxCUWidth() >> (sps.getMaxTotalCUDepth()+pcPicYuvRec->getComponentScaleX(COMPONENT_Cb)); 703 const UInt uiPelsInPartChromaV = sps.getMaxCUHeight() >> (sps.getMaxTotalCUDepth()+pcPicYuvRec->getComponentScaleY(COMPONENT_Cb)); 705 704 706 705 Int iQP = 0; -
branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp
r1289 r1290 117 117 const UInt uiTuHeight2 = uiTuHeight << 1; 118 118 119 const Int iBaseUnitSize = sps.getMaxCUWidth() >> g_uiMaxCUDepth;119 const Int iBaseUnitSize = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth(); 120 120 const Int iUnitWidth = iBaseUnitSize >> pcCU->getPic()->getPicYuvRec()->getComponentScaleX(compID); 121 121 const Int iUnitHeight = iBaseUnitSize >> pcCU->getPic()->getPicYuvRec()->getComponentScaleY(compID); -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp
r1289 r1290 75 75 } 76 76 #if SVC_EXTENSION 77 Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, constBool bIsVirtual, const UInt layerId )77 Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual, const UInt layerId ) 78 78 { 79 79 const ChromaFormat chromaFormatIDC = vps.getChromaFormatIdc(&sps, layerId); 80 const Int iWidth = vps.getPicWidthInLumaSamples(&sps, layerId); 81 const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId); 82 const UInt uiMaxCuWidth = sps.getMaxCUWidth(); 83 const UInt uiMaxCuHeight = sps.getMaxCUHeight(); 80 const Int iWidth = vps.getPicWidthInLumaSamples(&sps, layerId); 81 const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId); 82 const UInt uiMaxCuWidth = sps.getMaxCUWidth(); 83 const UInt uiMaxCuHeight = sps.getMaxCUHeight(); 84 const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); 84 85 85 86 const Window& conformanceWindow = vps.getConformanceWindow( &sps, layerId ); … … 110 111 } 111 112 #else 112 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual) 113 { 114 const ChromaFormat chromaFormatIDC=sps.getChromaFormatIdc(); 115 const Int iWidth = sps.getPicWidthInLumaSamples(); 116 const Int iHeight = sps.getPicHeightInLumaSamples(); 117 const UInt uiMaxCuWidth = sps.getMaxCUWidth(); 118 const UInt uiMaxCuHeight = sps.getMaxCUHeight(); 113 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual) 114 { 115 const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc(); 116 const Int iWidth = sps.getPicWidthInLumaSamples(); 117 const Int iHeight = sps.getPicHeightInLumaSamples(); 118 const UInt uiMaxCuWidth = sps.getMaxCUWidth(); 119 const UInt uiMaxCuHeight = sps.getMaxCUHeight(); 120 const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); 119 121 120 122 m_picSym.create( sps, pps, uiMaxDepth ); … … 262 264 Void TComPic::copyUpsampledMvField(UInt refLayerIdc) 263 265 { 264 UInt numPartitions = 1<<(g_uiMaxCUDepth<<1); 265 UInt widthMinPU = getSlice(0)->getSPS()->getMaxCUWidth() / (1<<g_uiMaxCUDepth); 266 UInt heightMinPU = getSlice(0)->getSPS()->getMaxCUHeight() / (1<<g_uiMaxCUDepth); 267 Int unitNum = max( 1, (Int)((16/widthMinPU)*(16/heightMinPU)) ); 266 const TComSPS *sps = getSlice(0)->getSPS(); 267 const UInt uiMaxDepth = sps->getMaxTotalCUDepth(); 268 const UInt numPartitions = 1<<(uiMaxDepth<<1); 269 const UInt widthMinPU = sps->getMaxCUWidth() / (1<<uiMaxDepth); 270 const UInt heightMinPU = sps->getMaxCUHeight() / (1<<uiMaxDepth); 271 const Int unitNum = max( 1, (Int)((16/widthMinPU)*(16/heightMinPU)) ); 268 272 269 273 for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++) //each LCU … … 314 318 Void TComPic::initUpsampledMvField() 315 319 { 316 UInt uiNumPartitions = 1<<(g_uiMaxCUDepth<<1); 320 const TComSPS *sps = getSlice(0)->getSPS(); 321 const UInt uiMaxDepth = sps->getMaxTotalCUDepth(); 322 const UInt uiNumPartitions = 1<<(uiMaxDepth<<1); 317 323 318 324 for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++) //each LCU -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.h
r1289 r1290 99 99 100 100 #if SVC_EXTENSION 101 Void create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, constBool bIsVirtual /*= false*/, const UInt layerId );101 Void create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual /*= false*/, const UInt layerId ); 102 102 #else 103 Void create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, constBool bIsVirtual /*= false*/ );103 Void create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual /*= false*/ ); 104 104 #endif 105 105 -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp
r1289 r1290 249 249 // ==================================================================================================================== 250 250 251 UInt g_uiMaxCUDepth = MAX_CU_DEPTH;252 UInt g_uiAddCUDepth = 0;253 251 UInt g_auiZscanToRaster [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, }; 254 252 UInt g_auiRasterToZscan [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, }; -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.h
r1289 r1290 85 85 Void initRasterToPelXY ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth ); 86 86 87 // global variable (CTU width/height, max. CU depth)88 extern UInt g_uiMaxCUDepth;89 extern UInt g_uiAddCUDepth;90 91 87 extern UInt g_auiPUOffset[NUMBER_OF_PART_SIZES]; 92 88 -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1289 r1290 2057 2057 , m_uiMaxCUWidth ( 32) 2058 2058 , m_uiMaxCUHeight ( 32) 2059 , m_uiMax CUDepth( 3)2059 , m_uiMaxTotalCUDepth ( 3) 2060 2060 , m_bLongTermRefsPresent (false) 2061 2061 , m_uiQuadtreeTULog2MaxSize ( 0) -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1287 r1290 1323 1323 UInt m_uiMaxCUWidth; 1324 1324 UInt m_uiMaxCUHeight; 1325 UInt m_uiMax CUDepth;1325 UInt m_uiMaxTotalCUDepth; ///< Total CU depth, relative to the smallest possible transform block size. 1326 1326 1327 1327 Window m_conformanceWindow; … … 1445 1445 Void setMaxCUHeight( UInt u ) { m_uiMaxCUHeight = u; } 1446 1446 UInt getMaxCUHeight() const { return m_uiMaxCUHeight; } 1447 Void setMax CUDepth( UInt u ) { m_uiMaxCUDepth = u;}1448 UInt getMax CUDepth() const { return m_uiMaxCUDepth;}1447 Void setMaxTotalCUDepth( UInt u ) { m_uiMaxTotalCUDepth = u; } 1448 UInt getMaxTotalCUDepth() const { return m_uiMaxTotalCUDepth; } 1449 1449 Void setUsePCM( Bool b ) { m_usePCM = b; } 1450 1450 Bool getUsePCM() const { return m_usePCM; } -
branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp
r1288 r1290 1760 1760 const ChannelType chType = toChannelType(compID); 1761 1761 const UInt uiChPredMode = pcCU->getIntraDir( chType, uiAbsPartIdx ); 1762 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode; 1762 const TComSPS *sps=pcCU->getSlice()->getSPS(); 1763 const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize())); 1764 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode; 1763 1765 const UInt uiChFinalMode = ((chFmt == CHROMA_422) && isChroma(compID)) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode; 1764 1766 … … 1830 1832 const ChannelType chType = toChannelType(compID); 1831 1833 const UInt uiChPredMode = pcCU->getIntraDir( chType, uiAbsPartIdx ); 1832 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode; 1834 const TComSPS *sps=pcCU->getSlice()->getSPS(); 1835 const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize())); 1836 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode; 1833 1837 const UInt uiChFinalMode = ((chFmt == CHROMA_422) && isChroma(compID)) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode; 1834 1838
Note: See TracChangeset for help on using the changeset viewer.