Ticket #1053: L0323.patch

File L0323.patch, 8.8 KB (added by peisongc, 9 years ago)
  • source/App/TAppEncoder/TAppEncCfg.cpp

     
    11511151  for(Int i=0; i<MAX_TLAYER; i++)
    11521152  {
    11531153    m_numReorderPics[i] = 0;
     1154#if L0323_DPB
     1155    m_maxDecPicBuffering[i] = 1;
     1156#else
    11541157    m_maxDecPicBuffering[i] = 0;
     1158#endif
    11551159  }
    11561160  for(Int i=0; i<m_iGOPSize; i++)
    11571161  {
     1162#if L0323_DPB
     1163    if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
     1164#else
    11581165    if(m_GOPList[i].m_numRefPics > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
     1166#endif
    11591167    {
     1168#if L0323_DPB
     1169      m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1;
     1170#else
    11601171      m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics;
     1172#endif
    11611173    }
    11621174    Int highestDecodingNumberWithLowerPOC = 0;
    11631175    for(Int j=0; j<m_iGOPSize; j++)
     
    11881200    {
    11891201      m_numReorderPics[i+1] = m_numReorderPics[i];
    11901202    }
     1203#if L0323_DPB
     1204    // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive
     1205    if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1)
     1206    {
     1207      m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1;
     1208    }
     1209#else
    11911210    // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive
    11921211    if(m_numReorderPics[i] > m_maxDecPicBuffering[i])
    11931212    {
    11941213      m_maxDecPicBuffering[i] = m_numReorderPics[i];
    11951214    }
     1215#endif
    11961216    // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer
    11971217    if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i])
    11981218    {
    11991219      m_maxDecPicBuffering[i+1] = m_maxDecPicBuffering[i];
    12001220    }
    12011221  }
     1222
     1223
     1224#if L0323_DPB
     1225  // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] -  1, inclusive
     1226  if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1)
     1227  {
     1228    m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1;
     1229  }
     1230#else
    12021231  // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive
    12031232  if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1])
    12041233  {
    12051234    m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1];
    12061235  }
     1236#endif
    12071237
    12081238  if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag)
    12091239  {
  • source/App/TAppEncoder/TAppEncCfg.h

     
    8989  Int       m_extraRPSs;                                      ///< extra RPSs added to handle CRA
    9090  GOPEntry  m_GOPList[MAX_GOP];                               ///< the coding structure entries from the config file
    9191  Int       m_numReorderPics[MAX_TLAYER];                     ///< total number of reorder pictures
     92#if L0323_DPB
     93  Int       m_maxDecPicBuffering[MAX_TLAYER];                 ///< total number of pictures in the decoded picture buffer
     94#else
    9295  Int       m_maxDecPicBuffering[MAX_TLAYER];                 ///< total number of reference pictures needed for decoding
     96#endif
    9397  Bool      m_bUseLComb;                                      ///< flag for using combined reference list for uni-prediction in B-slices (JCTVC-D421)
    9498  Bool      m_useTransformSkip;                               ///< flag for enabling intra transform skipping
    9599  Bool      m_useTransformSkipFast;                           ///< flag for enabling fast intra transform skipping
  • source/Lib/TLibCommon/TComSlice.cpp

     
    12041204  for( Int i = 0; i < MAX_TLAYER; i++)
    12051205  {
    12061206    m_numReorderPics[i] = 0;
     1207#if L0323_DPB
     1208    m_uiMaxDecPicBuffering[i] = 1;
     1209#else
    12071210    m_uiMaxDecPicBuffering[i] = 0;
     1211#endif
    12081212    m_uiMaxLatencyIncrease[i] = 0;
    12091213  }
    12101214}
     
    12641268  for ( Int i = 0; i < MAX_TLAYER; i++ )
    12651269  {
    12661270    m_uiMaxLatencyIncrease[i] = 0;
     1271#if L0323_DPB
     1272    m_uiMaxDecPicBuffering[i] = 1;
     1273#else
    12671274    m_uiMaxDecPicBuffering[i] = 0;
     1275#endif
    12681276    m_numReorderPics[i]       = 0;
    12691277  }
    12701278  m_scalingList = new TComScalingList;
  • source/Lib/TLibCommon/TypeDef.h

     
    4040
    4141//! \ingroup TLibCommon
    4242//! \{
     43#define L0323_DPB                     1 ///< L0323: Specification of active reference indices and decoded picture buffer
     44
    4345#define L0363_DU_BIT_RATE             1 ///< L0363: add bit_rate_du_value_minus1 to HRD parameters
    4446#define L0328_SPLICING                1 ///< L0328: splicing support in HRD
    4547#define L0044_DU_DPB_OUTPUT_DELAY_HRD 1 ///< L0044: Include dpb_output_delay_du_length_minus1 in hrd_parameters(), dpb_output_du_delay in
  • source/Lib/TLibDecoder/TDecCAVLC.cpp

     
    607607  READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
    608608  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
    609609  {
     610#if L0323_DPB
     611    READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1");
     612    pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
     613#else
    610614    READ_UVLC ( uiCode, "sps_max_dec_pic_buffering");
    611615    pcSPS->setMaxDecPicBuffering( uiCode, i);
     616#endif
    612617    READ_UVLC ( uiCode, "sps_num_reorder_pics" );
    613618    pcSPS->setNumReorderPics(uiCode, i);
    614619    READ_UVLC ( uiCode, "sps_max_latency_increase");
     
    735740  READ_FLAG(subLayerOrderingInfoPresentFlag, "vps_sub_layer_ordering_info_present_flag");
    736741  for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++)
    737742  {
     743#if L0323_DPB
     744    READ_UVLC( uiCode,  "vps_max_dec_pic_buffering_minus1[i]" );     pcVPS->setMaxDecPicBuffering( uiCode + 1, i );
     745#else
    738746    READ_UVLC( uiCode,  "vps_max_dec_pic_buffering[i]" );     pcVPS->setMaxDecPicBuffering( uiCode, i );
     747#endif
    739748    READ_UVLC( uiCode,  "vps_num_reorder_pics[i]" );          pcVPS->setNumReorderPics( uiCode, i );
    740749    READ_UVLC( uiCode,  "vps_max_latency_increase[i]" );      pcVPS->setMaxLatencyIncrease( uiCode, i );
    741750
  • source/Lib/TLibDecoder/TDecTop.cpp

     
    124124    numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer);
    125125  }
    126126
     127#if L0323_DPB
     128  m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer())+pcSlice->getSPS()->getNumReorderPics(pcSlice->getTLayer());     // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
     129#else
    127130  m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer())+pcSlice->getSPS()->getNumReorderPics(pcSlice->getTLayer()) + 1; // +1 to have space for the picture currently being decoded
     131#endif
    128132  if (m_cListPic.size() < (UInt)m_iMaxRefPicNum)
    129133  {
    130134    rpcPic = new TComPic();
  • source/Lib/TLibEncoder/TEncCavlc.cpp

     
    473473  WRITE_FLAG(subLayerOrderingInfoPresentFlag,       "sps_sub_layer_ordering_info_present_flag");
    474474  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
    475475  {
     476#if L0323_DPB
     477    WRITE_UVLC( pcSPS->getMaxDecPicBuffering(i) - 1,       "sps_max_dec_pic_buffering_minus1[i]" );
     478#else
    476479    WRITE_UVLC( pcSPS->getMaxDecPicBuffering(i),           "sps_max_dec_pic_buffering[i]" );
     480#endif
    477481    WRITE_UVLC( pcSPS->getNumReorderPics(i),               "sps_num_reorder_pics[i]" );
    478482    WRITE_UVLC( pcSPS->getMaxLatencyIncrease(i),           "sps_max_latency_increase[i]" );
    479483    if (!subLayerOrderingInfoPresentFlag)
     
    573577  WRITE_FLAG(subLayerOrderingInfoPresentFlag,              "vps_sub_layer_ordering_info_present_flag");
    574578  for(UInt i=0; i <= pcVPS->getMaxTLayers()-1; i++)
    575579  {
     580#if L0323_DPB
     581    WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i) - 1,       "vps_max_dec_pic_buffering_minus1[i]" );
     582#else
    576583    WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i),           "vps_max_dec_pic_buffering[i]" );
     584#endif
    577585    WRITE_UVLC( pcVPS->getNumReorderPics(i),               "vps_num_reorder_pics[i]" );
    578586    WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i),           "vps_max_latency_increase[i]" );
    579587    if (!subLayerOrderingInfoPresentFlag)