Changeset 1173 in 3DVCSoftware for branches/HTM-13.1-dev0/source/Lib/TLibCommon
- Timestamp:
- 5 Apr 2015, 23:05:17 (10 years ago)
- Location:
- branches/HTM-13.1-dev0/source/Lib/TLibCommon
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp
r1164 r1173 781 781 // segmentation of texture block --> mask IDs 782 782 Pel* pDepthBlockStart = pDepthPels; 783 783 784 784 // first compute average of depth block for thresholding 785 785 Int iSumDepth = 0; … … 790 790 uiMaxDepth = pDepthPels[ 0 ]; 791 791 iSumDepth = pDepthPels[ 0 ]; 792 792 UInt t=0; 793 793 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(); 794 794 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(); … … 796 796 if( pcCU->getSlice()->getDepthRefinementFlag( ) ) 797 797 { 798 798 cDv.setVer(0); 799 799 } 800 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 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 else809 {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 else821 {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 else845 {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 }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 850 #else 851 851 iSumDepth = pDepthPels[ 0 ]; … … 864 864 uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ]); 865 865 #endif 866 866 867 867 // don't generate mask for blocks with small depth range (encoder decision) 868 868 if( uiMaxDepth - uiMinDepth < 10 ) … … 870 870 return false; 871 871 } 872 872 873 873 AOF(uiWidth==uiHeight); 874 874 Int iMean = iSumDepth >> 2; 875 875 876 876 // start again for segmentation 877 877 pDepthPels = pDepthBlockStart; 878 878 879 879 Bool bInvertMask = pDepthPels[0]>iMean; // top-left segment needs to be mapped to partIdx 0 880 880 881 881 // generate mask 882 882 UInt uiSumPix[2] = {0,0}; … … 894 894 { 895 895 depthPel = pDepthPels[x]; 896 896 t=x; 897 897 } 898 898 #else 899 899 Int depthPel = pDepthPels[x]; 900 900 #endif 901 901 902 902 // decide which segment this pixel belongs to 903 903 Int ucSegment = (Int)(depthPel>iMean); 904 904 905 905 if( bInvertMask ) 906 906 { 907 907 ucSegment = 1-ucSegment; 908 908 } 909 909 910 910 // count pixels for each segment 911 911 uiSumPix[ucSegment]++; 912 912 913 913 // set mask value 914 914 pMask[x] = (Bool)ucSegment; 915 915 } 916 916 917 917 // next row 918 918 #if HS_DBBP_CLEAN_K0048 919 919 if (!(iBlkY+y+1>iPictureHeight)) 920 920 #endif 921 pDepthPels += uiDepthStride;921 pDepthPels += uiDepthStride; 922 922 pMask += MAX_CU_SIZE; 923 923 } 924 924 925 925 // don't generate valid mask for tiny segments (encoder decision) 926 926 // each segment needs to cover at least 1/8th of block … … 930 930 return false; 931 931 } 932 932 933 933 // all good 934 934 return true; -
branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComRom.cpp
r1172 r1173 391 391 Bool g_tracePU = false; 392 392 Bool g_traceTU = false; 393 Bool g_disableNumbering = true;393 Bool g_disableNumbering = false; 394 394 Bool g_disableHLSTrace = false; 395 UInt64 g_stopAtCounter = 0;395 UInt64 g_stopAtCounter = 937234; 396 396 Bool g_traceCopyBack = false; 397 397 Bool g_decTraceDispDer = false; 398 398 Bool g_decTraceMvFromMerge = false; 399 399 Bool g_decTracePicOutput = false; 400 Bool g_stopAtPos = false; 401 Bool g_outputPos = false; 402 Bool g_traceCameraParameters = true; 400 Bool g_stopAtPos = true; 401 Bool g_outputPos = true; 402 Bool g_traceCameraParameters = false; 403 Bool g_encNumberOfWrittenBits = true; 403 404 #endif 404 405 #endif … … 607 608 if ( stopAtCU ) // Stop at CU with specific size 608 609 { 609 stopFlag = ( cuPelX == 0 ) && ( cuPelY == 0 ) && ( cuWidth == 16 ) && ( cuHeight == 16);610 stopFlag = ( cuPelX == 0 ) && ( cuPelY == 0 ) && ( cuWidth == 8 ) && ( cuHeight == 8 ); 610 611 } 611 612 else -
branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComRom.h
r1172 r1173 230 230 231 231 #ifndef ENC_DEC_TRACE 232 #define ENC_DEC_TRACE 0 232 #define ENC_DEC_TRACE 0 233 233 #endif 234 234 … … 266 266 extern Bool g_outputPos; // Output position 267 267 extern Bool g_traceCameraParameters; // Trace camera parameters 268 extern Bool g_encNumberOfWrittenBits;// Trace number of written bits 268 269 269 270 #define DTRACE_CU(x,y) writeToTraceFile( x,y, g_traceCU ); -
branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComSlice.h
r1172 r1173 1200 1200 #endif 1201 1201 #endif 1202 1202 1203 #if HHI_INTER_COMP_PRED_K0052 1203 1204 #if HHI_CAM_PARA_K0052 … … 1216 1217 assert( 0 ); 1217 1218 return -1; 1218 }; 1219 }; 1219 1220 1220 1221 #if HHI_CAM_PARA_K0052 … … 1404 1405 #else 1405 1406 UInt getCamParPrecision () { return m_uiCamParPrecision; } 1407 1406 1408 Bool getCamParPresent ( Int viewIndex ) { return m_bCamParPresent[viewIndex]; } 1407 1409 Void setCamParPresent ( Int viewIndex, Bool val ) { m_bCamParPresent[viewIndex] = val; } … … 3037 3039 3038 3040 for( Int i = 0; i <= numCurCmpLIds - 1; i++ ) 3039 { 3041 { 3040 3042 m_inCmpRefViewIdcs.push_back( getVPS()->getViewOrderIdx( curCmpLIds[ i ] )); 3041 3043 #if HHI_CAM_PARA_K0052 -
branches/HTM-13.1-dev0/source/Lib/TLibCommon/TypeDef.h
r1172 r1173 335 335 #define HHI_RES_PRED_K0052 1 336 336 #define HHI_CAM_PARA_K0052 1 337 #define HHI_MOVE_SYN_K0052 1 337 338 #define H_3D_ANNEX_SELECTION_FIX 1 338 339 #endif
Note: See TracChangeset for help on using the changeset viewer.