diff --git a/source/Lib/CommonLib/InterPrediction.cpp b/source/Lib/CommonLib/InterPrediction.cpp index ef3def1137c3064730612ba1195b4bf98fc00f65..11be9dc11378a95b244d3338baeeeeefb6dbdca4 100644 --- a/source/Lib/CommonLib/InterPrediction.cpp +++ b/source/Lib/CommonLib/InterPrediction.cpp @@ -705,9 +705,8 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio int shiftHor = MV_FRACTIONAL_BITS_INTERNAL + ::getComponentScaleX(compID, chFmt); int shiftVer = MV_FRACTIONAL_BITS_INTERNAL + ::getComponentScaleY(compID, chFmt); - bool wrapRef = false; - Mv mv( _mv ); + Mv mv(_mv); if( !isIBC && pu.cs->sps->getWrapAroundEnabledFlag() ) { #if JVET_O1164_PS @@ -818,7 +817,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio m_if.filterVer(compID, (Pel*)tmpBuf.buf + ((vFilterSize >> 1) - 1) * tmpBuf.stride, tmpBuf.stride, dstBuf.buf, dstBuf.stride, backupWidth, backupHeight, yFrac, false, rndRes, chFmt, clpRng, bilinearMC, bilinearMC); #endif } - JVET_J0090_SET_CACHE_ENABLE( srcPadStride == 0 ); // Enabled only in non-DMVR process, In DMVR process, srcPadStride is always non-zero if (bioApplied && compID == COMPONENT_Y) { @@ -1372,7 +1370,7 @@ void InterPrediction::applyBiOptFlow(const PredictionUnit &pu, const CPelUnitBuf { for (int xu = 0; xu < xUnit; xu++) { -#if !JVET_O0055_INT_DMVR_DIS_BDOF +#if !JVET_O0055_INT_DMVR_DIS_BDOF if (m_bioPredSubBlkDist[yu*xUnit + xu] < m_bioSubBlkDistThres) { srcY0Temp = srcY0 + (stridePredMC + 1) + ((yu*src0Stride + xu) << 2); @@ -1457,7 +1455,7 @@ bool InterPrediction::xCalcBiPredSubBlkDist(const PredictionUnit &pu, const Pel* const int yUnit = (height >> 2); m_bioDistThres = (shift <= 5) ? (((32 << (clipbd - 8))*width*height) >> (5 - shift)) : (((32 << (clipbd - 8))*width*height) << (shift - 5)); - m_bioSubBlkDistThres = (shift <= 5) ? (((64 << (clipbd - 8)) << 4) >> (5 - shift)) : (((64 << (clipbd - 8)) << 4) << (shift - 5)); + m_bioSubBlkDistThres = (shift <= 5) ? (((64 << (clipbd - 8)) << 4) >> (5 - shift)) : (((64 << (clipbd - 8)) << 4) << (shift - 5)); m_bioDistThres >>= distortionShift; m_bioSubBlkDistThres >>= distortionShift; @@ -1547,7 +1545,7 @@ void InterPrediction::xWeightedAverage(const PredictionUnit& pu, const CPelUnitB const Pel* pSrcY0 = m_filteredBlockTmp[2][COMPONENT_Y] + 2 * src0Stride + 2; const Pel* pSrcY1 = m_filteredBlockTmp[3][COMPONENT_Y] + 2 * src1Stride + 2; -#if JVET_O0055_INT_DMVR_DIS_BDOF +#if JVET_O0055_INT_DMVR_DIS_BDOF bool bioEnabled = true; #else bool bioEnabled = xCalcBiPredSubBlkDist(pu, pSrcY0, src0Stride, pSrcY1, src1Stride, clipBitDepths); @@ -1727,7 +1725,7 @@ void InterPrediction::xApplyBiPROF(const PredictionUnit &pu, const CPelBuf& pcYu Pel* gY0 = gradYExt0.bufAt(PROF_BORDER_EXT_W, PROF_BORDER_EXT_H); Pel* gX1 = gradXExt1.bufAt(PROF_BORDER_EXT_W, PROF_BORDER_EXT_H); Pel* gY1 = gradYExt1.bufAt(PROF_BORDER_EXT_W, PROF_BORDER_EXT_H); - + int *dMvX0 = m_dMvBuf[REF_PIC_LIST_0]; int *dMvY0 = m_dMvBuf[REF_PIC_LIST_0] + 16; int *dMvX1 = m_dMvBuf[REF_PIC_LIST_1]; @@ -1897,7 +1895,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu { #if JVET_O0108_DIS_DMVR_BDOF_CIIP CHECK(predBufWOBIO != NULL, "the case should not happen!"); -#endif +#endif xSubPuMC( pu, predBuf, eRefPicList ); } else if( xCheckIdenticalMotion( pu ) ) @@ -2143,7 +2141,7 @@ void InterPrediction::xPrefetch(PredictionUnit& pu, PelUnitBuf &pcPad, RefPicLis -(((filtersize >> 1) - 1) << mvshiftTemp)); bool wrapRef = false; #if JVET_O1164_PS - if( pu.cs->sps->getWrapAroundEnabledFlag() ) + if( pu.cs->sps->getWrapAroundEnabledFlag() ) { wrapRef = wrapClipMv( cMv, pu.blocks[0].pos(), pu.blocks[0].size(), pu.cs->sps, pu.cs->pps ); } @@ -2154,7 +2152,7 @@ void InterPrediction::xPrefetch(PredictionUnit& pu, PelUnitBuf &pcPad, RefPicLis #else if( pu.cs->sps->getWrapAroundEnabledFlag() ) { - wrapRef = wrapClipMv( cMv, pu.blocks[0].pos(), pu.blocks[0].size(), pu.cs->sps); + wrapRef = wrapClipMv( cMv, pu.blocks[0].pos(), pu.blocks[0].size(), pu.cs->sps); } else { @@ -2214,7 +2212,7 @@ void InterPrediction::xPrefetchPad(PredictionUnit& pu, PelUnitBuf &pcPad, RefPic cMv += Mv(-(((filtersize >> 1) - 1) << mvshiftTemp), -(((filtersize >> 1) - 1) << mvshiftTemp)); bool wrapRef = false; - if( pu.cs->sps->getWrapAroundEnabledFlag() ) + if( pu.cs->sps->getWrapAroundEnabledFlag() ) { #if JVET_O1164_PS wrapRef = wrapClipMv( cMv, pu.blocks[0].pos(), pu.blocks[0].size(), pu.cs->sps, pu.cs->pps ); @@ -2222,7 +2220,8 @@ void InterPrediction::xPrefetchPad(PredictionUnit& pu, PelUnitBuf &pcPad, RefPic wrapRef = wrapClipMv( cMv, pu.blocks[0].pos(), pu.blocks[0].size(), pu.cs->sps); #endif } - else { + else + { #if JVET_O1164_PS clipMv( cMv, pu.lumaPos(), pu.lumaSize(), *pu.cs->sps, *pu.cs->pps ); #else @@ -2410,7 +2409,7 @@ void InterPrediction::xFinalPaddedMCForDMVR(PredictionUnit& pu, PelUnitBuf &pcYu } for (int compID = 0; compID < MAX_NUM_COMPONENT; compID++) { -#if JVET_O0297_DMVR_PADDING // For Dec speedup +#if JVET_O0297_DMVR_PADDING // For Dec speedup Pel *srcBufPelPtr = NULL; int pcPadstride = 0; if (blockMoved || (compID == 0)) @@ -2533,7 +2532,7 @@ void InterPrediction::xinitMC(PredictionUnit& pu, const ClpRngs &clpRngs) m_biLinearBufStride #else (MAX_CU_SIZE + (2 * DMVR_NUM_ITERATION)) -#endif +#endif , pu.lwidth() + (2 * DMVR_NUM_ITERATION), pu.lheight() + (2 * DMVR_NUM_ITERATION))); #if JVET_O1164_RPR @@ -2724,7 +2723,7 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con { minCost = xDMVRCost(clpRngs.comp[COMPONENT_Y].bd, addrL0, m_biLinearBufStride, addrL1, m_biLinearBufStride, dx, dy); #if JVET_O0590_REDUCE_DMVR_ORIG_MV_COST - minCost -= (minCost >>2); + minCost -= (minCost >>2); #endif if (minCost < (dx * dy)) { @@ -2750,7 +2749,7 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con pSADsArray += ((deltaMV[1] * (((2 * DMVR_NUM_ITERATION) + 1))) + deltaMV[0]); } -#if JVET_O0055_INT_DMVR_DIS_BDOF +#if JVET_O0055_INT_DMVR_DIS_BDOF bioAppliedType[num] = (minCost < bioEnabledThres) ? false : bioApplied; #endif totalDeltaMV[0] = (totalDeltaMV[0] << mvShift); @@ -2783,7 +2782,7 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con xPad(subPu, m_cYuvRefBuffDMVRL1, REF_PIC_LIST_1); } #endif - + int dstStride[MAX_NUM_COMPONENT] = { pcYuvDst.bufs[COMPONENT_Y].stride, pcYuvDst.bufs[COMPONENT_Cb].stride, pcYuvDst.bufs[COMPONENT_Cr].stride }; subPu.mv[0] = mergeMv[REF_PIC_LIST_0] + pu.mvdL0SubPu[num]; subPu.mv[1] = mergeMv[REF_PIC_LIST_1] - pu.mvdL0SubPu[num]; @@ -2791,7 +2790,7 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con subPu.mv[0].clipToStorageBitDepth(); subPu.mv[1].clipToStorageBitDepth(); -#if JVET_O0055_INT_DMVR_DIS_BDOF +#if JVET_O0055_INT_DMVR_DIS_BDOF xFinalPaddedMCForDMVR(subPu, srcPred0, srcPred1, m_cYuvRefBuffDMVRL0, m_cYuvRefBuffDMVRL1, bioAppliedType[num], mergeMv #else xFinalPaddedMCForDMVR(subPu, srcPred0, srcPred1, m_cYuvRefBuffDMVRL0, m_cYuvRefBuffDMVRL1, bioApplied, mergeMv @@ -2815,10 +2814,10 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con #endif subPredBuf.bufs[COMPONENT_Cr].buf = pcYuvDst.bufs[COMPONENT_Cr].buf + (xStart >> scaleX) + ((yStart >> scaleY) * dstStride[COMPONENT_Cr]); -#if JVET_O0055_INT_DMVR_DIS_BDOF +#if JVET_O0055_INT_DMVR_DIS_BDOF xWeightedAverage(subPu, srcPred0, srcPred1, subPredBuf, subPu.cu->slice->getSPS()->getBitDepths(), subPu.cu->slice->clpRngs(), bioAppliedType[num]); #else - xWeightedAverage(subPu, srcPred0, srcPred1, subPredBuf, subPu.cu->slice->getSPS()->getBitDepths(), subPu.cu->slice->clpRngs(), bioApplied); + xWeightedAverage(subPu, srcPred0, srcPred1, subPredBuf, subPu.cu->slice->getSPS()->getBitDepths(), subPu.cu->slice->clpRngs(), bioApplied); #endif #endif num++; @@ -2859,7 +2858,7 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con subPu.mv[1].clipToStorageBitDepth(); m_cYuvRefBuffSubCuDMVRL0 = m_cYuvRefBuffDMVRL0.subBuf(UnitAreaRelative(pu, subPu)); m_cYuvRefBuffSubCuDMVRL1 = m_cYuvRefBuffDMVRL1.subBuf(UnitAreaRelative(pu, subPu)); -#if JVET_O0055_INT_DMVR_DIS_BDOF +#if JVET_O0055_INT_DMVR_DIS_BDOF xFinalPaddedMCForDMVR(subPu, srcPred0, srcPred1, m_cYuvRefBuffSubCuDMVRL0, m_cYuvRefBuffSubCuDMVRL1, bioAppliedType[num], mergeMv); #else xFinalPaddedMCForDMVR(subPu, srcPred0, srcPred1, m_cYuvRefBuffSubCuDMVRL0, m_cYuvRefBuffSubCuDMVRL1, bioApplied, mergeMv); @@ -2874,7 +2873,7 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con scaleY = getComponentScaleY(COMPONENT_Cr, pu.chromaFormat); subPredBuf.bufs[COMPONENT_Cr].buf = pcYuvDst.bufs[COMPONENT_Cr].buf + (xStart >> scaleX) + ((yStart >> scaleY) * dstStride[COMPONENT_Cr]); -#if JVET_O0055_INT_DMVR_DIS_BDOF +#if JVET_O0055_INT_DMVR_DIS_BDOF xWeightedAverage(subPu, srcPred0, srcPred1, subPredBuf, subPu.cu->slice->getSPS()->getBitDepths(), subPu.cu->slice->clpRngs(), bioAppliedType[num]); #else xWeightedAverage(subPu, srcPred0, srcPred1, subPredBuf, subPu.cu->slice->getSPS()->getBitDepths(), subPu.cu->slice->clpRngs(), bioApplied); diff --git a/source/Lib/CommonLib/InterpolationFilter.h b/source/Lib/CommonLib/InterpolationFilter.h index 777a53affd56576431c0eea7ed4c8a6c5c172b0b..abb6f2ded1b6472de1d31267e852e083dac0c341 100644 --- a/source/Lib/CommonLib/InterpolationFilter.h +++ b/source/Lib/CommonLib/InterpolationFilter.h @@ -55,7 +55,7 @@ */ class InterpolationFilter { - static const TFilterCoeff m_lumaFilter4x4[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA]; + static const TFilterCoeff m_lumaFilter4x4[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA]; #if JVET_O1164_RPR public: #endif diff --git a/source/Lib/CommonLib/Mv.h b/source/Lib/CommonLib/Mv.h index bdc88c13ff1e4f4f8da46c8b5cdb508134e98c10..250244e753e3e91a7dae03e4505958011a7fbb87 100644 --- a/source/Lib/CommonLib/Mv.h +++ b/source/Lib/CommonLib/Mv.h @@ -293,8 +293,8 @@ void clipMv ( Mv& rcMv, const struct Position& pos, #endif ); -bool wrapClipMv( Mv& rcMv, const Position& pos, - const struct Size& size, +bool wrapClipMv( Mv& rcMv, const Position& pos, + const struct Size& size, const SPS *sps #if JVET_O1164_PS , const PPS* pps diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp index b54e8fe51110e19c3360dc28686a4d715ad04457..6f6f9bd19c5462dd0550575d24c735cac8406a3b 100755 --- a/source/Lib/CommonLib/UnitTools.cpp +++ b/source/Lib/CommonLib/UnitTools.cpp @@ -1142,7 +1142,7 @@ bool PU::addMergeHMVPCand(const CodingStructure &cs, MergeCtx& mrgCtx, bool isCa #if JVET_O0057_ALTHPELIF if (cnt < maxNumMergeCandMin1) { - mrgCtx.useAltHpelIf[cnt] = false; + mrgCtx.useAltHpelIf[cnt] = false; } #endif return false; @@ -4587,18 +4587,18 @@ bool CU::isGBiIdxCoded( const CodingUnit &cu ) { if( cu.firstPU->interDir == 3 ) { - WPScalingParam *wp0; - WPScalingParam *wp1; - int refIdx0 = cu.firstPU->refIdx[REF_PIC_LIST_0]; - int refIdx1 = cu.firstPU->refIdx[REF_PIC_LIST_1]; - - cu.cs->slice->getWpScaling(REF_PIC_LIST_0, refIdx0, wp0); - cu.cs->slice->getWpScaling(REF_PIC_LIST_1, refIdx1, wp1); - if ((wp0[COMPONENT_Y].bPresentFlag || wp0[COMPONENT_Cb].bPresentFlag || wp0[COMPONENT_Cr].bPresentFlag + WPScalingParam *wp0; + WPScalingParam *wp1; + int refIdx0 = cu.firstPU->refIdx[REF_PIC_LIST_0]; + int refIdx1 = cu.firstPU->refIdx[REF_PIC_LIST_1]; + + cu.cs->slice->getWpScaling(REF_PIC_LIST_0, refIdx0, wp0); + cu.cs->slice->getWpScaling(REF_PIC_LIST_1, refIdx1, wp1); + if ((wp0[COMPONENT_Y].bPresentFlag || wp0[COMPONENT_Cb].bPresentFlag || wp0[COMPONENT_Cr].bPresentFlag || wp1[COMPONENT_Y].bPresentFlag || wp1[COMPONENT_Cb].bPresentFlag || wp1[COMPONENT_Cr].bPresentFlag)) - { - return false; - } + { + return false; + } return true; } } diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index 650ff4d3e361f282df59f871d0ecc9593b100b72..c6b94e7df75ea49d228150809c85271b5a73ba65 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -2761,24 +2761,24 @@ void CABACReader::mmvd_merge_idx(PredictionUnit& pu) int var0 = 0; if (pu.cs->slice->getMaxNumMergeCand() > 1) - { + { static_assert(MMVD_BASE_MV_NUM == 2, ""); var0 = m_BinDecoder.decodeBin(Ctx::MmvdMergeIdx()); } DTRACE(g_trace_ctx, D_SYNTAX, "base_mvp_idx() base_mvp_idx=%d\n", var0); int numCandminus1_step = MMVD_REFINE_STEP - 1; int var1 = 0; - if (m_BinDecoder.decodeBin(Ctx::MmvdStepMvpIdx())) + if (m_BinDecoder.decodeBin(Ctx::MmvdStepMvpIdx())) + { + var1++; + for (; var1 < numCandminus1_step; var1++) { - var1++; - for (; var1 < numCandminus1_step; var1++) + if (!m_BinDecoder.decodeBinEP()) { - if (!m_BinDecoder.decodeBinEP()) - { - break; - } + break; } } + } DTRACE(g_trace_ctx, D_SYNTAX, "MmvdStepMvpIdx() MmvdStepMvpIdx=%d\n", var1); int var2 = 0; if (m_BinDecoder.decodeBinEP()) @@ -3394,17 +3394,17 @@ void CABACReader::transform_unit( TransformUnit& tu, CUCtx& cuCtx, ChromaCbfs& c #endif #if JVET_O0050_LOCAL_DUAL_TREE (!tu.cu->isSepTree() || isLuma(tu.chType)) ) -#else +#else (!CS::isDualITree(*tu.cs) || isLuma(tu.chType)) ) #endif { if( cu.cs->pps->getUseDQP() && !cuCtx.isDQPCoded ) { - cu_qp_delta(cu, cuCtx.qp, cu.qp); - cuCtx.qp = cu.qp; - cuCtx.isDQPCoded = true; - } + cu_qp_delta(cu, cuCtx.qp, cu.qp); + cuCtx.qp = cu.qp; + cuCtx.isDQPCoded = true; } + } #if JVET_O1168_CU_CHROMA_QP_OFFSET if (cu.cs->slice->getUseChromaQpAdj() && cbfChroma && !cuCtx.isChromaQpAdjCoded) #else @@ -3445,10 +3445,10 @@ void CABACReader::transform_unit( TransformUnit& tu, CUCtx& cuCtx, ChromaCbfs& c #else residual_coding( tu, compID ); #endif - } } } } +} void CABACReader::cu_qp_delta( CodingUnit& cu, int predQP, int8_t& qp ) { diff --git a/source/Lib/DecoderLib/DecCu.cpp b/source/Lib/DecoderLib/DecCu.cpp index b9b8f97b7b0c29cdee7889c0c6ef3699a3db5b9f..16acc44e1de937afc187ceba7f6f505ab1184dc7 100644 --- a/source/Lib/DecoderLib/DecCu.cpp +++ b/source/Lib/DecoderLib/DecCu.cpp @@ -262,7 +262,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID ) } else #endif - m_pcIntraPred->initIntraPatternChType( *tu.cu, area); + m_pcIntraPred->initIntraPatternChType(*tu.cu, area); #endif //===== get prediction signal ===== @@ -292,7 +292,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID ) } else #endif - m_pcIntraPred->predIntraAng( compID, piPred, pu ); + m_pcIntraPred->predIntraAng(compID, piPred, pu); } } const Slice &slice = *cs.slice; @@ -1089,7 +1089,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu ) const int cuPelY = pu.Y().y; int roiWidth = pu.lwidth(); int roiHeight = pu.lheight(); -#if !JVET_O1170_CHECK_BV_AT_DECODER +#if !JVET_O1170_CHECK_BV_AT_DECODER #if JVET_O1164_PS const int picWidth = pu.cs->slice->getPPS()->getPicWidthInLumaSamples(); const int picHeight = pu.cs->slice->getPPS()->getPicHeightInLumaSamples(); diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp index 4e8c8886d30dd4f0c33d82edb83248a453a52281..61bd81ff1143220157771c17caf68f6ddf73e987 100644 --- a/source/Lib/DecoderLib/DecLib.cpp +++ b/source/Lib/DecoderLib/DecLib.cpp @@ -640,7 +640,7 @@ void DecLib::finishPicture(int& poc, PicList*& rpcListPic, MsgLevel msgl ) for (int iRefList = 0; iRefList < 2; iRefList++) { msg( msgl, "[L%d ", iRefList); - for( int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx( RefPicList( iRefList ) ); iRefIndex++ ) + for (int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++) { #if RPR_CTC_PRINT int xScale, yScale; diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 8a0d5009aba5f3b0cddbd44d7a7ca61139a57cc9..1fe4f556917106ea6f5dc54e40017ae0d4caff5c 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -440,7 +440,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana READ_FLAG( uiCode, "transquant_bypass_enabled_flag"); pcPPS->setTransquantBypassEnabledFlag(uiCode ? true : false); - + READ_FLAG( uiCode, "single_tile_in_pic_flag" ); pcPPS->setSingleTileInPicFlag(uiCode == 1); if(!pcPPS->getSingleTileInPicFlag()) @@ -916,7 +916,7 @@ void HLSyntaxReader::parseAlfAps( APS* aps ) #else READ_FLAG(code, "alf_luma_clip"); param.nonLinearFlag[CHANNEL_TYPE_CHROMA] = code ? true : false; - alfFilter(param, true); + alfFilter(param, true); #endif } aps->setAlfAPSParam(param); @@ -1148,7 +1148,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); CHECK(uiCode > 12, "Invalid code"); - READ_FLAG( uiCode, "sps_idr_rpl_present_flag" ); pcSPS->setIDRRefParamListPresent( (bool) uiCode); + READ_FLAG( uiCode, "sps_idr_rpl_present_flag" ); pcSPS->setIDRRefParamListPresent( (bool) uiCode); // KJS: Marakech decision: sub-layers added back uint32_t subLayerOrderingInfoPresentFlag; READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); @@ -1314,8 +1314,8 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) std::vector<int> deltaQpOutVal(chromaQpMappingTableParams.getNumPtsInCQPTableMinus1(i) + 1); for (int j = 0; j <= chromaQpMappingTableParams.getNumPtsInCQPTableMinus1(i); j++) { - READ_UVLC(uiCode, "delta_qp_in_val_minus1"); deltaQpInValMinus1[j] = uiCode; - READ_UVLC(uiCode, "delta_qp_out_val"); deltaQpOutVal[j] = uiCode; + READ_UVLC(uiCode, "delta_qp_in_val_minus1"); deltaQpInValMinus1[j] = uiCode; + READ_UVLC(uiCode, "delta_qp_out_val"); deltaQpOutVal[j] = uiCode; } chromaQpMappingTableParams.setDeltaQpInValMinus1(i, deltaQpInValMinus1); chromaQpMappingTableParams.setDeltaQpOutVal(i, deltaQpOutVal); @@ -1329,7 +1329,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) READ_FLAG( uiCode, "sps_weighted_pred_flag" ); pcSPS->setUseWP( uiCode ? true : false ); READ_FLAG( uiCode, "sps_weighted_bipred_flag" ); pcSPS->setUseWPBiPred( uiCode ? true : false ); #endif - + READ_FLAG( uiCode, "sps_sao_enabled_flag" ); pcSPS->setSAOEnabledFlag ( uiCode ? true : false ); READ_FLAG( uiCode, "sps_alf_enabled_flag" ); pcSPS->setALFEnabledFlag ( uiCode ? true : false ); @@ -1358,7 +1358,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) #if !JVET_O1164_PS if( pcSPS->getCTUSize() + 2*(1 << pcSPS->getLog2MinCodingBlockSize()) <= pcSPS->getPicWidthInLumaSamples() ) - { + { #endif READ_FLAG(uiCode, "sps_ref_wraparound_enabled_flag"); pcSPS->setWrapAroundEnabledFlag( uiCode ? true : false ); @@ -1368,7 +1368,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) } #if !JVET_O1164_PS } - else + else { pcSPS->setWrapAroundEnabledFlag(0); } @@ -1439,7 +1439,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) { READ_FLAG( uiCode, "sps_fpel_mmvd_enabled_flag" ); pcSPS->setFpelMmvdEnabledFlag ( uiCode != 0 ); } -#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG +#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG if (pcSPS->getBDOFEnabledFlag() || pcSPS->getUseDMVR()) { READ_FLAG(uiCode, "sps_bdof_dmvr_slice_level_present_flag"); pcSPS->setBdofDmvrSlicePresentFlag(uiCode != 0); @@ -1583,8 +1583,8 @@ void HLSyntaxReader::parseDPS(DPS* dps) #endif uint32_t symbol; - READ_CODE( 4, symbol, "dps_decoding_parameter_set_id" ); - CHECK(symbol == 0, "dps_decoding_parameter_set_id equal to zero is reserved and should not be use in a bitstream"); + READ_CODE( 4, symbol, "dps_decoding_parameter_set_id" ); + CHECK(symbol == 0, "dps_decoding_parameter_set_id equal to zero is reserved and should not be use in a bitstream"); dps->setDecodingParameterSetId( symbol ); READ_CODE( 3, symbol, "dps_max_sub_layers_minus1" ); dps->setMaxSubLayersMinus1( symbol ); @@ -1593,7 +1593,7 @@ void HLSyntaxReader::parseDPS(DPS* dps) ProfileTierLevel ptl; parseProfileTierLevel(&ptl, dps->getMaxSubLayersMinus1()); dps->setProfileTierLevel(ptl); - + READ_FLAG( symbol, "dps_extension_flag" ); if (symbol) { @@ -1954,8 +1954,8 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para #endif apsId[i] = uiCode; } - - + + pcSlice->setAlfAPSs(apsId); #if JVET_O0616_400_CHROMA_SUPPORT if (bChroma) @@ -1964,7 +1964,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para #if JVET_O0491_HLS_CLEANUP READ_CODE(2, uiCode, "slice_alf_chroma_idc"); alfChromaIdc = uiCode; #else - alfChromaIdc = truncatedUnaryEqProb(3); //alf_chroma_idc + alfChromaIdc = truncatedUnaryEqProb(3); //alf_chroma_idc #endif #if JVET_O0616_400_CHROMA_SUPPORT } @@ -2132,7 +2132,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para { RefPicList eRefPicList = ( iNumRef ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); for ( int iRefIdx=0 ; iRefIdx<pcSlice->getNumRefIdx(eRefPicList) ; iRefIdx++ ) - { + { pcSlice->getWpScaling(eRefPicList, iRefIdx, wp); wp[0].bPresentFlag = false; wp[1].bPresentFlag = false; @@ -2312,11 +2312,11 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para } #else READ_SVLC(iCode, "slice_joint_cbcr_qp_offset"); - pcSlice->setSliceChromaQpDelta(JOINT_CbCr, iCode ); - CHECK( pcSlice->getSliceChromaQpDelta(JOINT_CbCr) < -12, "Invalid chroma QP offset" ); - CHECK( pcSlice->getSliceChromaQpDelta(JOINT_CbCr) > 12, "Invalid chroma QP offset" ); - CHECK( (pps->getQpOffset(JOINT_CbCr) + pcSlice->getSliceChromaQpDelta(JOINT_CbCr)) < -12, "Invalid chroma QP offset" ); - CHECK( (pps->getQpOffset(JOINT_CbCr) + pcSlice->getSliceChromaQpDelta(JOINT_CbCr)) > 12, "Invalid chroma QP offset" ); + pcSlice->setSliceChromaQpDelta(JOINT_CbCr, iCode); + CHECK( pcSlice->getSliceChromaQpDelta(JOINT_CbCr) < -12, "Invalid chroma QP offset"); + CHECK( pcSlice->getSliceChromaQpDelta(JOINT_CbCr) > 12, "Invalid chroma QP offset"); + CHECK( (pps->getQpOffset(JOINT_CbCr) + pcSlice->getSliceChromaQpDelta(JOINT_CbCr)) < -12, "Invalid chroma QP offset"); + CHECK( (pps->getQpOffset(JOINT_CbCr) + pcSlice->getSliceChromaQpDelta(JOINT_CbCr)) > 12, "Invalid chroma QP offset"); #endif } } @@ -2382,7 +2382,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para if (sps->getUseReshaper()) { - READ_FLAG(uiCode, "slice_lmcs_enabled_flag"); + READ_FLAG(uiCode, "slice_lmcs_enabled_flag"); pcSlice->setLmcsEnabledFlag(uiCode == 1); if (pcSlice->getLmcsEnabledFlag()) @@ -2392,7 +2392,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para #else READ_CODE(5, uiCode, "slice_lmcs_aps_id"); #endif - + pcSlice->setLmcsAPSId(uiCode); #if !JVET_O1109_UNFIY_CRS if (!(sps->getUseDualITree() && pcSlice->isIntra())) @@ -2402,7 +2402,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para if (bChroma) { #endif - READ_FLAG(uiCode, "slice_chroma_residual_scale_flag"); + READ_FLAG(uiCode, "slice_chroma_residual_scale_flag"); pcSlice->setLmcsChromaResidualScaleFlag(uiCode == 1); #if !JVET_O1109_UNFIY_CRS || JVET_O0616_400_CHROMA_SUPPORT } @@ -2760,13 +2760,13 @@ void HLSyntaxReader::parseScalingList(ScalingList* scalingList) if (sizeId == SCALING_LIST_64x64) { code *= (SCALING_LIST_NUM / SCALING_LIST_PRED_MODES); // Adjust the decoded code for this size, to cope with the missing 32x32 chroma entries. - } + } scalingList->setRefMatrixId (sizeId,listId,(uint32_t)((int)(listId)-(code))); if( sizeId > SCALING_LIST_8x8 ) { scalingList->setScalingListDC(sizeId,listId,((listId == scalingList->getRefMatrixId (sizeId,listId))? 16 :scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId)))); - } + } scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId)); } diff --git a/source/Lib/EncoderLib/Analyze.h b/source/Lib/EncoderLib/Analyze.h index 567000a08166c585fd34145ea2fb1e8fe0a92b6e..9d91de7a4dd7eb1f651c819cf4c00e3c9d26d969 100644 --- a/source/Lib/EncoderLib/Analyze.h +++ b/source/Lib/EncoderLib/Analyze.h @@ -207,7 +207,7 @@ public: #if JVET_O0756_CALCULATE_HDRMETRICS , const bool printHdrMetrics = false #endif - ) + ) #endif #else void printOut ( char cDelim, const ChromaFormat chFmt, const bool printMSEBasedSNR, const bool printSequenceMSE, const bool printHexPsnr, const BitDepths &bitDepths @@ -458,14 +458,14 @@ public: { #if ENABLE_QPA || WCG_WPSNR if (useWPSNR) { - msg( e_msg_level, "\tTotal Frames | " "Bitrate " "Y-WPSNR " "U-WPSNR " "V-WPSNR " "YUV-WPSNR" ); + msg( e_msg_level, "\tTotal Frames | " "Bitrate " "Y-WPSNR " "U-WPSNR " "V-WPSNR " "YUV-WPSNR " ); } else #endif msg( e_msg_level, "\tTotal Frames | " "Bitrate " "Y-PSNR " "U-PSNR " "V-PSNR " "YUV-PSNR " ); #if JVET_O0756_CALCULATE_HDRMETRICS if (printHdrMetrics) { - msg(e_msg_level, "DeltaE " "PSNRL "); + msg(e_msg_level, "DeltaE " "PSNRL "); } #endif #if EXTENSION_360_VIDEO diff --git a/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp b/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp index 7b425ed978708e7827cc1287bb541d62cbd57fa9..afa62f1e255a323fbd9eff2c9e774c7a81c35a1e 100644 --- a/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp +++ b/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp @@ -646,7 +646,6 @@ void EncAdaptiveLoopFilter::destroy() delete[] m_ctbDistortionUnfilter[comp]; m_ctbDistortionUnfilter[comp] = nullptr; } - AdaptiveLoopFilter::destroy(); } void EncAdaptiveLoopFilter::initCABACEstimator( CABACEncoder* cabacEncoder, CtxCache* ctxCache, Slice* pcSlice diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index e80bfe81f5c6c1454339d3b805cdf8f72586d418..107a639a9391bef05d7d0b6cbfb17f773ff6dc2c 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -241,8 +241,8 @@ protected: int m_iGOPSize; RPLEntry m_RPLList0[MAX_GOP]; RPLEntry m_RPLList1[MAX_GOP]; - int m_numRPLList0; - int m_numRPLList1; + int m_numRPLList0; + int m_numRPLList1; GOPEntry m_GOPList[MAX_GOP]; int m_maxDecPicBuffering[MAX_TLAYER]; int m_numReorderPics[MAX_TLAYER]; @@ -492,7 +492,7 @@ protected: std::vector<int> m_tileRowHeight; bool m_entropyCodingSyncEnabledFlag; - + bool m_rectSliceFlag; int m_numSlicesInPicMinus1; std::vector<int> m_topLeftBrickIdx; @@ -1670,8 +1670,8 @@ public: void setEnsureWppBitEqual( bool b) { m_ensureWppBitEqual = b; } bool getEnsureWppBitEqual() const { return m_ensureWppBitEqual; } #endif - void setUseALF( bool b ) { m_alf = b; } - bool getUseALF() const { return m_alf; } + void setUseALF( bool b ) { m_alf = b; } + bool getUseALF() const { return m_alf; } #if JVET_O0756_CALCULATE_HDRMETRICS void setWhitePointDeltaE( uint32_t index, double value ) { m_whitePointDeltaE[ index ] = value; } diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index a6f99272030974944763403b182883270ac5de71..61ed101e0387cf5033456e3a758bf60c93635816 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -112,19 +112,19 @@ EncGOP::EncGOP() #if JVET_O0756_CALCULATE_HDRMETRICS m_ppcFrameOrg = nullptr; m_ppcFrameRec = nullptr; - + m_pcConvertFormat = nullptr; m_pcConvertIQuantize = nullptr; m_pcColorTransform = nullptr; m_pcDistortionDeltaE = nullptr; m_pcTransferFct = nullptr; - + m_pcColorTransformParams = nullptr; m_pcFrameFormat = nullptr; - + m_metricTime = std::chrono::milliseconds(0); #endif - + m_bInitAMaxBT = true; m_bgPOC = -1; m_picBg = NULL; @@ -145,9 +145,9 @@ EncGOP::~EncGOP() #if JVET_O0756_CALCULATE_HDRMETRICS delete [] m_ppcFrameOrg; delete [] m_ppcFrameRec; - + m_ppcFrameOrg = m_ppcFrameRec = nullptr; - + delete m_pcConvertFormat; delete m_pcConvertIQuantize; delete m_pcColorTransform; @@ -155,7 +155,7 @@ EncGOP::~EncGOP() delete m_pcTransferFct; delete m_pcColorTransformParams; delete m_pcFrameFormat; - + m_pcConvertFormat = nullptr; m_pcConvertIQuantize = nullptr; m_pcColorTransform = nullptr; @@ -235,23 +235,23 @@ void EncGOP::init ( EncLib* pcEncLib ) pcEncLib->getALF()->setAlfWSSD(alfWSSD); #endif m_pcReshaper = pcEncLib->getReshaper(); - + #if JVET_O0756_CALCULATE_HDRMETRICS const bool calculateHdrMetrics = m_pcEncLib->getCalcluateHdrMetrics(); if(calculateHdrMetrics) { //allocate frame buffers and initialize class members int chainNumber = 5; - + m_ppcFrameOrg = new hdrtoolslib::Frame* [chainNumber]; m_ppcFrameRec = new hdrtoolslib::Frame* [chainNumber]; - + double* whitePointDeltaE = new double[hdrtoolslib::NB_REF_WHITE]; for (int i=0; i<hdrtoolslib::NB_REF_WHITE; i++) { whitePointDeltaE[i] = m_pcCfg->getWhitePointDeltaE(i); } - + double maxSampleValue = m_pcCfg->getMaxSampleValue(); hdrtoolslib::SampleRange sampleRange = m_pcCfg->getSampleRange(); hdrtoolslib::ChromaFormat chFmt = hdrtoolslib::ChromaFormat(m_pcCfg->getChromaFormatIdc()); @@ -268,32 +268,32 @@ void EncGOP::init ( EncLib* pcEncLib ) int cropOffsetTop = m_pcCfg->getCropOffsetTop(); int cropOffsetRight = m_pcCfg->getCropOffsetRight(); int cropOffsetBottom = m_pcCfg->getCropOffsetBottom(); - + int width = m_pcCfg->getSourceWidth() - cropOffsetLeft + cropOffsetRight; int height = m_pcCfg->getSourceHeight() - cropOffsetTop + cropOffsetBottom; - + m_ppcFrameOrg[0] = new hdrtoolslib::Frame(width, height, false, hdrtoolslib::CM_YCbCr, colorPrimaries, chFmt, sampleRange, bitDepth, false, hdrtoolslib::TF_PQ, 0); m_ppcFrameRec[0] = new hdrtoolslib::Frame(width, height, false, hdrtoolslib::CM_YCbCr, colorPrimaries, chFmt, sampleRange, bitDepth, false, hdrtoolslib::TF_PQ, 0); - + m_ppcFrameOrg[1] = new hdrtoolslib::Frame(m_ppcFrameOrg[0]->m_width[hdrtoolslib::Y_COMP], m_ppcFrameOrg[0]->m_height[hdrtoolslib::Y_COMP], false, hdrtoolslib::CM_YCbCr, colorPrimaries, hdrtoolslib::CF_444, sampleRange, bitDepth, false, hdrtoolslib::TF_PQ, 0); m_ppcFrameRec[1] = new hdrtoolslib::Frame(m_ppcFrameRec[0]->m_width[hdrtoolslib::Y_COMP], m_ppcFrameRec[0]->m_height[hdrtoolslib::Y_COMP], false, hdrtoolslib::CM_YCbCr, colorPrimaries, hdrtoolslib::CF_444, sampleRange, bitDepth, false, hdrtoolslib::TF_PQ, 0); // 420 to 444 conversion - + m_ppcFrameOrg[2] = new hdrtoolslib::Frame(m_ppcFrameOrg[0]->m_width[hdrtoolslib::Y_COMP], m_ppcFrameOrg[0]->m_height[hdrtoolslib::Y_COMP], true, hdrtoolslib::CM_YCbCr, colorPrimaries, hdrtoolslib::CF_444, hdrtoolslib::SR_UNKNOWN, 32, false, hdrtoolslib::TF_PQ, 0); m_ppcFrameRec[2] = new hdrtoolslib::Frame(m_ppcFrameRec[0]->m_width[hdrtoolslib::Y_COMP], m_ppcFrameRec[0]->m_height[hdrtoolslib::Y_COMP], true, hdrtoolslib::CM_YCbCr, colorPrimaries, hdrtoolslib::CF_444, hdrtoolslib::SR_UNKNOWN, 32, false, hdrtoolslib::TF_PQ, 0); // 444 to Float conversion - + m_ppcFrameOrg[3] = new hdrtoolslib::Frame(m_ppcFrameOrg[0]->m_width[hdrtoolslib::Y_COMP], m_ppcFrameOrg[0]->m_height[hdrtoolslib::Y_COMP], true, hdrtoolslib::CM_RGB, hdrtoolslib::CP_2020, hdrtoolslib::CF_444, hdrtoolslib::SR_UNKNOWN, 32, false, hdrtoolslib::TF_PQ, 0); m_ppcFrameRec[3] = new hdrtoolslib::Frame(m_ppcFrameRec[0]->m_width[hdrtoolslib::Y_COMP], m_ppcFrameRec[0]->m_height[hdrtoolslib::Y_COMP], true, hdrtoolslib::CM_RGB, hdrtoolslib::CP_2020, hdrtoolslib::CF_444, hdrtoolslib::SR_UNKNOWN, 32, false, hdrtoolslib::TF_PQ, 0); // YCbCr to RGB conversion - + m_ppcFrameOrg[4] = new hdrtoolslib::Frame(m_ppcFrameOrg[0]->m_width[hdrtoolslib::Y_COMP], m_ppcFrameOrg[0]->m_height[hdrtoolslib::Y_COMP], true, hdrtoolslib::CM_RGB, hdrtoolslib::CP_2020, hdrtoolslib::CF_444, hdrtoolslib::SR_UNKNOWN, 32, false, hdrtoolslib::TF_NULL, 0); m_ppcFrameRec[4] = new hdrtoolslib::Frame(m_ppcFrameRec[0]->m_width[hdrtoolslib::Y_COMP], m_ppcFrameRec[0]->m_height[hdrtoolslib::Y_COMP], true, hdrtoolslib::CM_RGB, hdrtoolslib::CP_2020, hdrtoolslib::CF_444, hdrtoolslib::SR_UNKNOWN, 32, false, hdrtoolslib::TF_NULL, 0); // Inverse Transfer Function - + m_pcFrameFormat = new hdrtoolslib::FrameFormat(); m_pcFrameFormat->m_isFloat = true; m_pcFrameFormat->m_chromaFormat = hdrtoolslib::CF_UNKNOWN; m_pcFrameFormat->m_colorSpace = hdrtoolslib::CM_RGB; m_pcFrameFormat->m_colorPrimaries = hdrtoolslib::CP_2020; m_pcFrameFormat->m_sampleRange = hdrtoolslib::SR_UNKNOWN; - + m_pcConvertFormat = hdrtoolslib::ConvertColorFormat::create(width, height, chFmt, hdrtoolslib::CF_444, chromaUpFilter, chromaLocation, chromaLocation); m_pcConvertIQuantize = hdrtoolslib::Convert::create(&m_ppcFrameOrg[1]->m_format, &m_ppcFrameOrg[2]->m_format); m_pcColorTransform = hdrtoolslib::ColorTransform::create(m_ppcFrameOrg[2]->m_colorSpace, m_ppcFrameOrg[2]->m_colorPrimaries, m_ppcFrameOrg[3]->m_colorSpace, m_ppcFrameOrg[3]->m_colorPrimaries, true, 1); @@ -1420,7 +1420,7 @@ void EncGOP::xPicInitHashME(Picture *pic, const SPS *sps, PicList &rcListPic) while (iterPic != rcListPic.end()) { Picture* refPic = *(iterPic++); - + if (refPic->poc != pic->poc && refPic->referenced) { if (!refPic->getHashMap()->isInitial()) @@ -1473,7 +1473,7 @@ void EncGOP::xPicInitHashME(Picture *pic, const SPS *sps, PicList &rcListPic) } } } - + if (simpleNum < 0.3*allNum) { m_pcCfg->setUseHashME(false); @@ -1499,18 +1499,18 @@ void EncGOP::xPicInitRateControl(int &estimatedBits, int gopId, double &lambda, } m_pcRateCtrl->initRCPic( frameLevel ); estimatedBits = m_pcRateCtrl->getRCPic()->getTargetBits(); - + #if U0132_TARGET_BITS_SATURATION if (m_pcRateCtrl->getCpbSaturationEnabled() && frameLevel != 0) { int estimatedCpbFullness = m_pcRateCtrl->getCpbState() + m_pcRateCtrl->getBufferingRate(); - + // prevent overflow if (estimatedCpbFullness - estimatedBits > (int)(m_pcRateCtrl->getCpbSize()*0.9f)) { estimatedBits = estimatedCpbFullness - (int)(m_pcRateCtrl->getCpbSize()*0.9f); } - + estimatedCpbFullness -= m_pcRateCtrl->getBufferingRate(); // prevent underflow #if V0078_ADAPTIVE_LOWER_BOUND @@ -1524,11 +1524,11 @@ void EncGOP::xPicInitRateControl(int &estimatedBits, int gopId, double &lambda, estimatedBits = std::max(200, estimatedCpbFullness - (int)(m_pcRateCtrl->getCpbSize()*0.1f)); } #endif - + m_pcRateCtrl->getRCPic()->setTargetBits(estimatedBits); } #endif - + int sliceQP = m_pcCfg->getInitialQP(); if ( ( slice->getPOC() == 0 && m_pcCfg->getInitialQP() > 0 ) || ( frameLevel == 0 && m_pcCfg->getForceIntraQP() ) ) // QP is specified { @@ -1544,23 +1544,23 @@ void EncGOP::xPicInitRateControl(int &estimatedBits, int gopId, double &lambda, else if ( frameLevel == 0 ) // intra case, but use the model { m_pcSliceEncoder->calCostSliceI(pic); // TODO: This only analyses the first slice segment - what about the others? - + if ( m_pcCfg->getIntraPeriod() != 1 ) // do not refine allocated bits for all intra case { int bits = m_pcRateCtrl->getRCSeq()->getLeftAverageBits(); bits = m_pcRateCtrl->getRCPic()->getRefineBitsForIntra( bits ); - + #if U0132_TARGET_BITS_SATURATION if (m_pcRateCtrl->getCpbSaturationEnabled() ) { int estimatedCpbFullness = m_pcRateCtrl->getCpbState() + m_pcRateCtrl->getBufferingRate(); - + // prevent overflow if (estimatedCpbFullness - bits > (int)(m_pcRateCtrl->getCpbSize()*0.9f)) { bits = estimatedCpbFullness - (int)(m_pcRateCtrl->getCpbSize()*0.9f); } - + estimatedCpbFullness -= m_pcRateCtrl->getBufferingRate(); // prevent underflow #if V0078_ADAPTIVE_LOWER_BOUND @@ -1576,14 +1576,14 @@ void EncGOP::xPicInitRateControl(int &estimatedBits, int gopId, double &lambda, #endif } #endif - + if ( bits < 200 ) { bits = 200; } m_pcRateCtrl->getRCPic()->setTargetBits( bits ); } - + list<EncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList(); m_pcRateCtrl->getRCPic()->getLCUInitTargetBits(); lambda = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture, slice->isIRAP()); @@ -1595,10 +1595,10 @@ void EncGOP::xPicInitRateControl(int &estimatedBits, int gopId, double &lambda, lambda = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture, slice->isIRAP()); sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture ); } - + sliceQP = Clip3( -slice->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, sliceQP ); m_pcRateCtrl->getRCPic()->setPicEstQP( sliceQP ); - + m_pcSliceEncoder->resetQP( pic, sliceQP, lambda ); } @@ -1607,13 +1607,13 @@ void EncGOP::xPicInitLMCS(Picture *pic, Slice *slice) if (slice->getSPS()->getUseReshaper()) { const SliceType sliceType = slice->getSliceType(); - + m_pcReshaper->getReshapeCW()->rspTid = slice->getTLayer() + (slice->isIntra() ? 0 : 1); m_pcReshaper->getReshapeCW()->rspSliceQP = slice->getSliceQp(); - + m_pcReshaper->setSrcReshaped(false); m_pcReshaper->setRecReshaped(true); - + if (m_pcCfg->getReshapeSignalType() == RESHAPE_SIGNAL_PQ) { m_pcReshaper->preAnalyzerHDR(pic, sliceType, m_pcCfg->getReshapeCW(), m_pcCfg->getDualITree()); @@ -1633,7 +1633,7 @@ void EncGOP::xPicInitLMCS(Picture *pic, Slice *slice) { THROW("Reshaper for other signal currently not defined!"); } - + if (sliceType == I_SLICE ) { if (m_pcCfg->getReshapeSignalType() == RESHAPE_SIGNAL_PQ) @@ -1664,9 +1664,9 @@ void EncGOP::xPicInitLMCS(Picture *pic, Slice *slice) { THROW("Reshaper for other signal currently not defined!"); } - + m_pcReshaper->setCTUFlag(false); - + //reshape original signal if (m_pcReshaper->getSliceReshaperInfo().getUseSliceReshaper()) { @@ -1683,9 +1683,9 @@ void EncGOP::xPicInitLMCS(Picture *pic, Slice *slice) } else m_pcReshaper->setCTUFlag(true); - + m_pcReshaper->getSliceReshaperInfo().setSliceReshapeModelPresentFlag(false); - + if (m_pcCfg->getReshapeSignalType() == RESHAPE_SIGNAL_PQ) { m_pcEncLib->getRdCost()->restoreReshapeLumaLevelToWeightTable(); @@ -1718,7 +1718,7 @@ void EncGOP::xPicInitLMCS(Picture *pic, Slice *slice) THROW("Reshaper for other signal currently not defined!"); } } - + //set all necessary information in LMCS APS and slice slice->setLmcsEnabledFlag(m_pcReshaper->getSliceReshaperInfo().getUseSliceReshaper()); slice->setLmcsChromaResidualScaleFlag(m_pcReshaper->getSliceReshaperInfo().getSliceReshapeChromaAdj() == 1); @@ -1748,8 +1748,8 @@ void EncGOP::xPicInitLMCS(Picture *pic, Slice *slice) tInfo.maxNbitsNeededDeltaCW = sInfo.maxNbitsNeededDeltaCW; m_pcEncLib->getApsMap()->setChangedFlag((lmcsAPS->getAPSId() << NUM_APS_TYPE_LEN) + LMCS_APS); } - - + + if (slice->getLmcsEnabledFlag()) { int apsId = 0; @@ -2489,13 +2489,13 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, #if JVET_O0376_SPS_JOINTCBCR_FLAG if (pcSlice->getSPS()->getJointCbCrEnabledFlag()) { - pcSlice->setSliceChromaQpDelta(JOINT_CbCr, m_pcCfg->getChromaCbCrQpOffsetDualTree()); + pcSlice->setSliceChromaQpDelta(JOINT_CbCr, m_pcCfg->getChromaCbCrQpOffsetDualTree()); } #else pcSlice->setSliceChromaQpDelta(JOINT_CbCr, m_pcCfg->getChromaCbCrQpOffsetDualTree()); #endif m_pcSliceEncoder->setUpLambda(pcSlice, pcSlice->getLambdas()[0], pcSlice->getSliceQp()); - } + } xPicInitLMCS(pcPic, pcSlice); @@ -2630,7 +2630,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, if( pcSlice->getSPS()->getSAOEnabledFlag() ) { bool sliceEnabled[MAX_NUM_COMPONENT]; - m_pcSAO->initCABACEstimator( m_pcEncLib->getCABACEncoder(), m_pcEncLib->getCtxCache(), pcSlice ); m_pcSAO->SAOProcess( cs, sliceEnabled, pcSlice->getLambdas(), @@ -2789,7 +2788,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, *apsMap->allocatePS(apsId) = *aps; //allocate and cpy m_pcALF->setApsIdStart( apsId ); } - + if (writeAPS ) { actualTotalBits += xWriteAPS(accessUnit, aps); @@ -3068,7 +3067,7 @@ void EncGOP::printOutSummary(uint32_t uiNumAllPicCoded, bool isField, const bool #if JVET_O0756_CALCULATE_HDRMETRICS , calculateHdrMetrics #endif - ); + ); #endif #else m_gcAnalyzeAll.printOut('a', chFmt, printMSEBasedSNR, printSequenceMSE, printHexPsnr, bitDepths @@ -3928,34 +3927,35 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni std::cout.flush(); } } + #if JVET_O0756_CALCULATE_HDRMETRICS void EncGOP::xCalculateHDRMetrics( Picture* pcPic, double deltaE[hdrtoolslib::NB_REF_WHITE], double psnrL[hdrtoolslib::NB_REF_WHITE]) { copyBuftoFrame(pcPic); - + ChromaFormat chFmt = pcPic->chromaFormat; - + if (chFmt != CHROMA_444) { m_pcConvertFormat->process(m_ppcFrameOrg[1], m_ppcFrameOrg[0]); m_pcConvertFormat->process(m_ppcFrameRec[1], m_ppcFrameRec[0]); } - + m_pcConvertIQuantize->process(m_ppcFrameOrg[2], m_ppcFrameOrg[1]); m_pcConvertIQuantize->process(m_ppcFrameRec[2], m_ppcFrameRec[1]); - + m_pcColorTransform->process(m_ppcFrameOrg[3], m_ppcFrameOrg[2]); m_pcColorTransform->process(m_ppcFrameRec[3], m_ppcFrameRec[2]); - + m_pcTransferFct->forward(m_ppcFrameOrg[4], m_ppcFrameOrg[3]); m_pcTransferFct->forward(m_ppcFrameRec[4], m_ppcFrameRec[3]); - + // Calculate the Metrics m_pcDistortionDeltaE->computeMetric(m_ppcFrameOrg[4], m_ppcFrameRec[4]); - + *deltaE = m_pcDistortionDeltaE->getDeltaE(); *psnrL = m_pcDistortionDeltaE->getPsnrL(); - + } void EncGOP::copyBuftoFrame( Picture* pcPic ) @@ -3964,22 +3964,22 @@ void EncGOP::copyBuftoFrame( Picture* pcPic ) int cropOffsetTop = m_pcCfg->getCropOffsetTop(); int cropOffsetRight = m_pcCfg->getCropOffsetRight(); int cropOffsetBottom = m_pcCfg->getCropOffsetBottom(); - + int height = pcPic->getOrigBuf(COMPONENT_Y).height - cropOffsetLeft + cropOffsetRight; int width = pcPic->getOrigBuf(COMPONENT_Y).width - cropOffsetTop + cropOffsetBottom; - + ChromaFormat chFmt = pcPic->chromaFormat; - + Pel* pOrg = pcPic->getOrigBuf(COMPONENT_Y).buf; Pel* pRec = pcPic->getRecoBuf(COMPONENT_Y).buf; - + uint16_t* yOrg = m_ppcFrameOrg[0]->m_ui16Comp[hdrtoolslib::Y_COMP]; uint16_t* yRec = m_ppcFrameRec[0]->m_ui16Comp[hdrtoolslib::Y_COMP]; uint16_t* uOrg = m_ppcFrameOrg[0]->m_ui16Comp[hdrtoolslib::Cb_COMP]; uint16_t* uRec = m_ppcFrameRec[0]->m_ui16Comp[hdrtoolslib::Cb_COMP]; uint16_t* vOrg = m_ppcFrameOrg[0]->m_ui16Comp[hdrtoolslib::Cr_COMP]; uint16_t* vRec = m_ppcFrameRec[0]->m_ui16Comp[hdrtoolslib::Cr_COMP]; - + if(chFmt == CHROMA_444){ yOrg = m_ppcFrameOrg[1]->m_ui16Comp[hdrtoolslib::Y_COMP]; yRec = m_ppcFrameRec[1]->m_ui16Comp[hdrtoolslib::Y_COMP]; @@ -3988,34 +3988,34 @@ void EncGOP::copyBuftoFrame( Picture* pcPic ) vOrg = m_ppcFrameOrg[1]->m_ui16Comp[hdrtoolslib::Cr_COMP]; vRec = m_ppcFrameRec[1]->m_ui16Comp[hdrtoolslib::Cr_COMP]; } - + for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { yOrg[i*width + j] = static_cast<uint16_t>(pOrg[(i + cropOffsetTop) * pcPic->getOrigBuf(COMPONENT_Y).stride + j + cropOffsetLeft]); yRec[i*width + j] = static_cast<uint16_t>(pRec[(i + cropOffsetTop) * pcPic->getRecoBuf(COMPONENT_Y).stride + j + cropOffsetLeft]); } } - + if (chFmt != CHROMA_444) { height >>= 1; width >>= 1; cropOffsetLeft >>= 1; cropOffsetTop >>= 1; } - + pOrg = pcPic->getOrigBuf(COMPONENT_Cb).buf; pRec = pcPic->getRecoBuf(COMPONENT_Cb).buf; - + for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { uOrg[i*width + j] = static_cast<uint16_t>(pOrg[(i + cropOffsetTop) * pcPic->getOrigBuf(COMPONENT_Cb).stride + j + cropOffsetLeft]); uRec[i*width + j] = static_cast<uint16_t>(pRec[(i + cropOffsetTop) * pcPic->getRecoBuf(COMPONENT_Cb).stride + j + cropOffsetLeft]); } } - + pOrg = pcPic->getOrigBuf(COMPONENT_Cr).buf; pRec = pcPic->getRecoBuf(COMPONENT_Cr).buf; - + for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { vOrg[i*width + j] = static_cast<uint16_t>(pOrg[(i + cropOffsetTop) * pcPic->getOrigBuf(COMPONENT_Cr).stride + j + cropOffsetLeft]); diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp index 6e12aafc084e17683a29860a8d8fabaeb5a36308..85dd50e6d981f55e616d4bf20bcc18c3506a48e6 100644 --- a/source/Lib/EncoderLib/InterSearch.cpp +++ b/source/Lib/EncoderLib/InterSearch.cpp @@ -2544,7 +2544,7 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner) ) { bool doBiPred = true; - tryBipred = 1; + tryBipred = 1; cMvBi[0] = cMv[0]; cMvBi[1] = cMv[1]; iRefIdxBi[0] = iRefIdx[0]; @@ -2913,19 +2913,19 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner) iRefIdx[1] = refIdxValidList1; uiBits [1] = bitsValidList1; uiCost [1] = costValidList1; - if (cu.cs->pps->getWPBiPred() == true && tryBipred && (gbiIdx != GBI_DEFAULT)) - { - CHECK(iRefIdxBi[0]<0, "Invalid picture reference index"); - CHECK(iRefIdxBi[1]<0, "Invalid picture reference index"); - cu.cs->slice->getWpScaling(REF_PIC_LIST_0, iRefIdxBi[0], wp0); - cu.cs->slice->getWpScaling(REF_PIC_LIST_1, iRefIdxBi[1], wp1); - if ((wp0[COMPONENT_Y].bPresentFlag || wp0[COMPONENT_Cb].bPresentFlag || wp0[COMPONENT_Cr].bPresentFlag - || wp1[COMPONENT_Y].bPresentFlag || wp1[COMPONENT_Cb].bPresentFlag || wp1[COMPONENT_Cr].bPresentFlag)) - { - uiCostBi = MAX_UINT; - enforceGBiPred = false; - } - } + if (cu.cs->pps->getWPBiPred() == true && tryBipred && (gbiIdx != GBI_DEFAULT)) + { + CHECK(iRefIdxBi[0]<0, "Invalid picture reference index"); + CHECK(iRefIdxBi[1]<0, "Invalid picture reference index"); + cu.cs->slice->getWpScaling(REF_PIC_LIST_0, iRefIdxBi[0], wp0); + cu.cs->slice->getWpScaling(REF_PIC_LIST_1, iRefIdxBi[1], wp1); + if ((wp0[COMPONENT_Y].bPresentFlag || wp0[COMPONENT_Cb].bPresentFlag || wp0[COMPONENT_Cr].bPresentFlag + || wp1[COMPONENT_Y].bPresentFlag || wp1[COMPONENT_Cb].bPresentFlag || wp1[COMPONENT_Cr].bPresentFlag)) + { + uiCostBi = MAX_UINT; + enforceGBiPred = false; + } + } if( enforceGBiPred ) { uiCost[0] = uiCost[1] = MAX_UINT; @@ -3342,7 +3342,6 @@ Distortion InterSearch::xGetTemplateCost( const PredictionUnit& pu, #else clipMv( cMvCand, pu.cu->lumaPos(), pu.cu->lumaSize(), *pu.cs->sps ); #endif - // prediction pattern const bool bi = pu.cu->slice->testWeightPred() && pu.cu->slice->getSliceType()==P_SLICE; @@ -5105,7 +5104,7 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit& pu, // Bi-directional prediction if ( slice.isInterB() && !PU::isBipredRestriction(pu) ) { - tryBipred = 1; + tryBipred = 1; pu.interDir = 3; #if JVET_O0070_PROF m_isBi = true; @@ -5339,16 +5338,16 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit& pu, uiCost[1] = costValidList1; if (pu.cs->pps->getWPBiPred() == true && tryBipred && (gbiIdx != GBI_DEFAULT)) { - CHECK(iRefIdxBi[0]<0, "Invalid picture reference index"); - CHECK(iRefIdxBi[1]<0, "Invalid picture reference index"); - pu.cs->slice->getWpScaling(REF_PIC_LIST_0, iRefIdxBi[0], wp0); - pu.cs->slice->getWpScaling(REF_PIC_LIST_1, iRefIdxBi[1], wp1); - if ((wp0[COMPONENT_Y].bPresentFlag || wp0[COMPONENT_Cb].bPresentFlag || wp0[COMPONENT_Cr].bPresentFlag - || wp1[COMPONENT_Y].bPresentFlag || wp1[COMPONENT_Cb].bPresentFlag || wp1[COMPONENT_Cr].bPresentFlag)) - { - uiCostBi = MAX_UINT; - enforceGBiPred = false; - } + CHECK(iRefIdxBi[0]<0, "Invalid picture reference index"); + CHECK(iRefIdxBi[1]<0, "Invalid picture reference index"); + pu.cs->slice->getWpScaling(REF_PIC_LIST_0, iRefIdxBi[0], wp0); + pu.cs->slice->getWpScaling(REF_PIC_LIST_1, iRefIdxBi[1], wp1); + if ((wp0[COMPONENT_Y].bPresentFlag || wp0[COMPONENT_Cb].bPresentFlag || wp0[COMPONENT_Cr].bPresentFlag + || wp1[COMPONENT_Y].bPresentFlag || wp1[COMPONENT_Cb].bPresentFlag || wp1[COMPONENT_Cr].bPresentFlag)) + { + uiCostBi = MAX_UINT; + enforceGBiPred = false; + } } if( enforceGBiPred ) { @@ -7025,7 +7024,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par } #else - if( isChroma( compID ) && tu.cu->cs->slice->getSliceQp() > 18 ) + if ( isChroma( compID ) && tu.cu->cs->slice->getSliceQp() > 18 ) { m_pcTrQuant->setLambda( 1.05 * m_pcTrQuant->getLambda() ); } @@ -7298,7 +7297,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par m_pcTrQuant->setLambda( 1.05 * m_pcTrQuant->getLambda() ); } #else - if( tu.cu->cs->slice->getSliceQp() > 18 ) + if ( tu.cu->cs->slice->getSliceQp() > 18 ) { m_pcTrQuant->setLambda( 1.05 * m_pcTrQuant->getLambda() ); } diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index cfa63c90238f56ada7d888e1cb7c6e7e80eee6ce..327f3fa486f047927334987725cce1bb57ec61cf 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -343,8 +343,8 @@ void HLSWriter::codePPS( const PPS* pcPPS ) } else { - // make sure single brick per slice is set by encoder such that the behaviour is same as for setting it to true - CHECK(pcPPS->getSingleBrickPerSliceFlag() != true, "SingleBrickPerSliceFlag must be set to 1 when not present"); + // make sure single brick per slice is set by encoder such that the behaviour is same as for setting it to true + CHECK(pcPPS->getSingleBrickPerSliceFlag() != true, "SingleBrickPerSliceFlag must be set to 1 when not present"); // make sure rect_slice_flag is set CHECK (pcPPS->getRectSliceFlag()!=true, "RectSliceFlag must be equalt to 1 for single_tile_in_pic_flag equal to 1"); } @@ -498,7 +498,7 @@ void HLSWriter::codeAPS( APS* pcAPS ) WRITE_CODE(pcAPS->getAPSId(), 5, "adaptation_parameter_set_id"); WRITE_CODE(pcAPS->getAPSType(), 3, "aps_params_type"); - + if (pcAPS->getAPSType() == ALF_APS) { @@ -524,7 +524,7 @@ void HLSWriter::codeAlfAps( APS* pcAPS ) #if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB WRITE_FLAG( param.nonLinearFlag[CHANNEL_TYPE_LUMA][0], "alf_luma_clip" ); #else - WRITE_FLAG(param.nonLinearFlag[CHANNEL_TYPE_LUMA], "alf_luma_clip"); + WRITE_FLAG( param.nonLinearFlag[CHANNEL_TYPE_LUMA], "alf_luma_clip" ); #endif #if JVET_O0491_HLS_CLEANUP @@ -883,7 +883,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) WRITE_FLAG(chromaQpMappingTable.getSameCQPTableForAllChromaFlag(), "same_qp_table_for_chroma"); for (int i = 0; i < (chromaQpMappingTable.getSameCQPTableForAllChromaFlag() ? 1 : 3); i++) { - WRITE_UVLC(chromaQpMappingTable.getNumPtsInCQPTableMinus1(i), "num_points_in_qp_table_minus1"); + WRITE_UVLC(chromaQpMappingTable.getNumPtsInCQPTableMinus1(i), "num_points_in_qp_table_minus1"); for (int j = 0; j <= chromaQpMappingTable.getNumPtsInCQPTableMinus1(i); j++) { @@ -931,7 +931,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) #if !JVET_O1164_PS if( pcSPS->getCTUSize() + 2*(1 << pcSPS->getLog2MinCodingBlockSize()) <= pcSPS->getPicWidthInLumaSamples() ) - { + { #endif WRITE_FLAG( pcSPS->getWrapAroundEnabledFlag() ? 1 : 0, "sps_ref_wraparound_enabled_flag" ); if( pcSPS->getWrapAroundEnabledFlag() ) @@ -1000,7 +1000,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) { WRITE_FLAG( pcSPS->getFpelMmvdEnabledFlag() ? 1 : 0, "sps_fpel_mmvd_enabled_flag" ); } -#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG +#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG if(pcSPS->getBDOFEnabledFlag() || pcSPS->getUseDMVR()) { WRITE_FLAG(pcSPS->getBdofDmvrSlicePresentFlag() ? 1 : 0, "sps_bdof_dmvr_slice_level_present_flag"); @@ -1217,7 +1217,7 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice ) { WRITE_UVLC(pcSlice->getSliceNumBricks() - 1, "num_bricks_in_slice_minus1"); } - + for( int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++ ) { WRITE_FLAG( 0, "slice_reserved_flag[]" ); @@ -1390,7 +1390,7 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice ) #if JVET_O0491_HLS_CLEANUP WRITE_CODE(alfChromaIdc, 2, "slice_alf_chroma_idc"); #else - truncatedUnaryEqProb(alfChromaIdc, 3); // alf_chroma_idc + truncatedUnaryEqProb(alfChromaIdc, 3); // alf_chroma_idc #endif #if JVET_O0616_400_CHROMA_SUPPORT } @@ -1684,7 +1684,7 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice ) if (chromaEnabled) { #endif - WRITE_FLAG(pcSlice->getLmcsChromaResidualScaleFlag(), "slice_chroma_residual_scale_flag"); + WRITE_FLAG(pcSlice->getLmcsChromaResidualScaleFlag(), "slice_chroma_residual_scale_flag"); #if JVET_O0616_400_CHROMA_SUPPORT } #endif @@ -2049,7 +2049,7 @@ void HLSWriter::alfFilter( const AlfParam& alfParam, const bool isChroma ) const int numFilters = isChroma ? 1 : alfParam.numLumaFilters; // vlc for all -#if !JVET_O0216_ALF_COEFF_EG3 +#if !JVET_O0216_ALF_COEFF_EG3 for( int ind = 0; ind < numFilters; ++ind ) { if( isChroma || !alfParam.alfLumaCoeffDeltaFlag || alfParam.alfLumaCoeffFlag[ind] )