Ignore:
Timestamp:
11 Dec 2015, 00:05:48 (8 years ago)
Author:
seregin
Message:

infer parameters in SPS after activation, fixing chroma scaling for non 4:2:0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1499 r1502  
    524524        // it is needed where the VPS is accessed through the slice
    525525        pBLPic->getSlice(0)->setVPS( vps );
     526        pBLPic->getPicSym()->inferSpsForNonHEVCBL();
     527        pBLPic->getSlice(0)->setSPS( &pBLPic->getPicSym()->getSPS() );
    526528      }
    527529    }
     
    596598      assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma()         <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma());
    597599    }
     600
     601    updateSPS->inferSPS( m_layerId, vps );
    598602#endif //SVC_EXTENSION
    599603
     
    627631
    628632    // Initialise the various objects for the new set of settings
    629 #if SVC_EXTENSION
    630     m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_LUMA), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA) );
    631 #else
    632633    m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_LUMA), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA) );
    633 #endif
    634634    m_cLoopFilter.create( sps->getMaxTotalCUDepth() );
    635 #if SCALABLE_REXT
    636     m_cPrediction.initTempBuff(pSlice->getChromaFormatIdc());
    637 #else
    638635    m_cPrediction.initTempBuff(sps->getChromaFormatIdc());
    639 #endif
    640636
    641637
     
    692688
    693689    // Recursive structure
    694 #if SVC_EXTENSION
    695     m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), pSlice->getChromaFormatIdc() );
     690    m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() );
     691#if SVC_EXTENSION
    696692    m_cCuDecoder.init   ( m_ppcTDecTop, &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, m_layerId );
    697693#else
    698     m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() );
    699694    m_cCuDecoder.init   ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction );
    700695#endif
     
    13991394      if( pFile->good() )
    14001395      {
    1401         Bool is16bit  = pBLPic->getSlice(0)->getBitDepth(CHANNEL_TYPE_LUMA) > 8 || pBLPic->getSlice(0)->getBitDepth(CHANNEL_TYPE_CHROMA) > 8;
     1396        Bool is16bit  = pBLPic->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) > 8 || pBLPic->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) > 8;
    14021397        UInt uiWidth  = pBLPic->getPicYuvRec()->getWidth(COMPONENT_Y);
    14031398        UInt uiHeight = pBLPic->getPicYuvRec()->getHeight(COMPONENT_Y);
     
    17011696        if( pcSlice->getPPS()->getCGSFlag() && m_c3DAsymLUTPPS.isRefLayer( pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc) ) )
    17021697        {
    1703           assert( pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getBitDepth(CHANNEL_TYPE_LUMA) == m_c3DAsymLUTPPS.getInputBitDepthY() );
    1704           assert( pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getBitDepth(CHANNEL_TYPE_CHROMA) == m_c3DAsymLUTPPS.getInputBitDepthC() );
    1705           assert( pcSlice->getBitDepth(CHANNEL_TYPE_LUMA) >= m_c3DAsymLUTPPS.getOutputBitDepthY() );
    1706           assert( pcSlice->getBitDepth(CHANNEL_TYPE_LUMA) >= m_c3DAsymLUTPPS.getOutputBitDepthC() );
     1698          assert( pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) == m_c3DAsymLUTPPS.getInputBitDepthY() );
     1699          assert( pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) == m_c3DAsymLUTPPS.getInputBitDepthC() );
     1700          assert( pcSlice->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) >= m_c3DAsymLUTPPS.getOutputBitDepthY() );
     1701          assert( pcSlice->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) >= m_c3DAsymLUTPPS.getOutputBitDepthC() );
    17071702
    17081703          if( !m_pColorMappedPic )
     
    17211716          if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) )
    17221717          {
    1723             m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getBitDepth(CHANNEL_TYPE_LUMA), pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getBitDepth(CHANNEL_TYPE_CHROMA));
     1718            m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA), pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA));
    17241719          }
    17251720        }
     
    18961891        pcSlice->getSPS()->getMaxLog2TrDynamicRange(CHANNEL_TYPE_CHROMA)
    18971892    };
    1898 #if SVC_EXTENSION
    1899     m_cTrQuant.setFlatScalingList(maxLog2TrDynamicRange, pcSlice->getBitDepths());
    1900 #else
    19011893    m_cTrQuant.setFlatScalingList(maxLog2TrDynamicRange, pcSlice->getSPS()->getBitDepths());
    1902 #endif
    19031894    m_cTrQuant.setUseScalingList(false);
    19041895  }
     
    24592450    {
    24602451      m_pColorMappedPic = new TComPicYuv;
    2461       m_pColorMappedPic->create( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc()/*CHROMA_420*/, pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getSPS()->getMaxCUHeight(), pcSlice->getSPS()->getMaxTotalCUDepth(), true, NULL );
     2452      m_pColorMappedPic->create( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getSPS()->getMaxCUHeight(), pcSlice->getSPS()->getMaxTotalCUDepth(), true, NULL );
    24622453    }
    24632454  }
     
    26142605    TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec();
    26152606
    2616     const Int bitDepthLuma = vps.getBitDepth(CHANNEL_TYPE_LUMA, &sps, m_layerId);
    2617     const Int bitDepthChroma = vps.getBitDepth(CHANNEL_TYPE_CHROMA, &sps, m_layerId);
    2618     const Int refBitDepthLuma = (*(pcTDecTopBase->getListPic()->begin()))->getSlice(0)->getBitDepth(CHANNEL_TYPE_LUMA);
    2619     const Int refBitDepthChroma = (*(pcTDecTopBase->getListPic()->begin()))->getSlice(0)->getBitDepth(CHANNEL_TYPE_CHROMA);
     2607    const Int bitDepthLuma = sps.getBitDepth(CHANNEL_TYPE_LUMA);
     2608    const Int bitDepthChroma = sps.getBitDepth(CHANNEL_TYPE_CHROMA);
     2609    const Int refBitDepthLuma = (*(pcTDecTopBase->getListPic()->begin()))->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
     2610    const Int refBitDepthChroma = (*(pcTDecTopBase->getListPic()->begin()))->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA);
    26202611   
    26212612    Bool sameBitDepths = ( bitDepthLuma == refBitDepthLuma ) && ( bitDepthChroma == refBitDepthChroma );
    26222613
    2623     if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == vps.getPicWidthInLumaSamples(&sps, m_layerId) && pcPicYuvRecBase->getHeight(COMPONENT_Y) == vps.getPicHeightInLumaSamples(&sps, m_layerId) && equalOffsets && zeroPhase )
     2614    if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == sps.getPicWidthInLumaSamples() && pcPicYuvRecBase->getHeight(COMPONENT_Y) == sps.getPicHeightInLumaSamples() && equalOffsets && zeroPhase )
    26242615    {
    26252616      pic->setEqualPictureSizeAndOffsetFlag( i, true );
Note: See TracChangeset for help on using the changeset viewer.