Changeset 571 in 3DVCSoftware for branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon
- Timestamp:
- 14 Aug 2013, 10:39:58 (12 years ago)
- Location:
- branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset for help on using the changeset viewer.