Changeset 588 in SHVCSoftware for trunk/source


Ignore:
Timestamp:
1 Feb 2014, 23:50:54 (11 years ago)
Author:
seregin
Message:

merge with SHM-5.0-dev

Location:
trunk
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • trunk/source/App/TAppDecoder/TAppDecCfg.cpp

    r547 r588  
    148148#endif
    149149#if OUTPUT_LAYER_SET_INDEX 
    150   this->getCommonDecoderParams()->setOutputLayerSetIdx( olsIdx       );
     150  this->getCommonDecoderParams()->setTargetOutputLayerSetIdx( olsIdx       );
    151151  this->getCommonDecoderParams()->setTargetLayerId    ( m_tgtLayerId );
    152152#endif
  • trunk/source/App/TAppDecoder/TAppDecTop.cpp

    r540 r588  
    8181  }
    8282#if SVC_EXTENSION
    83   for( Int i = 0; i < m_tgtLayerId; i++ )
     83  for( Int i = 0; i <= m_tgtLayerId; i++ )
    8484  {
    8585    if( m_pchReconFile[i] )
  • trunk/source/App/TAppEncoder/TAppEncCfg.cpp

    r547 r588  
    8080  {
    8181    m_acLayerCfg[layer].setAppEncCfg(this);
    82 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    83     m_ilSampleOnlyPred[layer] = 0;
    84 #endif
    8582  }
    8683  memset( m_scalabilityMask, 0, sizeof(m_scalabilityMask) );
     
    146143{
    147144#if VPS_EXTN_DIRECT_REF_LAYERS
    148 #if M0457_PREDICTION_INDICATIONS
    149145  for(Int layer = 0; layer < MAX_LAYERS; layer++)
    150146  {
     
    152148    {
    153149      delete [] m_acLayerCfg[layer].m_samplePredRefLayerIds;
    154     }
    155   }
    156   for(Int layer = 0; layer < MAX_LAYERS; layer++)
    157   {
     150      m_acLayerCfg[layer].m_samplePredRefLayerIds = NULL;
     151    }
    158152    if( m_acLayerCfg[layer].m_numMotionPredRefLayers > 0 )
    159153    {
    160154      delete [] m_acLayerCfg[layer].m_motionPredRefLayerIds;
    161     }
    162   }
    163 #else
    164   for(Int layer = 0; layer < MAX_LAYERS; layer++)
    165   {
    166     if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 )
    167     {
    168       delete [] m_acLayerCfg[layer].m_refLayerIds;
    169     }
    170   }
    171 #endif
    172   for(Int layer = 0; layer < MAX_LAYERS; layer++)
    173   {
     155      m_acLayerCfg[layer].m_motionPredRefLayerIds = NULL;
     156    }
    174157    if( m_acLayerCfg[layer].m_numActiveRefLayers > 0 )
    175158    {
    176159      delete [] m_acLayerCfg[layer].m_predLayerIds;
     160      m_acLayerCfg[layer].m_predLayerIds = NULL;
    177161    }
    178162  }
     
    383367#endif
    384368#if VPS_EXTN_DIRECT_REF_LAYERS
    385 #if M0457_PREDICTION_INDICATIONS
    386369  Int*    cfg_numSamplePredRefLayers  [MAX_LAYERS];
    387370  string  cfg_samplePredRefLayerIds   [MAX_LAYERS];
     
    390373  string  cfg_motionPredRefLayerIds   [MAX_LAYERS];
    391374  string* cfg_motionPredRefLayerIdsPtr[MAX_LAYERS];
    392 #else
    393   Int*    cfg_numDirectRefLayers [MAX_LAYERS];
    394   string  cfg_refLayerIds        [MAX_LAYERS];
    395   string* cfg_refLayerIdsPtr     [MAX_LAYERS];
    396 #endif
    397375  Int*    cfg_numActiveRefLayers [MAX_LAYERS];
    398376  string  cfg_predLayerIds       [MAX_LAYERS];
     
    462440#endif
    463441#if VPS_EXTN_DIRECT_REF_LAYERS
    464 #if M0457_PREDICTION_INDICATIONS
    465442    cfg_numSamplePredRefLayers  [layer] = &m_acLayerCfg[layer].m_numSamplePredRefLayers;
    466443    cfg_samplePredRefLayerIdsPtr[layer] = &cfg_samplePredRefLayerIds[layer];
    467444    cfg_numMotionPredRefLayers  [layer] = &m_acLayerCfg[layer].m_numMotionPredRefLayers;
    468445    cfg_motionPredRefLayerIdsPtr[layer] = &cfg_motionPredRefLayerIds[layer];
    469 #else
    470     cfg_numDirectRefLayers  [layer] = &m_acLayerCfg[layer].m_numDirectRefLayers;
    471     cfg_refLayerIdsPtr      [layer]  = &cfg_refLayerIds[layer];
    472 #endif
    473446    cfg_numActiveRefLayers  [layer] = &m_acLayerCfg[layer].m_numActiveRefLayers;
    474447    cfg_predLayerIdsPtr     [layer]  = &cfg_predLayerIds[layer];
     
    551524#endif
    552525#if VPS_EXTN_DIRECT_REF_LAYERS
    553 #if M0457_PREDICTION_INDICATIONS
    554526  ("NumSamplePredRefLayers%d",cfg_numSamplePredRefLayers, -1, MAX_LAYERS, "Number of sample prediction reference layers")
    555527  ("SamplePredRefLayerIds%d", cfg_samplePredRefLayerIdsPtr, string(""), MAX_LAYERS, "sample pred reference layer IDs")
    556528  ("NumMotionPredRefLayers%d",cfg_numMotionPredRefLayers, -1, MAX_LAYERS, "Number of motion prediction reference layers")
    557529  ("MotionPredRefLayerIds%d", cfg_motionPredRefLayerIdsPtr, string(""), MAX_LAYERS, "motion pred reference layer IDs")
    558 #else
    559   ("NumDirectRefLayers%d",    cfg_numDirectRefLayers, -1, MAX_LAYERS, "Number of direct reference layers")
    560   ("RefLayerIds%d",           cfg_refLayerIdsPtr, string(""), MAX_LAYERS, "direct reference layer IDs")
    561 #endif
    562530  ("NumActiveRefLayers%d",    cfg_numActiveRefLayers, -1, MAX_LAYERS, "Number of active reference layers")
    563531  ("PredLayerIds%d",          cfg_predLayerIdsPtr, string(""), MAX_LAYERS, "inter-layer prediction layer IDs")
     
    619587#endif
    620588#if N0147_IRAP_ALIGN_FLAG
    621     ("CrossLayerIrapAlignFlag", m_crossLayerIrapAlignFlag, true, "align IRAP across layers" ) 
     589  ("CrossLayerIrapAlignFlag", m_crossLayerIrapAlignFlag, true, "align IRAP across layers" ) 
     590#endif
     591#if O0194_WEIGHTED_PREDICTION_CGS
     592  ("InterLayerWeightedPred", m_useInterLayerWeightedPred, false, "enable IL WP parameters estimation at encoder" ) 
    622593#endif
    623594#if AVC_BASE
     
    629600#endif
    630601  ("EnableElRapB,-use-rap-b",  m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture)")
    631 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    632   ("IlSampleOnlyPred%d",       m_ilSampleOnlyPred, 0, MAX_LAYERS, "Set inter_layer_sample_pred_only_flag for all slices")
    633 #endif
    634602#else //SVC_EXTENSION
    635603  ("InputFile,i",           cfg_InputFile,     string(""), "Original YUV input file name")
     
    956924  ("SEIGradualDecodingRefreshInfo",  m_gradualDecodingRefreshInfoEnabled,      0, "Control generation of gradual decoding refresh information SEI message")
    957925  ("SEIDecodingUnitInfo",             m_decodingUnitInfoSEIEnabled,                       0, "Control generation of decoding unit information SEI message.")
    958 #if M0043_LAYERS_PRESENT_SEI
    959   ("SEILayersPresent",               m_layersPresentSEIEnabled,                0, "Control generation of layers present SEI message")
     926#if LAYERS_NOT_PRESENT_SEI
     927  ("SEILayersNotPresent",            m_layersNotPresentSEIEnabled,             0, "Control generation of layers not present SEI message")
    960928#endif
    961929  ("SEISOPDescription",              m_SOPDescriptionSEIEnabled,              0, "Control generation of SOP description SEI messages")
     
    11901158  }
    11911159#if VPS_EXTN_DIRECT_REF_LAYERS
    1192 #if M0457_PREDICTION_INDICATIONS
    11931160  for(Int layer = 0; layer < MAX_LAYERS; layer++)
    11941161  {
     
    12531220    }
    12541221  }
    1255 #else
    1256   for(Int layer = 0; layer < MAX_LAYERS; layer++)
    1257   {
    1258     Char* pRefLayerIds = cfg_refLayerIds[layer].empty() ? NULL: strdup(cfg_refLayerIds[layer].c_str());
    1259     if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 )
    1260     {
    1261       char *refLayerId;
    1262       int  i=0;
    1263       m_acLayerCfg[layer].m_refLayerIds = new Int[m_acLayerCfg[layer].m_numDirectRefLayers];
    1264       refLayerId = strtok(pRefLayerIds, " ,-");
    1265       while(refLayerId != NULL)
    1266       {
    1267         if( i >= m_acLayerCfg[layer].m_numDirectRefLayers )
    1268         {
    1269           printf( "NumDirectRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" );
    1270           exit( EXIT_FAILURE );
    1271         }
    1272         *( m_acLayerCfg[layer].m_refLayerIds + i ) = atoi( refLayerId );
    1273         refLayerId = strtok(NULL, " ,-");
    1274         i++;
    1275       }
    1276       if( i < m_acLayerCfg[layer].m_numDirectRefLayers )
    1277       {
    1278         printf( "NumDirectRefLayers: The width of some columns is not defined.\n" );
    1279         exit( EXIT_FAILURE );
    1280       }
    1281     }
    1282     else
    1283     {
    1284       m_acLayerCfg[layer].m_refLayerIds = NULL;
    1285     }
    1286   }
    1287 #endif
     1222
    12881223#if AUXILIARY_PICTURES
    12891224  for(UInt layer = 0; layer < MAX_LAYERS; layer++)
     
    22312166  }
    22322167#if VPS_EXTN_DIRECT_REF_LAYERS
    2233 #if M0457_PREDICTION_INDICATIONS
    22342168  xConfirmPara( (m_acLayerCfg[0].m_numSamplePredRefLayers != 0) && (m_acLayerCfg[0].m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" );
    22352169  // NOTE: m_numSamplePredRefLayers  (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference
     
    22542188    }
    22552189  }
    2256 #else
    2257   xConfirmPara( (m_acLayerCfg[0].m_numDirectRefLayers != 0) && (m_acLayerCfg[0].m_numDirectRefLayers != -1), "Layer 0 cannot have any reference layers" );
    2258   // NOTE: m_numDirectRefLayers  (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference
    2259   for(Int layer = 1; layer < MAX_LAYERS; layer++)
    2260   {
    2261     xConfirmPara(m_acLayerCfg[layer].m_numDirectRefLayers > layer, "Cannot reference more layers than before current layer");
    2262     for(Int i = 0; i < m_acLayerCfg[layer].m_numDirectRefLayers; i++)
    2263     {
    2264       xConfirmPara(m_acLayerCfg[layer].m_refLayerIds[i] > layer, "Cannot reference higher layers");
    2265       xConfirmPara(m_acLayerCfg[layer].m_refLayerIds[i] == layer, "Cannot reference the current layer itself");
    2266     }
    2267   }
    2268 #endif
     2190
    22692191  xConfirmPara( (m_acLayerCfg[0].m_numActiveRefLayers != 0) && (m_acLayerCfg[0].m_numActiveRefLayers != -1), "Layer 0 cannot have any active reference layers" );
    22702192  // NOTE: m_numActiveRefLayers  (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference
    22712193  for(Int layer = 1; layer < MAX_LAYERS; layer++)
    22722194  {
    2273 #if M0457_PREDICTION_INDICATIONS
    22742195    Bool predEnabledFlag[MAX_LAYERS];
    22752196    for (Int refLayer = 0; refLayer < layer; refLayer++)
     
    22952216      xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] >= numDirectRefLayers, "Cannot reference higher layers");
    22962217    }
    2297 #else
    2298     xConfirmPara(m_acLayerCfg[layer].m_numActiveRefLayers > m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers");
    2299     for(Int i = 0; i < m_acLayerCfg[layer].m_numActiveRefLayers; i++)
    2300     {
    2301       xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] >= m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference higher layers");
    2302     }
    2303 #endif
    2304   }
    2305 #endif
     2218  }
     2219#endif //VPS_EXTN_DIRECT_REF_LAYERS
    23062220#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    23072221  if (m_adaptiveResolutionChange > 0)
     
    24352349#if N0147_IRAP_ALIGN_FLAG
    24362350  printf("Cross layer IRAP alignment    : %d\n", m_crossLayerIrapAlignFlag );
     2351#endif
     2352#if O0194_WEIGHTED_PREDICTION_CGS
     2353  printf("InterLayerWeightedPred        : %d\n", m_useInterLayerWeightedPred );
    24372354#endif
    24382355  for(UInt layer=0; layer<m_numLayers; layer++)
     
    25812498  printf("O0194_DIFFERENT_BITDEPTH_EL_BL: %d ", O0194_DIFFERENT_BITDEPTH_EL_BL);
    25822499  printf("O0194_JOINT_US_BITSHIFT: %d ", O0194_JOINT_US_BITSHIFT);
    2583   printf("O0194_WEIGHTED_PREDICTION_CGS: %d ",O0194_WEIGHTED_PREDICTION_CGS);
    25842500#else
    25852501  printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 );
  • trunk/source/App/TAppEncoder/TAppEncCfg.h

    r540 r588  
    7272#if AVC_SYNTAX
    7373  Char*     m_BLSyntaxFile;                                   ///< input syntax file
    74 #endif
    75 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    76   Int       m_ilSampleOnlyPred[ MAX_LAYERS ];
    7774#endif
    7875#if N0120_MAX_TID_REF_CFG
     
    283280  Int       m_gradualDecodingRefreshInfoEnabled;
    284281  Int       m_decodingUnitInfoSEIEnabled;
    285 #if M0043_LAYERS_PRESENT_SEI
    286   Int       m_layersPresentSEIEnabled;
     282#if LAYERS_NOT_PRESENT_SEI
     283  Int       m_layersNotPresentSEIEnabled;
    287284#endif
    288285  Int       m_SOPDescriptionSEIEnabled;
     
    384381#endif
    385382#if O0215_PHASE_ALIGNMENT
    386   Bool m_phaseAlignFlag;
     383  Bool      m_phaseAlignFlag;
    387384#endif
    388385#if O0223_PICTURE_TYPES_ALIGN_FLAG
    389   Bool m_crossLayerPictureTypeAlignFlag;
     386  Bool      m_crossLayerPictureTypeAlignFlag;
    390387#endif
    391388#if N0147_IRAP_ALIGN_FLAG
    392   Bool m_crossLayerIrapAlignFlag;
     389  Bool      m_crossLayerIrapAlignFlag;
    393390#endif
    394391#if O0149_CROSS_LAYER_BLA_FLAG
    395   bool      m_crossLayerBLAFlag;
     392  Bool      m_crossLayerBLAFlag;
     393#endif
     394#if O0194_WEIGHTED_PREDICTION_CGS
     395  Bool      m_useInterLayerWeightedPred;
    396396#endif
    397397public:
  • trunk/source/App/TAppEncoder/TAppEncLayerCfg.h

    r540 r588  
    4848#endif
    4949#if VPS_EXTN_DIRECT_REF_LAYERS
    50 #if M0457_PREDICTION_INDICATIONS
    5150  Int       *m_samplePredRefLayerIds;
    5251  Int       m_numSamplePredRefLayers;
    5352  Int       *m_motionPredRefLayerIds;
    5453  Int       m_numMotionPredRefLayers;
    55 #else
    56   Int       *m_refLayerIds;
    57   Int       m_numDirectRefLayers;
    58 #endif
    5954  Int       *m_predLayerIds;
    6055  Int       m_numActiveRefLayers;
     
    153148  Int*    getdQPs()                   {return m_aidQP;            }
    154149#if VPS_EXTN_DIRECT_REF_LAYERS
    155 #if M0457_PREDICTION_INDICATIONS
    156150  Int     getNumSamplePredRefLayers()    {return m_numSamplePredRefLayers;   }
    157151  Int*    getSamplePredRefLayerIds()     {return m_samplePredRefLayerIds;    }
     
    160154  Int*    getMotionPredRefLayerIds()     {return m_motionPredRefLayerIds;    }
    161155  Int     getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; }
    162 #else
    163   Int     getNumDirectRefLayers()     {return m_numDirectRefLayers;}
    164   Int*    getRefLayerIds()            {return m_refLayerIds;      }
    165   Int     getRefLayerId(Int i)        {return m_refLayerIds[i];   }
    166 #endif
    167156
    168157  Int     getNumActiveRefLayers()     {return m_numActiveRefLayers;}
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r547 r588  
    177177  delete [] mapIdxToLayer;
    178178#endif
     179
    179180  for(UInt layer=0; layer<m_numLayers; layer++)
    180181  {
     
    190191    g_bitDepthYLayer[layer] = g_bitDepthY;
    191192    g_bitDepthCLayer[layer] = g_bitDepthC;
     193
     194#if O0194_WEIGHTED_PREDICTION_CGS
     195    m_acTEncTop[layer].setInterLayerWeightedPredFlag( m_useInterLayerWeightedPred );
     196#endif
    192197#endif
    193198    //m_acTEncTop[layer].setVPS(&vps);
     
    209214#if REF_IDX_MFM
    210215#if AVC_BASE
    211 #if M0457_PREDICTION_INDICATIONS
    212216    m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_avcBaseLayerFlag ? AVC_SYNTAX : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers());
    213217#else
    214     m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_avcBaseLayerFlag ? AVC_SYNTAX : true ));
    215 #endif
    216 #else
    217 #if M0457_PREDICTION_INDICATIONS
    218218    m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_acLayerCfg[layer].getNumMotionPredRefLayers() > 0 ) );
    219 #else
    220     m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : true);
    221 #endif
    222 #endif
    223 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    224     m_acTEncTop[layer].setIlSampleOnlyPred( layer == 0 ? 0 : m_ilSampleOnlyPred[layer] );
    225219#endif
    226220#endif
     
    261255    if(layer)
    262256    {
    263 #if M0457_PREDICTION_INDICATIONS
    264257      for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++)
    265258      {
     
    309302      }
    310303      m_acTEncTop[layer].setNumDirectRefLayers(numDirectRefLayers);
    311 #else
    312       if(m_acLayerCfg[layer].getNumDirectRefLayers() == -1)
    313       {
    314         // Not included in the configuration file; assume that each layer depends on previous layer
    315         m_acTEncTop[layer].setNumDirectRefLayers       (1);      // One ref. layer
    316         m_acTEncTop[layer].setRefLayerId               (0, layer - 1);   // Previous layer
    317       }
    318       else
    319       {
    320         m_acTEncTop[layer].setNumDirectRefLayers       ( m_acLayerCfg[layer].getNumDirectRefLayers() );
    321         for(Int i = 0; i < m_acTEncTop[layer].getNumDirectRefLayers(); i++)
    322         {
    323           m_acTEncTop[layer].setRefLayerId             ( i, m_acLayerCfg[layer].getRefLayerId(i));
    324         }
    325       }
    326 #endif
     304
    327305      if(m_acLayerCfg[layer].getNumActiveRefLayers() == -1)
    328306      {
    329 #if M0457_PREDICTION_INDICATIONS
    330307        m_acTEncTop[layer].setNumActiveRefLayers( m_acTEncTop[layer].getNumDirectRefLayers() );
    331 #else
    332         m_acTEncTop[layer].setNumActiveRefLayers( m_acLayerCfg[layer].getNumDirectRefLayers() );
    333 #endif
    334308        for( Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++ )
    335309        {
     
    346320      }
    347321    }
    348 #endif
     322#endif //VPS_EXTN_DIRECT_REF_LAYERS
    349323    //===== Slice ========
    350324
     
    426400    m_acTEncTop[layer].setWPBiPred                ( m_useWeightedBiPred   );
    427401#if O0194_WEIGHTED_PREDICTION_CGS
    428     if (layer!=0)
     402    if( layer != 0 && m_useInterLayerWeightedPred )
    429403    {
    430404      // Enable weighted prediction for enhancement layer
     
    514488    m_acTEncTop[layer].setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled );
    515489    m_acTEncTop[layer].setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled );
    516 #if M0043_LAYERS_PRESENT_SEI
    517     m_acTEncTop[layer].setLayersPresentSEIEnabled( m_layersPresentSEIEnabled );
     490#if LAYERS_NOT_PRESENT_SEI
     491    m_acTEncTop[layer].setLayersNotPresentSEIEnabled( m_layersNotPresentSEIEnabled );
    518492#endif
    519493    m_acTEncTop[layer].setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled );
     
    828802  m_cTEncTop.setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled );
    829803  m_cTEncTop.setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled );
    830 #if M0043_LAYERS_PRESENT_SEI
    831   m_cTEncTop.setLayersPresentSEIEnabled( m_layersPresentSEIEnabled );
     804#if LAYERS_NOT_PRESENT_SEI
     805  m_cTEncTop.setLayersNotPresentSEIEnabled( m_layersNotPresentSEIEnabled );
    832806#endif
    833807  m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled );
     
    11711145  vps->setNumOutputLayerSets(vps->getNumLayerSets());
    11721146  vps->setNumProfileTierLevel(vps->getNumLayerSets());
     1147#if P0295_DEFAULT_OUT_LAYER_IDC
     1148  vps->setDefaultTargetOutputLayerIdc(1);
     1149#else
    11731150#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
    11741151  vps->setDefaultOneTargetOutputLayerIdc(1);
    11751152#else
    11761153  vps->setDefaultOneTargetOutputLayerFlag(true);
     1154#endif
    11771155#endif
    11781156  for(i = 1; i < vps->getNumLayerSets(); i++)
     
    11991177  vps->deriveLayerIdListVariables();
    12001178#endif
     1179#if RESOLUTION_BASED_DPB
     1180  vps->assignSubDpbIndices();
     1181#else
    12011182  vps->deriveNumberOfSubDpbs();
     1183#endif
    12021184  // Initialize dpb_size_table() for all ouput layer sets in the VPS extension
    12031185  for(i = 1; i < vps->getNumOutputLayerSets(); i++)
    12041186  {
     1187#if CHANGE_NUMSUBDPB_IDX
     1188    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i );
     1189#endif
    12051190    Int layerSetId = vps->getOutputLayerSetIdx(i);
    12061191
    1207     // For each output layer set, set the DPB size for each layer and the reorder/latency value the maximum for all layers
    1208     Bool checkFlagOuter = false;      // Used to calculate sub_layer_flag_info_present_flag
    1209     Bool checkFlagInner[MAX_TLAYER];  // Used to calculate sub_layer_dpb_info_present_flag
    1210 
    12111192    for(Int j = 0; j < vps->getMaxTLayers(); j++)
    12121193    {
    12131194
    12141195      Int maxNumReorderPics = -1;
     1196#if CHANGE_NUMSUBDPB_IDX
     1197#if RESOLUTION_BASED_DPB
     1198      for(Int k = 0; k < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); k++)
     1199#else
     1200      for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++)
     1201#endif
     1202#else
    12151203      for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
     1204#endif
    12161205      {
    12171206        Int layerId = vps->getLayerSetLayerIdList(layerSetId, k); // k-th layer in the output layer set
     1207#if RESOLUTION_BASED_DPB
     1208        vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 );
     1209        // Add sub-DPB sizes of layers belonging to a sub-DPB. If a different sub-DPB size is calculated
     1210        // at the encoder, modify below
     1211        Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j );
     1212        oldValue += vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j );
     1213        vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue );
     1214#else
    12181215        vps->setMaxVpsDecPicBufferingMinus1( i, k, j,  m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 );
     1216#endif
    12191217        maxNumReorderPics       = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j));
    12201218      }
    12211219      vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics);
    1222      
    1223       if( j == 0 )  // checkFlagInner[0] is always 1
    1224       {
    1225         checkFlagInner[j] = true;     // Always signal sub-layer DPB information for the first sub-layer
    1226       }
    1227       else
    1228       {
    1229         checkFlagInner[j] = false;    // Initialize to be false. If the values of the current sub-layers matches with the earlier sub-layer,
    1230                                       // then will be continue to be false - i.e. the j-th sub-layer DPB info is not signaled
    1231         checkFlagInner[j] |= ( maxNumReorderPics != vps->getMaxVpsNumReorderPics(i, j - 1) );
    1232         for(Int k = 0; k < vps->getNumSubDpbs(i) && !checkFlagInner[j]; k++)  // If checkFlagInner[j] is true, break and signal the values
    1233         {
    1234           checkFlagInner[j] |= ( vps->getMaxVpsDecPicBufferingMinus1(i, k, j - 1) != vps->getMaxVpsDecPicBufferingMinus1(i, k, j) );
    1235         }
    1236       }
    1237       // If checkFlagInner[j] = true, then some value needs to be signalled for the j-th sub-layer
    1238       vps->setSubLayerDpbInfoPresentFlag( i, j, checkFlagInner[j] );
    1239     }
    1240     for(Int j = 1; j < vps->getMaxTLayers(); j++) // Check if DPB info of any of non-zero sub-layers is signaled. If so set flag to one
    1241     {
    1242       if( vps->getSubLayerDpbInfoPresentFlag(i, j) )
    1243       {
    1244         checkFlagOuter = true;
    1245         break;
    1246       }
    1247     }
    1248     vps->setSubLayerFlagInfoPresentFlag( i, checkFlagOuter );
     1220      vps->determineSubDpbInfoFlags();
     1221    }
    12491222  }
    12501223#endif
     
    12741247      vps->setDirectDependencyFlag( layerCtr, vps->getLayerIdInVps(m_acTEncTop[layerCtr].getRefLayerId(i)), true);
    12751248    }
    1276 #if M0457_PREDICTION_INDICATIONS
     1249    // prediction indications
    12771250    vps->setDirectDepTypeLen(2); // sample and motion types are encoded
    12781251    for(Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)
     
    13011274      }
    13021275    }
    1303 #endif
    13041276  }
    13051277
     
    13181290#endif
    13191291#endif
    1320 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    13211292    vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true);
    1322 #endif
    13231293#if O0062_POC_LSB_NOT_PRESENT_FLAG
    13241294    for(i = 1; i< vps->getMaxLayers(); i++)
     
    13611331  vps->setHigherLayerIrapSkipFlag(m_skipPictureAtArcSwitch);
    13621332#endif
     1333#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
    13631334#if !VPS_EXTN_OFFSET_CALC
    13641335#if VPS_EXTN_OFFSET
    13651336  // to be updated according to the current semantics
    13661337  vps->setExtensionOffset( 0xffff );
     1338#endif
    13671339#endif
    13681340#endif
     
    16531625    if(iTotalNumEncoded)
    16541626    {
     1627#if P0130_EOB
     1628      if( bEos )
     1629      {
     1630        OutputNALUnit nalu(NAL_UNIT_EOB);
     1631        nalu.m_layerId = 0;
     1632
     1633        AccessUnit& accessUnit = outputAccessUnits.back();
     1634        nalu.m_temporalId = accessUnit.front()->m_temporalId;
     1635        accessUnit.push_back(new NALUnitEBSP(nalu));
     1636      }
     1637#endif
    16551638      xWriteStream(bitstreamFile, iTotalNumEncoded, outputAccessUnits);
    16561639      outputAccessUnits.clear();
  • trunk/source/Lib/TLibCommon/CommonDef.h

    r540 r588  
    5757#if SVC_EXTENSION
    5858#include <vector>
    59 #define NV_VERSION        "4.1"                 ///< Current software version
     59#define NV_VERSION        "5.0 (HM-12.1)"                 ///< Current software version
    6060#else
    6161#define NV_VERSION        "12.1"                ///< Current software version
     
    284284{
    285285  Int m_targetLayerId;
    286   Int m_outputLayerSetIdx;
     286  Int m_targetOutputLayerSetIdx;
    287287  std::vector<Int> *m_targetDecLayerIdSet;
    288288  Bool m_valueCheckedFlag;
     
    290290  CommonDecoderParams():
    291291    m_targetLayerId(0)
    292     , m_outputLayerSetIdx(-1)
     292    , m_targetOutputLayerSetIdx(-1)
    293293    , m_targetDecLayerIdSet(NULL)
    294294    , m_valueCheckedFlag(false)
     
    298298  Int  getTargetLayerId()            { return m_targetLayerId;}
    299299 
    300   Void setOutputLayerSetIdx(const Int x) { m_outputLayerSetIdx = x;   }
    301   Int  getOutputLayerSetIdx()            { return m_outputLayerSetIdx;}
     300  Void setTargetOutputLayerSetIdx(const Int x) { m_targetOutputLayerSetIdx = x;   }
     301  Int  getTargetOutputLayerSetIdx()            { return m_targetOutputLayerSetIdx;}
    302302
    303303  Void               setTargetDecLayerIdSet(std::vector<Int> *x) { m_targetDecLayerIdSet = x;   }
  • trunk/source/Lib/TLibCommon/SEI.cpp

    r313 r588  
    4141//Table D-7 Meaning of camera iso sensitivity indicator and exposure index rating indicator
    4242Int  Table_exp_indicator[32] = {0, 10, 12, 16, 20, 25, 32, 40, 50, 64, 80, 100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 8000, -1};
     43
     44#if SUB_BITSTREAM_PROPERTY_SEI
     45SEISubBitstreamProperty::SEISubBitstreamProperty()
     46{
     47  m_activeVpsId             = -1;
     48  m_numAdditionalSubStreams = 0;
     49  ::memset(m_subBitstreamMode       , 0, sizeof(m_subBitstreamMode));
     50  ::memset(m_outputLayerSetIdxToVps , 0, sizeof(m_outputLayerSetIdxToVps));
     51  ::memset(m_highestSublayerId      , 0, sizeof(m_highestSublayerId));
     52  ::memset(m_avgBitRate             , 0, sizeof(m_avgBitRate));
     53  ::memset(m_maxBitRate             , 0, sizeof(m_maxBitRate));
     54}
     55#endif
    4356
    4457SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
  • trunk/source/Lib/TLibCommon/SEI.h

    r442 r588  
    7272    SCALABLE_NESTING                     = 133,
    7373    REGION_REFRESH_INFO                  = 134,
    74 #if M0043_LAYERS_PRESENT_SEI
    75     LAYERS_PRESENT                       = 137,
     74#if LAYERS_NOT_PRESENT_SEI
     75    LAYERS_NOT_PRESENT                   = 137,
    7676#endif
    7777#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
    7878    INTER_LAYER_CONSTRAINED_TILE_SETS    = 138
     79#endif
     80#if SUB_BITSTREAM_PROPERTY_SEI
     81   ,SUB_BITSTREAM_PROPERTY               = 139    // Final PayloadType to be defined after finalization
    7982#endif
    8083  };
     
    319322};
    320323
    321 #if M0043_LAYERS_PRESENT_SEI
    322 class SEILayersPresent : public SEI
    323 {
    324 public:
    325   PayloadType payloadType() const { return LAYERS_PRESENT; }
    326 
    327   SEILayersPresent() {}
    328   virtual ~SEILayersPresent() {}
     324#if LAYERS_NOT_PRESENT_SEI
     325class SEILayersNotPresent : public SEI
     326{
     327public:
     328  PayloadType payloadType() const { return LAYERS_NOT_PRESENT; }
     329
     330  SEILayersNotPresent() {}
     331  virtual ~SEILayersNotPresent() {}
    329332
    330333  UInt m_activeVpsId;
    331334  UInt m_vpsMaxLayers;
    332   Bool m_layerPresentFlag[MAX_LAYERS];
     335  Bool m_layerNotPresentFlag[MAX_LAYERS];
    333336};
    334337#endif
     
    407410#endif
    408411
     412#if SUB_BITSTREAM_PROPERTY_SEI
     413class SEISubBitstreamProperty : public SEI
     414{
     415public:
     416  PayloadType payloadType() const { return SUB_BITSTREAM_PROPERTY; }
     417
     418  SEISubBitstreamProperty();
     419  virtual ~SEISubBitstreamProperty() {}
     420
     421  Int  m_activeVpsId;
     422  Int  m_numAdditionalSubStreams;
     423  Int  m_subBitstreamMode       [MAX_SUB_STREAMS];
     424  Int  m_outputLayerSetIdxToVps [MAX_SUB_STREAMS];
     425  Int  m_highestSublayerId      [MAX_SUB_STREAMS];
     426  Int  m_avgBitRate             [MAX_SUB_STREAMS];
     427  Int  m_maxBitRate             [MAX_SUB_STREAMS];
     428};
     429#endif
    409430
    410431typedef std::list<SEI*> SEIMessages;
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r540 r588  
    34383438
    34393439  // use coldir.
    3440 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    3441   TComPic *pColPic;
    3442   if (m_layerId > 0 && getSlice()->getAltColIndicationFlag())
    3443   {
    3444     pColPic = getSlice()->getMotionPredIlp();
    3445   }
    3446   else
    3447   {
    3448     pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx());
    3449   }
    3450 #else
    34513440  TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx());
    3452 #endif
    34533441  TComDataCU *pColCU = pColPic->getCU( uiCUAddr );
    34543442  if(pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE)
  • trunk/source/Lib/TLibCommon/TComRom.cpp

    r540 r588  
    530530Int g_mvScalingFactor  [MAX_LAYERS][2] = {{0,0}, {0,0}};
    531531Int g_posScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}};
     532
     533std::string NaluToStr( NalUnitType nalu )
     534{
     535  switch( nalu )
     536  {
     537  case NAL_UNIT_CODED_SLICE_TRAIL_N:
     538  case NAL_UNIT_CODED_SLICE_TRAIL_R:
     539    return "TRAIL";
     540 
     541  case NAL_UNIT_CODED_SLICE_TSA_N:
     542  case NAL_UNIT_CODED_SLICE_TSA_R:
     543    return "  TSA";
     544 
     545  case NAL_UNIT_CODED_SLICE_STSA_N:
     546  case NAL_UNIT_CODED_SLICE_STSA_R:
     547    return " STSA";
     548
     549  case NAL_UNIT_CODED_SLICE_RADL_N:
     550  case NAL_UNIT_CODED_SLICE_RADL_R:
     551    return " RADL";
     552 
     553  case NAL_UNIT_CODED_SLICE_RASL_N:
     554  case NAL_UNIT_CODED_SLICE_RASL_R:
     555    return " RASL";
     556
     557  case NAL_UNIT_CODED_SLICE_BLA_W_LP:
     558  case NAL_UNIT_CODED_SLICE_BLA_W_RADL:
     559  case NAL_UNIT_CODED_SLICE_BLA_N_LP:
     560    return "  BLA";
     561
     562  case NAL_UNIT_CODED_SLICE_IDR_W_RADL:
     563  case NAL_UNIT_CODED_SLICE_IDR_N_LP:
     564    return "  IDR";
     565 
     566  case NAL_UNIT_CODED_SLICE_CRA:
     567    return "  CRA";
     568
     569  default:
     570    return "     ";
     571  };
     572}
    532573#endif
    533574
  • trunk/source/Lib/TLibCommon/TComRom.h

    r540 r588  
    288288#if SVC_EXTENSION
    289289extern Int g_mvScalingFactor  [MAX_LAYERS][2];
    290 extern Int g_posScalingFactor [MAX_LAYERS][2];
     290extern Int g_posScalingFactor [MAX_LAYERS][2];
     291std::string NaluToStr( NalUnitType nalu );
    291292#endif
    292293
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r547 r588  
    117117#if SVC_EXTENSION
    118118  memset( m_pcBaseColPic, 0, sizeof( m_pcBaseColPic ) );
    119 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    120119  m_activeNumILRRefIdx        = 0;
    121120  m_interLayerPredEnabledFlag = 0;
    122121  ::memset( m_interLayerPredLayerIdc, 0, sizeof(m_interLayerPredLayerIdc) );
    123 #else
    124   m_numILRRefIdx = 0;
    125 #endif
    126 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    127   m_altColIndicationFlag = false;
    128   m_colRefLayerIdx       = 0;
    129 #endif
    130 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    131   m_numSamplePredRefLayers       = 0;
    132   m_interLayerSamplePredOnlyFlag = false;
    133 #endif
    134122#endif //SVC_EXTENSION
    135123
     
    175163#if SVC_EXTENSION
    176164  m_layerId = layerId;
    177 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    178165  m_activeNumILRRefIdx        = 0;
    179166  m_interLayerPredEnabledFlag = 0;
    180 #else
    181   m_numILRRefIdx              = 0;
    182 #endif
    183 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    184   m_numSamplePredRefLayers       = 0;
    185   m_interLayerSamplePredOnlyFlag = false;
    186 #endif
    187167#endif
    188168  m_aiNumRefIdx[0]      = 0;
     
    410390      pcRefPic->getPicYuvRec()->extendPicBorder();
    411391      RefPicSetStCurr0[NumPocStCurr0] = pcRefPic;
    412 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    413       if( !m_interLayerSamplePredOnlyFlag || pcRefPic->getLayerId() < getLayerId())
    414 #endif
    415392      NumPocStCurr0++;
    416393      pcRefPic->setCheckLTMSBPresent(false); 
     
    426403      pcRefPic->getPicYuvRec()->extendPicBorder();
    427404      RefPicSetStCurr1[NumPocStCurr1] = pcRefPic;
    428 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    429       if( !m_interLayerSamplePredOnlyFlag || pcRefPic->getLayerId() < getLayerId())
    430 #endif
    431405      NumPocStCurr1++;
    432406      pcRefPic->setCheckLTMSBPresent(false); 
     
    442416      pcRefPic->getPicYuvRec()->extendPicBorder();
    443417      RefPicSetLtCurr[NumPocLtCurr] = pcRefPic;
    444 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    445       if( !m_interLayerSamplePredOnlyFlag || pcRefPic->getLayerId() < getLayerId())
    446 #endif
    447418      NumPocLtCurr++;
    448419    }
     
    470441    {
    471442#if REF_IDX_MFM
    472 #if M0457_COL_PICTURE_SIGNALING
    473443      if(!(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) && getMFMEnabledFlag())
    474 #else
    475       if(!(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) && m_pcSPS->getMFMEnabledFlag())
    476 #endif
    477444      {
    478445        ilpPic[refLayerIdc]->copyUpsampledMvField( refLayerIdc, m_pcBaseColPic[refLayerIdc] );
     
    508475      {
    509476        numInterLayerRPSPics++;
    510       }
    511     }
    512 #if JCTVC_M0458_INTERLAYER_RPS_SIG
     477#if DISCARDABLE_PIC_RPS
     478        assert( ilpPic[i]->getSlice(0)->getDiscardableFlag() == 0 );    // Inter-layer RPS shall not contain picture with discardable_flag = 1.
     479#endif
     480      }
     481    }
    513482    if (numInterLayerRPSPics < m_activeNumILRRefIdx)
    514483    {
     
    589558#endif
    590559    }
    591 #endif
    592 #else
    593     if (numInterLayerRPSPics < m_numILRRefIdx)
    594     {
    595       m_numILRRefIdx = numInterLayerRPSPics;
    596     }
    597 #endif
    598   }
    599 #if JCTVC_M0458_INTERLAYER_RPS_SIG
     560#endif
     561  }
    600562  Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + m_activeNumILRRefIdx;
    601 #else
    602   Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + m_numILRRefIdx;
    603 #endif
    604563#else //SVC_EXTENSION
    605564  Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;
     
    609568  {
    610569    // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:
    611 #if ILP_RAP    // inter-layer prediction is allowed for BLA, CRA pictures of nuh_layer_id>0
     570#if SVC_EXTENSION    // inter-layer prediction is allowed for BLA, CRA pictures of nuh_layer_id>0
    612571    // – If the current picture is a BLA or CRA picture with nuh_layer_id equal to 0, the value of NumPocTotalCurr shall be equal to 0.
    613572    // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
     
    623582
    624583    if (m_eSliceType == I_SLICE)
    625   {
     584    {
    626585      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
    627586      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
    628      
     587
    629588      return;
    630589    }
    631    
     590
    632591    assert(numPocTotalCurr > 0);
    633    
     592
    634593    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
    635594    m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
    636595  }
    637596
    638 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    639     if( m_interLayerSamplePredOnlyFlag && getLayerId() )
    640     {
    641       m_aiNumRefIdx[0] = m_aiNumRefIdx[0] > m_activeNumILRRefIdx ? m_activeNumILRRefIdx : m_aiNumRefIdx[0];
    642       m_aiNumRefIdx[1] = m_aiNumRefIdx[1] > m_activeNumILRRefIdx ? m_activeNumILRRefIdx : m_aiNumRefIdx[1];
    643     }
    644 #endif
    645  
    646597    Int cIdx = 0;
    647598    for ( i=0; i<NumPocStCurr0; i++, cIdx++)
     
    653604    if( m_layerId > 0 )
    654605    {     
    655 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    656606      for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++)     
    657 #else
    658       for( i = 0; i < m_numILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++)
    659 #endif
    660607      {
    661608        Int refLayerIdc = m_interLayerPredLayerIdc[i];
     
    685632    if( m_layerId > 0 )
    686633    {
    687 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    688634      for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++)     
    689 #else
    690       for( i = 0; i < m_numILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++)
    691 #endif
    692635      {
    693636        Int refLayerIdc = m_interLayerPredLayerIdc[i];
     
    726669    if( m_layerId > 0 )
    727670    {
    728 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    729671      for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++)
    730 #else
    731       for( i = 0; i < m_numILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++)
    732 #endif
    733672      {
    734673        Int refLayerIdc = m_interLayerPredLayerIdc[i];
     
    832771    else
    833772    {
    834 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    835773      for(Int i = m_activeNumILRRefIdx; i > 0; i-- )
    836 #else
    837       for(Int i = m_numILRRefIdx; i > 0; i-- )
    838 #endif
    839774      {
    840775#if RPL_INIT_N0316_N0082
     
    881816    else
    882817    {
    883 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    884818      for(Int i = m_activeNumILRRefIdx; i > 0; i-- )
    885 #else
    886       for(Int i = m_numILRRefIdx; i > 0; i-- )
    887 #endif
    888819      {
    889820        refPicListModification->setRefPicSetIdxL1(m_aiNumRefIdx[REF_PIC_LIST_1] - i, numberOfRpsCurrTempList - i);
     
    927858  {
    928859#if SVC_EXTENSION
    929 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    930860    return m_activeNumILRRefIdx;
    931 #else
    932     return getNumILRRefIdx();
    933 #endif
    934861#else
    935862    return 0;
     
    946873  if( m_layerId > 0 )
    947874  {
    948 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    949875    numRpsCurrTempList += m_activeNumILRRefIdx;
    950 #else
    951     numRpsCurrTempList += getNumILRRefIdx();
    952 #endif
    953876}
    954877#endif
     
    11791102  m_pcVPS                = pSrc->m_pcVPS;
    11801103  m_layerId              = pSrc->m_layerId;
    1181 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    11821104  m_activeNumILRRefIdx         = pSrc->m_activeNumILRRefIdx;
    11831105  m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
    11841106  memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) );
    1185 #endif
    11861107#endif
    11871108  m_pcSPS                = pSrc->m_pcSPS;
     
    15081429
    15091430    }
     1431#if DISCARDABLE_PIC_RPS
     1432    if( isReference ) // Current picture is in the temporal RPS
     1433    {
     1434      assert( rpcPic->getSlice(0)->getDiscardableFlag() == 0 ); // Temporal RPS shall not contain picture with discardable_flag equal to 1
     1435    }
     1436#endif
    15101437    // mark the picture as "unused for reference" if it is not in
    15111438    // the Reference Picture Set
     
    20101937, m_bitDepthVpsChroma           (0)
    20111938{}
     1939#if RESOLUTION_BASED_DPB
     1940Void RepFormat::init()
     1941{
     1942  m_chromaFormatVpsIdc          = CHROMA_420;
     1943  m_separateColourPlaneVpsFlag  = false;
     1944  m_picWidthVpsInLumaSamples    = 0;
     1945  m_picHeightVpsInLumaSamples   = 0;
     1946  m_bitDepthVpsLuma             = 0;
     1947  m_bitDepthVpsChroma           = 0;
     1948}
     1949#endif
    20121950#endif
    20131951
     
    20361974#endif
    20371975, m_numProfileTierLevel       (0)
     1976#if !VPS_EXTN_UEV_CODING
    20381977, m_moreOutputLayerSetsThanDefaultFlag (false)
     1978#endif
    20391979, m_numAddOutputLayerSets     (0)
     1980#if P0295_DEFAULT_OUT_LAYER_IDC
     1981, m_defaultTargetOutputLayerIdc     (0)
     1982#else
    20401983#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
    20411984, m_defaultOneTargetOutputLayerIdc     (0)
    20421985#else
    20431986, m_defaultOneTargetOutputLayerFlag    (false)
     1987#endif
    20441988#endif
    20451989#if VPS_VUI_BITRATE_PICRATE
     
    20582002#endif
    20592003#endif
     2004#if !P0307_REMOVE_VPS_VUI_OFFSET
    20602005#if VPS_VUI_OFFSET
    20612006, m_vpsVuiOffset (0)
     2007#endif
     2008#endif
     2009#if P0307_VPS_NON_VUI_EXTENSION
     2010, m_vpsNonVuiExtLength (0)
    20622011#endif
    20632012{
     
    20822031#if VPS_EXTN_PROFILE_INFO
    20832032  ::memset(m_profilePresentFlag, 0, sizeof(m_profilePresentFlag));
     2033#if !P0048_REMOVE_PROFILE_REF
    20842034  ::memset(m_profileLayerSetRef, 0, sizeof(m_profileLayerSetRef));
     2035#endif
    20852036#endif
    20862037#if VPS_EXTN_OP_LAYER_SETS
     
    20942045  ::memset(m_numDirectRefLayers,   0, sizeof(m_numDirectRefLayers  ));
    20952046  ::memset(m_refLayerId,           0, sizeof(m_refLayerId          ));
    2096 #if M0457_PREDICTION_INDICATIONS
    20972047  m_directDepTypeLen = 2;
    20982048  ::memset(m_directDependencyType, 0, sizeof(m_directDependencyType));
    2099 #endif
    21002049#endif
    21012050#if DERIVE_LAYER_ID_LIST_VARIABLES
     
    21042053#endif
    21052054  ::memset(m_profileLevelTierIdx,  0, sizeof(m_profileLevelTierIdx));
    2106 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    21072055  m_maxOneActiveRefLayerFlag = true;
    2108 #endif
    21092056#if O0062_POC_LSB_NOT_PRESENT_FLAG
    21102057  ::memset(m_pocLsbNotPresentFlag, 0, sizeof(m_pocLsbNotPresentFlag));
     
    21162063  m_crossLayerIrapAlignFlag = true;
    21172064#endif
    2118 #if JCTVC_M0203_INTERLAYER_PRED_IDC
    21192065#if N0120_MAX_TID_REF_PRESENT_FLAG
    21202066  m_maxTidRefPresentFlag = true;
     
    21232069  {
    21242070#if O0225_MAX_TID_FOR_REF_LAYERS
    2125   for( Int j = 0; j < MAX_VPS_LAYER_ID_PLUS1; j++)
    2126   {
    2127     m_maxTidIlRefPicsPlus1[i][j] = m_uiMaxTLayers + 1;
    2128   }
     2071    for( Int j = 0; j < MAX_VPS_LAYER_ID_PLUS1; j++)
     2072    {
     2073      m_maxTidIlRefPicsPlus1[i][j] = m_uiMaxTLayers + 1;
     2074    }
    21292075#else
    21302076    m_maxTidIlRefPicsPlus1[i] = m_uiMaxTLayers + 1;
    21312077#endif
    21322078  }
    2133 #endif
    21342079#if VPS_VUI_TILES_NOT_IN_USE__FLAG
    2135    m_tilesNotInUseFlag = true;
    2136    ::memset(m_tilesInUseFlag,  0, sizeof(m_tilesInUseFlag));
    2137    ::memset(m_loopFilterNotAcrossTilesFlag,  0, sizeof(m_loopFilterNotAcrossTilesFlag));
     2080  m_tilesNotInUseFlag = true;
     2081  ::memset(m_tilesInUseFlag,  0, sizeof(m_tilesInUseFlag));
     2082  ::memset(m_loopFilterNotAcrossTilesFlag,  0, sizeof(m_loopFilterNotAcrossTilesFlag));
    21382083#endif
    21392084#if TILE_BOUNDARY_ALIGNED_FLAG
    2140    ::memset(m_tileBoundariesAlignedFlag,  0, sizeof(m_tileBoundariesAlignedFlag));
     2085  ::memset(m_tileBoundariesAlignedFlag,  0, sizeof(m_tileBoundariesAlignedFlag));
    21412086#endif
    21422087#if VPS_VUI_WPP_NOT_IN_USE__FLAG
    2143    m_wppNotInUseFlag = true;
    2144    ::memset(m_wppInUseFlag,  0, sizeof(m_wppInUseFlag));
     2088  m_wppNotInUseFlag = true;
     2089  ::memset(m_wppInUseFlag,  0, sizeof(m_wppInUseFlag));
    21452090#endif
    21462091#if N0160_VUI_EXT_ILP_REF
    2147    m_numIlpRestrictedRefLayers = false;
    2148    ::memset(m_minSpatialSegmentOffsetPlus1,  0, sizeof(m_minSpatialSegmentOffsetPlus1));
    2149    ::memset(m_ctuBasedOffsetEnabledFlag,     0, sizeof(m_ctuBasedOffsetEnabledFlag));
    2150    ::memset(m_minHorizontalCtuOffsetPlus1,   0, sizeof(m_minHorizontalCtuOffsetPlus1));
     2092  m_ilpRestrictedRefLayersFlag = false;
     2093  ::memset(m_minSpatialSegmentOffsetPlus1,  0, sizeof(m_minSpatialSegmentOffsetPlus1));
     2094  ::memset(m_ctuBasedOffsetEnabledFlag,     0, sizeof(m_ctuBasedOffsetEnabledFlag));
     2095  ::memset(m_minHorizontalCtuOffsetPlus1,   0, sizeof(m_minHorizontalCtuOffsetPlus1));
    21512096#endif
    21522097#if VPS_VUI_VIDEO_SIGNAL
    2153     m_vidSigPresentVpsFlag=true;
    2154     m_vpsVidSigInfo=1;
    2155     ::memset( m_vpsVidSigIdx, 0, sizeof(m_vpsVidSigIdx) );
    2156     m_vpsVidSigIdx[0]=0;
    2157     for (Int i=0; i < 16; i++)
    2158     {
    2159       m_vpsVidFormat[i] = 5;
    2160       m_vpsFullRangeFlag[i] = false;
    2161       m_vpsColorPrimaries[i] = 2;
    2162       m_vpsTransChar[i] = 2;
    2163       m_vpsMatCoeff[i] = 2;
    2164     }
     2098  m_vidSigPresentVpsFlag=true;
     2099  m_vpsVidSigInfo=1;
     2100  ::memset( m_vpsVidSigIdx, 0, sizeof(m_vpsVidSigIdx) );
     2101  m_vpsVidSigIdx[0]=0;
     2102  for (Int i=0; i < 16; i++)
     2103  {
     2104    m_vpsVidFormat[i] = 5;
     2105    m_vpsFullRangeFlag[i] = false;
     2106    m_vpsColorPrimaries[i] = 2;
     2107    m_vpsTransChar[i] = 2;
     2108    m_vpsMatCoeff[i] = 2;
     2109  }
    21652110#endif
    21662111#if VPS_VUI_BITRATE_PICRATE 
     
    21922137  ::memset( m_subLayerDpbInfoPresentFlag,   0, sizeof(m_subLayerDpbInfoPresentFlag )  );
    21932138  ::memset( m_maxVpsDecPicBufferingMinus1,  0, sizeof(m_maxVpsDecPicBufferingMinus1 ) );
     2139#if RESOLUTION_BASED_DPB
     2140  ::memset( m_maxVpsLayerDecPicBuffMinus1,  0, sizeof(m_maxVpsLayerDecPicBuffMinus1 ) );
     2141#endif
    21942142  ::memset( m_maxVpsNumReorderPics,         0, sizeof(m_maxVpsNumReorderPics )        );
    21952143  ::memset( m_maxVpsLatencyIncreasePlus1,   0, sizeof(m_maxVpsLatencyIncreasePlus1 )  );
     
    22482196}
    22492197#endif
     2198#if !RESOLUTION_BASED_DPB
    22502199#if VPS_DPB_SIZE_TABLE
    22512200Void TComVPS::deriveNumberOfSubDpbs()
    22522201{
    22532202  // Derive number of sub-DPBs
     2203#if CHANGE_NUMSUBDPB_IDX
     2204  // For layer set 0
     2205  setNumSubDpbs(0, 1);
     2206  // For other layer sets
     2207  for( Int i = 1; i < getNumLayerSets(); i++)
     2208  {
     2209    setNumSubDpbs( i, getNumLayersInIdList( i ) );
     2210  }
     2211#else
    22542212  // For output layer set 0
    22552213  setNumSubDpbs(0, 1);
     
    22592217    setNumSubDpbs( i, getNumLayersInIdList( getOutputLayerSetIdx(i)) );
    22602218  }
    2261 }
     2219#endif
     2220}
     2221#endif
    22622222#endif
    22632223#if VPS_VUI_TILES_NOT_IN_USE__FLAG
     
    23582318
    23592319  return scalIdx;
     2320}
     2321#endif
     2322#if VPS_DPB_SIZE_TABLE
     2323Void TComVPS::determineSubDpbInfoFlags()
     2324{
     2325  for(Int i = 1; i < getNumOutputLayerSets(); i++)
     2326  {
     2327    Int layerSetIdxForOutputLayerSet = getOutputLayerSetIdx( i );
     2328    // For each output layer set, set the DPB size for each layer and the reorder/latency value the maximum for all layers
     2329    Bool checkFlagOuter = false;      // Used to calculate sub_layer_flag_info_present_flag
     2330    Bool checkFlagInner[MAX_TLAYER];  // Used to calculate sub_layer_dpb_info_present_flag
     2331
     2332    for(Int j = 0; j < getMaxTLayers(); j++)
     2333    {
     2334      // --------------------------------------------------------
     2335      // To determine value of m_subLayerDpbInfoPresentFlag
     2336      // --------------------------------------------------------
     2337      if( j == 0 )  // checkFlagInner[0] is always 1
     2338      {
     2339        checkFlagInner[j] = true;     // Always signal sub-layer DPB information for the first sub-layer
     2340      }
     2341      else
     2342      {
     2343        checkFlagInner[j] = false;    // Initialize to be false. If the values of the current sub-layers matches with the earlier sub-layer,
     2344                                      // then will be continue to be false - i.e. the j-th sub-layer DPB info is not signaled
     2345        checkFlagInner[j] |= ( getMaxVpsNumReorderPics(i, j) != getMaxVpsNumReorderPics(i, j - 1) );
     2346#if CHANGE_NUMSUBDPB_IDX
     2347        for(Int subDpbIdx = 0; subDpbIdx < getNumSubDpbs(layerSetIdxForOutputLayerSet) && !checkFlagInner[j]; subDpbIdx++)  // If checkFlagInner[j] is true, break and signal the values
     2348#else
     2349        for(Int k = 0; k < getNumSubDpbs(i) && !checkFlagInner[j]; k++)  // If checkFlagInner[j] is true, break and signal the values
     2350#endif
     2351        {
     2352          checkFlagInner[j] |= ( getMaxVpsDecPicBufferingMinus1(i, subDpbIdx, j - 1) != getMaxVpsDecPicBufferingMinus1(i, subDpbIdx, j) );
     2353        }
     2354#if RESOLUTION_BASED_DPB
     2355        for(Int layerIdx = 0; layerIdx < this->getNumLayersInIdList(layerSetIdxForOutputLayerSet) && !checkFlagInner[j]; layerIdx++)  // If checkFlagInner[j] is true, break and signal the values
     2356        {
     2357          checkFlagInner[j] |= ( getMaxVpsLayerDecPicBuffMinus1(i, layerIdx, j - 1) != getMaxVpsLayerDecPicBuffMinus1(i, layerIdx, j) );
     2358        }
     2359#endif
     2360      }
     2361      // If checkFlagInner[j] = true, then some value needs to be signalled for the j-th sub-layer
     2362      setSubLayerDpbInfoPresentFlag( i, j, checkFlagInner[j] );
     2363    }
     2364
     2365    // --------------------------------------------------------
     2366    // To determine value of m_subLayerFlagInfoPresentFlag
     2367    // --------------------------------------------------------
     2368
     2369    for(Int j = 1; j < getMaxTLayers(); j++) // Check if DPB info of any of non-zero sub-layers is signaled. If so set flag to one
     2370    {
     2371      if( getSubLayerDpbInfoPresentFlag(i, j) )
     2372      {
     2373        checkFlagOuter = true;
     2374        break;
     2375      }
     2376    }
     2377    setSubLayerFlagInfoPresentFlag( i, checkFlagOuter );
     2378  }
     2379}
     2380#endif
     2381#if RESOLUTION_BASED_DPB
     2382Void TComVPS::assignSubDpbIndices()
     2383{
     2384  RepFormat layerRepFormat  [MAX_LAYERS];
     2385  RepFormat subDpbRepFormat [MAX_LAYERS];
     2386
     2387  for(Int lsIdx = 0; lsIdx < this->getNumLayerSets(); lsIdx++)
     2388  {
     2389    for(Int j = 0; j < MAX_LAYERS; j++)
     2390    {
     2391      layerRepFormat [j].init();
     2392      subDpbRepFormat[j].init();
     2393    }
     2394
     2395    // Assign resolution, bit-depth, colour format for each layer in the layer set
     2396    for(Int i = 0; i < this->getNumLayersInIdList( lsIdx ); i++)
     2397    {
     2398      Int layerIdxInVps = this->getLayerIdInVps( this->getLayerSetLayerIdList(lsIdx, i) );
     2399      Int repFormatIdx  = this->getVpsRepFormatIdx( layerIdxInVps );
     2400      RepFormat* repFormat = this->getVpsRepFormat( repFormatIdx );
     2401
     2402      // Assign the rep_format() to the layer
     2403      layerRepFormat[i] = *repFormat;
     2404    }
     2405
     2406    // ----------------------------------------
     2407    // Sub-DPB assignment
     2408    // ----------------------------------------
     2409    // For the base layer
     2410    m_subDpbAssigned[lsIdx][0] = 0;
     2411    subDpbRepFormat[0] = layerRepFormat[0];
     2412
     2413    // Sub-DPB counter
     2414    Int subDpbCtr = 1;
     2415
     2416    for(Int i = 1; i < this->getNumLayersInIdList( lsIdx ); i++)
     2417    {
     2418      Bool newSubDpbFlag = true;
     2419      for(Int j = 0; (j < subDpbCtr) && (newSubDpbFlag); j++)
     2420      {
     2421        if( RepFormat::checkSameSubDpb( layerRepFormat[i], subDpbRepFormat[j] ) )
     2422        {
     2423          // Belong to i-th sub-DPB
     2424          m_subDpbAssigned[lsIdx][i] = j;
     2425          newSubDpbFlag = false;
     2426        }
     2427      }
     2428      if( newSubDpbFlag )
     2429      {
     2430        // New sub-DPB
     2431        subDpbRepFormat[subDpbCtr] = layerRepFormat[i];
     2432        m_subDpbAssigned[lsIdx][i] = subDpbCtr;
     2433        subDpbCtr++;                                    // Increment # subDpbs
     2434      }
     2435    }
     2436    m_numSubDpbs[lsIdx] = subDpbCtr;
     2437  }
     2438}
     2439Int  TComVPS::findLayerIdxInLayerSet ( Int lsIdx, Int nuhLayerId )
     2440{
     2441  for(Int i = 0; i < this->getNumLayersInIdList(lsIdx); i++)
     2442  {
     2443    if( this->getLayerSetLayerIdList( lsIdx, i) == nuhLayerId )
     2444    {
     2445      return i;
     2446    }
     2447  }
     2448  return -1;  // Layer not found
     2449}
     2450// RepFormat Assignment operator
     2451RepFormat& RepFormat::operator= (const RepFormat &other)
     2452{
     2453  if( this != &other)
     2454  {
     2455    m_chromaAndBitDepthVpsPresentFlag = other.m_chromaAndBitDepthVpsPresentFlag;
     2456    m_chromaFormatVpsIdc              = other.m_chromaFormatVpsIdc;
     2457    m_separateColourPlaneVpsFlag      = other.m_separateColourPlaneVpsFlag;
     2458    m_picWidthVpsInLumaSamples        = other.m_picWidthVpsInLumaSamples;
     2459    m_picHeightVpsInLumaSamples       = other.m_picHeightVpsInLumaSamples;
     2460    m_bitDepthVpsLuma                 = other.m_bitDepthVpsLuma;
     2461    m_bitDepthVpsChroma               = other.m_bitDepthVpsChroma;
     2462  }
     2463  return *this;
     2464}
     2465
     2466// Check whether x and y share the same resolution, chroma format and bit-depth.
     2467Bool RepFormat::checkSameSubDpb(const RepFormat &x, const RepFormat &y)
     2468{
     2469  return (    (x.m_chromaFormatVpsIdc              == y.m_chromaFormatVpsIdc)
     2470          &&  (x.m_picWidthVpsInLumaSamples        == y.m_picWidthVpsInLumaSamples)
     2471          &&  (x.m_picHeightVpsInLumaSamples       == y.m_picHeightVpsInLumaSamples)
     2472          &&  (x.m_bitDepthVpsLuma                 == y.m_bitDepthVpsLuma)
     2473          &&  (x.m_bitDepthVpsChroma               == y.m_bitDepthVpsChroma)
     2474          );
    23602475}
    23612476#endif
     
    24042519, m_vuiParameters             ()
    24052520#if SVC_EXTENSION
    2406 #if M0463_VUI_EXT_ILP_REF
    2407 , m_interViewMvVertConstraintFlag (false)
    2408 , m_numIlpRestrictedRefLayers ( 0 )
    2409 #endif
    24102521, m_layerId                   ( 0 )
    24112522, m_numScaledRefLayerOffsets  ( 0 )
     
    24312542  ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps));
    24322543  ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
    2433 #if M0463_VUI_EXT_ILP_REF
    2434   for (Int i = 0; i < MAX_LAYERS; i++ )
    2435   {
    2436     m_minSpatialSegmentOffsetPlus1[ i ] = 0;
    2437     m_ctuBasedOffsetEnabledFlag   [ i ] = false;
    2438     m_minHorizontalCtuOffsetPlus1 [ i ] = 0;
    2439   }
    2440 #endif
    24412544}
    24422545
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r547 r588  
    422422public:
    423423  RepFormat();
    424 
     424#if RESOLUTION_BASED_DPB
     425  Void init();
     426  RepFormat& operator= (const RepFormat &);
     427  static Bool checkSameSubDpb(const RepFormat &x, const RepFormat &y);
     428#endif
    425429#if REPN_FORMAT_CONTROL_FLAG
    426430  Bool getChromaAndBitDepthVpsPresentFlag() { return m_chromaAndBitDepthVpsPresentFlag; }
     
    483487  Int         m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1];
    484488#endif
     489#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
    485490#if VPS_EXTN_OFFSET
    486491  UInt        m_extensionOffset;
     492#endif
    487493#endif
    488494#if VPS_RENAME
     
    514520  // Profile-tier-level signalling related
    515521  Bool       m_profilePresentFlag[MAX_VPS_LAYER_SETS_PLUS1];    // The value with index 0 will not be used.
     522#if !P0048_REMOVE_PROFILE_REF
    516523  UInt       m_profileLayerSetRef[MAX_VPS_LAYER_SETS_PLUS1];    // The value with index 0 will not be used.
     524#endif
    517525  std::vector<TComPTL>    m_pcPTLForExtn; 
    518526#endif
     
    528536  UInt       m_numDirectRefLayers[MAX_VPS_LAYER_ID_PLUS1];
    529537  UInt       m_refLayerId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
    530 #if M0457_PREDICTION_INDICATIONS
    531538  UInt       m_directDepTypeLen;
    532539#if O0096_DEFAULT_DEPENDENCY_TYPE
     
    536543  UInt       m_directDependencyType[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
    537544#endif
    538 #endif
    539545  UInt       m_numProfileTierLevel;
     546#if !VPS_EXTN_UEV_CODING
    540547  Bool       m_moreOutputLayerSetsThanDefaultFlag;
     548#endif
    541549  Int        m_numAddOutputLayerSets;
     550#if P0295_DEFAULT_OUT_LAYER_IDC
     551  UInt       m_defaultTargetOutputLayerIdc;
     552#else
    542553#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
    543554  UInt       m_defaultOneTargetOutputLayerIdc;
     
    545556  Bool       m_defaultOneTargetOutputLayerFlag;
    546557#endif
     558#endif
    547559  Int        m_profileLevelTierIdx[64];     
    548 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    549560  Bool       m_maxOneActiveRefLayerFlag;
    550 #endif
    551561#if O0062_POC_LSB_NOT_PRESENT_FLAG
    552562  Bool       m_pocLsbNotPresentFlag[MAX_VPS_LAYER_ID_PLUS1];
     
    558568  Bool       m_crossLayerIrapAlignFlag;
    559569#endif
    560 #if JCTVC_M0203_INTERLAYER_PRED_IDC
    561570#if O0225_MAX_TID_FOR_REF_LAYERS
    562571  UInt       m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1][MAX_VPS_LAYER_ID_PLUS1];
    563572#else
    564573  UInt       m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1];
    565 #endif
    566574#endif
    567575#if N0120_MAX_TID_REF_PRESENT_FLAG
     
    591599#endif
    592600#if N0160_VUI_EXT_ILP_REF   
    593   Bool        m_numIlpRestrictedRefLayers;
     601  Bool        m_ilpRestrictedRefLayersFlag;
    594602  Int         m_minSpatialSegmentOffsetPlus1[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
    595603  Bool        m_ctuBasedOffsetEnabledFlag   [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     
    597605#endif
    598606#if VPS_VUI_VIDEO_SIGNAL
    599     Bool        m_vidSigPresentVpsFlag;
    600     Int         m_vpsVidSigInfo;
    601     Int         m_vpsVidSigIdx[MAX_VPS_LAYER_ID_PLUS1];
    602     Int         m_vpsVidFormat[16];
    603     Bool        m_vpsFullRangeFlag[16];
    604     Int         m_vpsColorPrimaries[16];
    605     Int         m_vpsTransChar[16];
    606     Int         m_vpsMatCoeff[16];
     607  Bool        m_vidSigPresentVpsFlag;
     608  Int         m_vpsVidSigInfo;
     609  Int         m_vpsVidSigIdx[MAX_VPS_LAYER_ID_PLUS1];
     610  Int         m_vpsVidFormat[16];
     611  Bool        m_vpsFullRangeFlag[16];
     612  Int         m_vpsColorPrimaries[16];
     613  Int         m_vpsTransChar[16];
     614  Int         m_vpsMatCoeff[16];
    607615#endif
    608616#if VPS_VUI_BITRATE_PICRATE
     
    646654  Bool    m_subLayerDpbInfoPresentFlag  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    647655  Int     m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER];
     656#if RESOLUTION_BASED_DPB
     657  Int     m_maxVpsLayerDecPicBuffMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER]; 
     658#endif
    648659  Int     m_maxVpsNumReorderPics        [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    649660  Int     m_maxVpsLatencyIncreasePlus1  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
     661#if CHANGE_NUMSUBDPB_IDX
     662  Int     m_numSubDpbs                  [MAX_VPS_LAYER_SETS_PLUS1];
     663#else
    650664  Int     m_numSubDpbs                  [MAX_VPS_OP_LAYER_SETS_PLUS1];
     665#endif
    651666#endif
    652667
     
    655670#endif
    656671
    657 #endif //SVC_EXTENSION
     672#if !P0307_REMOVE_VPS_VUI_OFFSET
    658673#if VPS_VUI_OFFSET
    659674  Int     m_vpsVuiOffset;
    660675#endif
     676#endif
     677#if P0307_VPS_NON_VUI_EXTENSION
     678  Int     m_vpsNonVuiExtLength;
     679#endif
     680#if RESOLUTION_BASED_DPB
     681  Int     m_subDpbAssigned            [MAX_VPS_LAYER_SETS_PLUS1][MAX_LAYERS];
     682#endif
     683#endif //SVC_EXTENSION
    661684public:
    662685  TComVPS();
     
    777800  Void   setProfilePresentFlag(Int id, Bool x)                  { m_profilePresentFlag[id] = x;    }
    778801
     802#if !P0048_REMOVE_PROFILE_REF
    779803  UInt   getProfileLayerSetRef(Int id)                          { return m_profileLayerSetRef[id]; }
    780804  Void   setProfileLayerSetRef(Int id, Bool x)                  { m_profileLayerSetRef[id] = x;    }
     805#endif
    781806
    782807  std::vector<TComPTL>* getPTLForExtnPtr()                      { return &m_pcPTLForExtn;          }
     
    805830  Void   setRefLayerId(Int layerId, Int refLayerIdx, UInt refLayerId)           { m_refLayerId[layerId][refLayerIdx] = refLayerId;        }
    806831
    807 #if M0457_PREDICTION_INDICATIONS
    808832  UInt   getDirectDepTypeLen()                                                  { return m_directDepTypeLen;                              }
    809833  Void   setDirectDepTypeLen(UInt x)                                            { m_directDepTypeLen = x;                                 }
     
    817841  Void   setDirectDependencyType(Int currLayerId, Int refLayerId, UInt x)       { m_directDependencyType[currLayerId][refLayerId] = x;    }
    818842#endif
    819 #endif
    820843  UInt   getNumProfileTierLevel()                                { return m_numProfileTierLevel; }
    821844  Void   setNumProfileTierLevel(Int x)                           { m_numProfileTierLevel = x;    }
    822845
     846#if !VPS_EXTN_UEV_CODING
    823847  Bool   getMoreOutputLayerSetsThanDefaultFlag()                 { return m_moreOutputLayerSetsThanDefaultFlag;}
    824848  Void   setMoreOutputLayerSetsThanDefaultFlag(Bool x)           { m_moreOutputLayerSetsThanDefaultFlag = x   ;}
     849#endif
    825850
    826851  Int    getNumAddOutputLayerSets()                              { return m_numAddOutputLayerSets; }
    827852  Void   setNumAddOutputLayerSets(Int x)                         { m_numAddOutputLayerSets = x   ; }
    828853
     854#if P0295_DEFAULT_OUT_LAYER_IDC
     855  UInt   getDefaultTargetOutputLayerIdc()                 { return m_defaultTargetOutputLayerIdc;}
     856  Void   setDefaultTargetOutputLayerIdc(UInt x)           { m_defaultTargetOutputLayerIdc = x    ;}
     857#else
    829858#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
    830859  UInt   getDefaultOneTargetOutputLayerIdc()                 { return m_defaultOneTargetOutputLayerIdc;}
     
    834863  Void   setDefaultOneTargetOutputLayerFlag(Bool x)           { m_defaultOneTargetOutputLayerFlag= x    ;}
    835864#endif
     865#endif
    836866  Int    getProfileLevelTierIdx(Int i)                        { return m_profileLevelTierIdx[i]; }
    837867  Void   setProfileLevelTierIdx(Int i, Int x)                 { m_profileLevelTierIdx[i] = x   ; }
    838 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    839868  Bool   getMaxOneActiveRefLayerFlag()                                          { return m_maxOneActiveRefLayerFlag;                      }
    840869  Void   setMaxOneActiveRefLayerFlag(Bool x)                                    { m_maxOneActiveRefLayerFlag = x;                         }
    841 #endif
    842870#if O0062_POC_LSB_NOT_PRESENT_FLAG
    843871  UInt   getPocLsbNotPresentFlag(Int i)                                         { return m_pocLsbNotPresentFlag[i]; }
     
    852880  Void   setCrossLayerIrapAlignFlag(Bool x)                                     { m_crossLayerIrapAlignFlag = x;                         }
    853881#endif
    854 #if JCTVC_M0203_INTERLAYER_PRED_IDC
    855882#if O0225_MAX_TID_FOR_REF_LAYERS
    856883  UInt   getMaxTidIlRefPicsPlus1(Int layerId, Int refLayerId)                     { return m_maxTidIlRefPicsPlus1[layerId][refLayerId];           }
     
    859886  UInt   getMaxTidIlRefPicsPlus1(Int layerId)                     { return m_maxTidIlRefPicsPlus1[layerId];                   }
    860887  Void   setMaxTidIlRefPicsPlus1(Int layerId, UInt maxSublayer)   { m_maxTidIlRefPicsPlus1[layerId] = maxSublayer;            }
    861 #endif
    862888#endif
    863889#if N0120_MAX_TID_REF_PRESENT_FLAG
     
    898924#endif
    899925#if N0160_VUI_EXT_ILP_REF 
    900   Bool  getNumIlpRestrictedRefLayers   ( )                                         { return m_numIlpRestrictedRefLayers        ;}
    901   Void  setNumIlpRestrictedRefLayers   ( Int val )                                 { m_numIlpRestrictedRefLayers         = val;}
     926  Bool  getIlpRestrictedRefLayersFlag   ( )                                        { return m_ilpRestrictedRefLayersFlag        ;}
     927  Void  setIlpRestrictedRefLayersFlag   ( Int val )                                { m_ilpRestrictedRefLayersFlag         = val;}
    902928 
    903929  Int  getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId )          { return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];}
     
    9831009  Int     scalTypeToScalIdx( ScalabilityType scalType );
    9841010#endif
     1011#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
    9851012#if VPS_EXTN_OFFSET
    9861013  Int     getExtensionOffset()                 { return m_extensionOffset;   }
    9871014  Void    setExtensionOffset( UInt offset )    { m_extensionOffset = offset; }
    9881015#endif
     1016#endif
    9891017#if O0215_PHASE_ALIGNMENT
    9901018  Bool   getPhaseAlignFlag()                             { return m_phaseAlignFlag; }
     
    10021030  Void    setMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j, Int x) { m_maxVpsDecPicBufferingMinus1[i][k][j] = x;    }
    10031031
     1032#if RESOLUTION_BASED_DPB
     1033  Int     getMaxVpsLayerDecPicBuffMinus1(Int i, Int k, Int j)        { assert(i != 0); return m_maxVpsLayerDecPicBuffMinus1[i][k][j]; }
     1034  Void    setMaxVpsLayerDecPicBuffMinus1(Int i, Int k, Int j, Int x) { m_maxVpsLayerDecPicBuffMinus1[i][k][j] = x;    }
     1035#endif
     1036
    10041037  Int     getMaxVpsNumReorderPics(Int i, Int j)         { assert(i != 0); return m_maxVpsNumReorderPics[i][j]; }
    10051038  Void    setMaxVpsNumReorderPics(Int i, Int j, Int x) { m_maxVpsNumReorderPics[i][j] = x;    }
     
    10101043  Int     getNumSubDpbs(Int i)                          { return m_numSubDpbs[i]; }
    10111044  Void    setNumSubDpbs(Int i, Int x)                   { m_numSubDpbs[i] = x;    }
     1045  Void    determineSubDpbInfoFlags();
    10121046#endif
    10131047
     
    10171051#endif
    10181052
     1053#if !P0307_REMOVE_VPS_VUI_OFFSET
    10191054#if VPS_VUI_OFFSET
    10201055  Int     getVpsVuiOffset()         { return m_vpsVuiOffset; }
    10211056  Void    setVpsVuiOffset(Int x)    { m_vpsVuiOffset = x; }
     1057#endif
     1058#endif
     1059#if P0307_VPS_NON_VUI_EXTENSION
     1060  Int     getVpsNonVuiExtLength()         { return m_vpsNonVuiExtLength; }
     1061  Void    setVpsNonVuiExtLength(Int x)    { m_vpsNonVuiExtLength = x; }
     1062#endif
     1063#if RESOLUTION_BASED_DPB
     1064  Void assignSubDpbIndices();
     1065  Int  getSubDpbAssigned  (Int lsIdx, Int layerIdx) { return m_subDpbAssigned[lsIdx][layerIdx]; }
     1066  Int  findLayerIdxInLayerSet ( Int lsIdx, Int nuhLayerId );
    10221067#endif
    10231068#endif //SVC_EXTENSION
     
    13121357
    13131358#if SVC_EXTENSION
    1314 #if M0463_VUI_EXT_ILP_REF
    1315   Bool        m_interViewMvVertConstraintFlag;
    1316   Int         m_numIlpRestrictedRefLayers        ;
    1317   Int         m_minSpatialSegmentOffsetPlus1[MAX_LAYERS];
    1318   Bool        m_ctuBasedOffsetEnabledFlag   [MAX_LAYERS];
    1319   Int         m_minHorizontalCtuOffsetPlus1 [MAX_LAYERS];
    1320 #endif
    1321 
    13221359  UInt m_layerId;
    1323 
    1324 #if REF_IDX_MFM
    1325 #if !M0457_COL_PICTURE_SIGNALING
    1326   Bool m_bMFMEnabledFlag;
    1327 #endif
    1328 #endif
    13291360  UInt        m_numScaledRefLayerOffsets;
    13301361#if O0098_SCALED_REF_LAYER_ID
     
    14851516
    14861517#if SVC_EXTENSION
    1487 #if M0463_VUI_EXT_ILP_REF
    1488   Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; }
    1489   Bool getInterViewMvVertConstraintFlag()         { return m_interViewMvVertConstraintFlag;}
    1490 
    1491   ////  sps_extension_vui_parameters( )
    1492   Void setNumIlpRestrictedRefLayers   ( Int val )        { m_numIlpRestrictedRefLayers         = val;}
    1493   Int  getNumIlpRestrictedRefLayers   ( )                { return m_numIlpRestrictedRefLayers        ;}
    1494 
    1495   Void setMinSpatialSegmentOffsetPlus1( Int i, Int val ) { m_minSpatialSegmentOffsetPlus1[ i ] = val;}
    1496   Int  getMinSpatialSegmentOffsetPlus1( Int i )          { return m_minSpatialSegmentOffsetPlus1[ i ];}
    1497 
    1498   Void setCtuBasedOffsetEnabledFlag   ( Int i, Bool flag ) { m_ctuBasedOffsetEnabledFlag   [ i ] = flag;}
    1499   Bool getCtuBasedOffsetEnabledFlag   ( Int i )            { return m_ctuBasedOffsetEnabledFlag   [ i ];}
    1500 
    1501   Void setMinHorizontalCtuOffsetPlus1 ( Int i, Int val )   { m_minHorizontalCtuOffsetPlus1 [ i ] = val;}
    1502   Int  getMinHorizontalCtuOffsetPlus1 ( Int i )            { return m_minHorizontalCtuOffsetPlus1 [ i ];}
    1503 #endif
    15041518  Void     setLayerId(UInt layerId) { m_layerId = layerId; }
    15051519  UInt     getLayerId() { return m_layerId; }
    1506 #if REF_IDX_MFM
    1507 #if !M0457_COL_PICTURE_SIGNALING
    1508   Void     setMFMEnabledFlag(Bool flag) {m_bMFMEnabledFlag = flag;}
    1509   Bool     getMFMEnabledFlag()          {return m_bMFMEnabledFlag;}
    1510 #endif
    1511 #endif
    15121520  UInt     getNumScaledRefLayerOffsets()  { return m_numScaledRefLayerOffsets; }
    15131521  Void     setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x; }
     
    18891897  TComPic*    m_pcBaseColPic[MAX_LAYERS];
    18901898  TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS];
    1891 #if M0457_COL_PICTURE_SIGNALING
    18921899  Int         m_numMotionPredRefLayers;
    18931900#if REF_IDX_MFM
     
    18971904  TComPic*    m_pcIlpPic;
    18981905#endif
    1899 #endif
    1900 
    1901 #if JCTVC_M0458_INTERLAYER_RPS_SIG
     1906
    19021907  Bool        m_interLayerPredEnabledFlag;
    19031908  Int         m_activeNumILRRefIdx;        //< Active inter-layer reference pictures
    19041909  Int         m_interLayerPredLayerIdc  [MAX_VPS_LAYER_ID_PLUS1];
    1905 #else
    1906 #if SVC_EXTENSION
    1907   Int         m_numILRRefIdx;       //< for inter-layer reference picture ser
    1908 #endif
    1909 #endif
    1910 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    1911   Int         m_numSamplePredRefLayers;
    1912   Bool        m_interLayerSamplePredOnlyFlag;
    1913 #endif
    19141910#if POC_RESET_FLAG
    19151911  Bool        m_bPocResetFlag;
     
    21742170#endif
    21752171
    2176 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    21772172  Int       getActiveNumILRRefIdx     ( )               { return  m_activeNumILRRefIdx; }
    21782173  Void      setActiveNumILRRefIdx     ( Int i )         { m_activeNumILRRefIdx = i;     } 
     
    21832178  Void      setInterLayerPredEnabledFlag     ( Bool   val )    { m_interLayerPredEnabledFlag = val; }
    21842179  Bool      getInterLayerPredEnabledFlag     ()                { return m_interLayerPredEnabledFlag;}
    2185 #else
    2186   Void      setNumILRRefIdx     ( Int i )               { m_numILRRefIdx = i;     }
    2187 #endif
    2188 
    2189 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    2190   Int       getNumSamplePredRefLayers      ( )          { return  m_numSamplePredRefLayers;       }
    2191   Void      setNumSamplePredRefLayers      ( Int i )    { m_numSamplePredRefLayers = i;           }
    2192   Bool      getInterLayerSamplePredOnlyFlag( )          { return  m_interLayerSamplePredOnlyFlag; }
    2193   Void      setInterLayerSamplePredOnlyFlag( Bool val ) { m_interLayerSamplePredOnlyFlag = val;   }
    2194 #endif
    2195 
    2196 #if M0457_COL_PICTURE_SIGNALING
     2180
    21972181  Void      setNumMotionPredRefLayers(int i)            { m_numMotionPredRefLayers = i; }
    21982182  Int       getNumMotionPredRefLayers()                 { return m_numMotionPredRefLayers; }
     
    22002184  Void      setMFMEnabledFlag(Bool flag)                { m_bMFMEnabledFlag = flag; }
    22012185  Bool      getMFMEnabledFlag()                         { return m_bMFMEnabledFlag; }
    2202 #if !REMOVE_COL_PICTURE_SIGNALING
    2203   Void      setColRefLayerIdx(Int i)                    { m_colRefLayerIdx = i;     }
    2204   Int       getColRefLayerIdx()                         { return m_colRefLayerIdx;  }
    2205   Void      setAltColIndicationFlag(Bool i)             { m_altColIndicationFlag = i; }
    2206   Bool      getAltColIndicationFlag()                   { return m_altColIndicationFlag; }
    2207   Void      setMotionPredIlp(TComPic *ilpPic)           { m_pcIlpPic = ilpPic; }
    2208   TComPic*  getMotionPredIlp()                          { return m_pcIlpPic; }
    2209 #endif
    2210 #endif
    22112186#endif
    22122187
    22132188  TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); }
    22142189
    2215 #if RESTR_CHK
    2216   Bool     isRADL() {  return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); }
    2217   Bool     isRASL()   {   return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); }
    2218 #endif
     2190  Bool     isRADL()   { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); }
     2191  Bool     isRASL()   { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); }
    22192192
    22202193#if POC_RESET_FLAG
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r547 r588  
    4343#define SYNTAX_BYTES                     10      ///< number of bytes taken by syntaxes per 4x4 block [RefIdxL0(1byte), RefIdxL1(1byte), MVxL0(2bytes), MVyL0(2bytes), MVxL1(2bytes), MVyL1(2bytes)]
    4444
     45#if SVC_EXTENSION
     46#define MAX_LAYERS                       8      ///< max number of layers the codec is supposed to handle
     47
    4548#define VPS_VUI_OFFSET                   1      ///< N0085: Signal VPS VUI offset in the VPS extension
    46 
    4749#define RANDOM_ACCESS_SEI_FIX            1
    48 #if SVC_EXTENSION
    49 #define MAX_LAYERS                       2      ///< max number of layers the codec is supposed to handle
    50 
    5150#define O0137_MAX_LAYERID                1      ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1
    5251
     52#define P0130_EOB                        1      ///< JCTVC-P0130, set layer Id of EOB NALU to be fixed to 0
     53#define P0307_REMOVE_VPS_VUI_OFFSET      1      ///< JCTVC-P0307, remove implementation related to VPS VUI offset signalling
     54#define P0307_VPS_NON_VUI_EXTENSION      1      ///< JCTVC-P0307, implementation related to NON VUI VPS Extension signalling
     55
     56#define DISCARDABLE_PIC_RPS              1      ///< JCTVC-P0130: Inter-layer RPS and temporal RPS should not contain picture with discardable_flag equal to 1
     57#define VPS_EXTN_UEV_CODING              1      ///< JCTVC-P0306: Code some syntax elements as ue(v), and remove some syntax elements that duplicate behaviour
     58#define CHANGE_NUMSUBDPB_IDX             1      ///< Change index of NumSubDpb from output layer set to layer set, to be more aligned with the Spec
     59#define RESOLUTION_BASED_DPB             1      ///< JCTVC-P0192: Assign layers to sub-DPBs based on the rep_format() signaled in the VPS
     60#define SUB_BITSTREAM_PROPERTY_SEI       1      ///< JCTVC-P0204: Sub-bitstream property SEI message
    5361#define O0109_O0199_FLAGS_TO_VUI         1      ///< JCTVC-O0109, O0199: move single_layer_for_non_irap_flag and higher_layer_flag to vps_vui
    5462#define O0109_VIEW_ID_LEN                1      ///< JCTVC-O0109: view_id_len_minus1 to view_id_len, and add constraint (1<<view_id_len) is greater than or equal to NumViews
     63
     64#define P0048_REMOVE_PROFILE_REF         1      ///< JCTVC-P0048: remove profile_ref_minus1
     65#if !P0048_REMOVE_PROFILE_REF
    5566#define O0109_PROF_REF_MINUS1            1      ///< JCTVC-O0109: constraint that profile_ref_minus1[i] shall be less than or equal to i
     67#endif
     68
     69#define P0295_DEFAULT_OUT_LAYER_IDC      1      ///< JCTVC-P0295: modifify default_one_target_output_layer_idc to default_target_output_layer_idc
    5670#define O0109_DEFAULT_ONE_OUT_LAYER_IDC  1      ///< JCTVC-O0109: default_one_target_output_layer_flag to default_one_target_output_layer_idc
    5771#define O0109_MOVE_VPS_VUI_FLAG          1      ///< JCTVC-O0109: move vps_vui_present_flag before vps_vui_offset
     
    6377#define O0194_JOINT_US_BITSHIFT          1      ///< JCTVC-O0194: Joint Upsampling and bit-shift
    6478#endif
    65 #define O0194_WEIGHTED_PREDICTION_CGS    0      ///< JCTVC-O0194: Weighted prediciton for color gamut scalability
     79#define O0194_WEIGHTED_PREDICTION_CGS    1      ///< JCTVC-O0194: Weighted prediciton for color gamut scalability
    6680#define MFM_ENCCONSTRAINT                1      ///< JCTVC-O0216: Encoder constraint for motion field mapping
    6781#define VPS_NUH_LAYER_ID                 1      ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0
     
    7690
    7791#define SCALINGLIST_INFERRING            1      ///< JCTVC-N0371: inter-layer scaling list
    78 #define M0463_VUI_EXT_ILP_REF            0      ///< JCTVC-M0463: VUI extension inter-layer dependency offset signalling
    7992#define SPS_EXTENSION                    1      ///< Define sps_extension() syntax structure
    8093#if SPS_EXTENSION
    8194#define O0142_CONDITIONAL_SPS_EXTENSION  1      ///< JCTVC-O0142: Conditional SPS extension
    8295#endif
    83 #define VERT_MV_CONSTRAINT               1      ///< Vertical MV component constraint flag
    8496#define SCALABILITY_MASK_E0104           1      ///< JCT3V-E0104: scalability mask for depth
    8597#define LAYER_CTB                        0      ///< enable layer-specific CTB structure
     
    103115#define VPS_EXTN_PROFILE_INFO            1      ///< Include profile information for layer sets in VPS extension
    104116#define VPS_EXTN_DIRECT_REF_LAYERS       1      ///< Include indication of direct dependency of layers in VPS extension
    105 #define M0457_PREDICTION_INDICATIONS     1
    106117#define M0040_ADAPTIVE_RESOLUTION_CHANGE 1
    107118#define VPS_VUI                          1      ///< Include function structure for VPS VUI
     
    117128#endif
    118129#define VPS_VUI_VIDEO_SIGNAL             1      ///< JCTVC-O0118 video signal information
     130#if VPS_VUI_VIDEO_SIGNAL
     131#define VPS_VUI_VIDEO_SIGNAL_MOVE        1      ///< JCTVC-P0076 Move video signal information syntax structure earlier in the VPS VUI
     132#endif
    119133#endif //VPS_VUI
    120134
    121135#endif
    122136
     137#define P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED        1   ///< JCTVC-P0125 -- Keep it as a reserved FFFF value --- The following two macros (VPS_EXTN_OFFSET & VPS_EXTN_OFFSET_CALC) will have no effect when this macro is set to 1.
    123138#define VPS_EXTN_OFFSET                  1      ///< implementation of vps_extension_offset syntax element
    124139#define VPS_EXTN_OFFSET_CALC             1      ///< Calculation of VPS extension offset
     
    133148
    134149#define JCTVC_M0259_LAMBDAREFINEMENT     1      ///< JCTVC-M0259: lambda refinement (encoder only optimization)
    135 #define RESTR_CHK                        1      ///< JCTVC-M0208 proposal 1
    136 #define ILP_RAP                          1      ///< JCTVC-M0208 proposal 3
    137150
    138151#define AVC_BASE                         1      ///< YUV BL reading for AVC base SVC
     
    144157#define ENCODER_FAST_MODE                1      ///< JCTVC-L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1.
    145158#define REF_IDX_MFM                      1      ///< JCTVC-L0336: motion vector mapping of inter-layer reference picture
    146 #define JCTVC_M0458_INTERLAYER_RPS_SIG   1      ///< implementation of JCTVC-L0178
    147 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    148159#define MAX_ONE_RESAMPLING_DIRECT_LAYERS 1      ///< Allow maximum of one resampling process for direct reference layers
    149160#define MOTION_RESAMPLING_CONSTRAINT     1      ///< JCTVC-N0108: Allow maximum of one motion resampling process for direct reference layers, and use motion inter-layer prediction from the same layer as texture inter-layer prediction.
    150 #endif
    151 #define JCTVC_M0203_INTERLAYER_PRED_IDC  1      ///< JCTVC-M0203: implementation of Inter-layer Prediction Indication
    152 #if JCTVC_M0203_INTERLAYER_PRED_IDC
    153161#define EARLY_REF_PIC_MARKING            1      ///< Decoded picture marking of sub-layer non-reference pictures
    154162#define N0120_MAX_TID_REF_PRESENT_FLAG   1      ///< JCTVC-N0120: max_tid_ref_pics_plus1_present_flag
     
    156164#define O0225_MAX_TID_FOR_REF_LAYERS     1
    157165#define O0225_TID_BASED_IL_RPS_DERIV     1
    158 
    159166#define VPS_TSLAYERS                     1      ///< JCTVC-O0120 signal max temporal sub-layers for each layer
    160167#define TSLAYERS_IL_RPS                  1      ///< JCTVC-O0120 IL RPS based on max temporal sub-layers
    161 #endif
     168#define P0079_DERIVE_NUMACTIVE_REF_PICS  1      ///< JCTVC-P0079 Modification of derivation of variable NumActiveRefLayerPics
    162169#if REF_IDX_MFM
    163 #define REMOVE_COL_PICTURE_SIGNALING     1      ///< JCTVC-N0107: remove alternative collocated picture signalling
    164 #define M0457_COL_PICTURE_SIGNALING      1
    165170#define N0139_POSITION_ROUNDING_OFFSET   1      ///< JCTVC-N0139: offset for collocated block in motion mapping
    166 #endif
    167 
    168 #if !VPS_EXTN_DIRECT_REF_LAYERS || !M0457_PREDICTION_INDICATIONS || !JCTVC_M0458_INTERLAYER_RPS_SIG
    169 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0      ///< shall be 0, JCTVC-N0107
    170 #else
    171 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0      ///< shall be 0, JCTVC-N0107
    172171#endif
    173172
     
    190189
    191190#define VIEW_ID_RELATED_SIGNALING        1      ///< Introduce syntax elements view_id and view_id_val
    192 #define M0043_LAYERS_PRESENT_SEI         0      ///< JCTVC-M0043: add layers present SEI. Macro shall be equal to 0 according to the JCTVC-N0174 discussion. The code is to be removed.
     191#define LAYERS_NOT_PRESENT_SEI           1      ///< JCTVC-M0043: add layers not present SEI.
    193192#define N0383_IL_CONSTRAINED_TILE_SETS_SEI  1
    194193#define N0065_LAYER_POC_ALIGNMENT        1
     
    252251#define MAX_VPS_OP_SETS_PLUS1                     1024
    253252#define MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1  1
     253#endif
     254
     255#if SUB_BITSTREAM_PROPERTY_SEI
     256#define MAX_SUB_STREAMS                           1024
    254257#endif
    255258
  • trunk/source/Lib/TLibDecoder/SEIread.cpp

    r442 r588  
    9393    fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n");
    9494    break;
    95 #if M0043_LAYERS_PRESENT_SEI
    96   case SEI::LAYERS_PRESENT:
     95#if LAYERS_NOT_PRESENT_SEI
     96  case SEI::LAYERS_NOT_PRESENT:
    9797    fprintf( g_hTrace, "=========== Layers Present SEI message ===========\n");
    9898    break;
     
    106106    break;
    107107#endif
     108#if SUB_BITSTREAM_PROPERTY_SEI
     109    case SEI::SUB_BITSTREAM_PROPERTY:
     110      fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n");
     111      break;
     112#endif
    108113  case SEI::SCALABLE_NESTING:
    109114    fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");
     
    119124 * unmarshal a single SEI message from bitstream bs
    120125 */
    121 #if M0043_LAYERS_PRESENT_SEI
     126#if LAYERS_NOT_PRESENT_SEI
    122127void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps)
    123128#else
     
    130135  do
    131136  {
    132 #if M0043_LAYERS_PRESENT_SEI
     137#if LAYERS_NOT_PRESENT_SEI
    133138    xReadSEImessage(seis, nalUnitType, vps, sps);
    134139#else
     
    145150}
    146151
    147 #if M0043_LAYERS_PRESENT_SEI
     152#if LAYERS_NOT_PRESENT_SEI
    148153Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps)
    149154#else
     
    254259      xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize);
    255260      break;
    256 #if M0043_LAYERS_PRESENT_SEI
    257     case SEI::LAYERS_PRESENT:
     261#if LAYERS_NOT_PRESENT_SEI
     262    case SEI::LAYERS_NOT_PRESENT:
    258263      if (!vps)
    259264      {
    260         printf ("Warning: Found Layers present SEI message, but no active VPS is available. Ignoring.");
     265        printf ("Warning: Found Layers not present SEI message, but no active VPS is available. Ignoring.");
    261266      }
    262267      else
    263268      {
    264         sei = new SEILayersPresent;
    265         xParseSEILayersPresent((SEILayersPresent&) *sei, payloadSize, vps);
     269        sei = new SEILayersNotPresent;
     270        xParseSEILayersNotPresent((SEILayersNotPresent&) *sei, payloadSize, vps);
    266271      }
    267272      break;
     
    277282      break;
    278283#endif
     284#if SUB_BITSTREAM_PROPERTY_SEI
     285   case SEI::SUB_BITSTREAM_PROPERTY:
     286     sei = new SEISubBitstreamProperty;
     287     xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei);
     288     break;
     289#endif
    279290    case SEI::SCALABLE_NESTING:
    280291      sei = new SEIScalableNesting;
    281 #if M0043_LAYERS_PRESENT_SEI
     292#if LAYERS_NOT_PRESENT_SEI
    282293      xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, vps, sps);
    283294#else
     
    741752}
    742753
    743 #if M0043_LAYERS_PRESENT_SEI
    744 Void SEIReader::xParseSEILayersPresent(SEILayersPresent &sei, UInt payloadSize, TComVPS *vps)
     754#if LAYERS_NOT_PRESENT_SEI
     755Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, TComVPS *vps)
    745756{
    746757  UInt uiCode;
     
    752763  for (; i < sei.m_vpsMaxLayers; i++)
    753764  {
    754     READ_FLAG( uiCode,         "layer_present_flag"   ); sei.m_layerPresentFlag[i] = uiCode ? true : false;
     765    READ_FLAG( uiCode,         "layer_not_present_flag"   ); sei.m_layerNotPresentFlag[i] = uiCode ? true : false;
    755766  }
    756767  for (; i < MAX_LAYERS; i++)
    757768  {
    758     sei.m_layerPresentFlag[i] = false;
     769    sei.m_layerNotPresentFlag[i] = false;
    759770  }
    760771  xParseByteAlign();
     
    829840}
    830841#endif
    831 
    832 #if M0043_LAYERS_PRESENT_SEI
     842#if SUB_BITSTREAM_PROPERTY_SEI
     843Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei)
     844{
     845  UInt uiCode;
     846  READ_CODE( 4, uiCode, "active_vps_id" );                      sei.m_activeVpsId = uiCode;
     847  READ_UVLC(    uiCode, "num_additional_sub_streams_minus1" );  sei.m_numAdditionalSubStreams = uiCode + 1;
     848
     849  for( Int i = 0; i < sei.m_numAdditionalSubStreams; i++ )
     850  {
     851    READ_CODE(  2, uiCode, "sub_bitstream_mode[i]"           ); sei.m_subBitstreamMode[i] = uiCode;
     852    READ_UVLC(     uiCode, "output_layer_set_idx_to_vps[i]"  ); sei.m_outputLayerSetIdxToVps[i] = uiCode;
     853    READ_CODE(  3, uiCode, "highest_sub_layer_id[i]"         ); sei.m_highestSublayerId[i] = uiCode;
     854    READ_CODE( 16, uiCode, "avg_bit_rate[i]"                 ); sei.m_avgBitRate[i] = uiCode;
     855    READ_CODE( 16, uiCode, "max_bit_rate[i]"                 ); sei.m_maxBitRate[i] = uiCode;
     856  }
     857  xParseByteAlign();
     858}
     859#endif
     860#if LAYERS_NOT_PRESENT_SEI
    833861Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps)
    834862#else
     
    876904  // read nested SEI messages
    877905  do {
    878 #if M0043_LAYERS_PRESENT_SEI
     906#if LAYERS_NOT_PRESENT_SEI
    879907    xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps);
    880908#else
  • trunk/source/Lib/TLibDecoder/SEIread.h

    r442 r588  
    5656  SEIReader() {};
    5757  virtual ~SEIReader() {};
    58 #if M0043_LAYERS_PRESENT_SEI
     58#if LAYERS_NOT_PRESENT_SEI
    5959  Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps);
    6060#else
     
    6262#endif
    6363protected:
    64 #if M0043_LAYERS_PRESENT_SEI
     64#if LAYERS_NOT_PRESENT_SEI
    6565  Void xReadSEImessage                (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps);
    6666#else
     
    8383  Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize);
    8484#endif
    85 #if M0043_LAYERS_PRESENT_SEI
    86   Void xParseSEILayersPresent         (SEILayersPresent &sei, UInt payloadSize, TComVPS *vps);
     85#if SUB_BITSTREAM_PROPERTY_SEI
     86Void   xParseSEISubBitstreamProperty   (SEISubBitstreamProperty &sei);
     87#endif
     88#if LAYERS_NOT_PRESENT_SEI
     89  Void xParseSEILayersNotPresent      (SEILayersNotPresent &sei, UInt payloadSize, TComVPS *vps);
    8790  Void xParseSEIScalableNesting       (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps);
    8891#else
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r547 r588  
    756756  }
    757757  READ_FLAG( uiCode, "sps_temporal_mvp_enable_flag" );            pcSPS->setTMVPFlagsPresent(uiCode);
    758 #if REF_IDX_MFM
    759 #if !M0457_COL_PICTURE_SIGNALING
    760   if(pcSPS->getLayerId() > 0)
    761   {
    762     READ_FLAG( uiCode, "sps_enh_mfm_enable_flag" );
    763     pcSPS->setMFMEnabledFlag( uiCode ? true : false );
    764   }
    765 #endif
    766 #endif
    767758  READ_FLAG( uiCode, "sps_strong_intra_smoothing_enable_flag" );  pcSPS->setUseStrongIntraSmoothing(uiCode);
    768759
     
    815806  // more syntax elements to be parsed here
    816807
    817 #if VERT_MV_CONSTRAINT
    818808  READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" );
    819809  // Vertical MV component restriction is not used in SHVC CTC
    820810  assert( uiCode == 0 );
    821 #endif
     811
    822812  if( pcSPS->getLayerId() > 0 )
    823813  {
     
    836826    }
    837827  }
    838 #if M0463_VUI_EXT_ILP_REF
    839   ////   sps_extension_vui_parameters( )
    840   if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() )
    841   {
    842     READ_UVLC( uiCode, "num_ilp_restricted_ref_layers" ); pcSPS->setNumIlpRestrictedRefLayers( uiCode );
    843     for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ )
    844     {
    845       READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcSPS->setMinSpatialSegmentOffsetPlus1( i, uiCode );
    846       if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 )
    847       {
    848         READ_FLAG( uiCode, "ctu_based_offset_enabled_flag[ i ]"); pcSPS->setCtuBasedOffsetEnabledFlag(i, uiCode == 1 );
    849         if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) )
    850         {
    851           READ_UVLC( uiCode, "min_horizontal_ctu_offset_plus1[ i ]"); pcSPS->setMinHorizontalCtuOffsetPlus1( i, uiCode );
    852         }
    853       }
    854     }
    855   }
    856   ////   sps_extension_vui_parameters( ) END
    857 #endif
    858828}
    859829#endif
     
    877847  READ_FLAG(     uiCode,  "vps_temporal_id_nesting_flag" );       pcVPS->setTemporalNestingFlag( uiCode ? true:false );
    878848  assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
     849#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
    879850#if VPS_EXTN_OFFSET
    880851  READ_CODE( 16, uiCode,  "vps_extension_offset" );               pcVPS->setExtensionOffset( uiCode );
     852#else
     853  READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
     854#endif
    881855#else
    882856  READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
     
    995969  READ_FLAG( uiCode, "avc_base_layer_flag" ); vps->setAvcBaseLayerFlag(uiCode ? true : false);
    996970
     971#if !P0307_REMOVE_VPS_VUI_OFFSET
    997972#if O0109_MOVE_VPS_VUI_FLAG
    998973  READ_FLAG( uiCode, "vps_vui_present_flag"); vps->setVpsVuiPresentFlag(uiCode ? true : false);
     
    1005980#if O0109_MOVE_VPS_VUI_FLAG
    1006981  }
     982#endif
    1007983#endif
    1008984  READ_FLAG( uiCode, "splitting_flag" ); vps->setSplittingFlag(uiCode ? true : false);
     
    11221098    }
    11231099#endif
    1124 #if JCTVC_M0203_INTERLAYER_PRED_IDC
    11251100#if N0120_MAX_TID_REF_PRESENT_FLAG
    11261101  READ_FLAG( uiCode, "max_tid_ref_present_flag"); vps->setMaxTidRefPresentFlag(uiCode ? true : false);
     
    11801155  }
    11811156#endif
    1182 #endif
    11831157#if ILP_SSH_SIG
    11841158    READ_FLAG( uiCode, "all_ref_layers_active_flag" ); vps->setIlpSshSignalingEnabledFlag(uiCode ? true : false);
     
    11861160#if VPS_EXTN_PROFILE_INFO
    11871161  // Profile-tier-level signalling
     1162#if !VPS_EXTN_UEV_CODING
    11881163  READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1" );     assert( uiCode == (vps->getNumLayerSets() - 1) );
    11891164  READ_CODE(  6, uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 );
     1165#else
     1166  READ_UVLC(  uiCode, "vps_num_profile_tier_level_minus1"); vps->setNumProfileTierLevel( uiCode + 1 );
     1167#endif
    11901168  vps->getPTLForExtnPtr()->resize(vps->getNumProfileTierLevel());
    11911169  for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
     
    11941172    if( !vps->getProfilePresentFlag(idx) )
    11951173    {
     1174#if P0048_REMOVE_PROFILE_REF
     1175      // Copy profile information from previous one
     1176      vps->getPTLForExtn(idx)->copyProfileInfo( (idx==1) ? vps->getPTL() : vps->getPTLForExtn( idx - 1 ) );
     1177#else
    11961178      READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); vps->setProfileLayerSetRef(idx, uiCode + 1);
    11971179#if O0109_PROF_REF_MINUS1
     
    12021184      // Copy profile information as indicated
    12031185      vps->getPTLForExtn(idx)->copyProfileInfo( vps->getPTLForExtn( vps->getProfileLayerSetRef(idx) ) );
     1186#endif
    12041187    }
    12051188    parsePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 );
     
    12071190#endif
    12081191
     1192#if !VPS_EXTN_UEV_CODING
    12091193  READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); vps->setMoreOutputLayerSetsThanDefaultFlag( uiCode ? true : false );
    12101194  Int numOutputLayerSets = 0;
     
    12181202    numOutputLayerSets = vps->getNumLayerSets() + vps->getNumAddOutputLayerSets();
    12191203  }
     1204#else
     1205  READ_UVLC( uiCode, "num_add_output_layer_sets" );          vps->setNumAddOutputLayerSets( uiCode );
     1206  Int numOutputLayerSets = vps->getNumLayerSets() + vps->getNumAddOutputLayerSets();
     1207#endif
     1208
     1209#if P0295_DEFAULT_OUT_LAYER_IDC
     1210  if( numOutputLayerSets > 1 )
     1211  {
     1212    READ_CODE( 2, uiCode, "default_target_output_layer_idc" );   vps->setDefaultTargetOutputLayerIdc( uiCode );
     1213  }
     1214  vps->setNumOutputLayerSets( numOutputLayerSets );
     1215
     1216  for(i = 1; i < numOutputLayerSets; i++)
     1217  {
     1218    if( i > (vps->getNumLayerSets() - 1) )
     1219    {
     1220      Int numBits = 1;
     1221      while ((1 << numBits) < (vps->getNumLayerSets() - 1))
     1222      {
     1223        numBits++;
     1224      }
     1225      READ_CODE( numBits, uiCode, "output_layer_set_idx_minus1");   vps->setOutputLayerSetIdx( i, uiCode + 1);
     1226    }
     1227    else
     1228    {
     1229      vps->setOutputLayerSetIdx( i, i );
     1230    }
     1231    if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 )
     1232    {
     1233      Int lsIdx = vps->getOutputLayerSetIdx(i);
     1234      for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++)
     1235      {
     1236        READ_FLAG( uiCode, "output_layer_flag[i][j]"); vps->setOutputLayerFlag(i, j, uiCode);
     1237      }
     1238    }
     1239    else
     1240    {
     1241      // i <= (vps->getNumLayerSets() - 1)
     1242      // Assign OutputLayerFlag depending on default_one_target_output_layer_flag
     1243      Int lsIdx = i;
     1244      if( vps->getDefaultTargetOutputLayerIdc() == 1 )
     1245      {
     1246        for(j = 0; j < vps->getNumLayersInIdList(lsIdx); j++)
     1247        {
     1248          vps->setOutputLayerFlag(i, j, (j == (vps->getNumLayersInIdList(lsIdx)-1)) && (vps->getDimensionId(j,1) == 0) );
     1249        }
     1250      }
     1251      else if ( vps->getDefaultTargetOutputLayerIdc() == 0 )
     1252      {
     1253        for(j = 0; j < vps->getNumLayersInIdList(lsIdx); j++)
     1254        {
     1255          vps->setOutputLayerFlag(i, j, 1);
     1256        }
     1257      }
     1258    }
     1259    Int numBits = 1;
     1260    while ((1 << numBits) < (vps->getNumProfileTierLevel()))
     1261    {
     1262      numBits++;
     1263    }
     1264    READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
     1265  }
     1266#else
    12201267  if( numOutputLayerSets > 1 )
    12211268  {
     
    12991346    READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
    13001347  }
     1348#endif
    13011349
    13021350#if O0153_ALT_OUTPUT_LAYER_FLAG
     
    13151363  {
    13161364#if O0096_REP_FORMAT_INDEX
     1365#if !VPS_EXTN_UEV_CODING
    13171366    READ_CODE( 8, uiCode, "vps_num_rep_formats_minus1" );
     1367#else
     1368    READ_UVLC( uiCode, "vps_num_rep_formats_minus1" );
     1369#endif
    13181370#else
    13191371    READ_CODE( 4, uiCode, "vps_num_rep_formats_minus1" );
     
    13421394      {
    13431395#if O0096_REP_FORMAT_INDEX
     1396#if !VPS_EXTN_UEV_CODING
    13441397        READ_CODE( 8, uiCode, "vps_rep_format_idx[i]" );
     1398#else
     1399        Int numBits = 1;
     1400        while ((1 << numBits) < (vps->getVpsNumRepFormats()))
     1401        {
     1402          numBits++;
     1403        }
     1404        READ_CODE( numBits, uiCode, "vps_rep_format_idx[i]" );
     1405#endif
    13451406#else
    13461407        READ_CODE( 4, uiCode, "vps_rep_format_idx[i]" );
     
    13641425  }
    13651426#endif
    1366 #if JCTVC_M0458_INTERLAYER_RPS_SIG
     1427#if RESOLUTION_BASED_DPB
     1428  vps->assignSubDpbIndices();
     1429#endif
    13671430  READ_FLAG(uiCode, "max_one_active_ref_layer_flag" );
    13681431  vps->setMaxOneActiveRefLayerFlag(uiCode);
    1369 #endif
    13701432#if O0062_POC_LSB_NOT_PRESENT_FLAG
    13711433  for(i = 1; i< vps->getMaxLayers(); i++)
     
    13881450
    13891451#if VPS_DPB_SIZE_TABLE
    1390   vps->deriveNumberOfSubDpbs();
    1391   for(i = 1; i < vps->getNumOutputLayerSets(); i++)
    1392   {
    1393     READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]");  vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false );
    1394     for(j = 0; j < vps->getMaxTLayers(); j++)
    1395     {
    1396       if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
    1397       {
    1398         READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag[i]");  vps->setSubLayerDpbInfoPresentFlag( i, j, uiCode ? true : false);
    1399       }
    1400       else
    1401       {
    1402         if( j == 0 )  // Always signal for the first sub-layer
    1403         {
    1404           vps->setSubLayerDpbInfoPresentFlag( i, j, true );
    1405         }
    1406         else // if (j != 0) && !vps->getSubLayerFlagInfoPresentFlag(i)
    1407         {
    1408           vps->setSubLayerDpbInfoPresentFlag( i, j, false );
    1409         }
    1410       }
    1411       if( vps->getSubLayerDpbInfoPresentFlag(i, j) )  // If sub-layer DPB information is present
    1412       {
    1413         for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
    1414         {
    1415           READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
    1416         }
    1417         READ_UVLC( uiCode, "max_vps_num_reorder_pics[i][j]" );              vps->setMaxVpsNumReorderPics( i, j, uiCode);
    1418         READ_UVLC( uiCode, "max_vps_latency_increase_plus1[i][j]" );        vps->setMaxVpsLatencyIncreasePlus1( i, j, uiCode);
    1419       }
    1420     }
    1421   }
    1422 #endif
    1423 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
     1452  parseVpsDpbSizeTable(vps);
     1453#endif
     1454
     1455#if VPS_EXTN_DIRECT_REF_LAYERS
    14241456  READ_UVLC( uiCode,           "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2);
    14251457#if O0096_DEFAULT_DEPENDENCY_TYPE
     
    14701502#endif
    14711503
     1504#if P0307_VPS_NON_VUI_EXTENSION
     1505  READ_UVLC( uiCode,           "vps_non_vui_extension_length"); vps->setVpsNonVuiExtLength((Int)uiCode);
     1506  if ( vps->getVpsNonVuiExtLength() > 0 )
     1507  {
     1508    printf("\n\nUp to the current spec, the value of vps_non_vui_extension_length is supposed to be 0\n");
     1509  }
     1510#endif
     1511
    14721512#if !O0109_O0199_FLAGS_TO_VUI
    14731513#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     
    14771517  READ_FLAG(uiCode, "higher_layer_irap_skip_flag" ); vps->setHigherLayerIrapSkipFlag(uiCode == 1 ? true : false);
    14781518#endif
     1519#endif
     1520
     1521#if P0307_REMOVE_VPS_VUI_OFFSET
     1522  READ_FLAG( uiCode, "vps_vui_present_flag"); vps->setVpsVuiPresentFlag(uiCode ? true : false);
    14791523#endif
    14801524
     
    15401584  READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" );         repFormat->setBitDepthVpsChroma( uiCode + 8 );
    15411585#endif
     1586}
     1587#endif
     1588#if VPS_DPB_SIZE_TABLE
     1589Void TDecCavlc::parseVpsDpbSizeTable( TComVPS *vps )
     1590{
     1591  UInt uiCode;
     1592#if !RESOLUTION_BASED_DPB
     1593  vps->deriveNumberOfSubDpbs();
     1594#endif
     1595  for(Int i = 1; i < vps->getNumOutputLayerSets(); i++)
     1596  {
     1597#if CHANGE_NUMSUBDPB_IDX
     1598    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i );
     1599#endif
     1600    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]");  vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false );
     1601    for(Int j = 0; j < vps->getMaxTLayers(); j++)
     1602    {
     1603      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
     1604      {
     1605        READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag[i]");  vps->setSubLayerDpbInfoPresentFlag( i, j, uiCode ? true : false);
     1606      }
     1607      else
     1608      {
     1609        if( j == 0 )  // Always signal for the first sub-layer
     1610        {
     1611          vps->setSubLayerDpbInfoPresentFlag( i, j, true );
     1612        }
     1613        else // if (j != 0) && !vps->getSubLayerFlagInfoPresentFlag(i)
     1614        {
     1615          vps->setSubLayerDpbInfoPresentFlag( i, j, false );
     1616        }
     1617      }
     1618      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )  // If sub-layer DPB information is present
     1619      {
     1620#if CHANGE_NUMSUBDPB_IDX
     1621        for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++)
     1622#else
     1623        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
     1624#endif
     1625        {
     1626          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
     1627        }
     1628        READ_UVLC( uiCode, "max_vps_num_reorder_pics[i][j]" );              vps->setMaxVpsNumReorderPics( i, j, uiCode);
     1629#if RESOLUTION_BASED_DPB
     1630        if( vps->getNumSubDpbs(layerSetIdxForOutputLayerSet) != vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ) ) 
     1631        {
     1632          for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++)
     1633          {
     1634            READ_UVLC( uiCode, "max_vps_layer_dec_pic_buff_minus1[i][k][j]" ); vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, uiCode);
     1635          }
     1636        }
     1637        else  // vps->getNumSubDpbs(layerSetIdxForOutputLayerSet) == vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet )
     1638        {         
     1639          for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++)
     1640          {
     1641            vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, vps->getMaxVpsDecPicBufferingMinus1( i, k, j));
     1642          }
     1643        }
     1644#endif
     1645        READ_UVLC( uiCode, "max_vps_latency_increase_plus1[i][j]" );        vps->setMaxVpsLatencyIncreasePlus1( i, j, uiCode);
     1646      }
     1647    }
     1648  }
    15421649}
    15431650#endif
     
    16141721  }
    16151722#endif
     1723#if VPS_VUI_VIDEO_SIGNAL_MOVE
     1724  READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); vps->setVideoSigPresentVpsFlag( uiCode == 1 );
     1725  if (vps->getVideoSigPresentVpsFlag())
     1726  {
     1727    READ_CODE(4, uiCode, "vps_num_video_signal_info_minus1" ); vps->setNumVideoSignalInfo(uiCode + 1);
     1728  }
     1729  else
     1730  {
     1731    vps->setNumVideoSignalInfo(vps->getMaxLayers());
     1732  }
     1733
     1734
     1735  for(i = 0; i < vps->getNumVideoSignalInfo(); i++)
     1736  {
     1737    READ_CODE(3, uiCode, "video_vps_format" ); vps->setVideoVPSFormat(i,uiCode);
     1738    READ_FLAG(uiCode, "video_full_range_vps_flag" ); vps->setVideoFullRangeVpsFlag(i,uiCode);
     1739    READ_CODE(8, uiCode, "color_primaries_vps" ); vps->setColorPrimaries(i,uiCode);
     1740    READ_CODE(8, uiCode, "transfer_characteristics_vps" ); vps->setTransCharacter(i,uiCode);
     1741    READ_CODE(8, uiCode, "matrix_coeffs_vps" );vps->setMaxtrixCoeff(i,uiCode);
     1742  }
     1743  if(!vps->getVideoSigPresentVpsFlag())
     1744  {
     1745    for (i=0; i < vps->getMaxLayers(); i++)
     1746    {
     1747      vps->setVideoSignalInfoIdx(i,i);
     1748    }
     1749  }
     1750  else {
     1751    vps->setVideoSignalInfoIdx(0,0);
     1752    if (vps->getNumVideoSignalInfo() > 1 )
     1753    {
     1754      for (i=1; i < vps->getMaxLayers(); i++)
     1755        READ_CODE(4, uiCode, "vps_video_signal_info_idx" ); vps->setVideoSignalInfoIdx(i, uiCode);
     1756    }
     1757    else {
     1758      for (i=1; i < vps->getMaxLayers(); i++)
     1759      {
     1760        vps->setVideoSignalInfoIdx(i,0);
     1761      }
     1762    }
     1763  }
     1764#endif
    16161765#if VPS_VUI_TILES_NOT_IN_USE__FLAG
    16171766  UInt layerIdx;
     
    16721821
    16731822#if N0160_VUI_EXT_ILP_REF
    1674     READ_FLAG( uiCode, "num_ilp_restricted_ref_layers" ); vps->setNumIlpRestrictedRefLayers( uiCode == 1 );
    1675   if( vps->getNumIlpRestrictedRefLayers())
     1823  READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); vps->setIlpRestrictedRefLayersFlag( uiCode == 1 );
     1824  if( vps->getIlpRestrictedRefLayersFlag())
    16761825  {
    16771826    for(i = 1; i < vps->getMaxLayers(); i++)
     
    16931842#endif
    16941843#if VPS_VUI_VIDEO_SIGNAL
     1844#if VPS_VUI_VIDEO_SIGNAL_MOVE
     1845#else
    16951846    READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); vps->setVideoSigPresentVpsFlag( uiCode == 1 );
    16961847    if (vps->getVideoSigPresentVpsFlag())
     
    17331884        }
    17341885    }
     1886#endif
    17351887#endif
    17361888}
     
    18201972    if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)
    18211973    {
     1974#if DISCARDABLE_PIC_RPS
     1975      READ_FLAG(uiCode, "discardable_flag"); rpcSlice->setDiscardableFlag( uiCode ? true : false );
     1976#else
    18221977      READ_FLAG(uiCode, "discardable_flag"); // ignored
     1978#endif
    18231979      iBits++;
    18241980    }
     
    20642220
    20652221#if SVC_EXTENSION
    2066 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    20672222    rpcSlice->setActiveNumILRRefIdx(0);
    20682223#if ILP_SSH_SIG
     
    20942249          else
    20952250          {
     2251#if P0079_DERIVE_NUMACTIVE_REF_PICS
     2252            Int   numRefLayerPics = 0;
     2253            Int   i = 0;
     2254            Int   refLayerPicIdc  [MAX_VPS_LAYER_ID_PLUS1];
     2255            for(i = 0, numRefLayerPics = 0;  i < rpcSlice->getNumILRRefIdx(); i++ )
     2256            {
     2257              if(rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) >  rpcSlice->getTLayer() &&
     2258                (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >=  rpcSlice->getTLayer()) )
     2259              {         
     2260                refLayerPicIdc[ numRefLayerPics++ ] = i;
     2261              }
     2262            }
     2263            if (numRefLayerPics)
     2264              rpcSlice->setActiveNumILRRefIdx(1);
     2265#else
    20962266            rpcSlice->setActiveNumILRRefIdx(1);
     2267#endif
    20972268          }
    20982269#if ILP_NUM_REF_CHK
     
    21662337    }
    21672338#endif
    2168 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    2169     rpcSlice->setInterLayerSamplePredOnlyFlag( false );
    2170     if( rpcSlice->getNumSamplePredRefLayers() > 0 && rpcSlice->getActiveNumILRRefIdx() > 0 )
    2171     {
    2172       READ_FLAG( uiCode, "inter_layer_sample_pred_only_flag" );
    2173       rpcSlice->setInterLayerSamplePredOnlyFlag( uiCode > 0 );
    2174     }
    2175 #endif
    2176 #else
    2177     if( rpcSlice->getLayerId() > 0 )
    2178     {
    2179       rpcSlice->setNumILRRefIdx( rpcSlice->getVPS()->getNumDirectRefLayers( rpcSlice->getLayerId() ) );
    2180     }
    2181 #endif
    21822339#endif
    21832340
     
    23572514    if ( rpcSlice->getEnableTMVPFlag() )
    23582515    {
    2359 #if M0457_COL_PICTURE_SIGNALING
    2360 #if REMOVE_COL_PICTURE_SIGNALING
     2516#if SVC_EXTENSION && REF_IDX_MFM
     2517      // set motion mapping flag
    23612518      rpcSlice->setMFMEnabledFlag( ( rpcSlice->getNumMotionPredRefLayers() > 0 && rpcSlice->getActiveNumILRRefIdx() ) ? true : false );
    2362 #else
    2363       rpcSlice->setMFMEnabledFlag( false );
    2364       rpcSlice->setColRefLayerIdx( 0 );
    2365       rpcSlice->setAltColIndicationFlag( false );
    2366       if ( sps->getLayerId() > 0 && rpcSlice->getActiveNumILRRefIdx() > 0 && rpcSlice->getNumMotionPredRefLayers() > 0 )
    2367       {
    2368         READ_FLAG( uiCode, "alt_collocated_indication_flag" );
    2369         rpcSlice->setAltColIndicationFlag( uiCode == 1 ? true : false );
    2370         rpcSlice->setMFMEnabledFlag( uiCode == 1 ? true : false );
    2371         if ( rpcSlice->getNumMotionPredRefLayers() > 1 )
    2372         {
    2373           READ_UVLC( uiCode, "collocated_ref_layer_idx" );
    2374           rpcSlice->setColRefLayerIdx( uiCode );
    2375         }
    2376       }
    2377       else
    2378       {
    2379 #endif //REMOVE_COL_PICTURE_SIGNALING
    23802519#endif
    23812520      if ( rpcSlice->getSliceType() == B_SLICE )
     
    24002539        rpcSlice->setColRefIdx(0);
    24012540      }
    2402 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    2403       }
    2404 #endif
    24052541    }
    24062542    if ( (pps->getUseWP() && rpcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && rpcSlice->getSliceType()==B_SLICE) )
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r494 r588  
    8383  Void  parseRepFormat      ( RepFormat *repFormat );
    8484#endif
     85#if VPS_DPB_SIZE_TABLE
     86  Void  parseVpsDpbSizeTable( TComVPS *vps );
     87#endif
    8588  Void  parseSPS            ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager );
    8689  Void  parseSPSExtension    ( TComSPS* pcSPS );
  • trunk/source/Lib/TLibDecoder/TDecGop.cpp

    r540 r588  
    234234  //-- For time output for each slice
    235235#if SVC_EXTENSION
    236   printf("\nPOC %4d LId: %1d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getPOC(),
     236  printf("\nPOC %4d LId: %1d TId: %1d ( %c-SLICE %s, QP%3d ) ", pcSlice->getPOC(),
    237237                                                    rpcPic->getLayerId(),
    238238                                                    pcSlice->getTLayer(),
    239239                                                    c,
     240                                                    NaluToStr( pcSlice->getNalUnitType() ).data(),
    240241                                                    pcSlice->getSliceQp() );
    241242#else
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r547 r588  
    8686  m_bRefreshPending            = false;
    8787#endif
     88#if RESOLUTION_BASED_DPB
     89  m_subDpbIdx = -1;
     90#endif
    8891}
    8992
     
    178181    {
    179182#if USE_DPB_SIZE_TABLE
    180       if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 )
     183      if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 )
    181184      {
    182185        assert( this->getLayerId() == 0 );
     
    187190        TComVPS *vps = slice->getVPS();
    188191        // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures.
    189         numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getOutputLayerSetIdx() , temporalLayer);
     192        numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getTargetOutputLayerSetIdx() , temporalLayer);
    190193      }
    191194#else
     
    196199    if (m_cIlpPic[0] == NULL)
    197200    {
    198       for (Int j=0; j < MAX_LAYERS /*MAX_NUM_REF*/; j++)  // consider to set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]]
     201      for (Int j=0; j < m_numDirectRefLayers; j++)
    199202      {
    200203
     
    282285  {
    283286#if USE_DPB_SIZE_TABLE
    284     if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 )
     287    if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 )
    285288    {
    286289      assert( this->getLayerId() == 0 );
     
    291294      TComVPS *vps = pcSlice->getVPS();
    292295      // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures.
    293       numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getOutputLayerSetIdx() , temporalLayer);
     296      numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getTargetOutputLayerSetIdx() , temporalLayer);
    294297    }
    295298#else
     
    299302
    300303#if USE_DPB_SIZE_TABLE
    301   if( getCommonDecoderParams()->getOutputLayerSetIdx() == 0 )
     304  if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 )
    302305  {
    303306    assert( this->getLayerId() == 0 );
     
    306309  else
    307310  {
    308     m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getOutputLayerSetIdx(), pcSlice->getLayerId(), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
     311#if RESOLUTION_BASED_DPB
     312    Int layerSetIdxForOutputLayerSet = pcSlice->getVPS()->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() );
     313    Int layerIdx = pcSlice->getVPS()->findLayerIdxInLayerSet( layerSetIdxForOutputLayerSet, pcSlice->getLayerId() );  assert( layerIdx != -1 );
     314    m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsLayerDecPicBuffMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), layerIdx, pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
     315#else
     316    m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), pcSlice->getLayerId(), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
     317#endif
    309318  }
    310319#else
     
    815824#if OUTPUT_LAYER_SET_INDEX
    816825  // Following check should go wherever the VPS is activated
    817   checkValueOfOutputLayerSetIdx( m_apcSlicePilot->getVPS());
     826  checkValueOfTargetOutputLayerSetIdx( m_apcSlicePilot->getVPS());
     827#endif
     828#if RESOLUTION_BASED_DPB
     829  // Following assignment should go wherever a new VPS is activated
     830  assignSubDpbs(m_apcSlicePilot->getVPS());
    818831#endif
    819832  m_apcSlicePilot->initSlice( nalu.m_layerId );
     
    845858#if SVC_EXTENSION
    846859  m_apcSlicePilot->setSliceIdx( m_uiSliceIdx ); // it should be removed if HM will reflect it in above
    847 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
     860#if VPS_EXTN_DIRECT_REF_LAYERS
    848861  setRefLayerParams(m_apcSlicePilot->getVPS());
    849862#endif
    850 #if M0457_COL_PICTURE_SIGNALING
    851863  m_apcSlicePilot->setNumMotionPredRefLayers(m_numMotionPredRefLayers);
    852 #endif
    853 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    854   m_apcSlicePilot->setNumSamplePredRefLayers( getNumSamplePredRefLayers() );
    855 #endif
    856864#endif
    857865  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
     
    14781486
    14791487#if REF_IDX_MFM
    1480 #if M0457_COL_PICTURE_SIGNALING
    14811488      if( pcSlice->getMFMEnabledFlag() )
    1482 #else
    1483       if( pcSlice->getSPS()->getMFMEnabledFlag() )
    1484 #endif
    14851489      {
    14861490        pcSlice->setRefPOCListILP(m_ppcTDecTop[m_layerId]->m_cIlpPic, pcSlice->getBaseColPic());
    1487 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    1488         pcSlice->setMotionPredIlp(getMotionPredIlp(pcSlice));
    1489 #endif
    14901491      }
    14911492      pcSlice->setRefPicList( m_cListPic, false, m_cIlpPic);
     
    16681669    }
    16691670#endif
    1670 #if M0043_LAYERS_PRESENT_SEI
     1671#if LAYERS_NOT_PRESENT_SEI
    16711672    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
    16721673#else
     
    16761677  else
    16771678  {
    1678 #if M0043_LAYERS_PRESENT_SEI
     1679#if LAYERS_NOT_PRESENT_SEI
    16791680    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
    16801681#else
     
    16961697  if(nalUnitType == NAL_UNIT_SUFFIX_SEI)
    16971698  {
    1698 #if M0043_LAYERS_PRESENT_SEI
     1699#if LAYERS_NOT_PRESENT_SEI
    16991700    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
    17001701#else
     
    17041705  else
    17051706  {
    1706 #if M0043_LAYERS_PRESENT_SEI
     1707#if LAYERS_NOT_PRESENT_SEI
    17071708    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() );
    17081709#else
     
    18651866     
    18661867    case NAL_UNIT_EOB:
     1868#if P0130_EOB
     1869      //Check layer id of the nalu. if it is not 0, give a warning message.
     1870      if (nalu.m_layerId > 0)
     1871      {
     1872        printf( "\n\nThis bitstream is ended with EOB NALU that has layer id greater than 0\n" );
     1873      }
     1874#endif
    18671875      return false;
    18681876     
     
    19591967#endif
    19601968
    1961 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
     1969#if VPS_EXTN_DIRECT_REF_LAYERS
    19621970
    19631971Void TDecTop::setRefLayerParams( TComVPS* vps )
     
    20132021#endif
    20142022
    2015 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    2016 TComPic* TDecTop::getMotionPredIlp(TComSlice* pcSlice)
    2017 {
    2018   TComPic* ilpPic = NULL;
    2019   Int activeMotionPredReflayerIdx = 0;
    2020 
    2021   for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
    2022   {
    2023     UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
    2024     if( getMotionPredEnabledFlag( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) ) )
    2025     {
    2026       if (activeMotionPredReflayerIdx == pcSlice->getColRefLayerIdx())
    2027       {
    2028         ilpPic = m_cIlpPic[refLayerIdc];
    2029         break;
    2030       }
    2031       else
    2032       {
    2033         activeMotionPredReflayerIdx++;
    2034       }
    2035     }
    2036   }
    2037 
    2038   assert(ilpPic != NULL);
    2039 
    2040   return ilpPic;
    2041 }
    2042 #endif
    20432023#if OUTPUT_LAYER_SET_INDEX
    2044 Void TDecTop::checkValueOfOutputLayerSetIdx(TComVPS *vps)
     2024Void TDecTop::checkValueOfTargetOutputLayerSetIdx(TComVPS *vps)
    20452025{
    20462026  CommonDecoderParams* params = this->getCommonDecoderParams();
     2027
     2028  assert( params->getTargetLayerId() < vps->getMaxLayers() );
     2029
    20472030  if( params->getValueCheckedFlag() )
    20482031  {
    20492032    return; // Already checked
    20502033  }
    2051   if( params->getOutputLayerSetIdx() == -1 )  // Output layer set index not specified
     2034  if( params->getTargetOutputLayerSetIdx() == -1 )  // Output layer set index not specified
    20522035  {
    20532036    Bool layerSetMatchFound = false;
     
    20962079          // Match found
    20972080          layerSetMatchFound = true;
    2098           params->setOutputLayerSetIdx( i );
     2081          params->setTargetOutputLayerSetIdx( i );
    20992082          params->setValueCheckedFlag( true );
    21002083          break;
     
    21072090  {
    21082091    // Check if the target decoded layer is the highest layer in the list
    2109     Int layerSetIdx = vps->getOutputLayerSetIdx( params->getOutputLayerSetIdx() );  // Index to the layer set
     2092    assert( params->getTargetOutputLayerSetIdx() < vps->getNumLayerSets() );
     2093    Int layerSetIdx = vps->getOutputLayerSetIdx( params->getTargetOutputLayerSetIdx() );  // Index to the layer set
    21102094    assert( params->getTargetLayerId() == vps->getNumLayersInIdList( layerSetIdx ) - 1);
    21112095
     
    21382122}
    21392123#endif
     2124#if RESOLUTION_BASED_DPB
     2125Void TDecTop::assignSubDpbs(TComVPS *vps)
     2126{
     2127  if( m_subDpbIdx == -1 ) // Sub-DPB index is not already assigned
     2128  {
     2129    Int lsIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() );
     2130
     2131    Int layerIdx = vps->findLayerIdxInLayerSet( lsIdx, getLayerId() );
     2132    assert( layerIdx != -1 ); // Current layer should be found in the layer set.
     2133
     2134    // Copy from the active VPS based on the layer ID.
     2135    m_subDpbIdx = vps->getSubDpbAssigned( lsIdx, layerIdx );
     2136  }
     2137}
     2138#endif
    21402139//! \}
  • trunk/source/Lib/TLibDecoder/TDecTop.h

    r540 r588  
    117117  Int                     m_iBLSourceHeight; 
    118118#endif
    119 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
     119#if VPS_EXTN_DIRECT_REF_LAYERS
    120120  Int                     m_numDirectRefLayers;
    121121  Int                     m_refLayerId[MAX_VPS_LAYER_ID_PLUS1];
     
    144144  Bool                   m_bRefreshPending;
    145145#endif
    146 
     146#if RESOLUTION_BASED_DPB
     147  Int                    m_subDpbIdx;     // Index to the sub-DPB that the layer belongs to.
     148                                          // When new VPS is activated, this should be re-initialized to -1
     149#endif
    147150public:
    148151  TDecTop();
     
    177180#if VPS_EXTN_DIRECT_REF_LAYERS
    178181  TDecTop*  getRefLayerDec(UInt refLayerIdc);
    179 #if M0457_PREDICTION_INDICATIONS
    180182  Int       getNumDirectRefLayers           ()                              { return m_numDirectRefLayers;      }
    181183  Void      setNumDirectRefLayers           (Int num)                       { m_numDirectRefLayers = num;       }
     
    206208
    207209  Void      setRefLayerParams( TComVPS* vps );
    208 #endif
    209210#endif
    210211#if AVC_BASE
     
    244245  Void      xDecodePPS();
    245246  Void      xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType );
    246 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    247   TComPic*  getMotionPredIlp(TComSlice* pcSlice);
    248 #endif
    249247
    250248#if NO_CLRAS_OUTPUT_FLAG
     
    262260  CommonDecoderParams*    getCommonDecoderParams() { return m_commonDecoderParams; }
    263261  Void                    setCommonDecoderParams(CommonDecoderParams* x) { m_commonDecoderParams = x; }
    264   Void      checkValueOfOutputLayerSetIdx(TComVPS *vps);
     262  Void      checkValueOfTargetOutputLayerSetIdx(TComVPS *vps);
    265263#endif
    266264#if SCALINGLIST_INFERRING
    267265  ParameterSetManagerDecoder* getParameterSetManager() { return &m_parameterSetManagerDecoder; }
    268266#endif
     267#if RESOLUTION_BASED_DPB
     268  Void setSubDpbIdx(Int idx)    { m_subDpbIdx = idx; }
     269  Int  getSubDpbIdx()           { return m_subDpbIdx; }
     270  Void assignSubDpbs(TComVPS *vps);
     271#endif
    269272};// END CLASS DEFINITION TDecTop
    270273
  • trunk/source/Lib/TLibEncoder/NALwrite.cpp

    r313 r588  
    9191  vector<uint8_t>& rbsp   = nalu.m_Bitstream.getFIFO();
    9292
     93#if P0130_EOB
     94  if (rbsp.size() == 0) return;
     95#endif
     96
    9397  for (vector<uint8_t>::iterator it = rbsp.begin(); it != rbsp.end();)
    9498  {
  • trunk/source/Lib/TLibEncoder/SEIwrite.cpp

    r442 r588  
    8787    fprintf( g_hTrace, "=========== Tone Mapping Info SEI message ===========\n");
    8888    break;
    89 #if M0043_LAYERS_PRESENT_SEI
    90   case SEI::LAYERS_PRESENT:
     89#if LAYERS_NOT_PRESENT_SEI
     90  case SEI::LAYERS_NOT_PRESENT:
    9191    fprintf( g_hTrace, "=========== Layers Present SEI message ===========\n");
    9292    break;
     
    9999    fprintf( g_hTrace, "=========== Inter Layer Constrained Tile Sets SEI message ===========\n");
    100100    break;
     101#endif
     102#if SUB_BITSTREAM_PROPERTY_SEI
     103    case SEI::SUB_BITSTREAM_PROPERTY:
     104      fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n");
     105      break;
    101106#endif
    102107  case SEI::SCALABLE_NESTING:
     
    150155    xWriteSEIToneMappingInfo(*static_cast<const SEIToneMappingInfo*>(&sei));
    151156    break;
    152 #if M0043_LAYERS_PRESENT_SEI
    153   case SEI::LAYERS_PRESENT:
    154     xWriteSEILayersPresent(*static_cast<const SEILayersPresent*>(&sei));
     157#if LAYERS_NOT_PRESENT_SEI
     158  case SEI::LAYERS_NOT_PRESENT:
     159    xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei));
    155160    break;
    156161#endif
     
    162167    xWriteSEIInterLayerConstrainedTileSets(*static_cast<const SEIInterLayerConstrainedTileSets*>(&sei));
    163168    break;
     169#endif
     170#if SUB_BITSTREAM_PROPERTY_SEI
     171   case SEI::SUB_BITSTREAM_PROPERTY:
     172     xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
     173     break;
    164174#endif
    165175  case SEI::SCALABLE_NESTING:
     
    536546}
    537547
    538 #if M0043_LAYERS_PRESENT_SEI
    539 Void SEIWriter::xWriteSEILayersPresent(const SEILayersPresent& sei)
     548#if LAYERS_NOT_PRESENT_SEI
     549Void SEIWriter::xWriteSEILayersNotPresent(const SEILayersNotPresent& sei)
    540550{
    541551  WRITE_UVLC( sei.m_activeVpsId,           "lp_sei_active_vps_id" );
    542552  for (UInt i = 0; i < sei.m_vpsMaxLayers; i++)
    543553  {
    544     WRITE_FLAG( sei.m_layerPresentFlag[i], "layer_present_flag"   );
     554    WRITE_FLAG( sei.m_layerNotPresentFlag[i], "layer_not_present_flag"   );
    545555  }
    546556  xWriteByteAlign();
     
    606616}
    607617#endif
    608 
     618#if SUB_BITSTREAM_PROPERTY_SEI
     619Void SEIWriter::xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei)
     620{
     621  WRITE_CODE( sei.m_activeVpsId, 4, "active_vps_id" );
     622  assert( sei.m_numAdditionalSubStreams >= 1 );
     623  WRITE_UVLC( sei.m_numAdditionalSubStreams - 1, "num_additional_sub_streams_minus1" );
     624
     625  for( Int i = 0; i < sei.m_numAdditionalSubStreams; i++ )
     626  {
     627    WRITE_CODE( sei.m_subBitstreamMode[i],       2, "sub_bitstream_mode[i]"           );
     628    WRITE_UVLC( sei.m_outputLayerSetIdxToVps[i],    "output_layer_set_idx_to_vps[i]"  );
     629    WRITE_CODE( sei.m_highestSublayerId[i],      3, "highest_sub_layer_id[i]"         );
     630    WRITE_CODE( sei.m_avgBitRate[i],            16, "avg_bit_rate[i]"                 );
     631    WRITE_CODE( sei.m_maxBitRate[i],            16, "max_bit_rate[i]"                 );
     632  }
     633  xWriteByteAlign();
     634}
     635#endif
    609636Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps)
    610637{
  • trunk/source/Lib/TLibEncoder/SEIwrite.h

    r442 r588  
    6464  Void xWriteSEIGradualDecodingRefreshInfo(const SEIGradualDecodingRefreshInfo &sei);
    6565  Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei);
    66 #if M0043_LAYERS_PRESENT_SEI
    67   Void xWriteSEILayersPresent(const SEILayersPresent& sei);
     66#if LAYERS_NOT_PRESENT_SEI
     67  Void xWriteSEILayersNotPresent(const SEILayersNotPresent& sei);
    6868#endif
    6969  Void xWriteSEISOPDescription(const SEISOPDescription& sei);
    7070#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
    7171  Void xWriteSEIInterLayerConstrainedTileSets(const SEIInterLayerConstrainedTileSets& sei);
     72#endif
     73#if SUB_BITSTREAM_PROPERTY_SEI
     74  Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei);
    7275#endif
    7376  Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps);
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r547 r588  
    579579  }
    580580  WRITE_FLAG( pcSPS->getTMVPFlagsPresent()  ? 1 : 0,           "sps_temporal_mvp_enable_flag" );
    581 #if REF_IDX_MFM
    582 #if !M0457_COL_PICTURE_SIGNALING
    583   if( pcSPS->getLayerId() > 0 )
    584   {
    585     WRITE_FLAG( pcSPS->getMFMEnabledFlag() ? 1 : 0,          "sps_enh_mfm_enable_flag" );
    586   }
    587 #endif
    588 #endif
    589581  WRITE_FLAG( pcSPS->getUseStrongIntraSmoothing(),             "sps_strong_intra_smoothing_enable_flag" );
    590582
     
    623615  // more syntax elements to be written here
    624616
    625 #if VERT_MV_CONSTRAINT
    626617  // Vertical MV component restriction is not used in SHVC CTC
    627618  WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" );
    628 #endif
     619
    629620  if( pcSPS->getLayerId() > 0 )
    630621  {
     
    642633    }
    643634  }
    644 #if M0463_VUI_EXT_ILP_REF
    645   ////   sps_extension_vui_parameters( )
    646   if( pcSPS->getVuiParameters()->getBitstreamRestrictionFlag() )
    647   { 
    648     WRITE_UVLC( pcSPS->getNumIlpRestrictedRefLayers( ),           "num_ilp_restricted_ref_layers" );
    649     for( Int i = 0; i < pcSPS->getNumIlpRestrictedRefLayers( ); i++ )
    650     { 
    651       WRITE_UVLC( pcSPS->getMinSpatialSegmentOffsetPlus1( i ),    "min_spatial_segment_offset_plus1" );
    652       if( pcSPS->getMinSpatialSegmentOffsetPlus1( i ) > 0 )
    653       { 
    654         WRITE_FLAG( pcSPS->getCtuBasedOffsetEnabledFlag( i ),      "ctu_based_offset_enabled_flag[ i ]");
    655         if( pcSPS->getCtuBasedOffsetEnabledFlag( i ) ) 
    656         {
    657           WRITE_UVLC( pcSPS->getMinHorizontalCtuOffsetPlus1( i ), "min_horizontal_ctu_offset_plus1[ i ]");
    658         }
    659       } 
    660     } 
    661   } 
    662   ////   sps_extension_vui_parameters( ) END
    663 #endif
    664635}
    665636#endif
    666637Void TEncCavlc::codeVPS( TComVPS* pcVPS )
    667638{
     639#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
    668640#if VPS_EXTN_OFFSET_CALC
    669641  UInt numBytesInVps = this->m_pcBitIf->getNumberOfWrittenBits();
    670642#endif
     643#endif
     644#if !P0307_REMOVE_VPS_VUI_OFFSET
    671645#if VPS_VUI_OFFSET
    672646   m_vpsVuiCounter = this->m_pcBitIf->getNumberOfWrittenBits();
     647#endif
    673648#endif
    674649  WRITE_CODE( pcVPS->getVPSId(),                    4,        "vps_video_parameter_set_id" );
     
    682657  WRITE_FLAG( pcVPS->getTemporalNestingFlag(),                "vps_temporal_id_nesting_flag" );
    683658  assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
     659#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
    684660#if VPS_EXTN_OFFSET
    685661  WRITE_CODE( pcVPS->getExtensionOffset(),         16,        "vps_extension_offset" );
     662#else
     663  WRITE_CODE( 0xffff,                              16,        "vps_reserved_ffff_16bits" );
     664#endif
    686665#else
    687666  WRITE_CODE( 0xffff,                              16,        "vps_reserved_ffff_16bits" );
     
    775754      WRITE_FLAG(1,                  "vps_extension_alignment_bit_equal_to_one");
    776755    }
     756#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
    777757#if VPS_EXTN_OFFSET_CALC
    778758    Int vpsExntOffsetValueInBits = this->m_pcBitIf->getNumberOfWrittenBits() - numBytesInVps + 16; // 2 bytes for NUH
     
    780760    pcVPS->setExtensionOffset( vpsExntOffsetValueInBits >> 3 );
    781761#endif
     762#endif
    782763    codeVPSExtension(pcVPS);
    783764    WRITE_FLAG( 0,                     "vps_extension2_flag" );   // Flag value of 1 reserved
     
    798779
    799780  WRITE_FLAG( vps->getAvcBaseLayerFlag(),              "avc_base_layer_flag" );
     781#if !P0307_REMOVE_VPS_VUI_OFFSET
    800782#if O0109_MOVE_VPS_VUI_FLAG
    801783#if !VPS_VUI
     
    819801  WRITE_FLAG( vps->getSplittingFlag(),                 "splitting_flag" );
    820802#endif // O0109_MOVE_VPS_VUI_FLAG
     803#endif
     804  WRITE_FLAG( vps->getSplittingFlag(),                 "splitting_flag" );
    821805
    822806  for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
     
    908892    }
    909893#endif
    910 #if JCTVC_M0203_INTERLAYER_PRED_IDC
    911894#if N0120_MAX_TID_REF_PRESENT_FLAG
    912895   WRITE_FLAG( vps->getMaxTidRefPresentFlag(), "max_tid_ref_present_flag");
     
    944927  }
    945928#endif
    946 #endif
    947929#if ILP_SSH_SIG
    948930    WRITE_FLAG( vps->getIlpSshSignalingEnabledFlag(), "all_ref_layers_active_flag" );
     
    950932#if VPS_EXTN_PROFILE_INFO
    951933  // Profile-tier-level signalling
     934#if !VPS_EXTN_UEV_CODING
    952935  WRITE_CODE( vps->getNumLayerSets() - 1   , 10, "vps_number_layer_sets_minus1" );     
    953936  WRITE_CODE( vps->getNumProfileTierLevel() - 1,  6, "vps_num_profile_tier_level_minus1");
     937#else
     938  WRITE_UVLC( vps->getNumProfileTierLevel() - 1, "vps_num_profile_tier_level_minus1");
     939#endif
    954940  for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++)
    955941  {
    956942    WRITE_FLAG( vps->getProfilePresentFlag(idx),       "vps_profile_present_flag[i]" );
     943#if !P0048_REMOVE_PROFILE_REF
    957944    if( !vps->getProfilePresentFlag(idx) )
    958945    {
    959946      WRITE_CODE( vps->getProfileLayerSetRef(idx) - 1, 6, "profile_ref_minus1[i]" );
    960947    }
     948#endif
    961949    codePTL( vps->getPTLForExtn(idx), vps->getProfilePresentFlag(idx), vps->getMaxTLayers() - 1 );
    962950  }
    963951#endif
    964952
     953#if !VPS_EXTN_UEV_CODING
    965954  Int numOutputLayerSets = vps->getNumOutputLayerSets() ;
    966955  WRITE_FLAG(  (numOutputLayerSets > vps->getNumLayerSets()), "more_output_layer_sets_than_default_flag" );
     
    969958    WRITE_CODE( numOutputLayerSets - vps->getNumLayerSets(), 10, "num_add_output_layer_sets" );
    970959  }
     960#else
     961  Int numOutputLayerSets = vps->getNumOutputLayerSets() ;
     962  assert( numOutputLayerSets - (Int)vps->getNumLayerSets() >= 0 );
     963  WRITE_UVLC( numOutputLayerSets - vps->getNumLayerSets(), "num_add_output_layer_sets" );
     964#endif
    971965  if( numOutputLayerSets > 1 )
    972966  {
     967#if P0295_DEFAULT_OUT_LAYER_IDC
     968    WRITE_CODE( vps->getDefaultTargetOutputLayerIdc(), 2, "default_target_output_layer_idc" );   
     969#else
    973970#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
    974971    WRITE_CODE( vps->getDefaultOneTargetOutputLayerIdc(), 2, "default_one_target_output_layer_idc" );   
     
    976973    WRITE_FLAG( vps->getDefaultOneTargetOutputLayerFlag(), "default_one_target_output_layer_flag" );   
    977974#endif
     975#endif
    978976  }
    979977
     
    987985        numBits++;
    988986      }
    989       WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, "output_layer_set_idx_minus1"); 
     987      WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, "output_layer_set_idx_minus1");
     988#if P0295_DEFAULT_OUT_LAYER_IDC
     989    }
     990    if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2
     991    {
     992#endif
    990993      Int lsIdx = vps->getOutputLayerSetIdx(i);
    991994      for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++)
     
    10151018  {
    10161019#if O0096_REP_FORMAT_INDEX
     1020#if !VPS_EXTN_UEV_CODING
    10171021    WRITE_CODE( vps->getVpsNumRepFormats() - 1, 8, "vps_num_rep_formats_minus1" );
     1022#else
     1023    WRITE_UVLC( vps->getVpsNumRepFormats() - 1, "vps_num_rep_formats_minus1" );
     1024#endif
    10181025#else
    10191026    WRITE_CODE( vps->getVpsNumRepFormats() - 1, 4, "vps_num_rep_formats_minus1" );
     
    10331040      {
    10341041#if O0096_REP_FORMAT_INDEX
     1042#if !VPS_EXTN_UEV_CODING
    10351043        WRITE_CODE( vps->getVpsRepFormatIdx(i), 8, "vps_rep_format_idx[i]" );
    10361044#else
     1045        Int numBits = 1;
     1046        while ((1 << numBits) < (vps->getVpsNumRepFormats()))
     1047        {
     1048          numBits++;
     1049        }
     1050        WRITE_CODE( vps->getVpsRepFormatIdx(i), numBits, "vps_rep_format_idx[i]" );
     1051#endif
     1052#else
    10371053        WRITE_CODE( vps->getVpsRepFormatIdx(i), 4, "vps_rep_format_idx[i]" );
    10381054#endif
     
    10421058#endif
    10431059
    1044 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    1045       WRITE_FLAG(vps->getMaxOneActiveRefLayerFlag(), "max_one_active_ref_layer_flag");
    1046 #endif
     1060  WRITE_FLAG(vps->getMaxOneActiveRefLayerFlag(), "max_one_active_ref_layer_flag");
    10471061#if O0062_POC_LSB_NOT_PRESENT_FLAG
    10481062  for(i = 1; i< vps->getMaxLayers(); i++)
     
    10611075#endif
    10621076#if VPS_DPB_SIZE_TABLE
    1063   for(i = 1; i < vps->getNumOutputLayerSets(); i++)
    1064   {
    1065     WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]"); 
    1066     for(j = 0; j < vps->getMaxTLayers(); j++)
    1067     {
    1068       if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
    1069       {
    1070         WRITE_FLAG( vps->getSubLayerDpbInfoPresentFlag( i, j), "sub_layer_dpb_info_present_flag[i]"); 
    1071       }
    1072       if( vps->getSubLayerDpbInfoPresentFlag(i, j) )
    1073       {
    1074         for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
    1075         {
    1076           WRITE_UVLC( vps->getMaxVpsDecPicBufferingMinus1( i, k, j), "max_vps_dec_pic_buffering_minus1[i][k][j]" );
    1077         }
    1078         WRITE_UVLC( vps->getMaxVpsNumReorderPics( i, j), "max_vps_num_reorder_pics[i][j]" );             
    1079         WRITE_UVLC( vps->getMaxVpsLatencyIncreasePlus1( i, j), "max_vps_latency_increase_plus1[i][j]" );       
    1080       }
    1081     }
    1082   }
    1083 #endif
    1084 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
     1077  codeVpsDpbSizeTable(vps);
     1078#endif
     1079#if VPS_EXTN_DIRECT_REF_LAYERS
    10851080  WRITE_UVLC( vps->getDirectDepTypeLen()-2,                           "direct_dep_type_len_minus2");
    10861081#if O0096_DEFAULT_DEPENDENCY_TYPE
     
    11261121#endif
    11271122
     1123#if P0307_VPS_NON_VUI_EXTENSION
     1124  WRITE_UVLC( vps->getVpsNonVuiExtLength(), "vps_non_vui_extension_length" );
     1125  if ( vps->getVpsNonVuiExtLength() > 0 )
     1126  {
     1127    printf("\n\nUp to the current spec, the value of vps_non_vui_extension_length is supposed to be 0\n");
     1128  }
     1129#endif
     1130
    11281131#if !O0109_MOVE_VPS_VUI_FLAG
    11291132#if !VPS_VUI
     
    11461149#endif
    11471150#else
     1151#if P0307_REMOVE_VPS_VUI_OFFSET
     1152  WRITE_FLAG( 1,                     "vps_vui_present_flag" );
     1153  vps->setVpsVuiPresentFlag(true);
     1154#endif
    11481155  if(vps->getVpsVuiPresentFlag())   // Should be conditioned on the value of vps_vui_present_flag
    11491156  {
     
    11521159      WRITE_FLAG(1,                  "vps_vui_alignment_bit_equal_to_one");
    11531160    }
     1161#if !P0307_REMOVE_VPS_VUI_OFFSET
    11541162#if VPS_VUI_OFFSET
    11551163    Int vpsVuiOffsetValeInBits = this->m_pcBitIf->getNumberOfWrittenBits() - m_vpsVuiCounter + 16; // 2 bytes for NUH
    11561164    assert( vpsVuiOffsetValeInBits % 8 == 0 );
    11571165    vps->setVpsVuiOffset( vpsVuiOffsetValeInBits >> 3 );
     1166#endif
    11581167#endif
    11591168    codeVPSVUI(vps); 
     
    12041213}
    12051214#endif
     1215#if VPS_DPB_SIZE_TABLE
     1216Void TEncCavlc::codeVpsDpbSizeTable(TComVPS *vps)
     1217{
     1218  for(Int i = 1; i < vps->getNumOutputLayerSets(); i++)
     1219  {
     1220#if CHANGE_NUMSUBDPB_IDX
     1221    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i );
     1222#endif
     1223    WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]"); 
     1224    for(Int j = 0; j < vps->getMaxTLayers(); j++)
     1225    {
     1226      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
     1227      {
     1228        WRITE_FLAG( vps->getSubLayerDpbInfoPresentFlag( i, j), "sub_layer_dpb_info_present_flag[i]"); 
     1229      }
     1230      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )
     1231      {
     1232#if CHANGE_NUMSUBDPB_IDX
     1233        for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++)
     1234#else
     1235        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
     1236#endif
     1237        {
     1238          WRITE_UVLC( vps->getMaxVpsDecPicBufferingMinus1( i, k, j), "max_vps_dec_pic_buffering_minus1[i][k][j]" );
     1239        }
     1240        WRITE_UVLC( vps->getMaxVpsNumReorderPics( i, j), "max_vps_num_reorder_pics[i][j]" );             
     1241#if RESOLUTION_BASED_DPB
     1242        if( vps->getNumSubDpbs(layerSetIdxForOutputLayerSet) != vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ) )  // NumSubDpbs
     1243        {
     1244          for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++)
     1245          {
     1246            WRITE_UVLC( vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j), "max_vps_layer_dec_pic_buff_minus1[i][k][j]" );
     1247          }
     1248        }
     1249#endif
     1250        WRITE_UVLC( vps->getMaxVpsLatencyIncreasePlus1( i, j), "max_vps_latency_increase_plus1[i][j]" );       
     1251      }
     1252    }
     1253  }
     1254}
     1255#endif
    12061256#if VPS_VUI
    12071257Void TEncCavlc::codeVPSVUI (TComVPS *vps)
     
    12511301  }
    12521302#endif
     1303#if VPS_VUI_VIDEO_SIGNAL_MOVE
     1304  WRITE_FLAG( vps->getVideoSigPresentVpsFlag(), "video_signal_info_idx_present_flag" );
     1305  if (vps->getVideoSigPresentVpsFlag())
     1306  {
     1307    WRITE_CODE(vps->getNumVideoSignalInfo()-1, 4, "vps_num_video_signal_info_minus1" );
     1308  }
     1309
     1310  for(i = 0; i < vps->getNumVideoSignalInfo(); i++)
     1311  {
     1312    WRITE_CODE(vps->getVideoVPSFormat(i), 3, "video_vps_format" );
     1313    WRITE_FLAG(vps->getVideoFullRangeVpsFlag(i), "video_full_range_vps_flag" );
     1314    WRITE_CODE(vps->getColorPrimaries(i), 8, "color_primaries_vps" );
     1315    WRITE_CODE(vps->getTransCharacter(i), 8, "transfer_characteristics_vps" );
     1316    WRITE_CODE(vps->getMaxtrixCoeff(i), 8, "matrix_coeffs_vps" );
     1317  }
     1318
     1319  if (vps->getVideoSigPresentVpsFlag() && vps->getNumVideoSignalInfo() > 1 )
     1320  {
     1321    for (i=1; i < vps->getMaxLayers(); i++)
     1322      WRITE_CODE(vps->getVideoSignalInfoIdx(i), 4, "vps_video_signal_info_idx" );
     1323  }
     1324#endif
    12531325#if VPS_VUI_TILES_NOT_IN_USE__FLAG
    12541326  UInt layerIdx;
     
    13041376#endif
    13051377#if N0160_VUI_EXT_ILP_REF
    1306   WRITE_FLAG( vps->getNumIlpRestrictedRefLayers() ? 1 : 0 , "num_ilp_restricted_ref_layers" );   
    1307   if( vps->getNumIlpRestrictedRefLayers())
     1378  WRITE_FLAG( vps->getIlpRestrictedRefLayersFlag() ? 1 : 0 , "ilp_restricted_ref_layers_flag" );   
     1379  if( vps->getIlpRestrictedRefLayersFlag())
    13081380  {
    13091381    for(i = 1; i < vps->getMaxLayers(); i++)
     
    13271399#endif
    13281400#if VPS_VUI_VIDEO_SIGNAL
     1401#if VPS_VUI_VIDEO_SIGNAL_MOVE
     1402#else
    13291403    WRITE_FLAG( vps->getVideoSigPresentVpsFlag(), "video_signal_info_idx_present_flag" );
    13301404    if (vps->getVideoSigPresentVpsFlag())
     
    13471421            WRITE_CODE(vps->getVideoSignalInfoIdx(i), 4, "vps_video_signal_info_idx" );
    13481422    }
     1423#endif
    13491424#endif
    13501425}
     
    16111686    }
    16121687
    1613 #if JCTVC_M0458_INTERLAYER_RPS_SIG
     1688#if SVC_EXTENSION
    16141689#if ILP_SSH_SIG
    16151690#if ILP_SSH_SIG_FIX
     
    16501725      }
    16511726    }     
    1652 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    1653     if( pcSlice->getNumSamplePredRefLayers() > 0 && pcSlice->getActiveNumILRRefIdx() > 0 )
    1654     {
    1655       WRITE_FLAG( pcSlice->getInterLayerSamplePredOnlyFlag(), "inter_layer_sample_pred_only_flag" );
    1656     }
    1657 #endif
    1658 #endif
     1727#endif //SVC_EXTENSION
    16591728
    16601729    if(pcSlice->getSPS()->getUseSAO())
     
    17721841    if ( pcSlice->getEnableTMVPFlag() )
    17731842    {
    1774 #if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    1775       if ( !pcSlice->getIdrPicFlag() && pcSlice->getLayerId() > 0 && pcSlice->getActiveNumILRRefIdx() > 0 && pcSlice->getNumMotionPredRefLayers() > 0 )
    1776       {
    1777         WRITE_FLAG( pcSlice->getAltColIndicationFlag() ? 1 : 0, "alt_collocated_indication_flag" );
    1778         if (pcSlice->getAltColIndicationFlag() && pcSlice->getNumMotionPredRefLayers() > 1)
    1779         {
    1780           WRITE_UVLC(0, "collocated_ref_layer_idx");
    1781         }
    1782       }
    1783       else
    1784       {
    1785 #endif
    17861843      if ( pcSlice->getSliceType() == B_SLICE )
    17871844      {
     
    17951852        WRITE_UVLC( pcSlice->getColRefIdx(), "collocated_ref_idx" );
    17961853      }
    1797 #if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    1798       }
    1799 #endif
    18001854    }
    18011855    if ( (pcSlice->getPPS()->getUseWP() && pcSlice->getSliceType()==P_SLICE) || (pcSlice->getPPS()->getWPBiPred() && pcSlice->getSliceType()==B_SLICE) )
  • trunk/source/Lib/TLibEncoder/TEncCavlc.h

    r547 r588  
    6868  TComSlice*    m_pcSlice;
    6969  UInt          m_uiCoeffCost;
     70#if !P0307_REMOVE_VPS_VUI_OFFSET
    7071#if VPS_VUI_OFFSET
    7172  Int m_vpsVuiCounter;
     73#endif
    7274#endif
    7375  Void codeShortTermRefPicSet              ( TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx );
     
    9597#if REPN_FORMAT_IN_VPS
    9698  Void  codeRepFormat           ( RepFormat *repFormat );
     99#endif
     100#if VPS_DPB_SIZE_TABLE
     101  Void  codeVpsDpbSizeTable      (TComVPS *vps);
    97102#endif
    98103  Void  codeVUI                 ( TComVUI *pcVUI, TComSPS* pcSPS );
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r540 r588  
    168168  Int       m_numActiveRefLayers;
    169169  Int       m_predLayerId[MAX_VPS_LAYER_ID_PLUS1];
    170 #if M0457_PREDICTION_INDICATIONS
    171170  Int       m_numSamplePredRefLayers;
    172171  Int       m_samplePredRefLayerId[MAX_VPS_LAYER_ID_PLUS1];
     
    175174  Bool      m_samplePredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1];
    176175  Bool      m_motionPredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1];
    177 #endif
    178176#endif
    179177#if N0120_MAX_TID_REF_CFG
     
    307305  Int       m_gradualDecodingRefreshInfoEnabled;
    308306  Int       m_decodingUnitInfoSEIEnabled;
    309 #if M0043_LAYERS_PRESENT_SEI
    310   Int       m_layersPresentSEIEnabled;
     307#if LAYERS_NOT_PRESENT_SEI
     308  Int       m_layersNotPresentSEIEnabled;
    311309#endif
    312310  Int       m_SOPDescriptionSEIEnabled;
     
    452450  Void      setPredLayerId                  (Int i, Int refLayerId)         { m_predLayerId[i] = refLayerId;    }
    453451
    454 #if M0457_PREDICTION_INDICATIONS
    455452  Int       getNumSamplePredRefLayers       ()                              { return m_numSamplePredRefLayers;  }
    456453  Void      setNumSamplePredRefLayers       (Int num)                       { m_numSamplePredRefLayers = num;   }
     
    470467  Bool      getMotionPredEnabledFlag        (Int i)                         { return m_motionPredEnabledFlag[i];  }
    471468  Void      setMotionPredEnabledFlag        (Int i,Bool flag)               { m_motionPredEnabledFlag[i] = flag;  }
    472 #endif
    473469#endif
    474470#if N0120_MAX_TID_REF_CFG
     
    752748  Void  setDecodingUnitInfoSEIEnabled(Int b)                { m_decodingUnitInfoSEIEnabled = b;    }
    753749  Int   getDecodingUnitInfoSEIEnabled()                     { return m_decodingUnitInfoSEIEnabled; }
    754 #if M0043_LAYERS_PRESENT_SEI
    755   Void  setLayersPresentSEIEnabled(Int b)                { m_layersPresentSEIEnabled = b; }
    756   Int   getLayersPresentSEIEnabled()                     { return m_layersPresentSEIEnabled; }
     750#if LAYERS_NOT_PRESENT_SEI
     751  Void  setLayersNotPresentSEIEnabled(Int b)             { m_layersNotPresentSEIEnabled = b; }
     752  Int   getLayersNotPresentSEIEnabled()                  { return m_layersNotPresentSEIEnabled; }
    757753#endif
    758754  Void  setSOPDescriptionSEIEnabled(Int b)                { m_SOPDescriptionSEIEnabled = b; }
  • trunk/source/Lib/TLibEncoder/TEncCu.cpp

    r540 r588  
    462462        testInter = false;
    463463      }
    464 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    465       if( pcSlice->getInterLayerSamplePredOnlyFlag() )
    466       {
    467         testInter = false;
    468       }
    469 #endif
    470464    }
    471465#endif
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r547 r588  
    167167}
    168168
    169 #if M0043_LAYERS_PRESENT_SEI
    170 SEILayersPresent* TEncGOP::xCreateSEILayersPresent ()
     169#if LAYERS_NOT_PRESENT_SEI
     170SEILayersNotPresent* TEncGOP::xCreateSEILayersNotPresent ()
    171171{
    172172  UInt i = 0;
    173   SEILayersPresent *seiLayersPresent = new SEILayersPresent();
    174   seiLayersPresent->m_activeVpsId = m_pcCfg->getVPS()->getVPSId();
    175   seiLayersPresent->m_vpsMaxLayers = m_pcCfg->getVPS()->getMaxLayers();
    176   for ( ; i < seiLayersPresent->m_vpsMaxLayers; i++)
    177   {
    178     seiLayersPresent->m_layerPresentFlag[i] = true;
     173  SEILayersNotPresent *seiLayersNotPresent = new SEILayersNotPresent();
     174  seiLayersNotPresent->m_activeVpsId = m_pcCfg->getVPS()->getVPSId();
     175  seiLayersNotPresent->m_vpsMaxLayers = m_pcCfg->getVPS()->getMaxLayers();
     176  for ( ; i < seiLayersNotPresent->m_vpsMaxLayers; i++)
     177  {
     178    seiLayersNotPresent->m_layerNotPresentFlag[i] = true;
    179179  }
    180180  for ( ; i < MAX_LAYERS; i++)
    181181  {
    182     seiLayersPresent->m_layerPresentFlag[i] = false;
    183   }
    184   return seiLayersPresent;
     182    seiLayersNotPresent->m_layerNotPresentFlag[i] = false;
     183  }
     184  return seiLayersNotPresent;
    185185}
    186186#endif
     
    363363  }
    364364
    365 #if M0043_LAYERS_PRESENT_SEI
    366   if(m_pcCfg->getLayersPresentSEIEnabled())
    367   {
    368     SEILayersPresent *sei = xCreateSEILayersPresent ();
     365#if LAYERS_NOT_PRESENT_SEI
     366  if(m_pcCfg->getLayersNotPresentSEIEnabled())
     367  {
     368    SEILayersNotPresent *sei = xCreateSEILayersNotPresent ();
    369369    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    370370    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
     
    690690      pcSlice->setActiveNumILRRefIdx(0);
    691691      pcSlice->setInterLayerPredEnabledFlag(false);
    692 #if M0457_COL_PICTURE_SIGNALING
    693692      pcSlice->setMFMEnabledFlag(false);
    694 #if !REMOVE_COL_PICTURE_SIGNALING
    695       pcSlice->setAltColIndicationFlag(false);
    696 #endif
    697 #endif
    698     }
    699 #endif
    700 
    701 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    702     pcSlice->setNumSamplePredRefLayers( m_pcEncTop->getNumSamplePredRefLayers() );
    703     pcSlice->setInterLayerSamplePredOnlyFlag( 0 );
    704     if( pcSlice->getNumSamplePredRefLayers() > 0 && pcSlice->getActiveNumILRRefIdx() > 0 )
    705     {
    706       if( m_pcEncTop->getIlSampleOnlyPred() > 0 )
    707       {
    708         pcSlice->setInterLayerSamplePredOnlyFlag( true );
    709       }
    710693    }
    711694#endif
     
    11591142    if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() )
    11601143    {
    1161 #if RESTR_CHK
    11621144#if POC_RESET_FLAG
    11631145      if ( pocCurr > 0          && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL())
     
    11661148#endif
    11671149      {
    1168 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    11691150        pcSlice->setActiveNumILRRefIdx(0);
    11701151        pcSlice->setInterLayerPredEnabledFlag(0);
    1171 #else
    1172         pcSlice->setNumILRRefIdx(0);
    1173 #endif
    1174       }
    1175 #endif
    1176 #if JCTVC_M0458_INTERLAYER_RPS_SIG
     1152      }
    11771153      if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA )
    11781154      {
     
    11851161        pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getNumRefIdx(REF_PIC_LIST_1)+pcSlice->getActiveNumILRRefIdx());
    11861162      }
    1187 #else
    1188       if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA )
    1189       {
    1190         pcSlice->setNumRefIdx(REF_PIC_LIST_0, pcSlice->getNumILRRefIdx());
    1191         pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getNumILRRefIdx());
    1192       }
    1193       else
    1194       {
    1195         pcSlice->setNumRefIdx(REF_PIC_LIST_0, pcSlice->getNumRefIdx(REF_PIC_LIST_0)+pcSlice->getNumILRRefIdx());
    1196         pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getNumRefIdx(REF_PIC_LIST_1)+pcSlice->getNumILRRefIdx());
    1197       }
    1198 #endif
    11991163    }
    12001164#endif //SVC_EXTENSION
     
    12051169
    12061170#if SVC_EXTENSION
    1207 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    1208     if ( pcSlice->getSliceType() == B_SLICE && !(pcSlice->getActiveNumILRRefIdx() > 0 && m_pcEncTop->getNumMotionPredRefLayers() > 0) )
    1209 #else
    12101171    if( pcSlice->getSliceType() == B_SLICE )
    1211 #endif
    12121172    {
    12131173      pcSlice->setColFromL0Flag(1-uiColDir);
     
    12241184      pcSlice->setILRPic( m_pcEncTop->getIlpList() );
    12251185#if REF_IDX_MFM
    1226 #if M0457_COL_PICTURE_SIGNALING
    12271186      if( pcSlice->getMFMEnabledFlag() )
    1228 #else
    1229       if( pcSlice->getSPS()->getMFMEnabledFlag() )
    1230 #endif
    12311187      {
    12321188        pcSlice->setRefPOCListILP(m_pcEncTop->getIlpList(), pcSlice->getBaseColPic());
    1233 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    1234         pcSlice->setMotionPredIlp(getMotionPredIlp(pcSlice));
    1235 #endif
    12361189      }
    12371190#else
     
    12431196
    12441197#if REF_IDX_MFM
    1245 #if M0457_COL_PICTURE_SIGNALING
    1246 #if REMOVE_COL_PICTURE_SIGNALING
    12471198      if( pcSlice->getMFMEnabledFlag() )
    1248 #else
    1249       if( pcSlice->getMFMEnabledFlag() && !(pcSlice->getActiveNumILRRefIdx() > 0 && m_pcEncTop->getNumMotionPredRefLayers() > 0) )
    1250 #endif
    1251 #else
    1252       if( pcSlice->getSPS()->getMFMEnabledFlag() )
    1253 #endif
    12541199      {
    12551200        Bool found         = false;
     
    13081253    }
    13091254
    1310 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    1311     if (pcSlice->getSliceType() == B_SLICE && m_pcEncTop->getIlSampleOnlyPred() == 0)
    1312 #else
    13131255    if (pcSlice->getSliceType() == B_SLICE)
    1314 #endif
    13151256    {
    13161257#if !SVC_EXTENSION
     
    16171558#if O0194_WEIGHTED_PREDICTION_CGS
    16181559      // Calculate for the base layer to be used in EL as Inter layer reference
    1619       m_pcSliceEncoder->estimateILWpParam( pcSlice );
     1560      if( m_pcEncTop->getInterLayerWeightedPredFlag() )
     1561      {
     1562        m_pcSliceEncoder->estimateILWpParam( pcSlice );
     1563      }
    16201564#endif
    16211565#if AVC_SYNTAX
     
    17561700      // The following code also calculates the VPS VUI offset
    17571701#endif
     1702#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
    17581703#if VPS_EXTN_OFFSET_CALC
    17591704      OutputNALUnit tempNalu(NAL_UNIT_VPS, 0, 0        ); // The value of nuh_layer_id of VPS NAL unit shall be equal to 0.
    17601705      m_pcEntropyCoder->setBitstream(&tempNalu.m_Bitstream);
    17611706      m_pcEntropyCoder->encodeVPS(m_pcEncTop->getVPS());  // Use to calculate the VPS extension offset
     1707#endif
    17621708#endif
    17631709      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     
    20682014            startCUAddrSliceSegmentIdx++;
    20692015          }
    2070 #if SVC_EXTENSION && M0457_COL_PICTURE_SIGNALING
     2016#if SVC_EXTENSION
    20712017          pcSlice->setNumMotionPredRefLayers(m_pcEncTop->getNumMotionPredRefLayers());
    20722018#endif
     
    31113057
    31123058#if SVC_EXTENSION
    3113 #if ADAPTIVE_QP_SELECTION
    3114   printf("POC %4d LId: %1d TId: %1d ( %c-SLICE, nQP %d QP %d ) %10d bits",
     3059#if ADAPTIVE_QP_SELECTION 
     3060  printf("POC %4d LId: %1d TId: %1d ( %c-SLICE %s, nQP %d QP %d ) %10d bits",
    31153061         pcSlice->getPOC(),
    31163062         pcSlice->getLayerId(),
    31173063         pcSlice->getTLayer(),
    31183064         c,
     3065         NaluToStr( pcSlice->getNalUnitType() ).data(),
    31193066         pcSlice->getSliceQpBase(),
    31203067         pcSlice->getSliceQp(),
    31213068         uibits );
    31223069#else
    3123   printf("POC %4d LId: %1d TId: %1d ( %c-SLICE, QP %d ) %10d bits",
     3070  printf("POC %4d LId: %1d TId: %1d ( %c-SLICE %s, QP %d ) %10d bits",
    31243071         pcSlice->getPOC()-pcSlice->getLastIDR(),
    31253072         pcSlice->getLayerId(),
    31263073         pcSlice->getTLayer(),
    31273074         c,
     3075         NaluToStr( pcSlice->getNalUnitType() ).data().
    31283076         pcSlice->getSliceQp(),
    31293077         uibits );
     
    37503698  free(rowSAD);
    37513699}
    3752 
    3753 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    3754 TComPic* TEncGOP::getMotionPredIlp(TComSlice* pcSlice)
    3755 {
    3756   TComPic* ilpPic = NULL;
    3757   Int activeMotionPredReflayerIdx = 0;
    3758 
    3759   for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
    3760   {
    3761     UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
    3762     if( m_pcEncTop->getMotionPredEnabledFlag( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) ) )
    3763     {
    3764       if (activeMotionPredReflayerIdx == pcSlice->getColRefLayerIdx())
    3765       {
    3766         ilpPic = m_pcEncTop->getIlpList()[refLayerIdc];
    3767         break;
    3768       }
    3769       else
    3770       {
    3771         activeMotionPredReflayerIdx++;
    3772       }
    3773     }
    3774   }
    3775 
    3776   assert(ilpPic != NULL);
    3777 
    3778   return ilpPic;
    3779 }
    3780 #endif
    3781 
    37823700//! \}
  • trunk/source/Lib/TLibEncoder/TEncGOP.h

    r442 r588  
    181181
    182182  SEIActiveParameterSets* xCreateSEIActiveParameterSets (TComSPS *sps);
    183 #if M0043_LAYERS_PRESENT_SEI
    184   SEILayersPresent*       xCreateSEILayersPresent ();
     183#if LAYERS_NOT_PRESENT_SEI
     184  SEILayersNotPresent*    xCreateSEILayersNotPresent ();
    185185#endif
    186186  SEIFramePacking*        xCreateSEIFramePacking();
     
    210210#endif
    211211  Void dblMetric( TComPic* pcPic, UInt uiNumSlices );
    212 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    213   TComPic* getMotionPredIlp(TComSlice* pcSlice);
    214 #endif
    215212};// END CLASS DEFINITION TEncGOP
    216213
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r540 r588  
    523523  if( layerId > 0 )
    524524  {
    525 #if JCTVC_M0458_INTERLAYER_RPS_SIG
    526525    if( rpcSlice->getNumILRRefIdx() > 0 )
    527526    {
     
    533532      rpcSlice->setInterLayerPredEnabledFlag(1);
    534533    }
    535 #else
    536     rpcSlice->setNumILRRefIdx( rpcSlice->getVPS()->getNumDirectRefLayers( layerId ) );
    537 #endif
    538 #if M0457_COL_PICTURE_SIGNALING
    539534    rpcSlice->setMFMEnabledFlag(m_ppcTEncTop[layerId]->getMFMEnabledFlag());
    540 #if !REMOVE_COL_PICTURE_SIGNALING
    541     rpcSlice->setAltColIndicationFlag(rpcSlice->getMFMEnabledFlag());
    542 #endif
    543 #endif
    544535  }
    545536
     
    820811  }
    821812#if O0194_WEIGHTED_PREDICTION_CGS
    822   else
     813  else if( m_ppcTEncTop[pcSlice->getLayerId()]->getInterLayerWeightedPredFlag() )
    823814  {
    824815    // Calculate for the base layer to be used in EL as Inter layer reference
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r540 r588  
    934934#if SVC_EXTENSION
    935935  m_cSPS.setLayerId(m_layerId);
    936 #if REF_IDX_MFM
    937 #if !M0457_COL_PICTURE_SIGNALING
    938   m_cSPS.setMFMEnabledFlag(m_bMFMEnabledFlag);
    939 #endif
    940 #endif
    941936  m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets);
    942937  for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++)
     
    16321627    if (m_cIlpPic[0] == NULL)
    16331628    {
    1634       for (Int j=0; j < MAX_LAYERS /*MAX_NUM_REF*/; j++) // consider to set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]]
     1629      for (Int j=0; j < m_numLayer; j++) // consider to set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]]
    16351630      {
    16361631        m_cIlpPic[j] = new  TComPic;
     
    16991694    if (m_cIlpPic[0] == NULL)
    17001695    {
    1701       for (Int j=0; j < MAX_LAYERS /*MAX_NUM_REF*/; j++) // consider to set to NumDirectRefLayers[LayerIdInVps[nuh_layer_id]]
     1696      for (Int j=0; j < m_numDirectRefLayers; j++)
    17021697      {
    17031698        m_cIlpPic[j] = new  TComPic;
  • trunk/source/Lib/TLibEncoder/TEncTop.h

    r540 r588  
    137137  Bool                    m_bMFMEnabledFlag;
    138138#endif
    139 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    140   Int                     m_ilSampleOnlyPred;
    141 #endif
    142139  UInt                    m_numScaledRefLayerOffsets;
    143140#if O0098_SCALED_REF_LAYER_ID
     
    153150  Bool                    m_firstPicInLayerDecodedFlag;
    154151  Bool                    m_noOutputOfPriorPicsFlags;
     152#endif
     153#if O0194_WEIGHTED_PREDICTION_CGS
     154  Bool                    m_interLayerWeightedPredFlag;
    155155#endif
    156156#endif //SVC_EXTENSION
     
    237237  Bool      getMFMEnabledFlag()                   {return m_bMFMEnabledFlag;}   
    238238#endif
    239 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    240   Void      setIlSampleOnlyPred( Int i )          { m_ilSampleOnlyPred = i;    }
    241   Int       getIlSampleOnlyPred()                 { return m_ilSampleOnlyPred; }
     239#if O0194_WEIGHTED_PREDICTION_CGS
     240  Void      setInterLayerWeightedPredFlag(Bool flag)   { m_interLayerWeightedPredFlag = flag; }
     241  Bool      getInterLayerWeightedPredFlag()            { return m_interLayerWeightedPredFlag; }
    242242#endif
    243243#if AVC_SYNTAX
Note: See TracChangeset for help on using the changeset viewer.