Changeset 1221 in 3DVCSoftware for branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder
- Timestamp:
- 21 May 2015, 14:39:30 (10 years ago)
- Location:
- branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCavlc.cpp
r1219 r1221 2843 2843 assert(0); 2844 2844 } 2845 #if H_3D_INTER_SDC2845 #if NH_3D_INTRA_SDC || H_3D_INTER_SDC 2846 2846 Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2847 2847 { -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCavlc.h
r1209 r1221 126 126 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 127 127 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 128 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC128 #if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC 129 129 Void codeDeltaDC ( TComDataCU* /*pcCU*/, UInt /*absPartIdx*/ ) { assert(0); }; 130 130 #endif … … 136 136 #endif 137 137 138 #if H_3D_INTER_SDC138 #if NH_3D_INTRA_SDC || H_3D_INTER_SDC 139 139 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 140 140 #endif -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncCu.cpp
r1209 r1221 1597 1597 if(pcCU->getIPCMFlag(uiAbsPartIdx)) 1598 1598 { 1599 #if H_3D_DIM_SDC1600 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx , false);1599 #if NH_3D_INTRA_SDC 1600 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx ); 1601 1601 #endif 1602 1602 … … 1612 1612 m_pcEntropyCoder->encodeDBBPFlag( pcCU, uiAbsPartIdx ); 1613 1613 #endif 1614 #if H_3D_DIM_SDC1615 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx , false);1614 #if NH_3D_INTRA_SDC 1615 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx ); 1616 1616 #endif 1617 1617 #if H_3D_ARP … … 2470 2470 rpcTempCU->setDISFlagSubParts(true, 0, uiDepth); 2471 2471 rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth); 2472 #if H_3D_DIM_SDC2472 #if NH_3D_INTRA_SDC 2473 2473 rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth); 2474 2474 #endif … … 2700 2700 m_pcPredSearch->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], resiLuma DEBUG_STRING_PASS_INTO(sTest) ); 2701 2701 } 2702 #if H_3D_DIM_SDC 2703 if( !rpcTempCU->getSDCFlag( 0 ) ) 2702 2703 #if NH_3D_INTRA_SDC 2704 if( rpcTempCU->getSDCFlag( 0 ) ) 2705 { 2706 assert( rpcTempCU->getTransformIdx(0) == 0 ); 2707 assert( rpcTempCU->getCbf(0, COMPONENT_Y) == 1 ); 2708 } 2704 2709 #endif 2705 2710 … … 2720 2725 m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0 ); 2721 2726 m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true ); 2722 #if H_3D_DIM_SDC2727 #if NH_3D_INTRA_SDC 2723 2728 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2724 2729 #endif … … 2805 2810 m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true ); 2806 2811 m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true ); 2807 #if H_3D_DIM_SDC2812 #if NH_3D_INTRA_SDC 2808 2813 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2809 2814 #endif -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncEntropy.cpp
r1209 r1221 514 514 { 515 515 encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx,true ); 516 #if H_3D_DIM_SDC 517 if(!pcCU->getSDCFlag(uiAbsPartIdx)) 518 #endif 516 519 517 if (pcCU->getPic()->getChromaFormat()!=CHROMA_400) 520 518 { … … 713 711 #endif 714 712 715 #if H_3D_DIM_SDC713 #if NH_3D_INTRA_SDC 716 714 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx ) ) 717 715 { 718 716 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 719 717 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); 720 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); 721 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 722 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 718 assert( pcCU->getCbf(uiAbsPartIdx, COMPONENT_Y) == 1 ); 723 719 } 724 720 #endif … … 734 730 if( pcCU->getSlice()->getIsDepth() ) 735 731 { 736 #if H_3D_DIM_SDC || H_3D_INTER_SDC732 #if NH_3D_INTRA_SDC || H_3D_INTER_SDC 737 733 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 738 734 { … … 843 839 } 844 840 845 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC841 #if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC 846 842 Void TEncEntropy::encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ) 847 843 { … … 849 845 } 850 846 #endif 851 #if H_3D_INTER_SDC847 #if NH_3D_INTRA_SDC || H_3D_INTER_SDC 852 848 Void TEncEntropy::encodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 853 849 { 850 if( bRD ) 851 { 852 uiAbsPartIdx = 0; 853 } 854 854 855 if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getInterSdcFlag() ) || 855 856 ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getIntraSdcWedgeFlag() ) ) … … 863 864 } 864 865 865 assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 866 867 if( bRD ) 868 { 869 uiAbsPartIdx = 0; 870 } 866 assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ); 871 867 872 868 m_pcEntropyCoderIf->codeSDCFlag( pcCU, uiAbsPartIdx ); -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncEntropy.h
r1209 r1221 84 84 virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 85 85 virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 86 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC86 #if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC 87 87 virtual Void codeDeltaDC ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 88 88 #endif … … 93 93 virtual Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 94 94 #endif 95 #if H_3D_INTER_SDC95 #if NH_3D_INTRA_SDC || H_3D_INTER_SDC 96 96 virtual Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 97 97 #endif … … 181 181 Void encodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 182 182 #endif 183 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC183 #if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC 184 184 Void encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 185 185 #endif 186 #if H_3D_INTER_SDC186 #if NH_3D_INTRA_SDC || H_3D_INTER_SDC 187 187 Void encodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 188 188 #endif -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSbac.cpp
r1209 r1221 106 106 , m_cDmmModeSCModel ( 1, 1, NUM_DMM_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 107 #endif 108 #if NH_3D_DMM || NH_3D_ SDC108 #if NH_3D_DMM || NH_3D_INTRA_SDC 109 109 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 110 110 #endif 111 #if H_3D_DIM_SDC111 #if NH_3D_INTRA_SDC 112 112 , m_cSDCResidualFlagSCModel ( 1, 1, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 113 113 , m_cSDCResidualSCModel ( 1, 1, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 187 187 m_cDmmModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_MODE ); 188 188 #endif 189 #if NH_3D_DMM || NH_3D_ SDC189 #if NH_3D_DMM || NH_3D_INTRA_SDC 190 190 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA ); 191 191 #endif 192 #if H_3D_DIM_SDC192 #if NH_3D_INTRA_SDC 193 193 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 194 194 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); … … 243 243 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 244 244 #endif 245 #if H_3D_DIM_SDC245 #if NH_3D_INTRA_SDC 246 246 curCost += m_cSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SDC_FLAG ); 247 247 #endif … … 280 280 curCost += m_cDmmModeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM_MODE ); 281 281 #endif 282 #if NH_3D_DMM || NH_3D_ SDC282 #if NH_3D_DMM || NH_3D_INTRA_SDC 283 283 curCost += m_cDdcDataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_DATA ); 284 284 #endif … … 307 307 #if H_3D_IC 308 308 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 309 #endif310 #if H_3D_DIM_SDC311 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );312 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );313 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );314 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );315 309 #endif 316 310 #if H_3D_DBBP … … 799 793 Void TEncSbac::codePredMode( TComDataCU* pcCU, UInt uiAbsPartIdx ) 800 794 { 801 #if H_3D_DIM_SDC802 if ( pcCU->getSlice()->isIntra() )803 {804 assert( pcCU->isIntra(uiAbsPartIdx) );805 return;806 }807 #endif808 809 795 // get context function is here 810 796 m_pcBinIf->encodeBin( pcCU->isIntra( uiAbsPartIdx ) ? 1 : 0, m_cCUPredModeSCModel.get( 0, 0, 0 ) ); … … 2487 2473 } 2488 2474 2489 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC2475 #if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC 2490 2476 Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx ) 2491 2477 { 2492 #if H_3D_DIM_SDC || H_3D_INTER_SDC2478 #if NH_3D_INTRA_SDC || H_3D_INTER_SDC 2493 2479 if( !(pcCU->getSDCFlag( absPartIdx )) ) 2494 2480 #endif … … 2504 2490 2505 2491 UInt hasDeltaDC = 1; 2506 #if H_3D_DIM_SDC2492 #if NH_3D_INTRA_SDC 2507 2493 if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx )) 2508 2494 { … … 2526 2512 if( pcCU->isIntra( absPartIdx ) ) 2527 2513 { 2528 #if H_3D_DIM_SDC2514 #if NH_3D_INTRA_SDC 2529 2515 if( pcCU->getSDCFlag( absPartIdx ) ) 2530 2516 { … … 2537 2523 deltaDC = pcCU->getDmmDeltaDC( getDmmType( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ), segment, absPartIdx ); 2538 2524 #endif 2539 #if H_3D_DIM_SDC2525 #if NH_3D_INTRA_SDC 2540 2526 } 2541 2527 #endif … … 2554 2540 Void TEncSbac::xCodeDeltaDC( Pel valDeltaDC, UInt uiNumSeg ) 2555 2541 { 2542 DTRACE_CU("delta_dc", valDeltaDC); 2556 2543 xWriteExGolombLevelDdc( UInt( abs( valDeltaDC ) - ( uiNumSeg > 1 ? 0 : 1 ) ) ); 2557 2544 if( valDeltaDC != 0 ) … … 2639 2626 #endif 2640 2627 2641 #if H_3D_INTER_SDC2628 #if NH_3D_INTRA_SDC || H_3D_INTER_SDC 2642 2629 Void TEncSbac::codeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2643 2630 { 2644 2631 UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0; 2645 UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );2646 2632 DTRACE_CU("dc_only_flag", uiSymbol) 2647 m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag) );2633 m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, 0 ) ); 2648 2634 } 2649 2635 -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSbac.h
r1209 r1221 115 115 Void xWriteEpExGolomb ( UInt uiSymbol, UInt uiCount ); 116 116 Void xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange ); 117 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC117 #if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC 118 118 Void xWriteExGolombLevelDdc( UInt uiSymbol ); 119 119 Void xCodeDeltaDC ( Pel valDeltaDC, UInt uiNumSeg ); … … 149 149 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 150 150 #endif 151 #if NH_3D_DMM || H_3D_DIM_SDC || H_3D_INTER_SDC151 #if NH_3D_DMM || NH_3D_INTRA_SDC || H_3D_INTER_SDC 152 152 Void codeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 153 153 #endif 154 #if H_3D_INTER_SDC154 #if NH_3D_INTRA_SDC || H_3D_INTER_SDC 155 155 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 156 156 #endif … … 252 252 ContextModel3DBuffer m_cDmmModeSCModel; 253 253 #endif 254 #if NH_3D_DMM || NH_3D_ SDC254 #if NH_3D_DMM || NH_3D_INTRA_SDC 255 255 ContextModel3DBuffer m_cDdcDataSCModel; 256 256 #endif 257 #if H_3D_DIM_SDC257 #if NH_3D_INTRA_SDC 258 258 ContextModel3DBuffer m_cSDCResidualFlagSCModel; 259 259 ContextModel3DBuffer m_cSDCResidualSCModel; -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.cpp
r1219 r1221 1031 1031 if ( pcCU->getIPCMFlag (0)) 1032 1032 { 1033 #if H_3D_DIM_SDC1033 #if NH_3D_INTRA_SDC 1034 1034 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 1035 1035 #endif … … 1051 1051 { 1052 1052 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 ); 1053 #if H_3D_DIM_SDC1053 #if NH_3D_INTRA_SDC 1054 1054 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 1055 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, 0 ) ) ) 1055 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, 0 ) ) ) 1056 1056 { 1057 1057 m_pcEntropyCoder->encodeDeltaDC( pcCU, 0 ); … … 1066 1066 { 1067 1067 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx ); 1068 #if H_3D_DIM_SDC1068 #if NH_3D_INTRA_SDC 1069 1069 } 1070 1070 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); … … 1076 1076 } 1077 1077 #endif 1078 #if H_3D_DIM_SDC1078 #if NH_3D_INTRA_SDC 1079 1079 if( uiAbsPartIdx == 0 ) 1080 1080 { … … 1974 1974 } 1975 1975 #endif 1976 #if H_3D_DIM_SDC1976 #if NH_3D_INTRA_SDC 1977 1977 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ) 1978 1978 { 1979 1979 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for DMM and SDC 1980 Bool bAboveAvail = false;1981 Bool bLeftAvail = false;1982 1980 UInt uiWidth = pcCU->getWidth ( 0 ); 1983 1981 UInt uiHeight = pcCU->getHeight( 0 ); 1984 1982 UInt uiLumaPredMode = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, uiAbsPartIdx ); 1983 const Int bitDepthY = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA); 1984 const TComSPS &sps = *(pcCU->getSlice()->getSPS()); 1985 const ChromaFormat chFmt = pcCU->getPic()->getChromaFormat(); 1985 1986 1986 1987 UInt sdcDepth = 0; … … 1990 1991 Pel* piReco; 1991 1992 1992 UInt uiZOrder; 1993 Pel* piRecIPred; 1993 Pel* piRecIPred; 1994 1994 UInt uiRecIPredStride; 1995 1995 … … 2001 2001 UInt uiMaskStride = 0; 2002 2002 #if NH_3D_DMM 2003 TComWedgelet* dmm4Segmentation = NULL;2004 2003 if( isDmmMode( uiLumaPredMode ) ) 2005 2004 { … … 2051 2050 #endif 2052 2051 uiNumSegments = 1; 2053 2054 UInt numParts = 1; 2055 UInt uiSubPartIdx = uiAbsPartIdx; 2056 2052 2057 2053 if( ( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1 ) 2058 2054 { 2059 numParts = uiWidth * uiWidth >> ( 2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() );2060 2055 sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 2061 uiWidth = uiHeight = ( 1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ); 2062 } 2063 2064 for ( Int i = 0; i < numParts; i++ ) 2065 { 2066 uiStride = pcOrgYuv ->getStride (); 2067 piOrg = pcOrgYuv ->getLumaAddr( uiSubPartIdx ); 2068 piPred = pcPredYuv->getLumaAddr( uiSubPartIdx ); 2069 piReco = pcPredYuv->getLumaAddr( uiSubPartIdx ); 2070 2071 uiZOrder = pcCU->getZorderIdxInCU() + uiSubPartIdx; 2072 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 2073 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 2074 2075 AOF( uiWidth == uiHeight ); 2076 2077 //===== init availability pattern ===== 2078 pcCU->getPattern()->initPattern ( pcCU, sdcDepth, uiSubPartIdx ); 2079 pcCU->getPattern()->initAdiPattern( pcCU, uiSubPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 2080 2081 predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 2082 2083 if ( numParts > 1 ) 2084 { 2085 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 2086 { 2087 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 2088 { 2089 piPred [ uiX ] = ClipY( piPred[ uiX ] ); 2090 piRecIPred [ uiX ] = piPred[ uiX ]; 2091 } 2092 piPred += uiStride; 2093 piRecIPred += uiRecIPredStride; 2094 } 2095 } 2096 2097 uiSubPartIdx += ( ( uiWidth * uiWidth ) >> 4 ); 2098 } 2056 } 2057 2058 //===== loop over partitions ===== 2059 TComTURecurse tuRecurseCU(pcCU, 0); 2060 TComTURecurse tuRecurseWithPU(tuRecurseCU, false, (sdcDepth==0)?TComTU::DONT_SPLIT:TComTU::QUAD_SPLIT); 2061 2062 do 2063 { 2064 const TComRectangle &puRect = tuRecurseWithPU.getRect(COMPONENT_Y); 2065 const UInt uiAbsPartIdxTU = tuRecurseWithPU.GetAbsPartIdxTU(); 2066 2067 Pel* piOrgTU = pcOrgYuv ->getAddr ( COMPONENT_Y, uiAbsPartIdxTU ); 2068 Pel* piPredTU = pcPredYuv->getAddr ( COMPONENT_Y, uiAbsPartIdxTU ); 2069 UInt uiStrideTU = pcPredYuv->getStride ( COMPONENT_Y ); 2070 2071 //===== init pattern for luma prediction ===== 2072 Bool bAboveAvail = false; 2073 Bool bLeftAvail = false; 2074 2075 if (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y)) 2076 { 2077 initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) ); 2078 } 2079 2080 const Bool bUseFilter = TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiLumaPredMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag()); 2081 2082 predIntraAng( COMPONENT_Y, uiLumaPredMode, piOrgTU, uiStrideTU, piPredTU, uiStrideTU, tuRecurseWithPU, bAboveAvail, bLeftAvail, bUseFilter, TComPrediction::UseDPCMForFirstPassIntraEstimation(tuRecurseWithPU, uiLumaPredMode) ); 2083 2084 } while (tuRecurseWithPU.nextSection(tuRecurseCU)); 2099 2085 2100 2086 // reset to full block … … 2102 2088 uiHeight = pcCU->getHeight( 0 ); 2103 2089 2104 uiStride = pcOrgYuv ->getStride (); 2105 piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx ); 2106 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 2107 piReco = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 2108 2109 uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 2110 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 2111 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 2090 uiStride = pcOrgYuv ->getStride( COMPONENT_Y ); 2091 piOrg = pcOrgYuv ->getAddr ( COMPONENT_Y, uiAbsPartIdx ); 2092 piPred = pcPredYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx ); 2093 piReco = pcPredYuv->getAddr ( COMPONENT_Y, uiAbsPartIdx ); 2094 2095 piRecIPred = pcCU->getPic()->getPicYuvRec()->getAddr ( COMPONENT_Y, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiAbsPartIdx ); 2096 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride( COMPONENT_Y ); 2112 2097 2113 2098 // get predicted and original DC … … 2273 2258 if( !bZeroResidual ) 2274 2259 { 2260 #if NH_3D_DLT 2275 2261 Pel pPredIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 2276 2262 Int pTestIdx = pPredIdx + pResidualIdx + iSDCDeltaResi; … … 2279 2265 pResidualIdx += iSDCDeltaResi; 2280 2266 } 2267 #else 2268 pResidualIdx += iSDCDeltaResi; 2269 #endif 2281 2270 } 2282 2271 // save SDC DC offset … … 2314 2303 Pel pResiDC = apDCResiValues[ucSegment]; 2315 2304 2316 pReco [ uiX ] = Clip Y( pPred[ uiX ] + pResiDC);2305 pReco [ uiX ] = ClipBD( pPred[ uiX ] + pResiDC, bitDepthY); 2317 2306 pRecIPred[ uiX ] = pReco[ uiX ]; 2318 2307 } … … 2323 2312 } 2324 2313 2325 // clear UV2326 UInt uiStrideC = pcPredYuv->get CStride();2327 Pel *pRecCb = pcPredYuv->get CbAddr();2328 Pel *pRecCr = pcPredYuv->get CrAddr();2314 // clear chroma 2315 UInt uiStrideC = pcPredYuv->getStride( COMPONENT_Cb ); 2316 Pel *pRecCb = pcPredYuv->getAddr ( COMPONENT_Cb, uiAbsPartIdx ); 2317 Pel *pRecCr = pcPredYuv->getAddr ( COMPONENT_Cr, uiAbsPartIdx ); 2329 2318 2330 2319 for (Int y=0; y<uiHeight/2; y++) … … 2346 2335 #endif 2347 2336 2348 //===== determine distortion ===== 2349 #if H_3D_VSO 2350 if ( m_pcRdCost->getUseVSO() ) 2351 ruiDist = m_pcRdCost->getDistPartVSO ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false ); 2337 //===== determine distortion ===== 2338 #if NH_3D_VSO 2339 if( m_pcRdCost->getUseVSO() ) 2340 { 2341 if( m_pcRdCost->getUseEstimatedVSD() ) 2342 { 2343 ruiDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPartIdx, bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false ); 2344 } 2345 else 2346 { 2347 ruiDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPartIdx, bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false ); 2348 } 2349 } 2352 2350 else 2353 2351 #endif 2354 ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight ); 2352 { 2353 ruiDist = m_pcRdCost->getDistPart( bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, COMPONENT_Y, DF_SAD ); 2354 } 2355 2355 2356 2356 //===== determine rate and r-d cost ===== … … 2371 2371 2372 2372 // encode pred direction + DC residual data 2373 m_pcEntropyCoder->encodePredInfo( pcCU, 0 , true);2373 m_pcEntropyCoder->encodePredInfo( pcCU, 0 ); 2374 2374 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 2375 2375 2376 2376 Bool bDummy = false; 2377 m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy );2377 m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), bDummy, bDummy ); 2378 2378 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 2379 2379 2380 #if H_3D_VSO2380 #if NH_3D_VSO 2381 2381 if ( m_pcRdCost->getUseLambdaScaleVSO()) 2382 2382 dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist ); … … 3239 3239 UInt rdSDC = m_pcEncCfg->getIsDepth() ? numModesForFullRD : 0; 3240 3240 #endif 3241 #if H_3D_DIM_SDC3241 #if NH_3D_INTRA_SDC 3242 3242 Bool bBestUseSDC = false; 3243 3243 Pel apBestDCOffsets[2] = {0,0}; … … 3290 3290 pcCU->setIntraDirSubParts ( CHANNEL_TYPE_LUMA, uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth ); 3291 3291 3292 #if H_3D_DIM_SDC3292 #if NH_3D_INTRA_SDC 3293 3293 #if H_3D_FAST_INTRA_SDC 3294 3294 Bool bTestSDC = ( ( m_pcEncCfg->getUseSDC() && pcCU->getSlice()->getIntraSdcWedgeFlag() ) && pcCU->getSDCAvailable(uiPartOffset) && uiMode >= numModesForFullRD); … … 3337 3337 #if NH_3D_ENC_DEPTH 3338 3338 UInt zeroResiTest = (pcCU->getSlice()->getIsDepth() && !pcCU->getSlice()->isIRAP()) ? 1 : 0; 3339 #if H_3D_DIM_SDC3340 bTestZeroResi|= pcCU->getSDCFlag(uiPartOffset);3339 #if NH_3D_INTRA_SDC 3340 zeroResiTest |= pcCU->getSDCFlag(uiPartOffset); 3341 3341 if( uiSDC != 0 && iSDCDeltaResi != 0 ) 3342 3342 { 3343 bTestZeroResi = false;3343 zeroResiTest = 0; 3344 3344 } 3345 3345 #endif … … 3364 3364 } 3365 3365 #endif 3366 #if H_3D_DIM_SDC3366 #if NH_3D_INTRA_SDC 3367 3367 if( pcCU->getSDCFlag(uiPartOffset) ) 3368 3368 { 3369 3369 pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth); 3370 pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth);3370 pcCU->setCbfSubParts(1, COMPONENT_Y, uiPartOffset, uiDepth + uiInitTrDepth); 3371 3371 3372 3372 // start encoding with SDC 3373 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi );3374 if ( testZeroResi == 0 && iOffset <= 3 )3373 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( zeroResi != 0 ), iSDCDeltaResi ); 3374 if ( zeroResi == 0 && iOffset <= 3 ) 3375 3375 { 3376 3376 dOffsetCost [iOffset -1] = dPUCost; … … 3403 3403 #endif 3404 3404 #endif 3405 #if H_3D_DIM_SDC3405 #if NH_3D_INTRA_SDC 3406 3406 } 3407 3407 #endif … … 3424 3424 dBestPUCost = dPUCost; 3425 3425 3426 #if H_3D_DIM_SDC3426 #if NH_3D_INTRA_SDC 3427 3427 if( pcCU->getSDCFlag(uiPartOffset) ) 3428 3428 { … … 3430 3430 3431 3431 // copy reconstruction 3432 pcPredYuv->copyPartToPartYuv(pcRecoYuv, uiPartOffset, uiWidth, uiHeight); 3432 UInt uiWidthPU = tuRecurseWithPU.getRect( COMPONENT_Y ).width; 3433 UInt uiHeightPU = tuRecurseWithPU.getRect( COMPONENT_Y ).height; 3434 UInt uiWidth = pcCU->getWidth (0) >> uiInitTrDepth; 3435 UInt uiHeight = pcCU->getHeight(0) >> uiInitTrDepth; 3436 AOF(uiWidth==uiWidthPU); 3437 AOF(uiHeight==uiHeightPU); 3438 pcPredYuv->copyPartToPartComponent(COMPONENT_Y, pcRecoYuv, uiPartOffset, uiWidth, uiHeight); 3433 3439 3434 3440 // copy DC values … … 3463 3469 ::memcpy( m_puhQTTempCbf[compID], pcCU->getCbf( compID ) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3464 3470 ::memcpy( m_puhQTTempTransformSkipFlag[compID], pcCU->getTransformSkip(compID) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 3465 #if H_3D_DIM_SDC 3466 } 3467 #endif 3468 3469 } 3471 } 3472 #if NH_3D_INTRA_SDC 3473 } 3474 #endif 3470 3475 } 3471 3476 #if HHI_RQT_INTRA_SPEEDUP_MOD … … 3479 3484 } 3480 3485 #endif 3481 #if H_3D_DIM_SDC3486 #if NH_3D_INTRA_SDC 3482 3487 } // SDC residual loop 3483 3488 } // SDC loop … … 3510 3515 3511 3516 pcCU->setIntraDirSubParts ( CHANNEL_TYPE_LUMA, uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth ); 3512 #if H_3D_DIM_SDC3517 #if NH_3D_INTRA_SDC 3513 3518 pcCU->setSDCFlagSubParts(false, uiPartOffset, uiDepth + uiInitTrDepth); 3514 3519 #endif … … 3543 3548 uiBestPUDistY = uiPUDistY; 3544 3549 dBestPUCost = dPUCost; 3545 #if H_3D_DIM_SDC3550 #if NH_3D_INTRA_SDC 3546 3551 bBestUseSDC = false; 3547 3552 #endif … … 3580 3585 //--- update overall distortion --- 3581 3586 uiOverallDistY += uiBestPUDistY; 3582 #if H_3D_DIM_SDC3587 #if NH_3D_INTRA_SDC 3583 3588 if( bBestUseSDC ) 3584 3589 { 3585 3590 pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth); 3586 pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth);3591 pcCU->setCbfSubParts(1, COMPONENT_Y, uiPartOffset, uiDepth + uiInitTrDepth); 3587 3592 3588 3593 //=== copy best DC segment values back to CU ==== … … 3602 3607 ::memcpy( pcCU->getCbf( compID ) + uiPartOffset, m_puhQTTempCbf[compID], uiQPartNum * sizeof( UChar ) ); 3603 3608 ::memcpy( pcCU->getTransformSkip( compID ) + uiPartOffset, m_puhQTTempTransformSkipFlag[compID ], uiQPartNum * sizeof( UChar ) ); 3604 #if H_3D_DIM_SDC3609 #if NH_3D_INTRA_SDC 3605 3610 } 3606 3611 #endif … … 3639 3644 //=== update PU data ==== 3640 3645 pcCU->setIntraDirSubParts ( CHANNEL_TYPE_LUMA, uiBestPUMode, uiPartOffset, uiDepth + uiInitTrDepth ); 3641 #if H_3D_DIM_SDC3646 #if NH_3D_INTRA_SDC 3642 3647 pcCU->setSDCFlagSubParts ( bBestUseSDC, uiPartOffset, uiDepth + uiInitTrDepth ); 3643 3648 #endif … … 6162 6167 #endif 6163 6168 6164 #if H_3D_DIM_SDC6169 #if NH_3D_INTRA_SDC 6165 6170 Bool bNonSkip = false; 6166 6171 #else … … 7226 7231 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 7227 7232 m_pcEntropyCoder->encodePredInfo( pcCU, 0 ); 7228 #if H_3D_DIM_SDC7233 #if NH_3D_INTRA_SDC 7229 7234 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 7230 7235 #endif … … 7769 7774 #endif 7770 7775 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC 7771 #if NH_3D_ SDC7776 #if NH_3D_INTRA_SDC 7772 7777 Void TEncSearch::xCalcConstantSDC( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& valDC ) 7773 7778 { -
branches/HTM-14.1-update-dev1-RWTH/source/Lib/TLibEncoder/TEncSearch.h
r1209 r1221 356 356 Void xSearchDmm1Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx ); 357 357 #endif 358 #if H_3D_DIM_SDC358 #if NH_3D_INTRA_SDC 359 359 Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ); 360 360 #endif 361 361 #if TEMP_SDC_CLEANUP // PM: consider this cleanup for SDC 362 #if NH_3D_ SDC362 #if NH_3D_INTRA_SDC 363 363 Void xCalcConstantSDC ( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& valDC ); 364 364 #endif
Note: See TracChangeset for help on using the changeset viewer.