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


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/TLibDecoder
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r174 r175  
    712712  }
    713713
     714#if SCALED_REF_LAYER_OFFSETS
     715  if( pcSPS->getLayerId() > 0 )
     716  {
     717    Int iCode;
     718    Window& scaledWindow = pcSPS->getScaledRefLayerWindow();
     719    READ_SVLC( iCode, "scaled_ref_layer_left_offset" );    scaledWindow.setWindowLeftOffset  (iCode << 1);
     720    READ_SVLC( iCode, "scaled_ref_layer_top_offset" );     scaledWindow.setWindowTopOffset   (iCode << 1);
     721    READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
     722    READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
     723  }
     724#endif
     725
    714726  READ_FLAG( uiCode, "sps_extension_flag");
    715727  if (uiCode)
  • branches/SHM-2.0-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r174 r175  
    836836      if ( pcPic->isSpatialEnhLayer())
    837837      {   
     838#if SCALED_REF_LAYER_OFFSETS
     839        m_cPrediction.upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow() );
     840#else
    838841        m_cPrediction.upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec() );
     842#endif
    839843      }
    840844      else
     
    948952  if (m_layerId > 0)
    949953  {
     954#if SCALED_REF_LAYER_OFFSETS
     955    const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow();
     956
     957    Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();
     958    Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();
     959
     960    Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
     961    Int heightEL  = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
     962#else
    950963    const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow();
    951964    const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();
     
    956969    Int widthEL   = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    957970    Int heightEL  = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    958 
     971#endif
    959972    g_mvScalingFactor[m_layerId][0] = Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
    960973    g_mvScalingFactor[m_layerId][1] = Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);
Note: See TracChangeset for help on using the changeset viewer.