Changeset 1152 in 3DVCSoftware for branches/HTM-13.1-dev2-HiSilicon/source/Lib
- Timestamp:
- 27 Feb 2015, 08:24:20 (10 years ago)
- Location:
- branches/HTM-13.1-dev2-HiSilicon/source/Lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-13.1-dev2-HiSilicon/source/Lib/TLibCommon/TComDataCU.cpp
r1142 r1152 2322 2322 Int iPictureWidth = depthPicYuv->getWidth(); 2323 2323 Int iPictureHeight = depthPicYuv->getHeight(); 2324 2324 2325 #if !HS_DBBP_CLEAN_K0048 2325 2326 Int iWidth = uiWidth; 2326 2327 Int iHeight = uiHeight; 2328 #endif 2327 2329 2328 2330 Bool depthRefineFlag = false; … … 2337 2339 } 2338 2340 2341 #if HS_DBBP_CLEAN_K0048 2342 Int depthPosX = Clip3(0, iPictureWidth - 1, iBlkX + ((cDv.getHor()+2)>>2)); 2343 Int depthPosY = Clip3(0, iPictureHeight - 1, iBlkY + ((cDv.getVer()+2)>>2)); 2344 #else 2339 2345 Int depthPosX = Clip3(0, iPictureWidth - iWidth, iBlkX + ((cDv.getHor()+2)>>2)); 2340 2346 Int depthPosY = Clip3(0, iPictureHeight- iHeight, iBlkY + ((cDv.getVer()+2)>>2)); 2347 #endif 2341 2348 2342 2349 pDepthPels = depthPicYuv->getLumaAddr() + depthPosX + depthPosY * uiDepthStride; -
branches/HTM-13.1-dev2-HiSilicon/source/Lib/TLibCommon/TComPrediction.cpp
r1133 r1152 630 630 631 631 #if H_3D_DBBP 632 #if HS_DBBP_CLEAN_K0048 633 PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU) 634 #else 632 635 PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize) 636 #endif 633 637 { 634 638 // find virtual partitioning for this CU based on depth block 635 639 // segmentation of texture block --> mask IDs 636 Pel* pDepthBlockStart 640 Pel* pDepthBlockStart = pDepthPels; 637 641 638 642 // first compute average of depth block for thresholding 639 643 Int iSumDepth = 0; 640 644 Int iSubSample = 4; 645 #if HS_DBBP_CLEAN_K0048 646 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(); 647 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(); 648 TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag( ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV; 649 if( pcCU->getSlice()->getDepthRefinementFlag( ) ) 650 { 651 cDv.setVer(0); 652 } 653 Int iBlkX = ( pcCU->getAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2); 654 Int iBlkY = ( pcCU->getAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2); 655 UInt t=0; 656 641 657 for (Int y=0; y<uiSize; y+=iSubSample) 642 {658 { 643 659 for (Int x=0; x<uiSize; x+=iSubSample) 644 { 645 Int depthPel = pDepthPels[x]; 646 647 iSumDepth += depthPel; 648 } 660 { 661 if (iBlkX+x>iPictureWidth) 662 { 663 Int depthPel = pDepthPels[t]; 664 iSumDepth += depthPel; 665 } 666 else 667 { 668 Int depthPel = pDepthPels[x]; 669 t=x; 670 iSumDepth += depthPel; 671 } 672 } 649 673 650 674 // next row 675 if (!(iBlkY+y+4>iPictureHeight)) 651 676 pDepthPels += uiDepthStride*iSubSample; 677 #else 678 for (Int y=0; y<uiSize; y+=iSubSample) 679 { 680 for (Int x=0; x<uiSize; x+=iSubSample) 681 { 682 Int depthPel = pDepthPels[x]; 683 684 iSumDepth += depthPel; 685 } 686 687 // next row 688 pDepthPels += uiDepthStride*iSubSample; 689 #endif 652 690 } 653 691 … … 667 705 for (Int x=0; x<uiSize; x+=iSubSample) 668 706 { 669 Int depthPel = pDepthPels[x]; 707 #if HS_DBBP_CLEAN_K0048 708 Int depthPel = 0; 709 if (iBlkX+x>iPictureWidth) 710 { 711 depthPel = pDepthPels[t]; 712 } 713 else 714 { 715 depthPel = pDepthPels[x]; 716 t=x; 717 } 718 #else 719 Int depthPel = pDepthPels[x]; 720 #endif 670 721 671 722 // decide which segment this pixel belongs to … … 696 747 697 748 // next row 749 #if HS_DBBP_CLEAN_K0048 750 if (!(iBlkY+y+4>iPictureHeight)) 751 #endif 698 752 pDepthPels += uiDepthStride*iSubSample; 699 753 } … … 719 773 } 720 774 721 Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask ) 775 #if HS_DBBP_CLEAN_K0048 776 Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU) 777 #else 778 Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask) 779 #endif 722 780 { 723 781 // segmentation of texture block --> mask IDs … … 728 786 Int uiMinDepth = MAX_INT; 729 787 Int uiMaxDepth = 0; 730 788 #if HS_DBBP_CLEAN_K0048 789 uiMinDepth = pDepthPels[ 0 ]; 790 uiMaxDepth = pDepthPels[ 0 ]; 791 iSumDepth = pDepthPels[ 0 ]; 792 UInt t=0; 793 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(); 794 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(); 795 TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag( ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV; 796 if( pcCU->getSlice()->getDepthRefinementFlag( ) ) 797 { 798 cDv.setVer(0); 799 } 800 Int iBlkX = ( pcCU->getAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2); 801 Int iBlkY = ( pcCU->getAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2); 802 if (iBlkX>(Int)(iPictureWidth - uiWidth)) 803 { 804 iSumDepth += pDepthPels[ iPictureWidth - iBlkX - 1 ]; 805 uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ iPictureWidth - iBlkX - 1 ]); 806 uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ iPictureWidth - iBlkX - 1 ]); 807 } 808 else 809 { 810 iSumDepth += pDepthPels[ uiWidth - 1 ]; 811 uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiWidth - 1 ]); 812 uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiWidth - 1 ]); 813 } 814 if (iBlkY>(Int)(iPictureHeight - uiHeight)) 815 { 816 iSumDepth += pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) ]; 817 uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) ]); 818 uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) ]); 819 } 820 else 821 { 822 iSumDepth += pDepthPels[ uiDepthStride * (uiHeight - 1) ]; 823 uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) ]); 824 uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) ]); 825 } 826 if (iBlkY>(Int)(iPictureHeight - uiHeight) && iBlkX>(Int)(iPictureWidth - uiWidth)) 827 { 828 iSumDepth += pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) + iPictureWidth - iBlkX - 1 ]; 829 uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) + iPictureWidth - iBlkX - 1 ]); 830 uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) + iPictureWidth - iBlkX - 1 ]); 831 } 832 else if (iBlkY>(Int)(iPictureHeight - uiHeight)) 833 { 834 iSumDepth += pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) + uiWidth - 1 ]; 835 uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) + uiWidth - 1 ]); 836 uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (iPictureHeight - iBlkY - 1) + uiWidth - 1 ]); 837 } 838 else if (iBlkX>(Int)(iPictureWidth - uiWidth)) 839 { 840 iSumDepth += pDepthPels[ uiDepthStride * (uiHeight - 1) + iPictureWidth - iBlkX - 1 ]; 841 uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + iPictureWidth - iBlkX - 1 ]); 842 uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + iPictureWidth - iBlkX - 1 ]); 843 } 844 else 845 { 846 iSumDepth += pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ]; 847 uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ]); 848 uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ]); 849 } 850 #else 731 851 iSumDepth = pDepthPels[ 0 ]; 732 852 iSumDepth += pDepthPels[ uiWidth - 1 ]; … … 743 863 uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) ]); 744 864 uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ]); 745 865 #endif 746 866 747 867 // don't generate mask for blocks with small depth range (encoder decision) … … 765 885 for (Int x=0; x<uiHeight; x++) 766 886 { 887 #if HS_DBBP_CLEAN_K0048 888 Int depthPel = 0; 889 if (iBlkX+x>iPictureWidth) 890 { 891 depthPel = pDepthPels[t]; 892 } 893 else 894 { 895 depthPel = pDepthPels[x]; 896 t=x; 897 } 898 #else 767 899 Int depthPel = pDepthPels[x]; 900 #endif 768 901 769 902 // decide which segment this pixel belongs to … … 783 916 784 917 // next row 918 #if HS_DBBP_CLEAN_K0048 919 if (!(iBlkY+y+1>iPictureHeight)) 920 #endif 785 921 pDepthPels += uiDepthStride; 786 922 pMask += MAX_CU_SIZE; -
branches/HTM-13.1-dev2-HiSilicon/source/Lib/TLibCommon/TComPrediction.h
r1084 r1152 175 175 176 176 #if H_3D_DBBP 177 #if HS_DBBP_CLEAN_K0048 178 PartSize getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU); 179 Bool getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU); 180 #else 177 181 PartSize getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize); 178 182 Bool getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask ); 183 #endif 179 184 Void combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize ); 180 185 #endif -
branches/HTM-13.1-dev2-HiSilicon/source/Lib/TLibCommon/TypeDef.h
r1143 r1152 265 265 // SEC_DBBP_DMM4_THRESHOLD_I0076 Simplification of threshold derivation for DBBP and DMM4, JCT3V-I0076 266 266 // SEC_DBBP_VIEW_REF_CHECK_J0037 1 // Signaling dbbp_flag when the current slice has view reference picture(s), JCT3V-J0037 item4 267 #define HS_DBBP_CLEAN_K0048 1 267 268 268 269 #define H_3D_DDD 1 // Disparity derived depth coding -
branches/HTM-13.1-dev2-HiSilicon/source/Lib/TLibDecoder/TDecCu.cpp
r1133 r1152 835 835 // compute mask by segmenting depth block 836 836 Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE]; 837 #if HS_DBBP_CLEAN_K0048 838 Bool bValidMask = m_pcPrediction->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(0), pcCU->getHeight(0), pMask, pcCU); 839 #else 837 840 Bool bValidMask = m_pcPrediction->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(0), pcCU->getHeight(0), pMask); 841 #endif 838 842 AOF(bValidMask); 839 843 -
branches/HTM-13.1-dev2-HiSilicon/source/Lib/TLibEncoder/TEncCu.cpp
r1133 r1152 2522 2522 AOF( uiDepthStride != 0 ); 2523 2523 2524 #if HS_DBBP_CLEAN_K0048 2525 PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth, rpcTempCU); 2526 2524 2527 // derive partitioning from depth 2528 Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE]; 2529 Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask, rpcTempCU); 2530 #else 2525 2531 PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth); 2526 2532 … … 2528 2534 Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE]; 2529 2535 Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask); 2536 #endif 2530 2537 2531 2538 if( !bValidMask )
Note: See TracChangeset for help on using the changeset viewer.