Commit f38104fd authored by Vadim Seregin's avatar Vadim Seregin
Browse files

JVET-O1164 RPR implementation without considering conformance window

parent 708048d8
......@@ -389,7 +389,11 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
numPicsNotYetDisplayed = numPicsNotYetDisplayed-2;
if ( !m_reconFileName.empty() )
{
#if JVET_O1164_PS
const Window &conf = pcPicTop->cs->pps->getConformanceWindow();
#else
const Window &conf = pcPicTop->cs->sps->getConformanceWindow();
#endif
const bool isTff = pcPicTop->topField;
bool display = true;
......@@ -408,10 +412,17 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
m_cVideoIOYuvReconFile.write( pcPicTop->getRecoBuf(), pcPicBottom->getRecoBuf(),
m_outputColourSpaceConvert,
false, // TODO: m_packedYUVMode,
#if JVET_O1164_PS
conf.getWindowLeftOffset() * SPS::getWinUnitX( pcPicTop->cs->sps->getChromaFormatIdc() ),
conf.getWindowRightOffset() * SPS::getWinUnitX( pcPicTop->cs->sps->getChromaFormatIdc() ),
conf.getWindowTopOffset() * SPS::getWinUnitY( pcPicTop->cs->sps->getChromaFormatIdc() ),
conf.getWindowBottomOffset() * SPS::getWinUnitY( pcPicTop->cs->sps->getChromaFormatIdc() ),
#else
conf.getWindowLeftOffset(),
conf.getWindowRightOffset(),
conf.getWindowTopOffset(),
conf.getWindowBottomOffset(),
#endif
NUM_CHROMA_FORMAT, isTff );
}
}
......@@ -454,15 +465,31 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
if (!m_reconFileName.empty())
{
#if JVET_O1164_PS
const Window &conf = pcPic->cs->pps->getConformanceWindow();
const SPS* sps = pcPic->cs->sps;
ChromaFormat chromaFormatIDC = sps->getChromaFormatIdc();
#else
const Window &conf = pcPic->cs->sps->getConformanceWindow();
#endif
#if JVET_O1164_RPR
m_cVideoIOYuvReconFile.write( pcPic->cs->sps->getMaxPicWidthInLumaSamples(), pcPic->cs->sps->getMaxPicHeightInLumaSamples(), pcPic->getRecoBuf(),
#else
m_cVideoIOYuvReconFile.write( pcPic->getRecoBuf(),
#endif
m_outputColourSpaceConvert,
m_packedYUVMode,
#if JVET_O1164_PS
conf.getWindowLeftOffset() * SPS::getWinUnitX( chromaFormatIDC ),
conf.getWindowRightOffset() * SPS::getWinUnitX( chromaFormatIDC ),
conf.getWindowTopOffset() * SPS::getWinUnitY( chromaFormatIDC ),
conf.getWindowBottomOffset() * SPS::getWinUnitY( chromaFormatIDC ),
#else
conf.getWindowLeftOffset(),
conf.getWindowRightOffset(),
conf.getWindowTopOffset(),
conf.getWindowBottomOffset(),
#endif
NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range );
}
......@@ -516,16 +543,27 @@ void DecApp::xFlushOutput( PicList* pcListPic )
// write to file
if ( !m_reconFileName.empty() )
{
#if JVET_O1164_PS
const Window &conf = pcPicTop->cs->pps->getConformanceWindow();
#else
const Window &conf = pcPicTop->cs->sps->getConformanceWindow();
#endif
const bool isTff = pcPicTop->topField;
m_cVideoIOYuvReconFile.write( pcPicTop->getRecoBuf(), pcPicBottom->getRecoBuf(),
m_outputColourSpaceConvert,
false, // TODO: m_packedYUVMode,
#if JVET_O1164_PS
conf.getWindowLeftOffset() * SPS::getWinUnitX( pcPicTop->cs->sps->getChromaFormatIdc() ),
conf.getWindowRightOffset() * SPS::getWinUnitX( pcPicTop->cs->sps->getChromaFormatIdc() ),
conf.getWindowTopOffset() * SPS::getWinUnitY( pcPicTop->cs->sps->getChromaFormatIdc() ),
conf.getWindowBottomOffset() * SPS::getWinUnitY( pcPicTop->cs->sps->getChromaFormatIdc() ),
#else
conf.getWindowLeftOffset(),
conf.getWindowRightOffset(),
conf.getWindowTopOffset(),
conf.getWindowBottomOffset(),
#endif
NUM_CHROMA_FORMAT, isTff );
}
......@@ -571,15 +609,31 @@ void DecApp::xFlushOutput( PicList* pcListPic )
if (!m_reconFileName.empty())
{
#if JVET_O1164_PS
const Window &conf = pcPic->cs->pps->getConformanceWindow();
const SPS* sps = pcPic->cs->sps;
ChromaFormat chromaFormatIDC = sps->getChromaFormatIdc();
#else
const Window &conf = pcPic->cs->sps->getConformanceWindow();
#endif
#if JVET_O1164_RPR
m_cVideoIOYuvReconFile.write( pcPic->cs->sps->getMaxPicWidthInLumaSamples(), pcPic->cs->sps->getMaxPicHeightInLumaSamples(), pcPic->getRecoBuf(),
#else
m_cVideoIOYuvReconFile.write( pcPic->getRecoBuf(),
#endif
m_outputColourSpaceConvert,
m_packedYUVMode,
#if JVET_O1164_PS
conf.getWindowLeftOffset() * SPS::getWinUnitX( chromaFormatIDC ),
conf.getWindowRightOffset() * SPS::getWinUnitX( chromaFormatIDC ),
conf.getWindowTopOffset() * SPS::getWinUnitY( chromaFormatIDC ),
conf.getWindowBottomOffset() * SPS::getWinUnitY( chromaFormatIDC ),
#else
conf.getWindowLeftOffset(),
conf.getWindowRightOffset(),
conf.getWindowTopOffset(),
conf.getWindowBottomOffset(),
#endif
NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range );
}
......
......@@ -106,7 +106,14 @@ void EncApp::xInitLibCfg()
m_cEncLib.setTemporalSubsampleRatio ( m_temporalSubsampleRatio );
m_cEncLib.setSourceWidth ( m_iSourceWidth );
m_cEncLib.setSourceHeight ( m_iSourceHeight );
#if JVET_O1164_RPR
m_cEncLib.setConformanceWindow ( m_confWinLeft / SPS::getWinUnitX( m_InputChromaFormatIDC ), m_confWinRight / SPS::getWinUnitX( m_InputChromaFormatIDC ), m_confWinTop / SPS::getWinUnitY( m_InputChromaFormatIDC ), m_confWinBottom / SPS::getWinUnitY( m_InputChromaFormatIDC ) );
m_cEncLib.setScalingRatio ( m_scalingRatio );
m_cEncLib.setRPREnabled ( m_rprEnabled );
m_cEncLib.setSwitchPocPeriod ( m_switchPocPeriod );
#else
m_cEncLib.setConformanceWindow ( m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom );
#endif
m_cEncLib.setFramesToBeEncoded ( m_framesToBeEncoded );
//====== SPS constraint flags =======
......@@ -867,10 +874,16 @@ void EncApp::xWriteOutput( int iNumEncoded, std::list<PelUnitBuf*>& recBufList
const PelUnitBuf* pcPicYuvRec = *(iterPicYuvRec++);
if (!m_reconFileName.empty())
{
#if JVET_O1164_RPR
SPS* sps0 = m_cEncLib.getSPS( 0 );
m_cVideoIOYuvReconFile.write( sps0->getMaxPicWidthInLumaSamples(), sps0->getMaxPicHeightInLumaSamples(), *pcPicYuvRec, ipCSC, m_packedYUVMode,
m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range );
#else
m_cVideoIOYuvReconFile.write( *pcPicYuvRec,
ipCSC,
m_packedYUVMode,
m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range );
#endif
}
}
}
......
......@@ -1378,6 +1378,11 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("EnsureWppBitEqual", m_ensureWppBitEqual, false, "Ensure the results are equal to results with WPP-style parallelism, even if WPP is off")
#endif
( "ALF", m_alf, true, "Adpative Loop Filter\n" )
#if JVET_O1164_RPR
( "ScalingRatio", m_scalingRatio, 1.0, "Scaling ratio" )
( "HalfFrames", m_halfFrames, false, "Encode half of the specified in FramesToBeEncoded" )
( "SwitchPocPeriod", m_switchPocPeriod, 0, "Switch POC period for RPR" )
#endif
;
#if EXTENSION_360_VIDEO
......@@ -1402,6 +1407,19 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
po::setDefaults(opts);
po::ErrorReporter err;
const list<const char*>& argv_unhandled = po::scanArgv(opts, argc, (const char**) argv, err);
#if JVET_O1164_RPR
m_rprEnabled = m_scalingRatio != 1.0;
if( m_halfFrames )
{
m_framesToBeEncoded >>= 1;
}
if( m_rprEnabled && !m_switchPocPeriod )
{
m_switchPocPeriod = m_iFrameRate / 2 / m_iGOPSize * m_iGOPSize;
}
#endif
for (int i = 0; m_GOPList[i].m_POC != -1 && i < MAX_GOP + 1; i++)
{
......@@ -3615,6 +3633,17 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "NumWppThreads:%d+%d ", m_numWppThreads, m_numWppExtraLines );
msg( VERBOSE, "EnsureWppBitEqual:%d ", m_ensureWppBitEqual );
#if JVET_O1164_RPR
if( m_rprEnabled )
{
msg( VERBOSE, "RPR:%1.2lfx|%d", m_scalingRatio, m_switchPocPeriod );
}
else
{
msg( VERBOSE, "RPR:%d", 0 );
}
#endif
#if EXTENSION_360_VIDEO
m_ext360.outputConfigurationSummary();
#endif
......
......@@ -602,7 +602,14 @@ protected:
bool m_bs2ModPOCAndType;
bool m_forceDecodeBitstream1;
bool m_alf; ///> Adaptive Loop Filter
bool m_alf; ///< Adaptive Loop Filter
#if JVET_O1164_RPR
double m_scalingRatio;
bool m_rprEnabled;
bool m_halfFrames; ///< encode only half of the frames as specified in CTC
int m_switchPocPeriod;
#endif
#if EXTENSION_360_VIDEO
TExt360AppEncCfg m_ext360;
......
......@@ -601,6 +601,9 @@ void AdaptiveLoopFilter::reconstructCoeff( AlfParam& alfParam, ChannelType chann
void AdaptiveLoopFilter::create( const int picWidth, const int picHeight, const ChromaFormat format, const int maxCUWidth, const int maxCUHeight, const int maxCUDepth, const int inputBitDepth[MAX_NUM_CHANNEL_TYPE] )
{
#if JVET_O1164_PS
destroy();
#endif
std::memcpy( m_inputBitDepth, inputBitDepth, sizeof( m_inputBitDepth ) );
m_picWidth = picWidth;
m_picHeight = picHeight;
......@@ -731,7 +734,10 @@ void AdaptiveLoopFilter::destroy()
m_tempBuf.destroy();
m_tempBuf2.destroy();
#if JVET_O1164_PS
m_filterShapes[CHANNEL_TYPE_LUMA].clear();
m_filterShapes[CHANNEL_TYPE_CHROMA].clear();
#endif
m_created = false;
}
......
......@@ -58,6 +58,10 @@ enum PictureType
PIC_RESIDUAL,
PIC_ORG_RESI,
PIC_RECON_WRAP,
#if RPR_CTC_PRINT
PIC_ORIGINAL_INPUT,
PIC_TRUE_ORIGINAL_INPUT,
#endif
NUM_PIC_TYPES
};
#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
......
This diff is collapsed.
......@@ -55,14 +55,26 @@ void roundAffineMv( int& mvx, int& mvy, int nShift )
mvy = (mvy + nOffset - (mvy >= 0)) >> nShift;
}
#if JVET_O1164_PS
void clipMv( Mv& rcMv, const Position& pos, const struct Size& size, const SPS& sps, const PPS& pps )
#else
void clipMv( Mv& rcMv, const Position& pos, const struct Size& size, const SPS& sps )
#endif
{
int iMvShift = MV_FRACTIONAL_BITS_INTERNAL;
int iOffset = 8;
#if JVET_O1164_PS
int iHorMax = ( pps.getPicWidthInLumaSamples() + iOffset - (int)pos.x - 1 ) << iMvShift;
#else
int iHorMax = ( sps.getPicWidthInLumaSamples() + iOffset - ( int ) pos.x - 1 ) << iMvShift;
#endif
int iHorMin = ( -( int ) sps.getMaxCUWidth() - iOffset - ( int ) pos.x + 1 ) << iMvShift;
#if JVET_O1164_PS
int iVerMax = ( pps.getPicHeightInLumaSamples() + iOffset - (int)pos.y - 1 ) << iMvShift;
#else
int iVerMax = ( sps.getPicHeightInLumaSamples() + iOffset - ( int ) pos.y - 1 ) << iMvShift;
#endif
int iVerMin = ( -( int ) sps.getMaxCUHeight() - iOffset - ( int ) pos.y + 1 ) << iMvShift;
if( sps.getWrapAroundEnabledFlag() )
......@@ -74,14 +86,26 @@ void clipMv( Mv& rcMv, const Position& pos, const struct Size& size, const SPS&
rcMv.setVer( std::min( iVerMax, std::max( iVerMin, rcMv.getVer() ) ) );
}
#if JVET_O1164_PS
bool wrapClipMv( Mv& rcMv, const Position& pos, const struct Size& size, const SPS *sps, const PPS *pps )
#else
bool wrapClipMv( Mv& rcMv, const Position& pos, const struct Size& size, const SPS *sps )
#endif
{
bool wrapRef = true;
int iMvShift = MV_FRACTIONAL_BITS_INTERNAL;
int iOffset = 8;
#if JVET_O1164_PS
int iHorMax = ( pps->getPicWidthInLumaSamples() + sps->getMaxCUWidth() - size.width + iOffset - (int)pos.x - 1 ) << iMvShift;
#else
int iHorMax = ( sps->getPicWidthInLumaSamples() + sps->getMaxCUWidth() - size.width + iOffset - ( int ) pos.x - 1 ) << iMvShift;
#endif
int iHorMin = ( -( int ) sps->getMaxCUWidth() - iOffset - ( int ) pos.x + 1 ) << iMvShift;
#if JVET_O1164_PS
int iVerMax = ( pps->getPicHeightInLumaSamples() + iOffset - (int)pos.y - 1 ) << iMvShift;
#else
int iVerMax = ( sps->getPicHeightInLumaSamples() + iOffset - ( int ) pos.y - 1 ) << iMvShift;
#endif
int iVerMin = ( -( int ) sps->getMaxCUHeight() - iOffset - ( int ) pos.y + 1 ) << iMvShift;
int mvX = rcMv.getHor();
......
......@@ -287,11 +287,19 @@ namespace std
};
void clipMv ( Mv& rcMv, const struct Position& pos,
const struct Size& size,
const class SPS& sps );
const class SPS& sps
#if JVET_O1164_PS
, const class PPS& pps
#endif
);
bool wrapClipMv( Mv& rcMv, const Position& pos,
const struct Size& size,
const SPS *sps );
bool wrapClipMv( Mv& rcMv, const Position& pos,
const struct Size& size,
const SPS *sps
#if JVET_O1164_PS
, const PPS* pps
#endif
);
void roundAffineMv( int& mvx, int& mvy, int nShift );
......
......@@ -903,8 +903,13 @@ void Picture::finalInit(const SPS& sps, const PPS& pps, APS** alfApss, APS& lmcs
}
const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc();
#if JVET_O1164_PS
const int iWidth = pps.getPicWidthInLumaSamples();
const int iHeight = pps.getPicHeightInLumaSamples();
#else
const int iWidth = sps.getPicWidthInLumaSamples();
const int iHeight = sps.getPicHeightInLumaSamples();
#endif
if( cs )
{
......@@ -1017,6 +1022,137 @@ void Picture::finishCtuPart( const UnitArea& ctuArea )
#endif
#if JVET_O1164_RPR
const TFilterCoeff InterpolationFilterSRC[16][8] =
{
{ 0, 0, 0, 64, 0, 0, 0, 0 },
{ 0, 1, -3, 63, 4, -2, 1, 0 },
{ -1, 2, -5, 62, 8, -3, 1, 0 },
{ -1, 3, -8, 60, 13, -4, 1, 0 },
{ -1, 4, -10, 58, 17, -5, 1, 0 },
{ -1, 4, -11, 52, 26, -8, 3, -1 },
{ -1, 3, -9, 47, 31, -10, 4, -1 },
{ -1, 4, -11, 45, 34, -10, 4, -1 },
{ -1, 4, -11, 40, 40, -11, 4, -1 },
{ -1, 4, -10, 34, 45, -11, 4, -1 },
{ -1, 4, -10, 31, 47, -9, 3, -1 },
{ -1, 3, -8, 26, 52, -11, 4, -1 },
{ 0, 1, -5, 17, 58, -10, 4, -1 },
{ 0, 1, -4, 13, 60, -8, 3, -1 },
{ 0, 1, -3, 8, 62, -5, 2, -1 },
{ 0, 1, -2, 4, 63, -3, 1, 0 }
};
const TFilterCoeff DownsamplingFilterSRC[16][12] =
{
//{ 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0}, //0
{ 0, 5, -6, -10, 37, 76, 37, -10, -6, 5, 0, 0}, //0
{ 0, 5, -4, -11, 33, 76, 40, -9, -7, 5, 0, 0}, //1
//{ 0, 5, -3, -12, 28, 75, 44, -7, -8, 5, 1, 0}, //2
{ -1, 5, -3, -12, 29, 75, 45, -7, -8, 5, 0, 0}, //2 new coefficients in m24499
{ -1, 4, -2, -13, 25, 75, 48, -5, -9, 5, 1, 0}, //3
{ -1, 4, -1, -13, 22, 73, 52, -3, -10, 4, 1, 0}, //4
{ -1, 4, 0, -13, 18, 72, 55, -1, -11, 4, 2, -1}, //5
{ -1, 4, 1, -13, 14, 70, 59, 2, -12, 3, 2, -1}, //6
{ -1, 3, 1, -13, 11, 68, 62, 5, -12, 3, 2, -1}, //7
{ -1, 3, 2, -13, 8, 65, 65, 8, -13, 2, 3, -1}, //8
{ -1, 2, 3, -12, 5, 62, 68, 11, -13, 1, 3, -1}, //9
{ -1, 2, 3, -12, 2, 59, 70, 14, -13, 1, 4, -1}, //10
{ -1, 2, 4, -11, -1, 55, 72, 18, -13, 0, 4, -1}, //11
{ 0, 1, 4, -10, -3, 52, 73, 22, -13, -1, 4, -1}, //12
{ 0, 1, 5, -9, -5, 48, 75, 25, -13, -2, 4, -1}, //13
//{ 0, 1, 5, -8, -7, 44, 75, 28, -12, -3, 5, 0}, //14
{ 0, 0, 5, -8, -7, 45, 75, 29, -12, -3, 5, -1} , //14 new coefficients in m24499
{ 0, 0, 5, -7, -9, 40, 76, 33, -11, -4, 5, 0}, //15
};
void Picture::sampleRateConv( const Pel* orgSrc, SizeType orgWidth, SizeType orgHeight, SizeType orgStride, Pel* scaledSrc, SizeType scaledWidth, SizeType scaledHeight, SizeType scaledStride, int bitDepth, const bool downsampling )
{
if( orgWidth == scaledWidth && orgHeight == scaledHeight )
{
for( int j = 0; j < orgHeight; j++ )
{
memcpy( scaledSrc + j * scaledStride, orgSrc + j * orgStride, sizeof( Pel ) * orgWidth );
}
return;
}
const TFilterCoeff* filter = downsampling ? &DownsamplingFilterSRC[0][0] : &InterpolationFilterSRC[0][0];
const int filerLength = downsampling ? 12 : 8;
const int log2Norm = downsampling ? 14 : 12;
int *buf = new int[orgHeight * scaledWidth];
int maxVal = ( 1 << bitDepth ) - 1;
CHECK( bitDepth > 17, "Overflow may happen!" );
for( int i = 0; i < scaledWidth; i++ )
{
const Pel* org = orgSrc;
int integer = ( i * orgWidth ) / scaledWidth;
int frac = ( ( i * orgWidth << 4 ) / scaledWidth ) & 15;
int* tmp = buf + i;
for( int j = 0; j < orgHeight; j++ )
{
int sum = 0;
const TFilterCoeff* f = filter + frac * filerLength;
for( int k = 0; k < filerLength; k++ )
{
int xInt = std::min<int>( std::max( 0, integer + k - filerLength / 2 + 1 ), orgWidth - 1 );
sum += f[k] * org[xInt]; // postpone horizontal filtering gain removal after vertical filtering
}
*tmp = sum;
tmp += scaledWidth;
org += orgStride;
}
}
Pel* dst = scaledSrc;
for( int j = 0; j < scaledHeight; j++ )
{
int integer = ( j * orgHeight ) / scaledHeight;
int frac = ( ( j * orgHeight << 4 ) / scaledHeight ) & 15;
for( int i = 0; i < scaledWidth; i++ )
{
int sum = 0;
int* tmp = buf + i;
const TFilterCoeff* f = filter + frac * filerLength;
for( int k = 0; k < filerLength; k++ )
{
int yInt = std::min<int>( std::max( 0, integer + k - filerLength / 2 + 1 ), orgHeight - 1 );
sum += f[k] * tmp[yInt*scaledWidth];
}
dst[i] = std::min<int>( std::max( 0, ( sum + ( 1 << ( log2Norm - 1 ) ) ) >> log2Norm ), maxVal );
}
dst += scaledStride;
}
delete[] buf;
}
void Picture::rescalePicture( const CPelUnitBuf& beforeScaling, const PelUnitBuf& afterScaling, const ChromaFormat chromaFormatIDC, const BitDepths& bitDepths, const bool downsampling )
{
for( int comp = 0; comp < ::getNumberValidComponents( chromaFormatIDC ); comp++ )
{
const CPelBuf& beforeScale = beforeScaling.get( ComponentID( comp ) );
const PelBuf& afterScale = afterScaling.get( ComponentID( comp ) );
Picture::sampleRateConv( beforeScale.buf, beforeScale.width, beforeScale.height, beforeScale.stride, afterScale.buf, afterScale.width, afterScale.height, afterScale.stride, bitDepths.recon[comp], downsampling );
}
}
#endif
void Picture::extendPicBorder()
{
if ( m_bIsBorderExtended )
......@@ -1216,8 +1352,13 @@ bool Picture::getSpliceFull()
void Picture::addPictureToHashMapForInter()
{
#if JVET_O1164_PS
int picWidth = slices[0]->getPPS()->getPicWidthInLumaSamples();
int picHeight = slices[0]->getPPS()->getPicHeightInLumaSamples();
#else
int picWidth = slices[0]->getSPS()->getPicWidthInLumaSamples();
int picHeight = slices[0]->getSPS()->getPicHeightInLumaSamples();
#endif
uint32_t* blockHashValues[2][2];
bool* bIsBlockSame[2][3];
......
......@@ -243,6 +243,11 @@ struct Picture : public UnitArea
void setSpliceIdx(uint32_t idx, int poc) { m_spliceIdx[idx] = poc; }
void createSpliceIdx(int nums);
bool getSpliceFull();
#if JVET_O1164_RPR
static void sampleRateConv( const Pel* orgSrc, SizeType orgWidth, SizeType orgHeight, SizeType orgStride, Pel* scaledSrc, SizeType scaledWidth, SizeType scaledHeight, SizeType scaledStride, int bitDepth, const bool downsampling = false );
static void rescalePicture( const CPelUnitBuf& beforeScaling, const PelUnitBuf& afterScaling, const ChromaFormat chromaFormatIDC, const BitDepths& bitDepths, const bool downsampling = false );
#endif
public:
bool m_bIsBorderExtended;
......@@ -271,6 +276,9 @@ public:
#else
PelStorage m_bufs[NUM_PIC_TYPES];
#endif
#if JVET_O1164_RPR
const Picture* unscaledPic;
#endif
TComHash m_hashMap;
TComHash* getHashMap() { return &m_hashMap; }
......
......@@ -1394,8 +1394,13 @@ SPS::SPS()
, m_chromaFormatIdc (CHROMA_420)
, m_uiMaxTLayers ( 1)
// Structure
#if JVET_O1164_PS
, m_maxWidthInLumaSamples (352)
, m_maxHeightInLumaSamples (288)
#else
, m_picWidthInLumaSamples (352)
, m_picHeightInLumaSamples (288)
#endif
, m_log2MinCodingBlockSize ( 0)
, m_log2DiffMaxMinCodingBlockSize(0)
, m_CTUSize(0)
......@@ -1631,6 +1636,10 @@ PPS::PPS()
, m_loopFilterAcrossVirtualBoundariesDisabledFlag(false)
, m_numVerVirtualBoundaries (0)
, m_numHorVirtualBoundaries (0)
#if JVET_O1164_PS
, m_picWidthInLumaSamples( 352 )
, m_picHeightInLumaSamples( 288 )
#endif
, m_ppsRangeExtension ()
, pcv (NULL)
{
......@@ -2282,6 +2291,148 @@ uint32_t PreCalcValues::getMinQtSize( const Slice &slice, const ChannelType chTy
return minQtSize[getValIdx( slice, chType )];
}
#if JVET_O1164_RPR
void Slice::scaleRefPicList( Picture *scaledRefPic[], APS** apss, APS& lmcsAps, const bool isDecoder )
{
int i;
const SPS* sps = getSPS();
const PPS* pps = getPPS();
// this is needed for IBC
m_pcPic->unscaledPic = m_pcPic;
if( m_eSliceType == I_SLICE )
{
return;
}
// the handling here mimics what happened in xGetNewPicBuffer()
for( i = 0; i < MAX_NUM_REF; i++ )
{
scaledRefPic[i] = new Picture;
scaledRefPic[i]->setBorderExtension( false );
scaledRefPic[i]->reconstructed = false;