Changeset 1053 in 3DVCSoftware


Ignore:
Timestamp:
25 Sep 2014, 02:15:29 (10 years ago)
Author:
qualcomm
Message:

Implementation of adoptions in:
G0131, G0031, H0042, I0044, I0045

submitted by Hendry (fhendry@…)

Location:
branches/HTM-12.0-dev0/source/Lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-12.0-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r1052 r1053  
    103103, m_temporalLayerNonReferenceFlag ( false )
    104104, m_enableTMVPFlag                ( true )
     105#if I0044_SLICE_TMVP
     106, m_availableForTMVPRefFlag       ( true )
     107#endif
    105108#if H_MV
    106109, m_refPicSetInterLayer0           ( NULL )
  • branches/HTM-12.0-dev0/source/Lib/TLibCommon/TComSlice.h

    r1039 r1053  
    996996  Void    setLayerSetIdxForOlsMinus1( Int outLayerSetIdx, Int val )        { m_layerSetIdxForOlsMinus1[ outLayerSetIdx ]  = val; }
    997997  Int     getLayerSetIdxForOlsMinus1( Int outLayerSetIdx )                 { return m_layerSetIdxForOlsMinus1[ outLayerSetIdx ]; }
     998#if VPS_MISC_UPDATES
     999  Int     getLayerSetIdxForOlsMinus1Len( Int outLayerSetIdx )              { return gCeilLog2( m_layerSetIdxForOlsMinus1[ outLayerSetIdx ] + 1 ); }
     1000#endif
    9981001
    9991002  Void    setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag )       { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; }
     
    21952198
    21962199  Bool       m_enableTMVPFlag;
     2200#if I0044_SLICE_TMVP
     2201  Bool       m_availableForTMVPRefFlag;
     2202#endif
     2203
    21972204#if H_MV
    21982205  std::vector<TComPic*>* m_refPicSetInterLayer0;
     
    25272534  Void      setEnableTMVPFlag     ( Bool   b )    { m_enableTMVPFlag = b; }
    25282535  Bool      getEnableTMVPFlag     ()              { return m_enableTMVPFlag;}
     2536#if I0044_SLICE_TMVP
     2537  Void      setAvailableForTMVPRefFlag     ( Bool   b )    { m_availableForTMVPRefFlag = b; }
     2538  Bool      getAvailableForTMVPRefFlag     ()              { return m_availableForTMVPRefFlag;}
     2539#endif
    25292540
    25302541#if H_MV
  • branches/HTM-12.0-dev0/source/Lib/TLibCommon/TypeDef.h

    r1052 r1053  
    382382
    383383//Added by Qualcomm for HLS
    384 #define DISCARDABLE_PIC_RPS        1      ///< JCTVC-G0131: Inter-layer RPS and temporal RPS should not contain picture with discardable_flag equal to 1
     384#define DISCARDABLE_PIC_RPS              1      ///< JCT3V-G0131: Inter-layer RPS and temporal RPS should not contain picture with discardable_flag equal to 1
     385#define VPS_MISC_UPDATES                 1      ///< Misc updates:JCT3V-0240,
     386#define NON_REF_NAL_TYPE_DISCARDABLE     1      ///< JCT3V-G0031: If discardable picture is a non-IRAP, it must be a non-referenced sub-layer picture
     387#define INFERENCE_POC_MSB_VAL_PRESENT    1      ///< JCT3V-H0042: poc_msb_val_present_flag shall be equal to 0 when slice_header_extension_length is (inferred to be ) equal to 0
     388#define INFERENCE_POC_RESET_INFO_PRESENT 1      ///< JCT3V-H0042: Infer the value of poc_reset_info_present_flag to be equal to 0 when no pps extension / pps extension for multilayer.
     389#define I0044_SLICE_TMVP                 1      ///< JCT3V-I0044: Regarding slice_temporal_mvp_enabled_flag
     390#define I0045_BR_PR_ADD_LAYER_SET        1      ///< JCT3V-I0045: Signalling of bit-rate and picture rate for additional layer set
     391#define I0045_VPS_VUI_VST_PARAMS         1      ///< JCT3V-I0045: Related to signalling of VST parameters of the base layer.
    385392
    386393// TBD: Check if integration is necessary.
  • branches/HTM-12.0-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1039 r1053  
    392392      READ_FLAG( uiCode, "pps_extension_reserved_zero_flag" );
    393393    }
     394#if INFERENCE_POC_RESET_INFO_PRESENT
     395    pcPPS->setPocResetInfoPresentFlag( false );
     396#endif
    394397#if !H_3D
    395398    if ( pcPPS->getPpsExtension6bits() )
     
    414417#endif
    415418  }
     419#if INFERENCE_POC_RESET_INFO_PRESENT
     420  else
     421  {
     422    pcPPS->setPpsRangeExtensionsFlag( false );
     423    pcPPS->setPpsMultilayerExtensionFlag( false );
     424    pcPPS->setPps3dExtensionFlag( false );
     425    pcPPS->setPocResetInfoPresentFlag( false );
     426  }
     427#endif
    416428}
    417429
     
    12741286    }
    12751287  }
     1288
     1289#if VPS_MISC_UPDATES   //These codes are moved from below
     1290  if ( pcVPS->getNumIndependentLayers() > 1 )
     1291  {
     1292   READ_UVLC( uiCode, "num_add_layer_sets"      ); pcVPS->setNumAddLayerSets( uiCode );
     1293  }
     1294  for (Int i = 0; i < pcVPS->getNumAddLayerSets(); i++)
     1295  {
     1296    for (Int j = 0; j < pcVPS->getNumIndependentLayers(); j++)
     1297    {
     1298      READ_CODE( pcVPS->getHighestLayerIdxPlus1Len( j ) , uiCode, "highest_layer_idx_plus1" ); pcVPS->setHighestLayerIdxPlus1( i, j, uiCode );
     1299    }
     1300  }
     1301#endif
     1302
    12761303  pcVPS->setRefLayers();
    12771304  READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag" ); pcVPS->setVpsSubLayersMaxMinus1PresentFlag( uiCode == 1 );
     
    13221349  }
    13231350
     1351#if !VPS_MISC_UPDATES   //These codes are moved to earlier position.
    13241352  if ( pcVPS->getNumIndependentLayers() > 1 )
    13251353  {
     
    13331361    }
    13341362  }
     1363#endif
     1364
    13351365  if (pcVPS->getNumLayerSets() > 1)
    13361366  {
     
    13511381    if( i >= pcVPS->getNumLayerSets( ) )   
    13521382    {       
     1383#if !VPS_MISC_UPDATES
    13531384      READ_UVLC( uiCode,      "layer_set_idx_for_ols_minus1[i]" ); pcVPS->setLayerSetIdxForOlsMinus1( i, uiCode );
    1354     }
    1355 
     1385#else
     1386      READ_CODE( pcVPS->getLayerSetIdxForOlsMinus1Len( i ), uiCode, "layer_set_idx_for_ols_minus1[i]" ); pcVPS->setLayerSetIdxForOlsMinus1( i, uiCode );
     1387#endif
     1388    }
     1389
     1390#if !VPS_MISC_UPDATES
    13561391    if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultOutputLayerIdc() == 2 )
     1392#else
     1393    if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultOutputLayerIdc() >= 2 )  //According to the spec, value 3 shall be treated as 2
     1394#endif
    13571395    {       
    13581396      for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx( i ) ); j++ )
     
    15211559  if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    15221560  {
     1561#if I0045_BR_PR_ADD_LAYER_SET
     1562    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <  pcVPS->getNumLayerSets(); i++ )
     1563#else
    15231564    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
     1565#endif
    15241566    {
    15251567      for( Int j = 0; j  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ )
     
    15541596  else
    15551597  {
     1598#if I0045_VPS_VUI_VST_PARAMS
     1599    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() - pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1);
     1600#else
    15561601    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() );
     1602#endif
    15571603  }
    15581604
     
    15651611  }
    15661612
     1613#if I0045_VPS_VUI_VST_PARAMS
     1614  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
     1615  {
     1616    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1617    {
     1618      READ_CODE( 4, uiCode, "vps_video_signal_info_idx" ); pcVPSVUI->setVpsVideoSignalInfoIdx( i, uiCode );
     1619    }
     1620  }
     1621  else if ( !pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
     1622  {
     1623    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1624    {
     1625      pcVPSVUI->setVpsVideoSignalInfoIdx( i, i );
     1626    }
     1627  }
     1628  else
     1629  {
     1630    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1631    {
     1632      pcVPSVUI->setVpsVideoSignalInfoIdx( i, 0 );
     1633    }
     1634  }
     1635#else
    15671636  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
    15681637  {
     
    15801649    }
    15811650  }
     1651#endif
    15821652  READ_FLAG( uiCode, "tiles_not_in_use_flag" ); pcVPSVUI->setTilesNotInUseFlag( uiCode == 1 );
    15831653  if( !pcVPSVUI->getTilesNotInUseFlag() )
     
    16411711  if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
    16421712  {
     1713#if VPS_MISC_UPDATES
     1714    assert(pcVPS->getTimingInfo()->getTimingInfoPresentFlag() == 1);
     1715#endif
    16431716    parseVpsVuiBspHrdParameters( pcVPS );
    16441717  }
     
    20082081      esb++;
    20092082      READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 );
     2083#if NON_REF_NAL_TYPE_DISCARDABLE
     2084      if ( uiCode == 1 )
     2085      {
     2086        assert(rpcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_TRAIL_R &&
     2087          rpcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_TSA_R &&
     2088          rpcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_STSA_R &&
     2089          rpcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RADL_R &&
     2090          rpcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RASL_R);
     2091      }
     2092#endif
    20102093    }
    20112094
     
    22872370      if (rpcSlice->getSPS()->getTMVPFlagsPresent())
    22882371      {
     2372#if I0044_SLICE_TMVP
     2373        READ_FLAG( uiCode, "slice_temporal_mvp_enabled_flag" );
     2374#else
    22892375        READ_FLAG( uiCode, "slice_temporal_mvp_enable_flag" );
     2376#endif
    22902377        rpcSlice->setEnableTMVPFlag( uiCode == 1 ? true : false );
    22912378      }
     
    27232810#endif
    27242811  }
     2812#if INFERENCE_POC_MSB_VAL_PRESENT
     2813  else
     2814  {
     2815    rpcSlice->setSliceSegmentHeaderExtensionLength( 0 );
     2816    rpcSlice->setPocMsbValPresentFlag( false );
     2817  }
     2818#endif
    27252819
    27262820
  • branches/HTM-12.0-dev0/source/Lib/TLibDecoder/TDecTop.cpp

    r976 r1053  
    909909   }
    910910#endif
     911   
     912#if I0044_SLICE_TMVP
     913  if ( m_apcSlicePilot->getTLayer() == 0 && m_apcSlicePilot->getEnableTMVPFlag() == 0 )
     914  {
     915    //update all pics in the DPB such that they cannot be used for TMPV ref
     916    TComList<TComPic*>::iterator  iterRefPic = m_cListPic.begin(); 
     917    while( iterRefPic != m_cListPic.end() )
     918    {
     919      TComPic *refPic = *iterRefPic;
     920      if( ( refPic->getLayerId() == m_apcSlicePilot->getLayerId() ) && refPic->getReconMark() )
     921      {
     922        for(Int i = refPic->getNumAllocatedSlice()-1; i >= 0; i--)
     923        {
     924
     925          TComSlice *refSlice = refPic->getSlice(i);
     926          refSlice->setAvailableForTMVPRefFlag( false );
     927        }
     928      }
     929      iterRefPic++;
     930    }
     931  }
     932  m_apcSlicePilot->setAvailableForTMVPRefFlag( true );
     933#endif
     934
    911935  xActivateParameterSets();
    912936
     
    11321156#endif   
    11331157#endif
     1158
     1159#if I0044_SLICE_TMVP
     1160    if( m_layerId > 0 && !pcSlice->isIntra() && pcSlice->getEnableTMVPFlag() )
     1161    {
     1162      TComPic* refPic = pcSlice->getRefPic(RefPicList(1 - pcSlice->getColFromL0Flag()), pcSlice->getColRefIdx());
     1163
     1164      assert ( refPic );
     1165      assert ( refPic->getPicSym()->getSlice(0)->getAvailableForTMVPRefFlag() == true );
     1166    }
     1167#endif
     1168
    11341169    // For generalized B
    11351170    // note: maybe not existed case (always L0 is copied to L1 if L1 is empty)
  • branches/HTM-12.0-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1039 r1053  
    10121012#if H_MV
    10131013Void TEncCavlc::codeVPSExtension( TComVPS *pcVPS )
    1014 
     1014{
     1015  //TODO: ADD implementation for PTL. Need to add level info in each layer.
    10151016  WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
    10161017
     
    10841085  }
    10851086
     1087#if VPS_MISC_UPDATES   //These codes are moved from below.
     1088  if ( pcVPS->getNumIndependentLayers() > 1 )
     1089  {
     1090   WRITE_UVLC( pcVPS->getNumAddLayerSets( ), "num_add_layer_sets" );
     1091  }
     1092  for (Int i = 0; i < pcVPS->getNumAddLayerSets(); i++)
     1093  {
     1094    for (Int j = 0; j < pcVPS->getNumIndependentLayers(); j++)
     1095    {
     1096      WRITE_CODE( pcVPS->getHighestLayerIdxPlus1( i, j ), pcVPS->getHighestLayerIdxPlus1Len( j )  , "highest_layer_idx_plus1" );
     1097    }
     1098  }
     1099#endif
     1100
    10861101  WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" );
    10871102  if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() )
     
    11251140  }
    11261141
     1142#if !VPS_MISC_UPDATES
    11271143  if ( pcVPS->getNumIndependentLayers() > 1 )
    11281144  {
     
    11361152    }
    11371153  }
     1154#endif
     1155
    11381156  if (pcVPS->getNumLayerSets() > 1)
    11391157  {
     
    11521170    if( i >= pcVPS->getNumLayerSets( ) )   
    11531171    {     
     1172#if !VPS_MISC_UPDATES
    11541173      WRITE_UVLC( pcVPS->getLayerSetIdxForOlsMinus1( i ),      "layer_set_idx_for_ols_minus1[i]" );
    1155     }
    1156 
     1174#else
     1175      WRITE_CODE( pcVPS->getLayerSetIdxForOlsMinus1( i ), pcVPS->getLayerSetIdxForOlsMinus1Len( i ) ,      "layer_set_idx_for_ols_minus1[i]" );
     1176#endif
     1177    }
     1178
     1179#if !VPS_MISC_UPDATES
    11571180    if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultOutputLayerIdc() == 2 )
     1181#else
     1182    if ( i > pcVPS->getVpsNumLayerSetsMinus1() || pcVPS->getDefaultOutputLayerIdc() >= 2 ) //according to the flag value 3 shall be treated as 2.
     1183#endif
    11581184    {       
    11591185      for( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx( i ) ); j++ )
     
    13711397  if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    13721398  {
     1399#if I0045_BR_PR_ADD_LAYER_SET
     1400    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <  pcVPS->getNumLayerSets(); i++ )
     1401#else
    13731402    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
     1403#endif
    13741404    {
    13751405      for( Int j = 0; j  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ )
     
    14041434  else
    14051435  {
     1436#if I0045_VPS_VUI_VST_PARAMS
     1437    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() - pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1 );
     1438#else
    14061439    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() );
     1440#endif
    14071441  }
    14081442
     
    14171451  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
    14181452  {
     1453#if I0045_VPS_VUI_VST_PARAMS
     1454    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1455    {
     1456      WRITE_CODE( pcVPSVUI->getVpsVideoSignalInfoIdx( i ), 4, "vps_video_signal_info_idx" );
     1457    }
     1458#else
    14191459    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
    14201460    {
     
    14291469      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i  ) == ( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ) );
    14301470    }
     1471#endif
    14311472  }
    14321473  WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" );
     
    17331774      esb++;
    17341775      WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" );
     1776#if NON_REF_NAL_TYPE_DISCARDABLE
     1777      if (pcSlice->getDiscardableFlag( ))
     1778      {
     1779        assert(pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_TRAIL_R &&
     1780          pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_TSA_R &&
     1781          pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_STSA_R &&
     1782          pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RADL_R &&
     1783          pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RASL_R);
     1784      }
     1785#endif
    17351786    }
    17361787
     
    18931944      if (pcSlice->getSPS()->getTMVPFlagsPresent())
    18941945      {
     1946#if I0044_SLICE_TMVP
     1947        WRITE_FLAG( pcSlice->getEnableTMVPFlag() ? 1 : 0, "slice_temporal_mvp_enabled_flag" );
     1948#else
    18951949        WRITE_FLAG( pcSlice->getEnableTMVPFlag() ? 1 : 0, "slice_temporal_mvp_enable_flag" );
     1950#endif
    18961951      }
    18971952    }
Note: See TracChangeset for help on using the changeset viewer.