Changeset 516 in SHVCSoftware


Ignore:
Timestamp:
17 Dec 2013, 10:27:32 (11 years ago)
Author:
qualcomm
Message:

DPB-information for output layer sets in the VPS extension. (MACRO: VPS_DPB_SIZE_TABLE)

Includes DPB-table signaling for output layer sets in the VPS extension.

From: Adarsh K. Ramasubramonian <aramasub@…>

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

Legend:

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

    r514 r516  
    9090    vps->setMaxDecPicBuffering             ( m_maxDecPicBuffering[i], i );
    9191  }
     92
    9293#if REPN_FORMAT_IN_VPS
    9394  vps->setRepFormatIdxPresentFlag( true );   // Could be disabled to optimize in some cases.
     
    11911192  }
    11921193#endif
     1194 #if VPS_DPB_SIZE_TABLE
     1195  // The Layer ID List variables can be derived here. 
     1196#if DERIVE_LAYER_ID_LIST_VARIABLES
     1197  vps->deriveLayerIdListVariables();
     1198#endif
     1199  vps->deriveNumberOfSubDpbs();
     1200  // Initialize dpb_size_table() for all ouput layer sets in the VPS extension
     1201  for(i = 1; i < vps->getNumOutputLayerSets(); i++)
     1202  {
     1203    Int layerSetId = vps->getOutputLayerSetIdx(i);
     1204
     1205    // For each output layer set, set the DPB size for each layer and the reorder/latency value the maximum for all layers
     1206    Bool checkFlagOuter = false;      // Used to calculate sub_layer_flag_info_present_flag
     1207    Bool checkFlagInner[MAX_TLAYER];  // Used to calculate sub_layer_dpb_info_present_flag
     1208
     1209    for(Int j = 0; j < vps->getMaxTLayers(); j++)
     1210    {
     1211
     1212      Int maxNumReorderPics = -1;
     1213      for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
     1214      {
     1215        Int layerId = vps->getLayerSetLayerIdList(layerSetId, k); // k-th layer in the output layer set
     1216        vps->setMaxVpsDecPicBufferingMinus1( i, k, j,  m_acTEncTop[layerId].getMaxDecPicBuffering(j) );
     1217        maxNumReorderPics       = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j));
     1218      }
     1219      vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics);
     1220     
     1221      if( j == 0 )  // checkFlagInner[0] is always 1
     1222      {
     1223        checkFlagInner[j] = true;     // Always signal sub-layer DPB information for the first sub-layer
     1224      }
     1225      else
     1226      {
     1227        checkFlagInner[j] = false;    // Initialize to be false. If the values of the current sub-layers matches with the earlier sub-layer,
     1228                                      // then will be continue to be false - i.e. the j-th sub-layer DPB info is not signaled
     1229        checkFlagInner[j] |= ( maxNumReorderPics != vps->getMaxVpsNumReorderPics(i, j - 1) );
     1230        for(Int k = 0; k < vps->getNumSubDpbs(i) && !checkFlagInner[j]; k++)  // If checkFlagInner[j] is true, break and signal the values
     1231        {
     1232          checkFlagInner[j] |= ( vps->getMaxVpsDecPicBufferingMinus1(i, k, j - 1) != vps->getMaxVpsDecPicBufferingMinus1(i, k, j) );
     1233        }
     1234      }
     1235      // If checkFlagInner[j] = true, then some value needs to be signalled for the j-th sub-layer
     1236      vps->setSubLayerDpbInfoPresentFlag( i, j, checkFlagInner[j] );
     1237    }
     1238    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
     1239    {
     1240      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )
     1241      {
     1242        checkFlagOuter = true;
     1243        break;
     1244      }
     1245    }
     1246    vps->setSubLayerFlagInfoPresentFlag( i, checkFlagOuter );
     1247  }
     1248#endif
    11931249#if VPS_EXTN_DIRECT_REF_LAYERS
    11941250  // Direct reference layers
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.cpp

    r507 r516  
    946946    numRpsCurrTempList += getNumILRRefIdx();
    947947#endif
    948   }
     948}
    949949#endif
    950950
     
    21442144  }
    21452145#endif
     2146#if VPS_DPB_SIZE_TABLE
     2147  ::memset( m_subLayerFlagInfoPresentFlag,  0, sizeof(m_subLayerFlagInfoPresentFlag ) );
     2148  ::memset( m_subLayerDpbInfoPresentFlag,   0, sizeof(m_subLayerDpbInfoPresentFlag )  );
     2149  ::memset( m_maxVpsDecPicBufferingMinus1,  0, sizeof(m_maxVpsDecPicBufferingMinus1 ) );
     2150  ::memset( m_maxVpsNumReorderPics,         0, sizeof(m_maxVpsNumReorderPics )        );
     2151  ::memset( m_maxVpsLatencyIncreasePlus1,   0, sizeof(m_maxVpsLatencyIncreasePlus1 )  );
     2152  ::memset( m_numSubDpbs                ,   0, sizeof(m_numSubDpbs)                   );
     2153#endif
    21462154}
    21472155#else
     
    21932201    }
    21942202    setNumLayersInIdList(i, n);
     2203  }
     2204}
     2205#endif
     2206#if VPS_DPB_SIZE_TABLE
     2207Void TComVPS::deriveNumberOfSubDpbs()
     2208{
     2209  // Derive number of sub-DPBs
     2210  // For output layer set 0
     2211  setNumSubDpbs(0, 1);
     2212  // For other output layer sets
     2213  for( Int i = 1; i < getNumOutputLayerSets(); i++)
     2214  {
     2215    setNumSubDpbs( i, getNumLayersInIdList( getOutputLayerSetIdx(i)) );
    21952216  }
    21962217}
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.h

    r514 r516  
    642642  Bool       m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];  // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer
    643643#endif
     644#if VPS_DPB_SIZE_TABLE
     645  Bool    m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1];
     646  Bool    m_subLayerDpbInfoPresentFlag  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
     647  Int     m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER];
     648  Int     m_maxVpsNumReorderPics        [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
     649  Int     m_maxVpsLatencyIncreasePlus1  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
     650  Int     m_numSubDpbs                  [MAX_VPS_OP_LAYER_SETS_PLUS1];
     651#endif
    644652#endif //SVC_EXTENSION
    645653public:
     
    707715  Void    deriveLayerIdListVariables();
    708716#endif
    709 
     717#if VPS_DPB_SIZE_TABLE
     718Void      deriveNumberOfSubDpbs();
     719#endif
    710720#if IL_SL_SIGNALLING_N0371
    711721  Bool    checkLayerDependency(UInt i, UInt j);
     
    928938  Bool   getPhaseAlignFlag()                             { return m_phaseAlignFlag; }
    929939  Void   setPhaseAlignFlag(Bool x)                       { m_phaseAlignFlag = x;    }
     940#endif
     941#if VPS_DPB_SIZE_TABLE
     942  Bool    getSubLayerFlagInfoPresentFlag(Int i)         {return m_subLayerFlagInfoPresentFlag[i]; }
     943  Void    setSubLayerFlagInfoPresentFlag(Int i, Bool x) {m_subLayerFlagInfoPresentFlag[i] = x;    }
     944
     945  Bool    getSubLayerDpbInfoPresentFlag(Int i, Int j)         {return m_subLayerDpbInfoPresentFlag[i][j]; }
     946  Void    setSubLayerDpbInfoPresentFlag(Int i, Int j, Bool x) {m_subLayerDpbInfoPresentFlag[i][j] = x;    }
     947
     948  Int     getMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j)         { return m_maxVpsDecPicBufferingMinus1[i][k][j]; }
     949  Void    setMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j, Int x) { m_maxVpsDecPicBufferingMinus1[i][k][j] = x;    }
     950
     951  Int     getMaxVpsNumReorderPics(Int i, Int j)         { return m_maxVpsNumReorderPics[i][j]; }
     952  Void    setMaxVpsNumReorderPics(Int i, Int j, Int x) { m_maxVpsNumReorderPics[i][j] = x;    }
     953
     954  Int     getMaxVpsLatencyIncreasePlus1(Int i, Int j)         { return m_maxVpsLatencyIncreasePlus1[i][j]; }
     955  Void    setMaxVpsLatencyIncreasePlus1(Int i, Int j, Int x) { m_maxVpsLatencyIncreasePlus1[i][j] = x;    }
     956
     957  Int     getNumSubDpbs(Int i)                          { return m_numSubDpbs[i]; }
     958  Void    setNumSubDpbs(Int i, Int x)                   { m_numSubDpbs[i] = x;    }
    930959#endif
    931960#endif //SVC_EXTENSION
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TypeDef.h

    r515 r516  
    188188#define O0153_ALT_OUTPUT_LAYER_FLAG      1      ///< JCTVC-O0153: alt output layer flag
    189189
     190#define VPS_DPB_SIZE_TABLE               1      ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters
    190191#else
    191192#define SYNTAX_OUTPUT                    0
     
    206207#define MAX_VPS_NUM_SCALABILITY_TYPES             16
    207208#endif
     209#define MAX_VPS_OP_LAYER_SETS_PLUS1               3
    208210#if VPS_RENAME
    209211#define MAX_VPS_LAYER_SETS_PLUS1                  1024
  • branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r515 r516  
    12591259    else
    12601260    {
     1261#if VPS_DPB_SIZE_TABLE
     1262      vps->setOutputLayerSetIdx( i, i );
     1263#endif
    12611264      // i <= (vps->getNumLayerSets() - 1)
    12621265      // Assign OutputLayerFlag depending on default_one_target_output_layer_flag
     
    13721375#endif
    13731376
     1377#if VPS_DPB_SIZE_TABLE
     1378  vps->deriveNumberOfSubDpbs();
     1379  for(i = 1; i < vps->getNumOutputLayerSets(); i++)
     1380  {
     1381    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]");  vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false );
     1382    for(j = 0; j < vps->getMaxTLayers(); j++)
     1383    {
     1384      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
     1385      {
     1386        READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag[i]");  vps->setSubLayerDpbInfoPresentFlag( i, j, uiCode ? true : false);
     1387      }
     1388      else
     1389      {
     1390        if( j == 0 )  // Always signal for the first sub-layer
     1391        {
     1392          vps->setSubLayerDpbInfoPresentFlag( i, j, true );
     1393        }
     1394        else // if (j != 0) && !vps->getSubLayerFlagInfoPresentFlag(i)
     1395        {
     1396          vps->setSubLayerDpbInfoPresentFlag( i, j, false );
     1397        }
     1398      }
     1399      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )  // If sub-layer DPB information is present
     1400      {
     1401        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
     1402        {
     1403          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
     1404        }
     1405        READ_UVLC( uiCode, "max_vps_num_reorder_pics[i][j]" );              vps->setMaxVpsNumReorderPics( i, j, uiCode);
     1406        READ_UVLC( uiCode, "max_vps_latency_increase_plus1[i][j]" );        vps->setMaxVpsLatencyIncreasePlus1( i, j, uiCode);
     1407      }
     1408    }
     1409  }
     1410#endif
    13741411#if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
    13751412  READ_UVLC( uiCode,           "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2);
  • branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r515 r516  
    10791079  WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag");
    10801080#endif
     1081#if VPS_DPB_SIZE_TABLE
     1082  for(i = 1; i < vps->getNumOutputLayerSets(); i++)
     1083  {
     1084    WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]"); 
     1085    for(j = 0; j < vps->getMaxTLayers(); j++)
     1086    {
     1087      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
     1088      {
     1089        WRITE_FLAG( vps->getSubLayerDpbInfoPresentFlag( i, j), "sub_layer_dpb_info_present_flag[i]"); 
     1090      }
     1091      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )
     1092      {
     1093        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
     1094        {
     1095          WRITE_UVLC( vps->getMaxVpsDecPicBufferingMinus1( i, k, j), "max_vps_dec_pic_buffering_minus1[i][k][j]" );
     1096        }
     1097        WRITE_UVLC( vps->getMaxVpsNumReorderPics( i, j), "max_vps_num_reorder_pics[i][j]" );             
     1098        WRITE_UVLC( vps->getMaxVpsLatencyIncreasePlus1( i, j), "max_vps_latency_increase_plus1[i][j]" );       
     1099      }
     1100    }
     1101  }
     1102#endif
    10811103#if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
    10821104  WRITE_UVLC( vps->getDirectDepTypeLen()-2,                           "direct_dep_type_len_minus2");
Note: See TracChangeset for help on using the changeset viewer.