Changeset 628 in SHVCSoftware for branches/SHM-5.1-dev/source/Lib/TLibCommon


Ignore:
Timestamp:
14 Mar 2014, 15:29:06 (11 years ago)
Author:
nokia
Message:

Integrated JCTVC-O0164: Multi-layer HRD operation

Location:
branches/SHM-5.1-dev/source/Lib/TLibCommon
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-5.1-dev/source/Lib/TLibCommon/SEI.h

    r616 r628  
    4040//! \{
    4141class TComSPS;
     42#if O0164_MULTI_LAYER_HRD
     43class TComHRD;
     44#endif
    4245
    4346/**
     
    8184   ,SUB_BITSTREAM_PROPERTY               = 139    // Final PayloadType to be defined after finalization
    8285#endif
     86#if O0164_MULTI_LAYER_HRD
     87   ,BSP_NESTING                          = 140
     88   ,BSP_INITIAL_ARRIVAL_TIME             = 141
     89   ,BSP_HRD                              = 142
     90#endif
    8391  };
    8492 
     
    448456Void deleteSEIs (SEIMessages &seiList);
    449457
     458#if O0164_MULTI_LAYER_HRD
     459
     460class SEIBspNesting : public SEI
     461{
     462public:
     463  PayloadType payloadType() const { return BSP_NESTING; }
     464
     465  SEIBspNesting() {}
     466  virtual ~SEIBspNesting()
     467  {
     468    if (!m_callerOwnsSEIs)
     469    {
     470      deleteSEIs(m_nestedSEIs);
     471    }
     472  }
     473
     474  Int  m_bspIdx;
     475  Bool  m_callerOwnsSEIs;
     476  SEIMessages m_nestedSEIs;
     477};
     478
     479class SEIBspInitialArrivalTime : public SEI
     480{
     481public:
     482  PayloadType payloadType() const { return BSP_INITIAL_ARRIVAL_TIME; }
     483
     484  SEIBspInitialArrivalTime () {}
     485  virtual ~SEIBspInitialArrivalTime () {}
     486
     487  UInt m_nalInitialArrivalDelay[256];
     488  UInt m_vclInitialArrivalDelay[256];
     489};
     490
     491class SEIBspHrd : public SEI
     492{
     493public:
     494  PayloadType payloadType() const { return BSP_HRD; }
     495
     496  SEIBspHrd () {}
     497  virtual ~SEIBspHrd () {}
     498
     499  UInt m_seiNumBspHrdParametersMinus1;
     500  Bool m_seiBspCprmsPresentFlag[MAX_VPS_LAYER_SETS_PLUS1];
     501  UInt m_seiNumBitstreamPartitionsMinus1[MAX_VPS_LAYER_SETS_PLUS1];
     502  Bool m_seiLayerInBspFlag[MAX_VPS_LAYER_SETS_PLUS1][8][MAX_LAYERS];
     503  UInt m_seiNumBspSchedCombinationsMinus1[MAX_VPS_LAYER_SETS_PLUS1];
     504  UInt m_seiBspCombHrdIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16];
     505  UInt m_seiBspCombScheddx[MAX_VPS_LAYER_SETS_PLUS1][16][16];
     506  UInt m_vpsMaxLayers;
     507  Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     508
     509  TComHRD *hrd;
     510};
     511
     512#endif
     513
    450514class SEIScalableNesting : public SEI
    451515{
  • branches/SHM-5.1-dev/source/Lib/TLibCommon/TComRom.h

    r595 r628  
    159159
    160160#ifndef ENC_DEC_TRACE
    161 # define ENC_DEC_TRACE 0
     161# define ENC_DEC_TRACE 1
    162162#endif
    163163
  • branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.cpp

    r627 r628  
    24832483  return -1;  // Layer not found
    24842484}
     2485#if O0164_MULTI_LAYER_HRD
     2486Void TComVPS::setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess )
     2487{
     2488  if( !getVpsVuiBspHrdPresentFlag() )
     2489  {
     2490    return;
     2491  }
     2492
     2493  TComHRD *hrd = getBspHrd(hrdIdx);
     2494
     2495  Bool rateCnt = ( bitRate > 0 );
     2496  hrd->setNalHrdParametersPresentFlag( rateCnt );
     2497  hrd->setVclHrdParametersPresentFlag( rateCnt );
     2498
     2499  hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) );
     2500
     2501  if( hrd->getSubPicCpbParamsPresentFlag() )
     2502  {
     2503    hrd->setTickDivisorMinus2( 100 - 2 );                          //
     2504    hrd->setDuCpbRemovalDelayLengthMinus1( 7 );                    // 8-bit precision ( plus 1 for last DU in AU )
     2505    hrd->setSubPicCpbParamsInPicTimingSEIFlag( true );
     2506    hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 );                 // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay
     2507  }
     2508  else
     2509  {
     2510    hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 
     2511  }
     2512
     2513  hrd->setBitRateScale( 4 );                                       // in units of 2~( 6 + 4 ) = 1,024 bps
     2514  hrd->setCpbSizeScale( 6 );                                       // in units of 2~( 4 + 4 ) = 1,024 bit
     2515  hrd->setDuCpbSizeScale( 6 );                                       // in units of 2~( 4 + 4 ) = 1,024 bit
     2516
     2517  hrd->setInitialCpbRemovalDelayLengthMinus1(15);                  // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit
     2518  if( randomAccess )
     2519  {
     2520    hrd->setCpbRemovalDelayLengthMinus1(5);                        // 32 = 2^5 (plus 1)
     2521    hrd->setDpbOutputDelayLengthMinus1 (5);                        // 32 + 3 = 2^6
     2522  }
     2523  else
     2524  {
     2525    hrd->setCpbRemovalDelayLengthMinus1(9);                        // max. 2^10
     2526    hrd->setDpbOutputDelayLengthMinus1 (9);                        // max. 2^10
     2527  }
     2528
     2529  /*
     2530  Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported.
     2531  */
     2532  Int i, j;
     2533  UInt birateValue, cpbSizeValue;
     2534  UInt ducpbSizeValue;
     2535  UInt duBitRateValue = 0;
     2536
     2537  for( i = 0; i < MAX_TLAYER; i ++ )
     2538  {
     2539    hrd->setFixedPicRateFlag( i, 1 );
     2540    hrd->setPicDurationInTcMinus1( i, 0 );
     2541    hrd->setLowDelayHrdFlag( i, 0 );
     2542    hrd->setCpbCntMinus1( i, 0 );
     2543
     2544    birateValue  = bitRate;
     2545    cpbSizeValue = bitRate;                                     // 1 second
     2546    ducpbSizeValue = bitRate/numDU;
     2547    duBitRateValue = bitRate;
     2548    for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ )
     2549    {
     2550      hrd->setBitRateValueMinus1( i, j, 0, ( birateValue  - 1 ) );
     2551      hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) );
     2552      hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) );
     2553      hrd->setCbrFlag( i, j, 0, ( j == 0 ) );
     2554
     2555      hrd->setBitRateValueMinus1( i, j, 1, ( birateValue  - 1) );
     2556      hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) );
     2557      hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) );
     2558      hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) );
     2559      hrd->setCbrFlag( i, j, 1, ( j == 0 ) );
     2560    }
     2561  }
     2562}
     2563#endif
    24852564// RepFormat Assignment operator
    24862565RepFormat& RepFormat::operator= (const RepFormat &other)
  • branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.h

    r627 r628  
    685685#endif
    686686
     687#if O0164_MULTI_LAYER_HRD
     688  Bool       m_vpsVuiBspHrdPresentFlag;
     689  UInt       m_vpsNumBspHrdParametersMinus1;
     690  Bool       m_bspCprmsPresentFlag[MAX_VPS_LAYER_SETS_PLUS1];
     691  TComHRD    *m_bspHrd;
     692  UInt       m_numBitstreamPartitions[MAX_VPS_LAYER_SETS_PLUS1];
     693  Bool       m_layerInBspFlag[MAX_VPS_LAYER_SETS_PLUS1][8][MAX_LAYERS];
     694  UInt       m_numBspSchedCombinations[MAX_VPS_LAYER_SETS_PLUS1];
     695  UInt       m_bspCombHrdIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16];
     696  UInt       m_bspCombSchedIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16];
     697#endif
     698
    687699#if P0182_VPS_VUI_PS_FLAG
    688700  UInt        m_SPSId[MAX_LAYERS];
     
    713725    m_cprmsPresentFlag = new Bool   [ getNumHrdParameters() ];
    714726  }
     727
     728#if O0164_MULTI_LAYER_HRD
     729  Void    createBspHrdParamBuffer(UInt numHrds)
     730  {
     731    m_bspHrd    = new TComHRD[ numHrds ];
     732//    m_hrdOpSetIdx      = new UInt   [ getNumHrdParameters() ];
     733//    m_cprmsPresentFlag = new Bool   [ getNumHrdParameters() ];
     734  }
     735#endif
    715736
    716737  TComHRD* getHrdParameters   ( UInt i )             { return &m_hrdParameters[ i ]; }
     
    10051026  Void setAvgPicRate(Int i, Int j, Int x)   { m_avgPicRate[i][j] = x;    }
    10061027#endif
     1028#if O0164_MULTI_LAYER_HRD
     1029  Bool     getVpsVuiBspHrdPresentFlag()                         { return m_vpsVuiBspHrdPresentFlag;      }
     1030  Void     setVpsVuiBspHrdPresentFlag(Bool x)                   { m_vpsVuiBspHrdPresentFlag = x;         }
     1031  UInt     getVpsNumBspHrdParametersMinus1()                    { return m_vpsNumBspHrdParametersMinus1; }
     1032  Void     setVpsNumBspHrdParametersMinus1(UInt i)              { m_vpsNumBspHrdParametersMinus1 = i;    }
     1033  Bool     getBspCprmsPresentFlag(UInt i)                       { return m_bspCprmsPresentFlag[i];       }
     1034  Void     setBspCprmsPresentFlag(UInt i, Bool val)             { m_bspCprmsPresentFlag[i] = val;        }
     1035  TComHRD* getBspHrd(UInt i)                                    { return &m_bspHrd[i];                    }
     1036  UInt     getNumBitstreamPartitions(UInt i)                    { return m_numBitstreamPartitions[i];    }
     1037  Void     setNumBitstreamPartitions(UInt i, UInt val)          { m_numBitstreamPartitions[i] = val;     }
     1038  UInt     getLayerInBspFlag(UInt h, UInt i, UInt j)            { return m_layerInBspFlag[h][i][j];      }
     1039  Void     setLayerInBspFlag(UInt h, UInt i, UInt j, UInt val)  { m_layerInBspFlag[h][i][j] = val;       }
     1040  UInt     getNumBspSchedCombinations(UInt i)                   { return m_numBspSchedCombinations[i];   }
     1041  Void     setNumBspSchedCombinations(UInt i, UInt val)         { m_numBspSchedCombinations[i] = val;    }
     1042  UInt     getBspCombHrdIdx(UInt h, UInt i, UInt j)             { return m_bspCombHrdIdx[h][i][j];       }
     1043  Void     setBspCombHrdIdx(UInt h, UInt i, UInt j, UInt val)   { m_bspCombHrdIdx[h][i][j] = val;        }
     1044  UInt     getBspCombSchedIdx(UInt h, UInt i, UInt j)           { return m_bspCombSchedIdx[h][i][j];     }
     1045  Void     setBspCombSchedIdx(UInt h, UInt i, UInt j, UInt val) { m_bspCombSchedIdx[h][i][j] = val;      }
     1046#endif
    10071047#if P0182_VPS_VUI_PS_FLAG
    10081048  Int     getSPSId       (Int layer)                   { return m_SPSId[layer];          }
     
    11141154  Int  getSubDpbAssigned  (Int lsIdx, Int layerIdx) { return m_subDpbAssigned[lsIdx][layerIdx]; }
    11151155  Int  findLayerIdxInLayerSet ( Int lsIdx, Int nuhLayerId );
     1156#endif
     1157#if O0164_MULTI_LAYER_HRD
     1158  Void setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess );
    11161159#endif
    11171160#endif //SVC_EXTENSION
  • branches/SHM-5.1-dev/source/Lib/TLibCommon/TypeDef.h

    r627 r628  
    7979
    8080#define O0135_DEFAULT_ONE_OUT_SEMANTIC   1      ///< JCTVC-O0135: semantics change of default_one_target_output_layer_idc for auxiliary pictures
     81
     82#define O0164_MULTI_LAYER_HRD            1      ///< JCTVC-O0164: Multi-layer HRD operation
    8183
    8284#define O0194_DIFFERENT_BITDEPTH_EL_BL   1      ///< JCTVC-O0194: Support for different bitdepth values for BL and EL, add required configuration parameters (and Some bugfixes when REPN_FORMAT_IN_VPS (JCTVC-N0092) is enabled)
Note: See TracChangeset for help on using the changeset viewer.