Changeset 211 in SHVCSoftware for branches/SHM-2.1-dev/source


Ignore:
Timestamp:
17 May 2013, 03:16:43 (12 years ago)
Author:
ustc
Message:

JCTVC-M0037. rate control harmonization with SHVC.

Location:
branches/SHM-2.1-dev/source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r191 r211  
    337337  Int*    cfg_scaledRefLayerBottomOffset [MAX_LAYERS];
    338338#endif
     339#if RC_SHVC_HARMONIZATION
     340  Bool*   cfg_RCEnableRateControl  [MAX_LAYERS];
     341  Int*    cfg_RCTargetBitRate      [MAX_LAYERS];
     342  Bool*   cfg_RCKeepHierarchicalBit[MAX_LAYERS];
     343  Bool*   cfg_RCLCULevelRC         [MAX_LAYERS];
     344  Bool*   cfg_RCUseLCUSeparateModel[MAX_LAYERS];
     345  Int*    cfg_RCInitialQP          [MAX_LAYERS];
     346  Bool*   cfg_RCForceIntraQP       [MAX_LAYERS];
     347#endif
    339348  for(UInt layer = 0; layer < MAX_LAYERS; layer++)
    340349  {
     
    356365    cfg_scaledRefLayerRightOffset [layer] = &m_acLayerCfg[layer].m_scaledRefLayerRightOffset;
    357366    cfg_scaledRefLayerBottomOffset[layer] = &m_acLayerCfg[layer].m_scaledRefLayerBottomOffset;
     367#endif
     368#if RC_SHVC_HARMONIZATION
     369    cfg_RCEnableRateControl[layer]   = &m_acLayerCfg[layer].m_RCEnableRateControl;
     370    cfg_RCTargetBitRate[layer]       = &m_acLayerCfg[layer].m_RCTargetBitrate;
     371    cfg_RCKeepHierarchicalBit[layer] = &m_acLayerCfg[layer].m_RCKeepHierarchicalBit;
     372    cfg_RCLCULevelRC[layer]          = &m_acLayerCfg[layer].m_RCLCULevelRC;
     373    cfg_RCUseLCUSeparateModel[layer] = &m_acLayerCfg[layer].m_RCUseLCUSeparateModel;
     374    cfg_RCInitialQP[layer]           = &m_acLayerCfg[layer].m_RCInitialQP;
     375    cfg_RCForceIntraQP[layer]        = &m_acLayerCfg[layer].m_RCForceIntraQP;
    358376#endif
    359377  }
     
    617635  ("ESD", m_useEarlySkipDetection, false, "Early SKIP detection setting")
    618636#if RATE_CONTROL_LAMBDA_DOMAIN
     637#if RC_SHVC_HARMONIZATION
     638  ("RateControl%d", cfg_RCEnableRateControl, false, MAX_LAYERS, "Rate control: enable rate control for layer %d")
     639  ("TargetBitrate%d", cfg_RCTargetBitRate, 0, MAX_LAYERS, "Rate control: target bitrate for layer %d")
     640  ("KeepHierarchicalBit%d", cfg_RCKeepHierarchicalBit, false, MAX_LAYERS, "Rate control: keep hierarchical bit allocation for layer %d")
     641  ("LCULevelRateControl%d", cfg_RCLCULevelRC, true, MAX_LAYERS, "Rate control: LCU level RC")
     642  ("RCLCUSeparateModel%d", cfg_RCUseLCUSeparateModel, true, MAX_LAYERS, "Rate control: Use LCU level separate R-lambda model")
     643  ("InitialQP%d", cfg_RCInitialQP, 0, MAX_LAYERS, "Rate control: initial QP")
     644  ("RCForceIntraQP%d", cfg_RCForceIntraQP, false, MAX_LAYERS, "Rate control: force intra QP to be equal to initial QP")
     645#else
    619646  ( "RateControl",         m_RCEnableRateControl,   false, "Rate control: enable rate control" )
    620647  ( "TargetBitrate",       m_RCTargetBitrate,           0, "Rate control: target bitrate" )
     
    624651  ( "InitialQP",           m_RCInitialQP,               0, "Rate control: initial QP" )
    625652  ( "RCForceIntraQP",      m_RCForceIntraQP,        false, "Rate control: force intra QP to be equal to initial QP" )
     653#endif
    626654#else
    627655  ("RateCtrl,-rc", m_enableRateCtrl, false, "Rate control on/off")
     
    17421770
    17431771#if RATE_CONTROL_LAMBDA_DOMAIN
     1772#if RC_SHVC_HARMONIZATION
     1773  for ( Int layer=0; layer<m_numLayers; layer++ )
     1774  {
     1775    if ( m_acLayerCfg[layer].m_RCEnableRateControl )
     1776    {
     1777      if ( m_acLayerCfg[layer].m_RCForceIntraQP )
     1778      {
     1779        if ( m_acLayerCfg[layer].m_RCInitialQP == 0 )
     1780        {
     1781          printf( "\nInitial QP for rate control is not specified. Reset not to use force intra QP!" );
     1782          m_acLayerCfg[layer].m_RCForceIntraQP = false;
     1783        }
     1784      }
     1785    }
     1786    xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" );
     1787  }
     1788#else
    17441789  if ( m_RCEnableRateControl )
    17451790  {
     
    17541799    xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" );
    17551800  }
     1801#endif
    17561802#else
    17571803  if(m_enableRateCtrl)
     
    18691915  printf("PCM sample bit depth         : (Y:%d, C:%d)\n", g_uiPCMBitDepthLuma, g_uiPCMBitDepthChroma );
    18701916#if RATE_CONTROL_LAMBDA_DOMAIN
     1917#if !RC_SHVC_HARMONIZATION
    18711918  printf("RateControl                  : %d\n", m_RCEnableRateControl );
    18721919  if(m_RCEnableRateControl)
     
    18791926    printf("ForceIntraQP                 : %d\n", m_RCForceIntraQP );
    18801927  }
     1928#endif
    18811929#else
    18821930  printf("RateControl                  : %d\n", m_enableRateCtrl);
  • branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncCfg.h

    r191 r211  
    287287  Int       m_signHideFlag;
    288288#if RATE_CONTROL_LAMBDA_DOMAIN
     289#if !RC_SHVC_HARMONIZATION
    289290  Bool      m_RCEnableRateControl;                ///< enable rate control or not
    290291  Int       m_RCTargetBitrate;                    ///< target bitrate when rate control is enabled
     
    294295  Int       m_RCInitialQP;                        ///< inital QP for rate control
    295296  Bool      m_RCForceIntraQP;                     ///< force all intra picture to use initial QP or not
     297#endif
    296298#else
    297299  Bool      m_enableRateCtrl;                                   ///< Flag for using rate control algorithm
  • branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r191 r211  
    134134  printf("QP                            : %5.2f\n", m_fQP );
    135135  printf("Intra period                  : %d\n", m_iIntraPeriod );
     136#if RC_SHVC_HARMONIZATION
     137  printf("RateControl                   : %d\n", m_RCEnableRateControl );
     138  if(m_RCEnableRateControl)
     139  {
     140    printf("TargetBitrate                 : %d\n", m_RCTargetBitrate );
     141    printf("KeepHierarchicalBit           : %d\n", m_RCKeepHierarchicalBit );
     142    printf("LCULevelRC                    : %d\n", m_RCLCULevelRC );
     143    printf("UseLCUSeparateModel           : %d\n", m_RCUseLCUSeparateModel );
     144    printf("InitialQP                     : %d\n", m_RCInitialQP );
     145    printf("ForceIntraQP                  : %d\n", m_RCForceIntraQP );
     146  }
     147#endif
    136148  printf("WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_cAppEncCfg->getWaveFrontSynchro(), m_iWaveFrontSubstreams);
    137149}
  • branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.h

    r191 r211  
    4646  Int       m_numDirectRefLayers;
    4747#endif
     48
     49#if RC_SHVC_HARMONIZATION
     50  Bool      m_RCEnableRateControl;                ///< enable rate control or not
     51  Int       m_RCTargetBitrate;                    ///< target bitrate when rate control is enabled
     52  Bool      m_RCKeepHierarchicalBit;              ///< whether keeping hierarchical bit allocation structure or not
     53  Bool      m_RCLCULevelRC;                       ///< true: LCU level rate control; false: picture level rate control
     54  Bool      m_RCUseLCUSeparateModel;              ///< use separate R-lambda model at LCU level
     55  Int       m_RCInitialQP;                        ///< inital QP for rate control
     56  Bool      m_RCForceIntraQP;                     ///< force all intra picture to use initial QP or not
     57#endif
     58
    4859#if SVC_EXTENSION
    4960  Int       m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles).
     
    98109  Int     getRefLayerId(Int i)        {return m_refLayerIds[i];   }
    99110#endif
     111#if RC_SHVC_HARMONIZATION
     112  Bool    getRCEnableRateControl()    {return m_RCEnableRateControl;   }
     113  Int     getRCTargetBitrate()        {return m_RCTargetBitrate;       }
     114  Bool    getRCKeepHierarchicalBit()  {return m_RCKeepHierarchicalBit; }
     115  Bool    getRCLCULevelRC()           {return m_RCLCULevelRC;          }
     116  Bool    getRCUseLCUSeparateModel()  {return m_RCUseLCUSeparateModel; }
     117  Int     getRCInitialQP()            {return m_RCInitialQP;           }
     118  Bool    getRCForceIntraQP()         {return m_RCForceIntraQP;        }
     119#endif
    100120}; // END CLASS DEFINITION TAppEncLayerCfg
    101121
  • branches/SHM-2.1-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r191 r211  
    343343    m_acTEncTop[layer].setSignHideFlag(m_signHideFlag);
    344344#if RATE_CONTROL_LAMBDA_DOMAIN
     345#if RC_SHVC_HARMONIZATION
     346    m_acTEncTop[layer].setUseRateCtrl     (m_acLayerCfg[layer].getRCEnableRateControl());
     347    m_acTEncTop[layer].setTargetBitrate   (m_acLayerCfg[layer].getRCTargetBitrate());
     348    m_acTEncTop[layer].setKeepHierBit     (m_acLayerCfg[layer].getRCKeepHierarchicalBit());
     349    m_acTEncTop[layer].setLCULevelRC      (m_acLayerCfg[layer].getRCLCULevelRC());
     350    m_acTEncTop[layer].setUseLCUSeparateModel (m_acLayerCfg[layer].getRCUseLCUSeparateModel());
     351    m_acTEncTop[layer].setInitialQP           (m_acLayerCfg[layer].getRCInitialQP());
     352    m_acTEncTop[layer].setForceIntraQP        (m_acLayerCfg[layer].getRCForceIntraQP());
     353#else
    345354    m_acTEncTop[layer].setUseRateCtrl         ( m_RCEnableRateControl );
    346355    m_acTEncTop[layer].setTargetBitrate       ( m_RCTargetBitrate );
     
    350359    m_acTEncTop[layer].setInitialQP           ( m_RCInitialQP );
    351360    m_acTEncTop[layer].setForceIntraQP        ( m_RCForceIntraQP );
     361#endif
    352362#else
    353363    m_acTEncTop[layer].setUseRateCtrl     ( m_enableRateCtrl);
     
    10141024    }
    10151025
     1026#if RC_SHVC_HARMONIZATION
     1027    for(UInt layer=0; layer<m_numLayers; layer++)
     1028    {
     1029      if ( m_acTEncTop[layer].getUseRateCtrl() )
     1030      {
     1031        (m_acTEncTop[layer].getRateCtrl())->initRCGOP(m_acTEncTop[layer].getNumPicRcvd());
     1032      }
     1033    }
     1034#endif
     1035
    10161036    // loop through frames in one GOP
    10171037    for ( UInt iPicIdInGOP=0; iPicIdInGOP < (bFirstFrame? 1:m_iGOPSize); iPicIdInGOP++ )
     
    10241044      }
    10251045    }
     1046
     1047#if RC_SHVC_HARMONIZATION
     1048    for(UInt layer=0; layer<m_numLayers; layer++)
     1049    {
     1050      if ( m_acTEncTop[layer].getUseRateCtrl() )
     1051      {
     1052        (m_acTEncTop[layer].getRateCtrl())->destroyRCGOP();
     1053      }
     1054    }
     1055#endif
    10261056
    10271057    iTotalNumEncoded = 0;
  • branches/SHM-2.1-dev/source/Lib/TLibCommon/TypeDef.h

    r210 r211  
    172172#define RATE_CONTROL_LAMBDA_DOMAIN                  1  ///< JCTVC-K0103, rate control by R-lambda model
    173173#define L0033_RC_BUGFIX                             1  ///< JCTVC-L0033, bug fix for R-lambda model based rate control
     174#define RC_SHVC_HARMONIZATION                       1  ///< JCTVC-M0037, rate control for SHVC
    174175
    175176#define MAX_CPB_CNT                     32  ///< Upper bound of (cpb_cnt_minus1 + 1)
  • branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r191 r211  
    386386  // compress GOP
    387387#if RATE_CONTROL_LAMBDA_DOMAIN
     388#if !RC_SHVC_HARMONIZATION
    388389  if ( m_RCEnableRateControl )
    389390  {
    390391    m_cRateCtrl.initRCGOP( m_iNumPicRcvd );
    391392  }
     393#endif
    392394#endif
    393395
     
    396398
    397399#if RATE_CONTROL_LAMBDA_DOMAIN
     400#if !RC_SHVC_HARMONIZATION
    398401  if ( m_RCEnableRateControl )
    399402  {
    400403    m_cRateCtrl.destroyRCGOP();
    401404  }
     405#endif
    402406#endif
    403407 
Note: See TracChangeset for help on using the changeset viewer.