Commit d947ca28 authored by Frank Bossen's avatar Frank Bossen

Merge branch 'master' into 'JVET-S0081'

# Conflicts:
#   source/Lib/CommonLib/TypeDef.h
parents 58838b28 c0aa11b3
Pipeline #5415 passed with stage
in 27 minutes and 58 seconds
......@@ -14,3 +14,5 @@ CrQpOffset : 0
SameCQPTablesForAllChroma : 1
QpInValCb : 9 23 33 42
QpOutValCb : 9 24 33 37
VerCollocatedChroma : 1
#======== File I/O ===============
InputFile : DayStreet_3840x2160_60p_10bit_420_hlg.yuv
InputFile : DayStreet2_3840x2160_60p_10bit_420_hlg_type2.yuv
InputBitDepth : 10 # Input bitdepth
InputChromaFormat : 420 # Ratio of luminance to chrominance samples
FrameRate : 60 # Frame Rate per second
......
#======== File I/O ===============
InputFile : FlyingBirds2_3840x2160p_60_10b_HLG_420.yuv
InputFile : FlyingBirds3_3840x2160p_60_10b_HLG_420_type2.yuv
InputBitDepth : 10 # Input bitdepth
InputChromaFormat : 420 # Ratio of luminance to chrominance samples
FrameRate : 60 # Frame Rate per second
......
#======== File I/O ===============
InputFile : PeopleInShoppingCenter_3840x2160_60p_10bit_420_hlg.yuv
InputFile : PeopleInShoppingCenter2_3840x2160_60p_10bit_420_hlg_type2.yuv
InputBitDepth : 10 # Input bitdepth
InputChromaFormat : 420 # Ratio of luminance to chrominance samples
FrameRate : 60 # Frame Rate per second
......
#======== File I/O ===============
InputFile : SunsetBeach2_3840x2160p_60_10b_HLG_420.yuv
InputFile : SunsetBeach3_3840x2160p_60_10b_HLG_420_type2.yuv
InputBitDepth : 10 # Input bitdepth
InputChromaFormat : 420 # Ratio of luminance to chrominance samples
FrameRate : 60 # Frame Rate per second
......
......@@ -1060,6 +1060,18 @@ Specifies the value of one_slice_per_pic_constraint_flag
Specifies the value of one_subpic_per_pic_constraint_flag
\\
\Option{ExplicitScaleListConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_explicit_scaling_list_constraint_flag
\\
\Option{VirtualBoundaryConstraintFlag} &
%\ShortOption{\None} &
\Default{false} &
Specifies the value of gci_no_virtual_boundaries_constraint_flag
\\
\Option{FrameOnly} &
%\ShortOption{\None} &
\Default{false} &
......
......@@ -223,6 +223,8 @@ void BitstreamExtractorApp::xRewritePPS (PPS &targetPPS, const PPS &sourcePPS, S
std::vector<uint32_t> tileRowHeight;
std::vector<uint32_t> tileColBd;
std::vector<uint32_t> tileRowBd;
int subpicTopLeftTileX = -1;
int subpicTopLeftTileY = -1;
for (int i=0; i<= sourcePPS.getNumTileColumns(); i++)
{
......@@ -230,6 +232,10 @@ void BitstreamExtractorApp::xRewritePPS (PPS &targetPPS, const PPS &sourcePPS, S
if ((currentColBd >= subPic.getSubPicCtuTopLeftX()) && (currentColBd <= (subPic.getSubPicCtuTopLeftX() + subPic.getSubPicWidthInCTUs())))
{
tileColBd.push_back(currentColBd - subPic.getSubPicCtuTopLeftX());
if (subpicTopLeftTileX == -1)
{
subpicTopLeftTileX = i;
}
}
}
numTileCols=(int)tileColBd.size() - 1;
......@@ -249,6 +255,10 @@ void BitstreamExtractorApp::xRewritePPS (PPS &targetPPS, const PPS &sourcePPS, S
if ((currentRowBd >= subPic.getSubPicCtuTopLeftY()) && (currentRowBd <= (subPic.getSubPicCtuTopLeftY() + subPic.getSubPicHeightInCTUs())))
{
tileRowBd.push_back(currentRowBd - subPic.getSubPicCtuTopLeftY());
if(subpicTopLeftTileY == -1)
{
subpicTopLeftTileY = i;
}
}
}
numTileRows=(int)tileRowBd.size() - 1;
......@@ -295,6 +305,11 @@ void BitstreamExtractorApp::xRewritePPS (PPS &targetPPS, const PPS &sourcePPS, S
{
int targetNumSlices = subPic.getNumSlicesInSubPic();
targetPPS.setNumSlicesInPic(targetNumSlices);
// To avoid the bitstream writer writing tile_idx_delta in the bitstream
if ( (targetPPS.getNumSlicesInPic() - 1) <= 1)
{
targetPPS.setTileIdxDeltaPresentFlag(0);
}
for (int i=0, cnt=0; i<sourcePPS.getNumSlicesInPic(); i++)
{
......@@ -310,23 +325,14 @@ void BitstreamExtractorApp::xRewritePPS (PPS &targetPPS, const PPS &sourcePPS, S
cnt++;
}
}
// renumber tiles to close gaps
// Find out new slices tile index after removal of some tiles
for (int i=0; i<targetPPS.getNumSlicesInPic(); i++)
{
int minVal = MAX_INT;
int minPos = -1;
for (int j=0; j<targetPPS.getNumSlicesInPic(); j++)
{
if ((targetPPS.getSliceTileIdx(j) < minVal) && (targetPPS.getSliceTileIdx(j) >= i))
{
minVal = targetPPS.getSliceTileIdx(j);
minPos = j;
}
}
if ( minPos != -1)
{
targetPPS.setSliceTileIdx(minPos, i);
}
int tileInPicX = targetPPS.getSliceTileIdx(i) % sourcePPS.getNumTileColumns();
int tileInPicY = targetPPS.getSliceTileIdx(i) / sourcePPS.getNumTileColumns();
int tileInSubpicX = tileInPicX - subpicTopLeftTileX;
int tileInSubpicY = tileInPicY - subpicTopLeftTileY;
targetPPS.setSliceTileIdx(i, tileInSubpicY * numTileCols + tileInSubpicX);
}
}
......
......@@ -304,7 +304,12 @@ void EncApp::xInitLibCfg()
m_cEncLib.setNoPaletteConstraintFlag ( m_PLTMode == 1 ? false : true );
m_cEncLib.setNoActConstraintFlag ( !m_useColorTrans );
m_cEncLib.setNoLmcsConstraintFlag ( !m_lmcsEnabled );
#if JVET_S0050_GCI
m_cEncLib.setNoExplicitScaleListConstraintFlag ( m_noExplicitScaleListConstraintFlag );
CHECK( m_noExplicitScaleListConstraintFlag && m_useScalingListId != SCALING_LIST_OFF, "Explicit scaling list shall be deactivated when m_noExplicitScaleListConstraintFlag is equal to 1");
m_cEncLib.setNoVirtualBoundaryConstraintFlag ( m_noVirtualBoundaryConstraintFlag );
CHECK( m_noVirtualBoundaryConstraintFlag && m_virtualBoundariesEnabledFlag, "Virtuall boundaries shall be deactivated when m_noVirtualBoundaryConstraintFlag is equal to 1");
#endif
//====== Coding Structure ========
m_cEncLib.setIntraPeriod ( m_iIntraPeriod );
......
......@@ -837,6 +837,10 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("OneSlicePerPicConstraintFlag", m_oneSlicePerPicConstraintFlag, false, "Indicate that each picture shall contain only one slice")
("OneSubpicPerPicConstraintFlag", m_oneSubpicPerPicConstraintFlag, false, "Indicate that each picture shall contain only one subpicture")
("FrameOnly", m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames")
#if JVET_S0050_GCI
("ExplicitScaleListConstraintFlag", m_noExplicitScaleListConstraintFlag, false, "Indicate that explicit scaling list is deactivated")
("VirtualBoundaryConstraintFlag", m_noVirtualBoundaryConstraintFlag, false, "Indicate that virtual boundary is deactivated")
#endif
("CTUSize", m_uiCTUSize, 128u, "CTUSize (specifies the CTU size if QTBT is on) [default: 128]")
("Log2MinCuSize", m_log2MinCuSize, 2u, "Log2 min CU size")
("SubPicInfoPresentFlag", m_subPicInfoPresentFlag, false, "equal to 1 specifies that subpicture parameters are present in in the SPS RBSP syntax")
......
......@@ -150,6 +150,10 @@ protected:
bool m_noPaletteConstraintFlag;
bool m_noActConstraintFlag;
bool m_noLmcsConstraintFlag;
#if JVET_S0050_GCI
bool m_noExplicitScaleListConstraintFlag;
bool m_noVirtualBoundaryConstraintFlag;
#endif
bool m_bNoQtbttDualTreeIntraConstraintFlag;
bool m_noPartitionConstraintsOverrideConstraintFlag;
bool m_bNoSaoConstraintFlag;
......
......@@ -65,17 +65,30 @@ void ParcatHLSyntaxReader::parsePictureHeaderUpToPoc ( ParameterSetManager *para
uint32_t uiCode;
PPS* pps = NULL;
SPS* sps = NULL;
READ_FLAG(uiCode, "gdr_or_irap_pic_flag");
#if JVET_S0076_ASPECT1
uint32_t uiTmp;
READ_FLAG(uiTmp, "gdr_or_irap_pic_flag");
READ_FLAG(uiCode, "ph_non_ref_pic_flag");
if( uiTmp )
{
READ_FLAG( uiCode, "gdr_pic_flag" );
}
#else
READ_FLAG( uiCode, "gdr_or_irap_pic_flag" );
if (uiCode)
{
READ_FLAG(uiCode, "gdr_pic_flag");
}
#endif
READ_FLAG(uiCode, "ph_inter_slice_allowed_flag");
if (uiCode)
{
READ_FLAG(uiCode, "ph_intra_slice_allowed_flag");
}
#if !JVET_S0076_ASPECT1
READ_FLAG(uiCode, "non_reference_picture_flag");
#endif
// parameter sets
READ_UVLC(uiCode, "ph_pic_parameter_set_id");
pps = parameterSetManager->getPPS(uiCode);
......
......@@ -439,7 +439,11 @@ void AreaBuf<T>::removeWeightHighFreq(const AreaBuf<T>& other, const bool bClip,
else
{
#endif
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
Intermediate_Int normalizer = ((1 << 16) + (bcwWeight > 0 ? (bcwWeight >> 1) : -(bcwWeight >> 1))) / bcwWeight;
#else
int normalizer = ((1 << 16) + (bcwWeight > 0 ? (bcwWeight >> 1) : -(bcwWeight >> 1))) / bcwWeight;
#endif
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
Intermediate_Int weight0 = normalizer << log2WeightBase;
Intermediate_Int weight1 = bcwWeightOther * normalizer;
......@@ -451,8 +455,13 @@ void AreaBuf<T>::removeWeightHighFreq(const AreaBuf<T>& other, const bool bClip,
src += srcStride; \
dst += dstStride; \
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
#define REM_HF_OP_CLIP( ADDR ) dst[ADDR] = ClipPel<T>( T((dst[ADDR]*weight0 - src[ADDR]*weight1 + (1<<15))>>16), clpRng )
#define REM_HF_OP( ADDR ) dst[ADDR] = T((dst[ADDR]*weight0 - src[ADDR]*weight1 + (1<<15))>>16)
#else
#define REM_HF_OP_CLIP( ADDR ) dst[ADDR] = ClipPel<T>( (dst[ADDR]*weight0 - src[ADDR]*weight1 + (1<<15))>>16, clpRng )
#define REM_HF_OP( ADDR ) dst[ADDR] = (dst[ADDR]*weight0 - src[ADDR]*weight1 + (1<<15))>>16
#endif
if(bClip)
{
......
......@@ -114,8 +114,13 @@ public:
const TCoeff* pData = coeff + posX + posY * m_width;
const int diag = posX + posY;
int numPos = 0;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
TCoeff sumAbs = 0;
#define UPDATE(x) {TCoeff a=abs(x);sumAbs+=std::min(4+(a&1),a);numPos+=int(!!a);}
#else
int sumAbs = 0;
#define UPDATE(x) {int a=abs(x);sumAbs+=std::min(4+(a&1),a);numPos+=!!a;}
#endif
if( posX < m_width-1 )
{
UPDATE( pData[1] );
......@@ -139,7 +144,11 @@ public:
#undef UPDATE
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
int ctxOfs = int(std::min<TCoeff>((sumAbs+1)>>1, 3)) + ( diag < 2 ? 4 : 0 );
#else
int ctxOfs = std::min((sumAbs+1)>>1, 3) + ( diag < 2 ? 4 : 0 );
#endif
if( m_chType == CHANNEL_TYPE_LUMA )
{
......@@ -156,7 +165,11 @@ public:
int offset = 0;
if( m_tmplCpDiag != -1 )
{
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
offset = int(std::min<TCoeff>( m_tmplCpSum1, 4 )) + 1;
#else
offset = std::min( m_tmplCpSum1, 4 ) + 1;
#endif
offset += ( !m_tmplCpDiag ? ( m_chType == CHANNEL_TYPE_LUMA ? 15 : 5 ) : m_chType == CHANNEL_TYPE_LUMA ? m_tmplCpDiag < 3 ? 10 : ( m_tmplCpDiag < 10 ? 5 : 0 ) : 0 );
}
return uint8_t(offset);
......@@ -170,7 +183,11 @@ public:
const uint32_t posY = m_scan[scanPos].y;
const uint32_t posX = m_scan[scanPos].x;
const TCoeff* pData = coeff + posX + posY * m_width;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
TCoeff sum = 0;
#else
int sum = 0;
#endif
if (posX < m_width - 1)
{
sum += abs(pData[1]);
......@@ -191,7 +208,11 @@ public:
sum += abs(pData[m_width << 1]);
}
}
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
return unsigned(std::max<TCoeff>(std::min<TCoeff>(sum - 5 * baseLevel, 31), 0));
#else
return std::max(std::min(sum - 5 * baseLevel, 31), 0);
#endif
}
unsigned sigCtxIdAbsTS( int scanPos, const TCoeff* coeff )
......@@ -200,7 +221,11 @@ public:
const uint32_t posX = m_scan[scanPos].x;
const TCoeff* posC = coeff + posX + posY * m_width;
int numPos = 0;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
#define UPDATE(x) {TCoeff a=abs(x);numPos+=int(!!a);}
#else
#define UPDATE(x) {int a=abs(x);numPos+=!!a;}
#endif
if( posX > 0 )
{
UPDATE( posC[-1] );
......@@ -224,7 +249,11 @@ public:
const TCoeff* posC = coeff + posX + posY * m_width;
int numPos = 0;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
#define UPDATE(x) {TCoeff a=abs(x);numPos+=int(!!a);}
#else
#define UPDATE(x) {int a=abs(x);numPos+=!!a;}
#endif
if (bdpcm)
{
......@@ -308,41 +337,69 @@ public:
if (posX > 0)
{
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
rightPixel = int(data[-1]);
#else
rightPixel = data[-1];
#endif
}
if (posY > 0)
{
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
belowPixel = int(data[-(int)m_width]);
#else
belowPixel = data[-(int)m_width];
#endif
}
}
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
int deriveModCoeff(int rightPixel, int belowPixel, TCoeff absCoeff, int bdpcm = 0)
#else
int deriveModCoeff(int rightPixel, int belowPixel, int absCoeff, int bdpcm = 0)
#endif
{
if (absCoeff == 0)
return 0;
int pred1, absBelow = abs(belowPixel), absRight = abs(rightPixel);
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
int absCoeffMod = int(absCoeff);
#else
int absCoeffMod = absCoeff;
#endif
if (bdpcm == 0)
{
pred1 = std::max(absBelow, absRight);
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
if (absCoeffMod == pred1)
#else
if (absCoeff == pred1)
#endif
{
absCoeffMod = 1;
}
else
{
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
absCoeffMod = absCoeffMod < pred1 ? absCoeffMod + 1 : absCoeffMod;
#else
absCoeffMod = absCoeff < pred1 ? absCoeff + 1 : absCoeff;
#endif
}
}
return(absCoeffMod);
}
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
TCoeff decDeriveModCoeff(int rightPixel, int belowPixel, TCoeff absCoeff)
#else
int decDeriveModCoeff(int rightPixel, int belowPixel, int absCoeff)
#endif
{
if (absCoeff == 0)
......@@ -351,7 +408,11 @@ public:
int pred1, absBelow = abs(belowPixel), absRight = abs(rightPixel);
pred1 = std::max(absBelow, absRight);
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
TCoeff absCoeffMod;
#else
int absCoeffMod;
#endif
if (absCoeff == 1 && pred1 > 0)
{
......@@ -413,7 +474,11 @@ private:
int m_minSubPos;
int m_maxSubPos;
unsigned m_sigGroupCtxId;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
TCoeff m_tmplCpSum1;
#else
int m_tmplCpSum1;
#endif
int m_tmplCpDiag;
CtxSet m_sigFlagCtxSet[3];
CtxSet m_parFlagCtxSet;
......
......@@ -629,7 +629,11 @@ namespace DQIntern
Quantizer() {}
void dequantBlock ( const TransformUnit& tu, const ComponentID compID, const QpParam& cQP, CoeffBuf& recCoeff, bool enableScalingLists, int* piDequantCoef ) const;
void initQuantBlock ( const TransformUnit& tu, const ComponentID compID, const QpParam& cQP, const double lambda, int gValue );
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
inline void preQuantCoeff( const TCoeff absCoeff, PQData *pqData, TCoeff quanCoeff ) const;
#else
inline void preQuantCoeff( const TCoeff absCoeff, PQData *pqData, int quanCoeff ) const;
#endif
inline TCoeff getLastThreshold() const { return m_thresLast; }
inline TCoeff getSSbbThreshold() const { return m_thresSSbb; }
......@@ -682,7 +686,11 @@ namespace DQIntern
// quant parameters
m_QShift = QUANT_SHIFT - 1 + qpPer + transformShift;
m_QAdd = -( ( 3 << m_QShift ) >> 1 );
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
int invShift = IQUANT_SHIFT + 1 - qpPer - transformShift;
#else
Intermediate_Int invShift = IQUANT_SHIFT + 1 - qpPer - transformShift;
#endif
m_QScale = g_quantScales[needsSqrt2ScaleAdjustment?1:0][ qpRem ];
const unsigned qIdxBD = std::min<unsigned>( maxLog2TrDynamicRange + 1, 8*sizeof(Intermediate_Int) + invShift - IQUANT_SHIFT - 1 );
m_maxQIdx = ( 1 << (qIdxBD-1) ) - 4;
......@@ -769,7 +777,11 @@ namespace DQIntern
}
}
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
inline void Quantizer::preQuantCoeff(const TCoeff absCoeff, PQData *pqData, TCoeff quanCoeff) const
#else
inline void Quantizer::preQuantCoeff(const TCoeff absCoeff, PQData *pqData, int quanCoeff) const
#endif
{
int64_t scaledOrg = int64_t( absCoeff ) * quanCoeff;
TCoeff qIdx = std::max<TCoeff>( 1, std::min<TCoeff>( m_maxQIdx, TCoeff( ( scaledOrg + m_QAdd ) >> m_QShift ) ) );
......@@ -886,14 +898,22 @@ namespace DQIntern
rdCostA += m_coeffFracBits.bits[ pqDataA.absLevel ];
else
{
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
const TCoeff value = ( pqDataA.absLevel - 4 ) >> 1;
#else
const unsigned value = ( pqDataA.absLevel - 4 ) >> 1;
#endif
rdCostA += m_coeffFracBits.bits[ pqDataA.absLevel - ( value << 1 ) ] + goRiceTab[ value < RICEMAX ? value : RICEMAX - 1 ];
}
if( pqDataB.absLevel < 4 )
rdCostB += m_coeffFracBits.bits[ pqDataB.absLevel ];
else
{
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
const TCoeff value = ( pqDataB.absLevel - 4 ) >> 1;
#else
const unsigned value = ( pqDataB.absLevel - 4 ) >> 1;
#endif
rdCostB += m_coeffFracBits.bits[ pqDataB.absLevel - ( value << 1 ) ] + goRiceTab[ value < RICEMAX ? value : RICEMAX - 1 ];
}
if( spt == SCAN_ISCSBB )
......@@ -954,7 +974,11 @@ namespace DQIntern
}
else
{
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
const TCoeff value = (pqData.absLevel - 4) >> 1;
#else
const unsigned value = (pqData.absLevel - 4) >> 1;
#endif
rdCost += m_coeffFracBits.bits[pqData.absLevel - (value << 1)] + g_goRiceBits[m_goRicePar][value < RICEMAX ? value : RICEMAX-1];
}
if( rdCost < decision.rdCost )
......@@ -1030,7 +1054,11 @@ namespace DQIntern
m_goRicePar = prvState->m_goRicePar;
if( m_remRegBins >= 4 )
{
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
m_remRegBins -= (decision.absLevel < 2 ? (unsigned)decision.absLevel : 3);
#else
m_remRegBins -= (decision.absLevel < 2 ? decision.absLevel : 3);
#endif
}
::memcpy( m_absLevelsAndCtxInit, prvState->m_absLevelsAndCtxInit, 48*sizeof(uint8_t) );
}
......@@ -1039,7 +1067,11 @@ namespace DQIntern
m_numSigSbb = 1;
m_refSbbCtxId = -1;
int ctxBinSampleRatio = (scanInfo.chType == CHANNEL_TYPE_LUMA) ? MAX_TU_LEVEL_CTX_CODED_BIN_CONSTRAINT_LUMA : MAX_TU_LEVEL_CTX_CODED_BIN_CONSTRAINT_CHROMA;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
m_remRegBins = (effWidth * effHeight *ctxBinSampleRatio) / 16 - (decision.absLevel < 2 ? (unsigned)decision.absLevel : 3);
#else
m_remRegBins = (effWidth * effHeight *ctxBinSampleRatio) / 16 - (decision.absLevel < 2 ? decision.absLevel : 3);
#endif
::memset( m_absLevelsAndCtxInit, 0, 48*sizeof(uint8_t) );
}
......@@ -1299,8 +1331,13 @@ namespace DQIntern
void dequant ( const TransformUnit& tu, CoeffBuf& recCoeff, const ComponentID compID, const QpParam& cQP, bool enableScalingLists, int* quantCoeff );
private:
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
void xDecideAndUpdate ( const TCoeff absCoeff, const ScanInfo& scanInfo, bool zeroOut, TCoeff quantCoeff);
void xDecide ( const ScanPosType spt, const TCoeff absCoeff, const int lastOffset, Decision* decisions, bool zeroOut, TCoeff quantCoeff );
#else
void xDecideAndUpdate ( const TCoeff absCoeff, const ScanInfo& scanInfo, bool zeroOut, int quantCoeff);
void xDecide ( const ScanPosType spt, const TCoeff absCoeff, const int lastOffset, Decision* decisions, bool zeroOut, int quantCoeff );
#endif
private:
CommonCtx m_commonCtx;
......@@ -1338,7 +1375,11 @@ namespace DQIntern
#undef DINIT
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
void DepQuant::xDecide( const ScanPosType spt, const TCoeff absCoeff, const int lastOffset, Decision* decisions, bool zeroOut, TCoeff quanCoeff)
#else
void DepQuant::xDecide( const ScanPosType spt, const TCoeff absCoeff, const int lastOffset, Decision* decisions, bool zeroOut, int quanCoeff)
#endif
{
::memcpy( decisions, startDec, 8*sizeof(Decision) );
......@@ -1372,7 +1413,11 @@ namespace DQIntern
m_startState.checkRdCostStart( lastOffset, pqData[2], decisions[2] );
}
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
void DepQuant::xDecideAndUpdate( const TCoeff absCoeff, const ScanInfo& scanInfo, bool zeroOut, TCoeff quantCoeff )
#else
void DepQuant::xDecideAndUpdate( const TCoeff absCoeff, const ScanInfo& scanInfo, bool zeroOut, int quantCoeff )
#endif
{
Decision* decisions = m_trellis[ scanInfo.scanIdx ];
......
......@@ -303,11 +303,13 @@ void IntraPrediction::xPredIntraPlanar( const CPelBuf &pSrc, PelBuf &pDst )
const uint32_t offset = 1 << (log2W + log2H);
// Get left and above reference column and row
CHECK(width > MAX_CU_SIZE, "width greater than limit");
for( int k = 0; k < width + 1; k++ )
{
topRow[k] = pSrc.at( k + 1, 0 );
}
CHECK(height > MAX_CU_SIZE, "height greater than limit");
for( int k = 0; k < height + 1; k++ )
{
leftColumn[k] = pSrc.at(k + 1, 1);
......
......@@ -4357,7 +4357,10 @@ bool operator == (const ConstraintInfo& op1, const ConstraintInfo& o
if (op1.m_noPaletteConstraintFlag != op2.m_noPaletteConstraintFlag ) return false;
if (op1.m_noActConstraintFlag != op2.m_noActConstraintFlag ) return false;
if (op1.m_noLmcsConstraintFlag != op2.m_noLmcsConstraintFlag ) return false;
#if JVET_S0050_GCI
if (op1.m_noExplicitScaleListConstraintFlag != op2.m_noExplicitScaleListConstraintFlag ) return false;
if (op1.m_noVirtualBoundaryConstraintFlag != op2.m_noVirtualBoundaryConstraintFlag ) return false;
#endif
if( op1.m_noQtbttDualTreeIntraConstraintFlag != op2.m_noQtbttDualTreeIntraConstraintFlag ) return false;
if( op1.m_noPartitionConstraintsOverrideConstraintFlag != op2.m_noPartitionConstraintsOverrideConstraintFlag ) return false;
if( op1.m_noSaoConstraintFlag != op2.m_noSaoConstraintFlag ) return false;
......@@ -4428,6 +4431,29 @@ bool operator != (const ProfileTierLevel& op1, const ProfileTierLeve
return !(op1 == op2);
}
#if JVET_Q0406_CABAC_ZERO
bool Slice::isLastSliceInSubpic()
{
CHECK(m_pcPPS == NULL, "PPS pointer not initialized");
int lastCTUAddrInSlice = m_sliceMap.getCtuAddrList().back();
if (m_pcPPS->getNumSubPics() > 1)
{
const SubPic& subpic = m_pcPPS->getSubPic(m_pcPPS->getSubPicIdxFromSubPicId(getSliceSubPicId()));
return subpic.isLastCTUinSubPic(lastCTUAddrInSlice);
}
else
{
const CodingStructure *cs = m_pcPic->cs;
const PreCalcValues* pcv = cs->pcv;
const uint32_t picSizeInCtus = pcv->heightInCtus * pcv->widthInCtus;
return lastCTUAddrInSlice == (picSizeInCtus-1);
}
}
#endif
#if ENABLE_TRACING
void xTraceVPSHeader()
{
......
......@@ -267,6 +267,10 @@ class ConstraintInfo
bool m_noActConstraintFlag;
bool m_noLmcsConstraintFlag;
#if JVET_S0050_GCI
bool m_noExplicitScaleListConstraintFlag;
bool m_noVirtualBoundaryConstraintFlag;
#endif
bool m_noQtbttDualTreeIntraConstraintFlag;
bool m_noPartitionConstraintsOverrideConstraintFlag;
bool m_noSaoConstraintFlag;
......@@ -339,7 +343,10 @@ public:
, m_noPaletteConstraintFlag(false)
, m_noActConstraintFlag(false)
, m_noLmcsConstraintFlag(false)
#if JVET_S0050_GCI
, m_noExplicitScaleListConstraintFlag(false)
, m_noVirtualBoundaryConstraintFlag(false)
#endif
, m_noQtbttDualTreeIntraConstraintFlag(false)
, m_noPartitionConstraintsOverrideConstraintFlag(false)
, m_noSaoConstraintFlag (false)
......@@ -450,7 +457,12 @@ public:
void setNoActConstraintFlag(bool b) { m_noActConstraintFlag = b; }
bool getNoLmcsConstraintFlag() const { return m_noLmcsConstraintFlag; }
void