Changeset 827 in 3DVCSoftware for branches/HTM-9.3-dev0/source/Lib/TLibEncoder
- Timestamp:
- 5 Feb 2014, 20:06:56 (11 years ago)
- Location:
- branches/HTM-9.3-dev0/source/Lib/TLibEncoder
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
r816 r827 2527 2527 2528 2528 #if H_3D_INTER_SDC 2529 #if QC_SDC_UNIFY_G0130 2530 Void TEncCavlc::codeDeltaDC( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2531 { 2532 assert(0); 2533 } 2534 2535 Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2536 { 2537 assert(0); 2538 } 2539 #else 2529 2540 Void TEncCavlc::codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2530 2541 { … … 2536 2547 assert(0); 2537 2548 } 2549 #endif 2538 2550 #endif 2539 2551 -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncCavlc.h
r816 r827 138 138 #endif 139 139 #if H_3D_INTER_SDC 140 #if QC_SDC_UNIFY_G0130 141 Void codeDeltaDC ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 142 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 143 #else 140 144 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 141 145 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 146 #endif 142 147 #endif 143 148 #if H_3D_DBBP -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncCu.cpp
r826 r827 1640 1640 m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 1641 1641 1642 #if QC_SDC_UNIFY_G0130 1643 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false ); 1644 #endif 1642 1645 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) 1643 1646 { … … 1667 1670 #endif 1668 1671 #endif 1669 #if H_3D_INTER_SDC 1672 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1670 1673 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, uiAbsPartIdx, false ); 1671 1674 #endif … … 2049 2052 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 2050 2053 rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level 2054 #if H_3D_SPIVMP 2051 2055 } 2056 #endif 2052 2057 // do MC 2053 2058 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); … … 2094 2099 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual ) 2095 2100 { 2101 #if SEC_INTER_SDC_G0101 2102 for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ ) 2103 { 2104 if( rpcTempCU != rpcTempCUPre ) 2105 { 2106 rpcTempCU->initEstData( uhDepth, orgQP ); 2107 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 2108 } 2109 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2110 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2111 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 2112 #if H_3D_VSO //M2 2113 if( m_pcRdCost->getUseRenModel() ) 2114 { //Reset 2115 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth (); 2116 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight (); 2117 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr (); 2118 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride (); 2119 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2120 } 2121 #endif 2122 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2123 m_ppcOrigYuv[uhDepth], 2124 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2125 m_ppcResiYuvTemp[uhDepth], 2126 m_ppcRecoYuvTemp[uhDepth], 2127 uiOffest, 2128 uhDepth ); 2129 2130 xCheckDQP( rpcTempCU ); 2131 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth ); 2132 } 2133 #else 2096 2134 if( rpcTempCU != rpcTempCUPre ) 2097 2135 { … … 2121 2159 xCheckDQP( rpcTempCU ); 2122 2160 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth ); 2161 #endif 2123 2162 } 2124 2163 #endif … … 2331 2370 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2332 2371 #if H_3D_INTER_SDC 2372 #if SEC_INTER_SDC_G0101 // ONLY_2NX2N_SDC 2373 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && ePartSize == SIZE_2Nx2N) 2374 #else 2333 2375 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() ) 2334 { 2376 #endif 2377 { 2378 #if SEC_INTER_SDC_G0101 2379 for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ ) 2380 { 2381 if( rpcTempCU != rpcTempCUPre ) 2382 { 2383 Int orgQP = rpcBestCU->getQP( 0 ); 2384 rpcTempCU->initEstData( uhDepth, orgQP ); 2385 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 2386 } 2387 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2388 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2389 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 2390 #if H_3D_VSO // M3 2391 if( m_pcRdCost->getUseRenModel() ) 2392 { 2393 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ( ); 2394 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight( ); 2395 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( ); 2396 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride(); 2397 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2398 } 2399 #endif 2400 2401 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2402 m_ppcOrigYuv[uhDepth], 2403 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2404 m_ppcResiYuvTemp[uhDepth], 2405 m_ppcRecoYuvTemp[uhDepth], 2406 uiOffest, 2407 uhDepth ); 2408 2409 xCheckDQP( rpcTempCU ); 2410 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2411 } 2412 #else 2335 2413 if( rpcTempCU != rpcTempCUPre ) 2336 2414 { … … 2362 2440 xCheckDQP( rpcTempCU ); 2363 2441 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2442 #endif 2364 2443 } 2365 2444 #endif … … 2605 2684 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2606 2685 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); 2686 #if QC_SDC_UNIFY_G0130 2687 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2688 #endif 2607 2689 m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0, true ); 2608 2690 m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true ); … … 2694 2776 m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0, true ); 2695 2777 m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true ); 2778 #if QC_SDC_UNIFY_G0130 2779 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2780 #endif 2696 2781 m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true ); 2697 2782 -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
r826 r827 679 679 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 680 680 UInt uiChromaOffset = uiLumaOffset>>2; 681 681 #if QC_SDC_UNIFY_G0130 682 682 #if H_3D_DIM_SDC 683 if( pcCU->getSDCFlag( uiAbsPartIdx ) )683 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx ) ) 684 684 { 685 685 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); … … 688 688 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 689 689 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 690 return;691 690 } 692 691 #endif 693 692 694 693 #if H_3D_INTER_SDC 695 if( pcCU->get InterSDCFlag( uiAbsPartIdx ) )694 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) ) 696 695 { 697 696 assert( !pcCU->isSkipped( uiAbsPartIdx ) ); 698 697 assert( !pcCU->isIntra( uiAbsPartIdx) ); 699 698 assert( pcCU->getSlice()->getIsDepth() ); 699 } 700 #endif 701 #if QC_SDC_UNIFY_G0130_FIX 702 if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) ) 703 #else 704 if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) 705 #endif 706 { 707 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 708 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 709 710 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 711 { 712 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 713 { 714 if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 715 { 716 m_pcEntropyCoderIf->codeDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart ); 717 } 718 } 719 } 720 else 721 { 722 m_pcEntropyCoderIf->codeDeltaDC( pcCU, uiAbsPartIdx ); 723 return; 724 } 725 } 726 #else 727 #if H_3D_DIM_SDC 728 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 729 { 730 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 731 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); 732 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); 733 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 734 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 735 return; 736 } 737 #endif 738 739 #if H_3D_INTER_SDC 740 if( pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 741 { 742 assert( !pcCU->isSkipped( uiAbsPartIdx ) ); 743 assert( !pcCU->isIntra( uiAbsPartIdx) ); 744 assert( pcCU->getSlice()->getIsDepth() ); 700 745 701 746 encodeInterSDCResidualData( pcCU, uiAbsPartIdx, false ); 702 747 return; 703 748 } 749 #endif 704 750 #endif 705 751 … … 855 901 856 902 #if H_3D_INTER_SDC 903 #if QC_SDC_UNIFY_G0130 904 Void TEncEntropy::encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ) 905 { 906 m_pcEntropyCoderIf->codeDeltaDC( pcCU, absPartIdx ); 907 } 908 909 Void TEncEntropy::encodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 910 { 911 if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) || 912 ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getVpsDepthModesFlag( pcCU->getSlice()->getLayerIdInVps() ) ) ) 913 { 914 return; 915 } 916 917 #if SEC_INTER_SDC_G0101 918 if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) ) 919 #else 920 if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) ) 921 #endif 922 { 923 return; 924 } 925 926 #if SEC_INTER_SDC_G0101 927 assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 928 #else 929 assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 930 #endif 931 932 if( bRD ) 933 { 934 uiAbsPartIdx = 0; 935 } 936 937 m_pcEntropyCoderIf->codeSDCFlag( pcCU, uiAbsPartIdx ); 938 } 939 #else 857 940 Void TEncEntropy::encodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 858 941 { … … 902 985 } 903 986 #endif 904 987 #endif 905 988 #if H_3D_DBBP 906 989 Void TEncEntropy::encodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncEntropy.h
r816 r827 95 95 #endif 96 96 #if H_3D_INTER_SDC 97 #if QC_SDC_UNIFY_G0130 98 virtual Void codeDeltaDC ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 99 virtual Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 100 #else 97 101 virtual Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 98 102 virtual Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0; 103 #endif 99 104 #endif 100 105 #if H_3D_DBBP … … 189 194 #endif 190 195 #if H_3D_INTER_SDC 196 #if QC_SDC_UNIFY_G0130 197 Void encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 198 Void encodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 199 #else 191 200 Void encodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 192 201 Void encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ); 202 #endif 193 203 #endif 194 204 #if H_3D_DBBP -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
r826 r827 93 93 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 94 94 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 95 #if QC_GENERIC_SDC_G0122 96 , m_cAngleFlagSCModel ( 1, 1, NUM_ANGLE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 97 #if !QC_SDC_UNIFY_G0130 98 , m_cIntraSdcFlagSCModel ( 1, 1, NUM_INTRASDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 99 #endif 100 #endif 95 101 #if H_3D_DIM_DMM 96 102 , m_cDmm1DataSCModel ( 1, 1, NUM_DMM1_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 101 107 #endif 102 108 #endif 103 #if H_3D_INTER_SDC 109 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 104 110 , m_cInterSDCFlagSCModel ( 1, 1, NUM_INTER_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 105 111 , m_cInterSDCResidualSCModel ( 1, 1, NUM_INTER_SDC_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 106 112 , m_cInterSDCResidualSignFlagSCModel ( 1, 1, NUM_INTER_SDC_SIGN_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 113 #endif 114 #if QC_SDC_UNIFY_G0130 115 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 116 #endif 108 117 #if H_3D_DBBP … … 171 180 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 172 181 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA ); 182 #if QC_GENERIC_SDC_G0122 183 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 184 #if !QC_SDC_UNIFY_G0130 185 m_cIntraSdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG ); 186 #endif 187 #endif 173 188 #if H_3D_DIM_DMM 174 189 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); … … 179 194 #endif 180 195 #endif 181 #if H_3D_INTER_SDC 196 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 182 197 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 183 198 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 184 199 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 200 #endif 201 #if QC_SDC_UNIFY_G0130 202 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 185 203 #endif 186 204 #if H_3D_DBBP … … 224 242 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 225 243 #endif 226 #if H_3D_INTER_SDC 244 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 227 245 curCost += m_cInterSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 228 246 curCost += m_cInterSDCResidualSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 229 247 curCost += m_cInterSDCResidualSignFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 248 #endif 249 #if QC_SDC_UNIFY_G0130 250 curCost += m_cSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SDC_FLAG ); 230 251 #endif 231 252 #if H_3D_DBBP … … 261 282 curCost += m_cDdcFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_FLAG ); 262 283 curCost += m_cDdcDataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_DATA ); 284 #if QC_GENERIC_SDC_G0122 285 curCost += m_cAngleFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 286 #if !QC_SDC_UNIFY_G0130 287 curCost += m_cIntraSdcFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTRASDC_FLAG ); 288 #endif 289 #endif 263 290 #if H_3D_DIM_DMM 264 291 curCost += m_cDmm1DataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM1_DATA ); … … 326 353 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 327 354 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA ); 355 #if QC_GENERIC_SDC_G0122 356 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 357 #if !QC_SDC_UNIFY_G0130 358 m_cIntraSdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG ); 359 #endif 360 #endif 328 361 #if H_3D_DIM_DMM 329 362 m_cDmm1DataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA ); … … 334 367 #endif 335 368 #endif 336 #if H_3D_INTER_SDC 369 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 337 370 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 338 371 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 339 372 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 373 #endif 374 #if QC_SDC_UNIFY_G0130 375 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 340 376 #endif 341 377 #if H_3D_DBBP … … 641 677 this->m_cDepthIntraModeSCModel .copyFrom( &pSrc->m_cDepthIntraModeSCModel ); 642 678 this->m_cDdcFlagSCModel .copyFrom( &pSrc->m_cDdcFlagSCModel ); 679 #if QC_GENERIC_SDC_G0122 680 this->m_cAngleFlagSCModel .copyFrom( &pSrc->m_cAngleFlagSCModel ); 681 #if !QC_SDC_UNIFY_G0130 682 this->m_cIntraSdcFlagSCModel .copyFrom( &pSrc->m_cIntraSdcFlagSCModel ); 683 #endif 684 #endif 643 685 } 644 686 #endif … … 1131 1173 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1132 1174 #if H_3D_DIM_SDC 1175 #if QC_GENERIC_SDC_G0122 1176 if( 1 ) 1177 #else 1133 1178 if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) ) 1179 #endif 1134 1180 #endif 1135 1181 { … … 1157 1203 if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1158 1204 #if H_3D_DIM_SDC 1205 #if QC_GENERIC_SDC_G0122 1206 if( 1 ) 1207 #else 1159 1208 if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) ) 1209 #endif 1160 1210 #endif 1161 1211 { … … 1256 1306 default: break; 1257 1307 } 1258 1308 #if !QC_SDC_UNIFY_G0130 1259 1309 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) ) 1260 1310 { 1261 1311 UInt dimDeltaDC; 1262 1312 Pel deltaDC; 1313 #if QC_GENERIC_SDC_G0122 1314 UInt uiNumSegments = isDimMode( dir ) ? 2 : 1; 1315 #else 1263 1316 UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2; 1317 #endif 1264 1318 if( pcCU->getSDCFlag( absPartIdx ) ) 1265 1319 { … … 1289 1343 } 1290 1344 } 1291 } 1292 1345 #endif 1346 } 1347 1348 #if QC_GENERIC_SDC_G0122 1349 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx ) 1350 { 1351 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 1352 1353 if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed 1354 { 1355 m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) ); 1356 } 1357 #if !QC_SDC_UNIFY_G0130 1358 if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case 1359 { 1360 m_pcBinIf->encodeBin( pcCU->getSDCFlag( absPartIdx ) ? 1 : 0, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) ); 1361 } 1362 #endif 1363 if( isDimMode( dir ) ) 1364 { 1365 UInt uiCodeIdx = 0; 1366 1367 switch( getDimType( dir ) ) 1368 { 1369 case DMM1_IDX: uiCodeIdx = 0; break; 1370 case DMM4_IDX: uiCodeIdx = 1; break; 1371 default: break; 1372 } 1373 //mode coding 1374 m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) ); 1375 } 1376 } 1377 #else 1293 1378 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx ) 1294 1379 { … … 1331 1416 } 1332 1417 } 1418 #endif 1333 1419 #endif 1334 1420 … … 2252 2338 2253 2339 #if H_3D_INTER_SDC 2340 #if QC_SDC_UNIFY_G0130 2341 Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx ) 2342 { 2343 if( !( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) ) 2344 { 2345 assert( 0 ); 2346 } 2347 2348 UInt uiNumSegments = 0; 2349 UInt dimDeltaDC = 0; 2350 2351 if( pcCU->isIntra( absPartIdx ) ) 2352 { 2353 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2354 uiNumSegments = isDimMode( dir ) ? 2 : 1; 2355 2356 if( pcCU->getSDCFlag( absPartIdx ) ) 2357 { 2358 if( uiNumSegments == 1 ) 2359 { 2360 dimDeltaDC = pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) ? 1 : 0; 2361 } 2362 else 2363 { 2364 dimDeltaDC = ( pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) || pcCU->getSDCSegmentDCOffset( 1, absPartIdx ) ) ? 1 : 0; 2365 } 2366 } 2367 else 2368 { 2369 dimDeltaDC = isDimDeltaDC( dir ); 2370 } 2371 2372 m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) ); 2373 } 2374 else //all-zero inter SDC is not allowed 2375 { 2376 #if SEC_INTER_SDC_G0101 2377 uiNumSegments = 1; 2378 #else 2379 PartSize cPartSize = pcCU->getPartitionSize( absPartIdx ); 2380 uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 ); 2381 #endif 2382 dimDeltaDC = 1; 2383 } 2384 2385 if( dimDeltaDC ) 2386 { 2387 for( UInt segment = 0; segment < uiNumSegments; segment++ ) 2388 { 2389 Pel deltaDC = 0; 2390 2391 if( pcCU->isIntra( absPartIdx ) ) 2392 { 2393 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2394 deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset( segment, absPartIdx ) : pcCU->getDimDeltaDC( getDimType( dir ), segment, absPartIdx ); 2395 } 2396 else 2397 { 2398 deltaDC = pcCU->getSDCSegmentDCOffset( segment, absPartIdx ); 2399 } 2400 2401 xCodeDimDeltaDC( deltaDC, uiNumSegments ); 2402 } 2403 } 2404 } 2405 2406 Void TEncSbac::codeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2407 { 2408 UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0; 2409 UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx ); 2410 2411 m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) ); 2412 } 2413 #else 2254 2414 Void TEncSbac::codeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2255 2415 { … … 2273 2433 } 2274 2434 #endif 2435 #endif 2275 2436 2276 2437 #if H_3D_DBBP -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncSbac.h
r816 r827 154 154 #endif 155 155 #if H_3D_INTER_SDC 156 #if QC_SDC_UNIFY_G0130 157 Void codeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 158 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 159 #else 156 160 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 157 161 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 162 #endif 158 163 #endif 159 164 #if H_3D_DBBP … … 250 255 ContextModel3DBuffer m_cDdcFlagSCModel; 251 256 ContextModel3DBuffer m_cDdcDataSCModel; 257 #if QC_GENERIC_SDC_G0122 258 ContextModel3DBuffer m_cAngleFlagSCModel; 259 #if !QC_SDC_UNIFY_G0130 260 ContextModel3DBuffer m_cIntraSdcFlagSCModel; 261 #endif 262 #endif 252 263 #if H_3D_DIM_DMM 253 264 ContextModel3DBuffer m_cDmm1DataSCModel; … … 258 269 #endif 259 270 #endif 260 #if H_3D_INTER_SDC 271 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 261 272 ContextModel3DBuffer m_cInterSDCFlagSCModel; 262 273 ContextModel3DBuffer m_cInterSDCResidualSCModel; 263 274 ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel; 264 275 #endif 276 #if QC_SDC_UNIFY_G0130 277 ContextModel3DBuffer m_cSDCFlagSCModel; 278 #endif 265 279 #if H_3D_DBBP 266 280 ContextModel3DBuffer m_cDBBPFlagSCModel; -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r826 r827 922 922 m_pcEntropyCoder ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 923 923 924 #if QC_SDC_UNIFY_G0130 925 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 926 #endif 924 927 if (pcCU->isIntra(0) && pcCU->getPartitionSize(0) == SIZE_2Nx2N ) 925 928 { … … 938 941 { 939 942 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 ); 943 #if QC_SDC_UNIFY_G0130_FIX 944 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && getDimType( pcCU->getLumaIntraDir( 0 ) ) < DIM_NUM_TYPE ) 945 { 946 m_pcEntropyCoder->encodeDeltaDC( pcCU, 0 ); 947 } 948 #endif 940 949 } 941 950 } … … 949 958 { 950 959 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPart * uiQNumParts ); 960 #if QC_SDC_UNIFY_G0130_FIX 961 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && getDimType( pcCU->getLumaIntraDir( uiPart * uiQNumParts ) ) < DIM_NUM_TYPE ) 962 { 963 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiPart * uiQNumParts ); 964 } 965 #endif 951 966 } 952 967 } … … 954 969 { 955 970 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx ); 956 } 957 } 971 #if QC_SDC_UNIFY_G0130_FIX 972 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) < DIM_NUM_TYPE ) 973 { 974 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx ); 975 } 976 #endif 977 } 978 } 979 #if QC_SDC_UNIFY_G0130 && !QC_SDC_UNIFY_G0130_FIX 980 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 981 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 982 983 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 984 { 985 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 986 { 987 if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 988 { 989 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart ); 990 } 991 } 992 } 993 #endif 958 994 } 959 995 if( bChroma ) … … 1862 1898 1863 1899 #if H_3D_DIM_SDC 1864 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual ) 1900 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, 1901 #if QC_GENERIC_SDC_G0122 1902 Bool bZeroResidual, Int iSDCDeltaResi 1903 #else 1904 Bool bResidual 1905 #endif 1906 ) 1865 1907 { 1866 1908 UInt uiLumaPredMode = pcCU ->getLumaIntraDir( uiAbsPartIdx ); 1867 1909 UInt uiWidth = pcCU ->getWidth ( 0 ); 1868 1910 UInt uiHeight = pcCU ->getHeight ( 0 ); 1911 #if QC_PKU_SDC_SPLIT_G0123 1912 #if HS_TSINGHUA_SDC_SPLIT_G0111 1913 #if QC_GENERIC_SDC_G0122 1914 TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight ); 1915 #endif 1916 #else 1917 #if QC_GENERIC_SDC_G0122 1918 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 1919 #endif 1920 #endif 1921 #endif 1922 #if QC_PKU_SDC_SPLIT_G0123 1923 UInt numParts = 1; 1924 UInt i = 0; 1925 UInt sdcDepth = 0; 1926 UInt uiStride; 1927 Pel* piOrg; 1928 Pel* piPred; 1929 Pel* piReco; 1930 1931 UInt uiZOrder; 1932 Pel* piRecIPred; 1933 UInt uiRecIPredStride; 1934 1935 #if HS_TSINGHUA_SDC_SPLIT_G0111 1936 if ( ( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1 ) 1937 { 1938 numParts = uiWidth * uiWidth >> ( 2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ); 1939 sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize(); 1940 uiWidth = uiHeight = ( 1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ); 1941 } 1942 #else 1943 if (uiWidth == 64) 1944 { 1945 numParts = 4; 1946 sdcDepth = 1; 1947 uiWidth = uiHeight = 32; 1948 } 1949 #endif 1950 1951 for ( i = 0; i < numParts; i++ ) 1952 { 1953 uiStride = pcOrgYuv ->getStride (); 1954 piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx ); 1955 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1956 piReco = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1957 1958 uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 1959 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 1960 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 1961 1962 AOF( uiWidth == uiHeight ); 1963 #else 1869 1964 UInt uiStride = pcOrgYuv ->getStride (); 1870 1965 Pel* piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx ); … … 1880 1975 AOF( pcCU->getSDCAvailable(uiAbsPartIdx) ); 1881 1976 AOF( pcCU->getSDCFlag(uiAbsPartIdx) ); 1977 #endif 1978 #if !QC_GENERIC_SDC_G0122 1882 1979 AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) ); 1883 1980 AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || uiWidth < 64 ); 1981 #endif 1884 1982 1885 1983 //===== init availability pattern ===== 1886 1984 Bool bAboveAvail = false; 1887 1985 Bool bLeftAvail = false; 1986 #if QC_PKU_SDC_SPLIT_G0123 1987 pcCU->getPattern()->initPattern ( pcCU, sdcDepth, uiAbsPartIdx ); 1988 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 1989 #else 1888 1990 pcCU->getPattern()->initPattern ( pcCU, 0, uiAbsPartIdx ); 1889 1991 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 1890 1992 1993 #endif 1994 #if !QC_PKU_SDC_SPLIT_G0123 1995 #if QC_GENERIC_SDC_G0122 1996 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 1997 #endif 1998 #endif 1999 #if HS_TSINGHUA_SDC_SPLIT_G0111 2000 #if QC_GENERIC_SDC_G0122 2001 TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight ); 2002 #endif 2003 #endif 1891 2004 //===== get prediction signal ===== 1892 2005 #if H_3D_DIM 1893 2006 if( isDimMode( uiLumaPredMode ) ) 1894 2007 { 1895 predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true ); 2008 #if HS_TSINGHUA_SDC_SPLIT_G0111 2009 UInt dimType = getDimType ( uiLumaPredMode ); 2010 UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx); 2011 if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiWidth]].size() && dimType == DMM1_IDX ) 2012 { 2013 if (g_aucConvertToBit[uiWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used. 2014 patternID = 1349; // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x16 2015 else 2016 patternID = patternID >> 1; // Other cases 2017 pcCU->setDmmWedgeTabIdx(dimType, uiAbsPartIdx, patternID); 2018 } 2019 #endif 2020 predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true 2021 #if QC_GENERIC_SDC_G0122 2022 , dmm4Segmentation 2023 #endif 2024 ); 2025 #if HS_TSINGHUA_SDC_SPLIT_G0111 2026 Bool* dmm4PatternSplit = dmm4Segmentation->getPattern(); 2027 Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern(); 2028 for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 2029 { 2030 dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k]; 2031 } 2032 #endif 1896 2033 } 1897 2034 else … … 1902 2039 } 1903 2040 #endif 1904 2041 #if QC_PKU_SDC_SPLIT_G0123 2042 if ( numParts > 1 ) 2043 { 2044 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 2045 { 2046 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 2047 { 2048 piPred [ uiX ] = ClipY( piPred[ uiX ] ); 2049 piRecIPred [ uiX ] = piPred[ uiX ]; 2050 } 2051 piPred += uiStride; 2052 piRecIPred += uiRecIPredStride; 2053 } 2054 } 2055 uiAbsPartIdx += ( ( uiWidth * uiWidth ) >> 4 ); 2056 #if HS_TSINGHUA_SDC_SPLIT_G0111 2057 dmm4Segmentation->destroy(); delete dmm4Segmentation; 2058 #endif 2059 } 2060 uiAbsPartIdx = 0; 2061 uiStride = pcOrgYuv ->getStride (); 2062 piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx ); 2063 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 2064 piReco = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 2065 2066 uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 2067 piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 2068 uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 2069 2070 if (numParts > 1) 2071 { 2072 uiWidth = pcCU->getWidth( 0 ); 2073 uiHeight = pcCU->getHeight( 0 ); 2074 } 2075 #endif 1905 2076 // number of segments depends on prediction mode 1906 2077 UInt uiNumSegments = 1; … … 1919 2090 uiMaskStride = pcWedgelet->getStride(); 1920 2091 } 2092 #if QC_GENERIC_SDC_G0122 2093 if( getDimType( uiLumaPredMode ) == DMM4_IDX ) 2094 { 2095 uiNumSegments = 2; 2096 #if HS_TSINGHUA_SDC_SPLIT_G0111 2097 pbMask = dmm4SegmentationOrg->getPattern(); 2098 uiMaskStride = dmm4SegmentationOrg->getStride(); 2099 #else 2100 pbMask = dmm4Segmentation->getPattern(); 2101 uiMaskStride = dmm4Segmentation->getStride(); 2102 #endif 2103 } 2104 #endif 1921 2105 1922 2106 // get DC prediction for each segment … … 1931 2115 { 1932 2116 // remap reconstructed value to valid depth values 2117 #if QC_GENERIC_SDC_G0122 2118 Pel pDCRec = ( !bZeroResidual ) ? apDCOrigValues[uiSegment] : apDCPredValues[uiSegment]; 2119 #else 1933 2120 Pel pDCRec = bResidual?apDCOrigValues[uiSegment]:apDCPredValues[uiSegment]; 1934 2121 #endif 1935 2122 // get residual (idx) 1936 2123 #if H_3D_DIM_DLT … … 1939 2126 Pel pResidualIdx = pDCRec - apDCPredValues[uiSegment]; 1940 2127 #endif 1941 2128 #if QC_GENERIC_SDC_G0122 2129 if( !bZeroResidual ) 2130 { 2131 Pel pPredIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 2132 Int pTestIdx = pPredIdx + pResidualIdx + iSDCDeltaResi; 2133 if( pTestIdx >= 0 && pTestIdx < pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) ) 2134 { 2135 pResidualIdx += iSDCDeltaResi; 2136 } 2137 } 2138 #endif 1942 2139 // save SDC DC offset 1943 2140 pcCU->setSDCSegmentDCOffset(pResidualIdx, uiSegment, uiAbsPartIdx); … … 2012 2209 2013 2210 // encode reduced intra header 2211 #if QC_SDC_UNIFY_G0130 2212 if( !pcCU->getSlice()->isIntra() ) 2213 { 2214 if (pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 2215 { 2216 m_pcEntropyCoder->encodeCUTransquantBypassFlag( pcCU, 0, true ); 2217 } 2218 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 2219 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 2220 } 2221 2222 m_pcEntropyCoder->encodePartSize( pcCU, 0, true ); 2223 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 2224 #else 2014 2225 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 2226 #endif 2015 2227 2016 2228 // encode pred direction + DC residual data 2017 2229 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 2230 #if QC_SDC_UNIFY_G0130 2231 Bool bDummy = false; 2232 m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy ); 2233 #endif 2018 2234 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 2019 2235 … … 2024 2240 #endif 2025 2241 dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist ); 2242 #if QC_GENERIC_SDC_G0122 2243 #if HS_TSINGHUA_SDC_SPLIT_G0111 2244 dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg; 2245 #else 2246 dmm4Segmentation->destroy(); delete dmm4Segmentation; 2247 #endif 2248 #endif 2026 2249 } 2027 2250 #endif … … 2901 3124 case( DMM4_IDX ): 2902 3125 { 3126 #if !QC_GENERIC_SDC_G0122 2903 3127 if( uiWidth > 4 ) 3128 #endif 2904 3129 { 2905 3130 biSegmentation = new TComWedgelet( uiWidth, uiHeight ); … … 2957 3182 { 2958 3183 pcCU->setSDCFlagSubParts( (uiSDC != 0), uiPartOffset, uiDepth + uiInitTrDepth ); 3184 #if QC_GENERIC_SDC_G0122 3185 for( Int iSDCDeltaResi = -2; iSDCDeltaResi <= 2; iSDCDeltaResi++ ) 3186 { 3187 if( ( uiSDC == 0 ) && iSDCDeltaResi != 0 ) 3188 { 3189 continue; 3190 } 3191 #endif 2959 3192 #endif 2960 3193 … … 2966 3199 #if H_3D_DIM_SDC 2967 3200 bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset); 3201 #endif 3202 #if QC_GENERIC_SDC_G0122 3203 if( uiSDC != 0 && iSDCDeltaResi != 0 ) 3204 { 3205 bTestZeroResi = false; 3206 } 2968 3207 #endif 2969 3208 #endif … … 3000 3239 3001 3240 // start encoding with SDC 3241 #if QC_GENERIC_SDC_G0122 3242 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi ); 3243 #else 3002 3244 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, (testZeroResi!=0)); 3245 #endif 3003 3246 } 3004 3247 else … … 3073 3316 #if H_3D_DIM_ENC || H_3D_DIM_SDC 3074 3317 } 3318 #endif 3319 #if QC_GENERIC_SDC_G0122 3320 } // SDC residual loop 3075 3321 #endif 3076 3322 #if H_3D_DIM_SDC … … 5746 5992 5747 5993 #if H_3D_INTER_SDC 5994 #if SEC_INTER_SDC_G0101 5995 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, Int uiOffest, const UInt uiDepth ) 5996 #else 5748 5997 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, const UInt uiDepth ) 5998 #endif 5749 5999 { 5750 6000 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( 0 ) ) … … 5752 6002 return; 5753 6003 } 5754 6004 #if QC_SDC_UNIFY_G0130 6005 pcCU->setSDCFlagSubParts( true, 0, uiDepth ); 6006 #else 5755 6007 pcCU->setInterSDCFlagSubParts( true, 0, 0, uiDepth ); 6008 #endif 5756 6009 5757 6010 UInt uiWidth = pcCU->getWidth ( 0 ); 5758 6011 UInt uiHeight = pcCU->getHeight( 0 ); 6012 #if SEC_INTER_SDC_G0101 6013 UInt uiSegSize = 0; 6014 #else 5759 6015 UChar* pMask = pcCU->getInterSDCMask(); 5760 6016 memset( pMask, 0, uiWidth*uiHeight ); … … 5763 6019 5764 6020 UInt uiSegSize[4] = { 0, 0, 0, 0 }; 6021 #endif 5765 6022 Pel *pPred, *pOrg; 5766 6023 UInt uiPredStride = pcPred->getStride(); 5767 6024 UInt uiOrgStride = pcOrg->getStride(); 5768 6025 UInt uiPelX, uiPelY; 6026 #if !SEC_INTER_SDC_G0101 5769 6027 UInt uiPartitionSize = pcCU->getPartitionSize( 0 ); 5770 6028 UInt uiSegmentNum = ( uiPartitionSize == SIZE_2Nx2N ) ? 1 : ( uiPartitionSize == SIZE_NxN ? 4 : 2 ); 6029 #endif 5771 6030 5772 6031 pPred = pcPred->getLumaAddr( 0 ); 5773 6032 pOrg = pcOrg->getLumaAddr( 0 ); 6033 #if SEC_INTER_SDC_G0101 6034 Int pResDC = 0; 6035 #else 5774 6036 Int pResDC[4] = { 0, 0, 0, 0}; 6037 #endif 5775 6038 5776 6039 //calculate dc value for prediction and original signal, and calculate residual and reconstruction … … 5779 6042 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 5780 6043 { 6044 #if SEC_INTER_SDC_G0101 6045 pResDC += (Int)( pOrg [uiPelX] - pPred[uiPelX] ); 6046 uiSegSize++; 6047 #else 5781 6048 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 5782 6049 pResDC[uiSeg] += (Int)( pOrg [uiPelX] - pPred[uiPelX] ); 5783 6050 uiSegSize[uiSeg]++; 6051 #endif 5784 6052 } 5785 6053 pOrg += uiOrgStride; … … 5787 6055 } 5788 6056 6057 #if SEC_INTER_SDC_G0101 6058 Int iResiOffset = ( pResDC > 0 ? ( uiSegSize >> 1 ) : -1*( uiSegSize >> 1 ) ); 6059 pResDC = ( pResDC + iResiOffset ) / (Int) uiSegSize; 6060 6061 pcCU->setSDCSegmentDCOffset( pResDC + uiOffest, 0, 0 ); 6062 #else 5789 6063 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ ) 5790 6064 { 5791 6065 Int iResiOffset = ( pResDC [uiSeg] > 0 ? ( uiSegSize[uiSeg] >> 1 ) : -1*( uiSegSize[uiSeg] >> 1 ) ); 5792 6066 pResDC [uiSeg] = ( pResDC [uiSeg] + iResiOffset ) / (Int) uiSegSize[uiSeg]; 5793 6067 #if QC_SDC_UNIFY_G0130 6068 pcCU->setSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 ); 6069 #else 5794 6070 pcCU->setInterSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 ); 5795 } 6071 #endif 6072 } 6073 #endif 5796 6074 5797 6075 Pel *pRec; … … 5804 6082 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 5805 6083 { 6084 #if SEC_INTER_SDC_G0101 6085 pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pcCU->getSDCSegmentDCOffset(0, 0) ); 6086 #else 5806 6087 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 5807 6088 assert( uiSeg < uiSegmentNum ); 5808 6089 5809 6090 pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pResDC[uiSeg] ); 6091 #endif 5810 6092 } 5811 6093 pPred += uiPredStride; … … 5847 6129 #endif 5848 6130 6131 #if QC_SDC_UNIFY_G0130 6132 Bool bNonSkip = false; 6133 #else 5849 6134 Bool bNonSkip = true; 6135 #endif 6136 #if SEC_INTER_SDC_G0101 6137 bNonSkip |= ( pcCU->getSDCSegmentDCOffset( 0, 0 ) != 0 ) ? 1 : 0; 6138 #else 5850 6139 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ ) 5851 6140 { 6141 #if QC_SDC_UNIFY_G0130 6142 bNonSkip |= ( pcCU->getSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0; 6143 #else 5852 6144 bNonSkip &= ( pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0; 5853 } 6145 #endif 6146 } 6147 #endif 5854 6148 5855 6149 if( !bNonSkip ) … … 7068 7362 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 7069 7363 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 7364 #if QC_SDC_UNIFY_G0130 7365 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 7366 #endif 7070 7367 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 7071 7368 #if !SEC_IC_ARP_SIG_G0072 … … 7082 7379 #endif 7083 7380 #endif 7084 #if H_3D_INTER_SDC 7381 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 7085 7382 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, 0, true ); 7086 7383 #endif -
branches/HTM-9.3-dev0/source/Lib/TLibEncoder/TEncSearch.h
r773 r827 219 219 TComYuv* pcResi, 220 220 TComYuv* pcRec, 221 #if SEC_INTER_SDC_G0101 222 Int uiOffset, 223 #endif 221 224 const UInt uiDepth ); 222 225 #endif … … 353 356 #endif 354 357 #if H_3D_DIM_SDC 355 Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual ); 358 Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, 359 #if QC_GENERIC_SDC_G0122 360 Bool bZeroResidual, Int iSDCDeltaResi 361 #else 362 Bool bResidual 363 #endif 364 ); 356 365 #endif 357 366 #endif
Note: See TracChangeset for help on using the changeset viewer.