Changeset 588 in SHVCSoftware for trunk/source/App/TAppEncoder


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

merge with SHM-5.0-dev

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • 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();
Note: See TracChangeset for help on using the changeset viewer.