Changeset 498 in 3DVCSoftware


Ignore:
Timestamp:
26 Jun 2013, 23:47:59 (11 years ago)
Author:
tech
Message:

Further fixes and new nonctc cfg files.

Location:
branches/HTM-DEV-0.3-dev0
Files:
11 added
9 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev0/source/App/TAppEncoder/TAppEncTop.cpp

    r495 r498  
    10881088{   
    10891089  // Layer sets
    1090   vps.setVpsNumLayerSetsMinus1   ( m_vpsNumLayerSets );
    1091   vps.setVpsNumberLayerSetsMinus1( m_vpsNumLayerSets );
     1090  vps.setVpsNumLayerSetsMinus1   ( m_vpsNumLayerSets - 1 );
     1091  vps.setVpsNumberLayerSetsMinus1( vps.getVpsNumLayerSetsMinus1() );
    10921092   
    10931093  for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++ )
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComRom.h

    r496 r498  
    162162
    163163#ifndef ENC_DEC_TRACE
    164 # define ENC_DEC_TRACE 0
     164# define ENC_DEC_TRACE 1
    165165#endif
    166166
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r497 r498  
    10071007  m_enableTMVPFlag                = pSrc->m_enableTMVPFlag;
    10081008  m_maxNumMergeCand               = pSrc->m_maxNumMergeCand;
     1009
     1010#if H_MV
     1011  // Additional slice header syntax elements
     1012  m_discardableFlag            = pSrc->m_discardableFlag;
     1013  m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
     1014  m_numInterLayerRefPicsMinus1 = pSrc->m_numInterLayerRefPicsMinus1;
     1015
     1016  for (Int layer = 0; layer < MAX_NUM_LAYERS; layer++ )
     1017  {
     1018    m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ];
     1019  }
     1020 
     1021  m_interLayerSamplePredOnlyFlag = pSrc->m_interLayerSamplePredOnlyFlag;
     1022  m_altCollocatedIndicationFlag  = pSrc->m_altCollocatedIndicationFlag ;   
     1023  m_collocatedRefLayerIdx        = pSrc->m_collocatedRefLayerIdx       ;
     1024  m_numActiveMotionPredRefLayers = pSrc->m_numActiveMotionPredRefLayers;
     1025
     1026  for (Int layer = 0; layer < MAX_NUM_LAYER_IDS; layer++)
     1027  {   
     1028    m_interLayerPredLayerIdc[layer] = pSrc->m_interLayerPredLayerIdc[layer];
     1029  }
     1030#endif
    10091031}
    10101032
     
    15771599Bool TComVPS::checkVPSExtensionSyntax()
    15781600{
    1579   // check splitting flag constraint
    1580   if ( getSplittingFlag() )
    1581   {
    1582     // Derive dimBitOffset[j]
    1583     Int dimBitOffset[MAX_NUM_SCALABILITY_TYPES+1];
    1584     Int numScalabilityTypes = getNumScalabilityTypes();
    1585     dimBitOffset[0] = 0;
    1586 
    1587     for (Int type = 1; type <= numScalabilityTypes; type++ )
    1588     {
    1589       dimBitOffset[ type ] = 0;
    1590       for (Int dimIdx = 0; dimIdx <= type - 1; dimIdx++)
    1591         dimBitOffset[ type ] += ( getDimensionIdLen( dimIdx ) );
    1592     }
    1593 
    1594     for (Int type = 0; type < getNumScalabilityTypes(); type++ )
    1595     {
    1596       for( Int layer = 1; layer < getMaxLayers(); layer++ )
    1597       {
    1598         assert( getDimensionId( layer, type ) == ( ( getLayerIdInNuh( layer ) & ( (1 << dimBitOffset[ type + 1 ] ) - 1) ) >> dimBitOffset[ type ] ) );
    1599       };
    1600   };
    1601   }
    1602 
    16031601  for( Int layer = 1; layer < getMaxLayers(); layer++ )
    16041602  {
     
    16271625  return scalIdx;
    16281626}
    1629 
    1630 
    16311627
    16321628Void TComVPS::setScalabilityMask( UInt val )
     
    17541750}
    17551751
     1752
     1753Int TComVPS::xGetDimBitOffset( Int j )
     1754{
     1755  Int dimBitOffset = 0;
     1756  if ( getSplittingFlag() && j == getNumScalabilityTypes() )
     1757  {
     1758     dimBitOffset = 6;
     1759  }
     1760  else
     1761  {
     1762    for (Int dimIdx = 0; dimIdx <= j-1; dimIdx++)
     1763    {
     1764      dimBitOffset += getDimensionIdLen( dimIdx );
     1765    }
     1766  }
     1767  return dimBitOffset;
     1768}
     1769
     1770Int TComVPS::inferDimensionId( Int i, Int j )
     1771{
     1772    return ( ( getLayerIdInNuh( i ) & ( (1 << xGetDimBitOffset( j + 1 ) ) - 1) ) >> xGetDimBitOffset( j ) );
     1773}
     1774
     1775Int TComVPS::inferLastDimsionIdLen()
     1776{
     1777  return ( 5 - xGetDimBitOffset( getNumScalabilityTypes() - 1 ) );
     1778}
     1779
     1780Int TComVPS::getNumLayersInIdList( Int lsIdx )
     1781{
     1782  assert( lsIdx >= 0 );
     1783  assert( lsIdx <= getVpsNumLayerSetsMinus1() );
     1784  Int numLayersInIdList = 0;
     1785  for (Int layerId = 0; layerId < getVpsMaxLayerId(); layerId++ )
     1786  {
     1787    numLayersInIdList += ( getLayerIdIncludedFlag( lsIdx, layerId ) );
     1788  }
     1789  return numLayersInIdList;
     1790}
    17561791#endif // H_MV
    17571792
     
    24362471}
    24372472
     2473Int TComSlice::getNumActiveRefLayerPics()
     2474{
     2475  Int numActiveRefLayerPics;
     2476
     2477  if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) ==  0 || !getInterLayerPredEnabledFlag() )
     2478  {
     2479    numActiveRefLayerPics = 0;
     2480  }
     2481  else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 1 )
     2482  {
     2483    numActiveRefLayerPics = 1;
     2484  }
     2485  else
     2486  {
     2487    numActiveRefLayerPics = getNumInterLayerRefPicsMinus1() + 1;
     2488  }
     2489  return numActiveRefLayerPics;
     2490}
     2491
     2492Int TComSlice::getRefPicLayerId( Int i )
     2493{
     2494  return getVPS()->getRefLayerId( getLayerIdInVps(), getInterLayerPredLayerIdc( i ) );
     2495}
     2496
     2497Void TComSlice::setActiveMotionPredRefLayers()
     2498{
     2499  Int j = 0;
     2500  for( Int i = 0; i < getNumActiveRefLayerPics(); i++)
     2501  {
     2502    if( getVPS()->getMotionPredEnabledFlag( getLayerIdInVps(), getInterLayerPredLayerIdc( i ))  )
     2503    {
     2504      m_activeMotionPredRefLayerId[ j++ ] = getVPS()->getRefLayerId( getLayerIdInVps(), i );
     2505    }
     2506  }
     2507  m_numActiveMotionPredRefLayers = j;
     2508
     2509  // Consider incorporating bitstream conformance tests on derived variables here.
     2510}
     2511
     2512Bool TComSlice::getInterRefEnabledInRPLFlag()
     2513{
     2514  Bool interRefEnabledInRPLFlag;
     2515  if ( getVPS()->getNumSamplePredRefLayers( getLayerIdInVps() ) > 0 && getNumActiveRefLayerPics() > 0 )
     2516  {
     2517    interRefEnabledInRPLFlag = !getInterLayerSamplePredOnlyFlag();
     2518  }
     2519  else
     2520  {
     2521    interRefEnabledInRPLFlag = 1;
     2522  }
     2523  return interRefEnabledInRPLFlag;
     2524}
    24382525#endif
    24392526/** get scaling matrix from RefMatrixID
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibCommon/TComSlice.h

    r497 r498  
    561561#endif
    562562
    563   Int         xCeilLog2( Int val );
     563  Int         xCeilLog2       ( Int val );
     564  Int         xGetDimBitOffset( Int j );
    564565
    565566
     
    730731  Int     scalTypeToScalIdx   ( ScalabilityType scalType );
    731732
    732 
    733733  Int     getProfileLevelTierIdxLen() { return xCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); };       
    734   Int     getNumLayersInIdList              ( Int lsIdx )
    735   {
    736     assert( lsIdx >= 0 );
    737     assert( lsIdx <= getVpsNumLayerSetsMinus1() );
    738     Int numLayersInIdList = 0;
    739     for (Int layerId = 0; layerId < getVpsMaxLayerId(); layerId++ )
    740     {
    741       numLayersInIdList += ( getLayerIdIncludedFlag( lsIdx, layerId ) );
    742     }
    743     return numLayersInIdList;
    744   };
     734  Int     getNumLayersInIdList              ( Int lsIdx );;
     735
     736  // inference
     737  Int     inferDimensionId     ( Int i, Int j );
     738  Int     inferLastDimsionIdLen();
     739
    745740#if H_3D 
    746741  Void    initViewIndex();
    747742  Int     getViewIndex    ( Int layerIdInVps )                             { return m_viewIndex[ layerIdInVps ]; }   
    748743  Int     getDepthId      ( Int layerIdInVps )                             { return getScalabilityId( layerIdInVps, DEPTH_ID ); }
    749   Int     getLayerIdInNuh( Int viewIndex, Bool depthFlag ); 
     744  Int     getLayerIdInNuh( Int viewIndex, Bool depthFlag );   
    750745#endif 
    751746#endif
     
    19111906
    19121907// Additional variables derived in slice header semantics
    1913 
    19141908Int  getNumInterLayerRefPicsMinus1Len( ) { return xCeilLog2(  getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); }
    19151909Int  getInterLayerPredLayerIdcLen    ( ) { return xCeilLog2(  getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); }
    19161910
    1917 Int  getNumActiveRefLayerPics( )
    1918 {
    1919   Int numActiveRefLayerPics;
    1920 
    1921   if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) ==  0 || !getInterLayerPredEnabledFlag() )
    1922   {
    1923     numActiveRefLayerPics = 0;
    1924   }
    1925   else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 1 )
    1926   {
    1927     numActiveRefLayerPics = 1;
    1928   }
    1929   else
    1930   {
    1931     numActiveRefLayerPics = getNumInterLayerRefPicsMinus1() + 1;
    1932   }
    1933   return numActiveRefLayerPics;
    1934 }
    1935 
    1936 Int getRefPicLayerId( Int i )
    1937 
    1938   return getVPS()->getRefLayerId( getLayerIdInVps(), getInterLayerPredLayerIdc( i ) );
    1939 }
    1940 
    1941 Void setActiveMotionPredRefLayers( )
    1942 {
    1943   Int j = 0;
    1944   for( Int i = 0; i < getNumActiveRefLayerPics(); i++)
    1945   {
    1946     if( getVPS()->getMotionPredEnabledFlag( getLayerIdInVps(), getInterLayerPredLayerIdc( i ))  )
    1947     {
    1948       m_activeMotionPredRefLayerId[ j++ ] = getVPS()->getRefLayerId( getLayerIdInVps(), i );
    1949     }
    1950   }
    1951   m_numActiveMotionPredRefLayers = j;
    1952 
    1953   // Consider incorporating bitstream conformance tests on derived variables here.
    1954 }
    1955 
    1956 Int  getActiveMotionPredRefLayerId( Int i ) { return m_activeMotionPredRefLayerId[i]; }
    1957 Int  getNumActiveMotionPredRefLayers(  ) { return m_numActiveMotionPredRefLayers; }
    1958 
    1959 Bool getInterRefEnabledInRPLFlag( )
    1960 {
    1961   Bool interRefEnabledInRPLFlag;
    1962   if ( getVPS()->getNumSamplePredRefLayers( getLayerIdInVps() ) > 0 && getNumActiveRefLayerPics() > 0 )
    1963   {
    1964     interRefEnabledInRPLFlag = !getInterLayerSamplePredOnlyFlag();
    1965   }
    1966   else
    1967   {
    1968     interRefEnabledInRPLFlag = 1;
    1969   }
    1970   return interRefEnabledInRPLFlag;
    1971 }
    1972 
    1973 Void setRefPicSetInterLayer( std::vector<TComPic*>* m_refPicSetInterLayer );
    1974 
     1911Int  getNumActiveRefLayerPics( );
     1912Int  getRefPicLayerId               ( Int i );
     1913
     1914Void setActiveMotionPredRefLayers   ( );
     1915
     1916Int  getNumActiveMotionPredRefLayers(  )      { return m_numActiveMotionPredRefLayers; }
     1917Int  getActiveMotionPredRefLayerId  ( Int i ) { return m_activeMotionPredRefLayerId[i]; }
     1918
     1919Bool getInterRefEnabledInRPLFlag( );
     1920
     1921Void     setRefPicSetInterLayer       ( std::vector<TComPic*>* m_refPicSetInterLayer );
    19751922TComPic* getPicFromRefPicSetInterLayer( Int layerId );
    19761923
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r495 r498  
    912912    for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ) - ( pcVPS->getSplittingFlag() ? 1 : 0 ); sIdx++ )
    913913    {
    914         READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" );       pcVPS->setDimensionIdLen( sIdx, uiCode + 1 );
    915     }
    916        
     914        READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" );       pcVPS->setDimensionIdLen( sIdx, uiCode + 1 );       
     915    }
     916     
     917    if ( pcVPS->getSplittingFlag() )
     918    {
     919      pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1, pcVPS->inferLastDimsionIdLen() );       
     920    }   
     921
    917922    READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" );           pcVPS->setVpsNuhLayerIdPresentFlag( uiCode == 1 ? true : false );
    918923
    919924    for( Int i = 0; i <= pcVPS->getMaxLayers() - 1; i++ )
    920925    {
    921        
    922926      if ( pcVPS->getVpsNuhLayerIdPresentFlag() && ( i > 0 ) )
    923927      {
     
    928932        pcVPS->setLayerIdInNuh( i, i );;
    929933      }
    930      
     934
    931935      pcVPS->setLayerIdInVps( pcVPS->getLayerIdInNuh( i ), i );
    932936
    933       if ( !pcVPS->getSplittingFlag() )
    934       {   
    935         for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )
    936         {
     937      for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )
     938      {
     939        if ( !pcVPS->getSplittingFlag() )
     940        {   
    937941          READ_CODE( pcVPS->getDimensionIdLen( j ), uiCode, "dimension_id[i][j]" );  pcVPS->setDimensionId( i, j, uiCode );
    938942        }
    939       }
    940     }
     943        else
     944        {
     945          pcVPS->setDimensionId( i, j, pcVPS->inferDimensionId( i, j)  );
     946        }
     947      }
     948    }
     949   
    941950
    942951    for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )
     
    979988    {
    980989      READ_CODE( 10, uiCode, "num_add_output_layer_sets_minus1"      ); pcVPS->setNumAddOutputLayerSetsMinus1( uiCode );
    981       numOutputLayerSets += pcVPS->getNumAddOutputLayerSetsMinus1( );
     990      numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1);
    982991    }
    983992
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibDecoder/TDecSlice.cpp

    r324 r498  
    123123  DTRACE_CABAC_T( "\tPOC: " );
    124124  DTRACE_CABAC_V( rpcPic->getPOC() );
     125#if H_MV
     126  DTRACE_CABAC_T( "\tLayer: " );
     127  DTRACE_CABAC_V( rpcPic->getLayerId()  );
     128#endif
     129
    125130  DTRACE_CABAC_T( "\n" );
    126131
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp

    r495 r498  
    663663    // Operation point set
    664664    for( UInt i = 0; i <= pcVPS->getVpsMaxLayerId(); i ++ )
     665    {
    665666#else
    666667  assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 );
     
    673674    // Operation point set
    674675    for( UInt i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ )
    675 #endif
    676676    {
    677677      // Only applicable for version 1
    678678      pcVPS->setLayerIdIncludedFlag( true, opsIdx, i );
     679#endif
    679680      WRITE_FLAG( pcVPS->getLayerIdIncludedFlag( opsIdx, i ) ? 1 : 0, "layer_id_included_flag[opsIdx][i]" );
    680681    }
     
    731732    WRITE_CODE( pcVPS->getDimensionIdLen( sIdx ) - 1 , 3,    "dimension_id_len_minus1[j]");   
    732733  }
     734
     735  if ( pcVPS->getSplittingFlag() )
     736  { // Ignore old dimension id length
     737    pcVPS->setDimensionIdLen( pcVPS->getNumScalabilityTypes( ) - 1 ,pcVPS->inferLastDimsionIdLen() );       
     738  }   
     739
    733740
    734741  WRITE_FLAG( pcVPS->getVpsNuhLayerIdPresentFlag() ? 1 : 0,  "vps_nuh_layer_id_present_flag");
     
    746753
    747754    assert(  pcVPS->getLayerIdInVps( pcVPS->getLayerIdInNuh( i ) ) == i );
    748      
    749     if ( !pcVPS->getSplittingFlag() )
    750     {   
    751       for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )
    752       {     
     755
     756    for( Int j = 0; j < pcVPS->getNumScalabilityTypes() ; j++ )
     757    {     
     758      if ( !pcVPS->getSplittingFlag() )
     759      {   
    753760        WRITE_CODE( pcVPS->getDimensionId( i, j ), pcVPS->getDimensionIdLen( j ), "dimension_id[i][j]");     
     761      }
     762      else
     763      {
     764        assert( pcVPS->getDimensionId( i, j ) ==  pcVPS->inferDimensionId( i, j )  );
    754765      }
    755766    }
     
    789800  {
    790801    WRITE_CODE( pcVPS->getNumAddOutputLayerSetsMinus1( )    , 10,    "num_add_output_layer_sets_minus1"      );
    791     numOutputLayerSets += pcVPS->getNumAddOutputLayerSetsMinus1( );
     802    numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1 );
    792803  }
    793804
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncCfg.h

    r493 r498  
    409409  , m_viewIndex(-1)
    410410  , m_isDepth(false)
     411  , m_bUseVSO(false)
    411412#endif
    412413#endif
  • branches/HTM-DEV-0.3-dev0/source/Lib/TLibEncoder/TEncSlice.cpp

    r446 r498  
    13011301  DTRACE_CABAC_T( "\tPOC: " );
    13021302  DTRACE_CABAC_V( rpcPic->getPOC() );
     1303#if H_MV
     1304  DTRACE_CABAC_T( "\tLayer: " );
     1305  DTRACE_CABAC_V( rpcPic->getLayerId()  );
     1306#endif
    13031307  DTRACE_CABAC_T( "\n" );
    13041308#if ENC_DEC_TRACE
Note: See TracChangeset for help on using the changeset viewer.