Changeset 1084 in SHVCSoftware for branches/SHM-dev/source


Ignore:
Timestamp:
26 Mar 2015, 01:03:53 (10 years ago)
Author:
seregin
Message:

fix for the sample and motion prediction flags, problem was reported by Yong He <Yong.He@…>

Location:
branches/SHM-dev/source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r1070 r1084  
    20382038    else
    20392039    {
     2040      if( layer == 0 )
     2041      {
     2042        m_profileList[0] = Profile::Name(extendedProfile[0]);
     2043      }
     2044
    20402045      m_profileList[layerPTLIdx] = Profile::Name(extendedProfile[layerPTLIdx]);
    20412046    }
     
    33243329    assert(m_levelList[0] >= m_levelList[1]);            //Level IDC of VpsProfileTierLevel[ 0 ] should not be less than level IDC of VpsProfileTierLevel[ 1 ].
    33253330                                                         //NOTE that this is not conformance constraint but it would be nice if our encoder can prevent inefficient level IDC assignment
    3326     if (m_levelList[0] == m_levelList[1]) printf("Warning: Level0 is set the same as Level1\n");
     3331    if (m_levelList[0] == m_levelList[1])
     3332    {
     3333      printf("Warning: Level0 is set the same as Level1\n");
     3334    }
    33273335  }
    33283336#else
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1078 r1084  
    19951995        {
    19961996          // check for the sample prediction picture type
    1997           if( m_ppcTDecTop[m_layerId]->getSamplePredEnabledFlag(pcSlice->getVPS()->getLayerIdxInVps(refLayerId)))
     1997          if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) )
    19981998          {
    19991999#if O0215_PHASE_ALIGNMENT_REMOVAL
     
    21442144      if( refPic->isILR(pcSlice->getLayerId()) )
    21452145      {
    2146         assert( m_ppcTDecTop[m_layerId]->getMotionPredEnabledFlag( refPic->getLayerIdx() ) );
     2146        assert( pcSlice->getVPS()->isMotionPredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), refPic->getLayerIdx() ) );
    21472147      }
    21482148    }
     
    27852785    decTop->setNumMotionPredRefLayers(0);
    27862786    decTop->setNumDirectRefLayers(0);
    2787     for(Int i = 0; i < MAX_VPS_LAYER_IDX_PLUS1; i++)
    2788     {
    2789       decTop->setSamplePredEnabledFlag(i, false);
    2790       decTop->setMotionPredEnabledFlag(i, false);
    2791       decTop->setSamplePredRefLayerId(i, 0);
    2792       decTop->setMotionPredRefLayerId(i, 0);
    2793     }
     2787
    27942788    for(Int j = 0; j < layerIdx; j++)
    27952789    {
     
    28002794
    28012795        Int samplePredEnabledFlag = (vps->getDirectDependencyType(layerIdx, j) + 1) & 1;
    2802         decTop->setSamplePredEnabledFlag(j, samplePredEnabledFlag == 1 ? true : false);
    28032796        decTop->setNumSamplePredRefLayers(decTop->getNumSamplePredRefLayers() + samplePredEnabledFlag);
    28042797
    28052798        Int motionPredEnabledFlag = ((vps->getDirectDependencyType(layerIdx, j) + 1) & 2) >> 1;
    2806         decTop->setMotionPredEnabledFlag(j, motionPredEnabledFlag == 1 ? true : false);
    28072799        decTop->setNumMotionPredRefLayers(decTop->getNumMotionPredRefLayers() + motionPredEnabledFlag);
    2808       }
    2809     }
    2810   }
    2811   for( Int i = 1; i < m_numLayer; i++ )
    2812   {
    2813     Int mIdx = 0, sIdx = 0;
    2814     TDecTop *decTop = (TDecTop *)getLayerDec(vps->getLayerIdInNuh(i));
    2815     for ( Int j = 0; j < i; j++ )
    2816     {
    2817       if (decTop->getMotionPredEnabledFlag(j))
    2818       {
    2819         decTop->setMotionPredRefLayerId(mIdx++, vps->getLayerIdInNuh(j));
    2820       }
    2821       if (decTop->getSamplePredEnabledFlag(j))
    2822       {
    2823         decTop->setSamplePredRefLayerId(sIdx++, vps->getLayerIdInNuh(j));
    28242800      }
    28252801    }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h

    r1073 r1084  
    151151  Int                     m_refLayerId[MAX_VPS_LAYER_IDX_PLUS1];
    152152  Int                     m_numSamplePredRefLayers;
    153   Int                     m_samplePredRefLayerId[MAX_VPS_LAYER_IDX_PLUS1];
    154153  Int                     m_numMotionPredRefLayers;
    155   Int                     m_motionPredRefLayerId[MAX_VPS_LAYER_IDX_PLUS1];
    156   Bool                    m_samplePredEnabledFlag[MAX_VPS_LAYER_IDX_PLUS1];
    157   Bool                    m_motionPredEnabledFlag[MAX_VPS_LAYER_IDX_PLUS1];
    158154#endif
    159155  TComPic*                m_cIlpPic[MAX_NUM_REF];                    ///<  Inter layer Prediction picture =  upsampled picture
     
    273269  Void      setNumSamplePredRefLayers       (Int num)                       { m_numSamplePredRefLayers = num;   }
    274270
    275   Int       getSamplePredRefLayerId         (Int layerIdc)                  { return m_samplePredRefLayerId[layerIdc];       }
    276   Void      setSamplePredRefLayerId         (Int layerIdc, Int refLayerId)  { m_samplePredRefLayerId[layerIdc] = refLayerId; }
    277 
    278271  Int       getNumMotionPredRefLayers       ()                              { return m_numMotionPredRefLayers;  }
    279272  Void      setNumMotionPredRefLayers       (Int num)                       { m_numMotionPredRefLayers = num;   }
    280 
    281   Int       getMotionPredRefLayerId         (Int layerIdc)                  { return m_motionPredRefLayerId[layerIdc];       }
    282   Void      setMotionPredRefLayerId         (Int layerIdc, Int refLayerId)  { m_motionPredRefLayerId[layerIdc] = refLayerId; }
    283 
    284   Bool      getSamplePredEnabledFlag        (Int layerIdx)                  { return m_samplePredEnabledFlag[layerIdx];  }
    285   Void      setSamplePredEnabledFlag        (Int layerIdx, Bool flag)       { m_samplePredEnabledFlag[layerIdx] = flag;  }
    286 
    287   Bool      getMotionPredEnabledFlag        (Int layerIdx)                  { return m_motionPredEnabledFlag[layerIdx];  }
    288   Void      setMotionPredEnabledFlag        (Int layerIdx, Bool flag)       { m_motionPredEnabledFlag[layerIdx] = flag;  }
    289273
    290274  Void      setRefLayerParams( TComVPS* vps );
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1082 r1084  
    14201420        {
    14211421          // check for the sample prediction picture type
    1422           if( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag(pcSlice->getVPS()->getLayerIdxInVps(refLayerId)))
     1422          if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) )
    14231423          {
    14241424#if P0312_VERT_PHASE_ADJ
     
    18461846        for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
    18471847        {
    1848           if( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag( pcSlice->getInterLayerPredLayerIdc(i) ) )
     1848          if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getInterLayerPredLayerIdc(i) ) )
    18491849          {
    18501850            foundSamplePredPicture = true;
     
    19741974          // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture,
    19751975          // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture.
    1976           if( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getMotionPredEnabledFlag( refPic->getLayerIdx() )
     1976          if( refPic->isILR(m_layerId) && pcSlice->getVPS()->isMotionPredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), refPic->getLayerIdx() )
    19771977#if MFM_ENCCONSTRAINT
    19781978            && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerIdx()]->getListPic() )->checkSameRefInfo() == true
     
    19961996            // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture,
    19971997            // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture.
    1998             if( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getMotionPredEnabledFlag( refPic->getLayerIdx() )
     1998            if( refPic->isILR(m_layerId) && pcSlice->getVPS()->isMotionPredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), refPic->getLayerIdx() )
    19991999#if MFM_ENCCONSTRAINT
    20002000              && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerIdx()]->getListPic() )->checkSameRefInfo() == true
     
    21152115        // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture,
    21162116        // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture.
    2117         if( refPic->isILR(m_layerId) && !m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getMotionPredEnabledFlag(refPic->getLayerIdx()) )
     2117        if( refPic->isILR(m_layerId) && !pcSlice->getVPS()->isMotionPredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), refPic->getLayerIdx() ) )
    21182118        {
    21192119          pcSlice->setEnableTMVPFlag(false);
     
    21332133          TComPic* refPic = pcSlice->getRefPic(refList, refIdx);
    21342134
    2135           if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag( refPic->getLayerIdx() ) ) )
     2135          if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), refPic->getLayerIdx() ) ) )
    21362136          {
    21372137            break;
     
    21572157          TComPic* refPic = pcSlice->getRefPic(refList, refIdx);
    21582158
    2159           if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag( refPic->getLayerIdx() ) ) )
     2159          if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), refPic->getLayerIdx() ) ) )
    21602160          {
    21612161            break;
Note: See TracChangeset for help on using the changeset viewer.