Skip to content
Snippets Groups Projects
Commit 2e2c31af authored by Frank Bossen's avatar Frank Bossen
Browse files

Merge branch 'master' into 'fix_ticket_1405'

# Conflicts:
#   source/Lib/CommonLib/TypeDef.h
parents 1fa3486c 6043ddc3
No related branches found
No related tags found
No related merge requests found
......@@ -2410,6 +2410,24 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio,
int addX = isLuma( compID ) ? 0 : int( 1 - refPic->cs->sps->getHorCollocatedChromaFlag() ) * 8 * ( scalingRatio.first - SCALE_1X.first );
int addY = isLuma( compID ) ? 0 : int( 1 - refPic->cs->sps->getVerCollocatedChromaFlag() ) * 8 * ( scalingRatio.second - SCALE_1X.second );
#if FIX_SUBPICS_W_RPR
int boundLeft = 0;
int boundRight = refPicWidth >> ::getComponentScaleX( compID, chFmt );
int boundTop = 0;
int boundBottom = refPicHeight >> ::getComponentScaleY( compID, chFmt );
if( refPic->subPictures.size() > 1 )
{
const SubPic& curSubPic = pps.getSubPicFromPos(blk.lumaPos());
if( curSubPic.getTreatedAsPicFlag() )
{
boundLeft = curSubPic.getSubPicLeft() >> ::getComponentScaleX( compID, chFmt );
boundRight = curSubPic.getSubPicRight() >> ::getComponentScaleX( compID, chFmt );
boundTop = curSubPic.getSubPicTop() >> ::getComponentScaleY( compID, chFmt );
boundBottom = curSubPic.getSubPicBottom() >> ::getComponentScaleY( compID, chFmt );
}
}
#endif
x0Int = ( ( posX << ( 4 + ::getComponentScaleX( compID, chFmt ) ) ) + mv.getHor() ) * (int64_t)scalingRatio.first + addX;
x0Int = SIGN( x0Int ) * ( ( llabs( x0Int ) + ( (long long)1 << ( 7 + ::getComponentScaleX( compID, chFmt ) ) ) ) >> ( 8 + ::getComponentScaleX( compID, chFmt ) ) ) + ( ( refPic->getScalingWindow().getWindowLeftOffset() * SPS::getWinUnitX( chFmt ) ) << ( ( posShift - ::getComponentScaleX( compID, chFmt ) ) ) );
......@@ -2421,10 +2439,18 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio,
int vFilterSize = isLuma( compID ) ? NTAPS_LUMA : NTAPS_CHROMA;
int yInt0 = ( (int32_t)y0Int + offY ) >> posShift;
#if FIX_SUBPICS_W_RPR
yInt0 = std::min( std::max( boundTop - (NTAPS_LUMA / 2), yInt0 ), boundBottom + (NTAPS_LUMA / 2) );
#else
yInt0 = std::min( std::max( -(NTAPS_LUMA / 2), yInt0 ), ( refPicHeight >> ::getComponentScaleY( compID, chFmt ) ) + (NTAPS_LUMA / 2) );
#endif
int xInt0 = ( (int32_t)x0Int + offX ) >> posShift;
#if FIX_SUBPICS_W_RPR
xInt0 = std::min( std::max( boundLeft - (NTAPS_LUMA / 2), xInt0 ), boundRight + (NTAPS_LUMA / 2) );
#else
xInt0 = std::min( std::max( -(NTAPS_LUMA / 2), xInt0 ), ( refPicWidth >> ::getComponentScaleX( compID, chFmt ) ) + (NTAPS_LUMA / 2) );
#endif
int refHeight = ((((int32_t)y0Int + (height-1) * stepY) + offY ) >> posShift) - ((((int32_t)y0Int + 0 * stepY) + offY ) >> posShift) + 1;
refHeight = std::max<int>( 1, refHeight );
......@@ -2439,7 +2465,11 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio,
{
int posX = (int32_t)x0Int + col * stepX;
xInt = ( posX + offX ) >> posShift;
#if FIX_SUBPICS_W_RPR
xInt = std::min( std::max( boundLeft - (NTAPS_LUMA / 2), xInt ), boundRight + (NTAPS_LUMA / 2) );
#else
xInt = std::min( std::max( -(NTAPS_LUMA / 2), xInt ), ( refPicWidth >> ::getComponentScaleX( compID, chFmt ) ) + (NTAPS_LUMA / 2) );
#endif
int xFrac = ( ( posX + offX ) >> ( posShift - shiftHor ) ) & ( ( 1 << shiftHor ) - 1 );
CHECK( xInt0 > xInt, "Wrong horizontal starting point" );
......@@ -2455,7 +2485,11 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio,
{
int posY = (int32_t)y0Int + row * stepY;
yInt = ( posY + offY ) >> posShift;
#if FIX_SUBPICS_W_RPR
yInt = std::min( std::max( boundTop - (NTAPS_LUMA / 2), yInt ), boundBottom + (NTAPS_LUMA / 2) );
#else
yInt = std::min( std::max( -(NTAPS_LUMA / 2), yInt ), ( refPicHeight >> ::getComponentScaleY( compID, chFmt ) ) + (NTAPS_LUMA / 2) );
#endif
int yFrac = ( ( posY + offY ) >> ( posShift - shiftVer ) ) & ( ( 1 << shiftVer ) - 1 );
CHECK( yInt0 > yInt, "Wrong vertical starting point" );
......
......@@ -66,6 +66,7 @@
#define JVET_S0084_S0110_RADL 1 // When the current picture is a RADL picture, allow RASL pictures with pps_mixed_nalu_types_in_pic_flag is equal to 1 in active entries in RefPicList[ 0 ] or RefPicList[ 1 ]
#define FIX_TICKET_1405 1 // Add dph_sei_single_component_flag and dph_sei_reserved_zero_7bits syntax to decoded picture hash SEI message
#define FIX_SUBPICS_W_RPR 1 // Fix handling of RPR with subpictures (via scaling windows with no resolution change)
//########### place macros to be be kept below this line ###############
#define JVET_S0257_DUMP_360SEI_MESSAGE 1 // Software support of 360 SEI messages
......
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