Changeset 877 in 3DVCSoftware for branches/HTM-10.1-dev0/source
- Timestamp:
- 27 Mar 2014, 19:31:41 (11 years ago)
- Location:
- branches/HTM-10.1-dev0/source/Lib
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-10.1-dev0/source/Lib/TLibCommon/ContextTables.h
r876 r877 116 116 #if QC_GENERIC_SDC_G0122 117 117 #define NUM_ANGLE_FLAG_CTX 3 118 #if !QC_SDC_UNIFY_G0130119 #define NUM_INTRASDC_FLAG_CTX 3120 #endif121 118 #endif 122 119 #endif 123 120 124 121 #if H_3D_DIM_SDC 125 #define SDC_NUM_RESIDUAL_FLAG_CTX 1 126 #define SDC_NUM_RESIDUAL_CTX 1 127 #endif 128 129 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 130 #define NUM_INTER_SDC_FLAG_CTX 1 ///< number of context models for inter SDC flag 131 #define NUM_INTER_SDC_SIGN_FLAG_CTX 1 ///< number of context models for sign of inter SDC residual 132 #define NUM_INTER_SDC_RESIDUAL_CTX 1 ///< number of context models for abs of inter SDC residual 133 #endif 134 135 #if QC_SDC_UNIFY_G0130 122 #define SDC_NUM_RESIDUAL_FLAG_CTX 1 123 #define SDC_NUM_RESIDUAL_CTX 1 136 124 #define NUM_SDC_FLAG_CTX 1 ///< number of context 137 125 #endif … … 404 392 { 155, 170, 157 }, 405 393 }; 406 #if !QC_SDC_UNIFY_G0130407 static const UChar408 INIT_INTRASDC_FLAG[3][NUM_INTRASDC_FLAG_CTX] =409 {410 { 214, 229, 230 },411 { 215, 202, 174 },412 { 213, 201, 246 },413 };414 #endif415 394 #endif 416 395 … … 456 435 #endif 457 436 458 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 459 static const UChar 460 INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] = 461 { 462 { CNU }, 463 { 154 }, 464 { 154 }, 465 }; 466 467 static const UChar 468 INIT_INTER_SDC_SIGN_FLAG[3][NUM_INTER_SDC_SIGN_FLAG_CTX] = 469 { 470 { CNU }, 471 { 154 }, 472 { 154 }, 473 }; 474 475 static const UChar 476 INIT_INTER_SDC_RESIDUAL[3][NUM_INTER_SDC_RESIDUAL_CTX] = 477 { 478 { CNU }, 479 { 154 }, 480 { 154 }, 481 }; 482 #endif 437 483 438 //! \} 484 #if QC_SDC_UNIFY_G0130439 #if H_3D_DIM_SDC 485 440 static const UChar 486 441 INIT_SDC_FLAG[3][NUM_SDC_FLAG_CTX] = -
branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp
r876 r877 123 123 #if H_3D_DIM_SDC 124 124 m_pbSDCFlag = NULL; 125 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101126 for( Int i = 0; i < 4; i++ )127 {128 m_apSegmentDCOffset[i] = NULL;129 }130 #else131 125 m_apSegmentDCOffset[0] = NULL; 132 126 m_apSegmentDCOffset[1] = NULL; 133 #endif134 127 #endif 135 128 #endif … … 153 146 #endif 154 147 #if H_3D_INTER_SDC 155 #if !QC_SDC_UNIFY_G0130156 m_pbInterSDCFlag = NULL;157 for( Int i = 0; i < 4; i++ )158 {159 m_apSegmentInterDCOffset[i] = NULL;160 }161 #endif162 #if !SEC_INTER_SDC_G0101163 m_pucInterSDCMask = NULL;164 #endif165 148 #endif 166 149 #if H_3D_DBBP … … 291 274 #if H_3D_DIM_SDC 292 275 m_pbSDCFlag = (Bool*)xMalloc(Bool, uiNumPartition); 293 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101294 for( Int i = 0; i < 4; i++ )295 {296 m_apSegmentDCOffset[i] = (Pel*)xMalloc(Pel, uiNumPartition);297 }298 #else299 276 m_apSegmentDCOffset[0] = (Pel*)xMalloc(Pel, uiNumPartition); 300 277 m_apSegmentDCOffset[1] = (Pel*)xMalloc(Pel, uiNumPartition); 301 278 #endif 302 279 #endif 303 #endif304 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130305 m_pbInterSDCFlag = (Bool* )xMalloc(Bool, uiNumPartition);306 for( Int i = 0; i < 4; i++ )307 {308 m_apSegmentInterDCOffset[i] = (Int*)xMalloc(Int, uiNumPartition);309 }310 #endif311 280 #if H_3D_DBBP 312 281 m_pbDBBPFlag = (Bool* )xMalloc(Bool, uiNumPartition); … … 318 287 m_acCUMvField[1].setNumPartition(uiNumPartition ); 319 288 } 320 #if !SEC_INTER_SDC_G0101321 #if H_3D_INTER_SDC322 m_pucInterSDCMask = (UChar* )xMalloc(UChar, g_uiMaxCUHeight*g_uiMaxCUWidth);323 #endif324 #endif325 289 m_sliceStartCU = (UInt* )xMalloc(UInt, uiNumPartition); 326 290 m_sliceSegmentStartCU = (UInt* )xMalloc(UInt, uiNumPartition); … … 441 405 #if H_3D_DIM_SDC 442 406 if ( m_pbSDCFlag ) { xFree(m_pbSDCFlag); m_pbSDCFlag = NULL; } 443 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101444 for( Int i = 0; i < 4; i++ )445 {446 if ( m_apSegmentDCOffset[i] ) { xFree(m_apSegmentDCOffset[i]); m_apSegmentDCOffset[i] = NULL; }447 }448 #else449 407 if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]); m_apSegmentDCOffset[0] = NULL; } 450 408 if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]); m_apSegmentDCOffset[1] = NULL; } 451 #endif452 409 #endif 453 410 #endif 454 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130455 if ( m_pbInterSDCFlag ) { xFree(m_pbInterSDCFlag); m_pbInterSDCFlag = NULL; }456 for(Int i = 0; i < 4; i++ )457 {458 if ( m_apSegmentInterDCOffset[i] ) { xFree( m_apSegmentInterDCOffset[i] ); m_apSegmentInterDCOffset[i] = NULL; }459 }460 #endif461 411 #if H_3D_DBBP 462 412 if ( m_pbDBBPFlag ) { xFree(m_pbDBBPFlag); m_pbDBBPFlag = NULL; } 463 413 #endif 464 414 } 465 #if !SEC_INTER_SDC_G0101466 #if H_3D_INTER_SDC467 if ( m_pucInterSDCMask ) { xFree(m_pucInterSDCMask); m_pucInterSDCMask = NULL; }468 #endif469 #endif470 415 m_pcCUAboveLeft = NULL; 471 416 m_pcCUAboveRight = NULL; … … 593 538 #if H_3D_DIM_SDC 594 539 m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui]; 595 #endif596 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130597 m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui];598 540 #endif 599 541 #if H_3D_DBBP … … 665 607 #if H_3D_DIM_SDC 666 608 memset( m_pbSDCFlag + firstElement, 0, numElements * sizeof( *m_pbSDCFlag ) ); 667 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101668 for( Int i = 0; i < 4; i++ )669 {670 memset( m_apSegmentDCOffset[i] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[i] ) );671 }672 #else673 609 memset( m_apSegmentDCOffset[0] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[0] ) ); 674 610 memset( m_apSegmentDCOffset[1] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[1] ) ); 675 611 #endif 676 #endif677 #endif678 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130679 memset( m_pbInterSDCFlag + firstElement, 0, numElements * sizeof( *m_pbInterSDCFlag ) );680 for( Int i = 0; i < 4; i++ )681 {682 memset( m_apSegmentInterDCOffset[i] + firstElement, 0, numElements * sizeof( *m_apSegmentInterDCOffset[i] ) );683 }684 612 #endif 685 613 #if H_3D_DBBP … … 853 781 #if H_3D_DIM_SDC 854 782 m_pbSDCFlag [ui] = false; 855 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101856 for( Int i = 0; i < 4; i++ )857 {858 m_apSegmentDCOffset[i][ui] = 0;859 }860 #else861 783 m_apSegmentDCOffset[0][ui] = 0; 862 784 m_apSegmentDCOffset[1][ui] = 0; 863 785 #endif 864 #endif865 #endif866 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130867 m_pbInterSDCFlag[ui] = false;868 for( Int i = 0; i < 4; i++ )869 {870 m_apSegmentInterDCOffset[i][ui] = 0;871 }872 786 #endif 873 787 #if H_3D_DBBP … … 982 896 #if H_3D_DIM_SDC 983 897 memset( m_pbSDCFlag, 0, sizeof(Bool) * m_uiNumPartition ); 984 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101985 for( Int i = 0; i < 4; i++ )986 {987 memset( m_apSegmentDCOffset[i], 0, sizeof(Pel) * m_uiNumPartition );988 }989 #else990 898 memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition ); 991 899 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition ); 992 900 #endif 993 #endif994 #endif995 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130996 memset( m_pbInterSDCFlag, 0, sizeof( Bool ) * m_uiNumPartition );997 for( Int i = 0; i < 4; i++ )998 {999 memset( m_apSegmentInterDCOffset[i], 0, sizeof( Int ) * m_uiNumPartition );1000 }1001 901 #endif 1002 902 #if H_3D_DBBP … … 1075 975 #if H_3D_DIM_SDC 1076 976 m_pbSDCFlag [ui] = pcCU->m_pbSDCFlag [ uiPartOffset + ui ]; 1077 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G01011078 for( Int i = 0; i < 4; i++ )1079 {1080 m_apSegmentDCOffset[i][ui] = pcCU->m_apSegmentDCOffset[i] [ uiPartOffset + ui ];1081 }1082 #else1083 977 m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ]; 1084 978 m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ]; 1085 979 #endif 1086 #endif1087 #endif1088 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G01301089 m_pbInterSDCFlag [ui] = pcCU->m_pbInterSDCFlag [ uiPartOffset + ui ];1090 for( Int i = 0; i < 4; i++ )1091 {1092 m_apSegmentInterDCOffset[i][ui] = pcCU->m_apSegmentInterDCOffset[i][ uiPartOffset + ui ];1093 }1094 980 #endif 1095 981 #if H_3D_DBBP … … 1246 1132 #if H_3D_DIM_SDC 1247 1133 m_pbSDCFlag = pcCU->getSDCFlag() + uiPart; 1248 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G01011249 for( Int i = 0; i < 4; i++ )1250 {1251 m_apSegmentDCOffset[i] = pcCU->getSDCSegmentDCOffset(i) + uiPart;1252 }1253 #else1254 1134 m_apSegmentDCOffset[0] = pcCU->getSDCSegmentDCOffset(0) + uiPart; 1255 1135 m_apSegmentDCOffset[1] = pcCU->getSDCSegmentDCOffset(1) + uiPart; 1256 #endif1257 1136 #endif 1258 1137 #endif 1259 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G01301260 m_pbInterSDCFlag = pcCU->getInterSDCFlag() + uiPart;1261 for( Int i = 0; i < 4; i++ )1262 {1263 m_apSegmentInterDCOffset[i] = pcCU->getInterSDCSegmentDCOffset( i ) + uiPart;1264 }1265 #endif1266 1138 #if H_3D_DBBP 1267 1139 m_pbDBBPFlag = pcCU->getDBBPFlag() + uiPart; … … 1465 1337 #if H_3D_DIM_SDC 1466 1338 memcpy( m_pbSDCFlag + uiOffset, pcCU->getSDCFlag(), iSizeInBool ); 1467 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G01011468 for( Int i = 0; i < 4; i++ )1469 {1470 memcpy( m_apSegmentDCOffset[i] + uiOffset, pcCU->getSDCSegmentDCOffset(i), sizeof( Pel ) * uiNumPartition);1471 }1472 #else1473 1339 memcpy( m_apSegmentDCOffset[0] + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition); 1474 1340 memcpy( m_apSegmentDCOffset[1] + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition); 1475 1341 #endif 1476 #endif1477 #endif1478 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G01301479 memcpy( m_pbInterSDCFlag + uiOffset, pcCU->getInterSDCFlag(), iSizeInBool );1480 for( Int i = 0; i < 4; i++ )1481 {1482 memcpy( m_apSegmentInterDCOffset[i] + uiOffset, pcCU->getInterSDCSegmentDCOffset( i ), sizeof( Int ) * uiNumPartition);1483 }1484 1342 #endif 1485 1343 #if H_3D_DBBP … … 1602 1460 #if H_3D_DIM_SDC 1603 1461 memcpy( rpcCU->getSDCFlag() + m_uiAbsIdxInLCU, m_pbSDCFlag, iSizeInBool ); 1604 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G01011605 for( Int i = 0; i < 4; i++ )1606 {1607 memcpy( rpcCU->getSDCSegmentDCOffset(i) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[i], sizeof( Pel ) * m_uiNumPartition);1608 }1609 #else1610 1462 memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition); 1611 1463 memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition); 1612 1464 #endif 1613 #endif1614 #endif1615 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G01301616 memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag, iSizeInBool );1617 for( Int i = 0;i < 4; i++ )1618 {1619 memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + m_uiAbsIdxInLCU, m_apSegmentInterDCOffset[i], sizeof( Int ) * m_uiNumPartition);1620 }1621 1465 #endif 1622 1466 #if H_3D_DBBP … … 1726 1570 #if H_3D_DIM_SDC 1727 1571 memcpy( rpcCU->getSDCFlag() + uiPartOffset, m_pbSDCFlag, iSizeInBool ); 1728 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G01011729 for( Int i = 0; i < 4; i++ )1730 {1731 memcpy( rpcCU->getSDCSegmentDCOffset(i) + uiPartOffset, m_apSegmentDCOffset[i], sizeof( Pel ) * uiQNumPart);1732 }1733 #else1734 1572 memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart); 1735 1573 memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart); 1736 1574 #endif 1737 #endif1738 #endif1739 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G01301740 memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag, iSizeInBool );1741 for( Int i = 0; i < 4; i++ )1742 {1743 memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + uiPartOffset, m_apSegmentInterDCOffset[i], sizeof( Int ) * uiQNumPart);1744 }1745 1575 #endif 1746 1576 #if H_3D_DBBP … … 2545 2375 #endif 2546 2376 2547 #if H_3D_INTER_SDC2548 #if !QC_SDC_UNIFY_G01302549 Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )2550 {2551 setSubPart( bInterSDCFlag, m_pbInterSDCFlag, uiAbsPartIdx, uiDepth, uiPartIdx );2552 }2553 2554 UInt TComDataCU::getCtxInterSDCFlag( UInt uiAbsPartIdx )2555 {2556 return 0;2557 }2558 #endif2559 2560 #if !SEC_INTER_SDC_G01012561 Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask )2562 {2563 UInt uiWidth = pcCU->getWidth ( 0 );2564 UInt uiHeight = pcCU->getHeight( 0 );2565 UInt uiPartitionSize = pcCU->getPartitionSize( 0 );2566 UInt uiXOffset = 0, uiYOffset = 0;2567 2568 switch( uiPartitionSize )2569 {2570 case SIZE_2NxN:2571 uiXOffset = uiWidth; uiYOffset = uiHeight >> 1; break;2572 case SIZE_2NxnU:2573 uiXOffset = uiWidth; uiYOffset = uiHeight >> 2; break;2574 case SIZE_2NxnD:2575 uiXOffset = uiWidth; uiYOffset = ( uiHeight >> 1 ) + ( uiHeight >> 2 ); break;2576 case SIZE_Nx2N:2577 uiXOffset = uiWidth >> 1; uiYOffset = uiHeight; break;2578 case SIZE_nLx2N:2579 uiXOffset = uiWidth >> 2; uiYOffset = uiHeight; break;2580 case SIZE_nRx2N:2581 uiXOffset = ( uiWidth >> 1 ) + ( uiWidth >> 2 ); uiYOffset = uiHeight; break;2582 case SIZE_NxN:2583 uiXOffset = uiWidth >> 1; uiYOffset = uiHeight >> 1; break;2584 default:2585 assert( uiPartitionSize == SIZE_2Nx2N );2586 uiXOffset = uiWidth; uiYOffset = uiHeight; break;2587 }2588 2589 UInt uiPelX, uiPelY;2590 2591 memset( pMask, 0, uiWidth*uiHeight );2592 2593 //mask2594 if( uiPartitionSize == SIZE_2NxN || uiPartitionSize == SIZE_2NxnD || uiPartitionSize == SIZE_2NxnU )2595 {2596 for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ )2597 {2598 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )2599 {2600 pMask[uiPelX + uiPelY*uiWidth] = 0;2601 }2602 }2603 2604 for( ; uiPelY < uiHeight; uiPelY++ )2605 {2606 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )2607 {2608 pMask[uiPelX + uiPelY*uiWidth] = 1;2609 }2610 }2611 }2612 else if( uiPartitionSize == SIZE_Nx2N || uiPartitionSize == SIZE_nLx2N || uiPartitionSize == SIZE_nRx2N )2613 {2614 for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ )2615 {2616 for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )2617 {2618 pMask[uiPelX + uiPelY*uiWidth] = 0;2619 }2620 2621 for( ; uiPelX < uiWidth; uiPelX++ )2622 {2623 pMask[uiPelX + uiPelY*uiWidth] = 1;2624 }2625 }2626 }2627 else if( uiPartitionSize == SIZE_NxN )2628 {2629 for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ )2630 {2631 for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )2632 {2633 pMask[uiPelX + uiPelY*uiWidth] = 0;2634 }2635 2636 for( ; uiPelX < uiWidth; uiPelX++ )2637 {2638 pMask[uiPelX + uiPelY*uiWidth] = 1;2639 }2640 }2641 2642 for( ; uiPelY < uiHeight; uiPelY++ )2643 {2644 for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )2645 {2646 pMask[uiPelX + uiPelY*uiWidth] = 2;2647 }2648 2649 for( ; uiPelX < uiWidth; uiPelX++ )2650 {2651 pMask[uiPelX + uiPelY*uiWidth] = 3;2652 }2653 }2654 }2655 2656 }2657 #endif2658 #endif2659 2660 2377 #if QC_GENERIC_SDC_G0122 2661 2378 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx ) 2662 2379 { 2663 #if QC_SDC_UNIFY_G01302664 2380 return 0; 2665 #else2666 TComDataCU* pcTempCU;2667 UInt uiTempPartIdx;2668 UInt uiCtx = 0;2669 2670 // Get BCBP of left PU2671 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );2672 uiCtx = ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;2673 2674 // Get BCBP of above PU2675 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );2676 uiCtx += ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;2677 2678 return uiCtx;2679 #endif2680 2381 } 2681 2382 … … 7193 6894 TComDataCU* pcBaseCU; 7194 6895 Int iPartition = 0; 7195 #if !KHU_SIMP_SPIVMP_G01477196 Int iInterDirLast = 0;7197 TComMvField cMvFieldLast[2];7198 #endif7199 6896 7200 6897 Int iDelX = iSPWidth/2; 7201 6898 Int iDelY = iSPHeight/2; 7202 6899 7203 #if KHU_SIMP_SPIVMP_G01477204 6900 Int iCenterPosX = iCurrPosX + ( ( iWidth / iSPWidth ) >> 1 ) * iSPWidth + ( iSPWidth >> 1 ); 7205 6901 Int iCenterPosY = iCurrPosY + ( ( iHeight / iSPHeight ) >> 1 ) * iSPHeight + (iSPHeight >> 1); … … 7269 6965 if(availableMcDc[0]) 7270 6966 { 7271 #endif 6967 7272 6968 Int iBasePosX, iBasePosY; 7273 6969 for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight) … … 7328 7024 if (puhInterDirSP[iPartition] == 0) 7329 7025 { 7330 #if KHU_SIMP_SPIVMP_G01477331 7026 puhInterDirSP[iPartition] = availableMcDc[0]; 7332 7027 pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]); 7333 7028 pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]); 7334 #else 7335 if (iInterDirLast != 0) 7336 { 7337 puhInterDirSP[iPartition] = iInterDirLast; 7338 pcMvFieldSP[2*iPartition] = cMvFieldLast[0]; 7339 pcMvFieldSP[2*iPartition + 1] = cMvFieldLast[1]; 7340 } 7341 #endif 7029 7342 7030 } 7343 #if !KHU_SIMP_SPIVMP_G01477344 else7345 {7346 if (iInterDirLast ==0)7347 {7348 availableMcDc[0] = puhInterDirSP[iPartition];7349 paiPdmRefIdx [ 0 ] = pcMvFieldSP[2*iPartition].getRefIdx();7350 pacPdmMv [ 0 ] = pcMvFieldSP[2*iPartition].getMv();7351 paiPdmRefIdx [ 1 ] = pcMvFieldSP[2*iPartition+1].getRefIdx();7352 pacPdmMv [ 1 ] = pcMvFieldSP[2*iPartition+1].getMv();7353 7354 if (iPartition != 0)7355 {7356 for (Int iPart = iPartition-1; iPart >= 0; iPart--)7357 {7358 puhInterDirSP[iPart] = puhInterDirSP[iPartition];7359 pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition];7360 pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1];7361 }7362 }7363 }7364 iInterDirLast = puhInterDirSP[iPartition];7365 cMvFieldLast[0] = pcMvFieldSP[2*iPartition];7366 cMvFieldLast[1] = pcMvFieldSP[2*iPartition + 1];7367 }7368 #endif7369 7031 iPartition ++; 7370 7371 7032 } 7372 7033 } 7373 #if KHU_SIMP_SPIVMP_G0147 7374 } 7375 #endif 7034 } 7376 7035 } 7377 7036 -
branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.h
r876 r877 192 192 #if H_3D_DIM_SDC 193 193 Bool* m_pbSDCFlag; 194 #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101195 Pel* m_apSegmentDCOffset[4];196 #else197 194 Pel* m_apSegmentDCOffset[2]; 198 #endif199 #endif200 #endif201 #if H_3D_INTER_SDC202 #if !QC_SDC_UNIFY_G0130203 Bool* m_pbInterSDCFlag;204 Int* m_apSegmentInterDCOffset[4];205 #endif206 #if !SEC_INTER_SDC_G0101207 UChar* m_pucInterSDCMask;208 195 #endif 209 196 #endif … … 575 562 #endif 576 563 #endif 577 #if H_3D_INTER_SDC578 #if !QC_SDC_UNIFY_G0130579 Bool* getInterSDCFlag () { return m_pbInterSDCFlag; }580 Bool getInterSDCFlag ( UInt uiIdx ) { return m_pbInterSDCFlag[uiIdx]; }581 Void setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );582 UInt getCtxInterSDCFlag ( UInt uiAbsPartIdx );583 Int* getInterSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentInterDCOffset[uiSeg]; }584 Int getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; }585 Void setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; }586 587 #endif588 #if !SEC_INTER_SDC_G0101589 Void xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask );590 591 UChar* getInterSDCMask () { return m_pucInterSDCMask; }592 #endif593 #endif594 564 595 565 // ------------------------------------------------------------------------------------------------------------------- -
branches/HTM-10.1-dev0/source/Lib/TLibCommon/TypeDef.h
r876 r877 183 183 // SEC_DMM3_RBC_F0147 Removal of DMM3 and RBC from DMMs 184 184 // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes 185 // Unify intra SDC and inter SDC 186 185 187 186 188 #define H_3D_INTER_SDC 1 // INTER SDC, Inter simplified depth coding 187 // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding 189 // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding 190 // SEC_INTER_SDC_G0101 Improved inter SDC with multiple DC candidates 191 188 192 #define H_3D_SPIVMP 1 // H_3D_SPIVMP // JCT3V-F0110: Sub-PU level inter-view motion prediction 189 193 // SEC_SPIVMP_MCP_SIZE_G0077, Apply SPIVMP only to 2Nx2N partition, JCT3V-G0077 190 194 // QC_SPIVMP_MPI_G0119 Sub-PU level MPI merge candidate 195 // Simplification on Sub-PU level temporal interview motion prediction 191 196 #define H_3D_FCO 0 // Flexible coding order for 3D 192 197 … … 313 318 #define SCU_HS_DEPTH_DC_PRED_G0143 1 314 319 #define QC_GENERIC_SDC_G0122 1 // Generalize SDC to all depth intra modes 315 #if H_3D_DIM_SDC && H_3D_INTER_SDC 316 #define QC_SDC_UNIFY_G0130 1 // Unify intra SDC and inter SDC 317 #define QC_SDC_UNIFY_G0130_FIX 1 // Fix bug of G0130 318 #define QC_SDC_UNIFY_G0130_FIX2 1 // Fix bug of G0130 319 #endif 320 #define SEC_INTER_SDC_G0101 1 // Improved inter SDC with multiple DC candidates 321 #endif 322 323 #define KHU_SIMP_SPIVMP_G0147 1 // Simplification on Sub-PU level temporal interview motion prediction 320 #endif 321 324 322 325 323 #endif -
branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r876 r877 3093 3093 #endif 3094 3094 #if H_3D_INTER_SDC 3095 #if QC_SDC_UNIFY_G01303096 3095 Void TDecCavlc::parseDeltaDC( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 3097 3096 { … … 3103 3102 assert(0); 3104 3103 } 3105 #else 3106 Void TDecCavlc::parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 3107 { 3108 assert(0); 3109 } 3110 3111 Void TDecCavlc::parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) 3112 { 3113 assert(0); 3114 } 3115 #endif 3104 3116 3105 #endif 3117 3106 #if H_3D_DBBP -
branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.h
r872 r877 124 124 #endif 125 125 #if H_3D_INTER_SDC 126 #if QC_SDC_UNIFY_G0130127 126 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 128 127 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 129 #else130 Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );131 Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );132 #endif133 128 #endif 134 129 #if H_3D_DBBP -
branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r876 r877 539 539 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 540 540 541 #if QC_SDC_UNIFY_G0130541 #if H_3D_DIM_SDC 542 542 m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 543 543 #endif … … 561 561 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) 562 562 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 563 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130564 m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );565 #endif566 563 // Coefficient decoding 567 564 Bool bCodeDQP = getdQPFlag(); … … 651 648 #endif 652 649 #if H_3D_INTER_SDC 653 #if QC_SDC_UNIFY_G0130654 650 if( m_ppcCU[uiDepth]->getSDCFlag( 0 ) ) 655 #else656 if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) )657 #endif658 651 { 659 652 xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); … … 718 711 UInt uiWidth = pcCU->getWidth ( 0 ); 719 712 UInt uiHeight = pcCU->getHeight( 0 ); 720 #if !SEC_INTER_SDC_G0101721 UChar* pMask = pcCU->getInterSDCMask();722 723 memset( pMask, 0, uiWidth*uiHeight );724 pcCU->xSetInterSDCCUMask( pcCU, pMask );725 #endif726 713 727 714 Pel *pResi; … … 734 721 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 735 722 { 736 #if SEC_INTER_SDC_G0101737 723 pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( 0, 0 ); 738 #else739 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];740 #if QC_SDC_UNIFY_G0130741 pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( uiSeg, 0 );742 #else743 pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 );744 #endif745 #endif746 724 } 747 725 pResi += uiResiStride; -
branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
r876 r877 779 779 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 780 780 UInt uiChromaOffset = uiLumaOffset>>2; 781 #if QC_SDC_UNIFY_G0130782 781 #if H_3D_DIM_SDC 783 782 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) ) … … 789 788 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 790 789 } 791 #endif792 790 793 791 #if H_3D_INTER_SDC … … 799 797 } 800 798 #endif 801 #if QC_SDC_UNIFY_G0130_FIX802 799 if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) ) 803 #else804 if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) )805 #endif806 800 { 807 801 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; … … 824 818 } 825 819 } 826 #else827 #if H_3D_DIM_SDC828 if( pcCU->getSDCFlag( uiAbsPartIdx ) )829 {830 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );831 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );832 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );833 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );834 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );835 return;836 }837 #endif838 839 #if H_3D_INTER_SDC840 if( pcCU->getInterSDCFlag( uiAbsPartIdx ) )841 {842 assert( !pcCU->isSkipped( uiAbsPartIdx ) );843 assert( !pcCU->isIntra( uiAbsPartIdx) );844 assert( pcCU->getSlice()->getIsDepth() );845 846 decodeInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth );847 return;848 }849 #endif850 820 #endif 851 821 … … 875 845 876 846 #if H_3D_INTER_SDC 877 #if QC_SDC_UNIFY_G0130878 847 Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 879 848 { … … 886 855 } 887 856 888 #if SEC_INTER_SDC_G0101889 857 if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) ) 890 #else891 if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) )892 #endif893 858 { 894 859 return; 895 860 } 896 861 897 #if SEC_INTER_SDC_G0101898 862 assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 899 #else900 assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );901 #endif902 903 863 m_pcEntropyDecoderIf->parseSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 904 864 } 905 906 #else907 Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )908 {909 pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth);910 911 if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )912 {913 return;914 }915 916 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) )917 {918 return;919 }920 921 m_pcEntropyDecoderIf->parseInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );922 }923 924 Void TDecEntropy::decodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )925 {926 if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )927 {928 return;929 }930 931 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || !pcCU->getInterSDCFlag( uiAbsPartIdx ) )932 {933 return;934 }935 936 UInt uiNumSegments = ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ? 1 : ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 );937 938 // decode residual data for each segment939 for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )940 {941 m_pcEntropyDecoderIf->parseInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth, uiSeg );942 }943 }944 #endif945 865 #endif 946 866 #if H_3D_DBBP -
branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecEntropy.h
r872 r877 96 96 #endif 97 97 #if H_3D_INTER_SDC 98 #if QC_SDC_UNIFY_G013099 98 virtual Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0; 100 99 virtual Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 101 #else102 virtual Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;103 virtual Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0;104 #endif105 100 #endif 106 101 #if H_3D_DBBP … … 187 182 #endif 188 183 #if H_3D_INTER_SDC 189 #if QC_SDC_UNIFY_G0130190 184 Void decodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 191 #else192 Void decodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );193 Void decodeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );194 #endif195 185 #endif 196 186 #if H_3D_DBBP -
branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r876 r877 88 88 #if QC_GENERIC_SDC_G0122 89 89 , m_cAngleFlagSCModel ( 1, 1, NUM_ANGLE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 90 #if !QC_SDC_UNIFY_G013091 , m_cIntraSdcFlagSCModel ( 1, 1, NUM_INTRASDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)92 #endif93 90 #endif 94 91 #if H_3D_DIM_DMM … … 100 97 #endif 101 98 #endif 102 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 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 107 #if QC_SDC_UNIFY_G0130 99 #if H_3D_DIM_SDC 108 100 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 109 101 #endif … … 182 174 #if QC_GENERIC_SDC_G0122 183 175 m_cAngleFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 184 #if !QC_SDC_UNIFY_G0130185 m_cIntraSdcFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTRASDC_FLAG );186 #endif187 176 #endif 188 177 #if H_3D_DIM_DMM … … 194 183 #endif 195 184 #endif 196 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 197 m_cInterSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 198 m_cInterSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 199 m_cInterSDCResidualSignFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 200 #endif 201 #if QC_SDC_UNIFY_G0130 185 #if H_3D_DIM_SDC 202 186 m_cSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_FLAG ); 203 187 #endif … … 262 246 #if QC_GENERIC_SDC_G0122 263 247 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 264 #if !QC_SDC_UNIFY_G0130265 m_cIntraSdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );266 #endif267 248 #endif 268 249 #if H_3D_DIM_DMM … … 274 255 #endif 275 256 #endif 276 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 277 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 278 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 279 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 280 #endif 281 #if QC_SDC_UNIFY_G0130 257 #if H_3D_DIM_SDC 282 258 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 283 259 #endif … … 1171 1147 } 1172 1148 1173 #if !QC_SDC_UNIFY_G01301174 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )1175 {1176 UInt symbol;1177 #if QC_GENERIC_SDC_G01221178 UInt uiNumSegments = isDimMode( dir ) ? 2 : 1;1179 #else1180 UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;1181 #endif1182 1183 if( pcCU->getSDCFlag( absPartIdx ) )1184 {1185 assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N);1186 pcCU->setTrIdxSubParts(0, absPartIdx, depth);1187 pcCU->setCbfSubParts(1, 1, 1, absPartIdx, depth);1188 }1189 1190 m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );1191 1192 if( symbol )1193 {1194 if( !pcCU->getSDCFlag( absPartIdx ) )1195 {1196 dir += symbol;1197 }1198 }1199 for( UInt segment = 0; segment < uiNumSegments; segment++ )1200 {1201 Pel valDeltaDC = 0;1202 if( symbol )1203 {1204 xParseDimDeltaDC( valDeltaDC, uiNumSegments );1205 }1206 1207 if( pcCU->getSDCFlag( absPartIdx ) )1208 {1209 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );1210 }1211 else1212 {1213 pcCU->setDimDeltaDC( dimType, segment, absPartIdx, valDeltaDC );1214 }1215 }1216 }1217 #endif1218 1149 pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth ); 1219 1150 } … … 1234 1165 uiIsDimMode = uiSymbol ? 0 : 1; 1235 1166 pcCU->setLumaIntraDirSubParts( 0, absPartIdx, depth ); 1236 #if !QC_SDC_UNIFY_G0130 1237 if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case 1238 { 1239 m_pcTDecBinIf->decodeBin( uiSymbol, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) ); 1240 } 1241 else 1242 { 1243 uiSymbol = 0; 1244 } 1245 1246 pcCU->setSDCFlagSubParts( uiSymbol, absPartIdx, depth ); 1247 #endif 1167 1248 1168 //decode DMM index 1249 1169 if( uiIsDimMode ) … … 2227 2147 2228 2148 #if H_3D_INTER_SDC 2229 #if QC_SDC_UNIFY_G01302230 2149 Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2231 2150 { … … 2258 2177 else 2259 2178 { 2260 #if SEC_INTER_SDC_G01012261 2179 uiNumSegments = 1; 2262 #else2263 PartSize cPartSize = pcCU->getPartitionSize( absPartIdx );2264 uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 );2265 #endif2266 2180 symbol = 1; 2267 2181 } … … 2314 2228 } 2315 2229 } 2316 #else 2317 Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2318 { 2319 UInt uiSymbol = 0; 2320 UInt uiCtxInterSDCFlag = pcCU->getCtxInterSDCFlag( uiAbsPartIdx ); 2321 2322 m_pcTDecBinIf->decodeBin( uiSymbol, m_cInterSDCFlagSCModel.get( 0, 0, uiCtxInterSDCFlag ) ); 2323 2324 if( uiSymbol ) 2325 { 2326 pcCU->setInterSDCFlagSubParts( true, uiAbsPartIdx, 0, uiDepth ); 2327 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); 2328 pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth ); 2329 } 2330 else 2331 { 2332 pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth); 2333 } 2334 } 2335 2336 Void TDecSbac::parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment ) 2337 { 2338 UInt uiAbsIdx = 0; 2339 UInt uiSign = 0; 2340 Int iIdx = 0; 2341 2342 xReadExGolombLevel( uiAbsIdx, m_cInterSDCResidualSCModel.get( 0, 0, 0 ) ); 2343 2344 uiAbsIdx++; 2345 m_pcTDecBinIf->decodeBin( uiSign, m_cInterSDCResidualSignFlagSCModel.get( 0, 0, 0 ) ); 2346 iIdx = (Int)( uiSign ? -1 : 1 ) * uiAbsIdx; 2347 2348 pcCU->setInterSDCSegmentDCOffset( iIdx, uiSegment, uiAbsPartIdx ); 2349 } 2350 #endif 2230 2351 2231 #endif 2352 2232 -
branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecSbac.h
r872 r877 112 112 #endif 113 113 #if H_3D_INTER_SDC 114 #if QC_SDC_UNIFY_G0130115 114 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 116 115 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 117 #else118 Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );119 Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );120 #endif121 116 #endif 122 117 #if H_3D_DBBP … … 220 215 #if QC_GENERIC_SDC_G0122 221 216 ContextModel3DBuffer m_cAngleFlagSCModel; 222 #if !QC_SDC_UNIFY_G0130223 ContextModel3DBuffer m_cIntraSdcFlagSCModel;224 #endif225 217 #endif 226 218 #if H_3D_DIM_DMM … … 232 224 #endif 233 225 #endif 234 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 235 ContextModel3DBuffer m_cInterSDCFlagSCModel; 236 ContextModel3DBuffer m_cInterSDCResidualSCModel; 237 ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel; 238 #endif 239 #if QC_SDC_UNIFY_G0130 226 #if H_3D_DIM_SDC 240 227 ContextModel3DBuffer m_cSDCFlagSCModel; 241 228 #endif -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
r876 r877 2814 2814 2815 2815 #if H_3D_INTER_SDC 2816 #if QC_SDC_UNIFY_G01302817 2816 Void TEncCavlc::codeDeltaDC( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2818 2817 { … … 2824 2823 assert(0); 2825 2824 } 2826 #else 2827 Void TEncCavlc::codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2828 { 2829 assert(0); 2830 } 2831 2832 Void TEncCavlc::codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) 2833 { 2834 assert(0); 2835 } 2836 #endif 2825 2837 2826 #endif 2838 2827 -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCavlc.h
r872 r877 133 133 #endif 134 134 #if H_3D_INTER_SDC 135 #if QC_SDC_UNIFY_G0130136 135 Void codeDeltaDC ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 137 136 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 138 #else139 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx );140 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );141 #endif142 137 #endif 143 138 #if H_3D_DBBP -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp
r876 r877 1542 1542 m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 1543 1543 1544 #if QC_SDC_UNIFY_G01301544 #if H_3D_DIM_SDC 1545 1545 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false ); 1546 1546 #endif … … 1566 1566 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1567 1567 #endif 1568 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G01301569 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, uiAbsPartIdx, false );1570 #endif1571 1572 1568 // Encode Coefficients 1573 1569 Bool bCodeDQP = getdQPFlag(); … … 1986 1982 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual ) 1987 1983 { 1988 #if SEC_INTER_SDC_G01011989 1984 for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ ) 1990 1985 { … … 2018 2013 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth ); 2019 2014 } 2020 #else2021 if( rpcTempCU != rpcTempCUPre )2022 {2023 rpcTempCU->initEstData( uhDepth, orgQP, bTransquantBypassFlag );2024 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth );2025 }2026 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );2027 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );2028 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth );2029 #if H_3D_VSO //M22030 if( m_pcRdCost->getUseRenModel() )2031 { //Reset2032 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ();2033 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight ();2034 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr ();2035 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride ();2036 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );2037 }2038 #endif2039 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU,2040 m_ppcOrigYuv[uhDepth],2041 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth],2042 m_ppcResiYuvTemp[uhDepth],2043 m_ppcRecoYuvTemp[uhDepth],2044 uhDepth );2045 2046 xCheckDQP( rpcTempCU );2047 xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth );2048 #endif2049 2015 } 2050 2016 #endif … … 2251 2217 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2252 2218 #if H_3D_INTER_SDC 2253 #if SEC_INTER_SDC_G0101 // ONLY_2NX2N_SDC2254 2219 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && ePartSize == SIZE_2Nx2N) 2255 #else 2256 if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() ) 2257 #endif 2258 { 2259 #if SEC_INTER_SDC_G0101 2220 { 2260 2221 for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ ) 2261 2222 { … … 2295 2256 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2296 2257 } 2297 #else 2298 if( rpcTempCU != rpcTempCUPre ) 2299 { 2300 Int orgQP = rpcBestCU->getQP( 0 ); 2301 rpcTempCU->initEstData( uhDepth, orgQP ); 2302 rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth ); 2303 } 2304 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2305 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2306 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); 2307 #if H_3D_VSO // M3 2308 if( m_pcRdCost->getUseRenModel() ) 2309 { 2310 UInt uiWidth = m_ppcOrigYuv[uhDepth]->getWidth ( ); 2311 UInt uiHeight = m_ppcOrigYuv[uhDepth]->getHeight( ); 2312 Pel* piSrc = m_ppcOrigYuv[uhDepth]->getLumaAddr( ); 2313 UInt uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride(); 2314 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2315 } 2316 #endif 2317 2318 m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 2319 m_ppcOrigYuv[uhDepth], 2320 ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 2321 m_ppcResiYuvTemp[uhDepth], 2322 m_ppcRecoYuvTemp[uhDepth], 2323 uhDepth ); 2324 2325 xCheckDQP( rpcTempCU ); 2326 xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth); 2327 #endif 2258 2328 2259 } 2329 2260 #endif … … 2568 2499 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2569 2500 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); 2570 #if QC_SDC_UNIFY_G01302501 #if H_3D_DIM_SDC 2571 2502 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2572 2503 #endif … … 2625 2556 m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0, true ); 2626 2557 m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true ); 2627 #if QC_SDC_UNIFY_G01302558 #if H_3D_DIM_SDC 2628 2559 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2629 2560 #endif -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
r876 r877 666 666 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 667 667 UInt uiChromaOffset = uiLumaOffset>>2; 668 #if QC_SDC_UNIFY_G0130669 668 #if H_3D_DIM_SDC 670 669 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx ) ) … … 676 675 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 677 676 } 678 #endif 679 680 #if H_3D_INTER_SDC 677 681 678 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) ) 682 679 { … … 685 682 assert( pcCU->getSlice()->getIsDepth() ); 686 683 } 687 #endif 688 #if QC_SDC_UNIFY_G0130_FIX 684 689 685 if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) ) 690 #else691 if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) )692 #endif693 686 { 694 687 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; … … 711 704 } 712 705 } 713 #else714 #if H_3D_DIM_SDC715 if( pcCU->getSDCFlag( uiAbsPartIdx ) )716 {717 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );718 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );719 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );720 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );721 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );722 return;723 }724 #endif725 726 #if H_3D_INTER_SDC727 if( pcCU->getInterSDCFlag( uiAbsPartIdx ) )728 {729 assert( !pcCU->isSkipped( uiAbsPartIdx ) );730 assert( !pcCU->isIntra( uiAbsPartIdx) );731 assert( pcCU->getSlice()->getIsDepth() );732 733 encodeInterSDCResidualData( pcCU, uiAbsPartIdx, false );734 return;735 }736 #endif737 706 #endif 738 707 … … 795 764 796 765 #if H_3D_INTER_SDC 797 #if QC_SDC_UNIFY_G0130798 766 Void TEncEntropy::encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ) 799 767 { … … 809 777 } 810 778 811 #if SEC_INTER_SDC_G0101812 779 if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) ) 813 #else 814 if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) ) 815 #endif 816 { 817 return; 818 } 819 820 #if SEC_INTER_SDC_G0101 780 { 781 return; 782 } 783 821 784 assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 822 #else823 assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );824 #endif825 785 826 786 if( bRD ) … … 831 791 m_pcEntropyCoderIf->codeSDCFlag( pcCU, uiAbsPartIdx ); 832 792 } 833 #else 834 Void TEncEntropy::encodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 835 { 836 if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) 837 { 838 return; 839 } 840 841 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) ) 842 { 843 return; 844 } 845 846 if( bRD ) 847 { 848 uiAbsPartIdx = 0; 849 } 850 851 m_pcEntropyCoderIf->codeInterSDCFlag( pcCU, uiAbsPartIdx ); 852 } 853 854 Void TEncEntropy::encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 855 { 856 if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) 857 { 858 return; 859 } 860 861 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || !pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 862 { 863 return; 864 } 865 866 if( bRD ) 867 { 868 uiAbsPartIdx = 0; 869 } 870 871 // number of segments depends on prediction mode for INTRA 872 UInt uiNumSegments = ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ? 1 : ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 ); 873 874 // encode residual data for each segment 875 for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ ) 876 { 877 m_pcEntropyCoderIf->codeInterSDCResidualData( pcCU, uiAbsPartIdx, uiSeg ); 878 } 879 } 880 #endif 793 881 794 #endif 882 795 #if H_3D_DBBP -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncEntropy.h
r872 r877 95 95 #endif 96 96 #if H_3D_INTER_SDC 97 #if QC_SDC_UNIFY_G013098 97 virtual Void codeDeltaDC ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 99 98 virtual Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 100 #else101 virtual Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;102 virtual Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0;103 #endif104 99 #endif 105 100 #if H_3D_DBBP … … 190 185 #endif 191 186 #if H_3D_INTER_SDC 192 #if QC_SDC_UNIFY_G0130193 187 Void encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 194 188 Void encodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 195 #else196 Void encodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );197 Void encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD );198 #endif199 189 #endif 200 190 #if H_3D_DBBP -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
r876 r877 94 94 #if QC_GENERIC_SDC_G0122 95 95 , m_cAngleFlagSCModel ( 1, 1, NUM_ANGLE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 96 #if !QC_SDC_UNIFY_G013097 , m_cIntraSdcFlagSCModel ( 1, 1, NUM_INTRASDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels)98 #endif99 96 #endif 100 97 #if H_3D_DIM_DMM … … 106 103 #endif 107 104 #endif 108 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 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 113 #if QC_SDC_UNIFY_G0130 105 #if H_3D_DIM_SDC 114 106 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 115 107 #endif … … 180 172 #if QC_GENERIC_SDC_G0122 181 173 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 182 #if !QC_SDC_UNIFY_G0130183 m_cIntraSdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );184 #endif185 174 #endif 186 175 #if H_3D_DIM_DMM … … 192 181 #endif 193 182 #endif 194 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 195 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 196 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 197 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 198 #endif 199 #if QC_SDC_UNIFY_G0130 183 #if H_3D_DIM_SDC 200 184 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 201 185 #endif … … 240 224 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 241 225 #endif 242 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 243 curCost += m_cInterSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 244 curCost += m_cInterSDCResidualSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 245 curCost += m_cInterSDCResidualSignFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 246 #endif 247 #if QC_SDC_UNIFY_G0130 226 #if H_3D_DIM_SDC 248 227 curCost += m_cSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SDC_FLAG ); 249 228 #endif … … 281 260 #if QC_GENERIC_SDC_G0122 282 261 curCost += m_cAngleFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 283 #if !QC_SDC_UNIFY_G0130284 curCost += m_cIntraSdcFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTRASDC_FLAG );285 #endif286 262 #endif 287 263 #if H_3D_DIM_DMM … … 350 326 #if QC_GENERIC_SDC_G0122 351 327 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 352 #if !QC_SDC_UNIFY_G0130353 m_cIntraSdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );354 #endif355 328 #endif 356 329 #if H_3D_DIM_DMM … … 362 335 #endif 363 336 #endif 364 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 365 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 366 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 367 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 368 #endif 369 #if QC_SDC_UNIFY_G0130 337 #if H_3D_DIM_SDC 370 338 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 371 339 #endif … … 674 642 #if QC_GENERIC_SDC_G0122 675 643 this->m_cAngleFlagSCModel .copyFrom( &pSrc->m_cAngleFlagSCModel ); 676 #if !QC_SDC_UNIFY_G0130677 this->m_cIntraSdcFlagSCModel .copyFrom( &pSrc->m_cIntraSdcFlagSCModel );678 #endif679 644 #endif 680 645 } … … 1290 1255 default: break; 1291 1256 } 1292 #if !QC_SDC_UNIFY_G01301293 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )1294 {1295 UInt dimDeltaDC;1296 Pel deltaDC;1297 #if QC_GENERIC_SDC_G01221298 UInt uiNumSegments = isDimMode( dir ) ? 2 : 1;1299 #else1300 UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;1301 #endif1302 if( pcCU->getSDCFlag( absPartIdx ) )1303 {1304 if( uiNumSegments==1 )1305 {1306 dimDeltaDC = pcCU->getSDCSegmentDCOffset(0, absPartIdx) ? 1 : 0;1307 }1308 else1309 {1310 dimDeltaDC = ( pcCU->getSDCSegmentDCOffset(0, absPartIdx) || pcCU->getSDCSegmentDCOffset(1, absPartIdx) ) ? 1 : 0;1311 }1312 }1313 else1314 {1315 dimDeltaDC = isDimDeltaDC( dir );1316 }1317 1318 m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );1319 1320 if( dimDeltaDC )1321 {1322 for( UInt segment = 0; segment < uiNumSegments; segment++ )1323 {1324 deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset(segment, absPartIdx) : pcCU->getDimDeltaDC( dimType, segment, absPartIdx );1325 xCodeDimDeltaDC( deltaDC, uiNumSegments );1326 }1327 }1328 }1329 #endif1330 1257 } 1331 1258 … … 1339 1266 m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) ); 1340 1267 } 1341 #if !QC_SDC_UNIFY_G01301342 if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case1343 {1344 m_pcBinIf->encodeBin( pcCU->getSDCFlag( absPartIdx ) ? 1 : 0, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) );1345 }1346 #endif1347 1268 if( isDimMode( dir ) ) 1348 1269 { … … 2435 2356 2436 2357 #if H_3D_INTER_SDC 2437 #if QC_SDC_UNIFY_G01302438 2358 Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx ) 2439 2359 { … … 2471 2391 else //all-zero inter SDC is not allowed 2472 2392 { 2473 #if SEC_INTER_SDC_G01012474 2393 uiNumSegments = 1; 2475 #else2476 PartSize cPartSize = pcCU->getPartitionSize( absPartIdx );2477 uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 );2478 #endif2479 2394 dimDeltaDC = 1; 2480 2395 } … … 2508 2423 m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) ); 2509 2424 } 2510 #else 2511 Void TEncSbac::codeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2512 { 2513 UInt uiSymbol = pcCU->getInterSDCFlag( uiAbsPartIdx ) ? 1 : 0; 2514 UInt uiCtxInterSDCFlag = pcCU->getCtxInterSDCFlag( uiAbsPartIdx ); 2515 2516 m_pcBinIf->encodeBin( uiSymbol, m_cInterSDCFlagSCModel.get( 0, 0, uiCtxInterSDCFlag ) ); 2517 } 2518 2519 Void TEncSbac::codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) 2520 { 2521 Pel segmentDCOffset = pcCU->getInterSDCSegmentDCOffset( uiSegment, uiAbsPartIdx ); 2522 2523 UInt uiSign = segmentDCOffset < 0 ? 1 : 0; 2524 UInt uiAbsIdx = abs( segmentDCOffset ); 2525 2526 assert( uiAbsIdx > 0 ); 2527 uiAbsIdx--; 2528 xWriteExGolombLevel( uiAbsIdx, m_cInterSDCResidualSCModel.get( 0, 0, 0 ) ); 2529 m_pcBinIf->encodeBin( uiSign, m_cInterSDCResidualSignFlagSCModel.get( 0, 0, 0 ) ); 2530 } 2531 #endif 2425 2532 2426 #endif 2533 2427 -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSbac.h
r872 r877 162 162 #endif 163 163 #if H_3D_INTER_SDC 164 #if QC_SDC_UNIFY_G0130165 164 Void codeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 166 165 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 167 #else168 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx );169 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );170 #endif171 166 #endif 172 167 #if H_3D_DBBP … … 264 259 #if QC_GENERIC_SDC_G0122 265 260 ContextModel3DBuffer m_cAngleFlagSCModel; 266 #if !QC_SDC_UNIFY_G0130267 ContextModel3DBuffer m_cIntraSdcFlagSCModel;268 #endif269 261 #endif 270 262 #if H_3D_DIM_DMM … … 276 268 #endif 277 269 #endif 278 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 279 ContextModel3DBuffer m_cInterSDCFlagSCModel; 280 ContextModel3DBuffer m_cInterSDCResidualSCModel; 281 ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel; 282 #endif 283 #if QC_SDC_UNIFY_G0130 270 #if H_3D_DIM_SDC 284 271 ContextModel3DBuffer m_cSDCFlagSCModel; 285 272 #endif -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r876 r877 920 920 m_pcEntropyCoder ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 921 921 922 #if QC_SDC_UNIFY_G0130922 #if H_3D_DIM_SDC 923 923 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 924 924 #endif … … 939 939 { 940 940 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 ); 941 #if QC_SDC_UNIFY_G0130_FIX941 #if H_3D_DIM_SDC 942 942 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && getDimType( pcCU->getLumaIntraDir( 0 ) ) < DIM_NUM_TYPE ) 943 943 { … … 956 956 { 957 957 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPart * uiQNumParts ); 958 #if QC_SDC_UNIFY_G0130_FIX958 #if H_3D_DIM_SDC 959 959 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && getDimType( pcCU->getLumaIntraDir( uiPart * uiQNumParts ) ) < DIM_NUM_TYPE ) 960 960 { … … 967 967 { 968 968 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx ); 969 #if QC_SDC_UNIFY_G0130_FIX969 #if H_3D_DIM_SDC 970 970 if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) < DIM_NUM_TYPE ) 971 971 { … … 975 975 } 976 976 } 977 #if QC_SDC_UNIFY_G0130 && !QC_SDC_UNIFY_G0130_FIX 978 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 979 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 980 981 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 982 { 983 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 984 { 985 if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 986 { 987 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart ); 988 } 989 } 990 } 991 #endif 977 992 978 } 993 979 if( bChroma ) … … 2186 2172 2187 2173 // encode reduced intra header 2188 #if QC_SDC_UNIFY_G01302174 #if H_3D_DIM_SDC 2189 2175 if( !pcCU->getSlice()->isIntra() ) 2190 2176 { … … 2197 2183 } 2198 2184 2199 #if QC_SDC_UNIFY_G0130_FIX22200 2185 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth( 0 ), true ); 2201 #else2202 m_pcEntropyCoder->encodePartSize( pcCU, 0, true );2203 #endif2204 2186 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 2205 2187 #else … … 2209 2191 // encode pred direction + DC residual data 2210 2192 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 2211 #if QC_SDC_UNIFY_G01302193 #if H_3D_DIM_SDC 2212 2194 Bool bDummy = false; 2213 2195 m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy ); … … 5875 5857 5876 5858 #if H_3D_INTER_SDC 5877 #if SEC_INTER_SDC_G01015878 5859 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, Int uiOffest, const UInt uiDepth ) 5879 #else5880 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, const UInt uiDepth )5881 #endif5882 5860 { 5883 5861 if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( 0 ) ) … … 5885 5863 return; 5886 5864 } 5887 #if QC_SDC_UNIFY_G01305888 5865 pcCU->setSDCFlagSubParts( true, 0, uiDepth ); 5889 #else 5890 pcCU->setInterSDCFlagSubParts( true, 0, 0, uiDepth ); 5891 #endif 5892 5893 UInt uiWidth = pcCU->getWidth ( 0 ); 5894 UInt uiHeight = pcCU->getHeight( 0 ); 5895 #if SEC_INTER_SDC_G0101 5896 UInt uiSegSize = 0; 5897 #else 5898 UChar* pMask = pcCU->getInterSDCMask(); 5899 memset( pMask, 0, uiWidth*uiHeight ); 5900 5901 pcCU->xSetInterSDCCUMask( pcCU, pMask ); 5902 5903 UInt uiSegSize[4] = { 0, 0, 0, 0 }; 5904 #endif 5866 5867 UInt uiWidth = pcCU->getWidth ( 0 ); 5868 UInt uiHeight = pcCU->getHeight( 0 ); 5869 UInt uiSegSize = 0; 5870 5905 5871 Pel *pPred, *pOrg; 5906 5872 UInt uiPredStride = pcPred->getStride(); 5907 5873 UInt uiOrgStride = pcOrg->getStride(); 5908 5874 UInt uiPelX, uiPelY; 5909 #if !SEC_INTER_SDC_G01015910 UInt uiPartitionSize = pcCU->getPartitionSize( 0 );5911 UInt uiSegmentNum = ( uiPartitionSize == SIZE_2Nx2N ) ? 1 : ( uiPartitionSize == SIZE_NxN ? 4 : 2 );5912 #endif5913 5875 5914 5876 pPred = pcPred->getLumaAddr( 0 ); 5915 5877 pOrg = pcOrg->getLumaAddr( 0 ); 5916 #if SEC_INTER_SDC_G01015917 5878 Int pResDC = 0; 5918 #else5919 Int pResDC[4] = { 0, 0, 0, 0};5920 #endif5921 5879 5922 5880 //calculate dc value for prediction and original signal, and calculate residual and reconstruction … … 5925 5883 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 5926 5884 { 5927 #if SEC_INTER_SDC_G01015928 5885 pResDC += (Int)( pOrg [uiPelX] - pPred[uiPelX] ); 5929 5886 uiSegSize++; 5930 #else5931 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];5932 pResDC[uiSeg] += (Int)( pOrg [uiPelX] - pPred[uiPelX] );5933 uiSegSize[uiSeg]++;5934 #endif5935 5887 } 5936 5888 pOrg += uiOrgStride; … … 5938 5890 } 5939 5891 5940 #if SEC_INTER_SDC_G01015941 5892 Int iResiOffset = ( pResDC > 0 ? ( uiSegSize >> 1 ) : -1*( uiSegSize >> 1 ) ); 5942 5893 pResDC = ( pResDC + iResiOffset ) / (Int) uiSegSize; 5943 5894 5944 5895 pcCU->setSDCSegmentDCOffset( pResDC + uiOffest, 0, 0 ); 5945 #else 5946 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ ) 5947 { 5948 Int iResiOffset = ( pResDC [uiSeg] > 0 ? ( uiSegSize[uiSeg] >> 1 ) : -1*( uiSegSize[uiSeg] >> 1 ) ); 5949 pResDC [uiSeg] = ( pResDC [uiSeg] + iResiOffset ) / (Int) uiSegSize[uiSeg]; 5950 #if QC_SDC_UNIFY_G0130 5951 pcCU->setSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 ); 5952 #else 5953 pcCU->setInterSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 ); 5954 #endif 5955 } 5956 #endif 5896 5957 5897 5958 5898 Pel *pRec; … … 5965 5905 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 5966 5906 { 5967 #if SEC_INTER_SDC_G01015968 5907 pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pcCU->getSDCSegmentDCOffset(0, 0) ); 5969 #else5970 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];5971 assert( uiSeg < uiSegmentNum );5972 5973 pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pResDC[uiSeg] );5974 #endif5975 5908 } 5976 5909 pPred += uiPredStride; … … 6012 5945 #endif 6013 5946 6014 #if QC_SDC_UNIFY_G01305947 #if H_3D_DIM_SDC 6015 5948 Bool bNonSkip = false; 6016 5949 #else 6017 5950 Bool bNonSkip = true; 6018 5951 #endif 6019 #if SEC_INTER_SDC_G01016020 5952 bNonSkip |= ( pcCU->getSDCSegmentDCOffset( 0, 0 ) != 0 ) ? 1 : 0; 6021 #else6022 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ )6023 {6024 #if QC_SDC_UNIFY_G01306025 bNonSkip |= ( pcCU->getSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0;6026 #else6027 bNonSkip &= ( pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0;6028 #endif6029 }6030 #endif6031 6032 5953 if( !bNonSkip ) 6033 5954 { … … 7187 7108 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 7188 7109 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 7189 #if QC_SDC_UNIFY_G01307110 #if H_3D_DIM_SDC 7190 7111 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 7191 7112 #endif … … 7196 7117 #if H_3D_IC 7197 7118 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 7198 #endif7199 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G01307200 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, 0, true );7201 7119 #endif 7202 7120 Bool bDummy = false; -
branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.h
r872 r877 218 218 TComYuv* pcResi, 219 219 TComYuv* pcRec, 220 #if SEC_INTER_SDC_G0101221 220 Int uiOffset, 222 #endif223 221 const UInt uiDepth ); 224 222 #endif
Note: See TracChangeset for help on using the changeset viewer.