Changeset 1054 in 3DVCSoftware


Ignore:
Timestamp:
26 Sep 2014, 18:34:05 (10 years ago)
Author:
tech
Message:

Integration of various MV-HEVC HLS changes.

Location:
branches/HTM-12.0-dev1
Files:
1 added
20 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-12.0-dev1/cfg/MV-HEVC/baseCfg_3view.cfg

    r964 r1054  
    88InputFile_1                   : newspapercc_2.yuv                               
    99InputFile_2                   : newspapercc_6.yuv                             
     10InputFile_3                   :                               
     11InputFile_4                   :                               
     12InputFile_5                   :       
    1013
    1114BitstreamFile                 : stream.bit                         
     
    1417ReconFile_1                   : rec_2.yuv                         
    1518ReconFile_2                   : rec_6.yuv                           
     19ReconFile_3                   :                           
     20ReconFile_4                   :                         
     21ReconFile_5                   :                           
    1622
    1723NumberOfLayers                : 3           # number of layers to be coded
     
    2228ViewOrderIndex                : 0 1 2       # ViewOrderIndex, per layer (m)
    2329LayerIdInNuh                  : 0           # Layer Id in NAL unit header, (0: no explicit signalling, otherwise per layer ) (m)
     30TargetEncLayerIdList          :             # Layer Id in Nuh to be encoded, (empty:-> all layers will be encode)
    2431SplittingFlag                 : 0           # Splitting Flag
    2532ViewId                        : 1 0 2       # ViewId, per ViewOrderIndex (m)
     
    3441LayerIdsInSet_5               :
    3542LayerIdsInSet_6               :
    36 
     43LayerIdsInSet_7               :
     44LayerIdsInSet_8               :
     45LayerIdsInSet_9               :
     46LayerIdsInSet_10              :
     47
     48NumAddLayerSets               : 0            # Specifies the number of additional layer sets
     49HighestLayerIdxPlus1_0        : -1           # Highest layer idx plus 1 for the 0-th additonal layer set, per independent layer (m) (first value will be ignored)
     50HighestLayerIdxPlus1_1        : -1           # Highest layer idx plus 1 for the 1-th additonal layer set, per independent layer (m) (first value will be ignored)
     51HighestLayerIdxPlus1_2        : -1           # Highest layer idx plus 1 for the 2-th additonal layer set, per independent layer (m) (first value will be ignored)
    3752
    3853DefaultTargetOutputLayerIdc   : 0            # Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet
     
    4156LayerIdsInAddOutputLayerSet_0 : 1            # Indices in VPS of output layers in additional output layer set 0
    4257LayerIdsInAddOutputLayerSet_1 : 2            # Indices in VPS of output layers in additional output layer set 1
    43 LayerIdsInAddOutputLayerSet_2 :              # Indices in VPS of output layers in additional output layer set 1
    44 LayerIdsInAddOutputLayerSet_3 :              # Indices in VPS of output layers in additional output layer set 1
    45 LayerIdsInAddOutputLayerSet_4 :              # Indices in VPS of output layers in additional output layer set 1
    46 
    47 ProfileLevelTierIdx           : 0 0 0 0 0 0  # Indices to profile level tier (TBD)
     58LayerIdsInAddOutputLayerSet_2 :              # Indices in VPS of output layers in additional output layer set 2
     59LayerIdsInAddOutputLayerSet_3 :              # Indices in VPS of output layers in additional output layer set 3
     60LayerIdsInAddOutputLayerSet_4 :              # Indices in VPS of output layers in additional output layer set 4
     61LayerIdsInAddOutputLayerSet_5 :              # Indices in VPS of output layers in additional output layer set 5
     62LayerIdsInAddOutputLayerSet_6 :              # Indices in VPS of output layers in additional output layer set 6
     63LayerIdsInAddOutputLayerSet_7 :              # Indices in VPS of output layers in additional output layer set 7
     64LayerIdsInAddOutputLayerSet_8 :              # Indices in VPS of output layers in additional output layer set 8
     65LayerIdsInAddOutputLayerSet_9 :              # Indices in VPS of output layers in additional output layer set 9
     66LayerIdsInAddOutputLayerSet_10:              # Indices in VPS of output layers in additional output layer set 10
     67
     68ProfileLevelTierIdx           : 0 0 0 0 0 0 0 0 0 0 0 0 0 0  # Indices to profile level tier (TBD)
    4869
    4970#======== VPS / Dependencies ================
    5071DirectRefLayers_1             : 0           # Indices in VPS of direct reference layers
    5172DirectRefLayers_2             : 0           # Indices in VPS of direct reference layers
     73DirectRefLayers_3             :             # Indices in VPS of direct reference layers
     74DirectRefLayers_4             :             # Indices in VPS of direct reference layers
     75DirectRefLayers_5             :             # Indices in VPS of direct reference layers
     76
    5277DependencyTypes_1             : 2           # Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
    5378DependencyTypes_2             : 2           # Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
     79DependencyTypes_3             : 2           # Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
     80DependencyTypes_4             : 2           # Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
     81DependencyTypes_5             : 2           # Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
    5482
    5583#======== Unit definition ================
     
    101129Frame8_l2:  B    7     7     0.68     0        0        0        3      4     -1 -3 -7 1         1    -2     5     1 1 1 1 0         1          0         2          -1       
    102130
     131FrameI_l3:
     132Frame1_l3:
     133Frame2_l3:
     134Frame3_l3:
     135Frame4_l3:
     136Frame5_l3:
     137Frame6_l3:
     138Frame7_l3:
     139Frame8_l3:
     140   
     141FrameI_l4:
     142Frame1_l4:
     143Frame2_l4:
     144Frame3_l4:
     145Frame4_l4:
     146Frame5_l4:
     147Frame6_l4:
     148Frame7_l4:
     149Frame8_l4:
     150
     151FrameI_l5:
     152Frame1_l5:
     153Frame2_l5:
     154Frame3_l5:
     155Frame4_l5:
     156Frame5_l5:
     157Frame6_l5:
     158Frame7_l5:
     159Frame8_l5:
     160
    103161#=========== Motion Search =============
    104162FastSearch                    : 1           # 0:Full search  1:TZ search
  • branches/HTM-12.0-dev1/source/App/TAppDecoder/TAppDecCfg.cpp

    r872 r1054  
    9494  ("TarDecLayerIdSetFile,l", cfg_TargetDecLayerIdSetFile, string(""), "targetDecLayerIdSet file name. The file should include white space separated LayerId values to be decoded. Omitting the option or a value of -1 in the file decodes all layers.")
    9595  ("RespectDefDispWindow,w", m_respectDefDispWindow, 0, "Only output content inside the default display window\n")
     96#if H_MV
     97#if H_MV_HLS10_GEN_FIX
     98  ("OutputVpsInfo,v", m_outputVpsInfo, false, "Output information about the layer dependencies and layer sets")
     99#endif
     100#endif
    96101  ;
    97102  po::setDefaults(opts);
  • branches/HTM-12.0-dev1/source/App/TAppDecoder/TAppDecCfg.h

    r964 r1054  
    8080
    8181#if H_MV
     82#if H_MV_HLS10_GEN_FIX
     83  Bool          m_outputVpsInfo;                     ///< Output VPS information
     84#endif
    8285  Void xAppendToFileNameEnd( Char* pchInputFileName, const Char* pchStringToAppend, Char*& rpchOutputFileName); ///< create filenames
    8386#endif
  • branches/HTM-12.0-dev1/source/App/TAppDecoder/TAppDecTop.cpp

    r976 r1054  
    239239          {
    240240            TComVPS* vps = m_vps;
    241           if ( m_targetOptLayerSetIdx == -1 )
     241            if ( m_targetOptLayerSetIdx == -1 )
     242            {
     243              // Not normative! Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. )
     244              m_targetOptLayerSetIdx = vps->getVpsNumLayerSetsMinus1();
     245            }
     246
     247            for (Int dI = 0; dI < m_numDecoders; dI++ )
     248            {
     249              m_tDecTop[decIdx]->setTargetOptLayerSetIdx( m_targetOptLayerSetIdx );
     250            }
     251
     252            if ( m_targetOptLayerSetIdx < 0 || m_targetOptLayerSetIdx >= vps->getNumOutputLayerSets() )
     253            {
     254              fprintf(stderr, "\ntarget output layer set index must be in the range of 0 to %d, inclusive \n", vps->getNumOutputLayerSets() - 1 );           
     255              exit(EXIT_FAILURE);
     256            }
     257            m_targetDecLayerIdSet = vps->getTargetDecLayerIdList( m_targetOptLayerSetIdx );
     258          }
     259#if H_MV_HLS10_GEN_FIX
     260          if (m_outputVpsInfo )
    242261          {
    243             // Not normative! Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. )
    244             m_targetOptLayerSetIdx = vps->getVpsNumLayerSetsMinus1();
     262            m_vps->printLayerDependencies();
     263            m_vps->printLayerSets();
     264            m_vps->printPTL();
    245265          }
    246 
    247           for (Int dI = 0; dI < m_numDecoders; dI++ )
    248           {
    249             m_tDecTop[decIdx]->setTargetOptLayerSetIdx( m_targetOptLayerSetIdx );
    250           }
    251 
    252           if ( m_targetOptLayerSetIdx < 0 || m_targetOptLayerSetIdx >= vps->getNumOutputLayerSets() )
    253           {
    254             fprintf(stderr, "\ntarget output layer set index must be in the range of 0 to %d, inclusive \n", vps->getNumOutputLayerSets() - 1 );           
    255             exit(EXIT_FAILURE);
    256           }
    257           m_targetDecLayerIdSet = vps->getTargetDecLayerIdList( m_targetOptLayerSetIdx );
    258         }
    259       }
     266#endif
     267        }
    260268#if H_3D
    261269        if (nalu.m_nalUnitType == NAL_UNIT_VPS )
     
    569577  Int dpbFullness = 0;
    570578#if H_MV
     579#if H_MV_HLS10_ADD_LAYERSETS
     580  TComSPS* activeSPS = m_tDecTop[ decIdx ]->getActiveSPS();
     581#else
    571582  // preliminary fix
    572583  TComSPS* activeSPS = m_tDecTop[0]->getActiveSPS();
     584#endif
    573585#else
    574586  TComSPS* activeSPS = m_cTDecTop.getActiveSPS();
  • branches/HTM-12.0-dev1/source/App/TAppEncoder/TAppEncCfg.cpp

    r1039 r1054  
    241241  {"main-still-picture", Profile::MAINSTILLPICTURE},
    242242#if H_MV
     243#if H_MV_HLS10_PTL
     244  {"multiview-main", Profile::MULTIVIEWMAIN},
     245#if H_3D
     246  {"3d-main"       , Profile::MAIN3D},
     247#endif
     248
     249#else
    243250  {"main-stereo",    Profile::MAINSTEREO},
    244251  {"main-multiview", Profile::MAINMULTIVIEW},
    245252#if H_3D
    246253  {"main-3d"    , Profile::MAIN3D},
     254#endif
    247255#endif
    248256#endif
     
    333341#if H_MV
    334342  vector<Int>   cfg_dimensionLength;
     343#if H_MV_HLS10_PTL
     344  string        cfg_profiles;
     345  string        cfg_levels;
     346  string        cfg_tiers;
     347#endif
    335348#if H_3D
    336349  cfg_dimensionLength.push_back( 2  );  // depth
     
    388401#endif
    389402#endif
    390   ("LayerIdInNuh",          m_layerIdInNuh       , std::vector<Int>(1,0), "LayerId in Nuh")
     403#if H_MV_HLS10_GEN_FIX
     404  ("TargetEncLayerIdList",  m_targetEncLayerIdList, std::vector<Int>(0,0), "LayerIds in Nuh to be encoded") 
     405#endif
     406  ("LayerIdInNuh",          m_layerIdInNuh       , std::vector<Int>(1,0), "LayerId in Nuh") 
    391407  ("SplittingFlag",         m_splittingFlag      , false                , "Splitting Flag")   
    392408
     
    394410  ("VpsNumLayerSets",       m_vpsNumLayerSets    , 1                    , "Number of layer sets")   
    395411  ("LayerIdsInSet_%d",      m_layerIdsInSets     , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set") 
     412#if H_MV_HLS10_ADD_LAYERSETS
     413  ("NumAddLayerSets"     , m_numAddLayerSets     , 0                                              , "NumAddLayerSets     ")
     414  ("HighestLayerIdxPlus1_%d", m_highestLayerIdxPlus1, std::vector< Int  >(0,0)  ,MAX_VPS_NUM_ADD_LAYER_SETS, "HighestLayerIdxPlus1")
     415#endif
    396416  ("DefaultTargetOutputLayerIdc"     , m_defaultOutputLayerIdc     , 0, "Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet")
    397417  ("OutputLayerSetIdx",     m_outputLayerSetIdx  , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets") 
     
    400420  ("LayerIdsInDefOutputLayerSet_%d", m_layerIdsInDefOutputLayerSet      , std::vector<Int>(0,0), MAX_VPS_OP_SETS_PLUS1, "Indices in VPS of output layers in layer set") 
    401421  ("AltOutputLayerFlag",    m_altOutputLayerFlag , std::vector<Bool>(1,0), "Alt output layer flag")
     422 
     423#if H_MV_HLS10_PTL
     424  ("ProfileTierLevelIdx_%d",  m_profileTierLevelIdx, std::vector<Int>(0), MAX_NUM_LAYERS, "Indices to profile level tier")
     425#else
    402426  ("ProfileLevelTierIdx",   m_profileLevelTierIdx, std::vector<Int>(1,0), "Indices to profile level tier")
    403  
     427#endif
    404428  // Layer dependencies
    405429  ("DirectRefLayers_%d",    m_directRefLayers    , std::vector<Int>(0,0), MAX_NUM_LAYERS, "LayerIds of direct reference layers")
     
    431455 
    432456  // Profile and level
     457#if H_MV_HLS10_PTL
     458  ("Profile", cfg_profiles,   string(""),           "Profile in VpsProfileTierLevel (Indication only)")
     459  ("Level",   cfg_levels ,    string(""),           "Level indication in VpsProfileTierLevel (Indication only)")
     460  ("Tier",    cfg_tiers  ,    string(""),           "Tier indication in VpsProfileTierLevel (Indication only)")
     461  ("InblFlag",m_inblFlag ,    std::vector<Bool>(0), "InblFlags in VpsProfileTierLevel (Indication only)" )
     462#else
    433463  ("Profile", m_profile,   Profile::NONE, "Profile to be used when encoding (Incomplete)")
    434464  ("Level",   m_level,     Level::NONE,   "Level limit to be used, eg 5.1 (Incomplete)")
    435465  ("Tier",    m_levelTier, Level::MAIN,   "Tier to use for interpretation of --Level")
    436 
     466#endif
    437467  ("ProgressiveSource", m_progressiveSourceFlag, false, "Indicate that source is progressive")
    438468  ("InterlacedSource",  m_interlacedSourceFlag,  false, "Indicate that source is interlaced")
     
    613643#endif
    614644#if H_MV
    615 
     645#if H_MV_HLS10_GEN_FIX
     646// A lot of this stuff could should actually be derived by the encoder.
     647#endif // H_MV_HLS10_GEN
    616648  // VPS VUI
    617649  ("VpsVuiPresentFlag"           , m_vpsVuiPresentFlag           , false                                           , "VpsVuiPresentFlag           ")
     
    637669  ("CtuBasedOffsetEnabledFlag"   , m_ctuBasedOffsetEnabledFlag   , std::vector< Bool >(1,0)  ,MAX_NUM_LAYERS       , "CtuBasedOffsetEnabledFlag    per direct reference for the N-th layer")
    638670  ("MinHorizontalCtuOffsetPlus1" , m_minHorizontalCtuOffsetPlus1 , std::vector< Int  >(1,0)  ,MAX_NUM_LAYERS       , "MinHorizontalCtuOffsetPlus1  per direct reference for the N-th layer")
     671#if H_MV_HLS10_VPS_VUI
     672  ("SingleLayerForNonIrapFlag", m_singleLayerForNonIrapFlag, false                                          , "SingleLayerForNonIrapFlag")
     673  ("HigherLayerIrapSkipFlag"  , m_higherLayerIrapSkipFlag  , false                                          , "HigherLayerIrapSkipFlag  ")
     674#endif
    639675#endif
    640676
     
    742778  ("SEISubBitstreamAvgBitRate",               m_sbPropAvgBitRate,             std::vector< Int  >(1,0)  ,"Specifies average bit rate of the i-th sub-bitstream")
    743779  ("SEISubBitstreamMaxBitRate",               m_sbPropMaxBitRate,             std::vector< Int  >(1,0)  ,"Specifies maximum bit rate of the i-th sub-bitstream")
     780
     781#if H_MV_HLS10_GEN_FIX
     782  ("OutputVpsInfo",                           m_outputVpsInfo,                false                     ,"Output information about the layer dependencies and layer sets")
     783#endif
    744784#endif
    745785#if H_3D
     
    792832#endif //H_3D
    793833  ;
    794   #if H_MV
     834
     835#if H_MV
    795836  // parse coding structure
    796837  for( Int k = 0; k < MAX_NUM_LAYERS; k++ )
     
    10671108  xResizeVector( m_wppInUseFlag );
    10681109
     1110#if H_MV_HLS10_ADD_LAYERSETS
     1111  for (Int olsIdx = 0; olsIdx < m_vpsNumLayerSets + m_numAddLayerSets + (Int) m_outputLayerSetIdx.size(); olsIdx++)
     1112#else
    10691113  for (Int olsIdx = 0; olsIdx < m_vpsNumLayerSets + (Int) m_outputLayerSetIdx.size(); olsIdx++)
     1114#endif
    10701115  {   
    10711116    m_altOutputLayerFlag.push_back( false );     
     
    11771222    }
    11781223  }
     1224
     1225#if H_MV
     1226#if H_MV_HLS10_PTL
     1227  // parse PTL
     1228  Bool anyEmpty = false;
     1229  if( cfg_profiles.empty() )
     1230  {
     1231#if H_3D
     1232    cfg_profiles = string("main main 3D-main");
     1233#else
     1234    cfg_profiles = string("main main multiview-main");   
     1235#endif
     1236    fprintf(stderr, "\nWarning: No profiles given, using defaults: %s", cfg_profiles.c_str() );
     1237    anyEmpty = true;
     1238  }
     1239
     1240  if( cfg_levels.empty() )
     1241  {
     1242    cfg_levels = string("none none none");
     1243    fprintf(stderr, "\nWarning: No levels given, using defaults: %s", cfg_levels.c_str() );
     1244    anyEmpty = true;
     1245  }
     1246
     1247  if( cfg_tiers.empty() )
     1248  {
     1249    cfg_tiers = string("main main main");
     1250    fprintf(stderr, "\nWarning: No tiers given, using defaults: %s", cfg_tiers.c_str());
     1251    anyEmpty = true;
     1252  }
     1253
     1254  if( m_inblFlag.empty() )
     1255  {
     1256    fprintf(stderr, "\nWarning: No inblFlags given, using defaults:");
     1257    for( Int i = 0; i < 3; i++)
     1258    {
     1259      m_inblFlag.push_back( false );
     1260      fprintf(stderr," %d", (Int) m_inblFlag[i]);
     1261    }
     1262    anyEmpty = true;
     1263  }   
     1264
     1265  if ( anyEmpty )
     1266  {
     1267    fprintf( stderr, "\n" );
     1268  }
     1269
     1270  xReadStrToEnum( cfg_profiles, m_profile   );
     1271  xReadStrToEnum( cfg_levels,   m_level     );
     1272  xReadStrToEnum( cfg_tiers ,   m_levelTier );
     1273#endif
     1274#endif
    11791275#if H_3D
    11801276  // set global varibles
     
    12911387    fprintf(stderr, "******************************************************************\n");
    12921388  }
     1389
     1390
     1391#if !H_MV_HLS10_PTL
    12931392  if( m_profile==Profile::NONE )
    12941393  {
     
    13031402    fprintf(stderr, "***************************************************************************\n");
    13041403  }
     1404#endif
    13051405
    13061406  Bool check_failed = false; /* abort if there is a fatal configuration problem */
     
    14281528  {   
    14291529    Int refLayerSetIdx = m_outputLayerSetIdx[ lsIdx ];
     1530#if H_MV_HLS10_ADD_LAYERSETS
     1531    xConfirmPara(  refLayerSetIdx < 0 || refLayerSetIdx >= m_vpsNumLayerSets + m_numAddLayerSets, "Output layer set idx must be greater or equal to 0 and less than the VpsNumLayerSets plus NumAddLayerSets." );
     1532#else
    14301533    xConfirmPara(  refLayerSetIdx < 0 || refLayerSetIdx >= m_vpsNumLayerSets, "Output layer set idx must be greater or equal to 0 and less than the VpsNumLayerSets." );
    1431 
     1534#endif
     1535#if !H_MV_HLS10_ADD_LAYERSETS
    14321536    for (Int i = 0; i < m_layerIdsInAddOutputLayerSet[ lsIdx ].size(); i++)
    14331537    {
     
    14431547      xConfirmPara( !isAlsoInLayerSet, "All output layers of a output layer set be included in corresponding layer set.");
    14441548    }
     1549#endif
    14451550  }
    14461551
     
    14541559      anyDefaultOutputFlag = anyDefaultOutputFlag || ( m_layerIdsInDefOutputLayerSet[lsIdx].size() != 0 );
    14551560    }   
     1561#if H_MV_HLS10_ADD_LAYERSETS
     1562    if ( anyDefaultOutputFlag )
     1563    {   
     1564      printf( "\nWarning: Ignoring LayerIdsInDefOutputLayerSet parameters, since defaultTargetOuputLayerIdc is not equal 2.\n" );   
     1565    }
     1566#else
    14561567    printf( "\nWarning: Ignoring LayerIdsInDefOutputLayerSet parameters, since defaultTargetOuputLayerIdc is not equal 2.\n" );   
     1568#endif
    14571569  }
    14581570  else 
     
    14761588  }
    14771589
     1590#if H_MV_HLS10_ADD_LAYERSETS
     1591  xConfirmPara( m_altOutputLayerFlag.size() < m_vpsNumLayerSets + m_numAddLayerSets + m_outputLayerSetIdx.size(), "The number of alt output layer flags must be equal to the number of layer set additional output layer sets plus the number of output layer set indices" );
     1592#else
    14781593  xConfirmPara( m_altOutputLayerFlag.size() < m_vpsNumLayerSets + m_outputLayerSetIdx.size(), "The number of Profile Level Tier indices must be equal to the number of layer set plus the number of output layer set indices" );
    1479   xConfirmPara( m_profileLevelTierIdx.size() < m_vpsNumLayerSets + m_outputLayerSetIdx.size(), "The number of Profile Level Tier indices must be equal to the number of layer set plus the number of output layer set indices" );
    1480 
    1481   // Layer Dependencies 
     1594#endif
     1595
     1596  // PTL
     1597#if H_MV_HLS10_PTL
     1598    xConfirmPara( ( m_profile.size() != m_inblFlag.size() || m_profile.size() != m_level.size()  ||  m_profile.size() != m_levelTier.size() ), "The number of Profiles, Levels, Tiers and InblFlags must be equal." );
     1599
     1600    if ( m_numberOfLayers > 1)
     1601    {
     1602      xConfirmPara( m_profile.size() <= 1, "The number of profiles, tiers, levels, and inblFlags must be greater than 1.");
     1603      xConfirmPara( m_inblFlag[0], "VpsProfileTierLevel[0] must have inblFlag equal to 0");
     1604      if (m_profile.size() > 1 )
     1605      {
     1606        xConfirmPara( m_profile[0]  != m_profile[1], "The profile in VpsProfileTierLevel[1] must be equal to the profile in VpsProfileTierLevel[0].");
     1607        xConfirmPara( m_inblFlag[0] != m_inblFlag[1], "inblFlag in VpsProfileTierLevel[1] must be equal to the inblFlag in VpsProfileTierLevel[0].");
     1608      }
     1609    }
     1610#else
     1611    xConfirmPara( m_profileLevelTierIdx.size() < m_vpsNumLayerSets + m_outputLayerSetIdx.size(), "The number of Profile Level Tier indices must be equal to the number of layer set plus the number of output layer set indices" );
     1612#endif
     1613
     1614    // Layer Dependencies 
    14821615  for (Int i = 0; i < m_numberOfLayers; i++ )
    14831616  {
     
    23412474#endif
    23422475#if H_MV
     2476#if H_MV_HLS10_GEN_FIX
     2477  xPrintParaVector( "NuhLayerId"     , m_layerIdInNuh );
     2478  if ( m_targetEncLayerIdList.size() > 0)
     2479  {
     2480    xPrintParaVector( "TargetEncLayerIdList"     , m_targetEncLayerIdList );
     2481  }
     2482#endif
    23432483  xPrintParaVector( "ViewIdVal"     , m_viewId );
    23442484  xPrintParaVector( "ViewOrderIndex", m_viewOrderIndex );
  • branches/HTM-12.0-dev1/source/App/TAppEncoder/TAppEncCfg.h

    r1039 r1054  
    8181  std::vector<Int>       m_depthFlag;                         ///< depth flag
    8282#endif
     83#if H_MV_HLS10_GEN_FIX
     84  std::vector<Int>       m_targetEncLayerIdList;              ///< layer Ids in Nuh to be encoded
     85#endif
    8386  std::vector<Int>       m_layerIdInNuh;                      ///< layer Id in Nuh for each layer
    8487  Bool                   m_splittingFlag;                     ///< Splitting Flag
     
    8992  Int                    m_vpsNumLayerSets;                   ///< Number of layer sets
    9093  std::vector< std::vector<Int> > m_layerIdsInSets;           ///< LayerIds in vps of layer set
    91   Int                    m_defaultOutputLayerIdc;       ///< Specifies output layers of layer sets, 0: output all layers, 1: output highest layers, 2: specified by LayerIdsInDefOuputLayerSet
     94#if H_MV_HLS10_ADD_LAYERSETS
     95  Int                    m_numAddLayerSets;                    ///< Number of additional layer sets
     96  std::vector< std::vector<Int> > m_highestLayerIdxPlus1;      ///< HighestLayerIdxPlus1 for each additional layer set and each independent layer (value with index 0 will be ignored)
     97#endif
     98  Int                    m_defaultOutputLayerIdc;             ///< Specifies output layers of layer sets, 0: output all layers, 1: output highest layers, 2: specified by LayerIdsInDefOuputLayerSet
    9299  std::vector<Int>       m_outputLayerSetIdx;                 ///< Indices of layer sets used as additional output layer sets 
    93100  std::vector< std::vector<Int> > m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers
    94101  std::vector< std::vector<Int> > m_layerIdsInDefOutputLayerSet; ///< Indices in vps of output layers in layer sets
     102#if H_MV_HLS10_ADD_LAYERSETS
     103  std::vector< std::vector< Int > > m_profileTierLevelIdx;      ///< Indices of of profile, per layer in layer set
     104#else
    95105  std::vector<Int>       m_profileLevelTierIdx;               ///< Indices of of profile level tier
     106#endif
    96107  std::vector<Bool>      m_altOutputLayerFlag;                ///< Alt output layer flag
    97108
     
    124135  std::vector< std::vector<Bool > > m_ctuBasedOffsetEnabledFlag;
    125136  std::vector< std::vector<Int  > > m_minHorizontalCtuOffsetPlus1;
     137#if H_MV_HLS10_VPS_VUI
     138  Bool m_singleLayerForNonIrapFlag;
     139  Bool m_higherLayerIrapSkipFlag;
     140#endif // H_MV_HLS10_VPS_VUI
     141
    126142
    127143#if H_3D_IV_MERGE
     
    174190 
    175191  // profile/level
     192#if H_MV_HLS10_PTL
     193#if H_MV
     194  std::vector< Profile::Name > m_profile;
     195  std::vector< Level::Tier   > m_levelTier;
     196  std::vector< Level::Name   > m_level;
     197  std::vector< Bool          > m_inblFlag;
     198#else
    176199  Profile::Name m_profile;
    177200  Level::Tier   m_levelTier;
    178201  Level::Name   m_level;
     202#endif
     203#endif
     204
    179205  Bool m_progressiveSourceFlag;
    180206  Bool m_interlacedSourceFlag;
    181207  Bool m_nonPackedConstraintFlag;
    182208  Bool m_frameOnlyConstraintFlag;
    183  
    184209  // coding structure
    185210#if H_MV
     
    440465  std::vector<Int>  m_sbPropAvgBitRate;
    441466  std::vector<Int>  m_sbPropMaxBitRate;
     467#if H_MV_HLS10_GEN_FIX
     468  Bool              m_outputVpsInfo;
     469#endif
    442470#endif
    443471#if H_3D
     
    506534  Void  xPrintUsage     ();                                   ///< print usage
    507535#if H_MV
     536
     537#if H_MV_HLS10_PTL
     538  template<typename T>
     539  Void xReadStrToEnum(string in, std::vector<T> &val)
     540  {
     541    val.clear();
     542
     543    char* cElement = NULL;
     544    char* cString = new char[in.size()+1];
     545    strcpy(cString, in.c_str());
     546
     547    cElement = strtok( cString, " " );
     548    while ( cElement != NULL )
     549    {
     550      T profile;       
     551      std::istringstream ss( cElement );
     552      ss >> profile;
     553      val.push_back( profile );
     554      cElement = strtok( NULL, " " );
     555    }
     556  }
     557#endif
     558
     559
    508560  template <typename T>
    509561  Void xResizeVector(  std::vector<T> & rpcVector )
  • branches/HTM-12.0-dev1/source/App/TAppEncoder/TAppEncTop.cpp

    r1048 r1054  
    133133  xSetLayerIds             ( vps );   
    134134  xSetDimensionIdAndLength ( vps );
    135   xSetDependencies( vps );
     135  xSetDependencies         ( vps );
     136  xSetRepFormat            ( vps );
    136137  xSetProfileTierLevel     ( vps );
    137   xSetRepFormat            ( vps );
    138138  xSetLayerSets            ( vps );
    139139  xSetDpbSize              ( vps );
     
    144144  xDeriveDltArray          ( vps, dlt );
    145145#endif
    146 
     146#if H_MV_HLS10_GEN_FIX
     147  Bool wasEmpty = true;
     148  if ( m_targetEncLayerIdList.size() == 0 )
     149  {
     150    for (Int i = 0; i < m_numberOfLayers; i++ )
     151    {
     152      m_targetEncLayerIdList.push_back( m_layerIdInNuh[ i ] );
     153    }
     154  }
     155  for( Int i = (Int) m_targetEncLayerIdList.size()-1 ; i >= 0 ; i--)
     156  {
     157    Int iNuhLayerId = m_targetEncLayerIdList[i];
     158    Bool allRefLayersPresent = true;
     159    for( Int j = 0; j < vps.getNumRefLayers( iNuhLayerId ); j++)
     160    {
     161      allRefLayersPresent = allRefLayersPresent && xLayerIdInTargetEncLayerIdList( vps.getIdRefLayer( iNuhLayerId, j) );
     162    }
     163    if ( !allRefLayersPresent )
     164    {
     165      printf("\nCannot encode layer with nuh_layer_id equal to %d since not all reference layers are in TargetEncLayerIdList\n", iNuhLayerId);
     166      m_targetEncLayerIdList.erase( m_targetEncLayerIdList.begin() + i  );
     167    }
     168  }
     169#endif
     170
     171#if H_MV_HLS10_ADD_LAYERSETS
     172  if ( m_outputVpsInfo )
     173  { 
     174    vps.printLayerDependencies();
     175    vps.printLayerSets();
     176    vps.printPTL();
     177  }
     178#endif
    147179
    148180  for(Int layerIdInVps = 0; layerIdInVps < m_numberOfLayers; layerIdInVps++)
     
    248280#endif
    249281
     282#if H_MV
     283  m_cTEncTop.setProfile(m_profile[0]);
     284  m_cTEncTop.setLevel  (m_levelTier[0], m_level[0]);
     285#else
    250286  m_cTEncTop.setProfile(m_profile);
    251287  m_cTEncTop.setLevel(m_levelTier, m_level);
     288#endif
    252289  m_cTEncTop.setProgressiveSourceFlag(m_progressiveSourceFlag);
    253290  m_cTEncTop.setInterlacedSourceFlag(m_interlacedSourceFlag);
     
    801838 
    802839#if H_MV
     840#if H_MV_HLS10_GEN_FIX
     841  while ( (m_targetEncLayerIdList.size() != 0 ) && !allEos )
     842#else
    803843  while ( !allEos )
     844#endif
    804845  {
    805846    for(Int layer=0; layer < m_numberOfLayers; layer++ )
    806847    {
     848#if H_MV_HLS10_GEN_FIX
     849      if (!xLayerIdInTargetEncLayerIdList( m_layerIdInNuh[ layer ] ))
     850      {
     851        continue;
     852      }
     853#endif
     854
    807855      Int frmCnt = 0;
    808856      while ( !eos[layer] && !(frmCnt == gopSize))
     
    844892      for(Int layer=0; layer < m_numberOfLayers; layer++ )
    845893      {
     894#if H_MV_HLS10_GEN_FIX
     895        if (!xLayerIdInTargetEncLayerIdList( m_layerIdInNuh[ layer ] ))
     896        {
     897          continue;
     898        }
     899#endif
     900
    846901#if H_3D_VSO       
    847902          if( m_bUseVSO && m_bUseEstimatedVSD && iNextPoc < m_framesToBeEncoded )
     
    870925  for(Int layer=0; layer < m_numberOfLayers; layer++ )
    871926  {
     927#if H_MV_HLS10_GEN_FIX
     928    if (!xLayerIdInTargetEncLayerIdList( m_layerIdInNuh[ layer ] ))
     929    {
     930      continue;
     931    }
     932#endif
    872933    m_acTEncTopList[layer]->printSummary( m_acTEncTopList[layer]->getNumAllPicCoded(), m_isField );
    873934  }
     
    14991560Void TAppEncTop::xSetProfileTierLevel( TComVPS& vps )
    15001561{
     1562#if H_MV_HLS10_PTL
     1563
     1564  // SET PTL
     1565  assert( m_profile.size() == m_level.size() && m_profile.size() == m_levelTier.size() );
     1566  vps.setVpsNumProfileTierLevelMinus1( (Int) m_profile.size() - 1 );
     1567  for ( Int ptlIdx = 0; ptlIdx <= vps.getVpsNumProfileTierLevelMinus1(); ptlIdx++ )
     1568  {
     1569    if ( ptlIdx > 1 )
     1570    {
     1571      Bool vpsProfilePresentFlag = ( m_profile[ptlIdx] != m_profile[ptlIdx - 1] )
     1572        || ( m_inblFlag[ptlIdx ] != m_inblFlag[ptlIdx - 1] );
     1573      vps.setVpsProfilePresentFlag( ptlIdx, vpsProfilePresentFlag );
     1574    }
     1575
     1576    xSetProfileTierLevel( vps, ptlIdx, -1, m_profile[ptlIdx], m_level[ptlIdx],
     1577      m_levelTier[ ptlIdx ], m_progressiveSourceFlag, m_interlacedSourceFlag,
     1578      m_nonPackedConstraintFlag, m_frameOnlyConstraintFlag,  m_inblFlag[ptlIdx] );     
     1579  } 
     1580#else
    15011581  const Int vpsNumProfileTierLevelMinus1 = 0; //TBD
    15021582  vps.setVpsNumProfileTierLevelMinus1( vpsNumProfileTierLevelMinus1 );
     
    15061586    vps.setVpsProfilePresentFlag( i, true );
    15071587  }
     1588#endif
    15081589}
    15091590
     
    15251606  //repFormat->setSeparateColourPlaneVpsFlag( );
    15261607
     1608#if H_MV_HLS10_GEN_VSP_CONF_WIN
     1609  repFormat->setConformanceWindowVpsFlag( true );
     1610  repFormat->setConfWinVpsLeftOffset    ( m_confLeft   / TComSPS::getWinUnitX( repFormat->getChromaFormatVpsIdc() ) );
     1611  repFormat->setConfWinVpsRightOffset   ( m_confRight  / TComSPS::getWinUnitX( repFormat->getChromaFormatVpsIdc() )  );
     1612  repFormat->setConfWinVpsTopOffset     ( m_confTop    / TComSPS::getWinUnitY( repFormat->getChromaFormatVpsIdc() )  );
     1613  repFormat->setConfWinVpsBottomOffset  ( m_confBottom / TComSPS::getWinUnitY( repFormat->getChromaFormatVpsIdc() ) );
     1614#endif
     1615
    15271616  assert( vps.getRepFormat( 0 ) == NULL );
    15281617  vps.setRepFormat( 0 , repFormat );
     
    15401629  { 
    15411630    Int currLsIdx = vps.olsIdxToLsIdx( i );
     1631#if !H_MV_HLS10_ADD_LAYERSETS
    15421632    std::vector<Int> targetDecLayerIdList = vps.getTargetDecLayerIdList( i );
     1633#endif
    15431634    Bool subLayerFlagInfoPresentFlag = false;
    15441635
     
    15461637    {   
    15471638      Bool subLayerDpbInfoPresentFlag = false;
     1639#if !H_MV_HLS10_ADD_LAYERSETS
    15481640      assert( vps.getNumLayersInIdList( currLsIdx ) == targetDecLayerIdList.size() );
     1641#endif
    15491642      for( Int k = 0; k < vps.getNumLayersInIdList( currLsIdx ); k++ )   
    15501643      {
     1644#if H_MV_HLS10_DBP_SIZE
     1645        Int layerIdInVps = vps.getLayerIdInVps( vps.getLayerSetLayerIdList( currLsIdx, k ) );
     1646        if ( vps.getNecessaryLayerFlag( i,k ) && ( vps.getVpsBaseLayerInternalFlag() || vps.getLayerSetLayerIdList( currLsIdx, k ) != 0 ) )
     1647        {       
     1648          dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, m_maxDecPicBufferingMvc[ layerIdInVps ][ j ] - 1 );
     1649          if ( j > 0 )
     1650          {
     1651            subLayerDpbInfoPresentFlag = subLayerDpbInfoPresentFlag || ( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) != dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j - 1 ) );
     1652          }
     1653        }
     1654        else
     1655        {
     1656          if (vps.getNecessaryLayerFlag(i,k) && j == 0 && k == 0 )
     1657          {         
     1658            dpbSize->setMaxVpsDecPicBufferingMinus1(i, k ,j, 0 );
     1659          }
     1660        }
     1661#else
    15511662        Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[k] );           
    15521663        dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, m_maxDecPicBufferingMvc[ layerIdInVps ][ j ] - 1 );
     1664
    15531665        if ( j > 0 )
    15541666        {
    15551667          subLayerDpbInfoPresentFlag = subLayerDpbInfoPresentFlag || ( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) != dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j - 1 ) );
    15561668        }
     1669#endif
    15571670      }       
    15581671
    15591672      Int maxNumReorderPics = MIN_INT;
     1673#if H_MV_HLS10_DBP_SIZE
     1674      for ( Int idx = 0; idx < vps.getNumLayersInIdList( currLsIdx ); idx++ )
     1675      {
     1676        if (vps.getNecessaryLayerFlag(i, idx ))
     1677        {       
     1678          Int layerIdInVps = vps.getLayerIdInVps( vps.getLayerSetLayerIdList(currLsIdx, idx) );       
     1679          maxNumReorderPics = std::max( maxNumReorderPics, m_numReorderPicsMvc[ layerIdInVps ][ j ] );
     1680        }
     1681      }
     1682#else
    15601683      for ( Int idx = 0; idx < targetDecLayerIdList.size(); idx++ )
    15611684      {
     
    15631686        maxNumReorderPics = std::max( maxNumReorderPics, m_numReorderPicsMvc[ layerIdInVps ][ j ] );
    15641687      }
     1688#endif
    15651689      assert( maxNumReorderPics != MIN_INT );
    15661690
     
    15881712}
    15891713
    1590 
    15911714Void TAppEncTop::xSetLayerSets( TComVPS& vps )
    15921715{   
     
    16101733  // Additional output layer sets + profileLevelTierIdx
    16111734  vps.setDefaultOutputLayerIdc      ( m_defaultOutputLayerIdc );   
     1735#if H_MV_HLS10_ADD_LAYERSETS
     1736  if( vps.getNumIndependentLayers() == 0 && m_numAddLayerSets > 0  )
     1737  {
     1738    fprintf( stderr, "\nWarning: Ignoring additional layer sets since NumIndependentLayers is equal to 0.\n");           
     1739  }
     1740  else
     1741  {
     1742    vps.setNumAddLayerSets( m_numAddLayerSets );
     1743    if ( m_highestLayerIdxPlus1.size() < vps.getNumAddLayerSets() )
     1744    {
     1745      fprintf(stderr, "\nError: Number of highestLayerIdxPlus1 parameters must be greater than or equal to NumAddLayerSets\n");
     1746      exit(EXIT_FAILURE);
     1747    }
     1748
     1749    for (Int i = 0; i < vps.getNumAddLayerSets(); i++)
     1750    {
     1751      if ( m_highestLayerIdxPlus1[ i ].size() < vps.getNumIndependentLayers() )
     1752      {
     1753        fprintf(stderr, "Error: Number of elements in highestLayerIdxPlus1[ %d ] parameters must be greater than or equal to NumIndependentLayers(= %d)\n", i, vps.getNumIndependentLayers());
     1754        exit(EXIT_FAILURE);
     1755      }
     1756
     1757      for (Int j = 1; j < vps.getNumIndependentLayers(); j++)
     1758      {
     1759        if ( m_highestLayerIdxPlus1[ i ][ j ]  < 0 || m_highestLayerIdxPlus1[ i ][ j ] > vps.getNumLayersInTreePartition( j ) )
     1760        {
     1761          fprintf(stderr, "Error: highestLayerIdxPlus1[ %d ][ %d ] shall be in the range of 0 to NumLayersInTreePartition[ %d ] (= %d ), inclusive. \n", i, j, j, vps.getNumLayersInTreePartition( j ) );
     1762          exit(EXIT_FAILURE);
     1763        }
     1764        vps.setHighestLayerIdxPlus1( i, j, m_highestLayerIdxPlus1[ i ][ j ] );
     1765      }
     1766      vps.deriveAddLayerSetLayerIdList( i );
     1767    }       
     1768  } 
     1769#else
    16121770  vps.setNumAddLayerSets            ( 0                             ); 
     1771#endif
    16131772  vps.setNumAddOlss                 ( numAddOuputLayerSets          );
    16141773  vps.initTargetLayerIdLists();
    16151774
     1775#if H_MV_HLS10_ADD_LAYERSETS
     1776  for (Int olsIdx = 0; olsIdx < vps.getNumLayerSets() + numAddOuputLayerSets; olsIdx++)
     1777  {
     1778    Int addOutLsIdx = olsIdx - vps.getNumLayerSets();     
     1779#else
    16161780  for (Int olsIdx = 0; olsIdx < m_vpsNumLayerSets + numAddOuputLayerSets; olsIdx++)
    16171781  {
    16181782    Int addOutLsIdx = olsIdx - m_vpsNumLayerSets;     
    1619    
     1783#endif   
    16201784    vps.setLayerSetIdxForOlsMinus1( olsIdx, ( ( addOutLsIdx < 0 ) ?  olsIdx  : m_outputLayerSetIdx[ addOutLsIdx ] ) - 1 );
    16211785
     1786#if H_MV_HLS10_ADD_LAYERSETS
     1787    Int lsIdx = vps.olsIdxToLsIdx( olsIdx );
     1788#else
    16221789    std::vector<Int>& layerIdList    = m_layerIdsInSets[ vps.olsIdxToLsIdx( olsIdx ) ];
    1623 
     1790#endif
    16241791    if (vps.getDefaultOutputLayerIdc() == 2 || addOutLsIdx >= 0 )
    16251792    {
     1793#if H_MV_HLS10_ADD_LAYERSETS
     1794      for ( Int i = 0; i < vps.getNumLayersInIdList( lsIdx ); i++)
     1795#else
    16261796      for ( Int i = 0; i < layerIdList.size(); i++)
     1797#endif
    16271798      {
    16281799        vps.setOutputLayerFlag( olsIdx, i, ( olsIdx == 0 && i == 0 ) ? vps.inferOutputLayerFlag(olsIdx, i ) : false ); // This is a software only fix for a bug in the spec. In spec outputLayerFlag neither present nor inferred for this case !
     
    16341805      for (Int j = 0; j < outLayerIdList.size(); j++)
    16351806      {   
     1807#if H_MV_HLS10_ADD_LAYERSETS
     1808        for ( Int i = 0; i < vps.getNumLayersInIdList( lsIdx ); i++)
     1809        {
     1810          if ( vps.getLayerSetLayerIdList( lsIdx, i ) == outLayerIdList[ j ] )
     1811#else
    16361812        for (Int i = 0; i < layerIdList.size(); i++ )
    16371813        {
    16381814          if ( layerIdList[ i ] == outLayerIdList[ j ] )
     1815#endif
    16391816          {
    16401817            vps.setOutputLayerFlag( olsIdx, i, true );       
     
    16431820          }
    16441821        }
    1645         assert( outputLayerInLayerSetFlag ); // The output layer is not not in the layer set.
     1822#if H_MV_HLS10_ADD_LAYERSETS
     1823        if ( !outputLayerInLayerSetFlag )
     1824        {
     1825          fprintf(stderr, "Error: Output layer %d in output layer set %d not in corresponding layer set %d \n", outLayerIdList[ j ], olsIdx , lsIdx );
     1826          exit(EXIT_FAILURE);
     1827        }
     1828#else
     1829        assert( outputLayerInLayerSetFlag ); // The output layer is not in the layer set.
     1830#endif
    16461831      }
    16471832    }
    16481833    else
    16491834    {
     1835#if H_MV_HLS10_ADD_LAYERSETS
     1836      for ( Int i = 0; i < vps.getNumLayersInIdList( lsIdx ); i++)
     1837#else
    16501838      for ( Int i = 0; i < layerIdList.size(); i++)
     1839#endif
    16511840      {
    16521841        vps.setOutputLayerFlag( olsIdx, i, vps.inferOutputLayerFlag( olsIdx, i ) );       
     
    16541843    }
    16551844
     1845#if H_MV_HLS10_NESSECARY_LAYER
     1846    vps.deriveNecessaryLayerFlags( olsIdx );
     1847#endif
    16561848    vps.deriveTargetLayerIdList(  olsIdx );
    16571849
     1850#if H_MV_HLS10_PTL
     1851    // SET profile_tier_level_index.
     1852    if ( olsIdx == 0 )
     1853    {   
     1854      vps.setProfileTierLevelIdx( 0, 0 , vps.getMaxLayersMinus1() > 0 ? 1 : 0 );
     1855    }
     1856    else
     1857    {
     1858      Int lsIdx = vps.olsIdxToLsIdx( olsIdx );
     1859      if( (Int) m_profileTierLevelIdx[ olsIdx ].size() < vps.getNumLayersInIdList( lsIdx ) )
     1860      {
     1861        fprintf( stderr, "Warning: Not enough profileTierLevelIdx values given for the %d-th OLS. Inferring default values.\n", olsIdx );
     1862      }
     1863      for (Int j = 0; j < vps.getNumLayersInIdList( lsIdx ); j++)
     1864      {
     1865        if( j < (Int) m_profileTierLevelIdx[ olsIdx ].size() )
     1866        {
     1867          vps.setProfileTierLevelIdx(olsIdx, j, m_profileTierLevelIdx[olsIdx][j] );
     1868        }
     1869        else
     1870        {
     1871          // setting default values
     1872          if ( j == 0 || vps.getVpsNumProfileTierLevelMinus1() < 1 )
     1873          {
     1874            // set base layer as default
     1875            vps.setProfileTierLevelIdx(olsIdx, j, 1 );
     1876          }
     1877          else
     1878          {
     1879            // set VpsProfileTierLevel[2] as default
     1880            vps.setProfileTierLevelIdx(olsIdx, j, 2 );
     1881          }
     1882        }
     1883      }
     1884    }
     1885#else
    16581886    if ( olsIdx > 0 )
    16591887    {
    16601888      vps.setProfileLevelTierIdx( olsIdx, m_profileLevelTierIdx[ olsIdx ] );
    16611889    }
     1890#endif
    16621891   
    16631892    if ( vps.getNumOutputLayersInOutputLayerSet( olsIdx ) == 1 &&
     
    16971926    if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    16981927    {
     1928#if H_MV_HLS10_VPS_VUI
     1929      for( Int i = 0; i  <  vps.getNumLayerSets(); i++ )
     1930#else
    16991931      for( Int i = 0; i  <=  vps.getVpsNumLayerSetsMinus1(); i++ )
     1932#endif
    17001933      {
    17011934        for( Int j = 0; j  <=  vps.getMaxTLayers(); j++ )
     
    17461979        for( Int j = 0; j < vps.getNumDirectRefLayers( vps.getLayerIdInNuh( i ) ) ; j++ )
    17471980        { 
     1981#if H_MV_HLS10_REF_PRED_LAYERS
     1982          Int layerIdx = vps.getLayerIdInVps( vps.getIdDirectRefLayer(vps.getLayerIdInNuh( i ) , j  )); 
     1983#else
    17481984          Int layerIdx = vps.getLayerIdInVps( vps.getRefLayerId(vps.getLayerIdInNuh( i ) , j  )); 
     1985#endif
    17491986          if( pcVPSVUI->getTilesInUseFlag( i )  &&  pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 
    17501987          {
     
    17642001      }
    17652002    }
     2003
     2004#if H_MV_HLS10_VPS_VUI
     2005  pcVPSVUI->setSingleLayerForNonIrapFlag( m_singleLayerForNonIrapFlag );
     2006  pcVPSVUI->setHigherLayerIrapSkipFlag( m_higherLayerIrapSkipFlag );
     2007#endif
    17662008
    17672009    pcVPSVUI->setIlpRestrictedRefLayersFlag( m_ilpRestrictedRefLayersFlag );
  • branches/HTM-12.0-dev1/source/App/TAppEncoder/TAppEncTop.h

    r976 r1054  
    132132  Void xSetLayerSets              ( TComVPS& vps );
    133133  Void xSetProfileTierLevel       ( TComVPS& vps );
     134
     135#if H_MV_HLS10_PTL
     136  Void xSetProfileTierLevel( TComVPS& vps, Int profileTierLevelIdx, Int subLayer,                             
     137                             Profile::Name profile, Level::Name level, Level::Tier tier,
     138                             Bool progressiveSourceFlag, Bool interlacedSourceFlag,
     139                             Bool nonPackedConstraintFlag, Bool frameOnlyConstraintFlag,
     140                             Bool inbldFlag )
     141  {
     142    TComPTL* ptlStruct = vps.getPTL( profileTierLevelIdx );   
     143    assert( ptlStruct != NULL );
     144
     145    ProfileTierLevel* ptl;
     146    if ( subLayer == -1 )
     147    {
     148      ptl = ptlStruct->getGeneralPTL();
     149    }
     150    else
     151    {
     152      ptl = ptlStruct->getSubLayerPTL(  subLayer );
     153    }
     154
     155    assert( ptl != NULL );
     156
     157
     158    ptl->setProfileIdc( profile );
     159    ptl->setTierFlag  ( tier    );
     160    ptl->setLevelIdc  ( level   );
     161    ptl->setProfileCompatibilityFlag( profile, true );
     162
     163    switch ( profile )
     164    {
     165    case Profile::MAIN:
     166      break;
     167    case Profile::MULTIVIEWMAIN:
     168#if H_3D
     169    case Profile::MAIN3D:
     170#endif
     171      ptl->setMax12bitConstraintFlag      ( true  );
     172      ptl->setMax12bitConstraintFlag      ( true  );
     173      ptl->setMax10bitConstraintFlag      ( true  );
     174      ptl->setMax8bitConstraintFlag       ( true  );
     175      ptl->setMax422chromaConstraintFlag  ( true  );
     176      ptl->setMax420chromaConstraintFlag  ( true  );
     177      ptl->setMaxMonochromeConstraintFlag ( false );
     178      ptl->setIntraConstraintFlag         ( false );
     179      ptl->setOnePictureOnlyConstraintFlag( false );
     180      ptl->setLowerBitRateConstraintFlag  ( true  );       
     181      break;
     182    default:
     183      assert( 0 ); // other profiles currently not supported
     184      break;
     185    }
     186  }
     187
     188
     189#endif
    134190  Void xSetRepFormat              ( TComVPS& vps );
    135191  Void xSetDpbSize                ( TComVPS& vps );
     
    137193  GOPEntry* xGetGopEntry( Int layerIdInVps, Int poc );
    138194  Int  xGetMax( std::vector<Int>& vec);
     195#if H_MV_HLS10_GEN_FIX
     196  Bool xLayerIdInTargetEncLayerIdList( Int nuhLayerId )
     197  {
     198    return  ( std::find(m_targetEncLayerIdList.begin(), m_targetEncLayerIdList.end(), nuhLayerId) != m_targetEncLayerIdList.end()) ;
     199  }
     200#endif
    139201#endif
    140202#if H_3D
  • branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComRom.cpp

    r1049 r1054  
    7171    c <<= 1;
    7272  } 
     73
     74#if H_MV
     75#if H_MV_HLS_PTL_LIMITS
     76 g_generalTierAndLevelLimits[ Level::LEVEL1   ] = TComGeneralTierAndLevelLimits(    36864,     350,  INT_MIN,   16,   1,   1 );
     77 g_generalTierAndLevelLimits[ Level::LEVEL2   ] = TComGeneralTierAndLevelLimits(   122880,    1500,  INT_MIN,   16,   1,   1 );
     78 g_generalTierAndLevelLimits[ Level::LEVEL2_1 ] = TComGeneralTierAndLevelLimits(   245760,    3000,  INT_MIN,   20,   1,   1 );
     79 g_generalTierAndLevelLimits[ Level::LEVEL3   ] = TComGeneralTierAndLevelLimits(   552960,    6000,  INT_MIN,   30,   2,   2 );
     80 g_generalTierAndLevelLimits[ Level::LEVEL3_1 ] = TComGeneralTierAndLevelLimits(   983040,   10000,  INT_MIN,   40,   3,   3 );
     81 g_generalTierAndLevelLimits[ Level::LEVEL4   ] = TComGeneralTierAndLevelLimits(  2228224,   12000,    30000,   75,   5,   5 );
     82 g_generalTierAndLevelLimits[ Level::LEVEL4_1 ] = TComGeneralTierAndLevelLimits(  2228224,   20000,    50000,   75,   5,   5 );
     83 g_generalTierAndLevelLimits[ Level::LEVEL5   ] = TComGeneralTierAndLevelLimits(  8912896,   25000,   100000,  200,  11,  10 );
     84 g_generalTierAndLevelLimits[ Level::LEVEL5_1 ] = TComGeneralTierAndLevelLimits(  8912896,   40000,   160000,  200,  11,  10 );
     85 g_generalTierAndLevelLimits[ Level::LEVEL5_2 ] = TComGeneralTierAndLevelLimits(  8912896,   60000,   240000,  200,  11,  10 );
     86 g_generalTierAndLevelLimits[ Level::LEVEL6   ] = TComGeneralTierAndLevelLimits( 35651584,   60000,   240000,  600,  22,  20 );
     87 g_generalTierAndLevelLimits[ Level::LEVEL6_1 ] = TComGeneralTierAndLevelLimits( 35651584,  120000,   480000,  600,  22,  20 );
     88 g_generalTierAndLevelLimits[ Level::LEVEL6_2 ] = TComGeneralTierAndLevelLimits( 35651584,  240000,   800000,  600,  22,  20 );
     89#endif
     90#endif
     91
    7392}
    7493
  • branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComRom.h

    r1049 r1054  
    187187// ==========================================
    188188
     189#if H_MV_HLS_PTL_LIMITS
     190class TComGeneralTierAndLevelLimits
     191{
     192public:
     193  TComGeneralTierAndLevelLimits::TComGeneralTierAndLevelLimits
     194  ( Int maxLumaPs,
     195    Int maxCPBMainTier,
     196    Int maxCPBHighTier,
     197    Int maxSliceSegmentsPerPicture,
     198    Int maxTileRows,
     199    Int maxTileCols )
     200  : m_maxLumaPs                 ( maxLumaPs                     ),
     201    m_maxCPBMainTier            ( maxCPBMainTier                ),
     202    m_maxCPBHighTier            ( maxCPBHighTier                ),
     203    m_maxSliceSegmentsPerPicture( maxSliceSegmentsPerPicture    ),
     204    m_maxTileRows               ( maxTileRows                   ),
     205    m_maxTileCols               ( maxTileCols                   );
     206  {};
     207
     208  Int getMaxLumaPs                 ( ) { return m_maxLumaPs                 ; };
     209  Int getMaxCPBMainTier            ( ) { return m_maxCPBMainTier            ; };
     210  Int getMaxCPBHighTier            ( ) { return m_maxCPBHighTier            ; };
     211  Int getMaxSliceSegmentsPerPicture( ) { return m_maxSliceSegmentsPerPicture; };
     212  Int getMaxTileRows               ( ) { return m_maxTileRows               ; };
     213  Int getMaxTileCols               ( ) { return m_maxTileCols               ; };
     214
     215private:
     216  const Int m_maxLumaPs;
     217  const Int m_maxCPBMainTier;
     218  const Int m_maxCPBHighTier;
     219  const Int m_maxSliceSegmentsPerPicture;
     220  const Int m_maxTileRows;
     221  const Int m_maxTileCols;
     222};
     223
     224extern std::map< Level::Name, TComGeneralTierAndLevelLimits > g_generalTierAndLevelLimits;   
     225
     226#endif
    189227// ====================================================================================================================
    190228// Misc.
  • branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.cpp

    r1050 r1054  
    18751875#if H_MV
    18761876  m_vpsBaseLayerInternalFlag = true;
     1877#if H_MV_HLS10_GEN_VSP_BASE_LAYER_AVAIL
     1878  m_vpsBaseLayerAvailableFlag = true;
     1879#endif
    18771880#endif
    18781881
     
    19001903  {
    19011904    m_layerSetIdxForOlsMinus1[i]  = -1;
     1905#if !H_MV_HLS10_PTL
    19021906    m_profileLevelTierIdx[i]      = 0;
     1907#endif
    19031908    for ( Int j = 0; j < MAX_VPS_NUH_LAYER_ID_PLUS1; j++)
    19041909    {
     1910#if H_MV_HLS10_PTL
     1911      m_profileTierLevelIdx[i][j] = false;
     1912#endif
    19051913      m_outputLayerFlag[i][j] = false;
    19061914    }
     
    19661974      m_directDependencyFlag[i][j] = false;
    19671975      m_directDependencyType[i][j] = -1;
     1976#if H_MV_HLS10_REF_PRED_LAYERS
     1977      m_dependencyFlag  [i][j]    = false;
     1978      m_idDirectRefLayer[i][j]    = -1;
     1979      m_idPredictedLayer[i][j]    = -1;
     1980      m_idRefLayer      [i][j]    = -1;
     1981#else
    19681982      m_refLayerId[i][j]           = -1;
     1983#endif
    19691984      m_maxTidIlRefPicsPlus1[i][j]  = 7;
    19701985    }
     
    20502065  assert( getVpsNumRepFormatsMinus1() <= 255 );
    20512066
     2067#if H_MV_HLS10_ADD_LAYERSETS
     2068  // The value of num_add_layer_sets shall be in the range of 0 to 1023, inclusive.
     2069  assert( getNumAddLayerSets() >= 0 && getNumAddLayerSets() <= 1023 );
     2070#endif
    20522071  return true;
    20532072}
     
    20812100Void TComVPS::setRefLayers()
    20822101{
     2102
     2103#if H_MV_HLS10_REF_PRED_LAYERS
     2104  for( Int i = 0; i  <=  getMaxLayersMinus1(); i++ )
     2105  {
     2106    for( Int j = 0; j  <=  getMaxLayersMinus1(); j++ )
     2107    {
     2108      m_dependencyFlag[ i ][ j ] = getDirectDependencyFlag( i , j );
     2109      for( Int k = 0; k < i; k++ )
     2110      {
     2111        if( getDirectDependencyFlag(i , k )  &&  m_dependencyFlag[k][j] )
     2112        {
     2113          m_dependencyFlag[ i ][ j ] = true;
     2114        }
     2115      }
     2116    }
     2117  }
     2118
     2119  for( Int i = 0; i  <=  getMaxLayersMinus1(); i++ )
     2120  {
     2121    Int iNuhLId = getLayerIdInNuh( i );
     2122    Int d = 0;
     2123    Int r = 0;
     2124    Int p = 0;
     2125    for( Int j = 0; j  <=  getMaxLayersMinus1(); j++ )
     2126    {
     2127      Int jNuhLid = getLayerIdInNuh( j );
     2128      if( getDirectDependencyFlag( i , j ) )
     2129      {
     2130        m_idDirectRefLayer[iNuhLId][d++] = jNuhLid;
     2131      }
     2132      if( getDependencyFlag( i , j ) )
     2133      {
     2134        m_idRefLayer      [iNuhLId][r++] = jNuhLid;
     2135      }
     2136      if( getDependencyFlag( j , i ) )
     2137      {
     2138        m_idPredictedLayer[iNuhLId][p++] = jNuhLid;
     2139      }
     2140    }
     2141    m_numDirectRefLayers[ iNuhLId ] = d;
     2142    m_numRefLayers      [ iNuhLId ] = r;
     2143    m_numPredictedLayers[ iNuhLId ] = p;
     2144  }
     2145 
     2146  Bool layerIdInListFlag[ 64 ];
     2147  for( Int i = 0; i  <=  63; i++ )
     2148  {
     2149    layerIdInListFlag[ i ] = 0;
     2150  }
     2151
     2152  Int k = 0;
     2153  for( Int i = 0; i  <=  getMaxLayersMinus1(); i++ )
     2154  {
     2155    Int iNuhLId = getLayerIdInNuh( i );
     2156    if( getNumDirectRefLayers( iNuhLId )  ==  0 )
     2157    {
     2158      m_treePartitionLayerIdList[ k ][ 0 ] = iNuhLId;
     2159      Int h = 1; 
     2160      for( Int j = 0; j < getNumPredictedLayers( iNuhLId ); j++ ) 
     2161      {
     2162        Int predLId = getIdPredictedLayer( iNuhLId, j );
     2163        if ( !layerIdInListFlag[ predLId ] )
     2164        {
     2165          m_treePartitionLayerIdList[ k ][ h++ ] = predLId;
     2166          layerIdInListFlag[ predLId ] = 1;
     2167        }         
     2168      }
     2169      m_numLayersInTreePartition[ k++ ] = h;
     2170    }
     2171  }
     2172  m_numIndependentLayers = k;
     2173#else // H_MV_HLS10_GEN
     2174
    20832175  for( Int i = 0; i  <= getMaxLayersMinus1(); i++ )
    20842176  {
     
    21162208    }
    21172209  }
    2118 
     2210 
    21192211  for( Int i = 0; i <= getMaxLayersMinus1(); i++ )  // Bug in spec "<" instead of "<="
    21202212  {
     
    21362228    countedLayerIdxFlag[ i ] = 0;
    21372229  }
    2138  
    21392230  for( Int i = 0, k = 0; i  <=  getMaxLayersMinus1(); i++ )
    21402231  {
     
    21442235      m_treePartitionLayerIdList[ k ][ 0 ] = iNuhLId;
    21452236      m_numLayersInTreePartition[ k ]      = 1;
     2237
    21462238      for( Int j = 0; j < m_numPredictedLayers[ iNuhLId ]; j++ ) 
    21472239      {
     
    21542246      }
    21552247      k++;
    2156     }
    2157     m_numIndependentLayers = k;
    2158   }
    2159 }
    2160 
     2248
     2249      m_numIndependentLayers = k;
     2250    }
     2251  }
     2252#endif // H_MV_HLS10_GEN
     2253}
     2254
     2255#if !H_MV_HLS10_REF_PRED_LAYERS
    21612256Int TComVPS::getRefLayerId( Int layerIdInNuh, Int idx )
    21622257{
     
    21662261  return refLayerIdInNuh;
    21672262}
     2263#endif
    21682264
    21692265Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType )
     
    23152411{
    23162412  assert( lsIdx >= 0 );
     2413#if H_MV_HLS10_ADD_LAYERSETS
     2414  assert( lsIdx <= getNumLayerSets() );
     2415#else
    23172416  assert( lsIdx <= getVpsNumLayerSetsMinus1() );
     2417#endif
    23182418  return (Int) m_layerSetLayerIdList[ lsIdx ].size();
    23192419}
     
    23412441Bool TComVPS::getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth /*= 0 */ )
    23422442{
     2443#if H_MV_HLS10_REF_PRED_LAYERS
     2444  // TBD: Remove getInDirectDependencyFlag entirely.
     2445  return getDependencyFlag( depLayeridInVps, refLayeridInVps );
     2446#else
    23432447  assert( depth < 65 );
    23442448  Bool dependentFlag = getDirectDependencyFlag( depLayeridInVps, refLayeridInVps );
     
    23522456  }
    23532457  return dependentFlag;
     2458#endif
    23542459}
    23552460
     
    23782483
    23792484  Int lsIdx = olsIdxToLsIdx( i );     
    2380  
     2485
    23812486  for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ )
    23822487  {
    2383     m_targetDecLayerIdLists[i].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] );
     2488#if H_MV_HLS10_NESSECARY_LAYER
     2489    if ( getNecessaryLayerFlag( i , j ))
     2490    {
     2491#endif
     2492      m_targetDecLayerIdLists[i].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] );
     2493#if H_MV_HLS10_NESSECARY_LAYER
     2494    }
     2495#endif
     2496
    23842497    if( getOutputLayerFlag( i, j  ))
    23852498    {
     
    24292542}
    24302543
     2544#if !H_MV_HLS10_ADD_LAYERSETS
    24312545Void TComVPS::inferDbpSizeLayerSetZero( TComSPS* sps, Bool encoder )
    24322546{
     
    24512565  }
    24522566}
    2453 
     2567#endif
    24542568Bool TComVPS::getAltOutputLayerFlagVar( Int i )
    24552569{
     
    24652579}
    24662580
     2581#if !H_MV_HLS10_MAXNUMPICS
    24672582Int TComVPS::getMaxNumPics( Int layerId )
    24682583{
     
    24832598  return maxNumPics;
    24842599}
    2485 
     2600#endif
     2601
     2602#if !H_MV_HLS10_REF_PRED_LAYERS
    24862603Void TComVPS::xSetRefLayerFlags( Int currLayerId )
    24872604{
     
    24962613  }
    24972614}
    2498 
     2615#endif
    24992616#endif // H_MV
    25002617
     
    25792696#endif
    25802697
     2698#if !H_MV_HLS10_PPS
    25812699  m_numScaledRefLayerOffsets = 0;
    25822700
     
    25902708    m_scaledRefLayerLeftOffset     [i] = 0;
    25912709    m_scaledRefLayerTopOffset      [i] = 0;
    2592     m_scaledRefLayerRightOffset    [i] = 0;
     2710    m_scaledRefLayerRiFghtOffset    [i] = 0;
    25932711    m_scaledRefLayerBottomOffset   [i] = 0;
    25942712  }
     2713#endif
    25952714#endif
    25962715}
     
    29673086Void TComSPS::inferRepFormat( TComVPS* vps, Int layerIdCurr )
    29683087{
     3088#if H_MV_HLS10_MULTILAYERSPS
     3089  if ( getMultiLayerExtSpsFlag() )
     3090#else
    29693091  if ( layerIdCurr > 0 )
     3092#endif
    29703093  {
    29713094    Int            repFormatIdx = getUpdateRepFormatFlag() ?  getSpsRepFormatIdx() : vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ;
    29723095    TComRepFormat* repFormat    = vps->getRepFormat( repFormatIdx );
    2973       setChromaFormatIdc( repFormat->getChromaFormatVpsIdc() );         
    2974       //// ToDo: add when supported:
    2975       // setSeperateColourPlaneFlag( repFormat->getSeparateColourPlaneVpsFlag() ) ;
    2976 
    2977       setPicWidthInLumaSamples ( repFormat->getPicWidthVpsInLumaSamples()  );
    2978       setPicHeightInLumaSamples( repFormat->getPicHeightVpsInLumaSamples() );
    2979 
    2980       setBitDepthY             ( repFormat->getBitDepthVpsLumaMinus8()   + 8 );
    2981       setQpBDOffsetY           ( (Int) (6*( getBitDepthY() - 8 )) );
    2982 
    2983       setBitDepthC             ( repFormat->getBitDepthVpsChromaMinus8() + 8 );
    2984       setQpBDOffsetC           ( (Int) (6* ( getBitDepthC() -8 ) ) );
    2985     if ( getLayerId() > 0 && getUpdateRepFormatFlag() )
     3096    setChromaFormatIdc( repFormat->getChromaFormatVpsIdc() );         
     3097    //// ToDo: add when supported:
     3098    // setSeperateColourPlaneFlag( repFormat->getSeparateColourPlaneVpsFlag() ) ;
     3099
     3100    setPicWidthInLumaSamples ( repFormat->getPicWidthVpsInLumaSamples()  );
     3101    setPicHeightInLumaSamples( repFormat->getPicHeightVpsInLumaSamples() );
     3102
     3103    setBitDepthY             ( repFormat->getBitDepthVpsLumaMinus8()   + 8 );
     3104    setQpBDOffsetY           ( (Int) (6*( getBitDepthY() - 8 )) );
     3105
     3106    setBitDepthC             ( repFormat->getBitDepthVpsChromaMinus8() + 8 );
     3107    setQpBDOffsetC           ( (Int) (6* ( getBitDepthC() -8 ) ) );
     3108 #if H_MV_HLS10_GEN_VSP_CONF_WIN
     3109    Window &spsConf    = getConformanceWindow();   
     3110
     3111    // Scaled later
     3112    spsConf.setScaledFlag( false );
     3113    spsConf.setWindowLeftOffset  ( repFormat->getConfWinVpsLeftOffset()    );
     3114    spsConf.setWindowRightOffset ( repFormat->getConfWinVpsRightOffset()   );
     3115    spsConf.setWindowTopOffset   ( repFormat->getConfWinVpsTopOffset()     );
     3116    spsConf.setWindowBottomOffset( repFormat->getConfWinVpsBottomOffset()  );   
     3117#endif
     3118
     3119#if H_MV_HLS10_MULTILAYERSPS
     3120   if ( getMultiLayerExtSpsFlag() && getUpdateRepFormatFlag() )
     3121#else
     3122   if ( getLayerId() > 0 && getUpdateRepFormatFlag() )
     3123#endif
    29863124    {
    29873125      assert( getChromaFormatIdc()      <=  repFormat->getChromaFormatVpsIdc()         );
     
    30173155  const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx ));
    30183156
     3157#if H_MV_HLS10_MULTILAYERSPS
     3158  if ( getMultiLayerExtSpsFlag() )
     3159#else
    30193160  if (getLayerId() > 0 )
     3161#endif
    30203162  {
    30213163    Int layerIdx = 0;         
     
    30353177      Int maxDecPicBufferingMinus1 = vps->getDpbSize()->getMaxVpsDecPicBufferingMinus1( targetOptLayerSetIdx, layerIdx, i ) ;
    30363178
    3037       if ( encoder )
     3179      if ( encoder )     
    30383180      {
    30393181        assert( getMaxDecPicBuffering( i ) - 1 == maxDecPicBufferingMinus1 );
     
    30493191Void TComSPS::checkRpsMaxNumPics( TComVPS* vps, Int currLayerId )
    30503192{
     3193#if !H_MV_HLS10_MAXNUMPICS
    30513194  // In spec, when rps is in SPS, nuh_layer_id of SPS is used instead
    30523195  // of nuh_layer_id of slice (currLayerId), this seems to be a bug.
    3053 
     3196#endif
    30543197  for (Int i = 0; i < getRPSList()->getNumberOfReferencePictureSets(); i++ )
    30553198  {
     
    30573200    if ( !rps->getInterRPSPrediction() )
    30583201    {
     3202#if H_MV_HLS10_MAXNUMPICS
     3203      rps->checkMaxNumPics( vps->getVpsExtensionFlag(), INT_MAX, getLayerId(), getMaxDecPicBuffering( getSpsMaxSubLayersMinus1() ) - 1 );   // INT_MAX to be replaced by DpbSize
     3204#else
    30593205      rps->checkMaxNumPics( vps->getVpsExtensionFlag(), vps->getMaxNumPics( currLayerId ),
    30603206        getLayerId(), getMaxDecPicBuffering( getSpsMaxSubLayersMinus1() ) - 1 ); 
     3207#endif
    30613208    }
    30623209  }
     
    34253572{
    34263573  TComVPS* vps = getVPS();
     3574#if H_MV_HLS10_REF_PRED_LAYERS
     3575  Int refLayerIdx = vps->getLayerIdInVps( vps->getIdDirectRefLayer( getLayerId(), i ) );
     3576#else
    34273577  Int refLayerIdx = vps->getLayerIdInVps( vps->getRefLayerId( getLayerId(), i ) );
     3578#endif
    34283579
    34293580  Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >=  getTLayer() )  && ( getTLayer() == 0  ) &&
     
    34963647Int TComSlice::getRefPicLayerId( Int i )
    34973648{
     3649#if H_MV_HLS10_REF_PRED_LAYERS
     3650  return getVPS()->getIdDirectRefLayer( getLayerId(), getInterLayerPredLayerIdc( i ) );
     3651#else
    34983652  return getVPS()->getRefLayerId( getLayerId(), getInterLayerPredLayerIdc( i ) );
     3653#endif
    34993654}
    35003655
     
    42334388, m_nonPackedConstraintFlag(false)
    42344389, m_frameOnlyConstraintFlag(false)
     4390#if H_MV_HLS10_PTL
     4391  , m_max12bitConstraintFlag      ( false )
     4392  , m_max10bitConstraintFlag      ( false )
     4393  , m_max8bitConstraintFlag       ( false )
     4394  , m_max422chromaConstraintFlag  ( false )
     4395  , m_max420chromaConstraintFlag  ( false )
     4396  , m_maxMonochromeConstraintFlag ( false )
     4397  , m_intraConstraintFlag         ( false )
     4398  , m_onePictureOnlyConstraintFlag( false )
     4399  , m_lowerBitRateConstraintFlag  ( false )
     4400  , m_inbldFlag                   ( false )
     4401#endif
    42354402{
    42364403  ::memset(m_profileCompatibilityFlag, 0, sizeof(m_profileCompatibilityFlag));
     
    42954462
    42964463  m_vpsVuiBspHrdPresentFlag = false;
     4464#if H_MV_HLS10_VPS_VUI_BSP
     4465  m_vpsVuiBspHrdParameters  = NULL;
     4466#else
    42974467  m_vpsVuiBspHrdParameters  = new TComVpsVuiBspHrdParameters();
     4468#endif
    42984469}
    42994470
     
    43384509    assert( getBitDepthVpsLumaMinus8          () == prevRepFormat->getBitDepthVpsLumaMinus8          () );
    43394510    assert( getBitDepthVpsChromaMinus8        () == prevRepFormat->getBitDepthVpsChromaMinus8        () );
    4340 }
    4341 }
    4342 
     4511  }
     4512}
     4513
     4514#if !H_MV_HLS10_VPS_VUI_BSP
    43434515Void TComVpsVuiBspHrdParameters::checkLayerInBspFlag( TComVPS* vps, Int h )
    43444516{
     
    44194591  //  assert(  getBspCombSchedIdx(h, i, j ) <= vps->getHrdParameters( getBspCombHrdIdx( h, i, j ) )->getCpbCntMinus1( highestTid ) );
    44204592}
     4593#endif
     4594
     4595#if H_MV_HLS10_VPS_VUI_BSP
     4596
     4597TComVpsVuiBspHrdParameters::~TComVpsVuiBspHrdParameters()
     4598{
     4599  delete[] m_cprmsAddPresentFlag;
     4600  delete[] m_numSubLayerHrdMinus1;
     4601  delete[] m_hrdParameters;
     4602
     4603  for (Int h = 0; h < m_numOls; h++)
     4604  {
     4605    if ( h > 0 )
     4606    {   
     4607      for (Int i = 0; i < getNumSignalledPartitioningSchemes(h)+1; i++)
     4608      {
     4609        for (Int t = 0; t < m_vps->getMaxSubLayersInLayerSetMinus1( m_vps->olsIdxToLsIdx(h) ) + 1; t++)
     4610        {       
     4611          for ( Int j = 0; j <= getNumBspSchedulesMinus1(h,i,j);j++ )
     4612          {
     4613            delete[] m_bspHrdIdx  [h][i][t][j];
     4614            delete[] m_bspSchedIdx[h][i][t][j];
     4615          }
     4616        }
     4617        delete[] m_numBspSchedulesMinus1[h][i];
     4618      }
     4619    }
     4620
     4621    for (Int j = 0; j <= getNumSignalledPartitioningSchemes(h ) + 1; j++ )
     4622    {
     4623      for (Int k = 0; k <= getNumPartitionsInSchemeMinus1(h,j); k++ )
     4624      {
     4625        delete[] m_layerIncludedInPartitionFlag[h][j][k];
     4626      }       
     4627    }
     4628    delete[] m_numPartitionsInSchemeMinus1[h];       
     4629  }
     4630  delete[] m_numSignalledPartitioningSchemes;
     4631}
     4632
     4633
     4634Int TComVpsVuiBspHrdParameters::getBspHrdIdxLen(TComVPS* vps)
     4635{
     4636  return gCeilLog2( vps->getNumHrdParameters() + getVpsNumAddHrdParams() );
     4637}
     4638
     4639Void TComVpsVuiBspHrdParameters::createAfterVpsNumAddHrdParams( TComVPS* vps )
     4640{
     4641  assert( vps == NULL );
     4642  m_vps = vps;
     4643  m_offsetHrdParamIdx = vps->getNumHrdParameters();
     4644  m_numHrdParam       = vps->getNumHrdParameters() + getVpsNumAddHrdParams() - m_offsetHrdParamIdx;
     4645  m_numOls            = vps->getNumOutputLayerSets();
     4646
     4647  m_cprmsAddPresentFlag   = new Bool    [ m_numHrdParam ];
     4648  m_numSubLayerHrdMinus1  = new Int     [ m_numHrdParam ];
     4649  m_hrdParameters         = new TComHRD [ m_numHrdParam ];
     4650
     4651  m_numSignalledPartitioningSchemes = new Int    [ m_numOls ];
     4652  m_numPartitionsInSchemeMinus1     = new Int*   [ m_numOls ];
     4653  m_numBspSchedulesMinus1           = new Int**  [ m_numOls ];
     4654  m_bspHrdIdx                       = new Int****[ m_numOls ];
     4655  m_bspSchedIdx                     = new Int****[ m_numOls ];
     4656}
     4657
     4658Void TComVpsVuiBspHrdParameters::createAfterNumSignalledPartitioningSchemes( Int h )
     4659{
     4660  m_numPartitionsInSchemeMinus1 [h]    = new Int    [ getNumSignalledPartitioningSchemes(h) ];
     4661  m_layerIncludedInPartitionFlag[h]    = new Bool** [ getNumSignalledPartitioningSchemes(h) ];   
     4662
     4663  m_numBspSchedulesMinus1[h]           = new Int*   [ getNumSignalledPartitioningSchemes(h) + 1 ];
     4664  for (Int i = 0; i < getNumSignalledPartitioningSchemes(h) + 1; i++)
     4665  {
     4666    Int tMax = m_vps->getMaxSubLayersInLayerSetMinus1( m_vps->olsIdxToLsIdx(h) ) + 1;
     4667    m_numBspSchedulesMinus1[h][i] = new Int  [ tMax ];
     4668    m_bspHrdIdx            [h][i] = new Int**[ tMax ];
     4669    m_bspSchedIdx          [h][i] = new Int**[ tMax ];
     4670  }
     4671}
     4672
     4673Void TComVpsVuiBspHrdParameters::createAfterNumPartitionsInSchemeMinus1( Int h, Int j )
     4674{
     4675  m_layerIncludedInPartitionFlag[h][j] = new Bool*[ getNumPartitionsInSchemeMinus1(h,j)];
     4676  for( Int k = 0; k < getNumPartitionsInSchemeMinus1(h,j); k++ )
     4677  {
     4678    m_layerIncludedInPartitionFlag[h][j][k] = new Bool[ m_vps->getNumLayersInIdList( m_vps->olsIdxToLsIdx(h))];
     4679  }
     4680}
     4681
     4682Void TComVpsVuiBspHrdParameters::createAfterNumBspSchedulesMinus1( Int h, Int i, Int t )
     4683{
     4684  m_bspSchedIdx[h][i][t] = new Int* [ getNumBspSchedulesMinus1( h, i, t ) + 1 ];
     4685  m_bspHrdIdx  [h][i][t] = new Int* [ getNumBspSchedulesMinus1( h, i, t ) + 1 ];
     4686  for( Int j = 0; j < getNumBspSchedulesMinus1( h, i, t ) + 1; j++ )
     4687  {
     4688    m_bspSchedIdx[h][i][t][j] = new Int[ getNumPartitionsInSchemeMinus1( h, i ) ];
     4689    m_bspHrdIdx  [h][i][t][j] = new Int[ getNumPartitionsInSchemeMinus1( h, i ) ];
     4690  }
     4691}
     4692
     4693#endif
    44214694
    44224695Void TComVUI::inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr )
     
    44544727      for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++ )
    44554728      {
     4729#if H_MV_HLS10_ADD_LAYERSETS
     4730        m_maxVpsDecPicBufferingMinus1[i][k][j] = MIN_INT;
     4731#else
    44564732        m_maxVpsDecPicBufferingMinus1[i][k][j] = 0;
     4733#endif
    44574734      }
    44584735    }
  • branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.h

    r1049 r1054  
    1 /* The copyright in this software is being made available under the BSD
     1/* The copyright in this software is being made available under the BSD
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
     
    4545#include "TComRom.h"
    4646#include "TComList.h"
    47 
     47#if H_MV_HLS10_GEN_FIX
     48#if H_MV
     49#include <ios>
     50#include <iostream>
     51#include <iomanip>
     52#endif
     53#endif
    4854//! \ingroup TLibCommon
    4955//! \{
     
    201207  Bool m_frameOnlyConstraintFlag;
    202208 
     209#if H_MV_HLS10_PTL
     210  Bool m_max12bitConstraintFlag;
     211  Bool m_max10bitConstraintFlag;
     212  Bool m_max8bitConstraintFlag;
     213  Bool m_max422chromaConstraintFlag;
     214  Bool m_max420chromaConstraintFlag;
     215  Bool m_maxMonochromeConstraintFlag;
     216  Bool m_intraConstraintFlag;
     217  Bool m_onePictureOnlyConstraintFlag;
     218  Bool m_lowerBitRateConstraintFlag;
     219  Bool m_inbldFlag;
     220#endif
    203221public:
    204222  ProfileTierLevel();
     
    230248  Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; }
    231249  Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; }
     250
     251#if H_MV_HLS10_PTL
     252  Void setMax12bitConstraintFlag( Bool flag ) { m_max12bitConstraintFlag = flag; }
     253  Bool getMax12bitConstraintFlag(  ) { return m_max12bitConstraintFlag; }
     254 
     255  Void setMax10bitConstraintFlag( Bool flag ) { m_max10bitConstraintFlag = flag; }
     256  Bool getMax10bitConstraintFlag(  ) { return m_max10bitConstraintFlag; }
     257 
     258  Void setMax8bitConstraintFlag( Bool flag ) { m_max8bitConstraintFlag = flag; }
     259  Bool getMax8bitConstraintFlag(  ) { return m_max8bitConstraintFlag; }
     260 
     261  Void setMax422chromaConstraintFlag( Bool flag ) { m_max422chromaConstraintFlag = flag; }
     262  Bool getMax422chromaConstraintFlag(  ) { return m_max422chromaConstraintFlag; }
     263 
     264  Void setMax420chromaConstraintFlag( Bool flag ) { m_max420chromaConstraintFlag = flag; }
     265  Bool getMax420chromaConstraintFlag(  ) { return m_max420chromaConstraintFlag; }
     266 
     267  Void setMaxMonochromeConstraintFlag( Bool flag ) { m_maxMonochromeConstraintFlag = flag; }
     268  Bool getMaxMonochromeConstraintFlag(  ) { return m_maxMonochromeConstraintFlag; }
     269  Void setIntraConstraintFlag( Bool flag ) { m_intraConstraintFlag = flag; }
     270  Bool getIntraConstraintFlag(  ) { return m_intraConstraintFlag; }
     271 
     272  Void setOnePictureOnlyConstraintFlag( Bool flag ) { m_onePictureOnlyConstraintFlag = flag; }
     273  Bool getOnePictureOnlyConstraintFlag(  ) { return m_onePictureOnlyConstraintFlag; }
     274 
     275  Void setLowerBitRateConstraintFlag( Bool flag ) { m_lowerBitRateConstraintFlag = flag; }
     276  Bool getLowerBitRateConstraintFlag(  ) { return m_lowerBitRateConstraintFlag; }
     277 
     278  Void setInbldFlag( Bool flag ) { m_inbldFlag = flag; }
     279  Bool getInbldFlag(  ) { return m_inbldFlag; }
     280#endif
     281
    232282};
    233283
     
    359409  Void setCpbCntMinus1           ( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value; }
    360410  UInt getCpbCntMinus1           ( Int layer            )  { return m_HRD[layer].cpbCntMinus1; }
    361 
     411 
    362412  Void setBitRateValueMinus1     ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; }
    363413  UInt getBitRateValueMinus1     ( Int layer, Int cpbcnt, Int nalOrVcl             ) { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl];  }
     
    434484  Int  getMatrixCoeffsVps(  ) { return m_matrixCoeffsVps; }
    435485};
     486
    436487class TComVpsVuiBspHrdParameters
    437488{
     489#if H_MV_HLS10_VPS_VUI_BSP
     490
     491  /* Not yet tested */
     492private:
     493
     494  Int   m_vpsNumAddHrdParams;
     495  Bool* m_cprmsAddPresentFlag;
     496  TComHRD* m_hrdParameters;
     497  Int*  m_numSubLayerHrdMinus1;
     498  Int*  m_numSignalledPartitioningSchemes;
     499  Int** m_numPartitionsInSchemeMinus1;
     500
     501  Bool****  m_layerIncludedInPartitionFlag;
     502  Int***    m_numBspSchedulesMinus1;
     503  Int*****  m_bspHrdIdx;
     504  Int*****  m_bspSchedIdx;
     505   
     506  // Array sizes
     507  Int      m_offsetHrdParamIdx;
     508  Int      m_numHrdParam;
     509  Int      m_numOls;
     510  TComVPS* m_vps;
     511public:   
     512
     513  ~TComVpsVuiBspHrdParameters();
     514 
     515  Void createAfterVpsNumAddHrdParams( TComVPS* vps );
     516  Void createAfterNumSignalledPartitioningSchemes(Int h );
     517  Void createAfterNumPartitionsInSchemeMinus1(Int h, Int j);
     518  Void createAfterNumBspSchedulesMinus1( Int h, Int i, Int t);
     519
     520  Void setVpsNumAddHrdParams( Int  val ) { m_vpsNumAddHrdParams = val; }
     521  Int  getVpsNumAddHrdParams(  ) { return m_vpsNumAddHrdParams; }
     522 
     523  Void setCprmsAddPresentFlag( Int i, Bool flag ) { m_cprmsAddPresentFlag[i - m_offsetHrdParamIdx] = flag; }
     524  Bool getCprmsAddPresentFlag( Int i ) { return m_cprmsAddPresentFlag[i  - m_offsetHrdParamIdx]; }
     525 
     526  Void setNumSubLayerHrdMinus1( Int i, Int  val ) { m_numSubLayerHrdMinus1[i  - m_offsetHrdParamIdx] = val; }
     527  Int  getNumSubLayerHrdMinus1( Int i ) { return m_numSubLayerHrdMinus1[i  - m_offsetHrdParamIdx]; }
     528 
     529  Void setNumSignalledPartitioningSchemes( Int h, Int  val ) { m_numSignalledPartitioningSchemes[h] = val; }
     530  Int  getNumSignalledPartitioningSchemes( Int h ) { return m_numSignalledPartitioningSchemes[h]; }
     531 
     532  Void setNumPartitionsInSchemeMinus1( Int h, Int j, Int  val ) { m_numPartitionsInSchemeMinus1[h][j] = val; }
     533  Int  getNumPartitionsInSchemeMinus1( Int h, Int j ) { return m_numPartitionsInSchemeMinus1[h][j]; }
     534 
     535  Void setLayerIncludedInPartitionFlag( Int h, Int j, Int k, Int r, Bool flag ) { m_layerIncludedInPartitionFlag[h][j][k][r] = flag; }
     536  Bool getLayerIncludedInPartitionFlag( Int h, Int j, Int k, Int r ) { return m_layerIncludedInPartitionFlag[h][j][k][r]; }
     537 
     538  Void setNumBspSchedulesMinus1( Int h, Int i, Int t, Int  val ) { m_numBspSchedulesMinus1[h][i][t] = val; }
     539  Int  getNumBspSchedulesMinus1( Int h, Int i, Int t ) { return m_numBspSchedulesMinus1[h][i][t]; }
     540 
     541  Void setBspHrdIdx( Int h, Int i, Int t, Int j, Int k, Int  val ) { m_bspHrdIdx[h][i  - m_offsetHrdParamIdx][t][j][k] = val; }
     542  Int  getBspHrdIdx( Int h, Int i, Int t, Int j, Int k ) { return m_bspHrdIdx[h][i  - m_offsetHrdParamIdx][t][j][k]; }
     543 
     544  Int  getBspHrdIdxLen( TComVPS* vps );
     545
     546  Void setBspSchedIdx( Int h, Int i, Int t, Int j, Int k, Int  val ) { m_bspSchedIdx[h][i - m_offsetHrdParamIdx][t][j][k] = val; }
     547  Int  getBspSchedIdx( Int h, Int i, Int t, Int j, Int k ) { return m_bspSchedIdx[h][i - m_offsetHrdParamIdx][t][j][k]; }
     548
     549  Void setHrdParametermeters( Int k, TComHRD* val  ) {  *(m_hrdParameters + k ) = *val; };
     550  TComHRD* getHrdParametermeters( Int k ) {  return m_hrdParameters + k; };
     551#else
    438552private:
    439553  Int  m_vpsNumBspHrdParametersMinus1;
     
    475589  Void setHrdParametermeters( Int k, TComHRD* val  ) {  m_hrdParameters[k] = val; };
    476590  TComHRD* getHrdParametermeters( Int k ) {  return m_hrdParameters[k]; };
     591#endif;
    477592};
    478593
     
    501616  Bool m_wppNotInUseFlag;
    502617  Bool m_wppInUseFlag                [MAX_NUM_LAYERS];
     618#if H_MV_HLS10_VPS_VUI
     619  Bool m_singleLayerForNonIrapFlag;
     620  Bool m_higherLayerIrapSkipFlag;
     621#endif
    503622  Bool m_ilpRestrictedRefLayersFlag;
    504623  Int  m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS][MAX_NUM_LAYERS];
     
    574693  Void setWppInUseFlag( Int i, Bool flag ) { m_wppInUseFlag[i] = flag; }
    575694  Bool getWppInUseFlag( Int i ) { return m_wppInUseFlag[i]; }
     695
     696#if H_MV_HLS10_VPS_VUI
     697  Void setSingleLayerForNonIrapFlag( Bool flag ) { m_singleLayerForNonIrapFlag = flag; }
     698  Bool getSingleLayerForNonIrapFlag(  ) { return m_singleLayerForNonIrapFlag; }
     699
     700  Void setHigherLayerIrapSkipFlag( Bool flag ) { m_higherLayerIrapSkipFlag = flag; }
     701  Bool getHigherLayerIrapSkipFlag(  ) { return m_higherLayerIrapSkipFlag; }
     702#endif
    576703
    577704  Void setIlpRestrictedRefLayersFlag( Bool flag ) { m_ilpRestrictedRefLayersFlag = flag; }
     
    609736  Int  m_bitDepthVpsLumaMinus8;
    610737  Int  m_bitDepthVpsChromaMinus8;
     738#if H_MV_HLS10_GEN_VSP_CONF_WIN
     739  Bool m_conformanceWindowVpsFlag;
     740  Int  m_confWinVpsLeftOffset;
     741  Int  m_confWinVpsRightOffset;
     742  Int  m_confWinVpsTopOffset;
     743  Int  m_confWinVpsBottomOffset;
     744#endif
    611745
    612746public:
     747
     748#if H_MV_HLS10_GEN_VSP_CONF_WIN
     749  TComRepFormat()
     750  {
     751  m_conformanceWindowVpsFlag = 0;
     752  m_confWinVpsLeftOffset     = 0;
     753  m_confWinVpsRightOffset    = 0;
     754  m_confWinVpsTopOffset      = 0;
     755  m_confWinVpsBottomOffset   = 0;
     756  }; 
     757#else
    613758  TComRepFormat() { }; 
     759#endif
    614760
    615761  Void setChromaAndBitDepthVpsPresentFlag( Bool flag ) { m_chromaAndBitDepthVpsPresentFlag = flag; }
     
    635781  Void setBitDepthVpsChromaMinus8( Int  val ) { m_bitDepthVpsChromaMinus8 = val; }
    636782  Int  getBitDepthVpsChromaMinus8(  ) { return m_bitDepthVpsChromaMinus8; }
     783
     784#if H_MV_HLS10_GEN_VSP_CONF_WIN
     785  Void setConformanceWindowVpsFlag( Bool flag ) { m_conformanceWindowVpsFlag = flag; }
     786  Bool getConformanceWindowVpsFlag(  ) { return m_conformanceWindowVpsFlag; }
     787
     788  Void setConfWinVpsLeftOffset( Int  val ) { m_confWinVpsLeftOffset = val; }
     789  Int  getConfWinVpsLeftOffset(  ) { return m_confWinVpsLeftOffset; }
     790
     791  Void setConfWinVpsRightOffset( Int  val ) { m_confWinVpsRightOffset = val; }
     792  Int  getConfWinVpsRightOffset(  ) { return m_confWinVpsRightOffset; }
     793
     794  Void setConfWinVpsTopOffset( Int  val ) { m_confWinVpsTopOffset = val; }
     795  Int  getConfWinVpsTopOffset(  ) { return m_confWinVpsTopOffset; }
     796
     797  Void setConfWinVpsBottomOffset( Int  val ) { m_confWinVpsBottomOffset = val; }
     798  Int  getConfWinVpsBottomOffset(  ) { return m_confWinVpsBottomOffset; }
     799#endif
    637800};
    638801
     
    657820
    658821  Void setMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j, Int  val ) { m_maxVpsDecPicBufferingMinus1[i][k][j] = val; }
     822  #if H_MV_HLS10_ADD_LAYERSETS
     823  Int  getMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j ) { assert( m_maxVpsDecPicBufferingMinus1[i][k][j] >= 0 ); return m_maxVpsDecPicBufferingMinus1[i][k][j]; }     
     824  #else
    659825  Int  getMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j ) { return m_maxVpsDecPicBufferingMinus1[i][k][j]; }
     826  #endif
    660827
    661828  Void setMaxVpsNumReorderPics( Int i, Int j, Int  val ) { m_maxVpsNumReorderPics[i][j] = val; }
     
    672839#if H_MV
    673840  Bool        m_vpsBaseLayerInternalFlag;
     841#if H_MV_HLS10_GEN_VSP_BASE_LAYER_AVAIL
     842  Bool        m_vpsBaseLayerAvailableFlag;
     843#endif // H_MV_HLS10_GEN
    674844#endif
    675845
     
    741911  Int         m_layerSetIdxForOlsMinus1  [MAX_VPS_OUTPUTLAYER_SETS]; 
    742912  Bool        m_outputLayerFlag          [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1];
     913#if H_MV_HLS10_PTL
     914  Int         m_profileTierLevelIdx      [MAX_VPS_OUTPUTLAYER_SETS ][MAX_NUM_LAYERS];
     915#else 
    743916  Int         m_profileLevelTierIdx      [MAX_VPS_OUTPUTLAYER_SETS ];
     917#endif
    744918  Bool        m_altOutputLayerFlag       [MAX_VPS_OUTPUTLAYER_SETS];
    745919  Bool        m_repFormatIdxPresentFlag;
     
    770944  // VPS EXTENSION SEMANTICS VARIABLES
    771945  Int         m_layerIdInVps             [MAX_NUM_LAYERS   ];
     946#if H_MV_HLS10_REF_PRED_LAYERS
     947  Int         m_dependencyFlag           [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
     948#endif
    772949
    773950  Int         m_numDirectRefLayers       [MAX_NUM_LAYERS];
     951#if H_MV_HLS10_REF_PRED_LAYERS
     952  Int         m_idDirectRefLayer         [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 
     953#else
    774954  Int         m_refLayerId               [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 
     955#endif
    775956
    776957  Int         m_numRefLayers             [MAX_NUM_LAYER_IDS];
    777   Int         m_numPredictedLayers       [MAX_NUM_LAYERS];
     958#if H_MV_HLS10_REF_PRED_LAYERS
     959  Int         m_idRefLayer               [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 
     960#endif
     961
     962
     963  Int         m_numPredictedLayers       [MAX_NUM_LAYERS ];
     964#if !H_MV_HLS10_REF_PRED_LAYERS
    778965  Int         m_predictedLayerId         [MAX_NUM_LAYERS][MAX_NUM_LAYER_IDS];
     966#else
     967  Int         m_idPredictedLayer         [MAX_NUM_LAYERS][MAX_NUM_LAYER_IDS];
     968#endif
    779969  Int         m_numIndependentLayers;
    780970  Int         m_numLayersInTreePartition [MAX_NUM_LAYER_IDS];
    781971  Int         m_treePartitionLayerIdList [MAX_NUM_LAYERS][MAX_NUM_LAYER_IDS];
     972#if H_MV_HLS10_REF_PRED_LAYERS
    782973  Bool        m_recursiveRefLayerFlag    [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];
    783 
     974  #endif
    784975  Int         m_viewIndex                [MAX_NUM_LAYERS   ];
    785976 
     
    788979  std::vector< std::vector< Int> >       m_layerSetLayerIdList;
    789980
     981#if H_MV_HLS10_NESSECARY_LAYER
     982  Int        m_numNecessaryLayers        [MAX_VPS_OUTPUTLAYER_SETS];
     983  Bool       m_necessaryLayerFlag        [MAX_VPS_OUTPUTLAYER_SETS][MAX_NUM_LAYERS];
     984#endif
    790985
    791986  Int         xGetDimBitOffset( Int j );
     987#if H_MV_HLS10_REF_PRED_LAYERS
    792988  Void        xSetRefLayerFlags( Int currLayerId );
     989#endif
    793990  // VPS EXTENSION 2 SYNTAX ELEMENTS
    794991#if H_3D_ARP
     
    8701067  Void    setVpsBaseLayerInternalFlag( Bool flag ) { m_vpsBaseLayerInternalFlag = flag; }
    8711068  Bool    getVpsBaseLayerInternalFlag(  )          { return m_vpsBaseLayerInternalFlag; }
     1069#if H_MV_HLS10_GEN_VSP_BASE_LAYER_AVAIL
     1070  Void    setVpsBaseLayerAvailableFlag( Bool flag ) { m_vpsBaseLayerAvailableFlag = flag; }
     1071  Bool    getVpsBaseLayerAvailableFlag(  )          { return m_vpsBaseLayerAvailableFlag; }
     1072#endif
    8721073#endif
    8731074
     
    8771078#if H_MV   
    8781079  UInt    getMaxSubLayersMinus1()             { return m_uiMaxTLayers - 1;  }  // For consistency with draft spec
     1080#if H_MV_HLS10_GEN_FIX
     1081  Void    setMaxSubLayersMinus1(UInt val)     { m_uiMaxTLayers = (val + 1); };
     1082#endif
    8791083  UInt    getMaxLayersMinus1()                { return m_uiMaxLayersMinus1;  };
    8801084  Void    setMaxLayersMinus1(UInt l)          { m_uiMaxLayersMinus1 = l; }
     
    9161120
    9171121#if H_MV
     1122#if H_MV_HLS10_PTL
     1123  TComPTL* getPTL( Int idx = 0 ) { return &m_pcPTL[idx]; }
     1124#else
    9181125  TComPTL* getPTL( Int layerSet = 0 ) { return &m_pcPTL[layerSet]; }
     1126#endif
    9191127#else
    9201128  TComPTL* getPTL() { return &m_pcPTL; }
     
    10021210  Bool    inferOutputLayerFlag( Int i, Int j );
    10031211
     1212#if H_MV_HLS10_PTL
     1213  Void    setProfileTierLevelIdx( Int i, Int j, Int val )                  { m_profileTierLevelIdx[ i ][ j ] = val; }
     1214  Int     getProfileTierLevelIdx( Int i, Int j )                           { return m_profileTierLevelIdx[ i ][ j ]; }
     1215#else
    10041216  Void    setProfileLevelTierIdx( Int outLayerSetIdx, Int val )            { m_profileLevelTierIdx[ outLayerSetIdx ] = val; }
    10051217  Int     getProfileLevelTierIdx( Int outLayerSetIdx )                     { return m_profileLevelTierIdx[ outLayerSetIdx ]; }
     1218#endif
    10061219 
    10071220  Void    setAltOutputLayerFlag( Int i, Bool flag )                        { m_altOutputLayerFlag[i] = flag; }
     
    10331246  TComDpbSize* getDpbSize( )                                               { return m_dpbSize;}
    10341247 
     1248#if !H_MV_HLS10_ADD_LAYERSETS 
    10351249  Void    inferDbpSizeLayerSetZero( TComSPS* sps, Bool encoder );
    1036  
     1250#endif
     1251
    10371252  Void    setPocLsbNotPresentFlag( Int i, Bool flag )                      { m_pocLsbNotPresentFlag[i] = flag; }
    10381253  Bool    getPocLsbNotPresentFlag( Int i )                                 { return m_pocLsbNotPresentFlag[i]; }
     
    10661281  Int     getNumViews();
    10671282
     1283#if H_MV_HLS10_REF_PRED_LAYERS
     1284  Bool    getDependencyFlag( Int i, Int j )                                { return m_dependencyFlag[i][j]; }
     1285#endif
    10681286  Int     getNumDirectRefLayers( Int layerIdInNuh )                        { return m_numDirectRefLayers[ layerIdInNuh ];  };                               
     1287#if !H_MV_HLS10_REF_PRED_LAYERS
    10691288  Int     getRefLayerId        ( Int layerIdInNuh, Int idx );;
    1070 
     1289#endif
    10711290  Int     getNumRefLayers            ( Int i )        { return m_numRefLayers[i]; }
    10721291  Int     getNumPredictedLayers      ( Int i )        { return m_numPredictedLayers[i]; }
     1292
     1293#if !H_MV_HLS10_REF_PRED_LAYERS 
    10731294  Int     getPredictedLayerId        ( Int i, Int j ) { return m_predictedLayerId[i][j]; }
     1295#else
     1296  Int     getIdRefLayer              ( Int i, Int j ) { assert( j >= 0 && j < getNumRefLayers      ( i )); return m_idRefLayer      [i][j]; }
     1297  Int     getIdPredictedLayer        ( Int i, Int j ) { assert( j >= 0 && j < getNumPredictedLayers( i )); return m_idPredictedLayer[i][j]; }
     1298  Int     getIdDirectRefLayer        ( Int i, Int j ) { assert( j >= 0 && j < getNumDirectRefLayers( i )); return m_idDirectRefLayer[i][j]; }
     1299#endif
    10741300  Int     getNumIndependentLayers    (  )             { return m_numIndependentLayers; }
    10751301  Int     getNumLayersInTreePartition( Int i )        { return m_numLayersInTreePartition[i]; }
     
    10781304  Int     getNumLayerSets( )                                               { return getVpsNumLayerSetsMinus1() + 1 + getNumAddLayerSets();  }; 
    10791305 
     1306#if H_MV_HLS10_ADD_LAYERSETS
     1307  Int     getFirstAddLayerSetIdx()                    { return getVpsNumLayerSetsMinus1() + 1; }
     1308  Int     getLastAddLayerSetIdx()                     { return getFirstAddLayerSetIdx() + getNumAddLayerSets() - 1; }
     1309#endif
    10801310  Bool    checkVPSExtensionSyntax();
    10811311  Int     scalTypeToScalIdx   ( ScalabilityType scalType );
    10821312
     1313#if H_MV_HLS10_PTL
     1314  Int     getProfileTierLevelIdxLen()                                      { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); };       
     1315#else
    10831316  Int     getProfileLevelTierIdxLen()                                      { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); };       
     1317#endif
    10841318  Int     getVpsRepFormatIdxLen()                                          { return gCeilLog2( getVpsNumRepFormatsMinus1() + 1 ); };       
    10851319
     
    10921326  Void    deriveLayerSetLayerIdList();
    10931327
     1328#if H_MV_HLS10_ADD_LAYERSETS
     1329  Int     olsIdxToLsIdx( Int i )                                           { return ( i < getNumLayerSets() ) ? i  : getLayerSetIdxForOlsMinus1( i ) + 1 ; };
     1330#else
    10941331  Int     olsIdxToLsIdx( Int i )                                           { return ( i <= getVpsNumLayerSetsMinus1() ) ? i  : getLayerSetIdxForOlsMinus1( i ) + 1 ; };
    1095 
     1332#endif
    10961333  Void    initTargetLayerIdLists  ( );
    10971334  Void    deriveTargetLayerIdList ( Int i );
    1098 
    10991335  std::vector<Int> getTargetDecLayerIdList( Int targetDecLayerSetIdx )     { return m_targetDecLayerIdLists[targetDecLayerSetIdx]; };
    11001336  std::vector<Int> getTargetOptLayerIdList( Int targetOptLayerSetIdx )     { return m_targetOptLayerIdLists[targetOptLayerSetIdx]; };
     
    11021338  Int     getNumOutputLayersInOutputLayerSet( Int i )                      { return (Int) getTargetOptLayerIdList( i ).size(); };
    11031339  Int     getOlsHighestOutputLayerId( Int i )                              { return getTargetOptLayerIdList( i ).back(); }; 
     1340
     1341#if H_MV_HLS10_ADD_LAYERSETS
     1342  Void    deriveAddLayerSetLayerIdList( Int i )
     1343  { 
     1344    assert( m_layerSetLayerIdList.size() ==  ( getVpsNumLayerSetsMinus1() + 1 + i ) );
     1345    std::vector<Int> layerSetLayerIdList;
     1346   
     1347    for( Int treeIdx = 1; treeIdx < getNumIndependentLayers(); treeIdx++ )
     1348    {
     1349      // The value of highest_layer_idx_plus1[ i ][ j ] shall be in the range of 0 to NumLayersInTreePartition[ j ], inclusive.
     1350      assert( getHighestLayerIdxPlus1( i, treeIdx ) >= 0 && getHighestLayerIdxPlus1( i, treeIdx ) <= getNumLayersInTreePartition( treeIdx ) );
     1351
     1352      for( Int layerCnt = 0; layerCnt < getHighestLayerIdxPlus1( i, treeIdx ); layerCnt++ )
     1353      {
     1354        layerSetLayerIdList.push_back( getTreePartitionLayerIdList( treeIdx, layerCnt ) );
     1355      }
     1356    }
     1357    m_layerSetLayerIdList.push_back( layerSetLayerIdList );
     1358
     1359    //It is a requirement of bitstream conformance that
     1360    //NumLayersInIdList[ vps_num_layer_sets_minus1 + 1 + i ] shall be greater than 0.
     1361    assert( getNumLayersInIdList( getVpsNumLayerSetsMinus1() + 1 + i ) > 0 );
     1362
     1363  }
     1364#endif
     1365#if H_MV_HLS10_NESSECARY_LAYER
     1366  Void    deriveNecessaryLayerFlags( Int olsIdx )
     1367  {
     1368    AOF( olsIdx >= 0 && olsIdx < getNumOutputLayerSets() );
     1369    Int lsIdx = olsIdxToLsIdx( olsIdx );
     1370    for( Int lsLayerIdx = 0; lsLayerIdx < getNumLayersInIdList( lsIdx) ; lsLayerIdx++ )
     1371    {
     1372      m_necessaryLayerFlag[ olsIdx ][ lsLayerIdx ] = 0;
     1373    }
     1374    for( Int lsLayerIdx = 0; lsLayerIdx < getNumLayersInIdList( lsIdx ); lsLayerIdx++ )
     1375    {
     1376      if( getOutputLayerFlag( olsIdx, lsLayerIdx  ))
     1377      {
     1378        m_necessaryLayerFlag[ olsIdx ][ lsLayerIdx ] = 1;
     1379        Int currLayerId = getLayerSetLayerIdList( lsIdx, lsLayerIdx );
     1380        for( Int rLsLayerIdx = 0; rLsLayerIdx < lsLayerIdx; rLsLayerIdx++ )
     1381        {
     1382          Int refLayerId = getLayerSetLayerIdList( lsIdx, rLsLayerIdx );
     1383          if( getDependencyFlag( getLayerIdInVps( currLayerId ), getLayerIdInVps( refLayerId ) ) )
     1384          {
     1385            m_necessaryLayerFlag[ olsIdx ][ rLsLayerIdx ] = 1;
     1386          }
     1387        }
     1388      }
     1389    }
     1390    m_numNecessaryLayers[ olsIdx ] = 0;
     1391    for( Int lsLayerIdx = 0; lsLayerIdx < getNumLayersInIdList( lsIdx ); lsLayerIdx++ )
     1392    {
     1393      m_numNecessaryLayers[ olsIdx ]  +=  m_necessaryLayerFlag[ olsIdx ][ lsLayerIdx ];
     1394    }
     1395  };
     1396
     1397  Int     getNecessaryLayerFlag( Int i, Int j )                                         { AOF( i >= 0 && i < getNumOutputLayerSets() ); AOF( j >= 0 && j < getNumLayersInIdList( olsIdxToLsIdx( i ) )  );  return m_necessaryLayerFlag[i][j]; };
     1398 
     1399#endif
     1400
    11041401
    11051402  Int     getMaxSubLayersInLayerSetMinus1( Int i );
     
    11131410
    11141411  // helpers
     1412
    11151413  Bool    getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 );
     1414#if !H_MV_HLS10_MAXNUMPICS
    11161415  Int     getMaxNumPics( Int layerId );
     1416#endif
     1417#if H_MV_HLS10_ADD_LAYERSETS
     1418
     1419  Void    printPTL()
     1420  {
     1421    std::vector<Int> idx;
     1422    std::vector<Int> num;
     1423    std::vector<std::vector<Int>> ptlInfo;
     1424
     1425    std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "PTLI" << std::endl;
     1426
     1427    for ( Int i = 0; i <= getVpsNumProfileTierLevelMinus1(); i++ )
     1428    {
     1429      std::vector<Int> curPtlInfo;
     1430      ProfileTierLevel* ptl = getPTL( i )->getGeneralPTL();
     1431      curPtlInfo.push_back( (Int) ptl->getProfileIdc()  );
     1432      curPtlInfo.push_back( (Int) ptl->getTierFlag()    );
     1433      curPtlInfo.push_back( (Int) ptl->getLevelIdc()    );
     1434      curPtlInfo.push_back( (Int) ptl->getInbldFlag()   );
     1435     
     1436      idx.push_back ( i );
     1437      num.push_back ( 4 );
     1438      ptlInfo.push_back( curPtlInfo );
     1439    }
     1440   
     1441    xPrintArray( "VpsProfileTierLevel", getVpsNumProfileTierLevelMinus1() + 1, idx, num, ptlInfo, false  );
     1442
     1443    num.clear();
     1444    idx.clear();
     1445    for (Int i = 0; i < getNumOutputLayerSets(); i++)
     1446    {
     1447      num.push_back ( getNumLayersInIdList( olsIdxToLsIdx( i ))  );
     1448      idx.push_back( i );
     1449    }
     1450   
     1451   xPrintArray( "profile_tier_level_idx", getNumOutputLayerSets(), idx, num, m_profileTierLevelIdx, true );
     1452   std::cout << std::endl;
     1453  }
     1454
     1455  Void    printLayerDependencies()
     1456  {
     1457    vector<Int> fullArray;
     1458    vector<Int> range;
     1459    for (Int i = 0; i <= getMaxLayersMinus1(); i++ )
     1460    {
     1461      fullArray.push_back( getMaxLayersMinus1() + 1 );
     1462      range.push_back( i );
     1463    }
     1464    std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "Layer Dependencies" << std::endl;
     1465    xPrintArray( "direct_dependency_flag", getMaxLayersMinus1()+1, range, fullArray, m_directDependencyFlag, false );
     1466    xPrintArray( "DependencyFlag", getMaxLayersMinus1()+1, range, fullArray, m_dependencyFlag, false );
     1467    xPrintArray( "layer_id_in_nuh", getMaxLayersMinus1()+1, m_layerIdInNuh, true  );     
     1468    xPrintArray( "IdPredictedLayer", getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numPredictedLayers, m_idPredictedLayer, true );
     1469    xPrintArray( "IdRefLayer"      , getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numRefLayers, m_idRefLayer, true );
     1470    xPrintArray( "IdDirectRefLayer", getMaxLayersMinus1() + 1, m_layerIdInNuh, m_numDirectRefLayers, m_idDirectRefLayer, true );
     1471    std::cout << std::endl;
     1472
     1473  };
     1474
     1475  Void    printLayerSets()
     1476  {
     1477    vector<Int> fullArray;
     1478    vector<Int> numLayersInIdList;
     1479    vector<Int> rangeLayerSets;
     1480   
     1481
     1482    for (Int i = 0; i < getNumLayerSets(); i++ )
     1483    {
     1484      numLayersInIdList.push_back( getNumLayersInIdList( i ) );       
     1485      rangeLayerSets.push_back( i );
     1486    }
     1487
     1488    vector<Int> rangeOutputLayerSets;
     1489    vector<Int> numOutputLayersInOutputLayerSet;
     1490    vector<Int> numDecLayer;
     1491    vector<Int> numLayersInLayerSetForOutputLayerSet;
     1492    vector<Int> vOlsIdxToLsIdx;
     1493    for (Int i = 0; i < getNumOutputLayerSets(); i++ )
     1494    {
     1495      vOlsIdxToLsIdx.push_back( olsIdxToLsIdx(i));
     1496      numOutputLayersInOutputLayerSet.push_back( getNumOutputLayersInOutputLayerSet( i ) );       
     1497      numDecLayer.push_back( (Int) m_targetDecLayerIdLists[ i ].size() );
     1498      rangeOutputLayerSets.push_back( i );
     1499      numLayersInLayerSetForOutputLayerSet.push_back( getNumLayersInIdList( olsIdxToLsIdx( i ) ) );
     1500    }
     1501
     1502    vector<Int> rangeIndependentLayers;
     1503    for(Int i = 0; i < getNumIndependentLayers(); i++ )
     1504    {
     1505      rangeIndependentLayers.push_back( i );   
     1506    }
     1507
     1508    vector<Int> rangeAddLayerSets;
     1509    vector<Int> numHighestLayerIdxPlus1;
     1510    for(Int i = 0; i < getNumAddLayerSets(); i++ )
     1511    {
     1512      rangeAddLayerSets.push_back( i );   
     1513      numHighestLayerIdxPlus1.push_back( getNumIndependentLayers() );
     1514    }
     1515
     1516    std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "Layer Sets" << std::endl;     
     1517    xPrintArray( "TreePartitionLayerIdList", getNumIndependentLayers(), rangeIndependentLayers, m_numLayersInTreePartition, m_treePartitionLayerIdList, true );
     1518    xPrintArray( "highest_layer_idx_plus1", getNumAddLayerSets(), rangeAddLayerSets, numHighestLayerIdxPlus1, m_highestLayerIdxPlus1, true );
     1519    xPrintArray( "LayerSetLayerIdList" , (Int) getNumLayerSets()      , rangeLayerSets      , numLayersInIdList, m_layerSetLayerIdList, true );
     1520    xPrintArray( "OlsIdxToLsIdx", (Int) vOlsIdxToLsIdx.size(), vOlsIdxToLsIdx, true );
     1521    xPrintArray( "OutputLayerFlag"     , getNumOutputLayerSets(), rangeOutputLayerSets, numLayersInLayerSetForOutputLayerSet, m_outputLayerFlag, true );
     1522    xPrintArray( "TargetOptLayerIdList", getNumOutputLayerSets(), rangeOutputLayerSets, numOutputLayersInOutputLayerSet, m_targetOptLayerIdLists, true );
     1523    xPrintArray( "NecessaryLayerFlag"  , getNumOutputLayerSets(), rangeOutputLayerSets, numLayersInLayerSetForOutputLayerSet, m_necessaryLayerFlag   , true );
     1524    xPrintArray( "TargetDecLayerIdList", getNumOutputLayerSets(), rangeOutputLayerSets, numDecLayer,                     m_targetDecLayerIdLists, true );
     1525    std::cout << endl;
     1526};
     1527
     1528
     1529
     1530  template <typename T, typename S, typename U> Void xPrintArray( const Char* name, Int numElemDim1, U idx, S numElemDim2, T vec, Bool printNumber, Bool printIdx = true )
     1531  {
     1532    std::cout << std::endl;
     1533    for (Int j = 0; j < numElemDim1; j++ )
     1534    {
     1535      std::cout << std::right << std::setw(27) << name;
     1536      if (printIdx)
     1537      {
     1538        std::cout << "[" << std::right << std::setw(3) << idx[ j ] << "]" ;
     1539      }
     1540      else
     1541      {
     1542        std::cout << std::right << std::setw(5) << " ";
     1543      }
     1544     
     1545      if ( printNumber )
     1546      {
     1547        std::cout << " (" << std::right << std::setw(3) << numElemDim2[j] << ")";       
     1548      }         
     1549      else
     1550      {
     1551       std::cout << std::right << std::setw(6) << " ";             
     1552      }
     1553
     1554      std::cout << ":";
     1555      for (Int i = 0; i < numElemDim2[j]; i++)
     1556      {
     1557        std::cout << std::right << std::setw(3) << vec[j][i];
     1558      }   
     1559      std::cout << std::endl;
     1560    }
     1561  }
     1562
     1563  template <typename T> Void xPrintArray( const char* name, Int numElem, T vec, Bool printNumber  )
     1564  {
     1565    std::vector<Int> numElemDim2(1, numElem);   
     1566    std::vector<T>   vec2       (1,  vec    );
     1567    std::vector<Int> idx2       (0);
     1568    xPrintArray( name, 1, idx2, numElemDim2, vec2, printNumber, false );
     1569  }
     1570#endif
     1571
    11171572
    11181573  /// VPS EXTENSION 2 SYNTAX ELEMENTS
     
    15572012  TComVPS*    m_pcVPS;
    15582013  // SPS
     2014#if H_MV_HLS10_MULTILAYERSPS
     2015  Int         m_spsMaxSubLayersMinus1;
     2016  Int         m_spsExtOrMaxSubLayersMinus1;
     2017#endif
    15592018  Bool        m_spsExtensionPresentFlag;
    15602019
     
    15742033  // SPS Extension
    15752034  Bool        m_interViewMvVertConstraintFlag;
     2035#if !H_MV_HLS10_PPS
    15762036  Int         m_numScaledRefLayerOffsets;
    15772037  Int         m_scaledRefLayerId          [MAX_NUM_SCALED_REF_LAYERS];
     
    15802040  Int         m_scaledRefLayerRightOffset [MAX_NUM_LAYERS];
    15812041  Int         m_scaledRefLayerBottomOffset[MAX_NUM_LAYERS];
     2042#endif
    15822043#endif
    15832044#if H_3D
     
    16832144#if H_MV
    16842145  UInt      getSpsMaxSubLayersMinus1()                { return ( m_uiMaxTLayers - 1); }
     2146#if H_MV_HLS10_MULTILAYERSPS
     2147  Void      setSpsMaxSubLayersMinus1( UInt val )       { setMaxTLayers( val + 1 ); }
     2148#endif
    16852149#endif
    16862150
     
    17152179  TComPTL* getPTL()     { return &m_pcPTL; }
    17162180#if H_MV
     2181#if H_MV_HLS10_MULTILAYERSPS
     2182  Void setSpsExtOrMaxSubLayersMinus1( Int  val ) { m_spsExtOrMaxSubLayersMinus1 = val; }
     2183  Int  getSpsExtOrMaxSubLayersMinus1(  ) { return m_spsExtOrMaxSubLayersMinus1; }
     2184  Void inferSpsMaxSubLayersMinus1( Bool atPsActivation, TComVPS* vps  )
     2185  {     
     2186    assert( getLayerId() != 0 );
     2187    if ( !atPsActivation   )
     2188    {
     2189      assert( vps == NULL );
     2190      if (getSpsExtOrMaxSubLayersMinus1() != 7)
     2191      {
     2192        setSpsMaxSubLayersMinus1( getSpsExtOrMaxSubLayersMinus1() );
     2193      }
     2194    }
     2195    else
     2196    {
     2197      assert( vps != NULL );
     2198      if (getSpsExtOrMaxSubLayersMinus1() == 7)
     2199      {
     2200        setSpsMaxSubLayersMinus1( vps->getMaxSubLayersMinus1() );
     2201      }
     2202    }
     2203  }
     2204
     2205  Bool getMultiLayerExtSpsFlag()            { return ( getLayerId() != 0  &&  getSpsExtOrMaxSubLayersMinus1() == 7 ); }
     2206#endif
    17172207  Void inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder );
    17182208
     
    17532243  Bool getInterViewMvVertConstraintFlag()         { return m_interViewMvVertConstraintFlag;}
    17542244
     2245#if !H_MV_HLS10_PPS
    17552246  Void setNumScaledRefLayerOffsets( Int  val )    { m_numScaledRefLayerOffsets = val; }
    17562247  Int  getNumScaledRefLayerOffsets(  )            { return m_numScaledRefLayerOffsets; }
     
    17702261  Void setScaledRefLayerBottomOffset( Int j, Int  val ) { m_scaledRefLayerBottomOffset[j] = val; }
    17712262  Int  getScaledRefLayerBottomOffset( Int j )           { return m_scaledRefLayerBottomOffset[j]; }
     2263#endif
    17722264  // Inference
     2265
    17732266  Void inferRepFormat( TComVPS* vps, Int layerIdCurr );
    17742267  Void inferScalingList( TComSPS* spsSrc );
  • branches/HTM-12.0-dev1/source/Lib/TLibCommon/TypeDef.h

    r1051 r1054  
    5555
    5656#ifndef HEVC_EXT
    57 #define HEVC_EXT                    2
     57#define HEVC_EXT                    1
    5858#endif
    5959
     
    387387/////////////////////////////////////////////////////////////////////////////////
    388388// TBD: Check if integration is necessary.
     389
     390
     391
     392#define H_MV_HLS10_GEN                       0  // General changes (not tested)
     393
     394#define H_MV_HLS10_GEN_FIX                   1
     395
     396#define H_MV_HLS10_GEN_VSP_CONF_WIN          1  // VPS conformance window
     397#define H_MV_HLS10_GEN_VSP_BASE_LAYER_AVAIL  1  // vps_base_layer_available
     398#define H_MV_HLS10_REF_PRED_LAYERS           1  // reference and predicted layer derivation
     399#define H_MV_HLS10_NESSECARY_LAYER           1  // necessary layers
     400#define H_MV_HLS10_ADD_LAYERSETS             1  // additional layer sets
     401#define H_MV_HLS10_DBP_SIZE                  1  // dpb size syntax structure
     402#define H_MV_HLS10_MAXNUMPICS                1  // constraint on number of pictures in rps 
     403#define H_MV_HLS10_PTL                       1  // profile tier level
     404#define H_MV_HLS10_MULTILAYERSPS             1  // multilayer SPS extension
     405#define H_MV_HLS10_VPS_VUI                   1  // vsp vui
     406#define H_MV_HLS10_VPS_VUI_BSP               1  // vsp vui bsp
     407#define H_MV_HLS10_PPS                       1  // PPS modifications
     408
     409#define H_MV_HLS10_VPS_VUI_BSP_STORE         0  // Currently bsp vui bsp hrd parameters are not stored, some dynamic memory allocation with upper bounds is required.
     410
     411
    389412#define H_MV_HLS7_GEN                        0  // General changes (not tested)
     413
    390414
    391415// POC
     
    463487#define MAX_NESTING_NUM_LAYER       64
    464488
     489#if H_MV_HLS10_VPS_VUI_BSP
     490#define MAX_VPS_NUM_HRD_PARAMETERS                1024
     491#define MAX_NUM_SUB_LAYERS                        7
     492#define MAX_NUM_SIGNALLED_PARTITIONING_SCHEMES    16
     493#else
    465494#define MAX_VPS_NUM_HRD_PARAMETERS                1
     495#endif
     496
    466497#define MAX_VPS_OP_SETS_PLUS1                     1024
    467498#if H_MV
     499#if H_MV_HLS10_ADD_LAYERSETS
     500#define MAX_VPS_NUM_ADD_LAYER_SETS                1024
     501#endif
    468502#define MAX_VPS_NUH_LAYER_ID_PLUS1  63
    469503#define MAX_NUM_SCALABILITY_TYPES   16
     
    480514#define MAX_VPS_PROFILE_TIER_LEVEL      64
    481515#define MAX_VPS_ADD_OUTPUT_LAYER_SETS   1024
     516#if H_MV_HLS10_ADD_LAYERSETS
     517#define MAX_VPS_OUTPUTLAYER_SETS        ( MAX_VPS_ADD_OUTPUT_LAYER_SETS + MAX_VPS_OP_SETS_PLUS1 + MAX_VPS_OP_SETS_PLUS1 )
     518#else
    482519#define MAX_VPS_OUTPUTLAYER_SETS        ( MAX_VPS_ADD_OUTPUT_LAYER_SETS + MAX_VPS_OP_SETS_PLUS1 )
     520#endif
    483521#define  MAX_NUM_VIDEO_SIGNAL_INFO      16
    484522#define MAX_NUM_SCALED_REF_LAYERS       MAX_NUM_LAYERS-1
     523#if !H_MV_HLS10_VPS_VUI_BSP
    485524#define MAX_NUM_BSP_HRD_PARAMETERS      100 ///< Maximum value is actually not specified
    486525#define MAX_NUM_BITSTREAM_PARTITIONS    100 ///< Maximum value is actually not specified
    487526#define MAX_NUM_BSP_SCHED_COMBINATION   100 ///< Maximum value is actually not specified
    488527#define MAX_SUB_STREAMS                 1024
     528#endif
    489529#else
    490530#define MAX_NUM_LAYER_IDS                64
     
    957997    MAINSTILLPICTURE = 3,
    958998#if H_MV
     999#if H_MV_HLS10_PTL
     1000    MULTIVIEWMAIN = 6,
     1001    MAIN3D = 5,
     1002#if H_3D
     1003    MAIN3D = 8,
     1004#endif
     1005#else
    9591006    MAINSTEREO = 4,
    9601007    MAINMULTIVIEW = 5,
    9611008#if H_3D
    9621009    MAIN3D = 6,
     1010#endif
    9631011#endif
    9641012#endif
  • branches/HTM-12.0-dev1/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1048 r1054  
    5353  }
    5454  // To avoid mismatches
     55#if H_MV_HLS10_GEN_FIX
     56  fprintf( g_hTrace, "=========== Sequence Parameter Set LayerId: %d ===========\n", pSPS->getLayerId() );
     57#else
    5558  fprintf( g_hTrace, "=========== Sequence Parameter Set ===========\n" );
     59#endif
    5660#else
    5761  fprintf( g_hTrace, "=========== Sequence Parameter Set ID: %d ===========\n", pSPS->getSPSId() );
     
    6670    return;
    6771  }
     72#if H_MV_HLS10_GEN_FIX
     73  fprintf( g_hTrace, "=========== Picture Parameter Set LayerId: %d ===========\n", pPPS->getLayerId() );
     74#else
    6875  fprintf( g_hTrace, "=========== Picture Parameter Set ===========\n" );
     76#endif
    6977#else
    7078  fprintf( g_hTrace, "=========== Picture Parameter Set ID: %d ===========\n", pPPS->getPPSId() );
     
    334342    }
    335343  }
     344#if !H_MV_HLS10_PPS
    336345#if H_MV
    337346  if ( pcPPS->getLayerId() > 0 )
     
    347356  { 
    348357#endif
     358#endif
    349359  READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" );           pcPPS->setScalingListPresentFlag( uiCode ? true : false );
    350360  if(pcPPS->getScalingListPresentFlag ())
     
    352362    parseScalingList( pcPPS->getScalingList() );
    353363  }
    354 #if H_MV
    355   }
    356 #endif
    357 
     364#if !H_MV_HLS10_PPS
     365#if H_MV
     366  }
     367#endif
     368#endif
    358369  READ_FLAG( uiCode, "lists_modification_present_flag");
    359370  pcPPS->setListsModificationPresentFlag(uiCode);
     
    389400    if ( pcPPS->getPpsMultilayerExtensionFlag() )
    390401    {
     402#if H_MV_HLS10_PPS
     403      parsePPSMultilayerExtension( pcPPS );
     404#else
    391405      READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
    392406      READ_FLAG( uiCode, "pps_extension_reserved_zero_flag" );
     407#endif
    393408    }
    394409#if !H_3D
     
    415430  }
    416431}
     432
    417433
    418434#if H_3D
     
    759775  UInt  uiCode;
    760776  READ_CODE( 4,  uiCode, "sps_video_parameter_set_id");          pcSPS->setVPSId        ( uiCode );
     777
    761778#if H_MV
    762779  if ( pcSPS->getLayerId() == 0 )
     
    765782    READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
    766783    assert(uiCode <= 6);
     784#if H_MV_HLS10_MULTILAYERSPS
     785#if H_MV
     786  }
     787  else
     788  {
     789    READ_CODE( 3, uiCode, "sps_ext_or_max_sub_layers_minus1" ); pcSPS->setSpsExtOrMaxSubLayersMinus1( uiCode );   
     790    pcSPS->inferSpsMaxSubLayersMinus1( false, NULL );
     791  }
     792  if ( !pcSPS->getMultiLayerExtSpsFlag() )
     793  {
     794#endif
     795#endif
    767796
    768797    READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
     
    780809  assert(uiCode <= 15);
    781810#if H_MV
     811#if H_MV_HLS10_MULTILAYERSPS
     812  if ( pcSPS->getMultiLayerExtSpsFlag() )
     813#else
    782814  if ( pcSPS->getLayerId() > 0 )
     815#endif
    783816  {
    784817    READ_FLAG( uiCode, "update_rep_format_flag" );               pcSPS->setUpdateRepFormatFlag( uiCode == 1 );
     
    802835    READ_UVLC (    uiCode, "pic_width_in_luma_samples" );          pcSPS->setPicWidthInLumaSamples ( uiCode    );
    803836    READ_UVLC (    uiCode, "pic_height_in_luma_samples" );         pcSPS->setPicHeightInLumaSamples( uiCode    );
    804 #if H_MV
    805   }
     837#if !H_MV_HLS10_MULTILAYERSPS
     838#if H_MV
     839  }
     840#endif
    806841#endif
    807842  READ_FLAG(     uiCode, "conformance_window_flag");
     
    816851    READ_UVLC(   uiCode, "conf_win_top_offset" );                conf.setWindowTopOffset   ( uiCode  );
    817852    READ_UVLC(   uiCode, "conf_win_bottom_offset" );             conf.setWindowBottomOffset( uiCode  );   
     853#if H_MV_HLS10_MULTILAYERSPS
     854  }
     855#endif
    818856#else
    819857    READ_UVLC(   uiCode, "conf_win_left_offset" );               conf.setWindowLeftOffset  ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) );
     
    825863
    826864#if H_MV
     865#if H_MV_HLS10_MULTILAYERSPS
     866  if ( !pcSPS->getMultiLayerExtSpsFlag() )
     867#else // H_MV_HLS10_GEN
    827868  if ( pcSPS->getLayerId() == 0 )
     869#endif // H_MV_HLS10_GEN
    828870  {
    829871#endif
     
    845887
    846888#if H_MV
     889#if H_MV_HLS10_MULTILAYERSPS
     890  if ( !pcSPS->getMultiLayerExtSpsFlag())
     891#else
    847892  if ( pcSPS->getLayerId() == 0 )
     893#endif
    848894  { 
    849895#endif
     
    904950  {
    905951#if H_MV
     952#if H_MV_HLS10_MULTILAYERSPS
     953    if ( pcSPS->getMultiLayerExtSpsFlag() )
     954#else
    906955    if ( pcSPS->getLayerId() > 0 )
     956#endif
    907957    {   
    908958      READ_FLAG( uiCode, "sps_infer_scaling_list_flag" ); pcSPS->setSpsInferScalingListFlag( uiCode == 1 );
     
    10321082  READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" );    pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false);
    10331083 
     1084#if !H_MV_HLS10_PPS
    10341085  READ_UVLC( uiCode, "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets( uiCode );
    10351086
     
    10461097    READ_FLAG( uiCode, "sps_multilayer_ext_reserved_zero_flag[ i ]" );
    10471098  }
     1099#endif
    10481100}
    10491101
     
    10751127#if H_MV
    10761128  READ_FLAG( uiCode, "vps_base_layer_internal_flag" );            pcVPS->setVpsBaseLayerInternalFlag( uiCode == 1 );
     1129#if H_MV_HLS10_GEN_VSP_BASE_LAYER_AVAIL
     1130  READ_FLAG( uiCode, "vps_base_layer_available_flag" );           pcVPS->setVpsBaseLayerAvailableFlag( uiCode == 1 );
     1131#else
    10771132  READ_FLAG( uiCode, "vps_reserved_one_bit" );                    assert( uiCode == 1 );
     1133#endif
    10781134#else
    10791135  READ_CODE( 2,  uiCode,  "vps_reserved_three_2bits" );           assert(uiCode == 3);
     
    11151171  READ_CODE( 6, uiCode, "vps_max_layer_id" );   pcVPS->setVpsMaxLayerId( uiCode );
    11161172
     1173#if H_MV_HLS10_GEN_FIX
     1174  READ_UVLC(    uiCode, "vps_num_layer_sets_minus1" );  pcVPS->setVpsNumLayerSetsMinus1( uiCode );
     1175#else
    11171176  READ_UVLC(    uiCode, "vps_max_num_layer_sets_minus1" );               pcVPS->setVpsNumLayerSetsMinus1( uiCode );
     1177#endif
    11181178  for( UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx ++ )
    11191179  {
     
    12041264  UInt uiCode;
    12051265
     1266#if H_MV_HLS10_PTL
     1267  if( pcVPS->getMaxLayersMinus1() > 0  &&  pcVPS->getVpsBaseLayerInternalFlag() )
     1268  {
     1269    parsePTL( pcVPS->getPTL( 1 ),0, pcVPS->getMaxSubLayersMinus1()  ); 
     1270   
     1271    // Copy Profile info
     1272    TComPTL temp = *pcVPS->getPTL( 1 );
     1273    *pcVPS->getPTL( 1 ) = *pcVPS->getPTL( 0 );
     1274    pcVPS->getPTL( 1 )->copyLevelFrom( &temp );
     1275  }
     1276#endif
     1277
    12061278  READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
    12071279
     
    12751347  }
    12761348  pcVPS->setRefLayers();
     1349
     1350#if H_MV_HLS10_ADD_LAYERSETS
     1351  if ( pcVPS->getNumIndependentLayers() > 1 )
     1352  {
     1353    READ_UVLC( uiCode, "num_add_layer_sets"      ); pcVPS->setNumAddLayerSets( uiCode );
     1354  }
     1355  for (Int i = 0; i < pcVPS->getNumAddLayerSets(); i++)
     1356  {
     1357    for (Int j = 1; j < pcVPS->getNumIndependentLayers(); j++)
     1358    {
     1359      READ_CODE( pcVPS->getHighestLayerIdxPlus1Len( j ) , uiCode, "highest_layer_idx_plus1" ); pcVPS->setHighestLayerIdxPlus1( i, j, uiCode );
     1360    }
     1361    pcVPS->deriveAddLayerSetLayerIdList( i );
     1362  }
     1363#endif
     1364
    12771365  READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag" ); pcVPS->setVpsSubLayersMaxMinus1PresentFlag( uiCode == 1 );
    12781366  if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() )
     
    13101398  READ_UVLC( uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode ); 
    13111399
     1400#if H_MV_HLS10_PTL
     1401  Int offsetVal =  ( pcVPS->getMaxLayersMinus1() > 0  &&  pcVPS->getVpsBaseLayerInternalFlag() ) ? 2 : 1;   
     1402  for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 2 : 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
     1403  {
     1404    READ_FLAG(  uiCode, "vps_profile_present_flag[i]" );    pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 );
     1405    parsePTL ( pcVPS->getPTL( offsetVal ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1);
     1406    if( !pcVPS->getVpsProfilePresentFlag( i ) )
     1407    {
     1408      TComPTL temp = *pcVPS->getPTL( offsetVal );
     1409      *pcVPS->getPTL( offsetVal ) = *pcVPS->getPTL( offsetVal - 1 );
     1410      pcVPS->getPTL( offsetVal )->copyLevelFrom( &temp );
     1411    }
     1412    offsetVal++;
     1413  }
     1414#else
    13121415  for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
    13131416  {
     
    13211424    }
    13221425  }
    1323 
     1426#endif
     1427
     1428#if !H_MV_HLS10_ADD_LAYERSETS
    13241429  if ( pcVPS->getNumIndependentLayers() > 1 )
    13251430  {
     
    13331438    }
    13341439  }
     1440#endif // H_MV_HLS10_GEN
     1441
    13351442  if (pcVPS->getNumLayerSets() > 1)
    13361443  {
     
    13451452  pcVPS->setLayerSetIdxForOlsMinus1(0, -1);
    13461453
     1454#if H_MV_HLS10_NESSECARY_LAYER
     1455  pcVPS->deriveNecessaryLayerFlags( 0 );
     1456#endif
    13471457  pcVPS->deriveTargetLayerIdList( 0 );
    13481458
     
    13681478      }
    13691479    }
     1480#if H_MV_HLS10_NESSECARY_LAYER
     1481    pcVPS->deriveNecessaryLayerFlags( i );
     1482#endif
    13701483    pcVPS->deriveTargetLayerIdList( i );
    13711484
     1485#if H_MV_HLS10_PTL
     1486    for ( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx(i)); j++ )
     1487    {   
     1488      if (pcVPS->getNecessaryLayerFlag( i, j ) && pcVPS->getVpsNumProfileTierLevelMinus1() > 0 )
     1489      {
     1490        READ_CODE( pcVPS->getProfileTierLevelIdxLen(), uiCode,"profile_tier_level_idx[ i ][ j ]" );   pcVPS->setProfileTierLevelIdx( i, j, uiCode );
     1491      }
     1492    }
     1493#else
    13721494    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
    1373     {      
     1495    {
    13741496      READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" );   pcVPS->setProfileLevelTierIdx( i , uiCode );
    13751497    }
     1498#endif
     1499
    13761500    if( pcVPS->getNumOutputLayersInOutputLayerSet( i ) == 1 && pcVPS->getNumDirectRefLayers( pcVPS->getOlsHighestOutputLayerId( i ) ) > 0 )
    13771501    {
     
    14221546  }
    14231547
     1548#if !H_MV_HLS10_GEN_FIX
    14241549  READ_FLAG( uiCode, "vps_reserved_zero_flag" );
     1550#endif
    14251551  parseDpbSize( pcVPS );
    14261552
     
    14841610  if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() )
    14851611  { 
    1486   READ_CODE( 2,  uiCode, "chroma_format_vps_idc" );          pcRepFormat->setChromaFormatVpsIdc       ( uiCode );
    1487   if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
    1488   {
    1489     READ_FLAG( uiCode, "separate_colour_plane_vps_flag" ); pcRepFormat->setSeparateColourPlaneVpsFlag( uiCode == 1 );
    1490   }
    1491   READ_CODE( 4,  uiCode, "bit_depth_vps_luma_minus8" );      pcRepFormat->setBitDepthVpsLumaMinus8    ( uiCode );
    1492   READ_CODE( 4,  uiCode, "bit_depth_vps_chroma_minus8" );    pcRepFormat->setBitDepthVpsChromaMinus8  ( uiCode );
     1612    READ_CODE( 2,  uiCode, "chroma_format_vps_idc" );          pcRepFormat->setChromaFormatVpsIdc       ( uiCode );
     1613    if ( pcRepFormat->getChromaFormatVpsIdc() == 3 )
     1614    {
     1615      READ_FLAG( uiCode, "separate_colour_plane_vps_flag" ); pcRepFormat->setSeparateColourPlaneVpsFlag( uiCode == 1 );
     1616    }
     1617    READ_CODE( 4,  uiCode, "bit_depth_vps_luma_minus8" );      pcRepFormat->setBitDepthVpsLumaMinus8    ( uiCode );
     1618    READ_CODE( 4,  uiCode, "bit_depth_vps_chroma_minus8" );    pcRepFormat->setBitDepthVpsChromaMinus8  ( uiCode );
    14931619  }
    14941620  else
     
    14961622    pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, false );
    14971623  }
     1624#if H_MV_HLS10_GEN_VSP_CONF_WIN
     1625  READ_FLAG( uiCode, "conformance_window_vps_flag" ); pcRepFormat->setConformanceWindowVpsFlag( uiCode == 1 );
     1626  if ( pcRepFormat->getConformanceWindowVpsFlag() )
     1627  {
     1628    READ_UVLC( uiCode, "conf_win_vps_left_offset" ); pcRepFormat->setConfWinVpsLeftOffset( uiCode );
     1629    READ_UVLC( uiCode, "conf_win_vps_right_offset" ); pcRepFormat->setConfWinVpsRightOffset( uiCode );
     1630    READ_UVLC( uiCode, "conf_win_vps_top_offset" ); pcRepFormat->setConfWinVpsTopOffset( uiCode );
     1631    READ_UVLC( uiCode, "conf_win_vps_bottom_offset" ); pcRepFormat->setConfWinVpsBottomOffset( uiCode );
     1632  }
     1633#endif
    14981634}
    14991635
     
    15211657  if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    15221658  {
     1659#if H_MV_HLS10_VPS_VUI
     1660    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <  pcVPS->getNumLayerSets(); i++ )
     1661#else
    15231662    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
     1663#endif
    15241664    {
    15251665      for( Int j = 0; j  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ )
     
    15541694  else
    15551695  {
     1696#if H_MV_HLS10_VPS_VUI
     1697    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() - pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1 );
     1698#else
    15561699    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() );
     1700#endif
    15571701  }
    15581702
     
    15671711  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
    15681712  {
     1713#if H_MV_HLS10_VPS_VUI
     1714    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1715#else
    15691716    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1717#endif
    15701718    {
    15711719      READ_CODE( 4, uiCode, "vps_video_signal_info_idx" ); pcVPSVUI->setVpsVideoSignalInfoIdx( i, uiCode );
     
    15941742    {
    15951743      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
    1596       { 
     1744      {
     1745#if H_MV_HLS10_REF_PRED_LAYERS
     1746        Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getIdDirectRefLayer(pcVPS->getLayerIdInNuh( i ) , j  )); 
     1747#else
    15971748        Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j  )); 
     1749#endif
    15981750        if( pcVPSVUI->getTilesInUseFlag( i )  &&  pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 
    15991751        {
     
    16131765    }
    16141766  }
     1767#if H_MV_HLS10_VPS_VUI
     1768  READ_FLAG( uiCode, "single_layer_for_non_irap_flag" ); pcVPSVUI->setSingleLayerForNonIrapFlag( uiCode == 1 );
     1769  READ_FLAG( uiCode, "higher_layer_irap_skip_flag" ); pcVPSVUI->setHigherLayerIrapSkipFlag( uiCode == 1 );
     1770#else
    16151771  READ_CODE( 3, uiCode, "vps_vui_reserved_zero_3bits" );
     1772#endif
    16161773  READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 );
    16171774
     
    16221779      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
    16231780      {
     1781#if H_MV_HLS10_REF_PRED_LAYERS
     1782        if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getIdDirectRefLayer( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
     1783#else
    16241784        if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getRefLayerId( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
     1785#endif
    16251786        {       
    16261787          READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcVPSVUI->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
     
    16611822
    16621823  TComVpsVuiBspHrdParameters*  vpsVuiBspHrdP = pcVPSVUI->getVpsVuiBspHrdParameters();
    1663  
     1824#if H_MV_HLS10_VPS_VUI_BSP
     1825  assert( vpsVuiBspHrdP == NULL );
     1826  vpsVuiBspHrdP = new TComVpsVuiBspHrdParameters;
     1827  pcVPSVUI->setVpsVuiBspHrdParameters( vpsVuiBspHrdP );
     1828#else
    16641829  assert ( vpsVuiBspHrdP );
    1665 
     1830#endif
    16661831  UInt uiCode;
     1832#if H_MV_HLS10_VPS_VUI_BSP
     1833  READ_UVLC( uiCode, "vps_num_add_hrd_params" ); vpsVuiBspHrdP->setVpsNumAddHrdParams( uiCode );
     1834  vpsVuiBspHrdP->createAfterVpsNumAddHrdParams( pcVPS );
     1835  for( Int i = pcVPS->getNumHrdParameters(); i < pcVPS->getNumHrdParameters() + vpsVuiBspHrdP->getVpsNumAddHrdParams(); i++ )
     1836  { 
     1837    if( i > 0 ) 
     1838    {
     1839      READ_FLAG( uiCode, "cprms_add_present_flag" ); vpsVuiBspHrdP->setCprmsAddPresentFlag( i, uiCode == 1 );
     1840    }
     1841    else
     1842    {
     1843       vpsVuiBspHrdP->setCprmsAddPresentFlag( i, true );
     1844    }
     1845
     1846    READ_UVLC( uiCode, "num_sub_layer_hrd_minus1" ); vpsVuiBspHrdP->setNumSubLayerHrdMinus1( i, uiCode );
     1847    TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i );
     1848    parseHrdParameters( hrdParameters, vpsVuiBspHrdP->getCprmsAddPresentFlag( i ), vpsVuiBspHrdP->getNumSubLayerHrdMinus1( i ) );     
     1849  }
     1850
     1851  vpsVuiBspHrdP->setNumPartitionsInSchemeMinus1( 0, 0, 0);
     1852  vpsVuiBspHrdP->createAfterNumPartitionsInSchemeMinus1( 0, 0 );
     1853
     1854  for( Int h = 0; h < pcVPS->getNumOutputLayerSets(); h++ )
     1855  {
     1856    if ( h == 0)
     1857    {
     1858      vpsVuiBspHrdP->setNumSignalledPartitioningSchemes( h, 0 );
     1859    }
     1860    else
     1861    {
     1862      READ_UVLC( uiCode, "num_signalled_partitioning_schemes" ); vpsVuiBspHrdP->setNumSignalledPartitioningSchemes( h, uiCode );
     1863    }   
     1864    vpsVuiBspHrdP->createAfterNumSignalledPartitioningSchemes( h );
     1865
     1866    for( Int j = 0; j < vpsVuiBspHrdP->getNumSignalledPartitioningSchemes( h ) + 1; j++ )
     1867    {
     1868      if ( j == 0 && h == 0 )
     1869      {
     1870        vpsVuiBspHrdP->setNumPartitionsInSchemeMinus1( h, j, uiCode );
     1871      }
     1872      else if( j == 0 )
     1873      {
     1874        vpsVuiBspHrdP->setNumPartitionsInSchemeMinus1( h, j, pcVPS->getNumLayersInIdList( h ) - 1 );
     1875      }
     1876      else
     1877      {
     1878        READ_UVLC( uiCode, "num_partitions_in_scheme_minus1" ); vpsVuiBspHrdP->setNumPartitionsInSchemeMinus1( h, j, uiCode );
     1879      }
     1880      vpsVuiBspHrdP->createAfterNumPartitionsInSchemeMinus1( h, j );
     1881
     1882      for( Int k = 0; k  <=  vpsVuiBspHrdP->getNumPartitionsInSchemeMinus1( h, j ); k++ ) 
     1883      {
     1884        for( Int r = 0; r < pcVPS->getNumLayersInIdList(pcVPS->olsIdxToLsIdx( h ) )   ; r++ ) 
     1885        {
     1886          if( h == 0 && j == 0 && k == 0 && r == 0 )
     1887          {
     1888             vpsVuiBspHrdP->setLayerIncludedInPartitionFlag( h, j, k, r, true );
     1889          }
     1890          else if ( h > 0 && j == 0 )
     1891          {
     1892             vpsVuiBspHrdP->setLayerIncludedInPartitionFlag( h, j, k, r, (k == r) );
     1893          }
     1894          else
     1895          {
     1896            READ_FLAG( uiCode, "layer_included_in_partition_flag" ); vpsVuiBspHrdP->setLayerIncludedInPartitionFlag( h, j, k, r, uiCode == 1 );
     1897          }         
     1898        }
     1899      }
     1900    } 
     1901    if ( h > 0 )
     1902    {
     1903      for( Int i = 0; i < vpsVuiBspHrdP->getNumSignalledPartitioningSchemes( h ) + 1; i++ ) 
     1904      {
     1905        for( Int t = 0; t  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( pcVPS->olsIdxToLsIdx( i ) ); t++ )
     1906        { 
     1907          READ_UVLC( uiCode, "num_bsp_schedules_minus1" ); vpsVuiBspHrdP->setNumBspSchedulesMinus1( h, i, t, uiCode );
     1908          vpsVuiBspHrdP->createAfterNumBspSchedulesMinus1( h, i, t );
     1909          for( Int j = 0; j  <=  vpsVuiBspHrdP->getNumBspSchedulesMinus1( h, i, t ); j++ ) 
     1910          {
     1911            for( Int k = 0; k  <=  vpsVuiBspHrdP->getNumPartitionsInSchemeMinus1( h, j ); k++ )
     1912            { 
     1913              READ_CODE( vpsVuiBspHrdP->getBspHrdIdxLen( pcVPS ), uiCode, "bsp_hrd_idx" ); vpsVuiBspHrdP->setBspHrdIdx( h, i, t, j, k, uiCode );
     1914              READ_UVLC( uiCode, "bsp_sched_idx" ); vpsVuiBspHrdP->setBspSchedIdx( h, i, t, j, k, uiCode );
     1915            } 
     1916          }
     1917        } 
     1918      }
     1919    }
     1920  } 
     1921#else
    16671922  READ_UVLC( uiCode, "vps_num_bsp_hrd_parameters_minus1" ); vpsVuiBspHrdP->setVpsNumBspHrdParametersMinus1( uiCode );
    16681923  for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ )
     
    17011956    } 
    17021957  } 
    1703 
     1958#endif 
     1959}
    17041960
    17051961Void TDecCavlc::parseVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo )
     
    17331989        for( Int k = 0; k < vps->getNumLayersInIdList( currLsIdx ); k++ )   
    17341990        {
     1991#if H_MV_HLS10_DBP_SIZE
     1992          if ( vps->getNecessaryLayerFlag( i, k ) && ( vps->getVpsBaseLayerInternalFlag() || ( vps->getLayerSetLayerIdList(vps->olsIdxToLsIdx(i),k) != 0 ) ))
     1993          {
     1994            READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
     1995          }
     1996          else
     1997          {
     1998            if ( vps->getNecessaryLayerFlag( i, k ) && ( j == 0 ) && ( k == 0 ))
     1999            {
     2000              dpbSize->setMaxVpsDecPicBufferingMinus1(i ,k, j, 0 );
     2001            }
     2002          }
     2003#else
    17352004          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
     2005#endif
    17362006        }
    17372007        READ_UVLC( uiCode, "max_vps_num_reorder_pics" ); dpbSize->setMaxVpsNumReorderPics( i, j, uiCode );
     
    17442014          for( Int k = 0; k < vps->getNumLayersInIdList( vps->olsIdxToLsIdx( i ) ); k++ )   
    17452015          {
    1746             dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
     2016#if H_MV_HLS10_DBP_SIZE
     2017            if ( vps->getNecessaryLayerFlag(i, k ) )
     2018            {           
     2019#endif
     2020              dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
     2021#if H_MV_HLS10_DBP_SIZE
     2022            }
     2023#endif           
    17472024          }
    17482025          dpbSize->setMaxVpsNumReorderPics      ( i, j, dpbSize->getMaxVpsNumReorderPics      ( i, j - 1 ) );
     
    19402217  sps->inferScalingList( parameterSetManager->getActiveSPS( sps->getSpsScalingListRefLayerId() ) );   
    19412218  sps->inferSpsMaxDecPicBufferingMinus1( vps, targetOlsIdx, rpcSlice->getLayerId(), false );
     2219#if !H_MV_HLS10_ADD_LAYERSETS
    19422220  vps->inferDbpSizeLayerSetZero( sps, false );
     2221#endif
    19432222
    19442223  if ( sps->getVuiParametersPresentFlag() )
     
    21552434          rps->checkMaxNumPics(
    21562435            vps->getVpsExtensionFlag(),
     2436#if H_MV_HLS10_MAXNUMPICS
     2437            INT_MAX,  // To be replaced by MaxDbpSize
     2438#else
    21572439            vps->getMaxNumPics( rpcSlice->getLayerId() ),
     2440#endif
    21582441            rpcSlice->getLayerId(),
    21592442            sps->getMaxDecPicBuffering( sps->getSpsMaxSubLayersMinus1() ) - 1 );
     
    22682551        rps->checkMaxNumPics(
    22692552          vps->getVpsExtensionFlag(),
     2553#if H_MV_HLS10_MAXNUMPICS
     2554            INT_MAX,  // To be replaced by MaxDbpsize
     2555#else
    22702556          vps->getMaxNumPics( rpcSlice->getLayerId() ),
     2557#endif
    22712558          rpcSlice->getLayerId(),
    22722559          sps->getMaxDecPicBuffering( sps->getSpsMaxSubLayersMinus1() ) - 1 );
     
    28703157  ptl->setFrameOnlyConstraintFlag(uiCode ? true : false);
    28713158 
     3159#if H_MV_HLS10_PTL
     3160  if( ptl->getProfileIdc( ) ==  4 || ptl->getProfileCompatibilityFlag( 4 )  ||
     3161      ptl->getProfileIdc( ) ==  5 || ptl->getProfileCompatibilityFlag( 5 )  ||
     3162      ptl->getProfileIdc( ) ==  6 || ptl->getProfileCompatibilityFlag( 6 )  ||
     3163      ptl->getProfileIdc( ) ==  7 || ptl->getProfileCompatibilityFlag( 7 ) )
     3164  {
     3165    READ_FLAG( uiCode, "max_12bit_constraint_flag" ); ptl->setMax12bitConstraintFlag( uiCode == 1 );
     3166    READ_FLAG( uiCode, "max_10bit_constraint_flag" ); ptl->setMax10bitConstraintFlag( uiCode == 1 );
     3167    READ_FLAG( uiCode, "max_8bit_constraint_flag" ); ptl->setMax8bitConstraintFlag( uiCode == 1 );
     3168    READ_FLAG( uiCode, "max_422chroma_constraint_flag" ); ptl->setMax422chromaConstraintFlag( uiCode == 1 );
     3169    READ_FLAG( uiCode, "max_420chroma_constraint_flag" ); ptl->setMax420chromaConstraintFlag( uiCode == 1 );
     3170    READ_FLAG( uiCode, "max_monochrome_constraint_flag" ); ptl->setMaxMonochromeConstraintFlag( uiCode == 1 );
     3171    READ_FLAG( uiCode, "intra_constraint_flag" ); ptl->setIntraConstraintFlag( uiCode == 1 );
     3172    READ_FLAG( uiCode, "one_picture_only_constraint_flag" ); ptl->setOnePictureOnlyConstraintFlag( uiCode == 1 );
     3173    READ_FLAG( uiCode, "lower_bit_rate_constraint_flag" ); ptl->setLowerBitRateConstraintFlag( uiCode == 1 );   
     3174    READ_CODE(16, uiCode, "XXX_reserved_zero_34bits[0..15]");
     3175    READ_CODE(16, uiCode, "XXX_reserved_zero_34bits[16..31]");
     3176    READ_CODE(2 , uiCode, "XXX_reserved_zero_34bits[32..33]");
     3177  }
     3178  else
     3179  {
     3180    READ_CODE(16, uiCode, "XXX_reserved_zero_43bits[0..15]");
     3181    READ_CODE(16, uiCode, "XXX_reserved_zero_43bits[16..31]");
     3182    READ_CODE(11, uiCode, "XXX_reserved_zero_43bits[32..42]");
     3183  }
     3184  if( ( ptl->getProfileIdc() >= 1 && ptl->getProfileIdc() <= 5 )  ||
     3185    ptl->getProfileCompatibilityFlag( 1 ) || ptl->getProfileCompatibilityFlag( 2 )  ||
     3186    ptl->getProfileCompatibilityFlag( 3 ) || ptl->getProfileCompatibilityFlag( 4 )  ||
     3187    ptl->getProfileCompatibilityFlag( 5 ) )
     3188  {
     3189    READ_FLAG( uiCode, "inbld_flag" ); ptl->setInbldFlag( uiCode == 1 );
     3190  }
     3191  else
     3192  {
     3193    READ_FLAG(uiCode, "reserved_zero_bit");
     3194  }
     3195#else
    28723196  READ_CODE(16, uiCode, "XXX_reserved_zero_44bits[0..15]");
    28733197  READ_CODE(16, uiCode, "XXX_reserved_zero_44bits[16..31]");
    28743198  READ_CODE(12, uiCode, "XXX_reserved_zero_44bits[32..43]");
     3199#endif
    28753200}
    28763201
  • branches/HTM-12.0-dev1/source/Lib/TLibDecoder/TDecCAVLC.h

    r1039 r1054  
    9797#endif
    9898
     99#if H_MV_HLS10_PPS
     100#if H_MV
     101  Void  parsePPSMultilayerExtension( TComPPS* pcPPS )
     102  {
     103    UInt uiCode = 0;
     104    READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
     105    READ_FLAG( uiCode, "pps_infer_scaling_list_flag" ); pcPPS->setPpsInferScalingListFlag( uiCode == 1 );
     106    READ_CODE( 6, uiCode, "pps_scaling_list_ref_layer_id" ); pcPPS->setPpsScalingListRefLayerId( uiCode );
     107    READ_UVLC( uiCode, "num_ref_loc_offsets" ); assert( uiCode == 0 );
     108  }
     109#endif
     110#endif
     111
     112
    99113#if H_3D
    100114  Void  parsePPS            ( TComPPS* pcPPS, TComVPS* pcVPS );
  • branches/HTM-12.0-dev1/source/Lib/TLibDecoder/TDecTop.cpp

    r1048 r1054  
    669669#if H_MV
    670670  sps->inferSpsMaxDecPicBufferingMinus1( vps, m_targetOptLayerSetIdx, getLayerId(), false );
     671#if !H_MV_HLS10_ADD_LAYERSETS
    671672  vps->inferDbpSizeLayerSetZero( sps, false );
     673#endif
    672674  // When the value of vps_num_rep_formats_minus1 in the active VPS is equal to 0
    673675  if ( vps->getVpsNumRepFormatsMinus1() == 0 )
     
    677679  }
    678680  sps->checkRpsMaxNumPics( vps, getLayerId() );
     681#if H_MV_HLS10_MULTILAYERSPS
     682
     683  if( sps->getLayerId() != 0 )
     684  {
     685    sps->inferSpsMaxSubLayersMinus1( true, vps );
     686  }
     687
     688#if H_MV_HLS10_MULTILAYERSPS
     689  // It is a requirement of bitstream conformance that, when the SPS is referred to by
     690  // any current picture that belongs to an independent non-base layer, the value of
     691  // MultiLayerExtSpsFlag derived from the SPS shall be equal to 0.
     692
     693  if ( m_layerId > 0 && vps->getNumRefLayers( m_layerId ) == 0 )
     694  { 
     695    assert( sps->getMultiLayerExtSpsFlag() == 0 );
     696  }
     697#endif
     698
     699  if( sps->getMultiLayerExtSpsFlag() )
     700  {
     701    sps->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? vps->getTemporalNestingFlag() : true );
     702  }
     703#else
    679704  if( m_layerId > 0 )
    680705  {
    681706    sps->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? vps->getTemporalNestingFlag() : true );
    682707  }
     708#endif
    683709#endif
    684710
     
    710736  sps->inferRepFormat  ( vps , m_layerId );
    711737  sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) );
     738
    712739#endif
    713740  pps->setSPS(sps);
     
    16581685  for (Int i = 0; i < vps->getNumDirectRefLayers( getLayerId()  ); i++ )
    16591686  {
     1687#if H_MV_HLS10_REF_PRED_LAYERS
     1688    Int refLayerId = vps->getIdDirectRefLayer( m_layerId, i );
     1689#else
    16601690    Int refLayerId = vps->getRefLayerId( m_layerId, i );
     1691#endif
    16611692    allRefLayersInitilizedFlag = allRefLayersInitilizedFlag && m_layerInitilizedFlag[ refLayerId ];
    16621693  }
  • branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1048 r1054  
    4949{
    5050#if H_MV_ENC_DEC_TRAC
     51#if H_MV_HLS10_GEN_FIX
     52  fprintf( g_hTrace, "=========== Sequence Parameter Set LayerId: %d ===========\n", pSPS->getLayerId() );
     53#else
    5154  fprintf( g_hTrace, "=========== Sequence Parameter Set ===========\n" );
     55#endif
    5256#else
    5357  fprintf( g_hTrace, "=========== Sequence Parameter Set ID: %d ===========\n", pSPS->getSPSId() );
     
    5862{
    5963#if H_MV_ENC_DEC_TRAC
     64#if H_MV_HLS10_GEN_FIX
     65  fprintf( g_hTrace, "=========== Picture Parameter Set LayerId: %d ===========\n", pPPS->getLayerId() );
     66#else
    6067  fprintf( g_hTrace, "=========== Picture Parameter Set ===========\n" );
     68#endif
    6169#else
    6270  fprintf( g_hTrace, "=========== Picture Parameter Set ID: %d ===========\n", pPPS->getPPSId() );
     
    241249    }
    242250  }
     251#if !H_MV_HLS10_PPS
    243252#if H_MV
    244253  if ( pcPPS->getLayerId() > 0 )
     
    254263  { 
    255264#endif 
     265#endif
    256266  WRITE_FLAG( pcPPS->getScalingListPresentFlag() ? 1 : 0,                          "pps_scaling_list_data_present_flag" );
    257267  if( pcPPS->getScalingListPresentFlag() )
     
    259269    codeScalingList( m_pcSlice->getScalingList() );
    260270  }
     271#if !H_MV_HLS10_PPS
    261272#if H_MV
    262273  }
     274#endif
    263275#endif
    264276#if PPS_FIX_DEPTH
     
    301313    if ( pcPPS->getPpsMultilayerExtensionFlag() )
    302314    {
     315#if H_MV_HLS10_PPS
     316      codePPSMultilayerExtension( pcPPS );
     317#else
    303318      WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
    304319      WRITE_FLAG( 0, "pps_extension_reserved_zero_flag" );
     320#endif
    305321    }
    306322
     
    675691#endif
    676692  WRITE_CODE( pcSPS->getMaxTLayers() - 1,  3,       "sps_max_sub_layers_minus1" );
     693#if H_MV_HLS10_MULTILAYERSPS
     694#if H_MV
     695  }
     696  else
     697  {
     698    WRITE_CODE( pcSPS->getSpsExtOrMaxSubLayersMinus1( ), 3, "sps_ext_or_max_sub_layers_minus1" );
     699  }
     700  if ( !pcSPS->getMultiLayerExtSpsFlag() )
     701  {
     702#endif
     703#endif
     704
    677705  WRITE_FLAG( pcSPS->getTemporalIdNestingFlag() ? 1 : 0,                             "sps_temporal_id_nesting_flag" );
    678706  codePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
     
    682710  WRITE_UVLC( pcSPS->getSPSId (),                   "sps_seq_parameter_set_id" );
    683711#if H_MV
     712#if H_MV_HLS10_MULTILAYERSPS
     713    if ( pcSPS->getMultiLayerExtSpsFlag() )
     714#else
    684715  if ( pcSPS->getLayerId() > 0 )
     716#endif
    685717  {
    686718    WRITE_FLAG( pcSPS->getUpdateRepFormatFlag( ) ? 1 : 0 , "update_rep_format_flag" );
     
    703735  WRITE_UVLC( pcSPS->getPicWidthInLumaSamples (),   "pic_width_in_luma_samples" );
    704736  WRITE_UVLC( pcSPS->getPicHeightInLumaSamples(),   "pic_height_in_luma_samples" );
     737#if !H_MV_HLS10_MULTILAYERSPS
    705738#if H_MV
    706739  }
     740#endif
    707741#endif
    708742  Window conf = pcSPS->getConformanceWindow();
     
    716750    WRITE_UVLC( conf.getWindowBottomOffset() / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc() ), "conf_win_bottom_offset" );
    717751  }
     752#if H_MV_HLS10_MULTILAYERSPS
    718753#if H_MV
     754}
     755#endif
     756#endif
     757
     758#if H_MV
     759#if H_MV_HLS10_MULTILAYERSPS
     760  if ( !pcSPS->getMultiLayerExtSpsFlag() )
     761#else
    719762  if ( pcSPS->getLayerId() == 0 )
     763#endif
    720764  {
    721765#endif
     
    727771  WRITE_UVLC( pcSPS->getBitsForPOC()-4,                 "log2_max_pic_order_cnt_lsb_minus4" );
    728772#if H_MV
     773#if H_MV_HLS10_MULTILAYERSPS
     774  if ( !pcSPS->getMultiLayerExtSpsFlag())
     775#else
    729776  if ( pcSPS->getLayerId() == 0 )
     777#endif
    730778  { 
    731779#endif
     
    758806  {
    759807#if H_MV
     808#if H_MV_HLS10_MULTILAYERSPS
     809    if ( pcSPS->getMultiLayerExtSpsFlag() )
     810#else
    760811    if ( pcSPS->getLayerId() > 0 )
     812#endif
    761813    {   
    762814      WRITE_FLAG( pcSPS->getSpsInferScalingListFlag( ) ? 1 : 0 , "sps_infer_scaling_list_flag" );
     
    865917{
    866918  WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" );
    867 
     919#if !H_MV_HLS10_PPS
    868920  WRITE_UVLC( pcSPS->getNumScaledRefLayerOffsets( ), "num_scaled_ref_layer_offsets" );
    869921
     
    880932    WRITE_FLAG( 0, "sps_multilayer_ext_reserved_zero_flag[ j ]" );
    881933  }
     934#endif
    882935}
    883936#endif
     
    904957#if H_MV
    905958  WRITE_FLAG( pcVPS->getVpsBaseLayerInternalFlag( ) ? 1 : 0 , "vps_base_layer_internal_flag" );
     959#if H_MV_HLS10_GEN_VSP_BASE_LAYER_AVAIL
     960  WRITE_FLAG( pcVPS->getVpsBaseLayerAvailableFlag( ) ? 1 : 0 , "vps_base_layer_available_flag" );
     961#else // H_MV_HLS10_GEN
    906962  WRITE_FLAG( 1                                             , "vps_reserved_one_bit" );
     963#endif // H_MV_HLS10_GEN
    907964#else
    908965  WRITE_CODE( 3,                                    2,        "vps_reserved_three_2bits" );
     
    930987    }
    931988  }
    932 
    933989  assert( pcVPS->getNumHrdParameters() <= MAX_VPS_NUM_HRD_PARAMETERS );
    934990#if H_MV
    935991  assert( pcVPS->getVpsMaxLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
    936992  WRITE_CODE( pcVPS->getVpsMaxLayerId(), 6,                 "vps_max_layer_id" ); 
    937  
     993#if H_MV_HLS10_GEN_FIX
     994  WRITE_UVLC( pcVPS->getVpsNumLayerSetsMinus1(),  "vps_num_layer_sets_minus1" );
     995#else
    938996  WRITE_UVLC( pcVPS->getVpsNumLayerSetsMinus1(),  "vps_max_num_layer_sets_minus1" );
     997#endif
    939998  for( UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx ++ )
    940999  {
     
    10121071#if H_MV
    10131072Void TEncCavlc::codeVPSExtension( TComVPS *pcVPS )
    1014 
     1073{
     1074#if H_MV_HLS10_PTL
     1075  if( pcVPS->getMaxLayersMinus1() > 0  &&  pcVPS->getVpsBaseLayerInternalFlag() )
     1076  {
     1077    codePTL( pcVPS->getPTL( 1 ),0, pcVPS->getMaxSubLayersMinus1()  );
     1078  }
     1079#endif
     1080
    10151081  WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
    10161082
     
    10841150  }
    10851151
     1152#if H_MV_HLS10_ADD_LAYERSETS
     1153  if ( pcVPS->getNumIndependentLayers() > 1 )
     1154  {
     1155    WRITE_UVLC( pcVPS->getNumAddLayerSets( ), "num_add_layer_sets" );
     1156  }
     1157  for (Int i = 0; i < pcVPS->getNumAddLayerSets(); i++)
     1158  {
     1159    for (Int j = 1; j < pcVPS->getNumIndependentLayers(); j++)
     1160    {
     1161      WRITE_CODE( pcVPS->getHighestLayerIdxPlus1( i, j ), pcVPS->getHighestLayerIdxPlus1Len( j )  , "highest_layer_idx_plus1" );
     1162    }
     1163 
     1164  }
     1165#endif
     1166
     1167
    10861168  WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" );
    10871169  if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() )
     
    11191201  WRITE_UVLC( pcVPS->getVpsNumProfileTierLevelMinus1( ), "vps_num_profile_tier_level_minus1" );
    11201202
     1203#if H_MV_HLS10_PTL
     1204  Int offsetVal =  ( pcVPS->getMaxLayersMinus1() > 0  &&  pcVPS->getVpsBaseLayerInternalFlag() ) ? 2 : 1;   
     1205  for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 2 : 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
     1206  {
     1207    WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( i ) ? 1 : 0, "vps_profile_present_flag[i]" );
     1208    codePTL( pcVPS->getPTL( offsetVal ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
     1209    offsetVal++;
     1210  }
     1211#else
    11211212  for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
    11221213  {
     
    11241215    codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
    11251216  }
    1126 
     1217#endif
     1218
     1219#if !H_MV_HLS10_ADD_LAYERSETS
    11271220  if ( pcVPS->getNumIndependentLayers() > 1 )
    11281221  {
     
    11361229    }
    11371230  }
     1231#endif // H_MV_HLS10_GEN
     1232
    11381233  if (pcVPS->getNumLayerSets() > 1)
    11391234  {
     
    11691264      }
    11701265    }       
    1171 
    1172 
     1266       
     1267#if H_MV_HLS10_PTL
     1268    for ( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx(i)); j++ )
     1269    {   
     1270      if (pcVPS->getNecessaryLayerFlag( i, j ) && pcVPS->getVpsNumProfileTierLevelMinus1() > 0 )
     1271      {
     1272        WRITE_CODE( pcVPS->getProfileTierLevelIdx( i, j ), pcVPS->getProfileTierLevelIdxLen() ,"profile_tier_level_idx[ i ][ j ]" );   
     1273      }
     1274    }
     1275#else
    11731276    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
    11741277    {     
    11751278      WRITE_CODE( pcVPS->getProfileLevelTierIdx( i ), pcVPS->getProfileLevelTierIdxLen() ,"profile_level_tier_idx[ i ]" );   
    11761279    }
     1280#endif
    11771281    if( pcVPS->getNumOutputLayersInOutputLayerSet( i ) == 1 && pcVPS->getNumDirectRefLayers( pcVPS->getOlsHighestOutputLayerId( i ) ) > 0 )
    11781282    {
     
    12241328  }
    12251329
     1330#if !H_MV_HLS10_GEN_FIX
    12261331  WRITE_FLAG( 0, "vps_reserved_zero_flag" );
     1332#endif
    12271333  codeDpbSize( pcVPS );
    12281334
     
    13011407        for( Int k = 0; k < vps->getNumLayersInIdList( currLsIdx ); k++ )   
    13021408        {
     1409#if H_MV_HLS10_DBP_SIZE
     1410          if ( vps->getNecessaryLayerFlag( i, k ) && ( vps->getVpsBaseLayerInternalFlag() || ( vps->getLayerSetLayerIdList(vps->olsIdxToLsIdx(i),k) != 0 ) ))
     1411          {
     1412            WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" );
     1413          }
     1414          else
     1415          {
     1416            if ( vps->getNecessaryLayerFlag( i, k ) && ( j == 0 ) && ( k == 0 ) )
     1417            {
     1418              assert( dpbSize->getMaxVpsDecPicBufferingMinus1(i ,k, j ) ==  0 );
     1419            }
     1420          }
     1421#else
    13031422          WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" );
     1423#endif
    13041424        }
    13051425        WRITE_UVLC( dpbSize->getMaxVpsNumReorderPics( i, j ), "max_vps_num_reorder_pics" );
     
    13121432          for( Int k = 0; k < vps->getNumLayersInIdList( vps->olsIdxToLsIdx( i ) ); k++ )   
    13131433          {
    1314             assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
     1434#if H_MV_HLS10_DBP_SIZE
     1435            if ( vps->getNecessaryLayerFlag(i, k ) )
     1436            {           
     1437#endif
     1438              assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
     1439#if H_MV_HLS10_DBP_SIZE
     1440            }
     1441#endif 
    13151442          }
    13161443          assert( dpbSize->getMaxVpsNumReorderPics      ( i, j ) ==  dpbSize->getMaxVpsNumReorderPics      ( i, j - 1 ) );
     
    13471474    pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, true );
    13481475  }
     1476#if H_MV_HLS10_GEN_VSP_CONF_WIN
     1477  WRITE_FLAG( pcRepFormat->getConformanceWindowVpsFlag( ) ? 1 : 0 , "conformance_window_vps_flag" );
     1478  if ( pcRepFormat->getConformanceWindowVpsFlag() )
     1479  {   
     1480    WRITE_UVLC( pcRepFormat->getConfWinVpsLeftOffset( ), "conf_win_vps_left_offset" );
     1481    WRITE_UVLC( pcRepFormat->getConfWinVpsRightOffset( ), "conf_win_vps_right_offset" );
     1482    WRITE_UVLC( pcRepFormat->getConfWinVpsTopOffset( ), "conf_win_vps_top_offset" );
     1483    WRITE_UVLC( pcRepFormat->getConfWinVpsBottomOffset( ), "conf_win_vps_bottom_offset" );
     1484  }
     1485#endif
    13491486}
    13501487
     
    13711508  if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
    13721509  {
     1510#if H_MV_HLS10_VPS_VUI
     1511    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i < pcVPS->getNumLayerSets(); i++ )
     1512#else
    13731513    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
     1514#endif
    13741515    {
    13751516      for( Int j = 0; j  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ )
     
    14041545  else
    14051546  {
     1547#if H_MV_HLS10_VPS_VUI
     1548    assert( pcVPSVUI->getVpsNumVideoSignalInfoMinus1() == pcVPS->getMaxLayersMinus1() - ( pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1)  );
     1549#else
    14061550    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() );
     1551#endif
    14071552  }
    14081553
     
    14171562  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
    14181563  {
     1564#if H_MV_HLS10_VPS_VUI
     1565    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1566#else
    14191567    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     1568#endif
    14201569    {
    14211570      WRITE_CODE( pcVPSVUI->getVpsVideoSignalInfoIdx( i ), 4, "vps_video_signal_info_idx" );
     
    14451594      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
    14461595      { 
     1596#if H_MV_HLS10_REF_PRED_LAYERS
     1597        Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getIdRefLayer(pcVPS->getLayerIdInNuh( i ) , j  )); 
     1598#else
    14471599        Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j  )); 
     1600#endif
    14481601        if( pcVPSVUI->getTilesInUseFlag( i )  &&  pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 
    14491602        {
     
    14631616    }
    14641617  }
     1618#if H_MV_HLS10_VPS_VUI
     1619  WRITE_FLAG( pcVPSVUI->getSingleLayerForNonIrapFlag( ) ? 1 : 0 , "single_layer_for_non_irap_flag" );
     1620  WRITE_FLAG( pcVPSVUI->getHigherLayerIrapSkipFlag( ) ? 1 : 0 , "higher_layer_irap_skip_flag" );
     1621#else
    14651622  WRITE_CODE( 0, 3, "vps_vui_reserved_zero_3bits" );
     1623#endif
    14661624  WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" );
    14671625
     
    14721630      for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
    14731631      {
     1632#if H_MV_HLS10_REF_PRED_LAYERS
     1633        if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getIdRefLayer( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
     1634#else
    14741635        if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getRefLayerId( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
     1636#endif
    14751637        {       
    14761638          WRITE_UVLC( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ), "min_spatial_segment_offset_plus1" );
     
    15141676
    15151677  assert ( vpsVuiBspHrdP );
    1516 
    15171678 
     1679#if H_MV_HLS10_VPS_VUI_BSP
     1680  WRITE_UVLC( vpsVuiBspHrdP->getVpsNumAddHrdParams( ), "vps_num_add_hrd_params" );
     1681
     1682  for( Int i = pcVPS->getNumHrdParameters(); i < pcVPS->getNumHrdParameters() + vpsVuiBspHrdP->getVpsNumAddHrdParams(); i++ )
     1683  { 
     1684    if( i > 0 ) 
     1685    {
     1686      WRITE_FLAG( vpsVuiBspHrdP->getCprmsAddPresentFlag( i ) ? 1 : 0 , "cprms_add_present_flag" );
     1687    }
     1688    WRITE_UVLC( vpsVuiBspHrdP->getNumSubLayerHrdMinus1( i ), "num_sub_layer_hrd_minus1" );
     1689    TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i );
     1690    codeHrdParameters( hrdParameters, vpsVuiBspHrdP->getCprmsAddPresentFlag( i ), vpsVuiBspHrdP->getNumSubLayerHrdMinus1( i ) );     
     1691  }
     1692
     1693  for( Int h = 1; h < pcVPS->getNumOutputLayerSets(); h++ )
     1694  { 
     1695    WRITE_UVLC( vpsVuiBspHrdP->getNumSignalledPartitioningSchemes( h ), "num_signalled_partitioning_schemes" );
     1696
     1697    for( Int j = 1; j < vpsVuiBspHrdP->getNumSignalledPartitioningSchemes( h ) + 1; j++ )
     1698    { 
     1699      WRITE_UVLC( vpsVuiBspHrdP->getNumPartitionsInSchemeMinus1( h, j ), "num_partitions_in_scheme_minus1" );
     1700      for( Int k = 0; k  <=  vpsVuiBspHrdP->getNumPartitionsInSchemeMinus1( h, j ); k++ ) 
     1701      {
     1702        for( Int r = 0; r < pcVPS->getNumLayersInIdList(pcVPS->olsIdxToLsIdx( h ) )   ; r++ ) 
     1703        {
     1704          WRITE_FLAG( vpsVuiBspHrdP->getLayerIncludedInPartitionFlag( h, j, k, r ) ? 1 : 0 , "layer_included_in_partition_flag" );
     1705        }
     1706      }
     1707    } 
     1708    for( Int i = 0; i < vpsVuiBspHrdP->getNumSignalledPartitioningSchemes( h ) + 1; i++ ) 
     1709    {
     1710      for( Int t = 0; t  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( pcVPS->olsIdxToLsIdx( h ) ); t++ )
     1711      { 
     1712        WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedulesMinus1( h, i, t ), "num_bsp_schedules_minus1" );
     1713        for( Int j = 0; j  <=  vpsVuiBspHrdP->getNumBspSchedulesMinus1( h, i, t ); j++ ) 
     1714        {
     1715          for( Int k = 0; k  <=  vpsVuiBspHrdP->getNumPartitionsInSchemeMinus1( h, j ); k++ )
     1716          { 
     1717            WRITE_CODE( vpsVuiBspHrdP->getBspHrdIdx( h, i, t, j, k ), vpsVuiBspHrdP->getBspHrdIdxLen( pcVPS ), "bsp_hrd_idx" );
     1718            WRITE_UVLC( vpsVuiBspHrdP->getBspSchedIdx( h, i, t, j, k ), "bsp_sched_idx" );
     1719          } 
     1720        }
     1721      } 
     1722    }
     1723  } 
     1724
     1725#else // H_MV_HLS10_GEN
    15181726  WRITE_UVLC( vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ), "vps_num_bsp_hrd_parameters_minus1" );
    15191727  for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ )
     
    15521760      }
    15531761    } 
    1554   } 
     1762  }
     1763#endif 
    15551764
    1556 
    15571765#endif
    15581766
     
    23162524  WRITE_FLAG(ptl->getFrameOnlyConstraintFlag(), "general_frame_only_constraint_flag");
    23172525 
     2526#if H_MV_HLS10_PTL
     2527  if( ptl->getProfileIdc( ) ==  4 || ptl->getProfileCompatibilityFlag( 4 )  ||
     2528    ptl->getProfileIdc( ) ==  5 || ptl->getProfileCompatibilityFlag( 5 )  ||
     2529    ptl->getProfileIdc( ) ==  6 || ptl->getProfileCompatibilityFlag( 6 )  ||
     2530    ptl->getProfileIdc( ) ==  7 || ptl->getProfileCompatibilityFlag( 7 ) )
     2531  {
     2532    WRITE_FLAG( ptl->getMax12bitConstraintFlag( ) ? 1 : 0 , "max_12bit_constraint_flag" );
     2533    WRITE_FLAG( ptl->getMax10bitConstraintFlag( ) ? 1 : 0 , "max_10bit_constraint_flag" );
     2534    WRITE_FLAG( ptl->getMax8bitConstraintFlag( ) ? 1 : 0 , "max_8bit_constraint_flag" );
     2535    WRITE_FLAG( ptl->getMax422chromaConstraintFlag( ) ? 1 : 0 , "max_422chroma_constraint_flag" );
     2536    WRITE_FLAG( ptl->getMax420chromaConstraintFlag( ) ? 1 : 0 , "max_420chroma_constraint_flag" );
     2537    WRITE_FLAG( ptl->getMaxMonochromeConstraintFlag( ) ? 1 : 0 , "max_monochrome_constraint_flag" );
     2538    WRITE_FLAG( ptl->getIntraConstraintFlag( ) ? 1 : 0 , "intra_constraint_flag" );
     2539    WRITE_FLAG( ptl->getOnePictureOnlyConstraintFlag( ) ? 1 : 0 , "one_picture_only_constraint_flag" );
     2540    WRITE_FLAG( ptl->getLowerBitRateConstraintFlag( ) ? 1 : 0 , "lower_bit_rate_constraint_flag" );
     2541    WRITE_CODE( 0, 16, "XXX_reserved_zero_34bits[0..15]");
     2542    WRITE_CODE( 0, 16, "XXX_reserved_zero_34bits[16..31]");
     2543    WRITE_CODE( 0, 2 , "XXX_reserved_zero_34bits[32..33]");
     2544  }
     2545  else
     2546  {
     2547    WRITE_CODE( 0, 16, "XXX_reserved_zero_43bits[0..15]");
     2548    WRITE_CODE( 0, 16, "XXX_reserved_zero_43bits[16..31]");
     2549    WRITE_CODE( 0, 11, "XXX_reserved_zero_43bits[32..42]");
     2550  }
     2551  if( ( ptl->getProfileIdc() >= 1 && ptl->getProfileIdc() <= 5 )  ||
     2552    ptl->getProfileCompatibilityFlag( 1 ) || ptl->getProfileCompatibilityFlag( 2 )  ||
     2553    ptl->getProfileCompatibilityFlag( 3 ) || ptl->getProfileCompatibilityFlag( 4 )  ||
     2554    ptl->getProfileCompatibilityFlag( 5 ) )
     2555  {
     2556    WRITE_FLAG( ptl->getInbldFlag( ) ? 1 : 0 , "inbld_flag" );
     2557  }
     2558  else
     2559  {
     2560    WRITE_FLAG(0, "reserved_zero_bit");
     2561  }
     2562#else
    23182563  WRITE_CODE(0 , 16, "XXX_reserved_zero_44bits[0..15]");
    23192564  WRITE_CODE(0 , 16, "XXX_reserved_zero_44bits[16..31]");
    23202565  WRITE_CODE(0 , 12, "XXX_reserved_zero_44bits[32..43]");
    2321     }
     2566#endif
     2567}
    23222568
    23232569/**
  • branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncCavlc.h

    r1039 r1054  
    107107  Void  codePPS                 ( TComPPS* pcPPS );
    108108
     109#if H_MV_HLS10_PPS
     110#if H_MV
     111  Void codePPSMultilayerExtension( TComPPS* pcPPS )
     112  {   
     113    WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
     114    WRITE_FLAG( pcPPS->getPpsInferScalingListFlag( ) ? 1 : 0 , "pps_infer_scaling_list_flag" );
     115    WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" );
     116    WRITE_UVLC( 0, "num_ref_loc_offsets" );
     117  }
     118#endif
     119#endif
     120
    109121#if H_3D
    110122  Void  codePPSExtension        ( TComPPS* pcPPS );
  • branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncTop.cpp

    r1049 r1054  
    7272  ContextModel::buildNextStateTable();
    7373#endif
     74#if H_MV_HLS10_GEN_FIX
     75#if H_MV
     76  m_iNumSubstreams         = 0;
     77#endif
     78#endif
    7479
    7580  m_pcSbacCoders           = NULL;
     
    231236      for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ )
    232237      {
     238#if H_MV_HLS10_GEN_FIX
     239#if H_MV
     240        xDelete( false, m_pppcRDSbacCoder, iDepth, iCIIdx);
     241        xDelete( false, m_pppcBinCoderCABAC, iDepth, iCIIdx);
     242#else
    233243        delete m_pppcRDSbacCoder[iDepth][iCIIdx];
    234244        delete m_pppcBinCoderCABAC[iDepth][iCIIdx];
     245#endif
     246#endif
    235247      }
    236248    }
     
    238250    for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
    239251    {
     252#if H_MV_HLS10_GEN_FIX
     253#if H_MV
     254      xDelete( true, m_pppcRDSbacCoder  , iDepth);
     255      xDelete( true, m_pppcBinCoderCABAC, iDepth);
     256#else
    240257      delete [] m_pppcRDSbacCoder[iDepth];
    241258      delete [] m_pppcBinCoderCABAC[iDepth];
    242     }
    243    
     259#endif
     260#endif
     261    }
     262
     263#if H_MV_HLS10_GEN_FIX
     264#if H_MV
     265     xDelete( true, m_pppcRDSbacCoder  );
     266     xDelete( true, m_pppcBinCoderCABAC);
     267#else
    244268    delete [] m_pppcRDSbacCoder;
    245269    delete [] m_pppcBinCoderCABAC;
    246 
     270#endif
     271#endif
    247272    for ( UInt ui = 0; ui < m_iNumSubstreams; ui++ )
    248273    {
     
    251276        for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ )
    252277        {
     278#if H_MV_HLS10_GEN_FIX
     279#if H_MV
     280          xDelete(false, m_ppppcRDSbacCoders  ,ui, iDepth, iCIIdx);
     281          xDelete(false, m_ppppcBinCodersCABAC,ui, iDepth, iCIIdx);
     282#else
    253283          delete m_ppppcRDSbacCoders  [ui][iDepth][iCIIdx];
    254284          delete m_ppppcBinCodersCABAC[ui][iDepth][iCIIdx];
     285#endif
     286#endif
    255287        }
    256288      }
     
    258290      for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
    259291      {
     292#if H_MV_HLS10_GEN_FIX
     293#if H_MV
     294        xDelete(true, m_ppppcRDSbacCoders  ,ui, iDepth);
     295        xDelete(true, m_ppppcBinCodersCABAC,ui, iDepth);       
     296#else
    260297        delete [] m_ppppcRDSbacCoders  [ui][iDepth];
    261298        delete [] m_ppppcBinCodersCABAC[ui][iDepth];
    262       }
     299#endif
     300#endif
     301      }
     302
     303
     304#if H_MV_HLS10_GEN_FIX
     305#if H_MV
     306      xDelete(true, m_ppppcRDSbacCoders,   ui);
     307      xDelete(true, m_ppppcBinCodersCABAC, ui);     
     308#else
    263309      delete[] m_ppppcRDSbacCoders  [ui];
    264310      delete[] m_ppppcBinCodersCABAC[ui];
    265     }
     311#endif
     312#endif
     313    }
     314#if H_MV_HLS10_GEN_FIX
     315#if H_MV
     316    xDelete(true, m_ppppcRDSbacCoders    ) ;
     317    xDelete(true, m_ppppcBinCodersCABAC);
     318    xDelete(true, m_pcSbacCoders);
     319    xDelete(true, m_pcBinCoderCABACs);
     320    xDelete(true, m_pcRDGoOnSbacCoders); 
     321    xDelete(true, m_pcRDGoOnBinCodersCABAC);
     322    xDelete(true, m_pcBitCounters);
     323    xDelete(true, m_pcRdCosts);
     324#else
    266325    delete[] m_ppppcRDSbacCoders;
    267326    delete[] m_ppppcBinCodersCABAC;
     
    272331  delete[] m_pcBitCounters;
    273332  delete[] m_pcRdCosts;
    274  
     333#endif
     334#endif
     335
    275336#if !H_MV
    276337    // destroy ROM
     
    708769#if H_MV 
    709770  m_cSPS.setUpdateRepFormatFlag           ( false );   
     771#if H_MV_HLS10_MULTILAYERSPS 
     772  Bool multiLayerExtensionFlag  = ( getLayerId() > 0 ) && ( m_cVPS->getNumRefLayers( getLayerId() ) > 0 );
     773 
     774  m_cSPS.setSpsExtOrMaxSubLayersMinus1( multiLayerExtensionFlag ? 7 : m_maxTempLayer - 1 );
     775  if ( multiLayerExtensionFlag )
     776  {
     777    m_cSPS.setSpsInferScalingListFlag   ( true );
     778    m_cSPS.setSpsScalingListRefLayerId( m_cVPS->getIdRefLayer( getLayerId(), 0 ) );
     779  }
     780#else
    710781  m_cSPS.setSpsInferScalingListFlag       ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) );
    711782  m_cSPS.setSpsScalingListRefLayerId      ( 0              );
    712   m_cSPS.setSpsExtensionPresentFlag              ( true );
     783#endif
     784  m_cSPS.setSpsExtensionPresentFlag       ( true );
    713785  m_cSPS.setSpsMultilayerExtensionFlag    ( true );
    714786#if H_3D
     
    791863    for( Int is = 0; is < targetDecLayerIdList.size(); is++  )
    792864    {
     865#if H_MV_HLS10_ADD_LAYERSETS
     866      if ( m_cVPS->getNecessaryLayerFlag( ols, is ) )
     867      {     
     868        m_cSPS.inferSpsMaxDecPicBufferingMinus1( m_cVPS, ols, targetDecLayerIdList[is], true );       
     869      }
     870#else
    793871      m_cSPS.inferSpsMaxDecPicBufferingMinus1( m_cVPS, ols, targetDecLayerIdList[is], true );       
    794     }
    795   }
    796 
     872#endif
     873    }
     874  }
     875#if !H_MV_HLS10_ADD_LAYERSETS
    797876  m_cVPS->inferDbpSizeLayerSetZero( &m_cSPS, true );
     877#endif
    798878#endif
    799879  m_cSPS.setPCMBitDepthLuma (g_uiPCMBitDepthLuma);
  • branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncTop.h

    r1049 r1054  
    150150  Void  xInitPPSforTiles  ();
    151151  Void  xInitRPS          (Bool isFieldCoding);           ///< initialize PPS from encoder options
    152 
     152#if H_MV_HLS10_GEN_FIX
     153#if H_MV
     154
     155  template <class T>     Void  xDelete( Bool ar, T inArray )
     156  {
     157    if( inArray != NULL)
     158    {
     159      if ( ar )
     160      {     
     161        delete[] inArray;
     162      }
     163      else
     164      {
     165        delete inArray;
     166      }
     167    }
     168  }
     169
     170  template <class T>     Void  xDelete( Bool ar, T inArray, Int idx1 )
     171  {
     172    if( inArray != NULL)
     173    {
     174        xDelete( ar, inArray[idx1]);
     175    }
     176  }
     177
     178  template <class T>     Void  xDelete( Bool ar, T inArray, Int idx1, Int idx2 )
     179  {
     180    if( inArray != NULL )
     181    {
     182      xDelete( ar, inArray[idx1], idx2 );
     183    }
     184  }
     185
     186  template <class T>     Void  xDelete( Bool ar, T inArray, Int idx1, Int idx2, Int idx3 )
     187  {
     188    if( inArray != NULL )
     189    {
     190      xDelete( ar, inArray[idx1], idx2, idx3 );
     191    }
     192  }
     193
     194#endif
     195#endif
    153196public:
    154197  TEncTop();
Note: See TracChangeset for help on using the changeset viewer.