Ticket #536: VTM-6.1-wraparound_bf.patch

File VTM-6.1-wraparound_bf.patch, 1.6 KB (added by yuwenhe, 5 years ago)

patch for wraparound fix in VTM-6.1

  • source/Lib/CommonLib/Mv.cpp

    diff --git a/source/Lib/CommonLib/Mv.cpp b/source/Lib/CommonLib/Mv.cpp
    index 14b5591a..98881475 100644
    a b void clipMv( Mv& rcMv, const Position& pos, const struct Size& size, const SPS& 
    6161void clipMv( Mv& rcMv, const Position& pos, const struct Size& size, const SPS& sps )
    6262#endif
    6363{
     64#if WA_FIX
     65  if (sps.getWrapAroundEnabledFlag())
     66  {
     67    wrapClipMv(rcMv, pos, size, &sps, &pps);
     68    return;
     69  }
     70#endif
     71
    6472  int iMvShift = MV_FRACTIONAL_BITS_INTERNAL;
    6573  int iOffset = 8;
    6674#if JVET_O1164_PS
    void clipMv( Mv& rcMv, const Position& pos, const struct Size& size, const SPS& 
    7684  int iVerMax = ( sps.getPicHeightInLumaSamples() + iOffset - ( int ) pos.y - 1 ) << iMvShift;
    7785#endif
    7886  int iVerMin = ( -( int ) sps.getMaxCUHeight()   - iOffset - ( int ) pos.y + 1 ) << iMvShift;
    79 
     87#if !WA_FIX
    8088  if( sps.getWrapAroundEnabledFlag() )
    8189  {
    8290    return;
    8391  }
    84 
     92#endif
    8593  rcMv.setHor( std::min( iHorMax, std::max( iHorMin, rcMv.getHor() ) ) );
    8694  rcMv.setVer( std::min( iVerMax, std::max( iVerMin, rcMv.getVer() ) ) );
    8795}
  • source/Lib/CommonLib/TypeDef.h

    diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
    index 88063fe2..f8439729 100644
    a b  
    5050#include <assert.h>
    5151#include <cassert>
    5252
     53#define WA_FIX                                            1
     54
    5355#define JVET_O1164_RPR                                    1  // JVET-O1164: Reference picture resampling
    5456#if JVET_O1164_RPR
    5557#define JVET_O1164_PS                                     1