Changeset 1412 in 3DVCSoftware for branches/HTM-16.2-dev/source/Lib/TLibEncoder/TEncSbac.cpp
- Timestamp:
- 12 Apr 2018, 11:12:21 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-16.2-dev/source/Lib/TLibEncoder/TEncSbac.cpp
r1405 r1412 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 6, ITU/ISO/IEC6 * Copyright (c) 2010-2017, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 62 62 , m_cCUSplitFlagSCModel ( 1, 1, NUM_SPLIT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 63 63 , m_cCUSkipFlagSCModel ( 1, 1, NUM_SKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 64 #if NH_3D _DIS64 #if NH_3D 65 65 , m_cCUDISFlagSCModel ( 1, 1, NUM_DIS_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 66 66 , m_cCUDISTypeSCModel ( 1, 1, NUM_DIS_TYPE_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 68 68 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 69 69 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 70 #if NH_3D _ARP70 #if NH_3D 71 71 , m_cCUPUARPWSCModel ( 1, 1, NUM_ARPW_CTX , m_contextModels + m_numContextModels, m_numContextModels) 72 #endif73 #if NH_3D_IC74 72 , m_cCUICFlagSCModel ( 1, 1, NUM_IC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 75 73 #endif … … 102 100 , m_ChromaQpAdjIdcSCModel ( 1, 1, NUM_CHROMA_QP_ADJ_IDC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 103 101 104 #if NH_3D _DMM102 #if NH_3D 105 103 , m_cNotDmmFlagSCModel ( 1, 1, NUM_NOTDMM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 106 104 , m_cDmmModeSCModel ( 1, 1, NUM_DMM_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 #endif108 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER109 105 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 110 106 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 111 #endif112 #if NH_3D_SDC_INTRA113 107 , m_cSDCResidualFlagSCModel ( 1, 1, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 114 108 , m_cSDCResidualSCModel ( 1, 1, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 115 109 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 116 #endif117 #if NH_3D_DBBP118 110 , m_cDBBPFlagSCModel ( 1, 1, DBBP_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 119 111 #endif … … 143 135 m_cCUSplitFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SPLIT_FLAG ); 144 136 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 145 #if NH_3D _DIS137 #if NH_3D 146 138 m_cCUDISFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG ); 147 139 m_cCUDISTypeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE ); … … 149 141 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); 150 142 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT); 151 #if NH_3D _ARP143 #if NH_3D 152 144 m_cCUPUARPWSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ARPW ); 153 #endif154 #if NH_3D_IC155 145 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 156 146 #endif … … 183 173 m_ChromaQpAdjIdcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CHROMA_QP_ADJ_IDC ); 184 174 185 #if NH_3D _DMM175 #if NH_3D 186 176 m_cNotDmmFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_NOTDMM_FLAG ); 187 177 m_cDmmModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_MODE ); 188 #endif189 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER190 178 m_cDdcDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_DATA ); 191 179 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 192 #endif193 #if NH_3D_SDC_INTRA194 180 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 195 181 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 196 182 m_cDdcFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG ); 197 #endif198 #if NH_3D_DBBP199 183 m_cDBBPFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DBBP_FLAG ); 200 184 #endif … … 231 215 curCost = m_cCUSplitFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG ); 232 216 curCost += m_cCUSkipFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG ); 233 #if NH_3D _DIS217 #if NH_3D 234 218 curCost += m_cCUDISFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DIS_FLAG ); 235 219 curCost += m_cCUDISTypeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DIS_TYPE ); … … 237 221 curCost += m_cCUMergeFlagExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT); 238 222 curCost += m_cCUMergeIdxExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_IDX_EXT); 239 #if NH_3D _ARP223 #if NH_3D 240 224 curCost += m_cCUPUARPWSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_ARPW ); 241 #endif242 #if NH_3D_IC243 225 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 244 #endif245 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER246 226 curCost += m_cSDCFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SDC_FLAG ); 247 #endif248 #if NH_3D_DBBP249 227 curCost += m_cDBBPFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DBBP_FLAG ); 250 228 #endif … … 276 254 curCost += m_ChromaQpAdjFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_FLAG ); 277 255 curCost += m_ChromaQpAdjIdcSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_IDC ); 278 #if NH_3D _DMM256 #if NH_3D 279 257 curCost += m_cNotDmmFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_NOTDMM_FLAG ); 280 258 curCost += m_cDmmModeSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DMM_MODE ); 281 #endif282 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER283 259 curCost += m_cDdcDataSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_DDC_DATA ); 284 260 #endif … … 406 382 } 407 383 408 #if NH_3D _DIS384 #if NH_3D 409 385 Void TEncSbac::codeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx ) 410 386 { … … 522 498 } 523 499 524 #if NH_3D _DMM500 #if NH_3D 525 501 Void TEncSbac::loadIntraDepthDmm( const TEncSbac* pSrc ) 526 502 { … … 567 543 { 568 544 PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx ); 569 #if NH_3D _QTLPC545 #if NH_3D 570 546 Bool bLimQtPredFlag = pcCU->getPic()->getSlice(0)->getQtPredFlag(); 571 547 TComPic *pcTexture = pcCU->getSlice()->getTexturePic(); … … 578 554 UInt uiTexturePart = eSize; 579 555 580 #if H_3D_FCO581 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag && pcTexture->getReconMark())582 #else583 556 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag ) 584 #endif585 557 { 586 558 TComDataCU *pcTextureCU = pcTexture->getCtu(pcCU->getCtuRsAddr()); … … 616 588 DTRACE_CU("part_mode", eSize ) 617 589 #endif 618 #if NH_3D _QTLPC590 #if NH_3D 619 591 if (depthDependent==false || uiTexturePart == SIZE_NxN|| uiTexturePart == SIZE_2Nx2N) 620 592 { 621 593 #endif 622 623 switch(eSize) 624 { 625 case SIZE_2Nx2N: 626 { 627 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 628 break; 629 } 630 case SIZE_2NxN: 631 case SIZE_2NxnU: 632 case SIZE_2NxnD: 633 { 634 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 635 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 636 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) 637 { 638 if (eSize == SIZE_2NxN) 639 { 640 m_pcBinIf->encodeBin(1, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 641 } 642 else 643 { 644 m_pcBinIf->encodeBin(0, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 645 m_pcBinIf->encodeBinEP((eSize == SIZE_2NxnU? 0: 1)); 646 } 647 } 648 break; 649 } 650 case SIZE_Nx2N: 651 case SIZE_nLx2N: 652 case SIZE_nRx2N: 653 { 654 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 655 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 656 657 if( uiDepth == log2DiffMaxMinCodingBlockSize && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) ) 658 { 659 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 2) ); 660 } 661 662 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) 663 { 664 if (eSize == SIZE_Nx2N) 665 { 666 m_pcBinIf->encodeBin(1, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 667 } 668 else 669 { 670 m_pcBinIf->encodeBin(0, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 671 m_pcBinIf->encodeBinEP((eSize == SIZE_nLx2N? 0: 1)); 672 } 673 } 674 break; 675 } 676 case SIZE_NxN: 677 { 678 if( uiDepth == log2DiffMaxMinCodingBlockSize && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) ) 679 { 680 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 681 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 682 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 2) ); 683 } 684 break; 685 } 686 default: 687 { 688 assert(0); 689 break; 690 } 691 } 692 #if NH_3D_QTLPC 594 switch(eSize) 595 { 596 case SIZE_2Nx2N: 597 { 598 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 599 break; 600 } 601 case SIZE_2NxN: 602 case SIZE_2NxnU: 603 case SIZE_2NxnD: 604 { 605 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 606 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 607 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) 608 { 609 if (eSize == SIZE_2NxN) 610 { 611 m_pcBinIf->encodeBin(1, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 612 } 613 else 614 { 615 m_pcBinIf->encodeBin(0, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 616 m_pcBinIf->encodeBinEP((eSize == SIZE_2NxnU? 0: 1)); 617 } 618 } 619 break; 620 } 621 case SIZE_Nx2N: 622 case SIZE_nLx2N: 623 case SIZE_nRx2N: 624 { 625 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 626 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 627 628 if( uiDepth == log2DiffMaxMinCodingBlockSize && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) ) 629 { 630 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 2) ); 631 } 632 633 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) 634 { 635 if (eSize == SIZE_Nx2N) 636 { 637 m_pcBinIf->encodeBin(1, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 638 } 639 else 640 { 641 m_pcBinIf->encodeBin(0, m_cCUPartSizeSCModel.get( 0, 0, 3 )); 642 m_pcBinIf->encodeBinEP((eSize == SIZE_nLx2N? 0: 1)); 643 } 644 } 645 break; 646 } 647 case SIZE_NxN: 648 { 649 if( uiDepth == log2DiffMaxMinCodingBlockSize && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) ) 650 { 651 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 652 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 653 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 2) ); 654 } 655 break; 656 } 657 default: 658 { 659 assert(0); 660 break; 661 } 662 } 663 #if NH_3D 693 664 } 694 665 else if(uiTexturePart == SIZE_2NxN || uiTexturePart == SIZE_2NxnU || uiTexturePart == SIZE_2NxnD) 695 666 { 696 //assert(eSize!=SIZE_NxN);697 //assert(eSize!=SIZE_Nx2N);698 //assert(eSize==SIZE_2Nx2N || eSize==SIZE_2NxN || eSize==SIZE_2NxnU || eSize==SIZE_2NxnD);699 667 switch(eSize) 700 668 { … … 729 697 else if(uiTexturePart == SIZE_Nx2N|| uiTexturePart==SIZE_nLx2N || uiTexturePart==SIZE_nRx2N) 730 698 { 731 //assert(eSize!=SIZE_NxN);732 //assert(eSize!=SIZE_2NxN);733 //assert(eSize==SIZE_2Nx2N ||eSize==SIZE_Nx2N || eSize==SIZE_nLx2N || eSize==SIZE_nRx2N);734 699 switch(eSize) 735 700 { … … 768 733 } 769 734 #endif 770 771 735 } 772 736 … … 885 849 } 886 850 887 #if NH_3D _ARP851 #if NH_3D 888 852 Void TEncSbac::codeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx ) 889 853 { … … 903 867 #endif 904 868 } 905 #endif 906 907 #if NH_3D_IC 869 908 870 /** code Illumination Compensation flag 909 871 * \param pcCU … … 940 902 941 903 assert( uiCtx < 3 ); 942 #if NH_3D _QTLPC904 #if NH_3D 943 905 Bool bCodeSplitFlag = true; 944 906 … … 951 913 Bool rapPic = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA); 952 914 953 #if H_3D_FCO954 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag && pcTexture->getReconMark() )955 #else956 915 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag ) 957 #endif958 916 { 959 917 TComDataCU *pcTextureCU = pcTexture->getCtu(pcCU->getCtuRsAddr()); … … 1009 967 { 1010 968 dir[j] = pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ); 1011 #if NH_3D _DMM969 #if NH_3D 1012 970 if( pcCU->getSlice()->getIntraSdcWedgeFlag() || pcCU->getSlice()->getIntraContourFlag() ) 1013 971 { … … 1018 976 { 1019 977 #endif 1020 pcCU->getIntraDirPredictor(absPartIdx+partOffset*j, preds[j], COMPONENT_Y);1021 for(UInt i = 0; i < NUM_MOST_PROBABLE_MODES; i++)1022 {1023 if(dir[j] == preds[j][i])1024 {1025 predIdx[j] = i;1026 }1027 }1028 m_pcBinIf->encodeBin((predIdx[j] != -1)? 1 : 0, m_cCUIntraPredSCModel.get( 0, 0, 0 ) );978 pcCU->getIntraDirPredictor(absPartIdx+partOffset*j, preds[j], COMPONENT_Y); 979 for(UInt i = 0; i < NUM_MOST_PROBABLE_MODES; i++) 980 { 981 if(dir[j] == preds[j][i]) 982 { 983 predIdx[j] = i; 984 } 985 } 986 m_pcBinIf->encodeBin((predIdx[j] != -1)? 1 : 0, m_cCUIntraPredSCModel.get( 0, 0, 0 ) ); 1029 987 #if NH_MV_ENC_DEC_TRAC 1030 988 DTRACE_CU("prev_intra_luma_pred_flag", (predIdx[j] != -1)? 1 : 0); 1031 989 #endif 1032 #if NH_3D _DMM990 #if NH_3D 1033 991 } 1034 992 #endif … … 1037 995 for (j=0;j<partNum;j++) 1038 996 { 1039 #if NH_3D _DMM997 #if NH_3D 1040 998 if( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 1041 999 { 1042 1000 #endif 1043 if(predIdx[j] != -1)1044 {1045 m_pcBinIf->encodeBinEP( predIdx[j] ? 1 : 0 );1046 if (predIdx[j])1047 {1048 m_pcBinIf->encodeBinEP( predIdx[j]-1 );1049 }1001 if(predIdx[j] != -1) 1002 { 1003 m_pcBinIf->encodeBinEP( predIdx[j] ? 1 : 0 ); 1004 if (predIdx[j]) 1005 { 1006 m_pcBinIf->encodeBinEP( predIdx[j]-1 ); 1007 } 1050 1008 #if NH_MV_ENC_DEC_TRAC 1051 1009 DTRACE_CU("mpm_idx", predIdx[j] ); 1052 1010 #endif 1053 }1054 else1055 {1056 if (preds[j][0] > preds[j][1])1057 {1058 std::swap(preds[j][0], preds[j][1]);1059 }1060 if (preds[j][0] > preds[j][2])1061 {1062 std::swap(preds[j][0], preds[j][2]);1063 }1064 if (preds[j][1] > preds[j][2])1065 {1066 std::swap(preds[j][1], preds[j][2]);1067 }1068 for(Int i = (Int(NUM_MOST_PROBABLE_MODES) - 1); i >= 0; i--)1069 {1070 dir[j] = dir[j] > preds[j][i] ? dir[j] - 1 : dir[j];1071 }1072 m_pcBinIf->encodeBinsEP( dir[j], 5 );1011 } 1012 else 1013 { 1014 if (preds[j][0] > preds[j][1]) 1015 { 1016 std::swap(preds[j][0], preds[j][1]); 1017 } 1018 if (preds[j][0] > preds[j][2]) 1019 { 1020 std::swap(preds[j][0], preds[j][2]); 1021 } 1022 if (preds[j][1] > preds[j][2]) 1023 { 1024 std::swap(preds[j][1], preds[j][2]); 1025 } 1026 for(Int i = (Int(NUM_MOST_PROBABLE_MODES) - 1); i >= 0; i--) 1027 { 1028 dir[j] = dir[j] > preds[j][i] ? dir[j] - 1 : dir[j]; 1029 } 1030 m_pcBinIf->encodeBinsEP( dir[j], 5 ); 1073 1031 #if NH_MV_ENC_DEC_TRAC 1074 1032 DTRACE_CU("rem_intra_luma_pred_mode", dir[j] ); 1075 1033 #endif 1076 }1077 #if NH_3D _DMM1034 } 1035 #if NH_3D 1078 1036 } 1079 1037 #endif … … 1721 1679 else 1722 1680 { 1723 beValid = pcCU->getSlice()->getPPS()->getSign HideFlag();1681 beValid = pcCU->getSlice()->getPPS()->getSignDataHidingEnabledFlag(); 1724 1682 } 1725 1683 } … … 2168 2126 **************************************************************************** 2169 2127 */ 2170 Void TEncSbac::estBit( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, ChannelType chType )2128 Void TEncSbac::estBit( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, ChannelType chType, COEFF_SCAN_TYPE scanType ) 2171 2129 { 2172 2130 estCBFBit( pcEstBitsSbac ); … … 2178 2136 2179 2137 // encode last significant position 2180 estLastSignificantPositionBit( pcEstBitsSbac, width, height, chType );2138 estLastSignificantPositionBit( pcEstBitsSbac, width, height, chType, scanType ); 2181 2139 2182 2140 // encode significant coefficients … … 2312 2270 */ 2313 2271 2314 Void TEncSbac::estLastSignificantPositionBit( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, ChannelType chType ) 2315 { 2272 Void TEncSbac::estLastSignificantPositionBit( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, ChannelType chType, COEFF_SCAN_TYPE scanType ) 2273 { 2274 if (scanType == SCAN_VER) 2275 { 2276 swap(width, height); 2277 } 2278 2316 2279 //--------------------------------------------------------------------------------------------------. 2317 2280 … … 2459 2422 } 2460 2423 2461 #if NH_3D _DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER2424 #if NH_3D 2462 2425 Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx ) 2463 2426 { 2464 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER2465 2427 if( !(pcCU->getSDCFlag( absPartIdx )) ) 2466 #endif2467 #if NH_3D_DMM2468 2428 if( !(pcCU->isIntra( absPartIdx ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) )) ) 2469 #endif2470 2429 assert( 0 ); 2471 2430 2472 2431 UInt uiNumSegments = 1; 2473 #if NH_3D_DMM2474 2432 uiNumSegments = isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ) ? 2 : 1; 2475 #endif2476 2433 2477 2434 UInt hasDeltaDC = 1; 2478 #if NH_3D_SDC_INTRA2479 2435 if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx )) 2480 2436 { … … 2489 2445 m_pcBinIf->encodeBin( hasDeltaDC, m_cDdcFlagSCModel.get( 0, 0, 0 ) ); 2490 2446 } 2491 #endif2492 2447 2493 2448 if( hasDeltaDC ) … … 2498 2453 if( pcCU->isIntra( absPartIdx ) ) 2499 2454 { 2500 #if NH_3D_SDC_INTRA2501 2455 if( pcCU->getSDCFlag( absPartIdx ) ) 2502 2456 { … … 2505 2459 else 2506 2460 { 2507 #endif2508 #if NH_3D_DMM2509 2461 deltaDC = pcCU->getDmmDeltaDC( getDmmType( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ), segment, absPartIdx ); 2510 #endif 2511 #if NH_3D_SDC_INTRA 2512 } 2513 #endif 2514 } 2515 #if NH_3D_SDC_INTER 2462 } 2463 } 2516 2464 else 2517 2465 { 2518 2466 deltaDC = pcCU->getSDCSegmentDCOffset( segment, absPartIdx ); 2519 2467 } 2520 #endif2521 2468 xCodeDeltaDC( deltaDC, uiNumSegments ); 2522 2469 } … … 2565 2512 return; 2566 2513 } 2567 #endif 2568 2569 #if NH_3D_DMM 2514 2570 2515 Void TEncSbac::xCodeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx ) 2571 2516 { … … 2612 2557 } 2613 2558 } 2614 #endif 2615 2616 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER 2559 2617 2560 Void TEncSbac::codeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2618 2561 { … … 2624 2567 } 2625 2568 2626 #endif 2627 2628 #if NH_3D_DBBP 2569 2629 2570 Void TEncSbac::codeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2630 2571 {
Note: See TracChangeset for help on using the changeset viewer.