Changeset 294 in 3DVCSoftware for branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
- Timestamp:
- 19 Feb 2013, 20:33:52 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
r292 r294 330 330 else 331 331 { 332 #if SIMP_MRG_PRUN333 332 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 334 333 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 335 #else336 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );337 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);338 #endif339 334 } 340 335 #else 341 #if SIMP_MRG_PRUN342 336 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 343 337 #if MERL_VSP_C0152 … … 375 369 #else 376 370 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 377 #endif378 #else379 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );380 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);381 371 #endif 382 372 #endif … … 547 537 } 548 538 549 #if UNIFIED_TRANSFORM_TREE550 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 ) 551 #else552 Void TDecEntropy::xDecodeTransformSubdiv( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3 )553 #endif554 540 { 555 541 UInt uiSubdiv; 556 542 const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth; 557 543 558 #if UNIFIED_TRANSFORM_TREE559 544 if(uiTrIdx==0) 560 545 { … … 570 555 } 571 556 } 572 #endif // UNIFIED_TRANSFORM_TREE573 557 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) ) 574 558 { 575 559 uiSubdiv = 1; 576 560 } 577 #if G519_TU_AMP_NSQT_HARMONIZATION578 561 else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) ) 579 #else580 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)) )581 #endif582 562 { 583 563 uiSubdiv = (uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx)); … … 656 636 if( uiSubdiv ) 657 637 { 658 #if UNIFIED_TRANSFORM_TREE659 638 UInt size; 660 639 width >>= 1; … … 662 641 size = width*height; 663 642 uiTrIdx++; 664 #endif665 643 ++uiDepth; 666 644 const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); … … 678 656 for( Int i = 0; i < 4; i++ ) 679 657 { 680 #if UNIFIED_TRANSFORM_TREE681 658 UInt nsAddr = 0; 682 659 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 ); 683 660 xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV, bCodeDQP ); 684 #else685 UInt nsAddr = 0;686 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 );687 xDecodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV );688 #endif689 661 uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode ); 690 662 uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiChromaTrMode ); 691 663 uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiChromaTrMode ); 692 664 uiAbsPartIdx += uiQPartNum; 693 #if UNIFIED_TRANSFORM_TREE694 665 offsetLuma += size; offsetChroma += (size>>2); 695 #endif696 666 } 697 667 … … 751 721 } 752 722 } 753 #if UNIFIED_TRANSFORM_TREE754 723 // transform_unit begin 755 724 UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA , uiTrIdx ); … … 817 786 } 818 787 // transform_unit end 819 #endif // UNIFIED_TRANSFORM_TREE 820 } 821 } 822 823 #if !UNIFIED_TRANSFORM_TREE 824 Void TDecEntropy::decodeTransformIdx( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 825 { 826 DTRACE_CABAC_VL( g_nSymbolCounter++ ) 827 DTRACE_CABAC_T( "\tdecodeTransformIdx()\tCUDepth=" ) 828 DTRACE_CABAC_V( uiDepth ) 829 DTRACE_CABAC_T( "\n" ) 830 UInt temp = 0; 831 UInt temp1 = 0; 832 UInt temp2 = 0; 833 xDecodeTransformSubdiv( pcCU, uiAbsPartIdx, uiAbsPartIdx, uiDepth, 0, temp, temp1, temp2 ); 834 } 835 #endif // UNIFIED_TRANSFORM_TREE 836 837 #if UNIFIED_TRANSFORM_TREE 788 } 789 } 790 791 838 792 Void TDecEntropy::decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 839 793 { … … 843 797 } 844 798 } 845 #else 846 Void TDecEntropy::decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 847 { 848 if ( pcCU->getSlice()->getPPS()->getUseDQP() ) 849 { 850 m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, uiDepth ); 851 } 852 } 853 #endif 854 855 #if !UNIFIED_TRANSFORM_TREE 856 Void TDecEntropy::xDecodeCoeff( TComDataCU* pcCU, UInt uiLumaOffset, UInt uiChromaOffset, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, UInt uiTrIdx, UInt uiCurrTrIdx, Bool& bCodeDQP ) 857 { 858 UInt uiLog2TrSize = g_aucConvertToBit[ pcCU->getSlice()->getSPS()->getMaxCUWidth() >> uiDepth ] + 2; 859 UInt uiCbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx ); 860 UInt uiCbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); 861 UInt uiCbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); 862 if( uiLog2TrSize == 2 ) 863 { 864 UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); 865 if( ( uiAbsPartIdx % uiQPDiv ) == 0 ) 866 { 867 m_uiBakAbsPartIdx = uiAbsPartIdx; 868 m_uiBakChromaOffset = uiChromaOffset; 869 } 870 else if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) ) 871 { 872 uiCbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); 873 uiCbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); 874 } 875 } 876 877 if ( uiCbfY || uiCbfU || uiCbfV ) 878 { 879 // dQP: only for LCU 880 if ( pcCU->getSlice()->getPPS()->getUseDQP() ) 881 { 882 if ( bCodeDQP ) 883 { 884 decodeQP( pcCU, uiAbsPartIdx, uiDepth); 885 bCodeDQP = false; 886 } 887 } 888 UInt uiLumaTrMode, uiChromaTrMode; 889 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx( uiAbsPartIdx ), uiLumaTrMode, uiChromaTrMode ); 890 const UInt uiStopTrMode = uiLumaTrMode; 891 892 if( uiTrIdx == uiStopTrMode ) 893 { 894 if( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx ) ) 895 { 896 Int trWidth = uiWidth; 897 Int trHeight = uiHeight; 898 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); 899 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+uiLumaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA ); 900 } 901 902 uiWidth >>= 1; 903 uiHeight >>= 1; 904 905 if( uiLog2TrSize == 2 ) 906 { 907 UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); 908 if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) ) 909 { 910 uiWidth <<= 1; 911 uiHeight <<= 1; 912 Int trWidth = uiWidth; 913 Int trHeight = uiHeight; 914 pcCU->getNSQTSize( uiTrIdx-1, uiAbsPartIdx, trWidth, trHeight ); 915 if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) ) 916 { 917 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); 918 } 919 if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) ) 920 { 921 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); 922 } 923 } 924 } 925 else 926 { 927 Int trWidth = uiWidth; 928 Int trHeight = uiHeight; 929 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); 930 if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) ) 931 { 932 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); 933 } 934 if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) ) 935 { 936 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); 937 } 938 } 939 } 940 else 941 { 942 { 943 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 944 DTRACE_CABAC_T( "\tgoing down\tdepth=" ); 945 DTRACE_CABAC_V( uiDepth ); 946 DTRACE_CABAC_T( "\ttridx=" ); 947 DTRACE_CABAC_V( uiTrIdx ); 948 DTRACE_CABAC_T( "\n" ); 949 } 950 if( uiCurrTrIdx <= uiTrIdx ) 951 { 952 assert(1); 953 } 954 UInt uiSize; 955 uiWidth >>= 1; 956 uiHeight >>= 1; 957 uiSize = uiWidth*uiHeight; 958 uiDepth++; 959 uiTrIdx++; 960 961 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 962 UInt uiIdx = uiAbsPartIdx; 963 964 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); 965 uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; 966 967 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); 968 uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; 969 970 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); 971 uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; 972 973 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); 974 { 975 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 976 DTRACE_CABAC_T( "\tgoing up\n" ); 977 } 978 } 979 } 980 } 981 #endif // !UNIFIED_TRANSFORM_TREE 799 982 800 983 801 /** decode coefficients … … 994 812 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 995 813 UInt uiChromaOffset = uiLumaOffset>>2; 996 #if UNIFIED_TRANSFORM_TREE997 814 UInt temp = 0; 998 815 UInt temp1 = 0; 999 816 UInt temp2 = 0; 1000 #else1001 UInt uiLumaTrMode, uiChromaTrMode;1002 #endif1003 817 1004 818 #if RWTH_SDC_DLT_B0036 … … 1018 832 if( pcCU->isIntra(uiAbsPartIdx) ) 1019 833 { 1020 #if !UNIFIED_TRANSFORM_TREE1021 decodeTransformIdx( pcCU, uiAbsPartIdx, pcCU->getDepth(uiAbsPartIdx) );1022 1023 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode );1024 1025 #endif // !UNIFIED_TRANSFORM_TREE1026 834 } 1027 835 else … … 1045 853 } 1046 854 1047 #if !UNIFIED_TRANSFORM_TREE1048 decodeTransformIdx( pcCU, uiAbsPartIdx, pcCU->getDepth(uiAbsPartIdx) );1049 1050 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode );1051 #endif // !UNIFIED_TRANSFORM_TREE1052 855 } 1053 856 … … 1068 871 #endif 1069 872 1070 #if UNIFIED_TRANSFORM_TREE1071 873 xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP ); 1072 #else // UNIFIED_TRANSFORM_TREE1073 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP );1074 #endif // UNIFIED_TRANSFORM_TREE1075 874 1076 875 #if FIX_MPI_B0065
Note: See TracChangeset for help on using the changeset viewer.