Changeset 1502 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder
- Timestamp:
- 11 Dec 2015, 00:05:48 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibDecoder
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1500 r1502 1225 1225 #endif 1226 1226 1227 #if SCALABLE_REXT1228 const ChromaFormat chFmt = pcSlice->getChromaFormatIdc();1229 #else1230 1227 const ChromaFormat chFmt = sps->getChromaFormatIdc(); 1231 #endif1232 1228 const UInt numValidComp=getNumberValidComponents(chFmt); 1233 1229 const Bool bChroma=(chFmt!=CHROMA_400); … … 1241 1237 pcSlice->setDependentSliceSegmentFlag(false); 1242 1238 } 1243 #if SVC_EXTENSION1244 Int numCTUs = ((pcSlice->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((pcSlice->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight());1245 #else1246 1239 Int numCTUs = ((sps->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((sps->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight()); 1247 #endif1248 1240 UInt sliceSegmentAddress = 0; 1249 1241 Int bitsSliceSegmentAddress = 0; … … 1832 1824 pcSlice->setSliceQp (26 + pps->getPicInitQPMinus26() + iCode); 1833 1825 1834 #if SVC_EXTENSION1835 assert( pcSlice->getSliceQp() >= -pcSlice->getQpBDOffset(CHANNEL_TYPE_LUMA) );1836 #else1837 1826 assert( pcSlice->getSliceQp() >= -sps->getQpBDOffset(CHANNEL_TYPE_LUMA) ); 1838 #endif1839 1827 assert( pcSlice->getSliceQp() <= 51 ); 1840 1828 … … 2365 2353 #endif 2366 2354 2367 #if SVC_EXTENSION2368 Int qpBdOffsetY = pcCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA);2369 #else2370 2355 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA); 2371 #endif2372 2356 const Int qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+ qpBdOffsetY)) - qpBdOffsetY; 2373 2357 … … 2429 2413 { 2430 2414 WPScalingParam *wp; 2431 #if SCALABLE_REXT2432 const ChromaFormat chFmt = pcSlice->getChromaFormatIdc();2433 #else2434 2415 const ChromaFormat chFmt = sps->getChromaFormatIdc(); 2435 #endif2436 2416 const Int numValidComp = Int(getNumberValidComponents(chFmt)); 2437 2417 const Bool bChroma = (chFmt!=CHROMA_400); … … 2496 2476 wp[COMPONENT_Y].iWeight = (iDeltaWeight + (1<<wp[COMPONENT_Y].uiLog2WeightDenom)); 2497 2477 READ_SVLC( wp[COMPONENT_Y].iOffset, iNumRef==0?"luma_offset_l0[i]":"luma_offset_l1[i]" ); 2498 #if SVC_EXTENSION2499 Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;2500 #else2501 2478 Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<sps->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128; 2502 #endif2503 2479 assert( wp[0].iOffset >= -range ); 2504 2480 assert( wp[0].iOffset < range ); … … 2513 2489 if ( wp[COMPONENT_Cb].bPresentFlag ) 2514 2490 { 2515 #if SVC_EXTENSION2516 Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;2517 #else2518 2491 Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<sps->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128; 2519 #endif2520 2492 for ( Int j=1 ; j<numValidComp ; j++ ) 2521 2493 { -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp
r1483 r1502 219 219 UInt uiBPelY = uiTPelY + (maxCuHeight>>uiDepth) - 1; 220 220 221 #if SVC_EXTENSION222 TComSlice * pcSlice = pcPic->getSlice(pcPic->getCurrSliceIdx());223 224 if( ( uiRPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getPicHeightInLumaSamples() ) )225 #else226 221 if( ( uiRPelX < sps.getPicWidthInLumaSamples() ) && ( uiBPelY < sps.getPicHeightInLumaSamples() ) ) 227 #endif228 222 { 229 223 m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 252 246 uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; 253 247 254 #if SVC_EXTENSION255 if ( !isLastCtuOfSliceSegment && ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) )256 #else257 248 if ( !isLastCtuOfSliceSegment && ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) ) 258 #endif259 249 { 260 250 xDecodeCU( pcCU, uiIdx, uiDepth+1, isLastCtuOfSliceSegment ); … … 404 394 UInt uiBPelY = uiTPelY + (sps.getMaxCUHeight()>>uiDepth) - 1; 405 395 406 #if SVC_EXTENSION407 if( ( uiRPelX >= pcSlice->getPicWidthInLumaSamples() ) || ( uiBPelY >= pcSlice->getPicHeightInLumaSamples() ) )408 #else409 396 if( ( uiRPelX >= sps.getPicWidthInLumaSamples() ) || ( uiBPelY >= sps.getPicHeightInLumaSamples() ) ) 410 #endif411 397 { 412 398 bBoundary = true; … … 423 409 uiTPelY = pCtu->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; 424 410 425 #if SVC_EXTENSION426 if( ( uiLPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getPicHeightInLumaSamples() ) )427 #else428 411 if( ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) ) 429 #endif430 412 { 431 413 xDecompressCU(pCtu, uiIdx, uiNextDepth ); … … 501 483 if ( pcCU->getQtRootCbf( 0) ) 502 484 { 503 #if SVC_EXTENSION504 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ), pcCU->getSlice()->getBitDepths() );505 #else506 485 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ), pcCU->getSlice()->getSPS()->getBitDepths() ); 507 #endif508 486 } 509 487 else … … 647 625 #endif 648 626 649 #if SVC_EXTENSION650 const Int clipbd = pcCU->getSlice()->getBitDepth(toChannelType(compID));651 #else652 627 const Int clipbd = sps.getBitDepth(toChannelType(compID)); 653 #endif654 628 #if O0043_BEST_EFFORT_DECODING 655 629 const Int bitDepthDelta = sps.getStreamBitDepth(toChannelType(compID)) - clipbd; … … 834 808 Pel* piPicReco = pcCU->getPic()->getPicYuvRec()->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu()+uiPartIdx); 835 809 const UInt uiPicStride = pcCU->getPic()->getPicYuvRec()->getStride(compID); 836 #if SVC_EXTENSION837 const UInt uiPcmLeftShiftBit = pcCU->getSlice()->getBitDepth(toChannelType(compID)) - pcCU->getSlice()->getSPS()->getPCMBitDepth(toChannelType(compID));838 #else839 810 const TComSPS &sps = *(pcCU->getSlice()->getSPS()); 840 811 const UInt uiPcmLeftShiftBit = sps.getBitDepth(toChannelType(compID)) - sps.getPCMBitDepth(toChannelType(compID)); 841 #endif842 812 843 813 for(UInt uiY = 0; uiY < uiHeight; uiY++ ) -
branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp
r1482 r1502 239 239 printf ("Warning: Got multiple decoded picture hash SEI messages. Using first."); 240 240 } 241 #if SVC_EXTENSION242 calcAndPrintHashStatus(*(pcPic->getPicYuvRec()), hash, pcSlice->getBitDepths(), m_numberOfChecksumErrorsDetected);243 #else244 241 calcAndPrintHashStatus(*(pcPic->getPicYuvRec()), hash, pcSlice->getSPS()->getBitDepths(), m_numberOfChecksumErrorsDetected); 245 #endif246 242 } 247 243 #if CONFORMANCE_BITSTREAM_MODE -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r1442 r1502 951 951 { 952 952 UInt uiSign; 953 #if SVC_EXTENSION954 Int qpBdOffsetY = pcCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA);955 #else956 953 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA); 957 #endif958 954 m_pcTDecBinIf->decodeBinEP(uiSign RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DELTA_QP_EP)); 959 955 iDQp = uiDQp; -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp
r1287 r1502 201 201 aboveMergeAvail = pcPic->getSAOMergeAvailability(ctuRsAddr, ctuRsAddr-frameWidthInCtus); 202 202 } 203 #if SVC_EXTENSION204 pcSbacDecoder->parseSAOBlkParam( saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail, pcSlice->getBitDepths());205 #else206 203 pcSbacDecoder->parseSAOBlkParam( saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail, pcSlice->getSPS()->getBitDepths()); 207 #endif208 204 } 209 205 } -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1499 r1502 524 524 // it is needed where the VPS is accessed through the slice 525 525 pBLPic->getSlice(0)->setVPS( vps ); 526 pBLPic->getPicSym()->inferSpsForNonHEVCBL(); 527 pBLPic->getSlice(0)->setSPS( &pBLPic->getPicSym()->getSPS() ); 526 528 } 527 529 } … … 596 598 assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma()); 597 599 } 600 601 updateSPS->inferSPS( m_layerId, vps ); 598 602 #endif //SVC_EXTENSION 599 603 … … 627 631 628 632 // Initialise the various objects for the new set of settings 629 #if SVC_EXTENSION630 m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_LUMA), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA) );631 #else632 633 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_LUMA), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA) ); 633 #endif634 634 m_cLoopFilter.create( sps->getMaxTotalCUDepth() ); 635 #if SCALABLE_REXT636 m_cPrediction.initTempBuff(pSlice->getChromaFormatIdc());637 #else638 635 m_cPrediction.initTempBuff(sps->getChromaFormatIdc()); 639 #endif640 636 641 637 … … 692 688 693 689 // Recursive structure 694 #if SVC_EXTENSION 695 m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), pSlice->getChromaFormatIdc() ); 690 m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() ); 691 #if SVC_EXTENSION 696 692 m_cCuDecoder.init ( m_ppcTDecTop, &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, m_layerId ); 697 693 #else 698 m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() );699 694 m_cCuDecoder.init ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction ); 700 695 #endif … … 1399 1394 if( pFile->good() ) 1400 1395 { 1401 Bool is16bit = pBLPic->getSlice(0)->get BitDepth(CHANNEL_TYPE_LUMA) > 8 || pBLPic->getSlice(0)->getBitDepth(CHANNEL_TYPE_CHROMA) > 8;1396 Bool is16bit = pBLPic->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) > 8 || pBLPic->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) > 8; 1402 1397 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth(COMPONENT_Y); 1403 1398 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight(COMPONENT_Y); … … 1701 1696 if( pcSlice->getPPS()->getCGSFlag() && m_c3DAsymLUTPPS.isRefLayer( pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc) ) ) 1702 1697 { 1703 assert( pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->get BitDepth(CHANNEL_TYPE_LUMA) == m_c3DAsymLUTPPS.getInputBitDepthY() );1704 assert( pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->get BitDepth(CHANNEL_TYPE_CHROMA) == m_c3DAsymLUTPPS.getInputBitDepthC() );1705 assert( pcSlice->get BitDepth(CHANNEL_TYPE_LUMA) >= m_c3DAsymLUTPPS.getOutputBitDepthY() );1706 assert( pcSlice->get BitDepth(CHANNEL_TYPE_LUMA) >= m_c3DAsymLUTPPS.getOutputBitDepthC() );1698 assert( pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) == m_c3DAsymLUTPPS.getInputBitDepthY() ); 1699 assert( pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) == m_c3DAsymLUTPPS.getInputBitDepthC() ); 1700 assert( pcSlice->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) >= m_c3DAsymLUTPPS.getOutputBitDepthY() ); 1701 assert( pcSlice->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) >= m_c3DAsymLUTPPS.getOutputBitDepthC() ); 1707 1702 1708 1703 if( !m_pColorMappedPic ) … … 1721 1716 if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) ) 1722 1717 { 1723 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->get BitDepth(CHANNEL_TYPE_LUMA), pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0)->getBitDepth(CHANNEL_TYPE_CHROMA));1718 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA), pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA)); 1724 1719 } 1725 1720 } … … 1896 1891 pcSlice->getSPS()->getMaxLog2TrDynamicRange(CHANNEL_TYPE_CHROMA) 1897 1892 }; 1898 #if SVC_EXTENSION1899 m_cTrQuant.setFlatScalingList(maxLog2TrDynamicRange, pcSlice->getBitDepths());1900 #else1901 1893 m_cTrQuant.setFlatScalingList(maxLog2TrDynamicRange, pcSlice->getSPS()->getBitDepths()); 1902 #endif1903 1894 m_cTrQuant.setUseScalingList(false); 1904 1895 } … … 2459 2450 { 2460 2451 m_pColorMappedPic = new TComPicYuv; 2461 m_pColorMappedPic->create( pcSlice->get PicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc()/*CHROMA_420*/, pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getSPS()->getMaxCUHeight(), pcSlice->getSPS()->getMaxTotalCUDepth(), true, NULL );2452 m_pColorMappedPic->create( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getSPS()->getMaxCUHeight(), pcSlice->getSPS()->getMaxTotalCUDepth(), true, NULL ); 2462 2453 } 2463 2454 } … … 2614 2605 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec(); 2615 2606 2616 const Int bitDepthLuma = vps.getBitDepth(CHANNEL_TYPE_LUMA, &sps, m_layerId);2617 const Int bitDepthChroma = vps.getBitDepth(CHANNEL_TYPE_CHROMA, &sps, m_layerId);2618 const Int refBitDepthLuma = (*(pcTDecTopBase->getListPic()->begin()))->getSlice(0)->get BitDepth(CHANNEL_TYPE_LUMA);2619 const Int refBitDepthChroma = (*(pcTDecTopBase->getListPic()->begin()))->getSlice(0)->get BitDepth(CHANNEL_TYPE_CHROMA);2607 const Int bitDepthLuma = sps.getBitDepth(CHANNEL_TYPE_LUMA); 2608 const Int bitDepthChroma = sps.getBitDepth(CHANNEL_TYPE_CHROMA); 2609 const Int refBitDepthLuma = (*(pcTDecTopBase->getListPic()->begin()))->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA); 2610 const Int refBitDepthChroma = (*(pcTDecTopBase->getListPic()->begin()))->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA); 2620 2611 2621 2612 Bool sameBitDepths = ( bitDepthLuma == refBitDepthLuma ) && ( bitDepthChroma == refBitDepthChroma ); 2622 2613 2623 if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == vps.getPicWidthInLumaSamples(&sps, m_layerId) && pcPicYuvRecBase->getHeight(COMPONENT_Y) == vps.getPicHeightInLumaSamples(&sps, m_layerId) && equalOffsets && zeroPhase )2614 if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == sps.getPicWidthInLumaSamples() && pcPicYuvRecBase->getHeight(COMPONENT_Y) == sps.getPicHeightInLumaSamples() && equalOffsets && zeroPhase ) 2624 2615 { 2625 2616 pic->setEqualPictureSizeAndOffsetFlag( i, true );
Note: See TracChangeset for help on using the changeset viewer.