Changeset 1164 in 3DVCSoftware


Ignore:
Timestamp:
16 Mar 2015, 12:52:20 (9 years ago)
Author:
tech
Message:

Merged 13.1-dev2-Sony

Location:
branches/HTM-13.1-dev0
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-13.1-dev0/cfg/MV-HEVC/baseCfg_2view.cfg

    r1084 r1164  
    9494FEN                           : 1           # Fast encoder decision
    9595FDM                           : 1           # Fast Decision for Merge RD cost
     96DispSearchRangeRestriction    : 0           # Limit Search range for vertical component of disparity vector
     97VerticalDispSearchRange       : 56          # Vertical Search range in pixel
    9698
    9799#======== Quantization =============
  • branches/HTM-13.1-dev0/cfg/MV-HEVC/baseCfg_3view.cfg

    r1084 r1164  
    120120FEN                           : 1           # Fast encoder decision
    121121FDM                           : 1           # Fast Decision for Merge RD cost
     122DispSearchRangeRestriction    : 0           # Limit Search range for vertical component of disparity vector
     123VerticalDispSearchRange       : 56          # Vertical Search range in pixel
    122124
    123125#======== Quantization =============
  • branches/HTM-13.1-dev0/cfg/MV-HEVC/fullCfg.cfg

    r1084 r1164  
    226226FEN                           : 1           # Fast encoder decision
    227227FDM                           : 1           # Fast Decision for Merge RD cost
     228DispSearchRangeRestriction    : 0           # Limit Search range for vertical component of disparity vector
     229VerticalDispSearchRange       : 56          # Vertical Search range in pixel
    228230
    229231#======== Quantization =============
  • branches/HTM-13.1-dev0/source/App/TAppEncoder/TAppEncCfg.cpp

    r1163 r1164  
    477477  ("FastSearch",              m_iFastSearch,                1, "0:Full search  1:Diamond  2:PMVFAST")
    478478  ("SearchRange,-sr",         m_iSearchRange,              96, "Motion search range")
     479#ifdef SONY_MV_V_CONST_C0078
     480  ("DispSearchRangeRestriction",  m_bUseDisparitySearchRangeRestriction, false, "restrict disparity search range")
     481  ("VerticalDispSearchRange",     m_iVerticalDisparitySearchRange, 56, "vertical disparity search range")
     482#endif
    479483  ("BipredSearchRange",       m_bipredSearchRange,          4, "Motion search range for bipred refinement")
    480484  ("HadamardME",              m_bUseHADME,               true, "Hadamard ME for fractional-pel")
     
    15861590  xConfirmPara( m_iSearchRange < 0 ,                                                        "Search Range must be more than 0" );
    15871591  xConfirmPara( m_bipredSearchRange < 0 ,                                                   "Search Range must be more than 0" );
     1592#ifdef SONY_MV_V_CONST_C0078
     1593  xConfirmPara( m_iVerticalDisparitySearchRange <= 0 ,                                      "Vertical Disparity Search Range must be more than 0" );
     1594#endif
    15881595  xConfirmPara( m_iMaxDeltaQP > 7,                                                          "Absolute Delta QP exceeds supported range (0 to 7)" );
    15891596  xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1,                                          "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );
     
    24572464  printf("Min PCM size                 : %d\n", 1 << m_uiPCMLog2MinSize);
    24582465  printf("Motion search range          : %d\n", m_iSearchRange );
     2466#ifdef SONY_MV_V_CONST_C0078
     2467  printf("Disp search range restriction: %d\n", m_bUseDisparitySearchRangeRestriction );
     2468  printf("Vertical disp search range   : %d\n", m_iVerticalDisparitySearchRange );
     2469#endif
    24592470#if H_MV
    24602471  xPrintParaVector( "Intra period", m_iIntraPeriod );
  • branches/HTM-13.1-dev0/source/App/TAppEncoder/TAppEncCfg.h

    r1163 r1164  
    289289  Int       m_iSearchRange;                                   ///< ME search range
    290290  Int       m_bipredSearchRange;                              ///< ME search range for bipred refinement
     291#ifdef SONY_MV_V_CONST_C0078
     292  Bool      m_bUseDisparitySearchRangeRestriction;            ///< restrict vertical search range for inter-view prediction
     293  Int       m_iVerticalDisparitySearchRange;                  ///< ME vertical search range for inter-view prediction
     294#endif
    291295  Bool      m_bUseFastEnc;                                    ///< flag for using fast encoder setting
    292296  Bool      m_bUseEarlyCU;                                    ///< flag for using Early CU setting
  • branches/HTM-13.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp

    r1163 r1164  
    352352  m_cTEncTop.setBipredSearchRange            ( m_bipredSearchRange );
    353353
     354#if SONY_MV_V_CONST_C0078
     355  m_cTEncTop.setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction );
     356  m_cTEncTop.setVerticalDisparitySearchRange ( m_iVerticalDisparitySearchRange );
     357#endif
    354358  //====== Quality control ========
    355359  m_cTEncTop.setMaxDeltaQP                   ( m_iMaxDeltaQP  );
  • branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r1163 r1164  
    23882388    Int iPictureHeight = depthPicYuv->getHeight();
    23892389   
     2390#if !HS_DBBP_CLEAN_K0048
    23902391    Int iWidth  = uiWidth;
    23912392    Int iHeight = uiHeight;
     2393#endif
    23922394   
    23932395    Bool depthRefineFlag = false;
     
    24022404    }
    24032405   
     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
    24042410    Int depthPosX = Clip3(0,   iPictureWidth - iWidth,  iBlkX + ((cDv.getHor()+2)>>2));
    24052411    Int depthPosY = Clip3(0,   iPictureHeight- iHeight, iBlkY + ((cDv.getVer()+2)>>2));
     2412#endif
    24062413   
    24072414    pDepthPels = depthPicYuv->getLumaAddr() + depthPosX + depthPosY * uiDepthStride;
     
    41894196              }
    41904197            }
     4198#if !SHARP_SUBBLOCK_CLEAN_K0044
    41914199            if (iPUHeight + iPUWidth == 12)
    41924200            {
     
    41974205              }
    41984206            }
     4207#endif
    41994208
    42004209            iPartition ++;
     
    54115420  rcMv.setVer( min (iVerMax, max (iVerMin, rcMv.getVer())) );
    54125421}
     5422
     5423#if SONY_MV_V_CONST_C0078
     5424Void 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
    54135438
    54145439UInt TComDataCU::getIntraSizeIdx(UInt uiAbsPartIdx)
     
    69186943
    69196944              }
     6945#if !SHARP_SUBBLOCK_CLEAN_K0044
    69206946              if (iSPHeight + iSPWidth == 12)
    69216947              {
     
    69266952                }
    69276953              }
     6954#endif
    69286955              iPartition ++;
    69296956            }
  • branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComDataCU.h

    r1163 r1164  
    620620 
    621621  Void          clipMv                ( TComMv&     rcMv     );
     622#if SONY_MV_V_CONST_C0078
     623  Void          checkMV_V (TComMv&  rcMv,  RefPicList eRefPicList, int iRefIdx );
     624#endif
    622625  Void          getMvPredLeft         ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldA.getMv(); }
    623626  Void          getMvPredAbove        ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldB.getMv(); }
  • branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComPrediction.cpp

    r1163 r1164  
    630630
    631631#if H_3D_DBBP
     632#if HS_DBBP_CLEAN_K0048
     633PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU)
     634#else
    632635PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize)
     636#endif
    633637{
    634638  // find virtual partitioning for this CU based on depth block
     
    639643  Int iSumDepth = 0;
    640644  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   {
     661if (iBlkX+x>iPictureWidth)
     662{
     663    Int depthPel = pDepthPels[t];
     664    iSumDepth += depthPel;
     665}
     666else
     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
    641678  for (Int y=0; y<uiSize; y+=iSubSample)
    642679  {
     
    650687    // next row
    651688    pDepthPels += uiDepthStride*iSubSample;
     689#endif
    652690  }
    653691 
     
    667705    for (Int x=0; x<uiSize; x+=iSubSample)
    668706    {
     707#if HS_DBBP_CLEAN_K0048
     708      Int depthPel = 0;
     709if (iBlkX+x>iPictureWidth)
     710{
     711    depthPel = pDepthPels[t];
     712}
     713else
     714{
     715    depthPel = pDepthPels[x];
     716     t=x;
     717}
     718#else
    669719      Int depthPel = pDepthPels[x];
     720#endif
    670721     
    671722      // decide which segment this pixel belongs to
     
    696747   
    697748    // next row
     749#if HS_DBBP_CLEAN_K0048
     750    if (!(iBlkY+y+4>iPictureHeight))
     751#endif
    698752    pDepthPels += uiDepthStride*iSubSample;
    699753  }
     
    719773}
    720774
     775#if HS_DBBP_CLEAN_K0048
     776Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU)
     777#else
    721778Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask )
     779#endif
    722780{
    723781  // segmentation of texture block --> mask IDs
     
    728786  Int uiMinDepth = MAX_INT;
    729787  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);
     802if (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}
     808else
     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}
     814if (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}
     820else
     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}
     826if (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}
     832else 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}
     838else 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}
     844else
     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
    731851  iSumDepth  = pDepthPels[ 0 ];
    732852  iSumDepth += pDepthPels[ uiWidth - 1 ];
     
    743863  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) ]);
    744864  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ]);
    745 
     865#endif
    746866 
    747867  // don't generate mask for blocks with small depth range (encoder decision)
     
    765885    for (Int x=0; x<uiHeight; x++)
    766886    {
     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
    767899      Int depthPel = pDepthPels[x];
     900#endif
    768901     
    769902      // decide which segment this pixel belongs to
     
    783916   
    784917    // next row
     918#if HS_DBBP_CLEAN_K0048
     919    if (!(iBlkY+y+1>iPictureHeight))
     920#endif
    785921    pDepthPels += uiDepthStride;
    786922    pMask += MAX_CU_SIZE;
     
    11571293  TComMv      cMv         = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr );
    11581294  pcCU->clipMv(cMv);
    1159 
     1295#if SONY_MV_V_CONST_C0078
     1296  pcCU->checkMV_V(cMv, eRefPicList, iRefIdx );
     1297#endif
    11601298#if H_3D_ARP
    11611299  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  
    739739  assert( uiWidth == uiHeight );
    740740
     741#if SHARP_DMM_CLEAN_K0042
     742  Int posStart = 0, posEnd = 0;
     743#else
    741744  UChar    uhStartX = 0,    uhStartY = 0,    uhEndX = 0,    uhEndY = 0;
    742745  Int   iStepStartX = 0, iStepStartY = 0, iStepEndX = 0, iStepEndY = 0;
     746#endif
    743747
    744748  UInt uiBlockSize = 0;
     
    752756  for( UInt uiOri = 0; uiOri < 6; uiOri++ )
    753757  {
     758#if !SHARP_DMM_CLEAN_K0042
    754759    // init the edge line parameters for each of the 6 wedgelet types
    755760    switch( uiOri )
     
    762767    case( 5 ): {  uhStartX = (uiBlockSize-1); uhStartY = 0;               uhEndX = 0;               uhEndY = 0;               iStepStartX =  0; iStepStartY = +1; iStepEndX =  0; iStepEndY = +1; break; }
    763768    }
    764 
     769#endif
     770
     771#if SHARP_DMM_CLEAN_K0042
     772    posEnd = racWedgeList.size();
     773    if (uiOri == 0 || uiOri == 4)
     774    {
     775#endif
    765776    for( Int iK = 0; iK < uiBlockSize; iK += (uiWidth>=16 ?2:1))
    766777    {
    767778      for( Int iL = 0; iL < uiBlockSize; iL += ((uiWidth>=16 && uiOri<4)?2:1) )
    768779      {
     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
    769787        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
    770789        addWedgeletToList( cTempWedgelet, racWedgeList, racWedgeRefList );
    771790      }
    772791    }
     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
    773804  }
    774805
  • branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComWedgelet.cpp

    r1084 r1164  
    177177}
    178178
     179#if SHARP_DMM_CLEAN_K0042
     180Void 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
    179214Void TComWedgelet::xGenerateWedgePattern()
    180215{
     
    193228  xDrawEdgeLine( uhXs, uhYs, uhXe, uhYe, pbTempPattern, iTempStride );
    194229
     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
    195245  switch( m_uhOri )
    196246  {
     
    252302    break;
    253303  }
     304#endif
    254305
    255306  if( pbTempPattern )
     
    294345  for( Int x = x0; x <= x1; x++ )
    295346  {
     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
    296353    if( steep ) { pbPattern[(x * iPatternStride) + y] = true; }
    297354    else        { pbPattern[(y * iPatternStride) + x] = true; }
     355#endif
    298356
    299357    error += deltaerr;
  • branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComWedgelet.h

    r1084 r1164  
    124124  Bool*           getScaledPattern(UInt uiWidth);
    125125
     126#if SHARP_DMM_CLEAN_K0042
     127  Void  generateWedgePatternByRotate(const TComWedgelet &rcWedge, Int rotate);
     128#endif
    126129  Void  setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse = false );
    127130  Void  findClosestAngle();
  • branches/HTM-13.1-dev0/source/Lib/TLibCommon/TypeDef.h

    r1163 r1164  
    6464#define H_MV          ( HEVC_EXT != 0)
    6565#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
    6670
    6771#define NTT_BUG_FIX_TK54    1
     
    280284                                              // SEC_DBBP_DMM4_THRESHOLD_I0076     Simplification of threshold derivation for DBBP and DMM4, JCT3V-I0076
    281285                                              // 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
    282287
    283288#define H_3D_DDD                          1   // Disparity derived depth coding
     
    367372                                              // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
    368373                                              // LG_ZEROINTRADEPTHRESI_A0087
     374#define SHARP_DMM_CLEAN_K0042             1   // Generate DMM pattern with rotation
    369375
    370376#define TICKET083_IVPFLAG_FIX             1
     377#define SHARP_SUBBLOCK_CLEAN_K0044        1   // Remove unused bipred restriction
     378
    371379#endif
    372380///// ***** VIEW SYNTHESIS PREDICTION *********
  • branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp

    r1163 r1164  
    954954  // compute mask by segmenting depth block
    955955  Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE];
     956#if HS_DBBP_CLEAN_K0048
     957  Bool bValidMask = m_pcPrediction->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(0), pcCU->getHeight(0), pMask, pcCU);
     958#else
    956959  Bool bValidMask = m_pcPrediction->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(0), pcCU->getHeight(0), pMask);
     960#endif
    957961  AOF(bValidMask);
    958962 
  • branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecTop.cpp

    r1133 r1164  
    954954
    955955  xActivateParameterSets();
     956
     957#if SONY_MV_V_CONST_C0078
     958  //Check Multiview Main profile constraint in G.11.1.1
     959  //  When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1
     960  //  for the layer with nuh_layer_id equal to i in subBitstream,
     961  //  inter_view_mv_vert_constraint_flag shall be equal to 1
     962  //  in the sps_multilayer_extension( ) syntax structure in each active SPS for that layer.
     963  if( m_apcSlicePilot->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc()==Profile::MULTIVIEWMAIN
     964      &&
     965      m_apcSlicePilot->getVPS()->getViewOrderIdx(m_apcSlicePilot->getVPS()->getLayerIdInNuh(getLayerId()))==1
     966     )
     967  {
     968    assert( m_apcSlicePilot->getSPS()->getInterViewMvVertConstraintFlag()==1 );
     969  }
     970#endif
    956971
    957972  if (m_apcSlicePilot->isNextSlice())
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncCfg.h

    r1133 r1164  
    180180  Int       m_iSearchRange;                     //  0:Full frame
    181181  Int       m_bipredSearchRange;
    182 
     182#ifdef SONY_MV_V_CONST_C0078
     183  Bool      m_bUseDisparitySearchRangeRestriction;
     184  Int       m_iVerticalDisparitySearchRange;
     185#endif
    183186  //====== Quality control ========
    184187  Int       m_iMaxDeltaQP;                      //  Max. absolute delta QP (1:default)
     
    502505  Void      setSearchRange                  ( Int   i )      { m_iSearchRange = i; }
    503506  Void      setBipredSearchRange            ( Int   i )      { m_bipredSearchRange = i; }
     507#ifdef SONY_MV_V_CONST_C0078
     508  Void      setUseDisparitySearchRangeRestriction ( Bool   b )      { m_bUseDisparitySearchRangeRestriction = b; }
     509  Void      setVerticalDisparitySearchRange ( Int   i )      { m_iVerticalDisparitySearchRange = i; }
     510#endif
    504511
    505512  //====== Quality control ========
     
    554561  Int       getFastSearch                   ()      { return  m_iFastSearch; }
    555562  Int       getSearchRange                  ()      { return  m_iSearchRange; }
     563#ifdef SONY_MV_V_CONST_C0078
     564  Bool      getUseDisparitySearchRangeRestriction ()      { return  m_bUseDisparitySearchRangeRestriction; }
     565  Int       getVerticalDisparitySearchRange ()            { return  m_iVerticalDisparitySearchRange; }
     566#endif
    556567
    557568  //==== Quality control ========
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp

    r1163 r1164  
    26472647  AOF( uiDepthStride != 0 );
    26482648 
     2649#if HS_DBBP_CLEAN_K0048
     2650  PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth, rpcTempCU);
     2651
    26492652  // derive partitioning from depth
     2653  Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE];
     2654  Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask, rpcTempCU);
     2655#else
    26502656  PartSize eVirtualPartSize = m_pcPredSearch->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, uiWidth);
    26512657 
     
    26532659  Bool pMask[MAX_CU_SIZE*MAX_CU_SIZE];
    26542660  Bool bValidMask = m_pcPredSearch->getSegmentMaskFromDepth(pDepthPels, uiDepthStride, uiWidth, uiHeight, pMask);
     2661#endif
    26552662 
    26562663  if( !bValidMask )
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp

    r1163 r1164  
    55005500  TComMv      cMvPred = *pcMvPred;
    55015501 
     5502#ifdef SONY_MV_V_CONST_C0078
     5503  Bool bMv_VRng_Restricted = false;
     5504  if( m_pcEncCfg->getUseDisparitySearchRangeRestriction()
     5505       &&
     5506      pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getPOC() == pcCU->getSlice()->getPOC()
     5507    )
     5508  {
     5509      bMv_VRng_Restricted = true;
     5510  }
     5511  if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, m_pcEncCfg->getVerticalDisparitySearchRange() );
     5512  else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, m_pcEncCfg->getVerticalDisparitySearchRange() );
     5513#else
    55025514  if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
    55035515  else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
     5516#endif
    55045517 
    55055518  m_pcRdCost->getMotionCost ( 1, 0 );
     
    55545567
    55555568
     5569#ifdef SONY_MV_V_CONST_C0078
     5570Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB, Bool bMv_VRng_Restricted, Int iVerDispSrchRng )
     5571#else
    55565572Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB )
     5573#endif
    55575574{
    55585575  Int  iMvShift = 2;
     
    55695586  rcMvSrchRngRB.setHor( cTmpMvPred.getHor() + (iSrchRng << iMvShift) );
    55705587  rcMvSrchRngRB.setVer( cTmpMvPred.getVer() + (iSrchRng << iMvShift) );
     5588 
     5589#ifdef SONY_MV_V_CONST_C0078
     5590  if ( bMv_VRng_Restricted ) {
     5591    Int iRestrictMvVrange = ( iVerDispSrchRng - 1 ) << iMvShift ; // -1 to consider subpel search
     5592    if ( rcMvSrchRngRB.getVer() >= iRestrictMvVrange  ){
     5593      rcMvSrchRngRB.setVer( iRestrictMvVrange ); //only positive side is restricted
     5594    }
     5595  }
     5596#endif
     5597
    55715598  pcCU->clipMv        ( rcMvSrchRngLT );
    55725599  pcCU->clipMv        ( rcMvSrchRngRB );
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncSearch.h

    r1163 r1164  
    480480                                    UInt&         ruiSAD );
    481481 
     482#ifdef SONY_MV_V_CONST_C0078
     483  Void xSetSearchRange           (  TComDataCU* pcCU,
     484                                    TComMv& cMvPred,
     485                                    Int iSrchRng,
     486                                    TComMv& rcMvSrchRngLT,
     487                                    TComMv& rcMvSrchRngRB,
     488                                    Bool bMv_VRng_Restricted,
     489                                    Int iVerDispSrchRng );
     490#else
    482491  Void xSetSearchRange            ( TComDataCU*   pcCU,
    483492                                    TComMv&       cMvPred,
     
    485494                                    TComMv&       rcMvSrchRngLT,
    486495                                    TComMv&       rcMvSrchRngRB );
     496#endif
    487497 
    488498  Void xPatternSearchFast         ( TComDataCU*   pcCU,
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncTop.cpp

    r1133 r1164  
    760760    m_cSPS.setSpsInferScalingListFlag   ( true );
    761761    m_cSPS.setSpsScalingListRefLayerId( m_cVPS->getIdRefLayer( getLayerId(), 0 ) );
     762#if SONY_MV_V_CONST_C0078
     763    if ( m_bUseDisparitySearchRangeRestriction )
     764    {
     765      m_cSPS.setInterViewMvVertConstraintFlag ( true ) ;
     766    }
     767#endif
    762768  }
    763769  m_cSPS.setSpsExtensionPresentFlag       ( true );
Note: See TracChangeset for help on using the changeset viewer.