Changeset 175 in SHVCSoftware for branches/SHM-2.0-dev/source/Lib/TLibEncoder


Ignore:
Timestamp:
9 May 2013, 22:48:02 (12 years ago)
Author:
qualcomm
Message:

Scaled reference layer offsets in SPS (MACRO: SCALED_REF_LAYER_OFFSETS)

M0309: Signal scaled reference layer offsets in the SPS and use it for upsampling and MV prediction.

From: Adarsh K. Ramasubramonian <aramasub@…>

Location:
branches/SHM-2.0-dev/source/Lib/TLibEncoder
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r174 r175  
    553553      codeVUI(pcSPS->getVuiParameters(), pcSPS);
    554554  }
     555#if SCALED_REF_LAYER_OFFSETS
     556  if( pcSPS->getLayerId() > 0 )
     557  {
     558    Window scaledWindow = pcSPS->getScaledRefLayerWindow();
     559    WRITE_SVLC( scaledWindow.getWindowLeftOffset()   >> 1, "scaled_ref_layer_left_offset" );
     560    WRITE_SVLC( scaledWindow.getWindowTopOffset()    >> 1, "scaled_ref_layer_top_offset" );
     561    WRITE_SVLC( scaledWindow.getWindowRightOffset()  >> 1, "scaled_ref_layer_right_offset" );
     562    WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" );
     563  }
     564#endif
    555565
    556566  WRITE_FLAG( 0, "sps_extension_flag" );
  • branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r174 r175  
    690690#if SVC_UPSAMPLING
    691691      if ( pcPic->isSpatialEnhLayer())
    692       {   
     692      {
     693#if SCALED_REF_LAYER_OFFSETS
     694        m_pcPredSearch->upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow() );
     695#else
    693696        m_pcPredSearch->upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec() );
     697#endif
    694698      }
    695699      else
     
    976980    if (m_layerId > 0)
    977981    {
     982#if SCALED_REF_LAYER_OFFSETS
     983      const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow();
     984
     985      Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();
     986      Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();
     987
     988      Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
     989      Int heightEL  = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
     990#else
    978991      const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow();
    979992      const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();
     
    984997      Int widthEL   = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    985998      Int heightEL  = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    986 
     999#endif
    9871000      g_mvScalingFactor[m_layerId][0] = Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
    9881001      g_mvScalingFactor[m_layerId][1] = Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);
  • branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r164 r175  
    576576  m_cSPS.setMFMEnabledFlag(m_bMFMEnabledFlag);
    577577#endif
     578#if SCALED_REF_LAYER_OFFSETS
     579  m_cSPS.getScaledRefLayerWindow() = m_scaledRefLayerWindow;
     580#endif
    578581  ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL();
    579582  profileTierLevel.setLevelIdc(m_level);
  • branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncTop.h

    r134 r175  
    139139  Bool                    m_bMFMEnabledFlag;
    140140#endif
     141#if SCALED_REF_LAYER_OFFSETS
     142  Window                  m_scaledRefLayerWindow;
     143#endif
    141144protected:
    142145  Void  xGetNewPicBuffer  ( TComPic*& rpcPic );           ///< get picture buffer which will be processed
     
    203206  Void                    setNumPicRcvd         ( Int num ) { m_iNumPicRcvd = num;      }
    204207#endif
     208#if SCALED_REF_LAYER_OFFSETS
     209  Window&  getScaledRefLayerWindow()            { return m_scaledRefLayerWindow; }
     210#endif
    205211
    206212  // -------------------------------------------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.