Changeset 1413 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncGOP.cpp


Ignore:
Timestamp:
11 Jul 2018, 15:19:49 (6 years ago)
Author:
tech
Message:

Merged HTM-16.2-dev@1412

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r1405 r1413  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    108108  m_associatedIRAPType = NAL_UNIT_CODED_SLICE_IDR_N_LP;
    109109  m_associatedIRAPPOC  = 0;
    110 #if W0038_DB_OPT
    111110  m_pcDeblockingTempPicYuv = NULL;
    112 #endif
    113   return;
    114111}
    115112
     
    128125Void  TEncGOP::destroy()
    129126{
    130 #if W0038_DB_OPT
    131127  if (m_pcDeblockingTempPicYuv)
    132128  {
     
    135131    m_pcDeblockingTempPicYuv = NULL;
    136132  }
    137 #endif
    138133}
    139134
     
    161156  m_layerId              = pcTEncTop->getLayerId();
    162157  m_viewId               = pcTEncTop->getViewId();
     158#endif
     159
    163160#if NH_3D
    164161  m_viewIndex            = pcTEncTop->getViewIndex();
    165162  m_isDepth              = pcTEncTop->getIsDepth();
    166 #endif
    167 #endif
    168 #if NH_3D_IC
     163
    169164  m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate();
    170165  m_aICEnableNum         = pcTEncTop->getICEnableNum();
     
    212207
    213208
    214 Int TEncGOP::xWriteParameterSets (AccessUnit &accessUnit, TComSlice *slice)
     209#if NH_MV
     210Int TEncGOP::xWriteParameterSets (AccessUnit &accessUnit, TComSlice *slice, const Bool bSeqFirst, const Bool bWriteVps )
     211#else
     212Int TEncGOP::xWriteParameterSets (AccessUnit &accessUnit, TComSlice *slice, const Bool bSeqFirst)
     213#endif
    215214{
    216215  Int actualTotalBits = 0;
    217216
    218217#if NH_MV
    219   if ( getLayerId() == 0 )
     218  if ( bWriteVps )
    220219  {
    221220    actualTotalBits += xWriteVPS(accessUnit, m_pcEncTop->getVPS());
    222221  }
    223222#else
    224   actualTotalBits += xWriteVPS(accessUnit, m_pcEncTop->getVPS());
    225 #endif
    226   actualTotalBits += xWriteSPS(accessUnit, slice->getSPS());
    227   actualTotalBits += xWritePPS(accessUnit, slice->getPPS());
     223  if (bSeqFirst)
     224  {
     225    actualTotalBits += xWriteVPS(accessUnit, m_pcEncTop->getVPS());
     226  }
     227#endif
     228  if (m_pcEncTop->SPSNeedsWriting(slice->getSPS()->getSPSId())) // Note this assumes that all changes to the SPS are made at the TEncTop level prior to picture creation (TEncTop::xGetNewPicBuffer).
     229  {
     230    assert(bSeqFirst); // Implementations that use more than 1 SPS need to be aware of activation issues.
     231    actualTotalBits += xWriteSPS(accessUnit, slice->getSPS());
     232  }
     233  if (m_pcEncTop->PPSNeedsWriting(slice->getPPS()->getPPSId())) // Note this assumes that all changes to the PPS are made at the TEncTop level prior to picture creation (TEncTop::xGetNewPicBuffer).
     234  {
     235    actualTotalBits += xWritePPS(accessUnit, slice->getPPS());
     236  }
    228237
    229238  return actualTotalBits;
     
    513522    seiMessages.push_back(seiChromaResamplingFilterHint);
    514523  }
    515 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
    516524  if(m_pcCfg->getSEIAlternativeTransferCharacteristicsSEIEnable())
    517525  {
     
    520528    seiMessages.push_back(seiAlternativeTransferCharacteristics);
    521529  }
    522 #endif
    523530}
    524531
     
    555562    {
    556563      // Gradual decoding refresh SEI
    557       SEIGradualDecodingRefreshInfo *gradualDecodingRefreshInfoSEI = new SEIGradualDecodingRefreshInfo();
     564      SEIRegionRefreshInfo *gradualDecodingRefreshInfoSEI = new SEIRegionRefreshInfo();
    558565      gradualDecodingRefreshInfoSEI->m_gdrForegroundFlag = true; // Indicating all "foreground"
    559566      seiMessages.push_back(gradualDecodingRefreshInfoSEI);
     
    10461053
    10471054
     1055#if X0038_LAMBDA_FROM_QP_CAPABILITY
     1056static UInt calculateCollocatedFromL0Flag(const TComSlice *pSlice)
     1057{
     1058  const Int refIdx = 0; // Zero always assumed
     1059  const TComPic *refPicL0 = pSlice->getRefPic(REF_PIC_LIST_0, refIdx);
     1060  const TComPic *refPicL1 = pSlice->getRefPic(REF_PIC_LIST_1, refIdx);
     1061  return refPicL0->getSlice(0)->getSliceQp() > refPicL1->getSlice(0)->getSliceQp();
     1062}
     1063#else
    10481064static UInt calculateCollocatedFromL1Flag(TEncCfg *pCfg, const Int GOPid, const Int gopSize)
    10491065{
     
    10941110  }
    10951111}
     1112#endif
    10961113
    10971114
     
    11411158Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic,
    11421159                                TComList<TComPicYuv*>& rcListPicYuvRecOut,  std::list<AccessUnit>& accessUnitsInGOP,
    1143                                 Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Int iGOPid )
     1160                                Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, const Bool printMSSSIM, Int iGOPid )
    11441161#else
    11451162Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic,
    11461163                           TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP,
     1164#if JVET_F0064_MSSSIM           
     1165                           Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, const Bool printMSSSIM )
     1166#else
     1167
    11471168                           Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE )
     1169#endif
    11481170#endif
    11491171{
     
    11931215    clock_t iBeforeTime = clock();
    11941216
     1217#if !X0038_LAMBDA_FROM_QP_CAPABILITY
    11951218    UInt uiColDir = calculateCollocatedFromL1Flag(m_pcCfg, iGOPid, m_iGopSize);
     1219#endif
    11961220
    11971221    /////////////////////////////////////////////////////////////////////////////////////////////////// Initial to start encoding
     
    12371261    xGetBuffer( rcListPic, rcListPicYuvRecOut, iNumPicRcvd, iTimeOffset, pcPic, pcPicYuvRecOut, pocCurr, isField );
    12381262
     1263#if REDUCED_ENCODER_MEMORY
     1264    pcPic->prepareForReconstruction();
     1265
     1266#endif
    12391267    //  Slice data initialization
    12401268    pcPic->clearSliceBuffer();
     
    12471275    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, isField );
    12481276#endif
    1249 
    1250     //Set Frame/Field coding
    1251     pcSlice->getPic()->setField(isField);
    12521277
    12531278    pcSlice->setLastIDR(m_iLastIDR);
     
    14411466    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() );
    14421467#endif
    1443 #if NH_3D_QTL
     1468
     1469#if NH_3D
    14441470    pcSlice->setIvPicLists( m_ivPicLists );
    1445 #endif
    1446 #if NH_3D
    1447 
    1448 
    14491471    Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid;
    14501472    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );
     
    15171539      pcSlice->checkInCompPredRefLayers();
    15181540    }
    1519 #if NH_3D_IV_MERGE
    15201541    // This needs to be done after initialization of 3D tool parameters.
    15211542    pcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand()   + ( ( pcSlice->getMpiFlag( ) || pcSlice->getIvMvPredFlag( ) || pcSlice->getViewSynthesisPredFlag( )   ) ? 1 : 0 ));
    1522 #endif
    15231543#endif
    15241544
     
    15451565    pcSlice->setRefPicList ( rcListPic );
    15461566#endif
    1547 #if NH_3D_NBDV
     1567#if NH_3D
    15481568    pcSlice->setDefaultRefView();
    1549 #endif
    1550 #if NH_3D_ARP
    15511569    //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh
    15521570    pcSlice->setARPStepNum(m_ivPicLists);
    1553 #endif
    1554 #if NH_3D_IC
    15551571    pcSlice->setICEnableCandidate( m_aICEnableCandidate );
    15561572    pcSlice->setICEnableNum( m_aICEnableNum );
     
    15761592    if (pcSlice->getSliceType() == B_SLICE)
    15771593    {
     1594#if X0038_LAMBDA_FROM_QP_CAPABILITY
     1595      const UInt uiColFromL0 = calculateCollocatedFromL0Flag(pcSlice);
     1596      pcSlice->setColFromL0Flag(uiColFromL0);
     1597#else
    15781598      pcSlice->setColFromL0Flag(1-uiColDir);
     1599#endif
    15791600      Bool bLowDelay = true;
    15801601      Int  iCurrPOC  = pcSlice->getPOC();
     
    16031624    }
    16041625
     1626#if !X0038_LAMBDA_FROM_QP_CAPABILITY
    16051627    uiColDir = 1-uiColDir;
     1628#endif
    16061629
    16071630    //-------------------------------------------------------------
     
    16091632
    16101633    pcSlice->setList1IdxToList0Idx();
    1611 #if NH_3D_TMVP
     1634#if NH_3D
    16121635    if(pcSlice->getLayerId())
    16131636      pcSlice->generateAlterRefforTMVP();
     
    16591682
    16601683    // SAIT_VSO_EST_A0033
    1661 #if H_3D_FCO
    1662     Bool flagRec;
    1663     flagRec =  ((m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false, pcSlice->getPOC(), true) == NULL) ? false: true);
    1664     pcRdCost->setVideoRecPicYuv( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false, pcSlice->getPOC(), flagRec ) );
    1665     pcRdCost->setDepthPicYuv   ( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), true, pcSlice->getPOC(), false ) );
    1666 #else   
    16671684    Int curAuxId     = pcSlice->getVPS()->getAuxId( getLayerId() );
    16681685    Int curDepthFlag = pcSlice->getIsDepth();
     
    16701687    pcRdCost->setVideoRecPicYuv( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false       , 0       , pcSlice->getPOC(), true ) );
    16711688    pcRdCost->setDepthPicYuv   ( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), curDepthFlag, curAuxId, pcSlice->getPOC(), false ) );
    1672 #endif
     1689
    16731690    // LGE_WVSO_A0119
    16741691    Bool bUseWVSO  = m_pcEncTop->getUseWVSO();
     
    17081725      pcSlice->setMvdL1ZeroFlag(false);
    17091726    }
    1710     pcPic->getSlice(pcSlice->getSliceIdx())->setMvdL1ZeroFlag(pcSlice->getMvdL1ZeroFlag());
    17111727
    17121728
     
    17331749#endif
    17341750
    1735 #if U0132_TARGET_BITS_SATURATION
    17361751      if (m_pcRateCtrl->getCpbSaturationEnabled() && frameLevel != 0)
    17371752      {
     
    17461761        estimatedCpbFullness -= m_pcRateCtrl->getBufferingRate();
    17471762        // prevent underflow
    1748 #if V0078_ADAPTIVE_LOWER_BOUND
    17491763        if (estimatedCpbFullness - estimatedBits < m_pcRateCtrl->getRCPic()->getLowerBound())
    17501764        {
    17511765          estimatedBits = max(200, estimatedCpbFullness - m_pcRateCtrl->getRCPic()->getLowerBound());
    17521766        }
    1753 #else
    1754         if (estimatedCpbFullness - estimatedBits < (Int)(m_pcRateCtrl->getCpbSize()*0.1f))
    1755         {
    1756           estimatedBits = max(200, estimatedCpbFullness - (Int)(m_pcRateCtrl->getCpbSize()*0.1f));
    1757         }
    1758 #endif
    1759 
    17601767        m_pcRateCtrl->getRCPic()->setTargetBits(estimatedBits);
    17611768      }
    1762 #endif
    17631769
    17641770      Int sliceQP = m_pcCfg->getInitialQP();
     
    17821788          bits = m_pcRateCtrl->getRCPic()->getRefineBitsForIntra( bits );
    17831789
    1784 #if U0132_TARGET_BITS_SATURATION
    17851790          if (m_pcRateCtrl->getCpbSaturationEnabled() )
    17861791          {
     
    17951800            estimatedCpbFullness -= m_pcRateCtrl->getBufferingRate();
    17961801            // prevent underflow
    1797 #if V0078_ADAPTIVE_LOWER_BOUND
    17981802            if (estimatedCpbFullness - bits < m_pcRateCtrl->getRCPic()->getLowerBound())
    17991803            {
    18001804              bits = estimatedCpbFullness - m_pcRateCtrl->getRCPic()->getLowerBound();
    18011805            }
    1802 #else
    1803             if (estimatedCpbFullness - bits < (Int)(m_pcRateCtrl->getCpbSize()*0.1f))
    1804             {
    1805               bits = estimatedCpbFullness - (Int)(m_pcRateCtrl->getCpbSize()*0.1f);
    1806             }
    1807 #endif
    18081806          }
    1809 #endif
    18101807
    18111808          if ( bits < 200 )
     
    18491846    UInt uiNumSliceSegments = 1;
    18501847
    1851 #if NH_3D_NBDV
     1848#if NH_3D
    18521849      if(pcSlice->getViewIndex() && !pcSlice->getIsDepth()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.
    18531850      {
     
    18551852        pcPic->setNumDdvCandPics(pcPic->getDisCandRefPictures(iColPoc));
    18561853      }
    1857 #endif
    1858 #if NH_3D
    18591854      pcSlice->setDepthToDisparityLUTs();
    18601855
    1861 #endif
    1862 
    1863 #if NH_3D_NBDV
    18641856      if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.
    18651857      {
     
    19351927    if ( m_pcCfg->getDeblockingFilterMetric() )
    19361928    {
    1937 #if W0038_DB_OPT
    19381929      if ( m_pcCfg->getDeblockingFilterMetric()==2 )
    19391930      {
     
    19421933      else
    19431934      {
    1944 #endif
    19451935      applyDeblockingFilterMetric(pcPic, uiNumSliceSegments);
    1946 #if W0038_DB_OPT
    1947       }
    1948 #endif
     1936      }
    19491937    }
    19501938    m_pcLoopFilter->loopFilterPic( pcPic );
     
    19531941    // Set entropy coder
    19541942    m_pcEntropyCoder->setEntropyCoder   ( m_pcCavlcCoder );
     1943
     1944    // write various parameter sets
     1945#if JCTVC_Y0038_PARAMS
     1946    //bool writePS = m_bSeqFirst || (m_pcCfg->getReWriteParamSetsFlag() && (pcPic->getSlice(0)->getSliceType() == I_SLICE));
     1947#if NH_MV
     1948    bool writePS = m_bSeqFirst || (m_pcCfg->getReWriteParamSetsFlag() && (pcSlice->isIRAP())  );
     1949#else
     1950    bool writePS = m_bSeqFirst || (m_pcCfg->getReWriteParamSetsFlag() && (pcSlice->isIRAP()));
     1951#endif
     1952    if (writePS)
     1953    {
     1954#if NH_MV
     1955      if ( m_layerId == pcSlice->getSPS()->getLayerId() )
     1956      {
     1957        m_pcEncTop->setParamSetChanged(pcSlice->getSPS()->getSPSId(), false );
     1958      }
     1959     
     1960      if ( m_layerId == pcSlice->getPPS()->getLayerId() )
     1961      {
     1962        m_pcEncTop->setParamSetChanged(pcSlice->getPPS()->getSPSId(), true  );       
     1963      }
     1964
     1965#else
     1966      m_pcEncTop->setParamSetChanged(pcSlice->getSPS()->getSPSId(), pcSlice->getPPS()->getPPSId());
     1967#endif
     1968    }
     1969#if NH_MV
     1970    actualTotalBits += xWriteParameterSets(accessUnit, pcSlice, writePS, (getLayerId() == 0) && m_bSeqFirst );
     1971#else
     1972    actualTotalBits += xWriteParameterSets(accessUnit, pcSlice, writePS);
     1973#endif
     1974
     1975    if (writePS)
     1976#else
     1977    actualTotalBits += xWriteParameterSets(accessUnit, pcSlice, m_bSeqFirst);
     1978
    19551979    if ( m_bSeqFirst )
    1956     {
    1957       // write various parameter sets
    1958       actualTotalBits += xWriteParameterSets(accessUnit, pcSlice);
    1959 #if H_3D_PPS_FIX_DEPTH
    1960       if(!pcSlice->getIsDepth() || !pcSlice->getViewIndex() )
    1961       {
    1962 #endif
    1963 #if H_3D_PPS_FIX_DEPTH
    1964       }
    1965 #endif
    1966 
    1967 
     1980#endif
     1981    {
    19681982      // create prefix SEI messages at the beginning of the sequence
    19691983      assert(leadingSeiMessages.empty());
     
    19982012      m_pcEncTop->getRDGoOnSbacCoder()->setBitstream(&tempBitCounter);
    19992013      m_pcSAO->initRDOCabacCoder(m_pcEncTop->getRDGoOnSbacCoder(), pcSlice);
    2000 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
    20012014      m_pcSAO->SAOProcess(pcPic, sliceEnabled, pcPic->getSlice(0)->getLambdas(),
    20022015                          m_pcCfg->getTestSAODisableAtPictureLevel(),
     
    20052018                          m_pcCfg->getSaoCtuBoundary(),
    20062019                          m_pcCfg->getSaoResetEncoderStateAfterIRAP());
    2007 #else
    2008       m_pcSAO->SAOProcess(pcPic, sliceEnabled, pcPic->getSlice(0)->getLambdas(), m_pcCfg->getTestSAODisableAtPictureLevel(), m_pcCfg->getSaoEncodingRate(), m_pcCfg->getSaoEncodingRateChroma(), m_pcCfg->getSaoCtuBoundary());
    2009 #endif
    20102020      m_pcSAO->PCMLFDisableProcess(pcPic);
    20112021      m_pcEncTop->getRDGoOnSbacCoder()->setBitstream(NULL);
     
    21582168      trailingSeiMessages.push_back(decodedPictureHashSei);
    21592169    }
     2170
     2171    m_pcCfg->setEncodedFlag(iGOPid, true);
     2172
     2173    Double PSNR_Y;
     2174#if JVET_F0064_MSSSIM
     2175    xCalculateAddPSNRs( isField, isTff, iGOPid, pcPic, accessUnit, rcListPic, dEncTime, snr_conversion, printFrameMSE, printMSSSIM, &PSNR_Y );
     2176#else
     2177    xCalculateAddPSNRs( isField, isTff, iGOPid, pcPic, accessUnit, rcListPic, dEncTime, snr_conversion, printFrameMSE, &PSNR_Y );
     2178#endif
     2179   
     2180    // Only produce the Green Metadata SEI message with the last picture.
     2181    if( m_pcCfg->getSEIGreenMetadataInfoSEIEnable() && pcSlice->getPOC() == ( m_pcCfg->getFramesToBeEncoded() - 1 )  )
     2182    {
     2183      SEIGreenMetadataInfo *seiGreenMetadataInfo = new SEIGreenMetadataInfo;
     2184      m_seiEncoder.initSEIGreenMetadataInfo(seiGreenMetadataInfo, (UInt)(PSNR_Y * 100 + 0.5));
     2185      trailingSeiMessages.push_back(seiGreenMetadataInfo);
     2186    }
     2187   
    21602188    xWriteTrailingSEIMessages(trailingSeiMessages, accessUnit, pcSlice->getTLayer(), pcSlice->getSPS());
    2161 
    2162     m_pcCfg->setEncodedFlag(iGOPid, true);
    2163 
    2164     xCalculateAddPSNRs( isField, isTff, iGOPid, pcPic, accessUnit, rcListPic, dEncTime, snr_conversion, printFrameMSE );
    21652189
    21662190    printHash(m_pcCfg->getDecodedPictureHashSEIType(), digestStr);
     
    21872211        m_pcRateCtrl->getRCGOP()->updateAfterPicture( estimatedBits );
    21882212      }
    2189 #if U0132_TARGET_BITS_SATURATION
    21902213      if (m_pcRateCtrl->getCpbSaturationEnabled())
    21912214      {
     
    21932216        printf(" [CPB %6d bits]", m_pcRateCtrl->getCpbState());
    21942217      }
    2195 #endif
    21962218    }
    21972219
     
    22232245    iGOPid=effFieldIRAPMap.restoreGOPid(iGOPid);
    22242246    }
     2247#if REDUCED_ENCODER_MEMORY
     2248
     2249    pcPic->releaseReconstructionIntermediateData();
     2250    if (!isField) // don't release the source data for field-coding because the fields are dealt with in pairs. // TODO: release source data for interlace simulations.
     2251    {
     2252      pcPic->releaseEncoderSourceImageData();
     2253    }
     2254
     2255#endif
    22252256  } // iGOPid-loop
    22262257
     
    22322263}
    22332264
     2265#if JVET_F0064_MSSSIM
     2266Void TEncGOP::printOutSummary(UInt uiNumAllPicCoded, Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const Bool printMSSSIM, const BitDepths &bitDepths)
     2267#else
    22342268Void TEncGOP::printOutSummary(UInt uiNumAllPicCoded, Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const BitDepths &bitDepths)
     2269#endif
    22352270{
    22362271  assert (uiNumAllPicCoded == m_gcAnalyzeAll.getNumPic());
     
    22452280  const ChromaFormat chFmt = m_pcCfg->getChromaFormatIdc();
    22462281
     2282
     2283#if JVET_F0064_MSSSIM
    22472284  //-- all
    22482285#if NH_MV
     
    22512288  printf( "\n\nSUMMARY --------------------------------------------------------\n" );
    22522289#endif
     2290  m_gcAnalyzeAll.printOut('a', chFmt, printMSEBasedSNR, printSequenceMSE, printMSSSIM, bitDepths);
     2291
     2292  printf( "\n\nI Slices--------------------------------------------------------\n" );
     2293  m_gcAnalyzeI.printOut('i', chFmt, printMSEBasedSNR, printSequenceMSE, printMSSSIM, bitDepths);
     2294
     2295  printf( "\n\nP Slices--------------------------------------------------------\n" );
     2296  m_gcAnalyzeP.printOut('p', chFmt, printMSEBasedSNR, printSequenceMSE, printMSSSIM, bitDepths);
     2297
     2298  printf( "\n\nB Slices--------------------------------------------------------\n" );
     2299  m_gcAnalyzeB.printOut('b', chFmt, printMSEBasedSNR, printSequenceMSE, printMSSSIM, bitDepths);
     2300#else
     2301  //-- all
     2302#if NH_MV
     2303  printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() );
     2304#else
     2305  printf( "\n\nSUMMARY --------------------------------------------------------\n" );
     2306#endif
     2307
    22532308  m_gcAnalyzeAll.printOut('a', chFmt, printMSEBasedSNR, printSequenceMSE, bitDepths);
    22542309
     
    22612316  printf( "\n\nB Slices--------------------------------------------------------\n" );
    22622317  m_gcAnalyzeB.printOut('b', chFmt, printMSEBasedSNR, printSequenceMSE, bitDepths);
    2263 
     2318#endif
    22642319  if (!m_pcCfg->getSummaryOutFilename().empty())
    22652320  {
     
    22772332  {
    22782333    //-- interlaced summary
    2279 #if TEMPORAL_SUBSAMPLE
    22802334    m_gcAnalyzeAll_in.setFrmRate( m_pcCfg->getFrameRate() / (Double)m_pcCfg->getTemporalSubsampleRatio());
    2281 #else
    2282     m_gcAnalyzeAll_in.setFrmRate( m_pcCfg->getFrameRate());
    2283 #endif
    22842335    m_gcAnalyzeAll_in.setBits(m_gcAnalyzeAll.getBits());
    22852336    // prior to the above statement, the interlace analyser does not contain the correct total number of bits.
    22862337
    22872338    printf( "\n\nSUMMARY INTERLACED ---------------------------------------------\n" );
     2339#if JVET_F0064_MSSSIM
     2340    m_gcAnalyzeAll_in.printOut('a', chFmt, printMSEBasedSNR, printSequenceMSE, printMSSSIM, bitDepths);
     2341#else
    22882342    m_gcAnalyzeAll_in.printOut('a', chFmt, printMSEBasedSNR, printSequenceMSE, bitDepths);
     2343#endif
    22892344
    22902345    if (!m_pcCfg->getSummaryOutFilename().empty())
     
    23742429  }
    23752430
    2376 #if !NH_MV
    23772431  assert (rpcPic != NULL);
    2378 #endif
    23792432  assert (rpcPic->getPOC() == pocCurr);
    23802433
     
    24202473}
    24212474
    2422 Void TEncGOP::xCalculateAddPSNRs( const Bool isField, const Bool isFieldTopFieldFirst, const Int iGOPid, TComPic* pcPic, const AccessUnit&accessUnit, TComList<TComPic*> &rcListPic, const Double dEncTime, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE )
    2423 {
    2424   xCalculateAddPSNR( pcPic, pcPic->getPicYuvRec(), accessUnit, dEncTime, snr_conversion, printFrameMSE );
     2475#if JVET_F0064_MSSSIM
     2476Void TEncGOP::xCalculateAddPSNRs( const Bool isField, const Bool isFieldTopFieldFirst, const Int iGOPid, TComPic* pcPic, const AccessUnit&accessUnit, TComList<TComPic*> &rcListPic, const Double dEncTime, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, const Bool printMSSSIM, Double* PSNR_Y )
     2477{
     2478  xCalculateAddPSNR( pcPic, pcPic->getPicYuvRec(), accessUnit, dEncTime, snr_conversion, printFrameMSE, printMSSSIM, PSNR_Y );
     2479#else
     2480Void TEncGOP::xCalculateAddPSNRs( const Bool isField, const Bool isFieldTopFieldFirst, const Int iGOPid, TComPic* pcPic, const AccessUnit&accessUnit, TComList<TComPic*> &rcListPic, const Double dEncTime, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Double* PSNR_Y )
     2481{
     2482  xCalculateAddPSNR( pcPic, pcPic->getPicYuvRec(), accessUnit, dEncTime, snr_conversion, printFrameMSE, PSNR_Y );
     2483#endif
    24252484
    24262485  //In case of field coding, compute the interlaced PSNR for both fields
     
    24772536      if( (pcPic->isTopField() && isFieldTopFieldFirst) || (!pcPic->isTopField() && !isFieldTopFieldFirst))
    24782537      {
    2479         xCalculateInterlacedAddPSNR(pcPic, correspondingFieldPic, pcPic->getPicYuvRec(), correspondingFieldPic->getPicYuvRec(), snr_conversion, printFrameMSE );
     2538#if JVET_F0064_MSSSIM
     2539        xCalculateInterlacedAddPSNR(pcPic, correspondingFieldPic, pcPic->getPicYuvRec(), correspondingFieldPic->getPicYuvRec(), snr_conversion, printFrameMSE, printMSSSIM, PSNR_Y );
     2540#else
     2541        xCalculateInterlacedAddPSNR(pcPic, correspondingFieldPic, pcPic->getPicYuvRec(), correspondingFieldPic->getPicYuvRec(), snr_conversion, printFrameMSE, PSNR_Y );
     2542#endif
    24802543      }
    24812544      else
    24822545      {
    2483         xCalculateInterlacedAddPSNR(correspondingFieldPic, pcPic, correspondingFieldPic->getPicYuvRec(), pcPic->getPicYuvRec(), snr_conversion, printFrameMSE );
    2484       }
    2485     }
    2486   }
    2487 }
    2488 
    2489 Void TEncGOP::xCalculateAddPSNR( TComPic* pcPic, TComPicYuv* pcPicD, const AccessUnit& accessUnit, Double dEncTime, const InputColourSpaceConversion conversion, const Bool printFrameMSE )
     2546#if JVET_F0064_MSSSIM
     2547        xCalculateInterlacedAddPSNR(correspondingFieldPic, pcPic, correspondingFieldPic->getPicYuvRec(), pcPic->getPicYuvRec(), snr_conversion, printFrameMSE, printMSSSIM, PSNR_Y );
     2548#else
     2549        xCalculateInterlacedAddPSNR(correspondingFieldPic, pcPic, correspondingFieldPic->getPicYuvRec(), pcPic->getPicYuvRec(), snr_conversion, printFrameMSE, PSNR_Y );
     2550#endif
     2551      }
     2552    }
     2553  }
     2554}
     2555
     2556#if JVET_F0064_MSSSIM
     2557Void TEncGOP::xCalculateAddPSNR( TComPic* pcPic, TComPicYuv* pcPicD, const AccessUnit& accessUnit, Double dEncTime, const InputColourSpaceConversion conversion, const Bool printFrameMSE, const Bool printMSSSIM, Double* PSNR_Y )
     2558#else
     2559Void TEncGOP::xCalculateAddPSNR( TComPic* pcPic, TComPicYuv* pcPicD, const AccessUnit& accessUnit, Double dEncTime, const InputColourSpaceConversion conversion, const Bool printFrameMSE, Double* PSNR_Y )
     2560#endif
    24902561{
    24912562  Double  dPSNR[MAX_NUM_COMPONENT];
     
    25562627  }
    25572628
     2629#if EXTENSION_360_VIDEO
     2630  m_ext360.calculatePSNRs(pcPic);
     2631#endif
     2632
     2633#if JVET_F0064_MSSSIM
     2634  //===== calculate MS-SSIM =====
     2635  Double  MSSSIM[MAX_NUM_COMPONENT] = {0,0,0};
     2636  if (printMSSSIM)
     2637  {
     2638    for(Int chan=0; chan<pcPicD->getNumberValidComponents(); chan++)
     2639    {
     2640      const ComponentID ch  = ComponentID(chan);
     2641      const TComPicYuv *pOrgPicYuv =(conversion!=IPCOLOURSPACE_UNCHANGED) ? pcPic ->getPicYuvTrueOrg() : pcPic ->getPicYuvOrg();
     2642      const Pel*  pOrg      = pOrgPicYuv->getAddr(ch);
     2643      const Int   orgStride = pOrgPicYuv->getStride(ch);
     2644      const Pel*  pRec      = picd.getAddr(ch);
     2645      const Int   recStride = picd.getStride(ch);
     2646      const Int   width     = pcPicD->getWidth (ch) - (m_pcEncTop->getPad(0) >> pcPic->getComponentScaleX(ch));
     2647      const Int   height    = pcPicD->getHeight(ch) - ((m_pcEncTop->getPad(1) >> (pcPic->isField()?1:0)) >> pcPic->getComponentScaleY(ch));
     2648      const UInt  bitDepth  = pcPic->getPicSym()->getSPS().getBitDepth(toChannelType(ch));
     2649 
     2650      MSSSIM[ch] = xCalculateMSSSIM (pOrg, orgStride, pRec, recStride, width, height, bitDepth);
     2651    }
     2652  }
     2653#endif
     2654
     2655
    25582656#if NH_3D_VSO
    25592657#if H_3D_VSO_SYNTH_DIST_OUT
     
    25622660#endif
    25632661  /* calculate the size of the access unit, excluding:
    2564    *  - any AnnexB contributions (start_code_prefix, zero_byte, etc.,)
    25652662   *  - SEI NAL units
    25662663   */
     
    25762673    {
    25772674      numRBSPBytes += numRBSPBytes_nal;
     2675      // add start code bytes (Annex B)
     2676      if (it == accessUnit.begin() || (*it)->m_nalUnitType == NAL_UNIT_VPS || (*it)->m_nalUnitType == NAL_UNIT_SPS || (*it)->m_nalUnitType == NAL_UNIT_PPS)
     2677      {
     2678        numRBSPBytes += 4;
     2679      }
     2680      else
     2681      {
     2682        numRBSPBytes += 3;
     2683      }
    25782684    }
    25792685  }
     
    25832689
    25842690  //===== add PSNR =====
     2691#if JVET_F0064_MSSSIM
     2692  m_gcAnalyzeAll.addResult (dPSNR, (Double)uibits, MSEyuvframe, MSSSIM);
     2693#else
    25852694  m_gcAnalyzeAll.addResult (dPSNR, (Double)uibits, MSEyuvframe);
     2695#endif
     2696#if EXTENSION_360_VIDEO
     2697  m_ext360.addResult(m_gcAnalyzeAll);
     2698#endif
    25862699
    25872700  TComSlice*  pcSlice = pcPic->getSlice(0);
    25882701  if (pcSlice->isIntra())
    25892702  {
     2703#if JVET_F0064_MSSSIM
     2704    m_gcAnalyzeI.addResult (dPSNR, (Double)uibits, MSEyuvframe, MSSSIM);
     2705#else
    25902706    m_gcAnalyzeI.addResult (dPSNR, (Double)uibits, MSEyuvframe);
     2707#endif
     2708#if EXTENSION_360_VIDEO
     2709    m_ext360.addResult(m_gcAnalyzeI);
     2710#endif
     2711    *PSNR_Y = dPSNR[COMPONENT_Y];
    25912712  }
    25922713  if (pcSlice->isInterP())
    25932714  {
     2715#if JVET_F0064_MSSSIM
     2716    m_gcAnalyzeP.addResult (dPSNR, (Double)uibits, MSEyuvframe, MSSSIM);
     2717#else
    25942718    m_gcAnalyzeP.addResult (dPSNR, (Double)uibits, MSEyuvframe);
     2719#endif
     2720#if EXTENSION_360_VIDEO
     2721    m_ext360.addResult(m_gcAnalyzeP);
     2722#endif
     2723    *PSNR_Y = dPSNR[COMPONENT_Y];
    25952724  }
    25962725  if (pcSlice->isInterB())
    25972726  {
     2727#if JVET_F0064_MSSSIM
     2728    m_gcAnalyzeB.addResult (dPSNR, (Double)uibits, MSEyuvframe, MSSSIM);
     2729#else
    25982730    m_gcAnalyzeB.addResult (dPSNR, (Double)uibits, MSEyuvframe);
     2731#endif
     2732#if EXTENSION_360_VIDEO
     2733    m_ext360.addResult(m_gcAnalyzeB);
     2734#endif
     2735    *PSNR_Y = dPSNR[COMPONENT_Y];
    25992736  }
    26002737
     
    26472784  printf(" [Y %6.4lf dB    U %6.4lf dB    V %6.4lf dB]", dPSNR[COMPONENT_Y], dPSNR[COMPONENT_Cb], dPSNR[COMPONENT_Cr] );
    26482785#endif
     2786#if JVET_F0064_MSSSIM
     2787  if (printMSSSIM)
     2788  {
     2789    printf(" [MS-SSIM Y %1.6lf    U %1.6lf    V %1.6lf]", MSSSIM[COMPONENT_Y], MSSSIM[COMPONENT_Cb], MSSSIM[COMPONENT_Cr] );
     2790  } 
     2791#endif
    26492792  if (printFrameMSE)
    26502793  {
    26512794    printf(" [Y MSE %6.4lf  U MSE %6.4lf  V MSE %6.4lf]", MSEyuvframe[COMPONENT_Y], MSEyuvframe[COMPONENT_Cb], MSEyuvframe[COMPONENT_Cr] );
    26522795  }
     2796#if EXTENSION_360_VIDEO
     2797  m_ext360.printPerPOCInfo();
     2798#endif
    26532799  printf(" [ET %5.0f ]", dEncTime );
    26542800
     
    26792825}
    26802826
     2827#if JVET_F0064_MSSSIM
     2828Double TEncGOP::xCalculateMSSSIM (const Pel *pOrg, const Int orgStride, const Pel* pRec, const Int recStride, const Int width, const Int height, const UInt bitDepth)
     2829{
     2830  const Int MAX_MSSSIM_SCALE  = 5;
     2831  const Int WEIGHTING_MID_TAP = 5;
     2832  const Int WEIGHTING_SIZE    = WEIGHTING_MID_TAP*2+1;
     2833
     2834  UInt maxScale;
     2835
     2836  // For low resolution videos determine number of scales
     2837  if (width < 22 || height < 22)
     2838  {
     2839    maxScale = 1;
     2840  }
     2841  else if (width < 44 || height < 44)
     2842  {
     2843    maxScale = 2;
     2844  }
     2845  else if (width < 88 || height < 88)
     2846  {
     2847    maxScale = 3;
     2848  }
     2849  else if (width < 176 || height < 176)
     2850  {
     2851    maxScale = 4;
     2852  }
     2853  else
     2854  {
     2855    maxScale = 5;
     2856  }
     2857
     2858  assert(maxScale>0 && maxScale<=MAX_MSSSIM_SCALE);
     2859
     2860  //Normalized Gaussian mask design, 11*11, s.d. 1.5
     2861  Double weights[WEIGHTING_SIZE][WEIGHTING_SIZE];
     2862  {
     2863    Double coeffSum=0.0;
     2864    for(Int y=0; y<WEIGHTING_SIZE; y++)
     2865    {
     2866      for(Int x=0; x<WEIGHTING_SIZE; x++)
     2867      {
     2868        weights[y][x]=exp(-((y-WEIGHTING_MID_TAP)*(y-WEIGHTING_MID_TAP)+(x-WEIGHTING_MID_TAP)*(x-WEIGHTING_MID_TAP))/(WEIGHTING_MID_TAP-0.5));
     2869        coeffSum +=weights[y][x];
     2870      }
     2871    }
     2872
     2873    for(Int y=0; y<WEIGHTING_SIZE; y++)
     2874    {
     2875      for(Int x=0; x<WEIGHTING_SIZE; x++)
     2876      {
     2877        weights[y][x] /=coeffSum;
     2878      }
     2879    }
     2880  }
     2881
     2882  //Resolution based weights
     2883  const Double exponentWeights[MAX_MSSSIM_SCALE][MAX_MSSSIM_SCALE] = {{1.0,    0,      0,      0,      0     },
     2884                                                                      {0.1356, 0.8644, 0,      0,      0     },
     2885                                                                      {0.0711, 0.4530, 0.4760, 0,      0     },
     2886                                                                      {0.0517, 0.3295, 0.3462, 0.2726, 0     },
     2887                                                                      {0.0448, 0.2856, 0.3001, 0.2363, 0.1333}};
     2888
     2889  //Downsampling of data:
     2890  std::vector<Double> original[MAX_MSSSIM_SCALE];
     2891  std::vector<Double> recon[MAX_MSSSIM_SCALE];
     2892
     2893  for(UInt scale=0; scale<maxScale; scale++)
     2894  {
     2895    const Int scaledHeight = height >> scale;
     2896    const Int scaledWidth  = width  >> scale;
     2897    original[scale].resize(scaledHeight*scaledWidth, Double(0));
     2898    recon[scale].resize(scaledHeight*scaledWidth, Double(0));
     2899  }
     2900
     2901  // Initial [0] arrays to be a copy of the source data (but stored in array "Double", not Pel array).
     2902  for(Int y=0; y<height; y++)
     2903  {
     2904    for(Int x=0; x<width; x++)
     2905    {
     2906      original[0][y*width+x] = pOrg[y*orgStride+x];
     2907      recon[0][   y*width+x] = pRec[y*recStride+x];
     2908    }
     2909  }
     2910
     2911  // Set up other arrays to be average value of each 2x2 sample.
     2912  for(UInt scale=1; scale<maxScale; scale++)
     2913  {
     2914    const Int scaledHeight = height >> scale;
     2915    const Int scaledWidth  = width  >> scale;
     2916    for(Int y=0; y<scaledHeight; y++)
     2917    {
     2918      for(Int x=0; x<scaledWidth; x++)
     2919      {
     2920        original[scale][y*scaledWidth+x]= (original[scale-1][ 2*y   *(2*scaledWidth)+2*x  ] +
     2921                                           original[scale-1][ 2*y   *(2*scaledWidth)+2*x+1] +
     2922                                           original[scale-1][(2*y+1)*(2*scaledWidth)+2*x  ] +
     2923                                           original[scale-1][(2*y+1)*(2*scaledWidth)+2*x+1]) / 4.0;
     2924        recon[scale][y*scaledWidth+x]=    (   recon[scale-1][ 2*y   *(2*scaledWidth)+2*x  ] +
     2925                                              recon[scale-1][ 2*y   *(2*scaledWidth)+2*x+1] +
     2926                                              recon[scale-1][(2*y+1)*(2*scaledWidth)+2*x  ] +
     2927                                              recon[scale-1][(2*y+1)*(2*scaledWidth)+2*x+1]) / 4.0;
     2928      }
     2929    }
     2930  }
     2931 
     2932  // Calculate MS-SSIM:
     2933  const UInt   maxValue  = (1<<bitDepth)-1;
     2934  const Double c1        = (0.01*maxValue)*(0.01*maxValue);
     2935  const Double c2        = (0.03*maxValue)*(0.03*maxValue);
     2936 
     2937  Double finalMSSSIM = 1.0;
     2938
     2939  for(UInt scale=0; scale<maxScale; scale++)
     2940  {
     2941    const Int scaledHeight    = height >> scale;
     2942    const Int scaledWidth     = width  >> scale;
     2943    const Int blocksPerRow    = scaledWidth-WEIGHTING_SIZE+1;
     2944    const Int blocksPerColumn = scaledHeight-WEIGHTING_SIZE+1;
     2945    const Int totalBlocks     = blocksPerRow*blocksPerColumn;
     2946
     2947    Double meanSSIM= 0.0;
     2948
     2949    for(Int blockIndexY=0; blockIndexY<blocksPerColumn; blockIndexY++)
     2950    {
     2951      for(Int blockIndexX=0; blockIndexX<blocksPerRow; blockIndexX++)
     2952      {
     2953        Double muOrg          =0.0;
     2954        Double muRec          =0.0;
     2955        Double muOrigSqr      =0.0;
     2956        Double muRecSqr       =0.0;
     2957        Double muOrigMultRec  =0.0;
     2958
     2959        for(Int y=0; y<WEIGHTING_SIZE; y++)
     2960        {
     2961          for(Int x=0;x<WEIGHTING_SIZE; x++)
     2962          {
     2963            const Double gaussianWeight=weights[y][x];
     2964            const Int    sampleOffset=(blockIndexY+y)*scaledWidth+(blockIndexX+x);
     2965            const Double orgPel=original[scale][sampleOffset];
     2966            const Double recPel=   recon[scale][sampleOffset];
     2967
     2968            muOrg        +=orgPel*       gaussianWeight;
     2969            muRec        +=recPel*       gaussianWeight;
     2970            muOrigSqr    +=orgPel*orgPel*gaussianWeight;
     2971            muRecSqr     +=recPel*recPel*gaussianWeight;
     2972            muOrigMultRec+=orgPel*recPel*gaussianWeight;
     2973          }
     2974        }
     2975
     2976        const Double sigmaSqrOrig = muOrigSqr    -(muOrg*muOrg);
     2977        const Double sigmaSqrRec  = muRecSqr     -(muRec*muRec);
     2978        const Double sigmaOrigRec = muOrigMultRec-(muOrg*muRec);
     2979
     2980        Double blockSSIMVal = ((2.0*sigmaOrigRec + c2)/(sigmaSqrOrig+sigmaSqrRec + c2));
     2981        if(scale == maxScale-1)
     2982        {
     2983          blockSSIMVal*=(2.0*muOrg*muRec + c1)/(muOrg*muOrg+muRec*muRec + c1);
     2984        }
     2985
     2986        meanSSIM += blockSSIMVal;
     2987      }
     2988    }
     2989
     2990    meanSSIM /=totalBlocks;
     2991
     2992    finalMSSSIM *= pow(meanSSIM, exponentWeights[maxScale-1][scale]);
     2993  }
     2994
     2995  return finalMSSSIM;
     2996}
     2997#endif
     2998
     2999
    26813000Void TEncGOP::xCalculateInterlacedAddPSNR( TComPic* pcPicOrgFirstField, TComPic* pcPicOrgSecondField,
    26823001                                           TComPicYuv* pcPicRecFirstField, TComPicYuv* pcPicRecSecondField,
    2683                                            const InputColourSpaceConversion conversion, const Bool printFrameMSE )
     3002#if JVET_F0064_MSSSIM
     3003                                           const InputColourSpaceConversion conversion, const Bool printFrameMSE, const Bool printMSSSIM, Double* PSNR_Y )
     3004#else
     3005                                           const InputColourSpaceConversion conversion, const Bool printFrameMSE, Double* PSNR_Y )
     3006#endif
    26843007{
    26853008
     
    27553078  }
    27563079
     3080#if JVET_F0064_MSSSIM
     3081  //===== calculate MS-SSIM =====
     3082  Double MSSSIM[MAX_NUM_COMPONENT] = {0,0,0};
     3083  if (printMSSSIM)
     3084  {
     3085    for(Int chan=0; chan<numValidComponents; chan++)
     3086    {
     3087      const ComponentID ch=ComponentID(chan);
     3088      assert(apcPicRecFields[0]->getWidth(ch) ==apcPicRecFields[1]->getWidth(ch) );
     3089      assert(apcPicRecFields[0]->getHeight(ch)==apcPicRecFields[1]->getHeight(ch));
     3090
     3091      Double sumOverFieldsMSSSIM = 0.0;
     3092      const Int   width  = apcPicRecFields[0]->getWidth (ch) - ( m_pcEncTop->getPad(0)       >> apcPicRecFields[0]->getComponentScaleX(ch));
     3093      const Int   height = apcPicRecFields[0]->getHeight(ch) - ((m_pcEncTop->getPad(1) >> 1) >> apcPicRecFields[0]->getComponentScaleY(ch));
     3094
     3095      for(UInt fieldNum=0; fieldNum<2; fieldNum++)
     3096      {
     3097        TComPic    *pcPic      = apcPicOrgFields[fieldNum];
     3098        TComPicYuv *pcPicD     = apcPicRecFields[fieldNum];
     3099
     3100        const Pel*  pOrg       = (conversion!=IPCOLOURSPACE_UNCHANGED) ? pcPic ->getPicYuvTrueOrg()->getAddr(ch)   : pcPic ->getPicYuvOrg()->getAddr(ch);
     3101        const Int   orgStride  = (conversion!=IPCOLOURSPACE_UNCHANGED) ? pcPic ->getPicYuvTrueOrg()->getStride(ch) : pcPic ->getPicYuvOrg()->getStride(ch);
     3102        Pel*        pRec       = pcPicD->getAddr(ch);
     3103        const Int   recStride  = pcPicD->getStride(ch);
     3104        const UInt  bitDepth   = sps.getBitDepth(toChannelType(ch));
     3105
     3106        sumOverFieldsMSSSIM += xCalculateMSSSIM (pOrg, orgStride, pRec, recStride, width, height, bitDepth);
     3107      }
     3108
     3109      MSSSIM[ch] = sumOverFieldsMSSSIM/2;
     3110    }
     3111  }
     3112#endif
     3113
    27573114  UInt uibits = 0; // the number of bits for the pair is not calculated here - instead the overall total is used elsewhere.
    27583115
    27593116  //===== add PSNR =====
     3117#if JVET_F0064_MSSSIM
     3118  m_gcAnalyzeAll_in.addResult (dPSNR, (Double)uibits, MSEyuvframe, MSSSIM);
     3119#else
    27603120  m_gcAnalyzeAll_in.addResult (dPSNR, (Double)uibits, MSEyuvframe);
     3121#endif
     3122
     3123  *PSNR_Y = dPSNR[COMPONENT_Y];
    27613124
    27623125  printf("\n                                      Interlaced frame %d: [Y %6.4lf dB    U %6.4lf dB    V %6.4lf dB]", pcPicOrgSecondField->getPOC()/2 , dPSNR[COMPONENT_Y], dPSNR[COMPONENT_Cb], dPSNR[COMPONENT_Cr] );
     3126#if JVET_F0064_MSSSIM 
     3127  if (printMSSSIM)
     3128  {
     3129    printf(" [MS-SSIM Y %1.6lf    U %1.6lf    V %1.6lf]", MSSSIM[COMPONENT_Y], MSSSIM[COMPONENT_Cb], MSSSIM[COMPONENT_Cr] );
     3130  }
     3131#endif
    27633132  if (printFrameMSE)
    27643133  {
     
    31133482    {
    31143483      pcPic->getSlice(i)->setDeblockingFilterOverrideFlag(false);
    3115       pcPic->getSlice(i)->setDeblockingFilterDisable(        pcPic->getSlice(i)->getPPS()->getPicDisableDeblockingFilterFlag() );
     3484      pcPic->getSlice(i)->setDeblockingFilterDisable(        pcPic->getSlice(i)->getPPS()->getPPSDeblockingFilterDisabledFlag() );
    31163485      pcPic->getSlice(i)->setDeblockingFilterBetaOffsetDiv2( pcPic->getSlice(i)->getPPS()->getDeblockingFilterBetaOffsetDiv2() );
    31173486      pcPic->getSlice(i)->setDeblockingFilterTcOffsetDiv2(   pcPic->getSlice(i)->getPPS()->getDeblockingFilterTcOffsetDiv2()   );
     
    31203489}
    31213490
    3122 #if W0038_DB_OPT
    31233491Void TEncGOP::applyDeblockingFilterParameterSelection( TComPic* pcPic, const UInt numSlices, const Int gopID )
    31243492{
     
    32233591    {
    32243592      pcPic->getSlice(i)->setDeblockingFilterOverrideFlag(false);
    3225       pcPic->getSlice(i)->setDeblockingFilterDisable(        pcPic->getSlice(i)->getPPS()->getPicDisableDeblockingFilterFlag() );
     3593      pcPic->getSlice(i)->setDeblockingFilterDisable(        pcPic->getSlice(i)->getPPS()->getPPSDeblockingFilterDisabledFlag() );
    32263594      pcPic->getSlice(i)->setDeblockingFilterBetaOffsetDiv2( pcPic->getSlice(i)->getPPS()->getDeblockingFilterBetaOffsetDiv2() );
    32273595      pcPic->getSlice(i)->setDeblockingFilterTcOffsetDiv2(   pcPic->getSlice(i)->getPPS()->getDeblockingFilterTcOffsetDiv2()   );
     
    32393607  }
    32403608}
    3241 #endif
    32423609
    32433610#if NH_MV
Note: See TracChangeset for help on using the changeset viewer.