Changeset 239 in SHVCSoftware for branches/SHM-2.1-dev/source/Lib/TLibDecoder


Ignore:
Timestamp:
24 May 2013, 19:44:53 (12 years ago)
Author:
seregin
Message:

move ahead of scaling factors initialization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r238 r239  
    839839      pcSlice->setBaseColPic ( *cListPic, m_layerId );
    840840#endif
     841
     842#if SIMPLIFIED_MV_POS_SCALING
     843#if SCALED_REF_LAYER_OFFSETS
     844      const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow();
     845
     846      Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();
     847      Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();
     848
     849      Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
     850      Int heightEL  = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
     851#else
     852      const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow();
     853      const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();
     854
     855      Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
     856      Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
     857
     858      Int widthEL   = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
     859      Int heightEL  = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
     860#endif
     861      g_mvScalingFactor[m_layerId][0] = Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
     862      g_mvScalingFactor[m_layerId][1] = Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);
     863
     864      g_posScalingFactor[m_layerId][0] = ((widthBL  << 16) + (widthEL  >> 1)) / widthEL;
     865      g_posScalingFactor[m_layerId][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL;
     866#endif
     867
    841868#if SVC_UPSAMPLING
    842869      if ( pcPic->isSpatialEnhLayer())
     
    954981    m_cTrQuant.setUseScalingList(false);
    955982  }
    956 
    957 #if SIMPLIFIED_MV_POS_SCALING
    958   if (m_layerId > 0)
    959   {
    960 #if SCALED_REF_LAYER_OFFSETS
    961     const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow();
    962 
    963     Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();
    964     Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();
    965 
    966     Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
    967     Int heightEL  = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
    968 #else
    969     const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow();
    970     const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();
    971 
    972     Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    973     Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    974 
    975     Int widthEL   = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    976     Int heightEL  = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    977 #endif
    978     g_mvScalingFactor[m_layerId][0] = Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
    979     g_mvScalingFactor[m_layerId][1] = Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);
    980 
    981     g_posScalingFactor[m_layerId][0] = ((widthBL  << 16) + (widthEL  >> 1)) / widthEL;
    982     g_posScalingFactor[m_layerId][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL;
    983   }
    984 #endif
    985983
    986984  //  Decode a picture
Note: See TracChangeset for help on using the changeset viewer.