Changeset 475 in SHVCSoftware for branches/SHM-4.0-dev/source/Lib/TLibEncoder


Ignore:
Timestamp:
15 Nov 2013, 14:55:37 (11 years ago)
Author:
nokia
Message:

Integrate auxiliary picture layers (JCTVC-O0041)

Location:
branches/SHM-4.0-dev/source/Lib/TLibEncoder
Files:
11 edited

Legend:

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

    r467 r475  
    12211221    }
    12221222
     1223#if !AUXILIARY_PICTURES
    12231224#if REPN_FORMAT_IN_VPS
    12241225    // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present
     
    12271228    // in the first version chroma_format_idc is equal to one, thus colour_plane_id will not be present
    12281229    assert (pcSlice->getSPS()->getChromaFormatIdc() == 1 );
     1230#endif
    12291231#endif
    12301232    // if( separate_colour_plane_flag  ==  1 )
     
    14281430         WRITE_FLAG( pcSlice->getSaoEnabledFlag(), "slice_sao_luma_flag" );
    14291431         {
     1432#if AUXILIARY_PICTURES
     1433           if (pcSlice->getChromaFormatIdc() != CHROMA_400)
     1434           {
     1435#endif
    14301436           SAOParam *saoParam = pcSlice->getPic()->getPicSym()->getSaoParam();
    14311437          WRITE_FLAG( saoParam->bSaoFlag[1], "slice_sao_chroma_flag" );
     1438#if AUXILIARY_PICTURES
     1439           }
     1440#endif
    14321441         }
    14331442      }
     
    18941903  UInt            uiMode = 0;
    18951904  UInt            uiTotalSignalledWeightFlags = 0;
     1905#if AUXILIARY_PICTURES
     1906  if (pcSlice->getChromaFormatIdc() == CHROMA_400)
     1907  {
     1908    bChroma = false;
     1909  }
     1910#endif
    18961911  if ( (pcSlice->getSliceType()==P_SLICE && pcSlice->getPPS()->getUseWP()) || (pcSlice->getSliceType()==B_SLICE && pcSlice->getPPS()->getWPBiPred()) )
    18971912  {
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCfg.h

    r469 r475  
    211211  Int       m_chromaCbQpOffset;                 //  Chroma Cb QP Offset (0:default)
    212212  Int       m_chromaCrQpOffset;                 //  Chroma Cr Qp Offset (0:default)
     213#if AUXILIARY_PICTURES
     214  ChromaFormat m_chromaFormatIDC;
     215#endif
    213216
    214217#if ADAPTIVE_QP_SELECTION
     
    931934  Int       getAdaptiveResolutionChange()      { return m_adaptiveResolutionChange; }
    932935#endif
     936#if AUXILIARY_PICTURES
     937  Void         setChromaFormatIDC(ChromaFormat x) { m_chromaFormatIDC = x;    }
     938  ChromaFormat getChromaFormatIDC()               { return m_chromaFormatIDC; }
     939#endif
    933940#endif
    934941};
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncEntropy.cpp

    r345 r475  
    280280  const UInt uiTrDepthCurr = uiDepth - pcCU->getDepth( uiAbsPartIdx );
    281281  const Bool bFirstCbfOfCU = uiTrDepthCurr == 0;
     282#if AUXILIARY_PICTURES
     283  if (pcCU->getSlice()->getChromaFormatIdc() != CHROMA_400)
     284  {
     285#endif
    282286  if( bFirstCbfOfCU || uiLog2TrafoSize > 2 )
    283287  {
     
    296300    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) );
    297301  }
     302#if AUXILIARY_PICTURES
     303  }
     304  else
     305  {
     306    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == 0 );
     307    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == 0 );
     308  }
     309#endif
    298310 
    299311  if( uiSubdiv )
     
    402414Void TEncEntropy::encodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
    403415{
     416#if AUXILIARY_PICTURES
     417  if ( pcCU->getSlice()->getChromaFormatIdc() == CHROMA_400 )
     418  {
     419    return;
     420  }
     421#endif
    404422  if( bRD )
    405423  {
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r467 r475  
    31653165 
    31663166  TComPicYuv* pcOrgInterlaced = new TComPicYuv;
     3167#if AUXILIARY_PICTURES
     3168  pcOrgInterlaced->create( iWidth, iHeight << 1, pcPicOrgTop->getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     3169#else
    31673170  pcOrgInterlaced->create( iWidth, iHeight << 1, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     3171#endif
    31683172 
    31693173  TComPicYuv* pcRecInterlaced = new TComPicYuv;
     3174#if AUXILIARY_PICTURES
     3175  pcRecInterlaced->create( iWidth, iHeight << 1, pcPicOrgTop->getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     3176#else
    31703177  pcRecInterlaced->create( iWidth, iHeight << 1, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     3178#endif
    31713179 
    31723180  Pel* pOrgInterlaced = pcOrgInterlaced->getLumaAddr();
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncPic.cpp

    r313 r475  
    126126 * \return Void
    127127 */
     128#if AUXILIARY_PICTURES
     129#if SVC_UPSAMPLING
     130Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 
     131                      Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual )
     132
     133#else
     134
     135Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth,
     136                      Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual )
     137#endif
     138{
     139#if SVC_UPSAMPLING
     140  TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, 
     141                   conformanceWindow, defaultDisplayWindow, numReorderPics, pcSps, bIsVirtual );
     142#else
     143  TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, bIsVirtual );
     144#endif
     145  m_uiMaxAQDepth = uiMaxAQDepth;
     146  if ( uiMaxAQDepth > 0 )
     147  {
     148    m_acAQLayer = new TEncPicQPAdaptationLayer[ m_uiMaxAQDepth ];
     149    for (UInt d = 0; d < m_uiMaxAQDepth; d++)
     150    {
     151      m_acAQLayer[d].create( iWidth, iHeight, uiMaxWidth>>d, uiMaxHeight>>d );
     152    }
     153  }
     154}
     155#else
    128156#if SVC_UPSAMPLING
    129157Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 
     
    152180  }
    153181}
     182#endif
    154183
    155184/** Clean up
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncPic.h

    r313 r475  
    105105  virtual ~TEncPic();
    106106
     107#if AUXILIARY_PICTURES
     108#if SVC_UPSAMPLING
     109  Void          create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 
     110                      Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual=false );
     111#else
     112  Void          create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth,
     113                          Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false );
     114
     115#endif
     116#else
    107117#if SVC_UPSAMPLING
    108118  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth,   
     
    111121  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth,   
    112122                        Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false );
     123#endif
    113124#endif
    114125  virtual Void  destroy();
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r313 r475  
    18711871
    18721872  saoParam->bSaoFlag[0] = true;
     1873#if AUXILIARY_PICTURES
     1874  saoParam->bSaoFlag[1] = m_pcPic->getChromaFormat() == CHROMA_400 ? false : true;
     1875#else
    18731876  saoParam->bSaoFlag[1] = true;
     1877#endif
    18741878  saoParam->oneUnitFlag[0] = false;
    18751879  saoParam->oneUnitFlag[1] = false;
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncSbac.cpp

    r442 r475  
    914914    }
    915915
     916#if AUXILIARY_PICTURES
     917    if (pcCU->getSlice()->getChromaFormatIdc() != CHROMA_400)
     918    {
     919#endif
    916920    piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset;
    917921    uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;
     
    945949      piPCMSample += uiWidth;
    946950    }
     951#if AUXILIARY_PICTURES
     952    }
     953#endif
    947954    m_pcBinIf->resetBac();
    948955  }
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncSlice.cpp

    r469 r475  
    7979}
    8080
     81#if AUXILIARY_PICTURES
     82Void TEncSlice::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth )
     83{
     84  // create prediction picture
     85  if ( m_apcPicYuvPred == NULL )
     86  {
     87    m_apcPicYuvPred  = new TComPicYuv;
     88    m_apcPicYuvPred->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth );
     89  }
     90
     91  // create residual picture
     92  if( m_apcPicYuvResi == NULL )
     93  {
     94    m_apcPicYuvResi  = new TComPicYuv;
     95    m_apcPicYuvResi->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth );
     96  }
     97}
     98#else
    8199Void TEncSlice::create( Int iWidth, Int iHeight, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth )
    82100{
     
    95113  }
    96114}
     115#endif
    97116
    98117Void TEncSlice::destroy()
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncSlice.h

    r442 r475  
    111111  virtual ~TEncSlice();
    112112 
     113#if AUXILIARY_PICTURES
     114  Void    create              ( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth );
     115#else
    113116  Void    create              ( Int iWidth, Int iHeight, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth );
     117#endif
    114118  Void    destroy             ();
    115119  Void    init                ( TEncTop* pcEncTop );
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r469 r475  
    115115  m_cGOPEncoder.        create();
    116116#endif
     117#if AUXILIARY_PICTURES
     118  m_cSliceEncoder.      create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     119#else
    117120  m_cSliceEncoder.      create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     121#endif
    118122  m_cCuEncoder.         create( g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight );
    119123  if (m_bUseSAO)
     
    606610    else
    607611    {
     612#if AUXILIARY_PICTURES
     613      rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     614#else
    608615      rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     616#endif
    609617    }
    610618    rcListPicYuvRecOut.pushBack( rpcPicYuvRec );
     
    806814#endif
    807815
     816#if AUXILIARY_PICTURES
     817#if SVC_UPSAMPLING
     818      pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 ,
     819                      m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS);
     820#else
     821      pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 ,
     822                      m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);
     823#endif
     824#else
    808825#if SVC_UPSAMPLING
    809826      pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 ,
     
    812829      pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 ,
    813830                      m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);
     831#endif
    814832#endif
    815833      rpcPic = pcEPic;
     
    847865#endif
    848866
     867#if AUXILIARY_PICTURES
     868#if SVC_UPSAMPLING
     869      rpcPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     870                      m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS);
     871#else
     872      rpcPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     873                      m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);
     874#endif
     875#else
    849876#if SVC_UPSAMPLING
    850877      rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
     
    853880      rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    854881                      m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);
     882#endif
    855883#endif
    856884    }
     
    917945  m_cSPS.setMaxCUHeight   ( g_uiMaxCUHeight     );
    918946  m_cSPS.setMaxCUDepth    ( g_uiMaxCUDepth      );
     947#if AUXILIARY_PICTURES
     948  m_cSPS.setChromaFormatIdc( m_chromaFormatIDC);
     949#endif
    919950
    920951  Int minCUSize = m_cSPS.getMaxCUWidth() >> ( m_cSPS.getMaxCUDepth()-g_uiAddCUDepth );
     
    15571588        m_cIlpPic[j] = new  TComPic;
    15581589#if SVC_UPSAMPLING
     1590#if AUXILIARY_PICTURES
     1591        m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true);
     1592#else
    15591593        m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true);
     1594#endif
    15601595#else
    15611596        m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     
    16091644        m_cIlpPic[j] = new  TComPic;
    16101645#if SVC_UPSAMPLING
     1646#if AUXILIARY_PICTURES
     1647        m_cIlpPic[j]->create(picWidth, picHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true);
     1648#else
    16111649        m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true);
     1650#endif
    16121651#else
    16131652        m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);
Note: See TracChangeset for help on using the changeset viewer.