Skip to content
Snippets Groups Projects
Commit 6a3350f7 authored by Brian Heng's avatar Brian Heng
Browse files

Fix for Ticket #561 - RPR

  - Incorrect clipping at picture border and insufficient picture buffer margin.
parent d5c60a08
No related branches found
No related tags found
No related merge requests found
...@@ -2415,7 +2415,7 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio, ...@@ -2415,7 +2415,7 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio,
{ {
int posX = (int32_t)x0Int + col * stepX; int posX = (int32_t)x0Int + col * stepX;
xInt = ( posX + offX ) >> posShift; xInt = ( posX + offX ) >> posShift;
xInt = std::min( std::max( 0, xInt ), ( refPicWidth >> ::getComponentScaleX( compID, chFmt ) ) ); xInt = std::min( std::max( -4, xInt ), ( refPicWidth >> ::getComponentScaleX( compID, chFmt ) ) + 4 );
int xFrac = ( ( posX + offX ) >> ( posShift - shiftHor ) ) & ( ( 1 << shiftHor ) - 1 ); int xFrac = ( ( posX + offX ) >> ( posShift - shiftHor ) ) & ( ( 1 << shiftHor ) - 1 );
CHECK( xInt0 > xInt, "Wrong horizontal starting point" ); CHECK( xInt0 > xInt, "Wrong horizontal starting point" );
...@@ -2435,7 +2435,7 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio, ...@@ -2435,7 +2435,7 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio,
{ {
int posY = (int32_t)y0Int + row * stepY; int posY = (int32_t)y0Int + row * stepY;
yInt = ( posY + offY ) >> posShift; yInt = ( posY + offY ) >> posShift;
yInt = std::min( std::max( 0, yInt ), ( refPicHeight >> ::getComponentScaleY( compID, chFmt ) ) ); yInt = std::min( std::max( -4, yInt ), ( refPicHeight >> ::getComponentScaleY( compID, chFmt ) ) + 4 );
int yFrac = ( ( posY + offY ) >> ( posShift - shiftVer ) ) & ( ( 1 << shiftVer ) - 1 ); int yFrac = ( ( posY + offY ) >> ( posShift - shiftVer ) ) & ( ( 1 << shiftVer ) - 1 );
CHECK( yInt0 > yInt, "Wrong vertical starting point" ); CHECK( yInt0 > yInt, "Wrong vertical starting point" );
......
...@@ -806,10 +806,10 @@ Picture::Picture() ...@@ -806,10 +806,10 @@ Picture::Picture()
void Picture::create(const ChromaFormat &_chromaFormat, const Size &size, const unsigned _maxCUSize, const unsigned _margin, const bool _decoder) void Picture::create(const ChromaFormat &_chromaFormat, const Size &size, const unsigned _maxCUSize, const unsigned _margin, const bool _decoder)
{ {
UnitArea::operator=( UnitArea( _chromaFormat, Area( Position{ 0, 0 }, size ) ) ); UnitArea::operator=( UnitArea( _chromaFormat, Area( Position{ 0, 0 }, size ) ) );
margin = _margin; margin = MAX_SCALING_RATIO*_margin;
const Area a = Area( Position(), size ); const Area a = Area( Position(), size );
M_BUFS( 0, PIC_RECONSTRUCTION ).create( _chromaFormat, a, _maxCUSize, _margin, MEMORY_ALIGN_DEF_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, _margin, MEMORY_ALIGN_DEF_SIZE ); M_BUFS( 0, PIC_RECON_WRAP ).create( _chromaFormat, a, _maxCUSize, MAX_SCALING_RATIO*_margin, MEMORY_ALIGN_DEF_SIZE );
if( !_decoder ) if( !_decoder )
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment