Changeset 983 in 3DVCSoftware for branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder
- Timestamp:
- 11 Jul 2014, 03:49:39 (11 years ago)
- Location:
- branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecCAVLC.cpp
r976 r983 2473 2473 } 2474 2474 #endif 2475 #if MTK_SINGLE_DEPTH_MODE_I0095 2476 if(rpcSlice->getIsDepth()) 2477 { 2478 UInt uiCodeTmp = 0; 2479 READ_FLAG( uiCodeTmp, "slice_enable_single_depth_mode" ); 2480 rpcSlice->setApplySingleDepthMode(uiCodeTmp); 2481 } 2482 #endif 2475 2483 if (!rpcSlice->isIntra()) 2476 2484 { … … 2843 2851 assert(0); 2844 2852 } 2845 2853 #if MTK_SINGLE_DEPTH_MODE_I0095 2854 Void TDecCavlc::parseSingleDepthMode( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 2855 { 2856 assert(0); 2857 } 2858 #endif 2846 2859 Void TDecCavlc::parseCUTransquantBypassFlag( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 2847 2860 { -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecCAVLC.h
r976 r983 119 119 120 120 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 121 #if MTK_SINGLE_DEPTH_MODE_I0095 122 Void parseSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 123 #endif 121 124 Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 122 125 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecCu.cpp
r976 r983 542 542 return; 543 543 } 544 544 #if MTK_SINGLE_DEPTH_MODE_I0095 545 m_pcEntropyDecoder->decodeSingleDepthMode( pcCU, uiAbsPartIdx, uiDepth ); 546 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 547 { 548 #endif 545 549 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); 546 550 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); … … 572 576 m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, uiCurrWidth, uiCurrHeight, bCodeDQP ); 573 577 setdQPFlag( bCodeDQP ); 578 #if MTK_SINGLE_DEPTH_MODE_I0095 579 } 580 #endif 574 581 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); 575 582 #if H_3D_IV_MERGE … … 671 678 break; 672 679 case MODE_INTRA: 680 #if MTK_SINGLE_DEPTH_MODE_I0095 681 if( m_ppcCU[uiDepth]->getSingleDepthFlag(0) ) 682 xReconIntraSingleDepth( m_ppcCU[uiDepth], 0, uiDepth ); 683 #if H_3D_DIM_SDC 684 else if( m_ppcCU[uiDepth]->getSDCFlag(0) ) 685 xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); 686 #endif 687 else 688 #else 673 689 #if H_3D_DIM_SDC 674 690 if( m_ppcCU[uiDepth]->getSDCFlag(0) ) 675 691 xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); 676 692 else 693 #endif 677 694 #endif 678 695 xReconIntraQT( m_ppcCU[uiDepth], uiDepth ); … … 709 726 } 710 727 } 711 728 #if MTK_SINGLE_DEPTH_MODE_I0095 729 Void TDecCu::xReconIntraSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 730 { 731 UInt uiWidth = pcCU->getWidth ( 0 ); 732 UInt uiHeight = pcCU->getHeight ( 0 ); 733 734 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; 735 736 UInt uiStride = pcRecoYuv->getStride (); 737 Pel* piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); 738 739 740 AOF( uiWidth == uiHeight ); 741 AOF( uiAbsPartIdx == 0 ); 742 743 //construction of depth candidates 744 Pel testDepth; 745 Pel DepthNeighbours[5]; 746 Int index =0; 747 for( Int i = 0; (i < 5) && (index<MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE) ; i++ ) 748 { 749 if(!pcCU->getNeighDepth (0, uiAbsPartIdx, &testDepth, i)) 750 { 751 continue; 752 } 753 DepthNeighbours[index]=testDepth; 754 index++; 755 for(Int j=0;j<index-1;j++) 756 { 757 if( (DepthNeighbours[index-1]==DepthNeighbours[j]) ) 758 { 759 index--; 760 break; 761 } 762 } 763 } 764 765 if(index==0) 766 { 767 DepthNeighbours[index]=1<<(g_bitDepthY-1); 768 index++; 769 } 770 771 if(index==1) 772 { 773 DepthNeighbours[index]=ClipY(DepthNeighbours[0] + 1 ); 774 index++; 775 } 776 777 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 778 { 779 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 780 { 781 piReco[ uiX ] =DepthNeighbours[(Int)pcCU->getSingleDepthValue(uiAbsPartIdx)]; 782 } 783 piReco += uiStride; 784 } 785 786 // clear UV 787 UInt uiStrideC = pcRecoYuv->getCStride(); 788 Pel *pRecCb = pcRecoYuv->getCbAddr(); 789 Pel *pRecCr = pcRecoYuv->getCrAddr(); 790 791 for (Int y=0; y<uiHeight/2; y++) 792 { 793 for (Int x=0; x<uiWidth/2; x++) 794 { 795 pRecCb[x] = 1<<(g_bitDepthC-1); 796 pRecCr[x] = 1<<(g_bitDepthC-1); 797 } 798 799 pRecCb += uiStrideC; 800 pRecCr += uiStrideC; 801 } 802 } 803 #endif 712 804 #if H_3D_INTER_SDC 713 805 Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecCu.h
r872 r983 123 123 Void setdQPFlag ( Bool b ) { m_bDecodeDQP = b; } 124 124 Void xFillPCMBuffer (TComDataCU* pCU, UInt depth); 125 #if MTK_SINGLE_DEPTH_MODE_I0095 126 Void xReconIntraSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 127 #endif 125 128 #if H_3D_DIM_SDC 126 129 Void xReconIntraSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecEntropy.cpp
r976 r983 52 52 m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); 53 53 } 54 54 #if MTK_SINGLE_DEPTH_MODE_I0095 55 Void TDecEntropy::decodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 56 { 57 if ( !pcCU->getSlice()->getIsDepth() ) 58 { 59 return; 60 } 61 if(!pcCU->getSlice()->getApplySingleDepthMode()) 62 { 63 return; 64 } 65 m_pcEntropyDecoderIf->parseSingleDepthMode( pcCU, uiAbsPartIdx, uiDepth ); 66 } 67 #endif 55 68 Void TDecEntropy::decodeCUTransquantBypassFlag(TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 56 69 { -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecEntropy.h
r976 r983 89 89 public: 90 90 virtual Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 91 #if MTK_SINGLE_DEPTH_MODE_I0095 92 virtual Void parseSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 93 #endif 91 94 virtual Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 92 95 virtual Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 176 179 Void decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 177 180 Void decodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 181 #if MTK_SINGLE_DEPTH_MODE_I0095 182 Void decodeSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) ; 183 #endif 178 184 Void decodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 179 185 Void decodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecSbac.cpp
r976 r983 52 52 , m_cCUSplitFlagSCModel ( 1, 1, NUM_SPLIT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels ) 53 53 , m_cCUSkipFlagSCModel ( 1, 1, NUM_SKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 54 #if MTK_SINGLE_DEPTH_MODE_I0095 55 , m_cCUSingleDepthFlagSCModel ( 1, 1, NUM_SINGLEDEPTH_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 56 , m_cSingleDepthValueSCModel ( 1, 1, NUM_SINGLE_DEPTH_VALUE_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 57 #endif 54 58 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 55 59 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 132 136 m_cCUSplitFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SPLIT_FLAG ); 133 137 m_cCUSkipFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SKIP_FLAG ); 138 #if MTK_SINGLE_DEPTH_MODE_I0095 139 m_cCUSingleDepthFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 140 m_cSingleDepthValueSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 141 #endif 134 142 m_cCUMergeFlagExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT ); 135 143 m_cCUMergeIdxExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT ); … … 199 207 m_cCUSplitFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SPLIT_FLAG ); 200 208 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 209 #if MTK_SINGLE_DEPTH_MODE_I0095 210 m_cCUSingleDepthFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 211 m_cSingleDepthValueSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 212 #endif 201 213 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT ); 202 214 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT ); … … 636 648 #endif 637 649 } 638 650 #if MTK_SINGLE_DEPTH_MODE_I0095 651 Void TDecSbac::parseSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 652 { 653 pcCU->setSingleDepthFlagSubParts( false, uiAbsPartIdx, uiDepth ); 654 UInt uiSymbol = 0; 655 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSingleDepthFlagSCModel.get( 0, 0, 0 ) ); 656 if( uiSymbol ) 657 { 658 pcCU->setSingleDepthFlagSubParts( true, uiAbsPartIdx, uiDepth ); 659 pcCU->setSkipFlagSubParts( false, uiAbsPartIdx, uiDepth ); 660 pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth ); 661 pcCU->setPredModeSubParts( MODE_INTRA, uiAbsPartIdx, uiDepth ); 662 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 663 pcCU->setLumaIntraDirSubParts (DC_IDX, uiAbsPartIdx, uiDepth ); 664 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 665 pcCU->setMergeFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); 666 pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth); 667 pcCU->setCbfSubParts(0, 1, 1, uiAbsPartIdx, uiDepth); 668 669 UInt absValDeltaDC = 0; 670 671 UInt uiUnaryIdx = 0; 672 UInt uiNumCand = MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE; 673 if ( uiNumCand > 1 ) 674 { 675 for( ; uiUnaryIdx < uiNumCand - 1; ++uiUnaryIdx ) 676 { 677 UInt uiSymbol2 = 0; 678 if ( uiUnaryIdx==0 ) 679 { 680 m_pcTDecBinIf->decodeBin( uiSymbol2, m_cSingleDepthValueSCModel.get( 0, 0, 0 ) ); 681 } 682 else 683 { 684 m_pcTDecBinIf->decodeBinEP( uiSymbol2); 685 } 686 if( uiSymbol2 == 0 ) 687 { 688 break; 689 } 690 } 691 } 692 absValDeltaDC = uiUnaryIdx; 693 pcCU->setSingleDepthValueSubParts((Pel)absValDeltaDC,uiAbsPartIdx, 0, uiDepth); 694 } 695 } 696 697 #endif 639 698 /** parse merge flag 640 699 * \param pcCU -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecSbac.h
r976 r983 129 129 130 130 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 131 #if MTK_SINGLE_DEPTH_MODE_I0095 132 Void parseSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 133 #endif 131 134 Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 132 135 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 179 182 ContextModel3DBuffer m_cCUSplitFlagSCModel; 180 183 ContextModel3DBuffer m_cCUSkipFlagSCModel; 184 #if MTK_SINGLE_DEPTH_MODE_I0095 185 ContextModel3DBuffer m_cCUSingleDepthFlagSCModel; 186 ContextModel3DBuffer m_cSingleDepthValueSCModel; 187 #endif 181 188 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 182 189 ContextModel3DBuffer m_cCUMergeIdxExtSCModel;
Note: See TracChangeset for help on using the changeset viewer.