diff --git a/source/Lib/CommonLib/InterPrediction.cpp b/source/Lib/CommonLib/InterPrediction.cpp index 92e2e94187ec71dd5f298c51f8c6ba8b20e9b49b..d5a970c43a9b80c2de5bfdad4293c4d1c18da0d3 100644 --- a/source/Lib/CommonLib/InterPrediction.cpp +++ b/source/Lib/CommonLib/InterPrediction.cpp @@ -2408,10 +2408,10 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio, int vFilterSize = isLuma( compID ) ? NTAPS_LUMA : NTAPS_CHROMA; int yInt0 = ( (int32_t)y0Int + offY ) >> posShift; - yInt0 = std::min( std::max( -4, yInt0 ), ( refPicHeight >> ::getComponentScaleY( compID, chFmt ) ) + 4 ); + yInt0 = std::min( std::max( -(NTAPS_LUMA / 2), yInt0 ), ( refPicHeight >> ::getComponentScaleY( compID, chFmt ) ) + (NTAPS_LUMA / 2) ); int xInt0 = ( (int32_t)x0Int + offX ) >> posShift; - xInt0 = std::min( std::max( -4, xInt0 ), ( refPicWidth >> ::getComponentScaleX( compID, chFmt ) ) + 4 ); + xInt0 = std::min( std::max( -(NTAPS_LUMA / 2), xInt0 ), ( refPicWidth >> ::getComponentScaleX( compID, chFmt ) ) + (NTAPS_LUMA / 2) ); int refHeight = ((((int32_t)y0Int + (height-1) * stepY) + offY ) >> posShift) - ((((int32_t)y0Int + 0 * stepY) + offY ) >> posShift) + 1; @@ -2429,7 +2429,7 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio, { int posX = (int32_t)x0Int + col * stepX; xInt = ( posX + offX ) >> posShift; - xInt = std::min( std::max( -4, xInt ), ( refPicWidth >> ::getComponentScaleX( compID, chFmt ) ) + 4 ); + xInt = std::min( std::max( -(NTAPS_LUMA / 2), xInt ), ( refPicWidth >> ::getComponentScaleX( compID, chFmt ) ) + (NTAPS_LUMA / 2) ); int xFrac = ( ( posX + offX ) >> ( posShift - shiftHor ) ) & ( ( 1 << shiftHor ) - 1 ); CHECK( xInt0 > xInt, "Wrong horizontal starting point" ); @@ -2449,7 +2449,7 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio, { int posY = (int32_t)y0Int + row * stepY; yInt = ( posY + offY ) >> posShift; - yInt = std::min( std::max( -4, yInt ), ( refPicHeight >> ::getComponentScaleY( compID, chFmt ) ) + 4 ); + yInt = std::min( std::max( -(NTAPS_LUMA / 2), yInt ), ( refPicHeight >> ::getComponentScaleY( compID, chFmt ) ) + (NTAPS_LUMA / 2) ); int yFrac = ( ( posY + offY ) >> ( posShift - shiftVer ) ) & ( ( 1 << shiftVer ) - 1 ); CHECK( yInt0 > yInt, "Wrong vertical starting point" ); diff --git a/source/Lib/CommonLib/Picture.cpp b/source/Lib/CommonLib/Picture.cpp index d84ae961bfa08179c14862cd6557b0e4f63400a0..27145ddb20210bcbe7870daa269c076747b8b365 100644 --- a/source/Lib/CommonLib/Picture.cpp +++ b/source/Lib/CommonLib/Picture.cpp @@ -808,8 +808,8 @@ void Picture::create(const ChromaFormat &_chromaFormat, const Size &size, const UnitArea::operator=( UnitArea( _chromaFormat, Area( Position{ 0, 0 }, size ) ) ); margin = MAX_SCALING_RATIO*_margin; const Area a = Area( Position(), size ); - M_BUFS( 0, PIC_RECONSTRUCTION ).create( _chromaFormat, a, _maxCUSize, MAX_SCALING_RATIO*_margin, MEMORY_ALIGN_DEF_SIZE ); - M_BUFS( 0, PIC_RECON_WRAP ).create( _chromaFormat, a, _maxCUSize, MAX_SCALING_RATIO*_margin, MEMORY_ALIGN_DEF_SIZE ); + M_BUFS( 0, PIC_RECONSTRUCTION ).create( _chromaFormat, a, _maxCUSize, margin, MEMORY_ALIGN_DEF_SIZE ); + M_BUFS( 0, PIC_RECON_WRAP ).create( _chromaFormat, a, _maxCUSize, margin, MEMORY_ALIGN_DEF_SIZE ); if( !_decoder ) {