Changeset 782 in 3DVCSoftware for branches/HTM-9.3-dev3-Qualcomm/source
- Timestamp:
- 20 Jan 2014, 05:01:03 (11 years ago)
- Location:
- branches/HTM-9.3-dev3-Qualcomm/source/Lib
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h
r781 r782 119 119 #if QC_GENERIC_SDC_G0122 120 120 #define NUM_ANGLE_FLAG_CTX 3 121 #if !QC_SDC_UNIFY_G0130 121 122 #define NUM_INTRASDC_FLAG_CTX 3 123 #endif 122 124 #endif 123 125 #endif … … 128 130 #endif 129 131 130 #if H_3D_INTER_SDC 132 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 131 133 #define NUM_INTER_SDC_FLAG_CTX 1 ///< number of context models for inter SDC flag 132 134 #define NUM_INTER_SDC_SIGN_FLAG_CTX 1 ///< number of context models for sign of inter SDC residual 133 135 #define NUM_INTER_SDC_RESIDUAL_CTX 1 ///< number of context models for abs of inter SDC residual 136 #endif 137 #if QC_SDC_UNIFY_G0130 138 #define NUM_SDC_FLAG_CTX 1 ///< number of context models for inter SDC flag 134 139 #endif 135 140 // ==================================================================================================================== … … 417 422 { 155, 170, 157 }, 418 423 }; 424 #if !QC_SDC_UNIFY_G0130 419 425 static const UChar 420 426 INIT_INTRASDC_FLAG[3][NUM_INTRASDC_FLAG_CTX] = … … 425 431 }; 426 432 #endif 433 #endif 427 434 428 435 static const UChar … … 467 474 #endif 468 475 469 #if H_3D_INTER_SDC 476 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 470 477 static const UChar 471 478 INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] = … … 493 500 #endif 494 501 //! \} 495 496 497 #endif 502 #if QC_SDC_UNIFY_G0130 503 static const UChar 504 INIT_SDC_FLAG[3][NUM_SDC_FLAG_CTX] = 505 { 506 { 154 }, 507 { 154 }, 508 { 154 }, 509 }; 510 #endif 511 512 #endif -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp
r781 r782 123 123 #if H_3D_DIM_SDC 124 124 m_pbSDCFlag = NULL; 125 #if QC_SDC_UNIFY_G0130 126 for( Int i = 0; i < 4; i++ ) 127 { 128 m_apSegmentDCOffset[i] = NULL; 129 } 130 #else 125 131 m_apSegmentDCOffset[0] = NULL; 126 132 m_apSegmentDCOffset[1] = NULL; 133 #endif 127 134 #endif 128 135 #endif … … 146 153 #endif 147 154 #if H_3D_INTER_SDC 155 #if !QC_SDC_UNIFY_G0130 148 156 m_pbInterSDCFlag = NULL; 149 157 for( Int i = 0; i < 4; i++ ) … … 151 159 m_apSegmentInterDCOffset[i] = NULL; 152 160 } 161 #endif 153 162 m_pucInterSDCMask = NULL; 154 163 #endif … … 272 281 #if H_3D_DIM_SDC 273 282 m_pbSDCFlag = (Bool*)xMalloc(Bool, uiNumPartition); 283 #if QC_SDC_UNIFY_G0130 284 for( Int i = 0; i < 4; i++ ) 285 { 286 m_apSegmentDCOffset[i] = (Pel*)xMalloc(Pel, uiNumPartition); 287 } 288 #else 274 289 m_apSegmentDCOffset[0] = (Pel*)xMalloc(Pel, uiNumPartition); 275 290 m_apSegmentDCOffset[1] = (Pel*)xMalloc(Pel, uiNumPartition); 276 291 #endif 277 292 #endif 278 #if H_3D_INTER_SDC 293 #endif 294 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 279 295 m_pbInterSDCFlag = (Bool* )xMalloc(Bool, uiNumPartition); 280 296 for( Int i = 0; i < 4; i++ ) … … 400 416 #if H_3D_DIM_SDC 401 417 if ( m_pbSDCFlag ) { xFree(m_pbSDCFlag); m_pbSDCFlag = NULL; } 418 #if QC_SDC_UNIFY_G0130 419 for( Int i = 0; i < 4; i++ ) 420 { 421 if ( m_apSegmentDCOffset[i] ) { xFree(m_apSegmentDCOffset[i]); m_apSegmentDCOffset[i] = NULL; } 422 } 423 #else 402 424 if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]); m_apSegmentDCOffset[0] = NULL; } 403 425 if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]); m_apSegmentDCOffset[1] = NULL; } 404 426 #endif 427 #endif 405 428 #endif 406 #if H_3D_INTER_SDC 429 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 407 430 if ( m_pbInterSDCFlag ) { xFree(m_pbInterSDCFlag); m_pbInterSDCFlag = NULL; } 408 431 for(Int i = 0; i < 4; i++ ) … … 554 577 m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui]; 555 578 #endif 556 #if H_3D_INTER_SDC 579 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 557 580 m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui]; 558 581 #endif … … 616 639 #if H_3D_DIM_SDC 617 640 memset( m_pbSDCFlag + firstElement, 0, numElements * sizeof( *m_pbSDCFlag ) ); 641 #if QC_SDC_UNIFY_G0130 642 for( Int i = 0; i < 4; i++ ) 643 { 644 memset( m_apSegmentDCOffset[i] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[i] ) ); 645 } 646 #else 618 647 memset( m_apSegmentDCOffset[0] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[0] ) ); 619 648 memset( m_apSegmentDCOffset[1] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[1] ) ); 620 649 #endif 621 650 #endif 622 #if H_3D_INTER_SDC 651 #endif 652 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 623 653 memset( m_pbInterSDCFlag + firstElement, 0, numElements * sizeof( *m_pbInterSDCFlag ) ); 624 654 for( Int i = 0; i < 4; i++ ) … … 788 818 #if H_3D_DIM_SDC 789 819 m_pbSDCFlag [ui] = false; 820 #if QC_SDC_UNIFY_G0130 821 for( Int i = 0; i < 4; i++ ) 822 { 823 m_apSegmentDCOffset[i][ui] = 0; 824 } 825 #else 790 826 m_apSegmentDCOffset[0][ui] = 0; 791 827 m_apSegmentDCOffset[1][ui] = 0; 792 828 #endif 793 829 #endif 794 #if H_3D_INTER_SDC 830 #endif 831 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 795 832 m_pbInterSDCFlag[ui] = false; 796 833 for( Int i = 0; i < 4; i++ ) … … 901 938 #if H_3D_DIM_SDC 902 939 memset( m_pbSDCFlag, 0, sizeof(Bool) * m_uiNumPartition ); 940 #if QC_SDC_UNIFY_G0130 941 for( Int i = 0; i < 4; i++ ) 942 { 943 memset( m_apSegmentDCOffset[i], 0, sizeof(Pel) * m_uiNumPartition ); 944 } 945 #else 903 946 memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition ); 904 947 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition ); 905 948 #endif 906 949 #endif 907 #if H_3D_INTER_SDC 950 #endif 951 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 908 952 memset( m_pbInterSDCFlag, 0, sizeof( Bool ) * m_uiNumPartition ); 909 953 for( Int i = 0; i < 4; i++ ) … … 978 1022 #if H_3D_DIM_SDC 979 1023 m_pbSDCFlag [ui] = pcCU->m_pbSDCFlag [ uiPartOffset + ui ]; 1024 #if QC_SDC_UNIFY_G0130 1025 for( Int i = 0; i < 4; i++ ) 1026 { 1027 m_apSegmentDCOffset[i][ui] = pcCU->m_apSegmentDCOffset[i] [ uiPartOffset + ui ]; 1028 } 1029 #else 980 1030 m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ]; 981 1031 m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ]; 982 1032 #endif 983 1033 #endif 984 #if H_3D_INTER_SDC 1034 #endif 1035 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 985 1036 m_pbInterSDCFlag [ui] = pcCU->m_pbInterSDCFlag [ uiPartOffset + ui ]; 986 1037 for( Int i = 0; i < 4; i++ ) … … 1134 1185 #if H_3D_DIM_SDC 1135 1186 m_pbSDCFlag = pcCU->getSDCFlag() + uiPart; 1187 #if QC_SDC_UNIFY_G0130 1188 for( Int i = 0; i < 4; i++ ) 1189 { 1190 m_apSegmentDCOffset[i] = pcCU->getSDCSegmentDCOffset(i) + uiPart; 1191 } 1192 #else 1136 1193 m_apSegmentDCOffset[0] = pcCU->getSDCSegmentDCOffset(0) + uiPart; 1137 1194 m_apSegmentDCOffset[1] = pcCU->getSDCSegmentDCOffset(1) + uiPart; 1138 1195 #endif 1196 #endif 1139 1197 #endif 1140 #if H_3D_INTER_SDC 1198 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1141 1199 m_pbInterSDCFlag = pcCU->getInterSDCFlag() + uiPart; 1142 1200 for( Int i = 0; i < 4; i++ ) … … 1328 1386 #if H_3D_DIM_SDC 1329 1387 memcpy( m_pbSDCFlag + uiOffset, pcCU->getSDCFlag(), iSizeInBool ); 1388 #if QC_SDC_UNIFY_G0130 1389 for( Int i = 0; i < 4; i++ ) 1390 { 1391 memcpy( m_apSegmentDCOffset[i] + uiOffset, pcCU->getSDCSegmentDCOffset(i), sizeof( Pel ) * uiNumPartition); 1392 } 1393 #else 1330 1394 memcpy( m_apSegmentDCOffset[0] + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition); 1331 1395 memcpy( m_apSegmentDCOffset[1] + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition); 1332 1396 #endif 1333 1397 #endif 1334 #if H_3D_INTER_SDC 1398 #endif 1399 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1335 1400 memcpy( m_pbInterSDCFlag + uiOffset, pcCU->getInterSDCFlag(), iSizeInBool ); 1336 1401 for( Int i = 0; i < 4; i++ ) … … 1450 1515 #if H_3D_DIM_SDC 1451 1516 memcpy( rpcCU->getSDCFlag() + m_uiAbsIdxInLCU, m_pbSDCFlag, iSizeInBool ); 1517 #if QC_SDC_UNIFY_G0130 1518 for( Int i = 0; i < 4; i++ ) 1519 { 1520 memcpy( rpcCU->getSDCSegmentDCOffset(i) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[i], sizeof( Pel ) * m_uiNumPartition); 1521 } 1522 #else 1452 1523 memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition); 1453 1524 memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition); 1454 1525 #endif 1455 1526 #endif 1456 #if H_3D_INTER_SDC 1527 #endif 1528 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1457 1529 memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag, iSizeInBool ); 1458 1530 for( Int i = 0;i < 4; i++ ) … … 1558 1630 #if H_3D_DIM_SDC 1559 1631 memcpy( rpcCU->getSDCFlag() + uiPartOffset, m_pbSDCFlag, iSizeInBool ); 1632 #if QC_SDC_UNIFY_G0130 1633 for( Int i = 0; i < 4; i++ ) 1634 { 1635 memcpy( rpcCU->getSDCSegmentDCOffset(i) + uiPartOffset, m_apSegmentDCOffset[i], sizeof( Pel ) * uiQNumPart); 1636 } 1637 #else 1560 1638 memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart); 1561 1639 memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart); 1562 1640 #endif 1563 1641 #endif 1564 #if H_3D_INTER_SDC 1642 #endif 1643 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1565 1644 memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag, iSizeInBool ); 1566 1645 for( Int i = 0; i < 4; i++ ) … … 2293 2372 2294 2373 #if H_3D_INTER_SDC 2374 #if !QC_SDC_UNIFY_G0130 2295 2375 Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2296 2376 { … … 2302 2382 return 0; 2303 2383 } 2384 #endif 2304 2385 2305 2386 Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask ) … … 2404 2485 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx ) 2405 2486 { 2487 #if QC_SDC_UNIFY_G0130 2488 return 0; 2489 #else 2406 2490 TComDataCU* pcTempCU; 2407 2491 UInt uiTempPartIdx; … … 2417 2501 2418 2502 return uiCtx; 2503 #endif 2419 2504 } 2420 2505 -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.h
r781 r782 215 215 #if H_3D_DIM_SDC 216 216 Bool* m_pbSDCFlag; 217 #if QC_SDC_UNIFY_G0130 218 Pel* m_apSegmentDCOffset[4]; 219 #else 217 220 Pel* m_apSegmentDCOffset[2]; 218 221 #endif 219 222 #endif 223 #endif 220 224 #if H_3D_INTER_SDC 225 #if !QC_SDC_UNIFY_G0130 221 226 Bool* m_pbInterSDCFlag; 222 227 Int* m_apSegmentInterDCOffset[4]; 228 #endif 223 229 UChar* m_pucInterSDCMask; 224 230 #endif … … 578 584 #endif 579 585 #if H_3D_INTER_SDC 586 #if !QC_SDC_UNIFY_G0130 580 587 Bool* getInterSDCFlag () { return m_pbInterSDCFlag; } 581 588 Bool getInterSDCFlag ( UInt uiIdx ) { return m_pbInterSDCFlag[uiIdx]; } … … 585 592 Int getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; } 586 593 Void setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; } 587 594 #endif 588 595 Void xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask ); 589 596 -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h
r781 r782 236 236 #endif 237 237 #define QC_GENERIC_SDC_G0122 1 // Generalize SDC to all depth intra modes 238 238 #if H_3D_DIM_SDC && H_3D_INTER_SDC 239 #define QC_SDC_UNIFY_G0130 1 // Unify intra SDC and inter SDC 240 #endif 239 241 #define H_3D_DIM_ENC 1 // Depth Intra encoder optimizations, includes: 240 242 // HHI_DEPTH_INTRA_SEARCH_RAU_C0160 -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.cpp
r773 r782 2774 2774 #endif 2775 2775 #if H_3D_INTER_SDC 2776 #if QC_SDC_UNIFY_G0130 2777 Void TDecCavlc::parseDeltaDC( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 2778 { 2779 assert(0); 2780 } 2781 2782 Void TDecCavlc::parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2783 { 2784 assert(0); 2785 } 2786 #else 2776 2787 Void TDecCavlc::parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2777 2788 { … … 2783 2794 assert(0); 2784 2795 } 2796 #endif 2785 2797 #endif 2786 2798 // ==================================================================================================================== -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.h
r773 r782 124 124 #endif 125 125 #if H_3D_INTER_SDC 126 #if QC_SDC_UNIFY_G0130 127 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 128 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 129 #else 126 130 Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 127 131 Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 132 #endif 128 133 #endif 129 134 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCu.cpp
r781 r782 495 495 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); 496 496 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 497 497 #if QC_SDC_UNIFY_G0130 498 m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 499 #endif 498 500 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) 499 501 { … … 515 517 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) 516 518 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 517 #if H_3D_INTER_SDC 519 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 518 520 m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 519 521 #endif … … 586 588 case MODE_INTER: 587 589 #if H_3D_INTER_SDC 590 #if QC_SDC_UNIFY_G0130 591 if( m_ppcCU[uiDepth]->getSDCFlag( 0 ) ) 592 #else 588 593 if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) ) 594 #endif 589 595 { 590 596 xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); … … 661 667 { 662 668 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 663 664 pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 );; 669 #if QC_SDC_UNIFY_G0130 670 pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( uiSeg, 0 ); 671 #else 672 pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 ); 673 #endif 665 674 } 666 675 pResi += uiResiStride; -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.cpp
r773 r782 713 713 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 714 714 UInt uiChromaOffset = uiLumaOffset>>2; 715 715 #if QC_SDC_UNIFY_G0130 716 716 #if H_3D_DIM_SDC 717 if( pcCU->getSDCFlag( uiAbsPartIdx ) )717 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) ) 718 718 { 719 719 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); … … 722 722 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 723 723 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 724 } 725 #endif 726 727 #if H_3D_INTER_SDC 728 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx) ) 729 { 730 assert( !pcCU->isSkipped( uiAbsPartIdx ) ); 731 assert( !pcCU->isIntra( uiAbsPartIdx) ); 732 assert( pcCU->getSlice()->getIsDepth() ); 733 } 734 #endif 735 736 if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) 737 { 738 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 739 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 740 741 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 742 { 743 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 744 { 745 if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 746 { 747 m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart, uiDepth + ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ); 748 } 749 } 750 } 751 else 752 { 753 m_pcEntropyDecoderIf->parseDeltaDC( pcCU, uiAbsPartIdx, uiDepth ); 754 return; 755 } 756 } 757 #else 758 #if H_3D_DIM_SDC 759 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 760 { 761 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 762 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); 763 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); 764 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 765 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 724 766 return; 725 767 } … … 737 779 } 738 780 #endif 781 #endif 739 782 740 783 if( pcCU->isIntra(uiAbsPartIdx) ) … … 760 803 761 804 #if H_3D_INTER_SDC 805 #if QC_SDC_UNIFY_G0130 806 Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 807 { 808 pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth ); 809 810 if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) || 811 ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getVpsDepthModesFlag( pcCU->getSlice()->getLayerIdInVps() ) ) ) 812 { 813 return; 814 } 815 816 if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) ) 817 { 818 return; 819 } 820 821 assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 822 823 m_pcEntropyDecoderIf->parseSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 824 } 825 826 #else 762 827 Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 763 828 { … … 798 863 } 799 864 #endif 865 #endif 800 866 801 867 //! \} -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.h
r773 r782 96 96 #endif 97 97 #if H_3D_INTER_SDC 98 #if QC_SDC_UNIFY_G0130 99 virtual Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0; 100 virtual Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 101 #else 98 102 virtual Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 99 103 virtual Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0; 104 #endif 100 105 #endif 101 106 virtual Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 179 184 #endif 180 185 #if H_3D_INTER_SDC 186 #if QC_SDC_UNIFY_G0130 187 Void decodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 188 #else 181 189 Void decodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 182 190 Void decodeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 183 191 #endif 192 #endif 184 193 Void decodeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 185 194 -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp
r781 r782 89 89 #if QC_GENERIC_SDC_G0122 90 90 , m_cAngleFlagSCModel ( 1, 1, NUM_ANGLE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 91 #if !QC_SDC_UNIFY_G0130 91 92 , m_cIntraSdcFlagSCModel ( 1, 1, NUM_INTRASDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 93 #endif 92 94 #endif 93 95 #if H_3D_DIM_DMM … … 99 101 #endif 100 102 #endif 101 #if H_3D_INTER_SDC 103 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 102 104 , m_cInterSDCFlagSCModel ( 1, 1, NUM_INTER_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 103 105 , m_cInterSDCResidualSCModel ( 1, 1, NUM_INTER_SDC_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 104 106 , m_cInterSDCResidualSignFlagSCModel ( 1, 1, NUM_INTER_SDC_SIGN_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 #endif 108 #if QC_SDC_UNIFY_G0130 109 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 105 110 #endif 106 111 { … … 176 181 #if QC_GENERIC_SDC_G0122 177 182 m_cAngleFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 183 #if !QC_SDC_UNIFY_G0130 178 184 m_cIntraSdcFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTRASDC_FLAG ); 185 #endif 179 186 #endif 180 187 #if H_3D_DIM_DMM … … 186 193 #endif 187 194 #endif 188 #if H_3D_INTER_SDC 195 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 189 196 m_cInterSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 190 197 m_cInterSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 191 198 m_cInterSDCResidualSignFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 199 #endif 200 #if QC_SDC_UNIFY_G0130 201 m_cSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_FLAG ); 192 202 #endif 193 203 m_uiLastDQpNonZero = 0; … … 249 259 #if QC_GENERIC_SDC_G0122 250 260 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 261 #if !QC_SDC_UNIFY_G0130 251 262 m_cIntraSdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG ); 263 #endif 252 264 #endif 253 265 #if H_3D_DIM_DMM … … 259 271 #endif 260 272 #endif 261 #if H_3D_INTER_SDC 273 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 262 274 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 263 275 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 264 276 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 277 #endif 278 #if QC_SDC_UNIFY_G0130 279 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 265 280 #endif 266 281 m_pcTDecBinIf->start(); … … 1065 1080 default: break; 1066 1081 } 1067 1082 #if !QC_SDC_UNIFY_G0130 1068 1083 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) ) 1069 1084 { … … 1109 1124 } 1110 1125 } 1111 1126 #endif 1112 1127 pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth ); 1113 1128 } … … 1128 1143 uiIsDimMode = uiSymbol ? 0 : 1; 1129 1144 pcCU->setLumaIntraDirSubParts( 0, absPartIdx, depth ); 1130 1145 #if !QC_SDC_UNIFY_G0130 1131 1146 if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case 1132 1147 { … … 1139 1154 1140 1155 pcCU->setSDCFlagSubParts( uiSymbol, absPartIdx, depth ); 1141 1156 #endif 1142 1157 //decode DMM index 1143 1158 if( uiIsDimMode ) … … 2164 2179 2165 2180 #if H_3D_INTER_SDC 2181 #if QC_SDC_UNIFY_G0130 2182 Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2183 { 2184 if( ! ( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) ) 2185 { 2186 assert( 0 ); 2187 } 2188 2189 UInt symbol = 0; 2190 UInt uiNumSegments = 0; 2191 2192 if( pcCU->isIntra( absPartIdx ) ) 2193 { 2194 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2195 uiNumSegments = isDimMode( dir ) ? 2 : 1; 2196 2197 m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) ); 2198 2199 if( pcCU->getSDCFlag( absPartIdx ) ) 2200 { 2201 assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ); 2202 pcCU->setTrIdxSubParts( 0, absPartIdx, depth ); 2203 pcCU->setCbfSubParts( 1, 1, 1, absPartIdx, depth ); 2204 } 2205 else 2206 { 2207 pcCU->setLumaIntraDirSubParts( dir + symbol, absPartIdx, depth ); 2208 } 2209 } 2210 else 2211 { 2212 PartSize cPartSize = pcCU->getPartitionSize( absPartIdx ); 2213 2214 uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 ); 2215 symbol = 1; 2216 } 2217 2218 2219 for( UInt segment = 0; segment < uiNumSegments; segment++ ) 2220 { 2221 Pel valDeltaDC = 0; 2222 if( symbol ) 2223 { 2224 xParseDimDeltaDC( valDeltaDC, uiNumSegments ); 2225 } 2226 2227 if( pcCU->isIntra( absPartIdx ) ) 2228 { 2229 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2230 2231 if( pcCU->getSDCFlag( absPartIdx ) ) 2232 { 2233 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 2234 } 2235 else 2236 { 2237 pcCU->setDimDeltaDC( getDimType( dir ), segment, absPartIdx, valDeltaDC ); 2238 } 2239 } 2240 else 2241 { 2242 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 2243 } 2244 } 2245 } 2246 2247 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2248 { 2249 UInt uiSymbol = 0; 2250 UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx ); 2251 2252 m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) ); 2253 2254 if( uiSymbol ) 2255 { 2256 pcCU->setSDCFlagSubParts( true, uiAbsPartIdx, uiDepth ); 2257 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); 2258 pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth ); 2259 } 2260 else 2261 { 2262 pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth ); 2263 } 2264 } 2265 #else 2166 2266 Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2167 2267 { … … 2198 2298 } 2199 2299 #endif 2300 #endif 2200 2301 2201 2302 //! \} -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h
r781 r782 112 112 #endif 113 113 #if H_3D_INTER_SDC 114 #if QC_SDC_UNIFY_G0130 115 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 116 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 117 #else 114 118 Void parseInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 115 119 Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 120 #endif 116 121 #endif 117 122 private: … … 213 218 #if QC_GENERIC_SDC_G0122 214 219 ContextModel3DBuffer m_cAngleFlagSCModel; 220 #if !QC_SDC_UNIFY_G0130 215 221 ContextModel3DBuffer m_cIntraSdcFlagSCModel; 222 #endif 216 223 #endif 217 224 #if H_3D_DIM_DMM … … 223 230 #endif 224 231 #endif 225 #if H_3D_INTER_SDC 232 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 226 233 ContextModel3DBuffer m_cInterSDCFlagSCModel; 227 234 ContextModel3DBuffer m_cInterSDCResidualSCModel; 228 235 ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel; 229 236 #endif 237 #if QC_SDC_UNIFY_G0130 238 ContextModel3DBuffer m_cSDCFlagSCModel; 239 #endif 230 240 }; 231 241 -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.cpp
r773 r782 2513 2513 2514 2514 #if H_3D_INTER_SDC 2515 #if QC_SDC_UNIFY_G0130 2516 Void TEncCavlc::codeDeltaDC( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2517 { 2518 assert(0); 2519 } 2520 2521 Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2522 { 2523 assert(0); 2524 } 2525 #else 2515 2526 Void TEncCavlc::codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2516 2527 { … … 2523 2534 } 2524 2535 #endif 2536 #endif 2525 2537 //! \} -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.h
r773 r782 138 138 #endif 139 139 #if H_3D_INTER_SDC 140 #if QC_SDC_UNIFY_G0130 141 Void codeDeltaDC ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 142 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 143 #else 140 144 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 141 145 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 146 #endif 142 147 #endif 143 148 -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncCu.cpp
r773 r782 1588 1588 1589 1589 m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 1590 1590 #if QC_SDC_UNIFY_G0130 1591 m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false ); 1592 #endif 1591 1593 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) 1592 1594 { … … 1609 1611 m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx ); 1610 1612 #endif 1611 #if H_3D_INTER_SDC 1613 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 1612 1614 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, uiAbsPartIdx, false ); 1613 1615 #endif … … 2285 2287 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2286 2288 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); 2289 #if QC_SDC_UNIFY_G0130 2290 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2291 #endif 2287 2292 m_pcEntropyCoder->encodePredInfo( rpcTempCU, 0, true ); 2288 2293 m_pcEntropyCoder->encodeIPCMInfo(rpcTempCU, 0, true ); … … 2374 2379 m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0, true ); 2375 2380 m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true ); 2381 #if QC_SDC_UNIFY_G0130 2382 m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true ); 2383 #endif 2376 2384 m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true ); 2377 2385 -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.cpp
r773 r782 649 649 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 650 650 UInt uiChromaOffset = uiLumaOffset>>2; 651 651 #if QC_SDC_UNIFY_G0130 652 652 #if H_3D_DIM_SDC 653 if( pcCU->getSDCFlag( uiAbsPartIdx ) )653 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx ) ) 654 654 { 655 655 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); … … 658 658 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 659 659 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 660 return;661 660 } 662 661 #endif 663 662 664 663 #if H_3D_INTER_SDC 665 if( pcCU->get InterSDCFlag( uiAbsPartIdx ) )664 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) ) 666 665 { 667 666 assert( !pcCU->isSkipped( uiAbsPartIdx ) ); 668 667 assert( !pcCU->isIntra( uiAbsPartIdx) ); 669 668 assert( pcCU->getSlice()->getIsDepth() ); 669 } 670 #endif 671 672 if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) 673 { 674 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 675 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 676 677 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 678 { 679 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 680 { 681 if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 682 { 683 m_pcEntropyCoderIf->codeDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart ); 684 } 685 } 686 } 687 else 688 { 689 m_pcEntropyCoderIf->codeDeltaDC( pcCU, uiAbsPartIdx ); 690 return; 691 } 692 } 693 #else 694 #if H_3D_DIM_SDC 695 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 696 { 697 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 698 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); 699 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); 700 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 701 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 702 return; 703 } 704 #endif 705 706 #if H_3D_INTER_SDC 707 if( pcCU->getInterSDCFlag( uiAbsPartIdx ) ) 708 { 709 assert( !pcCU->isSkipped( uiAbsPartIdx ) ); 710 assert( !pcCU->isIntra( uiAbsPartIdx) ); 711 assert( pcCU->getSlice()->getIsDepth() ); 670 712 671 713 encodeInterSDCResidualData( pcCU, uiAbsPartIdx, false ); 672 714 return; 673 715 } 716 #endif 674 717 #endif 675 718 … … 825 868 826 869 #if H_3D_INTER_SDC 870 #if QC_SDC_UNIFY_G0130 871 Void TEncEntropy::encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ) 872 { 873 m_pcEntropyCoderIf->codeDeltaDC( pcCU, absPartIdx ); 874 } 875 876 Void TEncEntropy::encodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 877 { 878 if( ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) ) || 879 ( pcCU->isIntra( uiAbsPartIdx ) && !pcCU->getSlice()->getVPS()->getVpsDepthModesFlag( pcCU->getSlice()->getLayerIdInVps() ) ) ) 880 { 881 return; 882 } 883 884 if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) ) 885 { 886 return; 887 } 888 889 assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) ); 890 891 if( bRD ) 892 { 893 uiAbsPartIdx = 0; 894 } 895 896 m_pcEntropyCoderIf->codeSDCFlag( pcCU, uiAbsPartIdx ); 897 } 898 #else 827 899 Void TEncEntropy::encodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 828 900 { … … 872 944 } 873 945 #endif 946 #endif 874 947 875 948 //! \} -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.h
r655 r782 95 95 #endif 96 96 #if H_3D_INTER_SDC 97 #if QC_SDC_UNIFY_G0130 98 virtual Void codeDeltaDC ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 99 virtual Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 100 #else 97 101 virtual Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 98 102 virtual Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0; 103 #endif 99 104 #endif 100 105 virtual Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 186 191 #endif 187 192 #if H_3D_INTER_SDC 193 #if QC_SDC_UNIFY_G0130 194 Void encodeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 195 Void encodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 196 #else 188 197 Void encodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 189 198 Void encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ); 199 #endif 190 200 #endif 191 201 Void encodePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.cpp
r781 r782 95 95 #if QC_GENERIC_SDC_G0122 96 96 , m_cAngleFlagSCModel ( 1, 1, NUM_ANGLE_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 97 #if !QC_SDC_UNIFY_G0130 97 98 , m_cIntraSdcFlagSCModel ( 1, 1, NUM_INTRASDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 99 #endif 98 100 #endif 99 101 #if H_3D_DIM_DMM … … 105 107 #endif 106 108 #endif 107 #if H_3D_INTER_SDC 109 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 108 110 , m_cInterSDCFlagSCModel ( 1, 1, NUM_INTER_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 109 111 , m_cInterSDCResidualSCModel ( 1, 1, NUM_INTER_SDC_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 110 112 , m_cInterSDCResidualSignFlagSCModel ( 1, 1, NUM_INTER_SDC_SIGN_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 113 #endif 114 #if QC_SDC_UNIFY_G0130 115 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 111 116 #endif 112 117 { … … 174 179 #if QC_GENERIC_SDC_G0122 175 180 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 181 #if !QC_SDC_UNIFY_G0130 176 182 m_cIntraSdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG ); 183 #endif 177 184 #endif 178 185 #if H_3D_DIM_DMM … … 184 191 #endif 185 192 #endif 186 #if H_3D_INTER_SDC 193 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 187 194 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 188 195 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 189 196 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 197 #endif 198 #if QC_SDC_UNIFY_G0130 199 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 190 200 #endif 191 201 // new structure … … 226 236 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 227 237 #endif 228 #if H_3D_INTER_SDC 238 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 229 239 curCost += m_cInterSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_FLAG ); 230 240 curCost += m_cInterSDCResidualSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 231 241 curCost += m_cInterSDCResidualSignFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 242 #endif 243 #if QC_SDC_UNIFY_G0130 244 curCost += m_cSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SDC_FLAG ); 232 245 #endif 233 246 curCost += m_cCUPartSizeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_PART_SIZE ); … … 262 275 #if QC_GENERIC_SDC_G0122 263 276 curCost += m_cAngleFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 277 #if !QC_SDC_UNIFY_G0130 264 278 curCost += m_cIntraSdcFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTRASDC_FLAG ); 279 #endif 265 280 #endif 266 281 #if H_3D_DIM_DMM … … 331 346 #if QC_GENERIC_SDC_G0122 332 347 m_cAngleFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG ); 348 #if !QC_SDC_UNIFY_G0130 333 349 m_cIntraSdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG ); 350 #endif 334 351 #endif 335 352 #if H_3D_DIM_DMM … … 341 358 #endif 342 359 #endif 343 #if H_3D_INTER_SDC 360 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 344 361 m_cInterSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG ); 345 362 m_cInterSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL ); 346 363 m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG ); 364 #endif 365 #if QC_SDC_UNIFY_G0130 366 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 347 367 #endif 348 368 m_pcBinIf->start(); … … 647 667 #if QC_GENERIC_SDC_G0122 648 668 this->m_cAngleFlagSCModel .copyFrom( &pSrc->m_cAngleFlagSCModel ); 669 #if !QC_SDC_UNIFY_G0130 649 670 this->m_cIntraSdcFlagSCModel .copyFrom( &pSrc->m_cIntraSdcFlagSCModel ); 671 #endif 650 672 #endif 651 673 } … … 1169 1191 default: break; 1170 1192 } 1171 1193 #if !QC_SDC_UNIFY_G0130 1172 1194 if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) ) 1173 1195 { … … 1206 1228 } 1207 1229 } 1230 #endif 1208 1231 } 1209 1232 … … 1217 1240 m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) ); 1218 1241 } 1219 1242 #if !QC_SDC_UNIFY_G0130 1220 1243 if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case 1221 1244 { 1222 1245 m_pcBinIf->encodeBin( pcCU->getSDCFlag( absPartIdx ) ? 1 : 0, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) ); 1223 1246 } 1224 1247 #endif 1225 1248 if( isDimMode( dir ) ) 1226 1249 { … … 2200 2223 2201 2224 #if H_3D_INTER_SDC 2225 #if QC_SDC_UNIFY_G0130 2226 Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx ) 2227 { 2228 if( !( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) ) 2229 { 2230 assert( 0 ); 2231 } 2232 2233 UInt uiNumSegments = 0; 2234 UInt dimDeltaDC = 0; 2235 2236 if( pcCU->isIntra( absPartIdx ) ) 2237 { 2238 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2239 uiNumSegments = isDimMode( dir ) ? 2 : 1; 2240 2241 if( pcCU->getSDCFlag( absPartIdx ) ) 2242 { 2243 if( uiNumSegments == 1 ) 2244 { 2245 dimDeltaDC = pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) ? 1 : 0; 2246 } 2247 else 2248 { 2249 dimDeltaDC = ( pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) || pcCU->getSDCSegmentDCOffset( 1, absPartIdx ) ) ? 1 : 0; 2250 } 2251 } 2252 else 2253 { 2254 dimDeltaDC = isDimDeltaDC( dir ); 2255 } 2256 2257 m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, uiNumSegments-1 ) ); 2258 } 2259 else //all-zero inter SDC is not allowed 2260 { 2261 PartSize cPartSize = pcCU->getPartitionSize( absPartIdx ); 2262 2263 uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 ); 2264 dimDeltaDC = 1; 2265 } 2266 2267 if( dimDeltaDC ) 2268 { 2269 for( UInt segment = 0; segment < uiNumSegments; segment++ ) 2270 { 2271 Pel deltaDC = 0; 2272 2273 if( pcCU->isIntra( absPartIdx ) ) 2274 { 2275 UInt dir = pcCU->getLumaIntraDir( absPartIdx ); 2276 deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset( segment, absPartIdx ) : pcCU->getDimDeltaDC( getDimType( dir ), segment, absPartIdx ); 2277 } 2278 else 2279 { 2280 deltaDC = pcCU->getSDCSegmentDCOffset( segment, absPartIdx ); 2281 } 2282 2283 xCodeDimDeltaDC( deltaDC, uiNumSegments ); 2284 } 2285 } 2286 } 2287 2288 Void TEncSbac::codeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2289 { 2290 UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0; 2291 UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx ); 2292 2293 m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) ); 2294 } 2295 #else 2202 2296 Void TEncSbac::codeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2203 2297 { … … 2221 2315 } 2222 2316 #endif 2317 #endif 2223 2318 //! \} -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.h
r781 r782 154 154 #endif 155 155 #if H_3D_INTER_SDC 156 #if QC_SDC_UNIFY_G0130 157 Void codeDeltaDC ( TComDataCU* pcCU, UInt absPartIdx ); 158 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 159 #else 156 160 Void codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 157 161 Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 162 #endif 158 163 #endif 159 164 Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 249 254 #if QC_GENERIC_SDC_G0122 250 255 ContextModel3DBuffer m_cAngleFlagSCModel; 256 #if !QC_SDC_UNIFY_G0130 251 257 ContextModel3DBuffer m_cIntraSdcFlagSCModel; 258 #endif 252 259 #endif 253 260 #if H_3D_DIM_DMM … … 259 266 #endif 260 267 #endif 261 #if H_3D_INTER_SDC 268 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 262 269 ContextModel3DBuffer m_cInterSDCFlagSCModel; 263 270 ContextModel3DBuffer m_cInterSDCResidualSCModel; 264 271 ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel; 265 272 #endif 273 #if QC_SDC_UNIFY_G0130 274 ContextModel3DBuffer m_cSDCFlagSCModel; 275 #endif 266 276 }; 267 277 -
branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSearch.cpp
r781 r782 921 921 922 922 m_pcEntropyCoder ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 923 923 #if QC_SDC_UNIFY_G0130 924 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 925 #endif 924 926 if (pcCU->isIntra(0) && pcCU->getPartitionSize(0) == SIZE_2Nx2N ) 925 927 { … … 956 958 } 957 959 } 960 #if QC_SDC_UNIFY_G0130 961 Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1; 962 UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2; 963 964 if( !pcCU->getSDCFlag( uiAbsPartIdx ) ) 965 { 966 for( Int iPart = 0; iPart < iPartNum; iPart++ ) 967 { 968 if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 969 { 970 m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart ); 971 } 972 } 973 } 974 #endif 958 975 } 959 976 if( bChroma ) … … 2047 2064 2048 2065 // encode reduced intra header 2066 #if QC_SDC_UNIFY_G0130 2067 if( !pcCU->getSlice()->isIntra() ) 2068 { 2069 if (pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 2070 { 2071 m_pcEntropyCoder->encodeCUTransquantBypassFlag( pcCU, 0, true ); 2072 } 2073 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 2074 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 2075 } 2076 2077 m_pcEntropyCoder->encodePartSize( pcCU, 0, true ); 2078 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 2079 #else 2049 2080 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 2081 #endif 2050 2082 2051 2083 // encode pred direction + DC residual data 2052 2084 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 2085 #if QC_SDC_UNIFY_G0130 2086 Bool bDummy = false; 2087 m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy ); 2088 #endif 2053 2089 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 2054 2090 … … 5603 5639 return; 5604 5640 } 5605 5641 #if QC_SDC_UNIFY_G0130 5642 pcCU->setSDCFlagSubParts( true, 0, uiDepth ); 5643 #else 5606 5644 pcCU->setInterSDCFlagSubParts( true, 0, 0, uiDepth ); 5645 #endif 5607 5646 5608 5647 UInt uiWidth = pcCU->getWidth ( 0 ); … … 5642 5681 Int iResiOffset = ( pResDC [uiSeg] > 0 ? ( uiSegSize[uiSeg] >> 1 ) : -1*( uiSegSize[uiSeg] >> 1 ) ); 5643 5682 pResDC [uiSeg] = ( pResDC [uiSeg] + iResiOffset ) / (Int) uiSegSize[uiSeg]; 5644 5683 #if QC_SDC_UNIFY_G0130 5684 pcCU->setSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 ); 5685 #else 5645 5686 pcCU->setInterSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 ); 5687 #endif 5646 5688 } 5647 5689 … … 5698 5740 #endif 5699 5741 5742 #if QC_SDC_UNIFY_G0130 5743 Bool bNonSkip = false; 5744 #else 5700 5745 Bool bNonSkip = true; 5746 #endif 5701 5747 for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ ) 5702 5748 { 5749 #if QC_SDC_UNIFY_G0130 5750 bNonSkip |= ( pcCU->getSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0; 5751 #else 5703 5752 bNonSkip &= ( pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0; 5753 #endif 5704 5754 } 5705 5755 … … 6912 6962 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 6913 6963 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 6964 #if QC_SDC_UNIFY_G0130 6965 m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true ); 6966 #endif 6914 6967 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 6915 6968 #if H_3D_IC … … 6919 6972 m_pcEntropyCoder->encodeARPW( pcCU , 0 ); 6920 6973 #endif 6921 #if H_3D_INTER_SDC 6974 #if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130 6922 6975 m_pcEntropyCoder->encodeInterSDCFlag( pcCU, 0, true ); 6923 6976 #endif
Note: See TracChangeset for help on using the changeset viewer.