Changeset 1387 in SHVCSoftware


Ignore:
Timestamp:
4 Aug 2015, 02:53:17 (9 years ago)
Author:
seregin
Message:

port rev 4522 and rev 4523

Location:
branches/SHM-dev/source/Lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/Debug.cpp

    r1335 r1387  
    179179  PRINT_CONSTANT(O0043_BEST_EFFORT_DECODING,                                        settingNameWidth, settingValueWidth);
    180180
     181  PRINT_CONSTANT(ME_ENABLE_ROUNDING_OF_MVS,                                         settingNameWidth, settingValueWidth);
     182
    181183  //------------------------------------------------
    182184
  • branches/SHM-dev/source/Lib/TLibCommon/TComMv.h

    r1262 r1387  
    116116  }
    117117
     118#if ME_ENABLE_ROUNDING_OF_MVS
     119  //! shift right with rounding
     120  Void divideByPowerOf2 (const Int i)
     121  {
     122    int offset = (i == 0) ? 0 : 1 << (i - 1);
     123    m_iHor += offset;
     124    m_iVer += offset;
     125
     126    m_iHor >>= i;
     127    m_iVer >>= i;
     128  }
     129#endif
     130
    118131  const TComMv& operator<<= (const Int i)
    119132  {
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1353 r1387  
    190190#define O0043_BEST_EFFORT_DECODING                        0 ///< 0 (default) = disable code related to best effort decoding, 1 = enable code relating to best effort decoding [ decode-side only ].
    191191
     192#define ME_ENABLE_ROUNDING_OF_MVS                         1 ///< 0 (default) = disables rounding of motion vectors when right shifted,  1 = enables rounding
     193
    192194#define RDOQ_CHROMA_LAMBDA                                1 ///< F386: weighting of chroma for RDOQ
    193195
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r1372 r1387  
    40044004  pcCU->clipMv        ( rcMvSrchRngRB );
    40054005
     4006#if ME_ENABLE_ROUNDING_OF_MVS
     4007  rcMvSrchRngLT.divideByPowerOf2(iMvShift);
     4008  rcMvSrchRngRB.divideByPowerOf2(iMvShift);
     4009#else
    40064010  rcMvSrchRngLT >>= iMvShift;
    40074011  rcMvSrchRngRB >>= iMvShift;
     4012#endif
    40084013}
    40094014
     
    41254130  UInt uiSearchRange = m_iSearchRange;
    41264131  pcCU->clipMv( rcMv );
     4132#if ME_ENABLE_ROUNDING_OF_MVS
     4133  rcMv.divideByPowerOf2(2);
     4134#else
    41274135  rcMv >>= 2;
     4136#endif
    41284137  // init TZSearchStruct
    41294138  IntTZSearchStruct cStruct;
     
    41424151      TComMv cMv = m_acMvPredictors[index];
    41434152      pcCU->clipMv( cMv );
     4153#if ME_ENABLE_ROUNDING_OF_MVS
     4154      cMv.divideByPowerOf2(2);
     4155#else
    41444156      cMv >>= 2;
     4157#endif
    41454158      xTZSearchHelp( pcPatternKey, cStruct, cMv.getHor(), cMv.getVer(), 0, 0 );
    41464159    }
     
    41584171    integerMv2Nx2NPred <<= 2;
    41594172    pcCU->clipMv( integerMv2Nx2NPred );
     4173#if ME_ENABLE_ROUNDING_OF_MVS
     4174    integerMv2Nx2NPred.divideByPowerOf2(2);
     4175#else
    41604176    integerMv2Nx2NPred >>= 2;
     4177#endif
    41614178    xTZSearchHelp(pcPatternKey, cStruct, integerMv2Nx2NPred.getHor(), integerMv2Nx2NPred.getVer(), 0, 0);
    41624179
     
    43374354
    43384355  pcCU->clipMv( rcMv );
     4356#if ME_ENABLE_ROUNDING_OF_MVS
     4357  rcMv.divideByPowerOf2(2);
     4358#else
    43394359  rcMv >>= 2;
     4360#endif
    43404361  // init TZSearchStruct
    43414362  IntTZSearchStruct cStruct;
     
    43574378      TComMv cMv = m_acMvPredictors[index];
    43584379      pcCU->clipMv( cMv );
     4380#if ME_ENABLE_ROUNDING_OF_MVS
     4381      cMv.divideByPowerOf2(2);
     4382#else
    43594383      cMv >>= 2;
     4384#endif
    43604385      xTZSearchHelp( pcPatternKey, cStruct, cMv.getHor(), cMv.getVer(), 0, 0 );
    43614386    }
     
    43734398    integerMv2Nx2NPred <<= 2;
    43744399    pcCU->clipMv( integerMv2Nx2NPred );
     4400#if ME_ENABLE_ROUNDING_OF_MVS
     4401    integerMv2Nx2NPred.divideByPowerOf2(2);
     4402#else
    43754403    integerMv2Nx2NPred >>= 2;
     4404#endif
    43764405    xTZSearchHelp(pcPatternKey, cStruct, integerMv2Nx2NPred.getHor(), integerMv2Nx2NPred.getVer(), 0, 0);
    43774406
     
    59255954    {
    59265955      uiBitsTemp += iRefIdxTemp+1;
    5927       if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--;
     5956      if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 )
     5957      {
     5958        uiBitsTemp--;
     5959      }
    59285960    }
    59295961
Note: See TracChangeset for help on using the changeset viewer.