Changeset 321 in SHVCSoftware for branches/SHM-3.0-dev/source/Lib/TLibCommon
- Timestamp:
- 2 Aug 2013, 22:52:20 (11 years ago)
- Location:
- branches/SHM-3.0-dev/source/Lib/TLibCommon
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-3.0-dev/source/Lib/TLibCommon/ContextTables.h
r313 r321 92 92 #define NUM_SAO_MERGE_FLAG_CTX 1 ///< number of context models for SAO merge flags 93 93 #define NUM_SAO_TYPE_IDX_CTX 1 ///< number of context models for SAO type index 94 #if INTRA_BL95 #define NUM_INTRA_BL_PRED_CTX 396 #endif97 94 98 95 #define NUM_TRANSFORMSKIP_FLAG_CTX 1 ///< number of context models for transform skipping … … 330 327 }; 331 328 332 #if INTRA_BL333 static const UChar334 INIT_INTRA_BL_PRED_FLAG[3][NUM_INTRA_BL_PRED_CTX] =335 {336 { 185, 185, 201, },337 { 197, 197, 185, },338 { 197, 197, 185, },339 };340 #endif341 329 static const UChar 342 330 INIT_TRANSFORMSKIP_FLAG[3][2*NUM_TRANSFORMSKIP_FLAG_CTX] = -
branches/SHM-3.0-dev/source/Lib/TLibCommon/TComDataCU.cpp
r319 r321 1643 1643 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 1644 1644 1645 #if INTRA_BL1646 iLeftIntraDir = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) && ( !pcTempCU->isIntraBL( uiTempPartIdx ) ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : DC_IDX ) : DC_IDX;1647 #else1648 1645 iLeftIntraDir = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : DC_IDX ) : DC_IDX; 1649 #endif1650 1646 1651 1647 // Get intra direction of above PU 1652 1648 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, true ); 1653 1649 1654 #if INTRA_BL1655 iAboveIntraDir = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) && ( !pcTempCU->isIntraBL( uiTempPartIdx ) ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : DC_IDX ) : DC_IDX;1656 #else1657 1650 iAboveIntraDir = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : DC_IDX ) : DC_IDX; 1658 #endif1659 1651 1660 1652 uiPredNum = 3; … … 1798 1790 UInt log2CbSize = g_aucConvertToBit[getWidth( absPartIdx )] + 2; 1799 1791 PartSize partSize = getPartitionSize( absPartIdx ); 1800 #if INTRA_BL1801 UInt quadtreeTUMaxDepth = isIntra( absPartIdx ) ? m_pcSlice->getSPS()->getQuadtreeTUMaxDepthIntra() : m_pcSlice->getSPS()->getQuadtreeTUMaxDepthInter();1802 #else1803 1792 UInt quadtreeTUMaxDepth = getPredictionMode( absPartIdx ) == MODE_INTRA ? m_pcSlice->getSPS()->getQuadtreeTUMaxDepthIntra() : m_pcSlice->getSPS()->getQuadtreeTUMaxDepthInter(); 1804 #endif1805 1793 Int intraSplitFlag = ( getPredictionMode( absPartIdx ) == MODE_INTRA && partSize == SIZE_NxN ) ? 1 : 0; 1806 1794 Int interSplitFlag = ((quadtreeTUMaxDepth == 1) && (getPredictionMode( absPartIdx ) == MODE_INTER) && (partSize != SIZE_2Nx2N) ); … … 1824 1812 return log2MinTUSizeInCU; 1825 1813 } 1826 1827 #if INTRA_BL1828 UInt TComDataCU::getCtxIntraBLFlag( UInt uiAbsPartIdx )1829 {1830 TComDataCU* pcTempCU;1831 UInt uiTempPartIdx;1832 UInt uiCtx = 0;1833 1834 // Get BCBP of left PU1835 #if DEPENDENT_SLICES1836 Bool bDepSliceRestriction = ( !m_pcSlice->getPPS()->getDependentSliceEnabledFlag());1837 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, bDepSliceRestriction );1838 #else1839 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );1840 #endif1841 uiCtx = ( pcTempCU ) ? pcTempCU->isIntraBL( uiTempPartIdx ) : 0;1842 1843 // Get BCBP of above PU1844 #if DEPENDENT_SLICES1845 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, bDepSliceRestriction );1846 #else1847 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );1848 #endif1849 uiCtx += ( pcTempCU ) ? pcTempCU->isIntraBL( uiTempPartIdx ) : 0;1850 1851 return uiCtx;1852 }1853 #endif1854 1814 1855 1815 #if REF_IDX_ME_ZEROMV … … 2554 2514 TComDataCU* pcCULeft = 0; 2555 2515 pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB ); 2556 #if INTRA_BL 2557 if( pcCULeft && pcCULeft->isIntraBL( uiLeftPartIdx ) ) 2558 { 2559 pcCULeft = NULL; 2560 } 2561 #endif 2516 2562 2517 Bool isAvailableA1 = pcCULeft && 2563 2518 pcCULeft->isDiffMER(xP -1, yP+nPSH-1, xP, yP) && … … 2591 2546 TComDataCU* pcCUAbove = 0; 2592 2547 pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT ); 2593 #if INTRA_BL 2594 if( pcCUAbove && pcCUAbove->isIntraBL( uiAbovePartIdx ) ) 2595 { 2596 pcCUAbove = NULL; 2597 } 2598 #endif 2548 2599 2549 Bool isAvailableB1 = pcCUAbove && 2600 2550 pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP) && … … 2628 2578 TComDataCU* pcCUAboveRight = 0; 2629 2579 pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT ); 2630 #if INTRA_BL 2631 if( pcCUAboveRight && pcCUAboveRight->isIntraBL( uiAboveRightPartIdx ) ) 2632 { 2633 pcCUAboveRight = NULL; 2634 } 2635 #endif 2580 2636 2581 Bool isAvailableB0 = pcCUAboveRight && 2637 2582 pcCUAboveRight->isDiffMER(xP+nPSW, yP-1, xP, yP) && … … 2664 2609 TComDataCU* pcCULeftBottom = 0; 2665 2610 pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB ); 2666 #if INTRA_BL 2667 if( pcCULeftBottom && pcCULeftBottom->isIntraBL( uiLeftBottomPartIdx ) ) 2668 { 2669 pcCULeftBottom = NULL; 2670 } 2671 #endif 2611 2672 2612 Bool isAvailableA0 = pcCULeftBottom && 2673 2613 pcCULeftBottom->isDiffMER(xP-1, yP+nPSH, xP, yP) && … … 2702 2642 TComDataCU* pcCUAboveLeft = 0; 2703 2643 pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr ); 2704 #if INTRA_BL 2705 if( pcCUAboveLeft && pcCUAboveLeft->isIntraBL( uiAboveLeftPartIdx ) ) 2706 { 2707 pcCUAboveLeft = NULL; 2708 } 2709 #endif 2644 2710 2645 Bool isAvailableB2 = pcCUAboveLeft && 2711 2646 pcCUAboveLeft->isDiffMER(xP-1, yP-1, xP, yP) && … … 3010 2945 UInt idx; 3011 2946 tmpCU = getPUBelowLeft(idx, uiPartIdxLB); 3012 #if INTRA_BL3013 bAddedSmvp = (tmpCU != NULL) && (!tmpCU->isIntra(idx));3014 #else3015 2947 bAddedSmvp = (tmpCU != NULL) && (tmpCU->getPredictionMode(idx) != MODE_INTRA); 3016 #endif3017 2948 3018 2949 if (!bAddedSmvp) 3019 2950 { 3020 2951 tmpCU = getPULeft(idx, uiPartIdxLB); 3021 #if INTRA_BL3022 bAddedSmvp = (tmpCU != NULL) && (!tmpCU->isIntra(idx));3023 #else3024 2952 bAddedSmvp = (tmpCU != NULL) && (tmpCU->getPredictionMode(idx) != MODE_INTRA); 3025 #endif3026 2953 } 3027 2954 … … 4019 3946 } 4020 3947 4021 #if INTRA_BL4022 Void TComDataCU::getBaseLumaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride )4023 {4024 TComPicYuv* pcBaseRec = getSlice()->getFullPelBaseRec();4025 UInt uiStrideBase = pcBaseRec->getStride();4026 Pel* piBase = pcBaseRec->getLumaAddr( getAddr(), getZorderIdxInCU() + uiAbsPartIdx );4027 4028 for ( UInt y = 0; y < uiHeight; y ++ )4029 {4030 memcpy( piPred + y * uiStride, piBase + y * uiStrideBase, uiWidth * sizeof( Pel ) );4031 }4032 }4033 4034 Void TComDataCU::getBaseChromaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, UInt uiChromaId )4035 {4036 TComPicYuv* pcBaseRec = getSlice()->getFullPelBaseRec();4037 4038 UInt uiStrideBase = pcBaseRec->getCStride();4039 Pel* piBase;4040 4041 if( uiChromaId == 0 )4042 {4043 piBase = pcBaseRec->getCbAddr( getAddr(), getZorderIdxInCU() + uiAbsPartIdx );4044 }4045 else4046 {4047 piBase = pcBaseRec->getCrAddr( getAddr(), getZorderIdxInCU() + uiAbsPartIdx );4048 }4049 4050 for ( UInt y = 0; y < uiHeight; y ++ )4051 {4052 memcpy( piPred + y * uiStride, piBase + y * uiStrideBase, uiWidth * sizeof( Pel ) );4053 }4054 }4055 4056 #endif4057 4058 3948 #if SVC_COL_BLK 4059 3949 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) -
branches/SHM-3.0-dev/source/Lib/TLibCommon/TComDataCU.h
r319 r321 489 489 // ------------------------------------------------------------------------------------------------------------------- 490 490 491 #if INTRA_BL492 Void getBaseLumaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride );493 Void getBaseChromaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, UInt uiChromaId );494 #endif495 #if INTRA_BL496 Bool isIntraBL ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA_BL; }497 Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA || m_pePredMode[ uiPartIdx ] == MODE_INTRA_BL; }498 #else499 491 Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } 500 #endif501 492 Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) 502 493 Bool isBipredRestriction( UInt puIdx ); … … 525 516 UInt& getTotalBins () { return m_uiTotalBins; } 526 517 527 #if INTRA_BL 528 UInt getCtxIntraBLFlag ( UInt uiAbsPartIdx ); 529 #endif 530 518 #if REF_IDX_FRAMEWORK 531 519 #if FAST_INTRA_SHVC 532 520 Int reduceSetOfIntraModes ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes ); … … 536 524 Bool xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1); 537 525 Bool xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx); 526 #endif 538 527 #endif 539 528 … … 549 538 UInt getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra); 550 539 540 #if REF_IDX_FRAMEWORK 551 541 #if SVC_COL_BLK 552 542 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 553 543 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 554 544 Void scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ); 545 #endif 555 546 #endif 556 547 }; -
branches/SHM-3.0-dev/source/Lib/TLibCommon/TComPrediction.cpp
r319 r321 408 408 } 409 409 410 #if INTRA_BL411 Void TComPrediction::getBaseBlk( TComDataCU* pcCU, TComYuv* pcYuvPred, Int iPartAddr, Int iWidth, Int iHeight )412 {413 pcCU->getBaseLumaBlk( iWidth, iHeight, iPartAddr, pcYuvPred->getLumaAddr( iPartAddr ), pcYuvPred->getStride() );414 pcCU->getBaseChromaBlk( iWidth >> 1, iHeight >> 1, iPartAddr, pcYuvPred->getCbAddr( iPartAddr ), pcYuvPred->getCStride(), 0 );415 pcCU->getBaseChromaBlk( iWidth >> 1, iHeight >> 1, iPartAddr, pcYuvPred->getCrAddr( iPartAddr ), pcYuvPred->getCStride(), 1 );416 }417 #endif418 419 410 Void TComPrediction::motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx ) 420 411 { -
branches/SHM-3.0-dev/source/Lib/TLibCommon/TComPrediction.h
r313 r321 101 101 102 102 Void initTempBuff(); 103 104 #if INTRA_BL 105 Void getBaseBlk ( TComDataCU* pcCU, TComYuv* pcYuvPred, Int iPartAddr, Int iWidth, Int iHeight ); 106 #endif 103 107 104 // inter 108 105 Void motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 ); … … 121 118 Int getPredicBufHeight() { return m_iYuvExtHeight; } 122 119 120 #if REF_IDX_FRAMEWORK 123 121 #if SVC_UPSAMPLING 124 122 #if SCALED_REF_LAYER_OFFSETS … … 128 126 #endif 129 127 #endif 128 #endif 130 129 }; 131 130 -
branches/SHM-3.0-dev/source/Lib/TLibCommon/TypeDef.h
r320 r321 113 113 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG 0 114 114 #endif 115 116 #else117 #define INTRA_BL 1 ///< inter-layer texture prediction118 115 #endif 119 116 … … 458 455 MODE_INTER, ///< inter-prediction mode 459 456 MODE_INTRA, ///< intra-prediction mode 460 #if INTRA_BL461 MODE_INTRA_BL, ///< inter-layer intra-prediction mode462 #endif463 457 MODE_NONE = 15 464 458 };
Note: See TracChangeset for help on using the changeset viewer.