Ignore:
Timestamp:
31 May 2013, 10:28:36 (11 years ago)
Author:
seregin
Message:

code clean up and move up upsampleBasePic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r250 r251  
    532532    // Set the nal unit type
    533533    pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR));
    534 #if IDR_ALIGNMENT
     534#if SVC_EXTENSION
    535535    if (m_layerId > 0)
    536536    {
     
    567567      g_posScalingFactor[m_layerId][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL;
    568568#endif
     569
     570#if ZERO_NUM_DIRECT_LAYERS
     571      if( pcSlice->getActiveNumILRRefIdx() )
     572#endif
     573      {
     574#if SVC_UPSAMPLING
     575        if ( pcPic->isSpatialEnhLayer())
     576        {
     577#if SCALED_REF_LAYER_OFFSETS
     578          m_pcPredSearch->upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow() );
     579#else
     580          m_pcPredSearch->upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec() );
     581#endif
     582        }
     583        else
     584        {
     585          pcPic->setFullPelBaseRec( pcSlice->getBaseColPic()->getPicYuvRec() );
     586        }
     587        pcSlice->setFullPelBaseRec ( pcPic->getFullPelBaseRec() );
     588#endif
     589      }
    569590    }
    570591#endif
     
    736757    pcSlice->setTrQuant( m_pcEncTop->getTrQuant() );
    737758#endif     
    738 
    739 #if SVC_EXTENSION     
    740 #if ZERO_NUM_DIRECT_LAYERS
    741     if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() )
    742 #else
    743     if(m_layerId > 0)
    744 #endif
    745     {
    746 #if !IDR_ALIGNMENT
    747       TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId-1]->getListPic();
    748       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] = widthEL  == widthBL  ? 4096 : Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
    770       g_mvScalingFactor[m_layerId][1] = heightEL == heightBL ? 4096 : 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
    775 #endif
    776 #if SVC_UPSAMPLING
    777       if ( pcPic->isSpatialEnhLayer())
    778       {
    779 #if SCALED_REF_LAYER_OFFSETS
    780         m_pcPredSearch->upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow() );
    781 #else
    782         m_pcPredSearch->upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec() );
    783 #endif
    784       }
    785       else
    786       {
    787         pcPic->setFullPelBaseRec( pcSlice->getBaseColPic()->getPicYuvRec() );
    788       }
    789       pcSlice->setFullPelBaseRec ( pcPic->getFullPelBaseRec() );
    790 #endif
    791     }
    792 #endif
    793759
    794760#if REF_IDX_FRAMEWORK
Note: See TracChangeset for help on using the changeset viewer.