Changeset 571 in 3DVCSoftware
- Timestamp:
- 14 Aug 2013, 10:39:58 (11 years ago)
- Location:
- branches/HTM-DEV-2.0-dev2-LG
- Files:
-
- 8 added
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-2.0-dev2-LG/cfg/3D-HEVC/baseCfg_2view+depth.cfg
r539 r571 209 209 QTL : 1 210 210 PC : 1 211 InterSDC : 1 # use of inter sdc 211 212 212 213 #========== view synthesis optimization (VSO) ========== -
branches/HTM-DEV-2.0-dev2-LG/cfg/3D-HEVC/baseCfg_3view+depth.cfg
r539 r571 241 241 QTL : 1 242 242 PC : 1 243 InterSDC : 1 # use of inter sdc 243 244 244 245 #========== view synthesis optimization (VSO) ========== -
branches/HTM-DEV-2.0-dev2-LG/cfg/3D-HEVC/fullCfg.cfg
r539 r571 245 245 QTL : 1 246 246 PC : 1 247 InterSDC : 1 # use of inter sdc 247 248 248 249 #========== view synthesis optimization (VSO) ========== -
branches/HTM-DEV-2.0-dev2-LG/source/App/TAppEncoder/TAppEncCfg.cpp
r542 r571 505 505 #if H_3D_IC 506 506 ("IlluCompEnable", m_abUseIC, std::vector<Bool>(2, true), "Enable illumination compensation") 507 #endif 508 #if LGE_INTER_SDC_E0156 509 ("InterSDC", m_bDepthInterSDCFlag, true, "Enable depth inter SDC") 507 510 #endif 508 511 // Coding tools … … 2289 2292 printf("DLT:%d ", m_useDLT ); 2290 2293 #endif 2294 #if LGE_INTER_SDC_E0156 2295 printf( "interSDC: %d ", m_bDepthInterSDCFlag ? 1 : 0 ); 2296 #endif 2291 2297 printf("\n\n"); 2292 2298 -
branches/HTM-DEV-2.0-dev2-LG/source/App/TAppEncoder/TAppEncCfg.h
r539 r571 432 432 Bool m_bUsePC; ///< flag for using Predictive Coding with QTL 433 433 #endif 434 #if LGE_INTER_SDC_E0156 435 Bool m_bDepthInterSDCFlag; ///< flag for inter SDC of depth map coding 436 #endif 434 437 #endif 435 438 // internal member functions -
branches/HTM-DEV-2.0-dev2-LG/source/App/TAppEncoder/TAppEncTop.cpp
r542 r571 187 187 m_cTEncTop.setUseQTL ( isDepth ? m_bUseQTL : false ); 188 188 m_cTEncTop.setUsePC ( isDepth ? m_bUsePC : false ); 189 #endif 190 //====== Depth Inter SDC ========= 191 #if LGE_INTER_SDC_E0156 192 m_cTEncTop.setInterSDCEnable ( isDepth ? m_bDepthInterSDCFlag : false ); 189 193 #endif 190 194 #endif // H_3D … … 1224 1228 #if H_3D_VSP 1225 1229 vps.setViewSynthesisPredFlag( layer, !isLayerZero && !isDepth && m_viewSynthesisPredFlag ); 1226 #endif 1230 #endif 1231 #if LGE_INTER_SDC_E0156 1232 vps.setInterSDCFlag( layer, !isLayerZero && isDepth && m_bDepthInterSDCFlag ); 1233 #endif 1227 1234 } 1228 1235 #if H_3D_TMVP -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/ContextTables.h
r531 r571 124 124 #define SDC_NUM_RESIDUAL_CTX 1 125 125 #endif 126 127 #if LGE_INTER_SDC_E0156 128 #define NUM_INTER_SDC_FLAG_CTX 1 ///< number of context models for inter SDC flag 129 #define NUM_INTER_SDC_SIGN_FLAG_CTX 1 ///< number of context models for sign of inter SDC residual 130 #define NUM_INTER_SDC_RESIDUAL_CTX 1 ///< number of context models for abs of inter SDC residual 131 #endif 126 132 // ==================================================================================================================== 127 133 // Tables … … 453 459 #endif 454 460 461 #if LGE_INTER_SDC_E0156 462 static const UChar 463 INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] = 464 { 465 { CNU }, 466 { 154 }, 467 { 154 }, 468 }; 469 470 static const UChar 471 INIT_INTER_SDC_SIGN_FLAG[3][NUM_INTER_SDC_SIGN_FLAG_CTX] = 472 { 473 { CNU }, 474 { 154 }, 475 { 154 }, 476 }; 477 478 static const UChar 479 INIT_INTER_SDC_RESIDUAL[3][NUM_INTER_SDC_RESIDUAL_CTX] = 480 { 481 { CNU }, 482 { 154 }, 483 { 154 }, 484 }; 485 #endif 455 486 //! \} 456 487 -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComDataCU.cpp
r564 r571 151 151 m_pbICFlag = NULL; 152 152 #endif 153 #if LGE_INTER_SDC_E0156 154 m_pbInterSDCFlag = NULL; 155 for( Int i = 0; i < 4; i++ ) 156 { 157 m_apSegmentInterDCOffset[i] = NULL; 158 } 159 m_pucInterSDCMask = NULL; 160 #endif 153 161 } 154 162 … … 280 288 #endif 281 289 #endif 290 #if LGE_INTER_SDC_E0156 291 m_pbInterSDCFlag = (Bool* )xMalloc(Bool, uiNumPartition); 292 for( Int i = 0; i < 4; i++ ) 293 m_apSegmentInterDCOffset[i] = (Int*)xMalloc(Int, uiNumPartition); 294 #endif 282 295 } 283 296 else … … 286 299 m_acCUMvField[1].setNumPartition(uiNumPartition ); 287 300 } 288 301 #if LGE_INTER_SDC_E0156 302 m_pucInterSDCMask = (UChar* )xMalloc(UChar, g_uiMaxCUHeight*g_uiMaxCUWidth); 303 #endif 289 304 m_sliceStartCU = (UInt* )xMalloc(UInt, uiNumPartition); 290 305 m_sliceSegmentStartCU = (UInt* )xMalloc(UInt, uiNumPartition); … … 405 420 #endif 406 421 #endif 407 } 408 422 #if LGE_INTER_SDC_E0156 423 if ( m_pbInterSDCFlag ) { xFree(m_pbInterSDCFlag); m_pbInterSDCFlag = NULL; } 424 for(Int i = 0; i < 4; i++ ) 425 { 426 if ( m_apSegmentInterDCOffset[i] ) { xFree( m_apSegmentInterDCOffset[i] ); m_apSegmentInterDCOffset[i] = NULL; } 427 } 428 #endif 429 } 430 #if LGE_INTER_SDC_E0156 431 if ( m_pucInterSDCMask ) { xFree(m_pucInterSDCMask); m_pucInterSDCMask = NULL; } 432 #endif 409 433 m_pcCUAboveLeft = NULL; 410 434 m_pcCUAboveRight = NULL; … … 542 566 #if H_3D_DIM_SDC 543 567 m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui]; 568 #endif 569 #if LGE_INTER_SDC_E0156 570 m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui]; 544 571 #endif 545 572 } … … 611 638 memset( m_apSegmentDCOffset[1] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[1] ) ); 612 639 #endif 640 #endif 641 #if LGE_INTER_SDC_E0156 642 memset( m_pbInterSDCFlag + firstElement, 0, numElements * sizeof( *m_pbInterSDCFlag ) ); 643 for( Int i = 0; i < 4; i++ ) 644 { 645 memset( m_apSegmentInterDCOffset[i] + firstElement, 0, numElements * sizeof( *m_apSegmentInterDCOffset[i] ) ); 646 } 613 647 #endif 614 648 } … … 776 810 #endif 777 811 #endif 812 #if LGE_INTER_SDC_E0156 813 m_pbInterSDCFlag[ui] = false; 814 for( Int i = 0; i < 4; i++ ) 815 { 816 m_apSegmentInterDCOffset[i][ui] = 0; 817 } 818 #endif 778 819 } 779 820 } … … 887 928 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition ); 888 929 #endif 930 #endif 931 #if LGE_INTER_SDC_E0156 932 memset( m_pbInterSDCFlag, 0, sizeof( Bool ) * m_uiNumPartition ); 933 for( Int i = 0; i < 4; i++ ) 934 { 935 memset( m_apSegmentInterDCOffset[i], 0, sizeof( Int ) * m_uiNumPartition ); 936 } 889 937 #endif 890 938 … … 956 1004 #endif 957 1005 #endif 1006 #if LGE_INTER_SDC_E0156 1007 m_pbInterSDCFlag [ui] = pcCU->m_pbInterSDCFlag [ uiPartOffset + ui ]; 1008 for( Int i = 0; i < 4; i++ ) 1009 { 1010 m_apSegmentInterDCOffset[i][ui] = pcCU->m_apSegmentInterDCOffset[i][ uiPartOffset + ui ]; 1011 } 1012 #endif 958 1013 } 959 1014 } … … 1111 1166 #endif 1112 1167 #endif 1168 #if LGE_INTER_SDC_E0156 1169 m_pbInterSDCFlag = pcCU->getInterSDCFlag() + uiPart; 1170 for( Int i = 0; i < 4; i++ ) 1171 { 1172 m_apSegmentInterDCOffset[i] = pcCU->getInterSDCSegmentDCOffset( i ) + uiPart; 1173 } 1174 #endif 1113 1175 m_puhDepth=pcCU->getDepth() + uiPart; 1114 1176 m_puhWidth=pcCU->getWidth() + uiPart; … … 1298 1360 #endif 1299 1361 #endif 1362 #if LGE_INTER_SDC_E0156 1363 memcpy( m_pbInterSDCFlag + uiOffset, pcCU->getInterSDCFlag(), iSizeInBool ); 1364 for( Int i = 0; i < 4; i++ ) 1365 { 1366 memcpy( m_apSegmentInterDCOffset[i] + uiOffset, pcCU->getInterSDCSegmentDCOffset( i ), sizeof( Int ) * uiNumPartition); 1367 } 1368 #endif 1300 1369 1301 1370 memcpy( m_puhDepth + uiOffset, pcCU->getDepth(), iSizeInUchar ); … … 1417 1486 memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition); 1418 1487 #endif 1488 #endif 1489 #if LGE_INTER_SDC_E0156 1490 memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag, iSizeInBool ); 1491 for( Int i = 0;i < 4; i++ ) 1492 { 1493 memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + m_uiAbsIdxInLCU, m_apSegmentInterDCOffset[i], sizeof( Int ) * m_uiNumPartition); 1494 } 1419 1495 #endif 1420 1496 memcpy( rpcCU->getDepth() + m_uiAbsIdxInLCU, m_puhDepth, iSizeInUchar ); … … 1525 1601 #endif 1526 1602 #endif 1603 #if LGE_INTER_SDC_E0156 1604 memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag, iSizeInBool ); 1605 for( Int i = 0; i < 4; i++ ) 1606 { 1607 memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + uiPartOffset, m_apSegmentInterDCOffset[i], sizeof( Int ) * uiQNumPart); 1608 } 1609 #endif 1527 1610 memcpy( rpcCU->getDepth() + uiPartOffset, m_puhDepth, iSizeInUchar ); 1528 1611 memcpy( rpcCU->getWidth() + uiPartOffset, m_puhWidth, iSizeInUchar ); … … 2238 2321 } 2239 2322 #endif 2323 2324 #if LGE_INTER_SDC_E0156 2325 Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2326 { 2327 setSubPart( bInterSDCFlag, m_pbInterSDCFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 2328 } 2329 2330 UInt TComDataCU::getCtxInterSDCFlag( UInt uiAbsPartIdx ) 2331 { 2332 return 0; 2333 } 2334 2335 Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask ) 2336 { 2337 UInt uiWidth = pcCU->getWidth ( 0 ); 2338 UInt uiHeight = pcCU->getHeight( 0 ); 2339 UInt uiPartitionSize = pcCU->getPartitionSize( 0 ); 2340 UInt uiXOffset = 0, uiYOffset = 0; 2341 2342 switch( uiPartitionSize ) 2343 { 2344 case SIZE_2NxN: 2345 uiXOffset = uiWidth; uiYOffset = uiHeight >> 1; break; 2346 case SIZE_2NxnU: 2347 uiXOffset = uiWidth; uiYOffset = uiHeight >> 2; break; 2348 case SIZE_2NxnD: 2349 uiXOffset = uiWidth; uiYOffset = ( uiHeight >> 1 ) + ( uiHeight >> 2 ); break; 2350 case SIZE_Nx2N: 2351 uiXOffset = uiWidth >> 1; uiYOffset = uiHeight; break; 2352 case SIZE_nLx2N: 2353 uiXOffset = uiWidth >> 2; uiYOffset = uiHeight; break; 2354 case SIZE_nRx2N: 2355 uiXOffset = ( uiWidth >> 1 ) + ( uiWidth >> 2 ); uiYOffset = uiHeight; break; 2356 case SIZE_NxN: 2357 uiXOffset = uiWidth >> 1; uiYOffset = uiHeight >> 1; break; 2358 default: 2359 assert( uiPartitionSize == SIZE_2Nx2N ); 2360 uiXOffset = uiWidth; uiYOffset = uiHeight; break; 2361 } 2362 2363 UInt uiPelX, uiPelY; 2364 2365 memset( pMask, 0, uiWidth*uiHeight ); 2366 2367 //mask 2368 if( uiPartitionSize == SIZE_2NxN || uiPartitionSize == SIZE_2NxnD || uiPartitionSize == SIZE_2NxnU ) 2369 { 2370 for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ ) 2371 { 2372 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 2373 { 2374 pMask[uiPelX + uiPelY*uiWidth] = 0; 2375 } 2376 } 2377 2378 for( ; uiPelY < uiHeight; uiPelY++ ) 2379 { 2380 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 2381 { 2382 pMask[uiPelX + uiPelY*uiWidth] = 1; 2383 } 2384 } 2385 } 2386 else if( uiPartitionSize == SIZE_Nx2N || uiPartitionSize == SIZE_nLx2N || uiPartitionSize == SIZE_nRx2N ) 2387 { 2388 for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ ) 2389 { 2390 for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ ) 2391 { 2392 pMask[uiPelX + uiPelY*uiWidth] = 0; 2393 } 2394 2395 for( ; uiPelX < uiWidth; uiPelX++ ) 2396 { 2397 pMask[uiPelX + uiPelY*uiWidth] = 1; 2398 } 2399 } 2400 } 2401 else if( uiPartitionSize == SIZE_NxN ) 2402 { 2403 for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ ) 2404 { 2405 for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ ) 2406 { 2407 pMask[uiPelX + uiPelY*uiWidth] = 0; 2408 } 2409 2410 for( ; uiPelX < uiWidth; uiPelX++ ) 2411 { 2412 pMask[uiPelX + uiPelY*uiWidth] = 1; 2413 } 2414 } 2415 2416 for( ; uiPelY < uiHeight; uiPelY++ ) 2417 { 2418 for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ ) 2419 { 2420 pMask[uiPelX + uiPelY*uiWidth] = 2; 2421 } 2422 2423 for( ; uiPelX < uiWidth; uiPelX++ ) 2424 { 2425 pMask[uiPelX + uiPelY*uiWidth] = 3; 2426 } 2427 } 2428 } 2429 2430 } 2431 #endif 2432 2240 2433 UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx ) 2241 2434 { -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComDataCU.h
r564 r571 223 223 #endif 224 224 #endif 225 #if LGE_INTER_SDC_E0156 226 Bool* m_pbInterSDCFlag; 227 Int* m_apSegmentInterDCOffset[4]; 228 UChar* m_pucInterSDCMask; 229 #endif 225 230 226 231 // ------------------------------------------------------------------------------------------------------------------- … … 565 570 Void setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; } 566 571 #endif 572 #endif 573 #if LGE_INTER_SDC_E0156 574 Bool* getInterSDCFlag () { return m_pbInterSDCFlag; } 575 Bool getInterSDCFlag ( UInt uiIdx ) { return m_pbInterSDCFlag[uiIdx]; } 576 Void setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 577 UInt getCtxInterSDCFlag ( UInt uiAbsPartIdx ); 578 Int* getInterSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentInterDCOffset[uiSeg]; } 579 Int getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; } 580 Void setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; } 581 582 Void xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask ); 583 584 UChar* getInterSDCMask () { return m_pucInterSDCMask; } 567 585 #endif 568 586 -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComPattern.h
r504 r571 102 102 Bool m_bICFlag; 103 103 #endif 104 #if LGE_INTER_SDC_E0156 105 Bool m_bSDCMRSADFlag; 106 #endif 104 107 static const UChar m_aucIntraFilter[5]; 105 108 … … 115 118 Bool getICFlag() { return m_bICFlag; } 116 119 Void setICFlag( Bool bICFlag ) { m_bICFlag = bICFlag; } 120 #endif 121 #if LGE_INTER_SDC_E0156 122 Bool getSDCMRSADFlag() { return m_bSDCMRSADFlag; } 123 Void setSDCMRSADFlag( Bool bSDCMRSADFlag ) { m_bSDCMRSADFlag = bSDCMRSADFlag; } 117 124 #endif 118 125 -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComRdCost.cpp
r537 r571 505 505 cDtParam.bUseIC = false; 506 506 #endif 507 #if LGE_INTER_SDC_E0156 508 cDtParam.bUseSDCMRSAD = false; 509 #endif 507 510 #if WEIGHTED_CHROMA_DISTORTION 508 511 if (eText == TEXT_CHROMA_U) … … 608 611 } 609 612 #endif 613 #if LGE_INTER_SDC_E0156 614 if( pcDtParam->bUseSDCMRSAD ) 615 { 616 return xGetSADic( pcDtParam ); 617 } 618 #endif 610 619 Pel* piOrg = pcDtParam->pOrg; 611 620 Pel* piCur = pcDtParam->pCur; … … 638 647 #if H_3D_IC 639 648 if( pcDtParam->bUseIC ) 649 { 650 return xGetSAD4ic( pcDtParam ); 651 } 652 #endif 653 #if LGE_INTER_SDC_E0156 654 if( pcDtParam->bUseSDCMRSAD ) 640 655 { 641 656 return xGetSAD4ic( pcDtParam ); … … 675 690 #if H_3D_IC 676 691 if( pcDtParam->bUseIC ) 692 { 693 return xGetSAD8ic( pcDtParam ); 694 } 695 #endif 696 #if LGE_INTER_SDC_E0156 697 if( pcDtParam->bUseSDCMRSAD ) 677 698 { 678 699 return xGetSAD8ic( pcDtParam ); … … 716 737 #if H_3D_IC 717 738 if( pcDtParam->bUseIC ) 739 { 740 return xGetSAD16ic( pcDtParam ); 741 } 742 #endif 743 #if LGE_INTER_SDC_E0156 744 if( pcDtParam->bUseSDCMRSAD ) 718 745 { 719 746 return xGetSAD16ic( pcDtParam ); … … 770 797 } 771 798 #endif 799 #if LGE_INTER_SDC_E0156 800 if( pcDtParam->bUseSDCMRSAD ) 801 { 802 return xGetSAD12ic( pcDtParam ); 803 } 804 #endif 772 805 Pel* piOrg = pcDtParam->pOrg; 773 806 Pel* piCur = pcDtParam->pCur; … … 808 841 #if H_3D_IC 809 842 if( pcDtParam->bUseIC ) 843 { 844 return xGetSAD16Nic( pcDtParam ); 845 } 846 #endif 847 #if LGE_INTER_SDC_E0156 848 if( pcDtParam->bUseSDCMRSAD ) 810 849 { 811 850 return xGetSAD16Nic( pcDtParam ); … … 860 899 #if H_3D_IC 861 900 if( pcDtParam->bUseIC ) 901 { 902 return xGetSAD32ic( pcDtParam ); 903 } 904 #endif 905 #if LGE_INTER_SDC_E0156 906 if( pcDtParam->bUseSDCMRSAD ) 862 907 { 863 908 return xGetSAD32ic( pcDtParam ); … … 930 975 } 931 976 #endif 977 #if LGE_INTER_SDC_E0156 978 if( pcDtParam->bUseSDCMRSAD ) 979 { 980 return xGetSAD24ic( pcDtParam ); 981 } 982 #endif 932 983 Pel* piOrg = pcDtParam->pOrg; 933 984 Pel* piCur = pcDtParam->pCur; … … 985 1036 #if H_3D_IC 986 1037 if( pcDtParam->bUseIC ) 1038 { 1039 return xGetSAD64ic( pcDtParam ); 1040 } 1041 #endif 1042 #if LGE_INTER_SDC_E0156 1043 if( pcDtParam->bUseSDCMRSAD ) 987 1044 { 988 1045 return xGetSAD64ic( pcDtParam ); … … 1087 1144 } 1088 1145 #endif 1146 #if LGE_INTER_SDC_E0156 1147 if( pcDtParam->bUseSDCMRSAD ) 1148 { 1149 return xGetSAD48ic( pcDtParam ); 1150 } 1151 #endif 1089 1152 Pel* piOrg = pcDtParam->pOrg; 1090 1153 Pel* piCur = pcDtParam->pCur; … … 3409 3472 } 3410 3473 #endif 3474 #if LGE_INTER_SDC_E0156 3475 if( pcDtParam->bUseSDCMRSAD ) 3476 { 3477 return xGetHADsic( pcDtParam ); 3478 } 3479 #endif 3411 3480 Pel* piOrg = pcDtParam->pOrg; 3412 3481 Pel* piCur = pcDtParam->pCur; -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComRdCost.h
r537 r571 94 94 Bool bUseIC; 95 95 #endif 96 #if LGE_INTER_SDC_E0156 97 Bool bUseSDCMRSAD; 98 #endif 96 99 Int iRows; 97 100 Int iCols; … … 132 135 pVirOrg = NULL; 133 136 iStrideVir = 0; 137 #endif 138 #if LGE_INTER_SDC_E0156 139 bUseSDCMRSAD = false; 134 140 #endif 135 141 } -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComSlice.cpp
r542 r571 1540 1540 #if H_3D_NBDV_REF 1541 1541 m_depthRefinementFlag [ i ] = false; 1542 #endif 1543 #if LGE_INTER_SDC_E0156 1544 m_bInterSDCFlag [ i ] = false; 1542 1545 #endif 1543 1546 } -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComSlice.h
r542 r571 507 507 Bool m_ivMvScalingFlag; 508 508 #endif 509 #if LGE_INTER_SDC_E0156 510 Bool m_bInterSDCFlag[MAX_NUM_LAYERS ]; 511 #endif 509 512 510 513 #endif … … 716 719 Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } 717 720 Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } 721 #endif 722 #if LGE_INTER_SDC_E0156 723 Bool getInterSDCFlag ( Int layerIdInVps ) { return m_bInterSDCFlag[layerIdInVps]; } 724 Void setInterSDCFlag ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; } 718 725 #endif 719 726 -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TypeDef.h
r564 r571 100 100 #define MTK_CLIPPING_ALIGN_IC_E0168 1 // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168 101 101 #define MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 1 // Progressive MV Compression, JCT3V-E0170 102 #define LGE_INTER_SDC_E0156 1 // Enable inter SDC for depth coding 102 103 103 104 #if H_3D_NBDV -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibDecoder/TDecCAVLC.cpp
r541 r571 1073 1073 } 1074 1074 #endif 1075 #if LGE_INTER_SDC_E0156 1076 READ_FLAG( uiCode, "depth_inter_SDC_flag" ); pcVPS->setInterSDCFlag( i, uiCode ? true : false ); 1077 #endif 1075 1078 } 1076 1079 } … … 2033 2036 } 2034 2037 #endif 2038 #if LGE_INTER_SDC_E0156 2039 Void TDecCavlc::parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2040 { 2041 assert(0); 2042 } 2043 2044 Void TDecCavlc::parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) 2045 { 2046 assert(0); 2047 } 2048 #endif 2035 2049 // ==================================================================================================================== 2036 2050 // Protected member functions -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibDecoder/TDecCAVLC.h
r537 r571 102 102 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 103 103 #endif 104 #if LGE_INTER_SDC_E0156 105 Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 106 Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 107 #endif 104 108 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 105 109 Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibDecoder/TDecCu.cpp
r531 r571 421 421 m_pcEntropyDecoder->decodeARPW ( pcCU , uiAbsPartIdx , uiDepth ); 422 422 #endif 423 #if LGE_INTER_SDC_E0156 424 m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 425 #endif 423 426 // Coefficient decoding 424 427 Bool bCodeDQP = getdQPFlag(); … … 485 488 { 486 489 case MODE_INTER: 490 #if LGE_INTER_SDC_E0156 491 if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) ) 492 xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 493 else 494 #endif 487 495 xReconInter( m_ppcCU[uiDepth], uiDepth ); 488 496 break; … … 526 534 } 527 535 } 536 537 #if LGE_INTER_SDC_E0156 538 Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 539 { 540 // inter prediction 541 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); 542 543 UInt uiWidth = pcCU->getWidth ( 0 ); 544 UInt uiHeight = pcCU->getHeight( 0 ); 545 UChar* pMask = pcCU->getInterSDCMask(); 546 547 memset( pMask, 0, uiWidth*uiHeight ); 548 pcCU->xSetInterSDCCUMask( pcCU, pMask ); 549 550 Pel *pResi; 551 UInt uiPelX, uiPelY; 552 UInt uiResiStride = m_ppcYuvResi[uiDepth]->getStride(); 553 554 pResi = m_ppcYuvResi[uiDepth]->getLumaAddr( 0 ); 555 for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ ) 556 { 557 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 558 { 559 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 560 561 pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 );; 562 } 563 pResi += uiResiStride; 564 } 565 566 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) ); 567 568 // clear UV 569 UInt uiStrideC = m_ppcYuvReco[uiDepth]->getCStride(); 570 Pel *pRecCb = m_ppcYuvReco[uiDepth]->getCbAddr(); 571 Pel *pRecCr = m_ppcYuvReco[uiDepth]->getCrAddr(); 572 573 for (Int y = 0; y < uiHeight/2; y++) 574 { 575 for (Int x = 0; x < uiWidth/2; x++) 576 { 577 pRecCb[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) ); 578 pRecCr[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) ); 579 } 580 581 pRecCb += uiStrideC; 582 pRecCr += uiStrideC; 583 } 584 } 585 #endif 528 586 529 587 Void -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibDecoder/TDecCu.h
r531 r571 118 118 Void xReconIntraSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 119 119 #endif 120 #if LGE_INTER_SDC_E0156 121 Void xReconInterSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 122 #endif 120 123 }; 121 124 -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibDecoder/TDecEntropy.cpp
r531 r571 635 635 #endif 636 636 637 #if LGE_INTER_SDC_E0156 638 if( pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 639 { 640 assert( !pcCU->isSkipped( uiAbsPartIdx ) ); 641 assert( !pcCU->isIntra( uiAbsPartIdx) ); 642 assert( pcCU->getSlice()->getIsDepth() ); 643 644 decodeInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth ); 645 return; 646 } 647 #endif 648 637 649 if( pcCU->isIntra(uiAbsPartIdx) ) 638 650 { … … 656 668 } 657 669 670 #if LGE_INTER_SDC_E0156 671 Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 672 { 673 pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth); 674 675 if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) 676 return; 677 678 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) ) 679 return; 680 681 m_pcEntropyDecoderIf->parseInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 682 } 683 684 Void TDecEntropy::decodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 685 { 686 if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) 687 return; 688 689 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || !pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 690 return; 691 692 UInt uiNumSegments = ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ? 1 : ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 ); 693 694 // decode residual data for each segment 695 for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ ) 696 m_pcEntropyDecoderIf->parseInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth, uiSeg ); 697 } 698 #endif 699 658 700 //! \} -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibDecoder/TDecEntropy.h
r504 r571 91 91 virtual Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 92 92 #endif 93 #if LGE_INTER_SDC_E0156 94 virtual Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 95 virtual Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0; 96 #endif 93 97 virtual Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 94 98 virtual Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 166 170 Void decodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 167 171 #endif 168 172 #if LGE_INTER_SDC_E0156 173 Void decodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 174 Void decodeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 175 #endif 169 176 Void decodeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 170 177 -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibDecoder/TDecSbac.cpp
r541 r571 100 100 #endif 101 101 #endif 102 #if LGE_INTER_SDC_E0156 103 , m_cInterSDCFlagSCModel ( 1, 1, NUM_INTER_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 104 , m_cInterSDCResidualSCModel ( 1, 1, NUM_INTER_SDC_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 105 , m_cInterSDCResidualSignFlagSCModel ( 1, 1, NUM_INTER_SDC_SIGN_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 106 #endif 102 107 { 103 108 assert( m_numContextModels <= MAX_NUM_CTX_MOD ); … … 182 187 m_cSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL ); 183 188 #endif 189 #endif 190 #if LGE_INTER_SDC_E0156 191 m_cInterSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 192 m_cInterSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 193 m_cInterSDCResidualSignFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 184 194 #endif 185 195 m_uiLastDQpNonZero = 0; … … 251 261 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 252 262 #endif 263 #endif 264 #if LGE_INTER_SDC_E0156 265 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 266 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 267 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 253 268 #endif 254 269 m_pcTDecBinIf->start(); … … 2237 2252 #endif 2238 2253 2254 #if LGE_INTER_SDC_E0156 2255 Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2256 { 2257 UInt uiSymbol = 0; 2258 UInt uiCtxInterSDCFlag = pcCU->getCtxInterSDCFlag( uiAbsPartIdx ); 2259 2260 m_pcTDecBinIf->decodeBin( uiSymbol, m_cInterSDCFlagSCModel.get( 0, 0, uiCtxInterSDCFlag ) ); 2261 2262 if( uiSymbol ) 2263 { 2264 pcCU->setInterSDCFlagSubParts( true, uiAbsPartIdx, 0, uiDepth ); 2265 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); 2266 pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth ); 2267 } 2268 else 2269 pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth); 2270 } 2271 2272 Void TDecSbac::parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment ) 2273 { 2274 UInt uiAbsIdx = 0; 2275 UInt uiSign = 0; 2276 Int iIdx = 0; 2277 2278 xReadExGolombLevel( uiAbsIdx, m_cInterSDCResidualSCModel.get( 0, 0, 0 ) ); 2279 2280 uiAbsIdx++; 2281 m_pcTDecBinIf->decodeBin( uiSign, m_cInterSDCResidualSignFlagSCModel.get( 0, 0, 0 ) ); 2282 iIdx = (Int)( uiSign ? -1 : 1 ) * uiAbsIdx; 2283 2284 pcCU->setInterSDCSegmentDCOffset( iIdx, uiSegment, uiAbsPartIdx ); 2285 } 2286 #endif 2287 2239 2288 //! \} -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibDecoder/TDecSbac.h
r531 r571 112 112 #endif 113 113 #endif 114 #if LGE_INTER_SDC_E0156 115 Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 116 Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 117 #endif 114 118 private: 115 119 TComInputBitstream* m_pcBitstream; … … 221 225 #endif 222 226 #endif 227 #if LGE_INTER_SDC_E0156 228 ContextModel3DBuffer m_cInterSDCFlagSCModel; 229 ContextModel3DBuffer m_cInterSDCResidualSCModel; 230 ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel; 231 #endif 223 232 }; 224 233 -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibEncoder/TEncCavlc.cpp
r542 r571 842 842 } 843 843 #endif 844 #if LGE_INTER_SDC_E0156 845 WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" ); 846 #endif 844 847 } 845 848 } … … 1776 1779 return true; 1777 1780 } 1781 1782 #if LGE_INTER_SDC_E0156 1783 Void TEncCavlc::codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1784 { 1785 assert(0); 1786 } 1787 1788 Void TEncCavlc::codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) 1789 { 1790 assert(0); 1791 } 1792 #endif 1778 1793 //! \} -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibEncoder/TEncCavlc.h
r537 r571 117 117 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 118 118 #endif 119 #if LGE_INTER_SDC_E0156 120 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 121 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 122 #endif 119 123 120 124 Void codeInterModeFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiEncMode ); -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibEncoder/TEncCfg.h
r541 r571 394 394 Bool m_bUseIC; 395 395 #endif 396 #if LGE_INTER_SDC_E0156 397 bool m_bInterSDC; 398 #endif 396 399 //====== Depth Intra Modes ====== 397 400 #if H_3D_DIM … … 490 493 Void setUseIC ( Bool bVal ) { m_bUseIC = bVal; } 491 494 Bool getUseIC () { return m_bUseIC; } 495 #endif 496 #if LGE_INTER_SDC_E0156 497 Void setInterSDCEnable ( Bool bVal ) { m_bInterSDC = bVal; } 498 Bool getInterSDCEnable () { return m_bInterSDC; } 492 499 #endif 493 500 //======== Transform ============= -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibEncoder/TEncCu.cpp
r559 r571 1527 1527 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1528 1528 #endif 1529 #if LGE_INTER_SDC_E0156 1530 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, uiAbsPartIdx, false ); 1531 #endif 1529 1532 1530 1533 // Encode Coefficients … … 1817 1820 1818 1821 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); 1822 #if LGE_INTER_SDC_E0156 1823 TComDataCU *rpcTempCUPre = rpcTempCU; 1824 #endif 1819 1825 Int orgQP = rpcTempCU->getQP( 0 ); 1820 1826 xCheckDQP( rpcTempCU ); 1821 1827 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 1828 #if LGE_INTER_SDC_E0156 1829 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual ) 1830 { 1831 if( rpcTempCU != rpcTempCUPre ) 1832 { 1833 rpcTempCU->initEstData( uhDepth, orgQP ); 1834 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 1835 } 1836 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 1837 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 1838 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 1839 #if H_3D_VSO //M2 1840 if( m_pcRdCost->getUseRenModel() ) 1841 { //Reset 1842 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth (); 1843 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight (); 1844 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr (); 1845 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride (); 1846 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 1847 } 1848 #endif 1849 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 1850 m_ppcOrigYuv[uhDepth], 1851 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 1852 m_ppcResiYuvTemp[uhDepth], 1853 m_ppcRecoYuvTemp[uhDepth], 1854 uhDepth ); 1855 1856 xCheckDQP( rpcTempCU ); 1857 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth ); 1858 } 1859 #endif 1822 1860 rpcTempCU->initEstData( uhDepth, orgQP ); 1823 1861 1824 1862 if( m_pcEncCfg->getUseFastDecisionForMerge() && !bestIsSkip ) 1825 1863 { 1864 #if LGE_INTER_SDC_E0156 1865 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) ) 1866 bestIsSkip = !rpcBestCU->getSDCFlag( 0 ) && ( rpcBestCU->getQtRootCbf(0) == 0 ); 1867 else 1868 #endif 1826 1869 bestIsSkip = rpcBestCU->getQtRootCbf(0) == 0; 1827 1870 } … … 2017 2060 #endif 2018 2061 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2019 2062 #if LGE_INTER_SDC_E0156 2063 TComDataCU *rpcTempCUPre = rpcTempCU; 2064 #endif 2020 2065 xCheckDQP( rpcTempCU ); 2021 2066 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2067 #if LGE_INTER_SDC_E0156 2068 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() ) 2069 { 2070 if( rpcTempCU != rpcTempCUPre ) 2071 { 2072 Int orgQP = rpcBestCU->getQP( 0 ); 2073 rpcTempCU->initEstData( uhDepth, orgQP ); 2074 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 2075 } 2076 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2077 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2078 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 2079 #if H_3D_VSO // M3 2080 if( m_pcRdCost->getUseRenModel() ) 2081 { 2082 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ( ); 2083 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight( ); 2084 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( ); 2085 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride(); 2086 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2087 } 2088 #endif 2089 2090 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2091 m_ppcOrigYuv[uhDepth], 2092 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2093 m_ppcResiYuvTemp[uhDepth], 2094 m_ppcRecoYuvTemp[uhDepth], 2095 uhDepth ); 2096 2097 xCheckDQP( rpcTempCU ); 2098 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth ); 2099 } 2100 #endif 2022 2101 #if H_3D_ARP 2023 2102 } -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibEncoder/TEncEntropy.cpp
r531 r571 662 662 #endif 663 663 664 #if LGE_INTER_SDC_E0156 665 if( pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 666 { 667 assert( !pcCU->isSkipped( uiAbsPartIdx ) ); 668 assert( !pcCU->isIntra( uiAbsPartIdx) ); 669 assert( pcCU->getSlice()->getIsDepth() ); 670 671 encodeInterSDCResidualData( pcCU, uiAbsPartIdx, false ); 672 return; 673 } 674 #endif 675 664 676 if( pcCU->isIntra(uiAbsPartIdx) ) 665 677 { … … 812 824 } 813 825 826 #if LGE_INTER_SDC_E0156 827 Void TEncEntropy::encodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 828 { 829 if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) 830 return; 831 832 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) ) 833 return; 834 835 if( bRD ) 836 uiAbsPartIdx = 0; 837 838 m_pcEntropyCoderIf->codeInterSDCFlag( pcCU, uiAbsPartIdx ); 839 } 840 841 Void TEncEntropy::encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 842 { 843 if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) 844 return; 845 846 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || !pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 847 return; 848 849 if( bRD ) 850 uiAbsPartIdx = 0; 851 852 // number of segments depends on prediction mode for INTRA 853 UInt uiNumSegments = ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ? 1 : ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 ); 854 855 // encode residual data for each segment 856 for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ ) 857 m_pcEntropyCoderIf->codeInterSDCResidualData( pcCU, uiAbsPartIdx, uiSeg ); 858 } 859 #endif 860 814 861 //! \} -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibEncoder/TEncEntropy.h
r504 r571 93 93 #if H_3D_IC 94 94 virtual Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 95 #endif 96 #if LGE_INTER_SDC_E0156 97 virtual Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 98 virtual Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0; 95 99 #endif 96 100 virtual Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 181 185 Void encodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 182 186 #endif 187 #if LGE_INTER_SDC_E0156 188 Void encodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 189 Void encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ); 190 #endif 183 191 Void encodePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 184 192 Void encodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibEncoder/TEncSbac.cpp
r541 r571 106 106 #endif 107 107 #endif 108 #if LGE_INTER_SDC_E0156 109 , m_cInterSDCFlagSCModel ( 1, 1, NUM_INTER_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 110 , m_cInterSDCResidualSCModel ( 1, 1, NUM_INTER_SDC_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 111 , m_cInterSDCResidualSignFlagSCModel ( 1, 1, NUM_INTER_SDC_SIGN_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 112 #endif 108 113 { 109 114 assert( m_numContextModels <= MAX_NUM_CTX_MOD ); … … 181 186 #endif 182 187 #endif 188 #if LGE_INTER_SDC_E0156 189 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 190 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 191 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 192 #endif 183 193 // new structure 184 194 m_uiLastQp = iQp; … … 217 227 #if H_3D_IC 218 228 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 229 #endif 230 #if LGE_INTER_SDC_E0156 231 curCost += m_cInterSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 232 curCost += m_cInterSDCResidualSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 233 curCost += m_cInterSDCResidualSignFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 219 234 #endif 220 235 curCost += m_cCUPartSizeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_PART_SIZE ); … … 330 345 #endif 331 346 #endif 347 #if LGE_INTER_SDC_E0156 348 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 349 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 350 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 351 #endif 332 352 m_pcBinIf->start(); 333 353 } … … 2209 2229 this->xCopyContextsFrom(pScr); 2210 2230 } 2231 2232 #if LGE_INTER_SDC_E0156 2233 Void TEncSbac::codeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2234 { 2235 UInt uiSymbol = pcCU->getInterSDCFlag( uiAbsPartIdx ) ? 1 : 0; 2236 UInt uiCtxInterSDCFlag = pcCU->getCtxInterSDCFlag( uiAbsPartIdx ); 2237 2238 m_pcBinIf->encodeBin( uiSymbol, m_cInterSDCFlagSCModel.get( 0, 0, uiCtxInterSDCFlag ) ); 2239 } 2240 2241 Void TEncSbac::codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) 2242 { 2243 Pel segmentDCOffset = pcCU->getInterSDCSegmentDCOffset( uiSegment, uiAbsPartIdx ); 2244 2245 UInt uiSign = segmentDCOffset < 0 ? 1 : 0; 2246 UInt uiAbsIdx = abs( segmentDCOffset ); 2247 2248 assert( uiAbsIdx > 0 ); 2249 uiAbsIdx--; 2250 xWriteExGolombLevel( uiAbsIdx, m_cInterSDCResidualSCModel.get( 0, 0, 0 ) ); 2251 m_pcBinIf->encodeBin( uiSign, m_cInterSDCResidualSignFlagSCModel.get( 0, 0, 0 ) ); 2252 } 2253 #endif 2211 2254 //! \} -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibEncoder/TEncSbac.h
r531 r571 158 158 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 159 159 #endif 160 #if LGE_INTER_SDC_E0156 161 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 162 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 163 #endif 160 164 Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 161 165 Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); … … 261 265 #endif 262 266 #endif 267 #if LGE_INTER_SDC_E0156 268 ContextModel3DBuffer m_cInterSDCFlagSCModel; 269 ContextModel3DBuffer m_cInterSDCResidualSCModel; 270 ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel; 271 #endif 263 272 }; 264 273 -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibEncoder/TEncSearch.cpp
r559 r571 41 41 #include "TEncSearch.h" 42 42 #include <math.h> 43 #if LGE_INTER_SDC_E0156 44 #include <memory.h> 45 #endif 43 46 44 47 //! \ingroup TLibEncoder … … 319 322 #if H_3D_IC 320 323 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 324 #endif 325 #if LGE_INTER_SDC_E0156 326 m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag(); 321 327 #endif 322 328 //-- jclee for using the SAD function pointer … … 748 754 #if H_3D_IC 749 755 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 756 #endif 757 #if LGE_INTER_SDC_E0156 758 m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag(); 750 759 #endif 751 760 m_cDistParam.pCur = piRefPos; … … 3531 3540 cDistParam.bUseIC = false; 3532 3541 #endif 3542 #if LGE_INTER_SDC_E0156 3543 cDistParam.bUseSDCMRSAD = false; 3544 #endif 3533 3545 ruiErr = cDistParam.DistFunc( &cDistParam ); 3534 3546 } … … 4627 4639 pcPatternKey->setICFlag( bICFlag ); 4628 4640 #endif 4641 #if LGE_INTER_SDC_E0156 4642 if ( pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) 4643 { 4644 pcPatternKey->setSDCMRSADFlag( true ); 4645 } 4646 else 4647 { 4648 pcPatternKey->setSDCMRSADFlag( false ); 4649 } 4650 #endif 4629 4651 4630 4652 if ( bBi ) … … 4772 4794 #if H_3D_IC 4773 4795 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 4796 #endif 4797 #if LGE_INTER_SDC_E0156 4798 m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag(); 4774 4799 #endif 4775 4800 m_cDistParam.bitDepth = g_bitDepthY; … … 5378 5403 #endif 5379 5404 } 5405 5406 #if LGE_INTER_SDC_E0156 5407 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, const UInt uiDepth ) 5408 { 5409 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( 0 ) ) 5410 { 5411 return; 5412 } 5413 5414 pcCU->setInterSDCFlagSubParts( true, 0, 0, uiDepth ); 5415 5416 UInt uiWidth = pcCU->getWidth ( 0 ); 5417 UInt uiHeight = pcCU->getHeight( 0 ); 5418 UChar* pMask = pcCU->getInterSDCMask(); 5419 memset( pMask, 0, uiWidth*uiHeight ); 5420 5421 pcCU->xSetInterSDCCUMask( pcCU, pMask ); 5422 5423 UInt uiSegSize[4] = { 0, 0, 0, 0 }; 5424 Pel *pPred, *pOrg; 5425 UInt uiPredStride = pcPred->getStride(); 5426 UInt uiOrgStride = pcOrg->getStride(); 5427 UInt uiPelX, uiPelY; 5428 UInt uiPartitionSize = pcCU->getPartitionSize( 0 ); 5429 UInt uiSegmentNum = ( uiPartitionSize == SIZE_2Nx2N ) ? 1 : ( uiPartitionSize == SIZE_NxN ? 4 : 2 ); 5430 5431 pPred = pcPred->getLumaAddr( 0 ); 5432 pOrg = pcOrg->getLumaAddr( 0 ); 5433 Int pResDC[4] = { 0, 0, 0, 0}; 5434 5435 //calculate dc value for prediction and original signal, and calculate residual and reconstruction 5436 for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ ) 5437 { 5438 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 5439 { 5440 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 5441 pResDC[uiSeg] += (Int)( pOrg [uiPelX] - pPred[uiPelX] ); 5442 uiSegSize[uiSeg]++; 5443 } 5444 pOrg += uiOrgStride; 5445 pPred += uiPredStride; 5446 } 5447 5448 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ ) 5449 { 5450 Int iResiOffset = ( pResDC [uiSeg] > 0 ? ( uiSegSize[uiSeg] >> 1 ) : -1*( uiSegSize[uiSeg] >> 1 ) ); 5451 pResDC [uiSeg] = ( pResDC [uiSeg] + iResiOffset ) / (Int) uiSegSize[uiSeg]; 5452 5453 pcCU->setInterSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 ); 5454 } 5455 5456 Pel *pRec; 5457 UInt uiRecStride = pcRec->getStride(); 5458 pPred = pcPred->getLumaAddr( 0 ); 5459 pRec = pcRec->getLumaAddr( 0 ); 5460 5461 for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ ) 5462 { 5463 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 5464 { 5465 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 5466 assert( uiSeg < uiSegmentNum ); 5467 5468 pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pResDC[uiSeg] ); 5469 } 5470 pPred += uiPredStride; 5471 pRec += uiRecStride; 5472 } 5473 5474 // clear UV 5475 UInt uiStrideC = pcRec->getCStride(); 5476 Pel *pRecCb = pcRec->getCbAddr(); 5477 Pel *pRecCr = pcRec->getCrAddr(); 5478 5479 for (Int y=0; y < uiHeight/2; y++) 5480 { 5481 for (Int x=0; x < uiWidth/2; x++) 5482 { 5483 pRecCb[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) ); 5484 pRecCr[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) ); 5485 } 5486 5487 pRecCb += uiStrideC; 5488 pRecCr += uiStrideC; 5489 } 5490 5491 Dist ruiDist; 5492 Double rdCost; 5493 #if H_3D_VSO // M13 5494 if ( m_pcRdCost->getUseVSO() ) 5495 { 5496 ruiDist = m_pcRdCost->getDistPartVSO( pcCU, 0, pcRec->getLumaAddr(), pcRec->getStride(), pcOrg->getLumaAddr(), pcOrg->getStride(), uiWidth, uiHeight , false ); 5497 } 5498 else 5499 { 5500 #endif 5501 { 5502 ruiDist = m_pcRdCost->getDistPart( g_bitDepthY, pcRec->getLumaAddr( 0 ), uiRecStride, pcOrg->getLumaAddr( 0 ), uiOrgStride, uiWidth, uiHeight ); 5503 } 5504 #if H_3D_VSO 5505 } 5506 #endif 5507 5508 Bool bNonSkip = true; 5509 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ ) 5510 { 5511 bNonSkip &= ( pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0; 5512 } 5513 5514 if( !bNonSkip ) 5515 { 5516 pcCU->getTotalBits() = MAX_INT; 5517 pcCU->getTotalDistortion() = MAX_INT; 5518 pcCU->getTotalCost() = MAX_DOUBLE; 5519 } 5520 else 5521 { 5522 //----- determine rate and r-d cost ----- 5523 UInt uiBits = 0; 5524 TComYuv *pDummy = NULL; 5525 if( m_bUseSBACRD ) 5526 { 5527 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] ); 5528 } 5529 5530 xAddSymbolBitsInter( pcCU, 0, 0, uiBits, pDummy, NULL, pDummy ); 5531 5532 #if H_3D_VSO //M 14 5533 if ( m_pcRdCost->getUseLambdaScaleVSO() ) 5534 rdCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist ); 5535 else 5536 #endif 5537 { 5538 rdCost = m_pcRdCost->calcRdCost( uiBits, ruiDist ); 5539 } 5540 5541 pcCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits(); 5542 pcCU->getTotalDistortion() = ruiDist; 5543 pcCU->getTotalCost() = rdCost; 5544 5545 if( m_bUseSBACRD ) 5546 { 5547 m_pcRDGoOnSbacCoder->store( m_pppcRDSbacCoder[ pcCU->getDepth( 0 ) ][ CI_TEMP_BEST ] ); 5548 } 5549 } 5550 5551 #if H_3D_VSO // necessary? // M15 5552 // set Model 5553 if( !m_pcRdCost->getUseEstimatedVSD() && m_pcRdCost->getUseRenModel() ) 5554 { 5555 Pel* piSrc = pcRec->getLumaAddr(); 5556 UInt uiSrcStride = pcRec->getStride(); 5557 m_pcRdCost->setRenModelData( pcCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 5558 } 5559 #endif 5560 } 5561 #endif 5380 5562 5381 5563 #if H_3D_VSO // M25 … … 6543 6725 m_pcEntropyCoder->encodeARPW( pcCU , 0 ); 6544 6726 #endif 6727 #if LGE_INTER_SDC_E0156 6728 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, 0, true ); 6729 #endif 6545 6730 Bool bDummy = false; 6546 6731 m_pcEntropyCoder->encodeCoeff ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy ); -
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibEncoder/TEncSearch.h
r559 r571 213 213 TComYuv*& rpcYuvRec, 214 214 Bool bSkipRes ); 215 215 #if LGE_INTER_SDC_E0156 216 Void encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, 217 TComYuv* pcOrg, 218 TComYuv* pcPred, 219 TComYuv* pcResi, 220 TComYuv* pcRec, 221 const UInt uiDepth ); 222 #endif 216 223 /// set ME search range 217 224 Void setAdaptiveSearchRange ( Int iDir, Int iRefIdx, Int iSearchRange) { m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; }
Note: See TracChangeset for help on using the changeset viewer.