Changeset 1164 in 3DVCSoftware for branches/HTM-13.1-dev0/source/Lib/TLibCommon
- Timestamp:
- 16 Mar 2015, 12:52:20 (10 years ago)
- Location:
- branches/HTM-13.1-dev0/source/Lib/TLibCommon
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp
r1163 r1164 2388 2388 Int iPictureHeight = depthPicYuv->getHeight(); 2389 2389 2390 #if !HS_DBBP_CLEAN_K0048 2390 2391 Int iWidth = uiWidth; 2391 2392 Int iHeight = uiHeight; 2393 #endif 2392 2394 2393 2395 Bool depthRefineFlag = false; … … 2402 2404 } 2403 2405 2406 #if HS_DBBP_CLEAN_K0048 2407 Int depthPosX = Clip3(0, iPictureWidth - 1, iBlkX + ((cDv.getHor()+2)>>2)); 2408 Int depthPosY = Clip3(0, iPictureHeight - 1, iBlkY + ((cDv.getVer()+2)>>2)); 2409 #else 2404 2410 Int depthPosX = Clip3(0, iPictureWidth - iWidth, iBlkX + ((cDv.getHor()+2)>>2)); 2405 2411 Int depthPosY = Clip3(0, iPictureHeight- iHeight, iBlkY + ((cDv.getVer()+2)>>2)); 2412 #endif 2406 2413 2407 2414 pDepthPels = depthPicYuv->getLumaAddr() + depthPosX + depthPosY * uiDepthStride; … … 4189 4196 } 4190 4197 } 4198 #if !SHARP_SUBBLOCK_CLEAN_K0044 4191 4199 if (iPUHeight + iPUWidth == 12) 4192 4200 { … … 4197 4205 } 4198 4206 } 4207 #endif 4199 4208 4200 4209 iPartition ++; … … 5411 5420 rcMv.setVer( min (iVerMax, max (iVerMin, rcMv.getVer())) ); 5412 5421 } 5422 5423 #if SONY_MV_V_CONST_C0078 5424 Void TComDataCU::checkMV_V (TComMv& rcMv, RefPicList eRefPicList, int iRefIdx ) 5425 { 5426 if ( getSlice()->getSPS()->getInterViewMvVertConstraintFlag() ) 5427 { 5428 if ( getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC() == getSlice()->getPOC() ) 5429 { 5430 //When inter_view_mv_vert_constraint_flag is equal to 1, 5431 //the vertical component of the motion vectors used for inter-layer prediction 5432 //shall be equal to or less than 56 in units of luma samples 5433 assert ( rcMv.getVer() <= (56<<2) ); 5434 } 5435 } 5436 } 5437 #endif 5413 5438 5414 5439 UInt TComDataCU::getIntraSizeIdx(UInt uiAbsPartIdx) … … 6918 6943 6919 6944 } 6945 #if !SHARP_SUBBLOCK_CLEAN_K0044 6920 6946 if (iSPHeight + iSPWidth == 12) 6921 6947 { … … 6926 6952 } 6927 6953 } 6954 #endif 6928 6955 iPartition ++; 6929 6956 } -
branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComDataCU.h
r1163 r1164 620 620 621 621 Void clipMv ( TComMv& rcMv ); 622 #if SONY_MV_V_CONST_C0078 623 Void checkMV_V (TComMv& rcMv, RefPicList eRefPicList, int iRefIdx ); 624 #endif 622 625 Void getMvPredLeft ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldA.getMv(); } 623 626 Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } -
branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp
r1163 r1164 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 … … 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 657 for (Int y=0; y<uiSize; y+=iSubSample) 658 { 659 for (Int x=0; x<uiSize; x+=iSubSample) 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 } 673 674 // next row 675 if (!(iBlkY+y+4>iPictureHeight)) 676 pDepthPels += uiDepthStride*iSubSample; 677 #else 641 678 for (Int y=0; y<uiSize; y+=iSubSample) 642 679 { … … 650 687 // next row 651 688 pDepthPels += uiDepthStride*iSubSample; 689 #endif 652 690 } 653 691 … … 667 705 for (Int x=0; x<uiSize; x+=iSubSample) 668 706 { 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 669 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 775 #if HS_DBBP_CLEAN_K0048 776 Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU) 777 #else 721 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; … … 1157 1293 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 1158 1294 pcCU->clipMv(cMv); 1159 1295 #if SONY_MV_V_CONST_C0078 1296 pcCU->checkMV_V(cMv, eRefPicList, iRefIdx ); 1297 #endif 1160 1298 #if H_3D_ARP 1161 1299 if(pcCU->getARPW( uiPartAddr ) > 0 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC()) -
branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComRom.cpp
r1133 r1164 739 739 assert( uiWidth == uiHeight ); 740 740 741 #if SHARP_DMM_CLEAN_K0042 742 Int posStart = 0, posEnd = 0; 743 #else 741 744 UChar uhStartX = 0, uhStartY = 0, uhEndX = 0, uhEndY = 0; 742 745 Int iStepStartX = 0, iStepStartY = 0, iStepEndX = 0, iStepEndY = 0; 746 #endif 743 747 744 748 UInt uiBlockSize = 0; … … 752 756 for( UInt uiOri = 0; uiOri < 6; uiOri++ ) 753 757 { 758 #if !SHARP_DMM_CLEAN_K0042 754 759 // init the edge line parameters for each of the 6 wedgelet types 755 760 switch( uiOri ) … … 762 767 case( 5 ): { uhStartX = (uiBlockSize-1); uhStartY = 0; uhEndX = 0; uhEndY = 0; iStepStartX = 0; iStepStartY = +1; iStepEndX = 0; iStepEndY = +1; break; } 763 768 } 764 769 #endif 770 771 #if SHARP_DMM_CLEAN_K0042 772 posEnd = racWedgeList.size(); 773 if (uiOri == 0 || uiOri == 4) 774 { 775 #endif 765 776 for( Int iK = 0; iK < uiBlockSize; iK += (uiWidth>=16 ?2:1)) 766 777 { 767 778 for( Int iL = 0; iL < uiBlockSize; iL += ((uiWidth>=16 && uiOri<4)?2:1) ) 768 779 { 780 #if SHARP_DMM_CLEAN_K0042 781 Int xS = iK; 782 Int yS = 0; 783 Int xE = (uiOri == 0) ? 0 : iL; 784 Int yE = (uiOri == 0) ? iL : uiBlockSize - 1; 785 cTempWedgelet.setWedgelet( xS, yS, xE, yE, uiOri, eWedgeRes, ((iL%2)==0 && (iK%2)==0) ); 786 #else 769 787 cTempWedgelet.setWedgelet( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), (UChar)uiOri, eWedgeRes, ((iL%2)==0 && (iK%2)==0) ); 788 #endif 770 789 addWedgeletToList( cTempWedgelet, racWedgeList, racWedgeRefList ); 771 790 } 772 791 } 792 #if SHARP_DMM_CLEAN_K0042 793 } 794 else 795 { 796 for (Int pos = posStart; pos < posEnd; pos++) 797 { 798 cTempWedgelet.generateWedgePatternByRotate(racWedgeList[pos], uiOri); 799 addWedgeletToList( cTempWedgelet, racWedgeList, racWedgeRefList ); 800 } 801 } 802 posStart = posEnd; 803 #endif 773 804 } 774 805 -
branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComWedgelet.cpp
r1084 r1164 177 177 } 178 178 179 #if SHARP_DMM_CLEAN_K0042 180 Void TComWedgelet::generateWedgePatternByRotate(const TComWedgelet &rcWedge, Int rotate) 181 { 182 Int stride = m_uiWidth; 183 Int sinc, offsetI, offsetJ; 184 185 sinc = 1; 186 offsetI = ( sinc) < 0 ? stride-1 : 0; // 0 187 offsetJ = (-sinc) < 0 ? stride-1 : 0; // stride - 1 188 189 for (Int y = 0; y < stride; y++) 190 { 191 for (Int x = 0; x < stride; x++) 192 { 193 Int i = offsetI + sinc * y; // y 194 Int j = offsetJ - sinc * x; // stride - 1 - x 195 m_pbPattern[(y * stride) + x] = !rcWedge.m_pbPattern[(j * stride) + i]; 196 } 197 } 198 Int blocksize = rcWedge.m_uiWidth * (rcWedge.m_eWedgeRes == HALF_PEL ? 2 : 1); 199 Int offsetX = (-sinc) < 0 ? blocksize - 1 : 0; 200 Int offsetY = ( sinc) < 0 ? blocksize - 1 : 0; 201 m_uhXs = offsetX - sinc * rcWedge.m_uhYs; 202 m_uhYs = offsetY + sinc * rcWedge.m_uhXs; 203 m_uhXe = offsetX - sinc * rcWedge.m_uhYe; 204 m_uhYe = offsetY + sinc * rcWedge.m_uhXe; 205 m_uhOri = rotate; 206 m_eWedgeRes = rcWedge.m_eWedgeRes; 207 m_bIsCoarse = rcWedge.m_bIsCoarse; 208 m_uiAng = rcWedge.m_uiAng; 209 m_uiWidth = rcWedge.m_uiWidth; 210 m_uiHeight = rcWedge.m_uiHeight; 211 } 212 #endif 213 179 214 Void TComWedgelet::xGenerateWedgePattern() 180 215 { … … 193 228 xDrawEdgeLine( uhXs, uhYs, uhXe, uhYe, pbTempPattern, iTempStride ); 194 229 230 #if SHARP_DMM_CLEAN_K0042 231 Int shift = (m_eWedgeRes == HALF_PEL) ? 1 : 0; 232 Int endPos = uhYe>>shift; 233 for (Int y = 0; y <= endPos; y++) 234 { 235 for (Int x = 0; x < m_uiWidth && pbTempPattern[(y * m_uiWidth) + x] == 0; x++) 236 { 237 pbTempPattern[(y * m_uiWidth) + x] = true; 238 } 239 } 240 for( UInt k = 0; k < (m_uiWidth * m_uiHeight); k++ ) 241 { 242 m_pbPattern[k] = pbTempPattern[k]; 243 }; 244 #else 195 245 switch( m_uhOri ) 196 246 { … … 252 302 break; 253 303 } 304 #endif 254 305 255 306 if( pbTempPattern ) … … 294 345 for( Int x = x0; x <= x1; x++ ) 295 346 { 347 #if SHARP_DMM_CLEAN_K0042 348 Int shift = (m_eWedgeRes == HALF_PEL) ? 1 : 0; 349 Int stride = iPatternStride >> shift; 350 if( steep ) { pbPattern[((x>>shift) * stride) + (y>>shift)] = true; } 351 else { pbPattern[((y>>shift) * stride) + (x>>shift)] = true; } 352 #else 296 353 if( steep ) { pbPattern[(x * iPatternStride) + y] = true; } 297 354 else { pbPattern[(y * iPatternStride) + x] = true; } 355 #endif 298 356 299 357 error += deltaerr; -
branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComWedgelet.h
r1084 r1164 124 124 Bool* getScaledPattern(UInt uiWidth); 125 125 126 #if SHARP_DMM_CLEAN_K0042 127 Void generateWedgePatternByRotate(const TComWedgelet &rcWedge, Int rotate); 128 #endif 126 129 Void setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse = false ); 127 130 Void findClosestAngle(); -
branches/HTM-13.1-dev0/source/Lib/TLibCommon/TypeDef.h
r1163 r1164 64 64 #define H_MV ( HEVC_EXT != 0) 65 65 #define H_3D ( HEVC_EXT == 2) 66 67 #if H_MV 68 #define SONY_MV_V_CONST_C0078 1 // Control disparity vector search range via configuration file 69 #endif 66 70 67 71 #define NTT_BUG_FIX_TK54 1 … … 280 284 // SEC_DBBP_DMM4_THRESHOLD_I0076 Simplification of threshold derivation for DBBP and DMM4, JCT3V-I0076 281 285 // SEC_DBBP_VIEW_REF_CHECK_J0037 1 // Signaling dbbp_flag when the current slice has view reference picture(s), JCT3V-J0037 item4 286 #define HS_DBBP_CLEAN_K0048 1 282 287 283 288 #define H_3D_DDD 1 // Disparity derived depth coding … … 367 372 // HHI_DEPTH_INTRA_SEARCH_RAU_C0160 368 373 // LG_ZEROINTRADEPTHRESI_A0087 374 #define SHARP_DMM_CLEAN_K0042 1 // Generate DMM pattern with rotation 369 375 370 376 #define TICKET083_IVPFLAG_FIX 1 377 #define SHARP_SUBBLOCK_CLEAN_K0044 1 // Remove unused bipred restriction 378 371 379 #endif 372 380 ///// ***** VIEW SYNTHESIS PREDICTION *********
Note: See TracChangeset for help on using the changeset viewer.