Changeset 296 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
- Timestamp:
- 20 Feb 2013, 22:07:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
r189 r296 72 72 pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); 73 73 74 if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0) || pcCU->getSlice()->getSPS()->isDepth()) 74 if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0) 75 #if !LGE_ILLUCOMP_DEPTH_C0046 76 || pcCU->getSlice()->getSPS()->isDepth() 77 #endif 78 ) 75 79 { 76 80 return; … … 80 84 return; 81 85 86 #if LGE_ILLUCOMP_DEPTH_C0046 87 if(pcCU->isICFlagRequired(uiAbsPartIdx, uiDepth)) //This modification is not needed after integrating JCT3V-C0137 88 #else 82 89 if(pcCU->isICFlagRequired(uiAbsPartIdx)) 90 #endif 83 91 m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth ); 84 92 } … … 100 108 } 101 109 102 #if H HI_INTER_VIEW_RESIDUAL_PRED110 #if H3D_IVRP && !MTK_MDIVRP_C0138 103 111 Void 104 112 TDecEntropy::decodeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx ) … … 115 123 if( bResPredAllowed ) 116 124 { 117 bResPredAvailable = pcSubCU->getResidualSamples( uiPUIdx 118 #if QC_SIMPLIFIEDIVRP_M24938 119 , false 120 #endif 121 ); 125 bResPredAvailable = pcSubCU->getResidualSamples( uiPUIdx , false ); 122 126 } 123 127 … … 272 276 273 277 #if CU_BASED_MRG_CAND_LIST 274 #if H HI_INTER_VIEW_MOTION_PRED278 #if H3D_IVMP 275 279 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 276 280 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; … … 293 297 { 294 298 #if !CU_BASED_MRG_CAND_LIST 295 #if H HI_INTER_VIEW_MOTION_PRED299 #if H3D_IVMP 296 300 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 297 301 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; … … 326 330 else 327 331 { 328 #if SIMP_MRG_PRUN329 332 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 330 333 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 331 #else332 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );333 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);334 #endif335 334 } 336 335 #else 337 #if SIMP_MRG_PRUN338 336 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 337 #if MERL_VSP_C0152 338 Int iVSPIndexTrue[3] = {-1, -1, -1}; 339 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex ); 340 341 #if HHI_MPI 342 if(pcCU->getTextureModeDepth( uiSubPartIdx ) == uiDepth)//MPI is used 343 { 344 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 345 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 346 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 347 { 348 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui); 349 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 350 } 351 } 352 else // MPI not used 353 #endif 354 { 355 Int iVSPIdx = 0; 356 Int numVspIdx; 357 numVspIdx = 3; 358 for (Int i = 0; i < numVspIdx; i++) 359 { 360 if (iVSPIndexTrue[i] == uiMergeIndex) 361 { 362 iVSPIdx = i+1; 363 break; 364 } 365 } 366 pcCU->setVSPIndexSubParts( iVSPIdx, uiSubPartIdx, uiPartIdx, uiDepth ); //Initialize the VSP, may change later in get InterMergeCandidates() 367 } 368 369 #else 339 370 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 340 #else341 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );342 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);343 371 #endif 344 372 #endif … … 485 513 if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) && (pcSubCU->getAMVPMode(uiPartAddr) == AM_EXPL) ) 486 514 { 487 #if H HI_INTER_VIEW_MOTION_PRED515 #if H3D_IVMP 488 516 const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcSubCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 489 517 m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx, iNumAMVPCands ); … … 492 520 #endif 493 521 } 494 #if SHARP_INTERVIEW_DECOUPLE_B0111522 #if H3D_IVMP 495 523 pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo, iMVPIdx); 496 524 #else … … 509 537 } 510 538 511 #if UNIFIED_TRANSFORM_TREE512 539 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3, Bool& bCodeDQP ) 513 #else514 Void TDecEntropy::xDecodeTransformSubdiv( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3 )515 #endif516 540 { 517 541 UInt uiSubdiv; 518 542 const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth; 519 543 520 #if UNIFIED_TRANSFORM_TREE521 544 if(uiTrIdx==0) 522 545 { … … 532 555 } 533 556 } 534 #endif // UNIFIED_TRANSFORM_TREE535 557 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) ) 536 558 { 537 559 uiSubdiv = 1; 538 560 } 539 #if G519_TU_AMP_NSQT_HARMONIZATION540 561 else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) ) 541 #else542 else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) )543 #endif544 562 { 545 563 uiSubdiv = (uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx)); … … 618 636 if( uiSubdiv ) 619 637 { 620 #if UNIFIED_TRANSFORM_TREE621 638 UInt size; 622 639 width >>= 1; … … 624 641 size = width*height; 625 642 uiTrIdx++; 626 #endif627 643 ++uiDepth; 628 644 const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); … … 640 656 for( Int i = 0; i < 4; i++ ) 641 657 { 642 #if UNIFIED_TRANSFORM_TREE643 658 UInt nsAddr = 0; 644 659 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 ); 645 660 xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV, bCodeDQP ); 646 #else647 UInt nsAddr = 0;648 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 );649 xDecodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV );650 #endif651 661 uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode ); 652 662 uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiChromaTrMode ); 653 663 uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiChromaTrMode ); 654 664 uiAbsPartIdx += uiQPartNum; 655 #if UNIFIED_TRANSFORM_TREE656 665 offsetLuma += size; offsetChroma += (size>>2); 657 #endif658 666 } 659 667 … … 713 721 } 714 722 } 715 #if UNIFIED_TRANSFORM_TREE716 723 // transform_unit begin 717 724 UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA , uiTrIdx ); … … 779 786 } 780 787 // transform_unit end 781 #endif // UNIFIED_TRANSFORM_TREE 782 } 783 } 784 785 #if !UNIFIED_TRANSFORM_TREE 786 Void TDecEntropy::decodeTransformIdx( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 787 { 788 DTRACE_CABAC_VL( g_nSymbolCounter++ ) 789 DTRACE_CABAC_T( "\tdecodeTransformIdx()\tCUDepth=" ) 790 DTRACE_CABAC_V( uiDepth ) 791 DTRACE_CABAC_T( "\n" ) 792 UInt temp = 0; 793 UInt temp1 = 0; 794 UInt temp2 = 0; 795 xDecodeTransformSubdiv( pcCU, uiAbsPartIdx, uiAbsPartIdx, uiDepth, 0, temp, temp1, temp2 ); 796 } 797 #endif // UNIFIED_TRANSFORM_TREE 798 799 #if UNIFIED_TRANSFORM_TREE 788 } 789 } 790 791 800 792 Void TDecEntropy::decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 801 793 { … … 805 797 } 806 798 } 807 #else 808 Void TDecEntropy::decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 809 { 810 if ( pcCU->getSlice()->getPPS()->getUseDQP() ) 811 { 812 m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, uiDepth ); 813 } 814 } 815 #endif 816 817 #if !UNIFIED_TRANSFORM_TREE 818 Void TDecEntropy::xDecodeCoeff( TComDataCU* pcCU, UInt uiLumaOffset, UInt uiChromaOffset, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, UInt uiTrIdx, UInt uiCurrTrIdx, Bool& bCodeDQP ) 819 { 820 UInt uiLog2TrSize = g_aucConvertToBit[ pcCU->getSlice()->getSPS()->getMaxCUWidth() >> uiDepth ] + 2; 821 UInt uiCbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx ); 822 UInt uiCbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); 823 UInt uiCbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); 824 if( uiLog2TrSize == 2 ) 825 { 826 UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); 827 if( ( uiAbsPartIdx % uiQPDiv ) == 0 ) 828 { 829 m_uiBakAbsPartIdx = uiAbsPartIdx; 830 m_uiBakChromaOffset = uiChromaOffset; 831 } 832 else if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) ) 833 { 834 uiCbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); 835 uiCbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); 836 } 837 } 838 839 if ( uiCbfY || uiCbfU || uiCbfV ) 840 { 841 // dQP: only for LCU 842 if ( pcCU->getSlice()->getPPS()->getUseDQP() ) 843 { 844 if ( bCodeDQP ) 845 { 846 decodeQP( pcCU, uiAbsPartIdx, uiDepth); 847 bCodeDQP = false; 848 } 849 } 850 UInt uiLumaTrMode, uiChromaTrMode; 851 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx( uiAbsPartIdx ), uiLumaTrMode, uiChromaTrMode ); 852 const UInt uiStopTrMode = uiLumaTrMode; 853 854 if( uiTrIdx == uiStopTrMode ) 855 { 856 if( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx ) ) 857 { 858 Int trWidth = uiWidth; 859 Int trHeight = uiHeight; 860 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); 861 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+uiLumaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA ); 862 } 863 864 uiWidth >>= 1; 865 uiHeight >>= 1; 866 867 if( uiLog2TrSize == 2 ) 868 { 869 UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); 870 if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) ) 871 { 872 uiWidth <<= 1; 873 uiHeight <<= 1; 874 Int trWidth = uiWidth; 875 Int trHeight = uiHeight; 876 pcCU->getNSQTSize( uiTrIdx-1, uiAbsPartIdx, trWidth, trHeight ); 877 if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) ) 878 { 879 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); 880 } 881 if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) ) 882 { 883 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); 884 } 885 } 886 } 887 else 888 { 889 Int trWidth = uiWidth; 890 Int trHeight = uiHeight; 891 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); 892 if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) ) 893 { 894 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); 895 } 896 if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) ) 897 { 898 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); 899 } 900 } 901 } 902 else 903 { 904 { 905 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 906 DTRACE_CABAC_T( "\tgoing down\tdepth=" ); 907 DTRACE_CABAC_V( uiDepth ); 908 DTRACE_CABAC_T( "\ttridx=" ); 909 DTRACE_CABAC_V( uiTrIdx ); 910 DTRACE_CABAC_T( "\n" ); 911 } 912 if( uiCurrTrIdx <= uiTrIdx ) 913 { 914 assert(1); 915 } 916 UInt uiSize; 917 uiWidth >>= 1; 918 uiHeight >>= 1; 919 uiSize = uiWidth*uiHeight; 920 uiDepth++; 921 uiTrIdx++; 922 923 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 924 UInt uiIdx = uiAbsPartIdx; 925 926 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); 927 uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; 928 929 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); 930 uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; 931 932 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); 933 uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; 934 935 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); 936 { 937 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 938 DTRACE_CABAC_T( "\tgoing up\n" ); 939 } 940 } 941 } 942 } 943 #endif // !UNIFIED_TRANSFORM_TREE 799 944 800 945 801 /** decode coefficients … … 956 812 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 957 813 UInt uiChromaOffset = uiLumaOffset>>2; 958 #if UNIFIED_TRANSFORM_TREE959 814 UInt temp = 0; 960 815 UInt temp1 = 0; 961 816 UInt temp2 = 0; 962 #else963 UInt uiLumaTrMode, uiChromaTrMode;964 #endif965 817 966 818 #if RWTH_SDC_DLT_B0036 … … 980 832 if( pcCU->isIntra(uiAbsPartIdx) ) 981 833 { 982 #if !UNIFIED_TRANSFORM_TREE983 decodeTransformIdx( pcCU, uiAbsPartIdx, pcCU->getDepth(uiAbsPartIdx) );984 985 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode );986 987 #endif // !UNIFIED_TRANSFORM_TREE988 834 } 989 835 else … … 1007 853 } 1008 854 1009 #if !UNIFIED_TRANSFORM_TREE1010 decodeTransformIdx( pcCU, uiAbsPartIdx, pcCU->getDepth(uiAbsPartIdx) );1011 1012 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode );1013 #endif // !UNIFIED_TRANSFORM_TREE1014 855 } 1015 856 … … 1030 871 #endif 1031 872 1032 #if UNIFIED_TRANSFORM_TREE1033 873 xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP ); 1034 #else // UNIFIED_TRANSFORM_TREE1035 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP );1036 #endif // UNIFIED_TRANSFORM_TREE1037 874 1038 875 #if FIX_MPI_B0065
Note: See TracChangeset for help on using the changeset viewer.