Changeset 345 in SHVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 17 Aug 2013, 06:27:19 (11 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev (added) merged: 315-344 /trunk (added) merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev/source (added) merged: 316-340 /trunk/source (added) merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibCommon/CommonDef.h
r313 r345 57 57 58 58 #if SVC_EXTENSION 59 #define NV_VERSION " trunk" ///< Current software version59 #define NV_VERSION "3.0" ///< Current software version 60 60 #else 61 61 #define NV_VERSION "11.0" ///< Current software version -
trunk/source/Lib/TLibCommon/ContextTables.h
r313 r345 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] = -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r313 r345 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 1660 #if SVC_BL_CAND_INTRA1661 if(m_layerId > 0)1662 {1663 UInt uiCUAddrBase, uiAbsPartAddrBase;1664 pcTempCU = getBaseColCU( uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase );1665 1666 if(pcTempCU->getPredictionMode( uiAbsPartAddrBase ) == MODE_INTRA )1667 {1668 Int iColBaseDir = pcTempCU->getLumaIntraDir( uiAbsPartAddrBase );1669 if( iColBaseDir != iAboveIntraDir && iColBaseDir != iLeftIntraDir && iAboveIntraDir != iLeftIntraDir)1670 {1671 uiIntraDirPred[0] = iColBaseDir;1672 uiIntraDirPred[1] = iLeftIntraDir;1673 uiIntraDirPred[2] = iAboveIntraDir;1674 if( piMode )1675 {1676 *piMode = 2;1677 }1678 uiPredNum = 3;1679 return uiPredNum;1680 }1681 else1682 {1683 iAboveIntraDir = (iColBaseDir == iLeftIntraDir) ? iAboveIntraDir : iLeftIntraDir;1684 iLeftIntraDir = iColBaseDir;1685 }1686 }1687 }1688 #endif1689 1651 1690 1652 uiPredNum = 3; … … 1828 1790 UInt log2CbSize = g_aucConvertToBit[getWidth( absPartIdx )] + 2; 1829 1791 PartSize partSize = getPartitionSize( absPartIdx ); 1830 #if INTRA_BL1831 UInt quadtreeTUMaxDepth = isIntra( absPartIdx ) ? m_pcSlice->getSPS()->getQuadtreeTUMaxDepthIntra() : m_pcSlice->getSPS()->getQuadtreeTUMaxDepthInter();1832 #else1833 1792 UInt quadtreeTUMaxDepth = getPredictionMode( absPartIdx ) == MODE_INTRA ? m_pcSlice->getSPS()->getQuadtreeTUMaxDepthIntra() : m_pcSlice->getSPS()->getQuadtreeTUMaxDepthInter(); 1834 #endif1835 1793 Int intraSplitFlag = ( getPredictionMode( absPartIdx ) == MODE_INTRA && partSize == SIZE_NxN ) ? 1 : 0; 1836 1794 Int interSplitFlag = ((quadtreeTUMaxDepth == 1) && (getPredictionMode( absPartIdx ) == MODE_INTER) && (partSize != SIZE_2Nx2N) ); … … 1854 1812 return log2MinTUSizeInCU; 1855 1813 } 1856 1857 #if INTRA_BL1858 UInt TComDataCU::getCtxIntraBLFlag( UInt uiAbsPartIdx )1859 {1860 #if INTRA_BL_CTX_CHANGE1861 Int cuDepth = getDepth(uiAbsPartIdx);1862 Int maxCuDepth = g_uiMaxCUDepth - g_uiAddCUDepth;1863 UInt uiCtx = (maxCuDepth==3 && cuDepth > 0) ? (cuDepth - 1) : cuDepth;1864 return uiCtx;1865 #else1866 TComDataCU* pcTempCU;1867 UInt uiTempPartIdx;1868 UInt uiCtx = 0;1869 1870 // Get BCBP of left PU1871 #if DEPENDENT_SLICES1872 Bool bDepSliceRestriction = ( !m_pcSlice->getPPS()->getDependentSliceEnabledFlag());1873 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, bDepSliceRestriction );1874 #else1875 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );1876 #endif1877 uiCtx = ( pcTempCU ) ? pcTempCU->isIntraBL( uiTempPartIdx ) : 0;1878 1879 // Get BCBP of above PU1880 #if DEPENDENT_SLICES1881 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, bDepSliceRestriction );1882 #else1883 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );1884 #endif1885 uiCtx += ( pcTempCU ) ? pcTempCU->isIntraBL( uiTempPartIdx ) : 0;1886 1887 return uiCtx;1888 #endif1889 }1890 #endif1891 1814 1892 1815 #if REF_IDX_ME_ZEROMV … … 2586 2509 deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT ); 2587 2510 deriveLeftBottomIdxGeneral ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB ); 2588 #if SVC_MVP2589 // BL collocated2590 TComDataCU *pcColCU = NULL;2591 UInt uiCUAddrBase = 0, uiAbsPartAddrBase = 0;2592 #if AVC_BASE2593 if( !this->getSlice()->getVPS()->getAvcBaseLayerFlag() || AVC_SYNTAX )2594 #endif2595 {2596 TComMvField cMvFieldBaseColCU[2];2597 if(m_layerId)2598 {2599 pcColCU = getBaseColCU( m_layerId - 1, xP + nPSW/2, yP + nPSH/2, uiCUAddrBase, uiAbsPartAddrBase );2600 2601 #if INTRA_BL2602 if( pcColCU && pcColCU->isIntraBL( uiAbsPartAddrBase ) )2603 {2604 pcColCU = NULL;2605 }2606 #endif2607 2608 if(pcColCU && !pcColCU->isIntra( uiAbsPartAddrBase ) )2609 {2610 abCandIsInter[iCount] = true;2611 2612 // get interDir2613 puhInterDirNeighbours[iCount] = pcColCU->getInterDir( uiAbsPartAddrBase );2614 2615 pcMvFieldNeighbours[(iCount << 1)].setMvField( TComMv(0,0), -1);2616 pcMvFieldNeighbours[(iCount << 1) + 1].setMvField( TComMv(0,0), -1);2617 2618 if( puhInterDirNeighbours[iCount] & 1 )2619 {2620 pcColCU->getMvField( pcColCU, uiAbsPartAddrBase, REF_PIC_LIST_0, cMvFieldBaseColCU[0]);2621 scaleBaseMV( m_layerId - 1, pcMvFieldNeighbours[iCount<<1], cMvFieldBaseColCU[0] );2622 }2623 2624 if ( getSlice()->isInterB() && puhInterDirNeighbours[iCount] & 2 )2625 {2626 pcColCU->getMvField( pcColCU, uiAbsPartAddrBase, REF_PIC_LIST_1, cMvFieldBaseColCU[1] );2627 scaleBaseMV( m_layerId - 1, pcMvFieldNeighbours[(iCount<<1)+1], cMvFieldBaseColCU[1] );2628 }2629 2630 if( puhInterDirNeighbours[iCount] > 0 )2631 {2632 if ( mrgCandIdx == iCount )2633 {2634 return;2635 }2636 iCount ++;2637 }2638 }2639 }2640 }2641 #endif2642 2511 2643 2512 //left … … 2645 2514 TComDataCU* pcCULeft = 0; 2646 2515 pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB ); 2647 #if INTRA_BL 2648 if( pcCULeft && pcCULeft->isIntraBL( uiLeftPartIdx ) ) 2649 { 2650 pcCULeft = NULL; 2651 } 2652 #endif 2516 2653 2517 Bool isAvailableA1 = pcCULeft && 2654 2518 pcCULeft->isDiffMER(xP -1, yP+nPSH-1, xP, yP) && 2655 #if SVC_MVP2656 ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0])) &&2657 #endif2658 2519 !( uiPUIdx == 1 && (cCurPS == SIZE_Nx2N || cCurPS == SIZE_nLx2N || cCurPS == SIZE_nRx2N) ) && 2659 2520 !pcCULeft->isIntra( uiLeftPartIdx ) ; … … 2685 2546 TComDataCU* pcCUAbove = 0; 2686 2547 pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT ); 2687 #if INTRA_BL 2688 if( pcCUAbove && pcCUAbove->isIntraBL( uiAbovePartIdx ) ) 2689 { 2690 pcCUAbove = NULL; 2691 } 2692 #endif 2548 2693 2549 Bool isAvailableB1 = pcCUAbove && 2694 #if SVC_MVP2695 ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0] )) &&2696 #endif2697 2550 pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP) && 2698 2551 !( uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD) ) && … … 2725 2578 TComDataCU* pcCUAboveRight = 0; 2726 2579 pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT ); 2727 #if INTRA_BL 2728 if( pcCUAboveRight && pcCUAboveRight->isIntraBL( uiAboveRightPartIdx ) ) 2729 { 2730 pcCUAboveRight = NULL; 2731 } 2732 #endif 2580 2733 2581 Bool isAvailableB0 = pcCUAboveRight && 2734 #if SVC_MVP && !IL_MRG_SIMPLIFIED_PRUNING2735 ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCUAboveRight->hasEqualMotion( uiAboveRightPartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0] )) &&2736 #endif2737 2582 pcCUAboveRight->isDiffMER(xP+nPSW, yP-1, xP, yP) && 2738 2583 !pcCUAboveRight->isIntra( uiAboveRightPartIdx ); … … 2761 2606 2762 2607 //left bottom 2763 #if SVC_MVP2764 if( iCount < 4 )2765 {2766 #endif2767 2608 UInt uiLeftBottomPartIdx = 0; 2768 2609 TComDataCU* pcCULeftBottom = 0; 2769 2610 pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB ); 2770 #if INTRA_BL 2771 if( pcCULeftBottom && pcCULeftBottom->isIntraBL( uiLeftBottomPartIdx ) ) 2772 { 2773 pcCULeftBottom = NULL; 2774 } 2775 #endif 2611 2776 2612 Bool isAvailableA0 = pcCULeftBottom && 2777 2613 pcCULeftBottom->isDiffMER(xP-1, yP+nPSH, xP, yP) && 2778 #if SVC_MVP && !IL_MRG_SIMPLIFIED_PRUNING2779 ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCULeftBottom->hasEqualMotion( uiLeftBottomPartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0])) &&2780 #endif2781 2614 !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) ; 2782 2615 if ( isAvailableA0 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) … … 2802 2635 return; 2803 2636 } 2804 #if SVC_MVP2805 }2806 #endif2807 2637 2808 2638 // above left … … 2812 2642 TComDataCU* pcCUAboveLeft = 0; 2813 2643 pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr ); 2814 #if INTRA_BL 2815 if( pcCUAboveLeft && pcCUAboveLeft->isIntraBL( uiAboveLeftPartIdx ) ) 2816 { 2817 pcCUAboveLeft = NULL; 2818 } 2819 #endif 2644 2820 2645 Bool isAvailableB2 = pcCUAboveLeft && 2821 2646 pcCUAboveLeft->isDiffMER(xP-1, yP-1, xP, yP) && 2822 #if SVC_MVP && !IL_MRG_SIMPLIFIED_PRUNING2823 ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCUAboveLeft->hasEqualMotion( uiAboveLeftPartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0] )) &&2824 #endif2825 2647 !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx ); 2826 2648 if ( isAvailableB2 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) … … 3123 2945 UInt idx; 3124 2946 tmpCU = getPUBelowLeft(idx, uiPartIdxLB); 3125 #if INTRA_BL3126 bAddedSmvp = (tmpCU != NULL) && (!tmpCU->isIntra(idx));3127 #else3128 2947 bAddedSmvp = (tmpCU != NULL) && (tmpCU->getPredictionMode(idx) != MODE_INTRA); 3129 #endif3130 2948 3131 2949 if (!bAddedSmvp) 3132 2950 { 3133 2951 tmpCU = getPULeft(idx, uiPartIdxLB); 3134 #if INTRA_BL3135 bAddedSmvp = (tmpCU != NULL) && (!tmpCU->isIntra(idx));3136 #else3137 2952 bAddedSmvp = (tmpCU != NULL) && (tmpCU->getPredictionMode(idx) != MODE_INTRA); 3138 #endif3139 2953 } 3140 2954 … … 3562 3376 3563 3377 // use coldir. 3564 #if M0457_COL_PICTURE_SIGNALING 3378 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING 3565 3379 TComPic *pColPic; 3566 3380 if (m_layerId > 0 && getSlice()->getAltColIndicationFlag()) … … 3699 3513 if (scaleFactor > 0) 3700 3514 { 3701 #if SVC_MVP3702 m_acCUMvField[0].compress(m_pePredMode, m_puhInterDir, scaleFactor);3703 m_acCUMvField[1].compress(m_pePredMode, m_puhInterDir, scaleFactor);3704 #else3705 3515 m_acCUMvField[0].compress(m_pePredMode, scaleFactor); 3706 3516 m_acCUMvField[1].compress(m_pePredMode, scaleFactor); 3707 #endif3708 3517 } 3709 3518 } … … 4137 3946 } 4138 3947 4139 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED4140 Void TComDataCU::getBaseLumaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride )4141 {4142 TComPicYuv* pcBaseRec = getSlice()->getFullPelBaseRec();4143 UInt uiStrideBase = pcBaseRec->getStride();4144 Pel* piBase = pcBaseRec->getLumaAddr( getAddr(), getZorderIdxInCU() + uiAbsPartIdx );4145 4146 for ( UInt y = 0; y < uiHeight; y ++ )4147 {4148 memcpy( piPred + y * uiStride, piBase + y * uiStrideBase, uiWidth * sizeof( Pel ) );4149 }4150 }4151 4152 Void TComDataCU::getBaseChromaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, UInt uiChromaId )4153 {4154 TComPicYuv* pcBaseRec = getSlice()->getFullPelBaseRec();4155 4156 UInt uiStrideBase = pcBaseRec->getCStride();4157 Pel* piBase;4158 4159 if( uiChromaId == 0 )4160 {4161 piBase = pcBaseRec->getCbAddr( getAddr(), getZorderIdxInCU() + uiAbsPartIdx );4162 }4163 else4164 {4165 piBase = pcBaseRec->getCrAddr( getAddr(), getZorderIdxInCU() + uiAbsPartIdx );4166 }4167 4168 for ( UInt y = 0; y < uiHeight; y ++ )4169 {4170 memcpy( piPred + y * uiStride, piBase + y * uiStrideBase, uiWidth * sizeof( Pel ) );4171 }4172 }4173 4174 #endif4175 4176 3948 #if SVC_COL_BLK 4177 3949 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) … … 4273 4045 #endif 4274 4046 4047 #if N0139_POSITION_ROUNDING_OFFSET 4048 iBX += 4; 4049 iBY += 4; 4050 #endif 4051 4275 4052 #if SCALED_REF_LAYER_OFFSETS 4276 4053 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight() || … … 4334 4111 } 4335 4112 #endif 4336 4337 #if SVC_MVP4338 Bool TComDataCU::hasEqualMotion( UInt uiAbsPartIdx, UChar uchInterDir, TComMvField* pcMvField )4339 {4340 if ( getInterDir( uiAbsPartIdx ) != uchInterDir )4341 {4342 return false;4343 }4344 4345 for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )4346 {4347 if ( getInterDir( uiAbsPartIdx ) & ( 1 << uiRefListIdx ) )4348 {4349 if ( getCUMvField( RefPicList( uiRefListIdx ) )->getMv( uiAbsPartIdx ) != pcMvField[uiRefListIdx].getMv() ||4350 getCUMvField( RefPicList( uiRefListIdx ) )->getRefIdx( uiAbsPartIdx ) != pcMvField[uiRefListIdx].getRefIdx() )4351 {4352 return false;4353 }4354 }4355 }4356 4357 return true;4358 }4359 #endif4360 4361 4113 //! \} -
trunk/source/Lib/TLibCommon/TComDataCU.h
r313 r345 485 485 Void deriveLeftBottomIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB ); 486 486 487 #if SVC_MVP488 Bool hasEqualMotion ( UInt uiAbsPartIdx, UChar uchInterDir, TComMvField* pcMvField );489 #endif490 491 487 // ------------------------------------------------------------------------------------------------------------------- 492 488 // member functions for modes 493 489 // ------------------------------------------------------------------------------------------------------------------- 494 490 495 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED496 Void getBaseLumaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride );497 Void getBaseChromaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, UInt uiChromaId );498 #endif499 #if INTRA_BL500 Bool isIntraBL ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA_BL; }501 Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA || m_pePredMode[ uiPartIdx ] == MODE_INTRA_BL; }502 #else503 491 Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } 504 #endif505 492 Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) 506 493 Bool isBipredRestriction( UInt puIdx ); … … 529 516 UInt& getTotalBins () { return m_uiTotalBins; } 530 517 531 #if INTRA_BL 532 UInt getCtxIntraBLFlag ( UInt uiAbsPartIdx ); 533 #endif 534 518 #if REF_IDX_FRAMEWORK 535 519 #if FAST_INTRA_SHVC 536 520 Int reduceSetOfIntraModes ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes ); … … 540 524 Bool xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1); 541 525 Bool xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx); 526 #endif 542 527 #endif 543 528 … … 553 538 UInt getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra); 554 539 540 #if REF_IDX_FRAMEWORK 555 541 #if SVC_COL_BLK 556 542 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 557 543 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 558 544 Void scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ); 545 #endif 559 546 #endif 560 547 }; -
trunk/source/Lib/TLibCommon/TComMotionInfo.cpp
r313 r345 328 328 * \param scale Factor by which to subsample motion information 329 329 */ 330 #if SVC_MVP331 Void TComCUMvField::compress(Char* pePredMode, UChar* peInterDir, Int scale)332 #else333 330 Void TComCUMvField::compress(Char* pePredMode, Int scale) 334 #endif335 331 { 336 332 Int N = scale * scale; … … 351 347 pePredMode[ uiPartIdx + i ] = predMode; 352 348 m_piRefIdx[ uiPartIdx + i ] = iRefIdx; 353 #if SVC_MVP354 peInterDir[ uiPartIdx + i ] = peInterDir[ uiPartIdx ];355 #endif356 349 } 357 350 } -
trunk/source/Lib/TLibCommon/TComMotionInfo.h
r313 r345 158 158 } 159 159 160 #if SVC_MVP161 Void compress(Char* pePredMode, UChar* peInterDir, Int scale);162 #else163 160 Void compress(Char* pePredMode, Int scale); 164 #endif165 161 166 162 #if REF_IDX_MFM -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r313 r345 408 408 } 409 409 410 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED411 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 { -
trunk/source/Lib/TLibCommon/TComPrediction.h
r313 r345 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 -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r313 r345 124 124 m_numILRRefIdx = 0; 125 125 #endif 126 #if M0457_COL_PICTURE_SIGNALING 126 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING 127 127 m_altColIndicationFlag = false; 128 128 m_colRefLayerIdx = 0; … … 385 385 386 386 #if REF_IDX_FRAMEWORK 387 #if ZERO_NUM_DIRECT_LAYERS388 387 if( m_layerId == 0 || ( m_layerId > 0 && ( m_activeNumILRRefIdx == 0 || !((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) ) ) ) 389 #else390 if ((getLayerId() == 0) ||391 ((getSPS()->getLayerId()) && !((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&392 (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) )393 )394 #endif395 388 { 396 389 #endif … … 458 451 #if ILR_RESTR 459 452 Int maxSubLayerForILPPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()) : 0; 460 #if ZERO_NUM_DIRECT_LAYERS461 453 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<= maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) ) 462 #else463 if( m_layerId > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) )464 #endif465 454 #else //#if ILR_RESTR 466 #if ZERO_NUM_DIRECT_LAYERS467 455 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 ) 468 #else469 if( m_layerId > 0 )470 #endif471 456 #endif //#if ILR_RESTR 472 457 { … … 599 584 rpsCurrList0[cIdx] = RefPicSetStCurr0[i]; 600 585 } 601 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 602 { 603 rpsCurrList0[cIdx] = RefPicSetStCurr1[i]; 604 } 605 for ( i=0; i<NumPocLtCurr; i++, cIdx++) 606 { 607 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 608 } 609 586 #if RPL_INIT_N0316_N0082 610 587 #if REF_IDX_FRAMEWORK 611 588 if( m_layerId > 0 ) … … 619 596 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 620 597 #if ILR_RESTR 598 Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 599 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 600 #endif 601 rpsCurrList0[cIdx] = ilpPic[refLayerIdc]; 602 } 603 } 604 #endif 605 #endif 606 for ( i=0; i<NumPocStCurr1; i++, cIdx++) 607 { 608 rpsCurrList0[cIdx] = RefPicSetStCurr1[i]; 609 } 610 for ( i=0; i<NumPocLtCurr; i++, cIdx++) 611 { 612 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 613 } 614 #if !RPL_INIT_N0316_N0082 615 #if REF_IDX_FRAMEWORK 616 if( m_layerId > 0 ) 617 { 618 #if JCTVC_M0458_INTERLAYER_RPS_SIG 619 for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++) 620 #else 621 for( i = 0; i < m_numILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++) 622 #endif 623 { 624 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 625 #if ILR_RESTR 621 626 Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 622 627 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) … … 625 630 } 626 631 } 632 #endif 627 633 #endif 628 634 assert(cIdx == numPocTotalCurr); … … 707 713 TComRefPicListModification* refPicListModification = &m_RefPicListModification; 708 714 Int numberOfRpsCurrTempList = this->getNumRpsCurrTempList(); // total number of ref pics in listTemp0 including inter-layer ref pics 715 #if RPL_INIT_N0316_N0082 716 Int numberOfPocBeforeCurr = this->getNumNegativeRpsCurrTempList(); // number of negative temporal ref pics 717 #endif 709 718 710 719 assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 1); … … 712 721 713 722 //set L0 inter-layer reference picture modification 723 #if RPL_INIT_N0316_N0082 724 Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true; 725 #else 714 726 Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == numberOfRpsCurrTempList) ? false : true; 727 #endif 728 #if FINAL_RPL_CHANGE_N0082 729 hasModification = false; //modification is not necessary 730 #endif 715 731 refPicListModification->setRefPicListModificationFlagL0(hasModification); 716 732 if(hasModification) … … 736 752 #endif 737 753 { 754 #if RPL_INIT_N0316_N0082 755 if((numberOfPocBeforeCurr) >= m_aiNumRefIdx[REF_PIC_LIST_0]) 756 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr); 757 else 758 { 759 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr); 760 for (Int j = numberOfPocBeforeCurr; j < (m_aiNumRefIdx[REF_PIC_LIST_0] - i); j++) 761 refPicListModification->setRefPicSetIdxL0(j, j + m_activeNumILRRefIdx); 762 } 763 #else 738 764 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfRpsCurrTempList - i); 765 #endif 739 766 } 740 767 } … … 773 800 } 774 801 #endif 775 802 #if RPL_INIT_N0316_N0082 803 Int TComSlice::getNumNegativeRpsCurrTempList() 804 { 805 if( m_eSliceType == I_SLICE ) 806 { 807 return 0; 808 } 809 810 Int numPocBeforeCurr = 0; 811 for( UInt i = 0; i < m_pcRPS->getNumberOfNegativePictures(); i++ ) 812 { 813 if(m_pcRPS->getUsed(i)) 814 { 815 numPocBeforeCurr++; 816 } 817 } 818 819 return numPocBeforeCurr; 820 } 821 #endif 776 822 Int TComSlice::getNumRpsCurrTempList() 777 823 { … … 1616 1662 #endif 1617 1663 #if JCTVC_M0203_INTERLAYER_PRED_IDC 1664 #if N0120_MAX_TID_REF_PRESENT_FLAG 1665 m_maxTidIlRefPicsPlus1PresentFlag = true; 1666 #endif 1618 1667 for( Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++) 1619 1668 { -
trunk/source/Lib/TLibCommon/TComSlice.h
r313 r345 456 456 UInt m_layerIdInVps[MAX_VPS_LAYER_ID_PLUS1]; // Maps layer_id_in_nuh with the layer ID in the VPS 457 457 #endif 458 #if ILP_SSH_SIG 459 Bool m_ilpSshSignalingEnabledFlag; 460 #endif 458 461 #if VPS_EXTN_PROFILE_INFO 459 462 // Profile-tier-level signalling related … … 491 494 UInt m_maxSublayerForIlpPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1]; 492 495 #endif 496 #if N0120_MAX_TID_REF_PRESENT_FLAG 497 Bool m_maxTidIlRefPicsPlus1PresentFlag; 498 #endif 493 499 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 494 500 Bool m_singleLayerForNonIrapFlag; … … 588 594 UInt getLayerIdInVps(Int id) { return m_layerIdInVps[id]; } 589 595 Void setLayerIdInVps(Int id, UInt x) { m_layerIdInVps[id] = x; } 596 #endif 597 #if ILP_SSH_SIG 598 Bool getIlpSshSignalingEnabledFlag() { return m_ilpSshSignalingEnabledFlag;} 599 Void setIlpSshSignalingEnabledFlag(Bool x) { m_ilpSshSignalingEnabledFlag = x;} 590 600 #endif 591 601 #if VPS_EXTN_PROFILE_INFO … … 653 663 Void setMaxSublayerForIlpPlus1(Int layerId, UInt maxSublayer) { m_maxSublayerForIlpPlus1[layerId] = maxSublayer; } 654 664 #endif 665 #if N0120_MAX_TID_REF_PRESENT_FLAG 666 Bool getMaxTidIlRefPicsPlus1PresentFlag() { return m_maxTidIlRefPicsPlus1PresentFlag ;} 667 Void setMaxTidIlRefPicsPlus1PresentFlag(Bool x) { m_maxTidIlRefPicsPlus1PresentFlag = x;} 668 #endif 655 669 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 656 670 Bool getSingleLayerForNonIrapFlag() { return m_singleLayerForNonIrapFlag; } … … 1560 1574 Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } 1561 1575 Int getNumRpsCurrTempList(); 1576 #if RPL_INIT_N0316_N0082 1577 Int getNumNegativeRpsCurrTempList(); 1578 #endif 1562 1579 Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } 1563 1580 Void setReferenced(Bool b) { m_bRefenced = b; } … … 1778 1795 Void setMFMEnabledFlag(Bool flag) { m_bMFMEnabledFlag = flag; } 1779 1796 Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; } 1797 #if !REMOVE_COL_PICTURE_SIGNALING 1780 1798 Void setColRefLayerIdx(Int i) { m_colRefLayerIdx = i; } 1781 1799 Int getColRefLayerIdx() { return m_colRefLayerIdx; } … … 1784 1802 Void setMotionPredIlp(TComPic *ilpPic) { m_pcIlpPic = ilpPic; } 1785 1803 TComPic* getMotionPredIlp() { return m_pcIlpPic; } 1804 #endif 1786 1805 #endif 1787 1806 #endif -
trunk/source/Lib/TLibCommon/TComTrQuant.cpp
r313 r345 1235 1235 uiMode = pcCU->getLumaIntraDir( uiAbsPartIdx ); 1236 1236 } 1237 #if INTRA_BL_DST4x41238 else if(eTType == TEXT_LUMA && pcCU->isIntraBL(uiAbsPartIdx) )1239 {1240 uiMode = DC_IDX; //Using DST1241 }1242 #endif1243 1237 else 1244 1238 { … … 1314 1308 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)eTxt]; 1315 1309 assert(scalingListType < 6); 1316 #if NO_RESIDUAL_FLAG_FOR_BLPRED1317 if(pcCU->isIntraBL(uiAbsPartIdx) && eTxt == TEXT_LUMA)1318 {1319 invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eTxt, DC_IDX, pResi, uiStride, rpcCoeff, uiWidth, uiHeight, scalingListType, pcCU->getTransformSkip(uiAbsPartIdx, eTxt) );1320 }1321 else1322 {1323 invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eTxt, REG_DCT, pResi, uiStride, rpcCoeff, uiWidth, uiHeight, scalingListType, pcCU->getTransformSkip(uiAbsPartIdx, eTxt) );1324 }1325 #else1326 1310 invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eTxt, REG_DCT, pResi, uiStride, rpcCoeff, uiWidth, uiHeight, scalingListType, pcCU->getTransformSkip(uiAbsPartIdx, eTxt) ); 1327 #endif1328 1311 } 1329 1312 else … … 1809 1792 Int ui16CtxCbf = 0; 1810 1793 Int iBestLastIdxP1 = 0; 1811 #if NO_RESIDUAL_FLAG_FOR_BLPRED1812 if( (!pcCU->isIntra( uiAbsPartIdx ) || pcCU->isIntraBL( uiAbsPartIdx )) && eTType == TEXT_LUMA && pcCU->getTransformIdx( uiAbsPartIdx ) == 0 )1813 #else1814 1794 if( !pcCU->isIntra( uiAbsPartIdx ) && eTType == TEXT_LUMA && pcCU->getTransformIdx( uiAbsPartIdx ) == 0 ) 1815 #endif1816 1795 { 1817 1796 ui16CtxCbf = 0; -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r313 r345 9 9 { 10 10 { 0, 0, 0, 64, 0, 0, 0, 0}, // 11 #if ARBITRARY_SPATIAL_RATIO 12 { 0, 1, -3, 63, 4, -2, 1, 0}, 13 { -1, 2, -5, 62, 8, -3, 1, 0}, 14 { -1, 3, -8, 60, 13, -4, 1, 0}, 15 { -1, 4,-10, 58, 17, -5, 1, 0}, 16 #else 11 17 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 12 18 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 13 19 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 14 20 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 15 { -1, 4, -11, 52, 26, -8, 3, -1}, // <-> actual phase shift 1/3, used for spatial scalability x1.5 21 #endif 22 { -1, 4, -11, 52, 26, -8, 3, -1}, // <-> actual phase shift 1/3, used for spatial scalability x1.5 23 #if ARBITRARY_SPATIAL_RATIO 24 { -1, 3, -9, 47, 31, -10, 4, -1}, 25 { -1, 4, -11, 45, 34, -10, 4, -1}, 26 #else 16 27 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 17 28 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 18 { -1, 4, -11, 40, 40, -11, 4, -1}, // <-> actual phase shift 1/2, equal to HEVC MC, used for spatial scalability x2 29 #endif 30 { -1, 4, -11, 40, 40, -11, 4, -1}, // <-> actual phase shift 1/2, equal to HEVC MC, used for spatial scalability x2 31 #if ARBITRARY_SPATIAL_RATIO 32 { -1, 4, -10, 34, 45, -11, 4, -1}, 33 { -1, 4, -10, 31, 47, -9, 3, -1}, 34 #else 19 35 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 20 36 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 37 #endif 21 38 { -1, 3, -8, 26, 52, -11, 4, -1}, // <-> actual phase shift 2/3, used for spatial scalability x1.5 39 #if ARBITRARY_SPATIAL_RATIO 40 { 0, 1, -5, 17, 58, -10, 4, -1}, 41 { 0, 1, -4, 13, 60, -8, 3, -1}, 42 { 0, 1, -3, 8, 62, -5, 2, -1}, 43 { 0, 1, -2, 4, 63, -3, 1, 0} 44 #else 22 45 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 23 46 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 24 47 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 25 48 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU} // 49 #endif 26 50 }; 27 51 28 52 const Int TComUpsampleFilter::m_chromaFixedFilter[16][NTAPS_US_CHROMA] = 29 53 { 30 #if CHROMA_UPSAMPLING31 54 { 0, 64, 0, 0},// 55 #if ARBITRARY_SPATIAL_RATIO 56 { -2, 62, 4, 0}, 57 { -2, 58, 10, -2}, 58 { -4, 56, 14, -2}, 59 #else 32 60 {CNU,CNU,CNU,CNU},// 33 61 {CNU,CNU,CNU,CNU},// 34 62 {CNU,CNU,CNU,CNU},// 63 #endif 35 64 { -4, 54, 16, -2},// <-> actual phase shift 1/4,equal to HEVC MC, used for spatial scalability x1.5 (only for accurate Chroma alignement) 36 65 { -6, 52, 20, -2},// <-> actual phase shift 1/3, used for spatial scalability x1.5 37 66 { -6, 46, 28, -4},// <-> actual phase shift 3/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 67 #if ARBITRARY_SPATIAL_RATIO 68 { -4, 42, 30, -4}, 69 #else 38 70 {CNU,CNU,CNU,CNU},// 71 #endif 39 72 { -4, 36, 36, -4},// <-> actual phase shift 1/2,equal to HEVC MC, used for spatial scalability x2 40 73 { -4, 30, 42, -4},// <-> actual phase shift 7/12, used for spatial scalability x1.5 (only for accurate Chroma alignement) 74 #if ARBITRARY_SPATIAL_RATIO 75 { -4, 28, 46, -6}, 76 #else 41 77 {CNU,CNU,CNU,CNU},// 78 #endif 42 79 { -2, 20, 52, -6},// <-> actual phase shift 2/3, used for spatial scalability x1.5 80 #if ARBITRARY_SPATIAL_RATIO 81 {-2, 16, 54, -4}, 82 {-2, 14, 56, -4}, 83 #else 43 84 {CNU,CNU,CNU,CNU},// 44 85 {CNU,CNU,CNU,CNU},// 86 #endif 45 87 { -2, 10, 58, -2},// <-> actual phase shift 7/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 46 88 { 0, 4, 62, -2} // <-> actual phase shift 11/12, used for spatial scalability x1.5 (only for accurate Chroma alignement) 47 #else48 { 0, 64, 0, 0},//49 {CNU,CNU,CNU,CNU},//50 {CNU,CNU,CNU,CNU},//51 {CNU,CNU,CNU,CNU},//52 { -4, 54, 16, -2},// <-> actual phase shift 1/4,equal to HEVC MC, used for spatial scalability x1.5 (only for accurate Chroma alignement)53 { -5, 50, 22, -3},// <-> actual phase shift 1/3, used for spatial scalability x1.554 { -6, 46, 28, -4},// <-> actual phase shift 3/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement)55 {CNU,CNU,CNU,CNU},//56 { -4, 36, 36, -4},// <-> actual phase shift 1/2,equal to HEVC MC, used for spatial scalability x257 { -4, 30, 43, -5},// <-> actual phase shift 7/12, used for spatial scalability x1.5 (only for accurate Chroma alignement)58 {CNU,CNU,CNU,CNU},//59 { -3, 22, 50, -5},// <-> actual phase shift 2/3, used for spatial scalability x1.560 {CNU,CNU,CNU,CNU},//61 {CNU,CNU,CNU,CNU},//62 { -2, 10, 58, -2},// <-> actual phase shift 7/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement)63 { -1, 5, 62, -2} // <-> actual phase shift 11/12, used for spatial scalability x1.5 (only for accurate Chroma alignement)64 #endif65 89 }; 66 90 … … 183 207 } 184 208 209 #if ARBITRARY_SPATIAL_RATIO 210 assert ( widthEL >= widthBL ); 211 assert ( heightEL >= heightBL ); 212 #else 185 213 assert ( widthEL == widthBL || widthEL == 2*widthBL || 2*widthEL == 3*widthBL ); 186 214 assert ( heightEL == heightBL || heightEL == 2*heightBL || 2*heightEL == 3*heightBL ); 215 #endif 187 216 188 217 pcBasePic->setBorderExtension(false); … … 195 224 Int phaseY = 0; 196 225 226 #if ROUNDING_OFFSET 227 Int addX = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 228 Int addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 229 #else 197 230 Int addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 198 231 Int addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 232 #endif 199 233 200 234 Int deltaX = 4 * phaseX; … … 216 250 Int topStartL = scalEL.getWindowTopOffset(); 217 251 Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset(); 252 #if BUGFIX_RESAMPLE 253 Int leftOffset = leftStartL > 0 ? leftStartL : 0; 254 #endif 255 #endif 256 257 #if N0214_INTERMEDIATE_BUFFER_16BITS 258 Int shift1 = g_bitDepthY - 8; 218 259 #endif 219 260 … … 236 277 for( j = 0; j < heightBL ; j++ ) 237 278 { 279 #if N0214_INTERMEDIATE_BUFFER_16BITS 280 *piDstY = sumLumaHor(piSrcY, coeff) >> shift1; 281 #else 238 282 *piDstY = sumLumaHor(piSrcY, coeff); 283 #endif 239 284 piSrcY += strideBL; 240 285 piDstY += strideEL; … … 248 293 pcTempPic->setHeight(heightEL); 249 294 295 #if N0214_INTERMEDIATE_BUFFER_16BITS 296 Int nShift = US_FILTER_PREC*2 - shift1; 297 #else 250 298 const Int nShift = US_FILTER_PREC*2; 299 #endif 251 300 Int iOffset = 1 << (nShift - 1); 252 301 … … 269 318 piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL; 270 319 #if SCALED_REF_LAYER_OFFSETS 320 #if BUGFIX_RESAMPLE 321 Pel* piDstY0 = piDstBufY + j * strideEL; 322 piDstY = piDstY0 + leftOffset; 323 piSrcY += leftOffset; 324 325 for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- ) 326 { 327 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 328 piSrcY++; 329 piDstY++; 330 } 331 332 for( i = rightEndL; i < pcTempPic->getWidth(); i++ ) 333 { 334 *piDstY = piDstY0[rightEndL-1]; 335 piDstY++; 336 } 337 338 piDstY = piDstY0; 339 for( i = 0; i < leftStartL; i++ ) 340 { 341 *piDstY = piDstY0[leftStartL]; 342 piDstY++; 343 } 344 #else 271 345 #if 1 // it should provide identical result 272 346 Pel* piDstY0 = piDstBufY + j * strideEL; … … 308 382 } 309 383 #endif 384 #endif 310 385 #else 311 386 piDstY = piDstBufY + j * strideEL; … … 351 426 Int topStartC = scalEL.getWindowTopOffset() >> 1; 352 427 Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1); 428 #if BUGFIX_RESAMPLE 429 leftOffset = leftStartC > 0 ? leftStartC : 0; 430 #endif 353 431 #endif 354 432 … … 359 437 phaseY = 1; 360 438 439 #if ROUNDING_OFFSET 440 addX = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 441 addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 442 #else 361 443 addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 362 444 addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 445 #endif 363 446 364 447 deltaX = 4 * phaseX; … … 379 462 widthBL = pcBasePic->getWidth () >> 1; 380 463 heightBL = min<Int>( pcBasePic->getHeight() >> 1, heightEL ); 464 #endif 465 466 #if N0214_INTERMEDIATE_BUFFER_16BITS 467 shift1 = g_bitDepthC - 8; 381 468 #endif 382 469 … … 401 488 for( j = 0; j < heightBL ; j++ ) 402 489 { 490 #if N0214_INTERMEDIATE_BUFFER_16BITS 491 *piDstU = sumChromaHor(piSrcU, coeff) >> shift1; 492 *piDstV = sumChromaHor(piSrcV, coeff) >> shift1; 493 #else 403 494 *piDstU = sumChromaHor(piSrcU, coeff); 404 495 *piDstV = sumChromaHor(piSrcV, coeff); 496 #endif 405 497 406 498 piSrcU += strideBL; … … 416 508 pcTempPic->extendPicBorder (); // extend the border. 417 509 pcTempPic->setHeight(heightEL << 1); 510 511 #if N0214_INTERMEDIATE_BUFFER_16BITS 512 nShift = US_FILTER_PREC*2 - shift1; 513 iOffset = 1 << (nShift - 1); 514 #endif 418 515 419 516 #if SCALED_REF_LAYER_OFFSETS … … 436 533 piSrcV = piTempBufV + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 437 534 #if SCALED_REF_LAYER_OFFSETS 535 #if BUGFIX_RESAMPLE 536 Pel* piDstU0 = piDstBufU + j*strideEL; 537 Pel* piDstV0 = piDstBufV + j*strideEL; 538 piDstU = piDstU0 + leftOffset; 539 piDstV = piDstV0 + leftOffset; 540 piSrcU += leftOffset; 541 piSrcV += leftOffset; 542 543 for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- ) 544 { 545 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 546 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 547 piSrcU++; 548 piSrcV++; 549 piDstU++; 550 piDstV++; 551 } 552 553 for( i = rightEndC; i < pcTempPic->getWidth() >> 1; i++ ) 554 { 555 *piDstU = piDstU0[rightEndC-1]; 556 *piDstV = piDstV0[rightEndC-1]; 557 piDstU++; 558 piDstV++; 559 } 560 561 piDstU = piDstU0; 562 piDstV = piDstV0; 563 for( i = 0; i < leftStartC; i++ ) 564 { 565 *piDstU = piDstU0[leftStartC]; 566 *piDstV = piDstV0[leftStartC]; 567 piDstU++; 568 piDstV++; 569 } 570 #else 438 571 #if 1 // it should provide identical result 439 572 Pel* piDstU0 = piDstBufU + j*strideEL; … … 490 623 } 491 624 #endif 625 #endif 492 626 #else 493 627 piDstU = piDstBufU + j*strideEL; -
trunk/source/Lib/TLibCommon/TComYuv.cpp
r313 r345 184 184 } 185 185 186 #if NO_RESIDUAL_FLAG_FOR_BLPRED187 Void TComYuv::copyFromPicLuma ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiZorderIdxInCU, UInt uiAbsZorderIdx, UInt uiWidth, UInt uiHeight )188 {189 Int y;190 191 Pel* pDst = getLumaAddr(uiAbsZorderIdx);192 Pel* pSrc = pcPicYuvSrc->getLumaAddr ( iCuAddr, uiZorderIdxInCU + uiAbsZorderIdx );193 194 UInt iDstStride = getStride();195 UInt iSrcStride = pcPicYuvSrc->getStride();196 for ( y = uiHeight; y != 0; y-- )197 {198 ::memcpy( pDst, pSrc, sizeof(Pel)*uiWidth);199 pDst += iDstStride;200 pSrc += iSrcStride;201 }202 }203 204 Void TComYuv::copyFromPicChroma( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiZorderIdxInCU, UInt uiAbsZorderIdx, UInt uiCWidth, UInt uiCHeight, UInt uiChromaId )205 {206 Int y;207 208 if (!uiChromaId)209 {210 Pel* pDstU = getCbAddr(uiAbsZorderIdx);211 Pel* pSrcU = pcPicYuvSrc->getCbAddr( iCuAddr, uiZorderIdxInCU + uiAbsZorderIdx );212 213 UInt iDstStride = getCStride();214 UInt iSrcStride = pcPicYuvSrc->getCStride();215 for ( y = uiCHeight; y != 0; y-- )216 {217 ::memcpy( pDstU, pSrcU, sizeof(Pel)*(uiCWidth) );218 pSrcU += iSrcStride;219 pDstU += iDstStride;220 }221 }222 else223 {224 Pel* pDstV = getCrAddr(uiAbsZorderIdx);225 Pel* pSrcV = pcPicYuvSrc->getCrAddr( iCuAddr, uiZorderIdxInCU + uiAbsZorderIdx );226 227 UInt iDstStride = getCStride();228 UInt iSrcStride = pcPicYuvSrc->getCStride();229 for ( y = uiCHeight; y != 0; y-- )230 {231 ::memcpy( pDstV, pSrcV, sizeof(Pel)*(uiCWidth) );232 pSrcV += iSrcStride;233 pDstV += iDstStride;234 }235 }236 }237 #endif238 239 186 Void TComYuv::copyToPartYuv( TComYuv* pcYuvDst, UInt uiDstPartIdx ) 240 187 { -
trunk/source/Lib/TLibCommon/TComYuv.h
r313 r345 115 115 Void copyFromPicLuma ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiAbsZorderIdx ); 116 116 Void copyFromPicChroma ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiAbsZorderIdx ); 117 #if NO_RESIDUAL_FLAG_FOR_BLPRED118 Void copyFromPicLuma ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiZorderIdxInCU, UInt uiAbsZorderIdx, UInt uiWidth, UInt uiHeight );119 Void copyFromPicChroma( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiZorderIdxInCU, UInt uiAbsZorderIdx, UInt uiCWidth, UInt uiCHeight, UInt uiChromaId );120 #endif121 117 122 118 // Copy Small YUV buffer to the part of other Big YUV buffer -
trunk/source/Lib/TLibCommon/TypeDef.h
r313 r345 41 41 #define SVC_EXTENSION 1 42 42 43 #define N0139_POSITION_ROUNDING_OFFSET 1 44 43 45 #define SYNTAX_BYTES 10 ///< number of bytes taken by syntaxes per 4x4 block [RefIdxL0(1byte), RefIdxL1(1byte), MVxL0(2bytes), MVyL0(2bytes), MVxL1(2bytes), MVyL1(2bytes)] 44 46 45 47 #if SVC_EXTENSION 46 48 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle 47 49 #define RPL_INIT_N0316_N0082 1 ///< N0316, N0082: initial reference picture list construction 50 #define FINAL_RPL_CHANGE_N0082 1 ///< N0082: final ref picture list change (encoder) 48 51 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 1 ///< VUI flag to indicate tile boundary alignment 49 52 #define M0463_VUI_EXT_ILP_REF 1 ///< VUI extension inter-layer dependency offset signalling … … 51 54 #define SCALED_REF_LAYER_OFFSET_FLAG 0 ///< M0309: Signal scaled reference layer offsets in SPS 52 55 #define SCALED_REF_LAYER_OFFSETS 1 ///< M0309: Signal scaled reference layer offsets in SPS 56 57 #define ILP_SSH_SIG 1 ///< JCTVC-N0195 proposal 2, JCTVC-N0118: add presence flag in VPS ext to condition inter-layer prediction signaling in slice segment header 58 #define SPL_FLG_CHK 1 ///< JCTVC-N0195 proposal 5, JCTVC-N0085: constrain sum of lengths to be less than or equal to 6 59 #define ILP_NUM_REF_CHK 1 ///< JCTVC-N0195 proposal 1, JCTVC-N0081, JCTVC-N0154, JCTVC-N0217: a condition on signaling inter_layer_pred_layer_idc[ i ], to avoid sending when NumDirectRefLayers equals NumActiveRefLayerPics, and instead infer values 53 60 54 61 #define VPS_RENAME 1 ///< Rename variables max_layer_id and num_layer_sets_minus1 in VPS … … 74 81 #define SVC_COL_BLK 1 ///< get co-located block 75 82 #define SVC_UPSAMPLING 1 ///< upsampling filters 76 #define CHROMA_UPSAMPLING 1 ///< L0335: Chroma upsampling with 5 bits coefficients 83 #define ROUNDING_OFFSET 1 ///< JCTVC-N0111: upsampling rounding offset using scalling factors 84 #define N0214_INTERMEDIATE_BUFFER_16BITS 1 ///< JCTVC-N0214 support base layer input more than 8 bits 85 #define ARBITRARY_SPATIAL_RATIO 0 ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio 86 #define BUGFIX_RESAMPLE 1 ///< JCTVC-N0055: resampling bug fix for positive left scalled offset 77 87 78 88 #define SIMPLIFIED_MV_POS_SCALING 1 ///< M0133/M0449: inter-layer MV scaling and pixel mapping position calculation … … 97 107 #define JCTVC_M0458_INTERLAYER_RPS_SIG 1 ///< implementation of JCTVC-L0178 98 108 #if JCTVC_M0458_INTERLAYER_RPS_SIG 99 #define ZERO_NUM_DIRECT_LAYERS 1 ///< support of zero direct reference layers100 109 #define MAX_ONE_RESAMPLING_DIRECT_LAYERS 1 ///< Allow maximum of one resampling process for direct reference layers 101 110 #endif 102 111 #define JCTVC_M0203_INTERLAYER_PRED_IDC 1 ///< implementation of JCTVC-M0203 Inter-layer Prediction Indication 103 112 #if JCTVC_M0203_INTERLAYER_PRED_IDC 104 #define ILR_RESTR 1 ///< JCTVC-M0209 Inter-layer RPS and RPL 113 #define ILR_RESTR 1 ///< JCTVC-M0209 Inter-layer RPS and RPL 114 #define N0120_MAX_TID_REF_PRESENT_FLAG 1 ///< JCTVC-N0120 max_tid_ref_pics_plus1_present_flag 105 115 #endif 106 116 #if REF_IDX_MFM 117 #define REMOVE_COL_PICTURE_SIGNALING 1 ///< JCTVC-N0107 remove alternative collocated picture signalling 107 118 #define M0457_COL_PICTURE_SIGNALING 1 108 119 #endif 109 120 110 121 #if !VPS_EXTN_DIRECT_REF_LAYERS || !M0457_PREDICTION_INDICATIONS || !JCTVC_M0458_INTERLAYER_RPS_SIG 111 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG 0 122 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG 0 ///< shall be 0, JCTVC-N0107 112 123 #else 113 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG 0 114 #endif 115 116 #else 117 #define INTRA_BL 1 ///< inter-layer texture prediction 118 119 #if INTRA_BL 120 #define INTRA_BL_DST4x4 1 ///< L0067/L0204: DST4x4 for Intra BL 121 #define NO_RESIDUAL_FLAG_FOR_BLPRED 1 ///< L0437: Root cbf for Intra_BL 122 #define IL_MRG_SIMPLIFIED_PRUNING 1 ///< M0124: simplified pruning, Only the left and above candidates are checked with BL-C candidate for redundancy removal 123 #define INTRA_BL_CTX_CHANGE 1 ///< M0075: spatial dependency removal for IntraBL flag context derivation 124 125 // Hooks 126 #define SVC_MVP 1 ///< motion hook for merge mode as an example 127 #if !AVC_BASE && !AVC_SYNTAX 128 #define SVC_BL_CAND_INTRA 0 ///< Intra Base Mode Prediction hook as an example 129 #endif 130 124 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG 0 ///< shall be 0, JCTVC-N0107 131 125 #endif 132 126 #endif … … 134 128 #define FAST_INTRA_SHVC 1 ///< M0115: reduction number of intra modes in the EL (encoder only) 135 129 #if FAST_INTRA_SHVC 136 #define NB_REMAIN_MODES2 ///< nb of remaining modes (M0115)137 #endif 138 139 #define RC_SHVC_HARMONIZATION 1 ///< JCTVC-M0037, rate control for SHVC130 #define NB_REMAIN_MODES 2 ///< nb of remaining modes (M0115) 131 #endif 132 133 #define RC_SHVC_HARMONIZATION 1 ///< JCTVC-M0037, rate control for SHVC 140 134 141 135 #else … … 472 466 MODE_INTER, ///< inter-prediction mode 473 467 MODE_INTRA, ///< intra-prediction mode 474 #if INTRA_BL475 MODE_INTRA_BL, ///< inter-layer intra-prediction mode476 #endif477 468 MODE_NONE = 15 478 469 };
Note: See TracChangeset for help on using the changeset viewer.