Changeset 239 in SHVCSoftware


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

move ahead of scaling factors initialization

Location:
branches/SHM-2.1-dev/source/Lib
Files:
2 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
  • branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r238 r239  
    541541#endif
    542542      pcSlice->setBaseColPic (*cListPic, m_layerId );
    543     }
    544 #endif
     543     
     544#if SIMPLIFIED_MV_POS_SCALING
     545#if SCALED_REF_LAYER_OFFSETS
     546      const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow();
     547
     548      Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();
     549      Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();
     550
     551      Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
     552      Int heightEL  = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
     553#else
     554      const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow();
     555      const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();
     556
     557      Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
     558      Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
     559
     560      Int widthEL   = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
     561      Int heightEL  = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
     562#endif
     563      g_mvScalingFactor[m_layerId][0] = Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
     564      g_mvScalingFactor[m_layerId][1] = Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);
     565
     566      g_posScalingFactor[m_layerId][0] = ((widthBL  << 16) + (widthEL  >> 1)) / widthEL;
     567      g_posScalingFactor[m_layerId][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL;
     568#endif
     569    }
     570#endif
     571
    545572#if REF_IDX_FRAMEWORK
    546 
    547573    if( m_layerId > 0 && (pocCurr % m_pcCfg->getIntraPeriod() == 0) )
    548574    {
     
    721747      TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId-1]->getListPic();
    722748      pcSlice->setBaseColPic (*cListPic, m_layerId );
     749
     750#if SIMPLIFIED_MV_POS_SCALING
     751#if SCALED_REF_LAYER_OFFSETS
     752      const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow();
     753
     754      Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();
     755      Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();
     756
     757      Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
     758      Int heightEL  = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
     759#else
     760      const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow();
     761      const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();
     762
     763      Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
     764      Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
     765
     766      Int widthEL   = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
     767      Int heightEL  = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
     768#endif
     769      g_mvScalingFactor[m_layerId][0] = Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
     770      g_mvScalingFactor[m_layerId][1] = Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);
     771
     772      g_posScalingFactor[m_layerId][0] = ((widthBL  << 16) + (widthEL  >> 1)) / widthEL;
     773      g_posScalingFactor[m_layerId][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL;
     774#endif
    723775#endif
    724776#if SVC_UPSAMPLING
     
    10181070
    10191071    UInt uiNumSlices = 1;
    1020 
    1021 #if SIMPLIFIED_MV_POS_SCALING
    1022     if (m_layerId > 0)
    1023     {
    1024 #if SCALED_REF_LAYER_OFFSETS
    1025       const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow();
    1026 
    1027       Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();
    1028       Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();
    1029 
    1030       Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
    1031       Int heightEL  = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
    1032 #else
    1033       const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow();
    1034       const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();
    1035 
    1036       Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    1037       Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    1038 
    1039       Int widthEL   = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    1040       Int heightEL  = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    1041 #endif
    1042       g_mvScalingFactor[m_layerId][0] = Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
    1043       g_mvScalingFactor[m_layerId][1] = Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);
    1044 
    1045       g_posScalingFactor[m_layerId][0] = ((widthBL  << 16) + (widthEL  >> 1)) / widthEL;
    1046       g_posScalingFactor[m_layerId][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL;
    1047     }
    1048 #endif
    10491072
    10501073    UInt uiInternalAddress = pcPic->getNumPartInCU()-4;
Note: See TracChangeset for help on using the changeset viewer.