Changeset 507 in SHVCSoftware for branches/SHM-4.1-dev/source/Lib


Ignore:
Timestamp:
25 Nov 2013, 17:32:16 (11 years ago)
Author:
nokia
Message:

Add scaled reference layer ID (JCTVC-O0098)

Location:
branches/SHM-4.1-dev/source/Lib
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r494 r507  
    40284028#endif
    40294029
     4030#if O0098_SCALED_REF_LAYER_ID
     4031  Int leftStartL = getSlice()->getSPS()->getScaledRefLayerWindowForLayer(getSlice()->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset();
     4032  Int topStartL  = getSlice()->getSPS()->getScaledRefLayerWindowForLayer(getSlice()->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset();
     4033#else
    40304034  Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset();
    40314035  Int topStartL  = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset();
     4036#endif
    40324037  Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16;
    40334038  Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.cpp

    r504 r507  
    522522      memset( refResamplingLayer, 0, sizeof( refResamplingLayer ) );
    523523#endif
     524#if !RESAMPLING_CONSTRAINT_BUG_FIX
    524525      const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]);
    525526      Int scalingOffset = ((scalEL.getWindowLeftOffset()   == 0 ) &&
     
    528529                           (scalEL.getWindowBottomOffset() == 0 )
    529530                          );
     531#endif
    530532
    531533      for( i=0; i < m_activeNumILRRefIdx; i++ )
    532534      {
    533535        UInt refLayerIdc = m_interLayerPredLayerIdc[i];
     536#if RESAMPLING_CONSTRAINT_BUG_FIX
     537#if O0098_SCALED_REF_LAYER_ID
     538        const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_pcVPS->getRefLayerId( m_layerId, m_interLayerPredLayerIdc[i] ));
     539#else
     540        const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]);
     541#endif
     542        Int scalingOffset = ((scalEL.getWindowLeftOffset()   == 0 ) &&
     543                             (scalEL.getWindowRightOffset()  == 0 ) &&
     544                             (scalEL.getWindowTopOffset()    == 0 ) &&
     545                             (scalEL.getWindowBottomOffset() == 0 )
     546                            );
     547#endif
    534548        if(!( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || (!scalingOffset)) // ratio 1x
    535549        {
     
    24702484const Int TComSPS::m_winUnitY[]={1,2,1,1};
    24712485
     2486#if O0098_SCALED_REF_LAYER_ID
     2487Window& TComSPS::getScaledRefLayerWindowForLayer(Int layerId)
     2488{
     2489  static Window win;
     2490
     2491  for (Int i = 0; i < m_numScaledRefLayerOffsets; i++)
     2492  {
     2493    if (layerId == m_scaledRefLayerId[i])
     2494    {
     2495      return m_scaledRefLayerWindow[i];
     2496    }
     2497  }
     2498
     2499  win.resetWindow();  // scaled reference layer offsets are inferred to be zero when not present
     2500  return win;
     2501}
     2502#endif
     2503
    24722504TComPPS::TComPPS()
    24732505: m_PPSId                       (0)
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.h

    r504 r507  
    12271227#endif
    12281228  UInt        m_numScaledRefLayerOffsets;
     1229#if O0098_SCALED_REF_LAYER_ID
     1230  UInt        m_scaledRefLayerId[MAX_LAYERS];
     1231#endif
    12291232  Window      m_scaledRefLayerWindow[MAX_LAYERS];
    12301233#if REPN_FORMAT_IN_VPS
     
    14121415  UInt     getNumScaledRefLayerOffsets()  { return m_numScaledRefLayerOffsets; }
    14131416  Void     setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x; }
     1417#if O0098_SCALED_REF_LAYER_ID
     1418  UInt     getScaledRefLayerId(Int x)          { return m_scaledRefLayerId[x]; }
     1419  Void     setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; }
     1420  Window&  getScaledRefLayerWindowForLayer( Int layerId );
     1421#endif
    14141422  Window&  getScaledRefLayerWindow( Int x )   { return m_scaledRefLayerWindow[x]; }
    14151423#if REPN_FORMAT_IN_VPS
  • branches/SHM-4.1-dev/source/Lib/TLibCommon/TypeDef.h

    r504 r507  
    175175#define O0096_REP_FORMAT_INDEX           1      ///< JCTVC-O0096: identify SPS rep_format() with an index into the lists of formats in VPS extension.
    176176#define O0096_DEFAULT_DEPENDENCY_TYPE    1      ///< JCTVC-O0096: specify default dependency type for all direct reference layers
     177
     178#define RESAMPLING_CONSTRAINT_BUG_FIX    1
     179#define O0098_SCALED_REF_LAYER_ID        1      ///< JCTVC-O0098: signal scaled reference id
    177180
    178181#else
  • branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r505 r507  
    861861    {
    862862      Window& scaledWindow = pcSPS->getScaledRefLayerWindow(i);
     863#if O0098_SCALED_REF_LAYER_ID
     864      READ_CODE( 6,  uiCode,  "scaled_ref_layer_left_id" );  pcSPS->setScaledRefLayerId( i, uiCode );
     865#endif
    863866      READ_SVLC( iCode, "scaled_ref_layer_left_offset" );    scaledWindow.setWindowLeftOffset  (iCode << 1);
    864867      READ_SVLC( iCode, "scaled_ref_layer_top_offset" );     scaledWindow.setWindowTopOffset   (iCode << 1);
  • branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r494 r507  
    278278      for(UInt i = 0; i < pcSlice->getVPS()->getNumDirectRefLayers( m_layerId ); i++ )
    279279      {
     280#if O0098_SCALED_REF_LAYER_ID
     281        const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, i));
     282#else
    280283        const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(i);
     284#endif
    281285        Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
    282286
     
    11941198#endif
    11951199
     1200#if O0098_SCALED_REF_LAYER_ID
     1201        const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
     1202#else
    11961203        const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
     1204#endif
    11971205
    11981206        Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth();
     
    12111219        if( pcPic->isSpatialEnhLayer(refLayerIdc) )
    12121220        {   
     1221#if O0098_SCALED_REF_LAYER_ID
     1222          Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
     1223#else
     1224          Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
     1225#endif
    12131226#if O0215_PHASE_ALIGNMENT
    12141227#if O0194_JOINT_US_BITSHIFT
    1215           m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
    1216 #else
    1217           m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
     1228          m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );
     1229#else
     1230          m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );
    12181231#endif
    12191232#else
    12201233#if O0194_JOINT_US_BITSHIFT
    1221           m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );
    1222 #else
    1223           m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );
     1234          m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );
     1235#else
     1236          m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );
    12241237#endif
    12251238#endif
  • branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r506 r507  
    684684    {
    685685      Window scaledWindow = pcSPS->getScaledRefLayerWindow(i);
     686#if O0098_SCALED_REF_LAYER_ID
     687      WRITE_CODE( pcSPS->getScaledRefLayerId(i), 6,          "scaled_ref_layer_id" );
     688#endif
    686689      WRITE_SVLC( scaledWindow.getWindowLeftOffset()   >> 1, "scaled_ref_layer_left_offset" );
    687690      WRITE_SVLC( scaledWindow.getWindowTopOffset()    >> 1, "scaled_ref_layer_top_offset" );
  • branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r506 r507  
    783783        }
    784784
     785#if O0098_SCALED_REF_LAYER_ID
     786        const Window &scalEL = m_pcEncTop->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
     787#else
    785788        const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc);
     789#endif
    786790
    787791        Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth();
     
    800804        if( pcPic->isSpatialEnhLayer(refLayerIdc))
    801805        {
     806#if O0098_SCALED_REF_LAYER_ID
     807          Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
     808#else
     809          Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
     810#endif
    802811#if O0215_PHASE_ALIGNMENT
    803812#if O0194_JOINT_US_BITSHIFT
    804           m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
    805 #else
    806           m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
     813          m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );
     814#else
     815          m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );
    807816#endif
    808817#else
    809818#if O0194_JOINT_US_BITSHIFT
    810           m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );
    811 #else
    812           m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );
     819          m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );
     820#else
     821          m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );
    813822#endif
    814823#endif
  • branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r506 r507  
    791791        for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ )
    792792        {
     793#if O0098_SCALED_REF_LAYER_ID
     794          const Window scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
     795#else
    793796          const Window scalEL = getSPS()->getScaledRefLayerWindow(i);
     797#endif
    794798          Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
    795799
     
    842846        for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ )
    843847        {
     848#if O0098_SCALED_REF_LAYER_ID
     849          const Window scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
     850#else
    844851          const Window scalEL = getSPS()->getScaledRefLayerWindow(i);
     852#endif
    845853          Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
    846854
     
    912920  for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++)
    913921  {
     922#if O0098_SCALED_REF_LAYER_ID
     923    m_cSPS.setScaledRefLayerId(i, m_scaledRefLayerId[i]);
     924#endif
    914925    m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];
    915926  }
     
    16831694}
    16841695#endif
     1696
     1697#if O0098_SCALED_REF_LAYER_ID
     1698Window& TEncTop::getScaledRefLayerWindowForLayer(Int layerId)
     1699{
     1700  static Window win;
     1701
     1702  for (Int i = 0; i < m_numScaledRefLayerOffsets; i++)
     1703  {
     1704    if (layerId == m_scaledRefLayerId[i])
     1705    {
     1706      return m_scaledRefLayerWindow[i];
     1707    }
     1708  }
     1709
     1710  win.resetWindow();  // scaled reference layer offsets are inferred to be zero when not present
     1711  return win;
     1712}
     1713#endif
     1714
    16851715#endif //SVC_EXTENSION
    16861716//! \}
  • branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncTop.h

    r494 r507  
    141141#endif
    142142  UInt                    m_numScaledRefLayerOffsets;
     143#if O0098_SCALED_REF_LAYER_ID
     144  UInt                    m_scaledRefLayerId[MAX_LAYERS];
     145#endif
    143146  Window                  m_scaledRefLayerWindow[MAX_LAYERS];
    144147#if POC_RESET_FLAG
     
    209212  Void                    setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; }
    210213  UInt                    getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; }
     214#if O0098_SCALED_REF_LAYER_ID
     215  Void                    setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id;   }
     216  UInt                    getScaledRefLayerId(Int x)          { return m_scaledRefLayerId[x]; }
     217  Window&  getScaledRefLayerWindowForLayer(Int layerId);
     218#endif
    211219  Window&  getScaledRefLayerWindow(Int x)            { return m_scaledRefLayerWindow[x]; }
    212220#endif //SVC_EXTENSION
Note: See TracChangeset for help on using the changeset viewer.