Changeset 1290 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder
- Timestamp:
- 18 Jul 2015, 01:59:29 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibDecoder
- Files:
-
- 5 edited
-
TDecCAVLC.cpp (modified) (3 diffs)
-
TDecCu.cpp (modified) (7 diffs)
-
TDecEntropy.cpp (modified) (1 diff)
-
TDecSbac.cpp (modified) (10 diffs)
-
TDecTop.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1287 r1290 868 868 869 869 Int addCuDepth = max (0, log2MinCUSize - (Int)pcSPS->getQuadtreeTULog2MinSize() ); 870 pcSPS->setMax CUDepth( maxCUDepthDelta + addCuDepth + getMaxCUDepthOffset(pcSPS->getChromaFormatIdc(), pcSPS->getQuadtreeTULog2MinSize()) );870 pcSPS->setMaxTotalCUDepth( maxCUDepthDelta + addCuDepth + getMaxCUDepthOffset(pcSPS->getChromaFormatIdc(), pcSPS->getQuadtreeTULog2MinSize()) ); 871 871 872 872 READ_FLAG( uiCode, "scaling_list_enabled_flag" ); pcSPS->setScalingListFlag ( uiCode ); … … 2347 2347 Void TDecCavlc::parseDeltaQP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2348 2348 { 2349 Int qp;2350 2349 Int iDQp; 2351 2350 … … 2361 2360 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA); 2362 2361 #endif 2363 qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+ qpBdOffsetY)) - qpBdOffsetY; 2364 2365 UInt uiAbsQpCUPartIdx = (uiAbsPartIdx>>((g_uiMaxCUDepth - pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())<<1))<<((g_uiMaxCUDepth - pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())<<1) ; 2366 UInt uiQpCUDepth = min(uiDepth,pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()) ; 2362 const Int qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+ qpBdOffsetY)) - qpBdOffsetY; 2363 2364 const UInt maxCUDepth = pcCU->getSlice()->getSPS()->getMaxTotalCUDepth(); 2365 const UInt maxCuDQPDepth = pcCU->getSlice()->getPPS()->getMaxCuDQPDepth(); 2366 const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1); 2367 const UInt uiAbsQpCUPartIdx = (uiAbsPartIdx>>doubleDepthDifference)<<doubleDepthDifference ; 2368 const UInt uiQpCUDepth = min(uiDepth,pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()) ; 2367 2369 2368 2370 pcCU->setQPSubParts( qp, uiAbsQpCUPartIdx, uiQpCUDepth ); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp
r1289 r1290 235 235 bBoundary = true; 236 236 } 237 238 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) ) || bBoundary ) 237 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary ) 239 238 { 240 239 UInt uiIdx = uiAbsPartIdx; 241 if( (maxCuWidth>>uiDepth) == (maxCuWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression240 if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP()) 242 241 { 243 242 setdQPFlag(true); … … 245 244 } 246 245 247 if( (maxCuWidth>>uiDepth) == (maxCuWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj() ) // TODO: tidy expression246 if( uiDepth == pps.getMaxCuChromaQpAdjDepth() && pcCU->getSlice()->getUseChromaQpAdj() ) 248 247 { 249 248 setIsChromaQpAdjCoded(true); … … 270 269 uiIdx += uiQNumParts; 271 270 } 272 if( (maxCuWidth>>uiDepth) == (maxCuWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression271 if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP()) 273 272 { 274 273 if ( getdQPFlag() ) … … 281 280 } 282 281 283 if( (maxCuWidth>>uiDepth) >= (maxCuWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression282 if( uiDepth <= pps.getMaxCuDQPDepth() && pps.getUseDQP()) 284 283 { 285 284 setdQPFlag(true); … … 287 286 } 288 287 289 if( (maxCuWidth>>uiDepth) >= (maxCuWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj() ) // TODO: tidy expression288 if( uiDepth <= pps.getMaxCuChromaQpAdjDepth() && pcCU->getSlice()->getUseChromaQpAdj() ) 290 289 { 291 290 setIsChromaQpAdjCoded(true); … … 416 415 } 417 416 418 if( ( ( uiDepth < pCtu->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth) ) || bBoundary )417 if( ( ( uiDepth < pCtu->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary ) 419 418 { 420 419 UInt uiNextDepth = uiDepth + 1; … … 569 568 570 569 const UInt uiChPredMode = pcCU->getIntraDir( toChannelType(compID), uiAbsPartIdx ); 571 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode; 570 const UInt partsPerMinCU = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize())); 571 const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode; 572 572 const UInt uiChFinalMode = ((chFmt == CHROMA_422) && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode; 573 573 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.cpp
r1286 r1290 184 184 PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx ); 185 185 UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) ); 186 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMax CUDepth() - uiDepth ) << 1 ) ) >> 4;186 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4; 187 187 188 188 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r1289 r1290 510 510 Void TDecSbac::parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 511 511 { 512 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth)512 if( uiDepth == pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize() ) 513 513 { 514 514 pcCU->setDepthSubParts( uiDepth, uiAbsPartIdx ); … … 540 540 const UChar cuWidth =UChar(pcCU->getSlice()->getSPS()->getMaxCUWidth()>>uiDepth); 541 541 const UChar cuHeight=UChar(pcCU->getSlice()->getSPS()->getMaxCUHeight()>>uiDepth); 542 const Int log2DiffMaxMinCodingBlockSize = pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize(); 542 543 543 544 #if RExt__DECODER_DEBUG_BIT_STATISTICS … … 545 546 #endif 546 547 548 assert ( pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize() == log2DiffMaxMinCodingBlockSize); 547 549 if ( pcCU->isIntra( uiAbsPartIdx ) ) 548 550 { 549 551 uiSymbol = 1; 550 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth)552 if( uiDepth == log2DiffMaxMinCodingBlockSize ) 551 553 { 552 554 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); … … 570 572 UInt uiMaxNumBits = 2; 571 573 572 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth&& !( cuWidth == 8 && cuHeight == 8 ) )574 if( uiDepth == log2DiffMaxMinCodingBlockSize && !( cuWidth == 8 && cuHeight == 8 ) ) 573 575 { 574 576 uiMaxNumBits ++; … … 585 587 } 586 588 eMode = (PartSize) uiMode; 587 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth)589 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) 588 590 { 589 591 if (eMode == SIZE_2NxN) … … 1233 1235 const UInt uiHeight=rRect.height; 1234 1236 TCoeff* pcCoef=(pcCU->getCoeff(compID)+rTu.getCoefficientOffset(compID)); 1237 const TComSPS &sps=*(pcCU->getSlice()->getSPS()); 1235 1238 1236 1239 DTRACE_CABAC_VL( g_nSymbolCounter++ ) … … 1265 1268 //-------------------------------------------------------------------------------------------------- 1266 1269 1267 if( uiWidth > pcCU->getSlice()->getSPS()->getMaxTrSize() )1270 if( uiWidth > sps.getMaxTrSize() ) 1268 1271 { 1269 1272 std::cerr << "ERROR: parseCoeffNxN was passed a TU with dimensions larger than the maximum allowed size" << std::endl; … … 1283 1286 1284 1287 const ChannelType channelType = toChannelType(compID); 1285 const Bool extendedPrecision = pcCU->getSlice()->getSPS()->getUseExtendedPrecision();1286 1287 const Bool alignCABACBeforeBypass = pcCU->getSlice()->getSPS()->getAlignCABACBeforeBypass();1288 const Int maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(channelType);1288 const Bool extendedPrecision = sps.getUseExtendedPrecision(); 1289 1290 const Bool alignCABACBeforeBypass = sps.getAlignCABACBeforeBypass(); 1291 const Int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(channelType); 1289 1292 1290 1293 #if RExt__DECODER_DEBUG_BIT_STATISTICS … … 1333 1336 if ( isIntra && pcCU->isRDPCMEnabled(uiAbsPartIdx) ) 1334 1337 { 1338 const UInt partsPerMinCU = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize())); 1335 1339 uiIntraMode = pcCU->getIntraDir( toChannelType(compID), uiAbsPartIdx ); 1336 uiIntraMode = (uiIntraMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, rTu.GetChromaFormat() )) : uiIntraMode;1340 uiIntraMode = (uiIntraMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, rTu.GetChromaFormat(), partsPerMinCU)) : uiIntraMode; 1337 1341 uiIntraMode = ((rTu.GetChromaFormat() == CHROMA_422) && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiIntraMode] : uiIntraMode; 1338 1342 … … 1347 1351 //-------------------------------------------------------------------------------------------------- 1348 1352 1349 const Bool bUseGolombRiceParameterAdaptation = pcCU->getSlice()->getSPS()->getUseGolombRiceParameterAdaptation();1353 const Bool bUseGolombRiceParameterAdaptation = sps.getUseGolombRiceParameterAdaptation(); 1350 1354 UInt ¤tGolombRiceStatistic = m_golombRiceAdaptationStatistics[rTu.getGolombRiceStatisticsIndex(compID)]; 1351 1355 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1289 r1290 254 254 } 255 255 256 rpcPic->create( vps, sps, pps, g_uiMaxCUDepth,true, m_layerId);256 rpcPic->create( vps, sps, pps, true, m_layerId); 257 257 #else //SVC_EXTENSION 258 rpcPic->create ( sps, pps, g_uiMaxCUDepth,true);258 rpcPic->create ( sps, pps, true); 259 259 #endif //SVC_EXTENSION 260 260 … … 303 303 } 304 304 305 rpcPic->create( vps, sps, pps, g_uiMaxCUDepth,true, m_layerId);305 rpcPic->create( vps, sps, pps, true, m_layerId); 306 306 #else //SVC_EXTENSION 307 rpcPic->create ( sps, pps, g_uiMaxCUDepth,true);307 rpcPic->create ( sps, pps, true); 308 308 #endif //SVC_EXTENSION 309 309 } … … 493 493 UInt refLayerId = 0; 494 494 495 pBLPic->create( *vps, *sps, *pps, sps->getMaxCUDepth(),true, refLayerId);495 pBLPic->create( *vps, *sps, *pps, true, refLayerId); 496 496 497 497 // it is needed where the VPS is accessed through the slice … … 571 571 #endif //SVC_EXTENSION 572 572 573 // TODO: remove the use of the following globals: 574 g_uiMaxCUDepth = sps->getMaxCUDepth(); 575 #if SVC_EXTENSION 576 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(vps->getChromaFormatIdc(sps, m_apcSlicePilot->getLayerId()), sps->getQuadtreeTULog2MinSize())); 577 #else 578 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(sps->getChromaFormatIdc(), sps->getQuadtreeTULog2MinSize())); 579 #endif 573 // NOTE: globals were set up here originally. You can now use: 574 // g_uiMaxCUDepth = sps->getMaxTotalCUDepth(); 575 // g_uiAddCUDepth = sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize() 580 576 581 577 // Get a new picture buffer. This will also set up m_pcPic, and therefore give us a SPS and PPS pointer that we can use. … … 605 601 // Initialise the various objects for the new set of settings 606 602 #if SVC_EXTENSION 607 m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMax CUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );603 m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) ); 608 604 #else 609 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMax CUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );610 #endif 611 m_cLoopFilter.create( sps->getMax CUDepth() );605 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) ); 606 #endif 607 m_cLoopFilter.create( sps->getMaxTotalCUDepth() ); 612 608 m_cPrediction.initTempBuff(sps->getChromaFormatIdc()); 613 609 … … 666 662 // Recursive structure 667 663 #if SVC_EXTENSION 668 m_cCuDecoder.create ( sps->getMax CUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), pSlice->getChromaFormatIdc() );664 m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), pSlice->getChromaFormatIdc() ); 669 665 m_cCuDecoder.init ( m_ppcTDecTop, &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, m_layerId ); 670 666 #else 671 m_cCuDecoder.create ( sps->getMax CUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() );667 m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() ); 672 668 m_cCuDecoder.init ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction ); 673 669 #endif … … 2198 2194 if( m_layerId > 0 ) 2199 2195 { 2200 g_uiMaxCUDepth = sps->getMaxCUDepth();2201 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() );2202 2203 2196 if (m_cIlpPic[0] == NULL) 2204 2197 { … … 2207 2200 m_cIlpPic[j] = new TComPic; 2208 2201 2209 m_cIlpPic[j]->create(*vps, *sps, *slice->getPPS(), g_uiMaxCUDepth,true, m_layerId);2202 m_cIlpPic[j]->create(*vps, *sps, *slice->getPPS(), true, m_layerId); 2210 2203 2211 2204 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++) … … 2379 2372 Void TDecTop::initAsymLut(TComSlice *pcSlice) 2380 2373 { 2381 if(m_layerId>0) 2382 { 2383 if(!m_pColorMappedPic) 2384 { 2385 Int picWidth = pcSlice->getPicWidthInLumaSamples(); 2386 Int picHeight = pcSlice->getPicHeightInLumaSamples(); 2374 if( m_layerId > 0 ) 2375 { 2376 if( !m_pColorMappedPic ) 2377 { 2387 2378 m_pColorMappedPic = new TComPicYuv; 2388 m_pColorMappedPic->create( p icWidth, picHeight, pcSlice->getChromaFormatIdc()/*CHROMA_420*/, pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getSPS()->getMaxCUHeight(), g_uiMaxCUDepth, true, NULL );2379 m_pColorMappedPic->create( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc()/*CHROMA_420*/, pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getSPS()->getMaxCUHeight(), pcSlice->getSPS()->getMaxTotalCUDepth(), true, NULL ); 2389 2380 } 2390 2381 }
Note: See TracChangeset for help on using the changeset viewer.