Changeset 165 in SHVCSoftware for branches/SHM-2.0-dev/source


Ignore:
Timestamp:
8 May 2013, 22:13:18 (12 years ago)
Author:
qualcomm
Message:

Profile and output-layer signalling in VPS (MACRO: VPS_PROFILE_OUTPUT_LAYERS)

M0268: Signaling of profile and output layers in VPS as in Section 3 of M0268v2.

From: Adarsh K. Ramasubramonian <aramasub@…>

Location:
branches/SHM-2.0-dev/source
Files:
6 edited

Legend:

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

    r154 r165  
    853853#endif
    854854  // Target output layer
     855#if VPS_PROFILE_OUTPUT_LAYERS
     856  vps->setNumOutputLayerSets(2);    // 2 including the default base-layer set.
     857  vps->setNumProfileTierLevel(2);   // 1 for the enhancement layer
     858  vps->setProfileLevelTierIdx(1, 1);
     859  vps->setDefaultOneTargetOutputLayerFlag(true);
     860  Int lsIdx = 1;
     861  vps->setOutputLayerSetIdx(1, lsIdx); // Because only one layer set
     862#else
    855863  vps->setNumOutputLayerSets(1);
    856864  Int lsIdx = 1;
    857865  vps->setOutputLayerSetIdx(0, lsIdx); // Because only one layer set
     866#endif
    858867  // Include the highest layer as output layer
    859868  for(UInt layer=0; layer <= vps->getMaxLayerId() ; layer++)
  • branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.cpp

    r162 r165  
    14911491, m_numOutputLayerSets        (0) 
    14921492#endif
     1493#if VPS_PROFILE_OUTPUT_LAYERS
     1494, m_numProfileTierLevel       (0)
     1495, m_moreOutputLayerSetsThanDefaultFlag (false)
     1496, m_numAddOutputLayerSets     (0)
     1497, m_defaultOneTargetOutputLayerFlag    (false)
     1498#endif
    14931499{
    14941500  for( Int i = 0; i < MAX_TLAYER; i++)
     
    15321538  ::memset(m_layerSetLayerIdList,  0, sizeof(m_layerSetLayerIdList));
    15331539  ::memset(m_numLayerInIdList,     0, sizeof(m_numLayerInIdList   ));
     1540#endif
     1541#if VPS_PROFILE_OUTPUT_LAYERS
     1542  ::memset(m_profileLevelTierIdx,  0, sizeof(m_profileLevelTierIdx));
    15341543#endif
    15351544}
  • branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.h

    r162 r165  
    550550  UInt       m_refLayerId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
    551551#endif
    552 
     552#if VPS_PROFILE_OUTPUT_LAYERS
     553  UInt       m_numProfileTierLevel;
     554  Bool       m_moreOutputLayerSetsThanDefaultFlag;
     555  Int        m_numAddOutputLayerSets;
     556  Bool       m_defaultOneTargetOutputLayerFlag;
     557  Int        m_profileLevelTierIdx[64];     
     558#endif
    553559public:
    554560  TComVPS();
     
    682688  UInt   getRefLayerId(Int layerId, Int refLayerIdx)                            { return m_refLayerId[layerId][refLayerIdx];              }
    683689  Void   setRefLayerId(Int layerId, Int refLayerIdx, UInt refLayerId)           { m_refLayerId[layerId][refLayerIdx] = refLayerId;        }
     690#endif
     691#if VPS_PROFILE_OUTPUT_LAYERS
     692  UInt   getNumProfileTierLevel()                                { return m_numProfileTierLevel; }
     693  Void   setNumProfileTierLevel(Int x)                           { m_numProfileTierLevel = x;    }
     694
     695  Bool   getMoreOutputLayerSetsThanDefaultFlag()                 { return m_moreOutputLayerSetsThanDefaultFlag;}
     696  Void   setMoreOutputLayerSetsThanDefaultFlag(Bool x)           { m_moreOutputLayerSetsThanDefaultFlag = x   ;}
     697
     698  Int    getNumAddOutputLayerSets()                              { return m_numAddOutputLayerSets; }
     699  Void   setNumAddOutputLayerSets(Int x)                         { m_numAddOutputLayerSets = x   ; }
     700
     701  Bool   getDefaultOneTargetOutputLayerFlag()                 { return m_defaultOneTargetOutputLayerFlag;}
     702  Void   setDefaultOneTargetOutputLayerFlag(Bool x)           { m_defaultOneTargetOutputLayerFlag= x    ;}
     703
     704  Int    getProfileLevelTierIdx(Int i)                        { return m_profileLevelTierIdx[i]; }
     705  Void   setProfileLevelTierIdx(Int i, Int x)                 { m_profileLevelTierIdx[i] = x   ; }
    684706#endif
    685707};
  • branches/SHM-2.0-dev/source/Lib/TLibCommon/TypeDef.h

    r162 r165  
    5454#define VPS_EXTN_DIRECT_REF_LAYERS       1      ///< Include indication of direct dependency of layers in VPS extension
    5555#define VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE   1
    56 #define VPS_OUTPUT_LAYER_SET_IDX         1      ///< Signal output_layer_set_idx[i] as output_layer_set_idx_minus1[i]
    57 #define VPS_MOVE_DIR_DEPENDENCY_FLAG     1      ///< Move the syntax element direct_dependency_flag to follow the syntax element dimension_id
     56#define VPS_OUTPUT_LAYER_SET_IDX         1      ///< M0268: Signal output_layer_set_idx[i] as output_layer_set_idx_minus1[i]
     57#define VPS_MOVE_DIR_DEPENDENCY_FLAG     1      ///< M0268: Move the syntax element direct_dependency_flag to follow the syntax element dimension_id
     58#define VPS_PROFILE_OUTPUT_LAYERS        1      ///< M0268: Signal profile information and output layer information as in Sec. 3 of M0268v2
    5859#endif
    5960
  • branches/SHM-2.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r160 r165  
    927927#endif
    928928#endif
     929
    929930#if VPS_EXTN_PROFILE_INFO
    930931  // Profile-tier-level signalling
     932#if VPS_PROFILE_OUTPUT_LAYERS
     933  READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" );     assert( uiCode == (vps->getNumLayerSets() - 1) );
     934  READ_CODE(  6, uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 );
     935  vps->getPTLForExtnPtr()->resize(vps->getNumProfileTierLevel());
     936  for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
     937#else
    931938  vps->getPTLForExtnPtr()->resize(vps->getNumLayerSets());
    932939  for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++)
     940#endif
    933941  {
    934942    READ_FLAG( uiCode, "vps_profile_present_flag[i]" ); vps->setProfilePresentFlag(idx, uiCode ? true : false);
    935943    if( !vps->getProfilePresentFlag(idx) )
    936944    {
     945#if VPS_PROFILE_OUTPUT_LAYERS
     946      READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1);
     947#else
    937948      READ_UVLC( uiCode, "vps_profile_layer_set_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1);
     949#endif
    938950      assert( vps->getProfileLayerSetRef(idx) < idx );
    939951      // Copy profile information as indicated
     
    944956#endif
    945957
     958#if VPS_PROFILE_OUTPUT_LAYERS
     959  READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); vps->setMoreOutputLayerSetsThanDefaultFlag( uiCode ? true : false );
     960  Int numOutputLayerSets = 0;
     961  if(! vps->getMoreOutputLayerSetsThanDefaultFlag() )
     962  {
     963    numOutputLayerSets = vps->getNumLayerSets();
     964  }
     965  else
     966  {
     967    READ_CODE( 10, uiCode, "num_add_output_layer_sets" );          vps->setNumAddOutputLayerSets( uiCode );
     968    numOutputLayerSets = vps->getNumLayerSets() + vps->getNumAddOutputLayerSets();
     969  }
     970  if( numOutputLayerSets > 1 )
     971  {
     972    READ_FLAG( uiCode, "default_one_target_output_layer_flag" );   vps->setDefaultOneTargetOutputLayerFlag( uiCode ? true : false );
     973  }
     974  vps->setNumOutputLayerSets( numOutputLayerSets );
     975
     976  for(i = 1; i < numOutputLayerSets; i++)
     977  {
     978    if( i > (vps->getNumLayerSets() - 1) )
     979    {
     980      Int numBits = std::max(1.0, ceil( log((double)vps->getNumLayerSets() - 1) / log(2.0) ));
     981      READ_CODE( numBits, uiCode, "output_layer_set_idx_minus1");   vps->setOutputLayerSetIdx( i, uiCode + 1);
     982      Int lsIdx = vps->getOutputLayerSetIdx(i);
     983      for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++)
     984      {
     985        READ_FLAG( uiCode, "output_layer_flag[i][j]"); vps->setOutputLayerFlag(i, j, uiCode);
     986      }
     987    }
     988    else
     989    {
     990      // i <= (vps->getNumLayerSets() - 1)
     991      // Assign OutputLayerFlag depending on default_one_target_output_layer_flag
     992      Int lsIdx = i;
     993      if( vps->getDefaultOneTargetOutputLayerFlag() )
     994      {
     995        for(j = 0; j < vps->getNumLayersInIdList(lsIdx); j++)
     996        {
     997          vps->setOutputLayerFlag(i, j, (j == (vps->getNumLayersInIdList(lsIdx)-1)));
     998        }
     999      }
     1000      else
     1001      {
     1002        for(j = 0; j < vps->getNumLayersInIdList(lsIdx); j++)
     1003        {
     1004          vps->setOutputLayerFlag(i, j, 1);
     1005        }
     1006      }
     1007    }
     1008    Int numBits = std::max(1.0, ceil( log((double)vps->getNumProfileTierLevel()) / log(2.0) ));
     1009    READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
     1010  }
     1011#else
    9461012#if VPS_EXTN_OP_LAYER_SETS
    9471013  // Target output layer signalling
     
    9621028      }
    9631029    }
    964   } 
    965 #endif
     1030  }
     1031#endif
     1032#endif
     1033
    9661034#if !VPS_MOVE_DIR_DEPENDENCY_FLAG
    9671035#if VPS_EXTN_DIRECT_REF_LAYERS
  • branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r160 r165  
    3939#include "TEncCavlc.h"
    4040#include "SEIwrite.h"
    41 
     41#include <iostream>
    4242//! \ingroup TLibEncoder
    4343//! \{
     
    718718#if VPS_EXTN_PROFILE_INFO
    719719  // Profile-tier-level signalling
     720#if VPS_PROFILE_OUTPUT_LAYERS
     721  WRITE_CODE( vps->getNumLayerSets() - 1   , 10, "vps_number_layer_sets_minus1" );     
     722  WRITE_CODE( vps->getNumProfileTierLevel() - 1,  6, "vps_num_profile_tier_level_minus1");
     723  for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
     724#else
    720725  for(Int idx = 1; idx <= vps->getNumLayerSets() - 1; idx++)
     726#endif
    721727  {
    722728    WRITE_FLAG( vps->getProfilePresentFlag(idx),       "vps_profile_present_flag[i]" );
    723729    if( !vps->getProfilePresentFlag(idx) )
    724730    {
     731#if VPS_PROFILE_OUTPUT_LAYERS
     732      WRITE_CODE( vps->getProfileLayerSetRef(idx) - 1, 6, "profile_ref_minus1[i]" );
     733#else
    725734      WRITE_UVLC( vps->getProfileLayerSetRef(idx) - 1, "vps_profile_layer_set_ref_minus1[i]" );
     735#endif
    726736    }
    727737    codePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 );
    728738  }
    729739#endif
     740
     741#if VPS_PROFILE_OUTPUT_LAYERS
     742  Int numOutputLayerSets = vps->getNumOutputLayerSets() ;
     743  WRITE_FLAG(  (numOutputLayerSets > vps->getNumLayerSets()), "more_output_layer_sets_than_default_flag" );
     744  if(numOutputLayerSets > vps->getNumLayerSets())
     745  {
     746    WRITE_CODE( numOutputLayerSets - vps->getNumLayerSets(), 10, "num_add_output_layer_sets" );
     747  }
     748  if( numOutputLayerSets > 1 )
     749  {
     750    WRITE_FLAG( vps->getDefaultOneTargetOutputLayerFlag(), "default_one_target_output_layer_flag" );   
     751  }
     752
     753  for(i = 1; i < numOutputLayerSets; i++)
     754  {
     755    if( i > (vps->getNumLayerSets() - 1) )
     756    {
     757      Int numBits = std::max(1.0, ceil( log((double)vps->getNumLayerSets() - 1) / log(2.0) ));
     758      WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, "output_layer_set_idx_minus1"); 
     759      Int lsIdx = vps->getOutputLayerSetIdx(i);
     760      for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++)
     761      {
     762        WRITE_FLAG( vps->getOutputLayerFlag(i,j), "output_layer_flag[i][j]");
     763      }
     764    }
     765    Int numBits = std::max(1.0, ceil( log((double)vps->getNumProfileTierLevel()) / log(2.0) ));
     766    WRITE_CODE( vps->getProfileLevelTierIdx(i), numBits, "profile_level_tier_idx[i]" );     
     767  }
     768#else
    730769#if VPS_EXTN_OP_LAYER_SETS
    731770  // Target output layer signalling
     
    748787    }
    749788  }
     789#endif
    750790#endif
    751791#if !VPS_MOVE_DIR_DEPENDENCY_FLAG
Note: See TracChangeset for help on using the changeset viewer.