Changeset 1172 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder


Ignore:
Timestamp:
8 Jul 2015, 01:45:57 (10 years ago)
Author:
seregin
Message:

macro cleanup: Q0078_ADD_LAYER_SETS

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

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1171 r1172  
    817817
    818818  WRITE_CODE( pcVPS->getMaxLayerId(), 6,                       "vps_max_layer_id" );
    819 #if Q0078_ADD_LAYER_SETS
    820819  WRITE_UVLC(pcVPS->getVpsNumLayerSetsMinus1(),                "vps_num_layer_sets_minus1");
    821   for (UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++)
    822 #else
    823   WRITE_UVLC( pcVPS->getNumLayerSets() - 1,                 "vps_num_layer_sets_minus1" );
    824   for (UInt opsIdx = 1; opsIdx <= (pcVPS->getNumLayerSets() - 1); opsIdx++)
    825 #endif
     820
     821  for( UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++ )
    826822  {
    827823    // Operation point set
     
    20712067  }
    20722068
    2073 #if Q0078_ADD_LAYER_SETS
    2074   if (vps->getNumIndependentLayers() > 1)
     2069  if( vps->getNumIndependentLayers() > 1 )
    20752070  {
    20762071    WRITE_UVLC( vps->getNumAddLayerSets(), "num_add_layer_sets" );
    2077     for (i = 0; i < vps->getNumAddLayerSets(); i++)
    2078     {
    2079       for (j = 1; j < vps->getNumIndependentLayers(); j++)
    2080       {
    2081         int len = 1;
    2082         while ((1 << len) < (vps->getNumLayersInTreePartition(j) + 1))
     2072
     2073    for( i = 0; i < vps->getNumAddLayerSets(); i++ )
     2074    {
     2075      for( j = 1; j < vps->getNumIndependentLayers(); j++ )
     2076      {
     2077        Int len = 1;
     2078        while( (1 << len) < (vps->getNumLayersInTreePartition(j) + 1) )
    20832079        {
    20842080          len++;
     
    20882084    }
    20892085  }
    2090 #endif
    20912086
    20922087  WRITE_FLAG( vps->getMaxTSLayersPresentFlag(), "vps_sub_layers_max_minus1_present_flag");
     
    21622157      WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, "layer_set_idx_for_ols_minus1");
    21632158    }
    2164 #if Q0078_ADD_LAYER_SETS
    2165     if ( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2
    2166 #else
    2167     if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2
    2168 #endif
    2169     {
    2170       for( j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet) ; j++ )
     2159
     2160    if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2
     2161    {
     2162      for( j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++ )
    21712163      {
    21722164        WRITE_FLAG( vps->getOutputLayerFlag(i,j), "output_layer_flag[i][j]");
     
    23922384  if( vps->getBitRatePresentVpsFlag() || vps->getPicRatePresentVpsFlag() )
    23932385  {
    2394 #if Q0078_ADD_LAYER_SETS
    23952386    for( i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getNumLayerSets(); i++ )
    2396 #else
    2397     for( i = 0; i < vps->getNumLayerSets(); i++ )
    2398 #endif
    23992387    {
    24002388      for( j = 0; j <= vps->getMaxSLayersInLayerSetMinus1(i); j++ )
     
    24042392          WRITE_FLAG( vps->getBitRatePresentFlag( i, j),        "bit_rate_present_flag[i][j]" );
    24052393        }
     2394
    24062395        if( vps->getPicRatePresentVpsFlag() )
    24072396        {
    24082397          WRITE_FLAG( vps->getPicRatePresentFlag( i, j),        "pic_rate_present_flag[i][j]" );
    24092398        }
     2399
    24102400        if( vps->getBitRatePresentFlag(i, j) )
    24112401        {
     
    24132403          WRITE_CODE( vps->getAvgBitRate( i, j ), 16, "max_bit_rate[i][j]" );
    24142404        }
     2405
    24152406        if( vps->getPicRatePresentFlag(i, j) )
    24162407        {
     
    25392530        codeHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1);
    25402531      }
    2541 #if Q0078_ADD_LAYER_SETS
    25422532      for( UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++ )
    2543 #else
    2544       for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ )
    2545 #endif
    25462533      {
    25472534        WRITE_UVLC( vps->getNumBitstreamPartitions(h), "num_bitstream_partitions[i]");
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1150 r1172  
    23702370#if SVC_EXTENSION
    23712371      nalu = NALUnit(NAL_UNIT_SPS, 0, m_layerId);
     2372
     2373      if( m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0 )
     2374      {
     2375        // For independent base layer rewriting
     2376        nalu.m_layerId = 0;
     2377      }
    23722378#else
    23732379      nalu = NALUnit(NAL_UNIT_SPS);
    23742380#endif
    2375 #if Q0078_ADD_LAYER_SETS
    2376       if (m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0)
    2377       {
    2378         nalu.m_layerId = 0; // For independent base layer rewriting
    2379       }
    2380 #endif
     2381
    23812382      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    23822383      if (m_bSeqFirst)
     
    24152416#if SVC_EXTENSION
    24162417      nalu = NALUnit(NAL_UNIT_PPS, 0, m_layerId);
     2418
     2419      if( m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0 )
     2420      {
     2421        // For independent base layer rewriting
     2422        nalu.m_layerId = 0;
     2423      }
    24172424#else
    24182425      nalu = NALUnit(NAL_UNIT_PPS);
    24192426#endif
    2420 #if Q0078_ADD_LAYER_SETS
    2421       if (m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0)
    2422       {
    2423         nalu.m_layerId = 0; // For independent base layer rewriting
    2424       }
    2425 #endif
     2427
    24262428      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    24272429#if O0092_0094_DEPENDENCY_CONSTRAINT
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1163 r1172  
    743743  m_cSPS.setNumDirectRefLayers(m_numDirectRefLayers);
    744744#endif
    745 #if Q0078_ADD_LAYER_SETS
     745
    746746  if( !m_numDirectRefLayers && m_numAddLayerSets )
    747747  {
     
    752752    m_cSPS.setLayerId(m_layerId);
    753753  }
    754 #else
    755   m_cSPS.setLayerId(m_layerId);
    756 #endif
    757754#endif //SVC_EXTENSION
     755
    758756  ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL();
    759757  profileTierLevel.setLevelIdc(m_level);
     
    10291027#endif
    10301028
    1031 #if Q0078_ADD_LAYER_SETS
    10321029  if( !m_numDirectRefLayers && m_numAddLayerSets )
    10331030  {
    10341031    m_cPPS.setLayerId(0); // layer ID 0 for independent layers
    10351032  }
    1036 #endif
    10371033
    10381034  if( m_layerId > 0 )
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h

    r1148 r1172  
    147147  Bool                    m_interLayerWeightedPredFlag;
    148148#endif
    149 #if Q0078_ADD_LAYER_SETS
    150   int                     m_numAddLayerSets;
    151 #endif
     149  Int                     m_numAddLayerSets;
    152150#if P0297_VPS_POC_LSB_ALIGNED_FLAG
    153151  Bool                    m_pocDecrementedInDPBFlag;
     
    270268  Void      setNoOutputOfPriorPicsFlags(Bool x)   { m_noOutputOfPriorPicsFlags = x;   }
    271269#endif
    272 #if Q0078_ADD_LAYER_SETS
    273270  Void      setNumAddLayerSets(Int x)             { m_numAddLayerSets = x; }
    274271  Int       getNumAddLayerSets()                  { return m_numAddLayerSets; }
    275 #endif
    276272#if P0297_VPS_POC_LSB_ALIGNED_FLAG
    277273  Void      setPocDecrementedInDPBFlag(Bool x)    { m_pocDecrementedInDPBFlag = x; }
Note: See TracChangeset for help on using the changeset viewer.