Changeset 713 in SHVCSoftware for trunk/source/Lib/TLibCommon


Ignore:
Timestamp:
21 Apr 2014, 04:44:16 (11 years ago)
Author:
seregin
Message:

merge with SHM-6-dev

Location:
trunk
Files:
18 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • trunk/source/Lib/TLibCommon/CommonDef.h

    r644 r713  
    5858#if SVC_EXTENSION
    5959#include <vector>
    60 #define NV_VERSION        "5.1 (HM-13.0)"                 ///< Current software version
     60#define NV_VERSION        "6.0 (HM-14.0)"                 ///< Current software version
    6161#else
    62 #define NV_VERSION        "13.0"                ///< Current software version
     62#define NV_VERSION        "14.0"                ///< Current software version
    6363#endif
    6464
  • trunk/source/Lib/TLibCommon/SEI.h

    r644 r713  
    7979#endif
    8080#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
    81     INTER_LAYER_CONSTRAINED_TILE_SETS    = 138
     81    INTER_LAYER_CONSTRAINED_TILE_SETS    = 138,
    8282#endif
    8383#if SUB_BITSTREAM_PROPERTY_SEI
    84    ,SUB_BITSTREAM_PROPERTY               = 139    // Final PayloadType to be defined after finalization
     84    SUB_BITSTREAM_PROPERTY               = 139,    // Final PayloadType to be defined after finalization
    8585#endif
    8686#if O0164_MULTI_LAYER_HRD
    87    ,BSP_NESTING                          = 140
    88    ,BSP_INITIAL_ARRIVAL_TIME             = 141
    89    ,BSP_HRD                              = 142
     87    BSP_NESTING                          = 140,
     88    BSP_INITIAL_ARRIVAL_TIME             = 141,
     89    BSP_HRD                              = 142,
     90#endif
     91#if Q0074_SEI_COLOR_MAPPING
     92    COLOR_MAPPING_INFO                   = 143,
    9093#endif
    9194  };
     
    142145  SEIActiveParameterSets()
    143146    : activeVPSId            (0)
    144     , m_fullRandomAccessFlag (false)
    145     , m_noParamSetUpdateFlag (false)
     147    , m_selfContainedCvsFlag (false)
     148    , m_noParameterSetUpdateFlag (false)
    146149    , numSpsIdsMinus1        (0)
    147150  {}
     
    149152
    150153  Int activeVPSId;
    151   Bool m_fullRandomAccessFlag;
    152   Bool m_noParamSetUpdateFlag;
     154  Bool m_selfContainedCvsFlag;
     155  Bool m_noParameterSetUpdateFlag;
    153156  Int numSpsIdsMinus1;
    154   std::vector<Int> activeSeqParamSetId;
     157  std::vector<Int> activeSeqParameterSetId;
    155158};
    156159
     
    393396  Int    m_cameraIsoSpeedIdc;
    394397  Int    m_cameraIsoSpeedValue;
     398  Int    m_exposureIndexIdc;
     399  Int    m_exposureIndexValue;
    395400  Int    m_exposureCompensationValueSignFlag;
    396401  Int    m_exposureCompensationValueNumerator;
     
    402407  Int    m_extendedWhiteLevelLumaCodeValue;
    403408};
     409
     410#if Q0074_SEI_COLOR_MAPPING
     411class SEIColorMappingInfo : public SEI
     412{
     413public:
     414  PayloadType payloadType() const { return COLOR_MAPPING_INFO; }
     415  SEIColorMappingInfo() {
     416  }
     417  virtual ~SEIColorMappingInfo() {}
     418
     419  Int   m_colorMapId;
     420  Bool  m_colorMapCancelFlag;
     421  Bool  m_colorMapPersistenceFlag;
     422  Bool  m_colorMap_video_signal_type_present_flag;
     423  Bool  m_colorMap_video_full_range_flag;
     424  Int   m_colorMap_primaries;
     425  Int   m_colorMap_transfer_characteristics;
     426  Int   m_colorMap_matrix_coeffs;
     427  Int   m_colorMapModelId;
     428
     429  Int   m_colour_map_coded_data_bit_depth;
     430  Int   m_colour_map_target_bit_depth;
     431
     432  Int   m_num_input_pivots[3];
     433  Int*  m_coded_input_pivot_value[3];
     434  Int*  m_target_input_pivot_value[3];
     435 
     436  Bool  m_matrix_flag;
     437  Int   m_log2_matrix_denom;
     438  Int   m_matrix_coef[3][3];
     439
     440  Int   m_num_output_pivots[3];
     441  Int*  m_coded_output_pivot_value[3];
     442  Int*  m_target_output_pivot_value[3];
     443};
     444#endif
    404445
    405446#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r595 r713  
    172172    memset( m_pcTrCoeffCb, 0,uiWidth*uiHeight/4 * sizeof( TCoeff ) );
    173173    memset( m_pcTrCoeffCr, 0,uiWidth*uiHeight/4 * sizeof( TCoeff ) );
    174 #if ADAPTIVE_QP_SELECTION   
     174#if ADAPTIVE_QP_SELECTION
    175175    if( bGlobalRMARLBuffer )
    176176    {
    177177      if( m_pcGlbArlCoeffY == NULL )
    178178      {
     179#if LAYER_CTB
     180        m_pcGlbArlCoeffY   = (Int*)xMalloc(Int, MAX_CU_SIZE * MAX_CU_SIZE);
     181        m_pcGlbArlCoeffCb  = (Int*)xMalloc(Int, MAX_CU_SIZE * MAX_CU_SIZE/4);
     182        m_pcGlbArlCoeffCr  = (Int*)xMalloc(Int, MAX_CU_SIZE * MAX_CU_SIZE/4);
     183#else
    179184        m_pcGlbArlCoeffY   = (Int*)xMalloc(Int, uiWidth*uiHeight);
    180185        m_pcGlbArlCoeffCb  = (Int*)xMalloc(Int, uiWidth*uiHeight/4);
    181186        m_pcGlbArlCoeffCr  = (Int*)xMalloc(Int, uiWidth*uiHeight/4);
     187#endif
    182188      }
    183189      m_pcArlCoeffY        = m_pcGlbArlCoeffY;
     
    16901696}
    16911697
    1692 
    1693 #if FAST_INTRA_SHVC
    1694 /** generate limited set of remaining modes
    1695 *\param   uiAbsPartIdx
    1696 *\param   uiIntraDirPred  pointer to the array for MPM storage
    1697 *\returns Number of intra coding modes (nb of remaining modes + 3 MPMs)
    1698 */
    1699 Int TComDataCU::reduceSetOfIntraModes( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes )
    1700 {
    1701   // check BL mode
    1702   UInt          uiCUAddrBase = 0, uiAbsPartAddrBase = 0;
    1703   // the right reference layerIdc should be specified, currently it is set to m_layerId-1
    1704   TComDataCU*   pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase, 0 );
    1705 
    1706   if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA )
    1707   {
    1708     return( NUM_INTRA_MODE-1 );
    1709   }
    1710 
    1711   // compute set of enabled modes g_reducedSetIntraModes[...]
    1712   Int authorizedMode[NUM_INTRA_MODE-1]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
    1713   Int nbModes;
    1714   for (nbModes=0; nbModes<3; nbModes++)  // add 3 MPMs 1st
    1715   {
    1716     g_reducedSetIntraModes[nbModes] = uiIntraDirPred[nbModes];
    1717     authorizedMode[ uiIntraDirPred[nbModes] ] = 0;
    1718   }
    1719 
    1720   Int iColBaseDir = pcTempCU->getLumaIntraDir( uiAbsPartAddrBase );
    1721   if ( authorizedMode[iColBaseDir] )  //possibly add BL mode
    1722   {
    1723     g_reducedSetIntraModes[nbModes++] = iColBaseDir;
    1724     authorizedMode[ iColBaseDir ] = 0;
    1725   }
    1726 
    1727   Int iRefMode = ( iColBaseDir > 1 ) ? iColBaseDir : uiIntraDirPred[0];
    1728   if ( iRefMode > 1 )    //add neighboring modes of refMode
    1729   {
    1730     UInt Left  = iRefMode;
    1731     UInt Right = iRefMode;
    1732     while ( nbModes < NB_REMAIN_MODES+3 )
    1733     {
    1734       Left = ((Left + 29) % 32) + 2;
    1735       Right = ((Right - 1 ) % 32) + 2;
    1736       if ( authorizedMode[Left] )   g_reducedSetIntraModes[nbModes++] = Left;
    1737       if ( authorizedMode[Right] )  g_reducedSetIntraModes[nbModes++] = Right;
    1738     }
    1739   }
    1740   else      //add pre-defined modes
    1741   {
    1742     Int  idx = 0;
    1743     while ( nbModes < NB_REMAIN_MODES+3 )
    1744     {
    1745       UInt mode = g_predefSetIntraModes[idx++];
    1746       if ( authorizedMode[mode] )   g_reducedSetIntraModes[nbModes++] = mode;
    1747     }
    1748   }
    1749 
    1750   fullSetOfModes = 0;
    1751   return ( nbModes );
    1752 }
    1753 #endif
    1754 
    1755 
    17561698UInt TComDataCU::getCtxSplitFlag( UInt uiAbsPartIdx, UInt uiDepth )
    17571699{
     
    18091751  return log2MinTUSizeInCU;
    18101752}
    1811 
    1812 #if REF_IDX_ME_ZEROMV
    1813 Bool TComDataCU::xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)
    1814 {
    1815   Bool checkZeroMVILR = true;
    1816 
    1817   if(uhInterDir&0x1)  //list0
    1818   {
    1819     Int refIdxL0 = cMvFieldL0.getRefIdx();
    1820     if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId))
    1821     {
    1822       checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0);
    1823     }
    1824   }
    1825   if(uhInterDir&0x2)  //list1
    1826   {
    1827     Int refIdxL1  = cMvFieldL1.getRefIdx();
    1828     if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId))
    1829     {
    1830       checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0);
    1831     }
    1832   }
    1833 
    1834   return checkZeroMVILR;
    1835 }
    1836 
    1837 Bool TComDataCU::xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx)
    1838 {
    1839   RefPicList eRefPicList = iRefList > 0? REF_PIC_LIST_1: REF_PIC_LIST_0;
    1840   assert(eRefPicList == REF_PIC_LIST_1);
    1841 
    1842   Bool checkZeroMVILR = true;
    1843 
    1844   if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(m_layerId))
    1845   {
    1846     AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo();
    1847     TComMv    cMv        = pcAMVPInfo->m_acMvCand[MvpIdx];
    1848     checkZeroMVILR &= (cMv.getHor() == 0 && cMv.getVer() == 0);
    1849   }
    1850 
    1851   return checkZeroMVILR;
    1852 }
    1853 #endif
    1854 
    1855 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI
    1856 Bool TComDataCU::isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)
    1857 {
    1858   Bool checkILR = false;
    1859 
    1860   if(uhInterDir&0x1)  //list0
    1861   {
    1862     Int refIdxL0 = cMvFieldL0.getRefIdx();
    1863     checkILR = getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId);
    1864   }
    1865   if(uhInterDir&0x2)  //list1
    1866   {
    1867     Int refIdxL1  = cMvFieldL1.getRefIdx();
    1868     checkILR = checkILR || getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId);
    1869   }
    1870 
    1871   return checkILR;
    1872 }
    1873 #endif
    18741753
    18751754UInt TComDataCU::getCtxSkipFlag( UInt uiAbsPartIdx )
     
    21682047}
    21692048
    2170 UChar TComDataCU::getNumPartInter()
     2049UChar TComDataCU::getNumPartitions()
    21712050{
    21722051  UChar iNumPart = 0;
     
    36123491TComDataCU*  TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping )
    36133492{
    3614   TComPic* cBaseColPic = m_pcSlice->getBaseColPic(refLayerIdc);
     3493  TComPic* baseColPic = m_pcSlice->getBaseColPic(refLayerIdc);
    36153494
    36163495  uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX);
     
    36223501
    36233502#if O0098_SCALED_REF_LAYER_ID
    3624   Int leftStartL = getSlice()->getSPS()->getScaledRefLayerWindowForLayer(getSlice()->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset();
    3625   Int topStartL  = getSlice()->getSPS()->getScaledRefLayerWindowForLayer(getSlice()->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset();
     3503  Int leftStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset();
     3504  Int topStartL  = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset();
    36263505#else
    3627   Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset();
    3628   Int topStartL  = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset();
    3629 #endif
     3506  Int leftStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset();
     3507  Int topStartL  = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset();
     3508#endif
     3509
     3510#if Q0200_CONFORMANCE_BL_SIZE
     3511  Int chromaFormatIdc = baseColPic->getSlice(0)->getChromaFormatIdc();
     3512  Int iBX = (((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16) + baseColPic->getConformanceWindow().getWindowLeftOffset() * TComSPS::getWinUnitX( chromaFormatIdc );
     3513  Int iBY = (((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16) + baseColPic->getConformanceWindow().getWindowTopOffset() * TComSPS::getWinUnitY( chromaFormatIdc );
     3514#else
    36303515  Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16;
    36313516  Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;
     3517#endif
    36323518
    36333519#if N0139_POSITION_ROUNDING_OFFSET
    36343520  if( iMotionMapping == 1 )
    36353521  {
    3636     iBX += 4;
    3637     iBY += 4;
    3638   }
    3639 #endif
    3640 
    3641   if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight() ||
    3642        iBX < 0                                        || iBY < 0                                          )
     3522    // actually, motion field compression is performed in the Void TComPic::compressMotion() function, but with (+4) the rounding may have effect on the picture boundary check.
     3523    iBX = ( ( iBX + 4 ) >> 4 ) << 4;
     3524    iBY = ( ( iBY + 4 ) >> 4 ) << 4;
     3525  }
     3526#endif
     3527
     3528  if ( iBX < 0 || iBX >= baseColPic->getPicYuvRec()->getWidth() || iBY < 0 || iBY >= baseColPic->getPicYuvRec()->getHeight() )
    36433529  {
    36443530    return NULL;
     
    36463532
    36473533#if LAYER_CTB
    3648   UInt baseMaxCUHeight = cBaseColPic->getPicSym()->getMaxCUHeight();
    3649   UInt baseMaxCUWidth  = cBaseColPic->getPicSym()->getMaxCUWidth();
    3650   UInt baseMinUnitSize = cBaseColPic->getMinCUWidth();
    3651  
    3652   uiCUAddrBase = ( iBY / cBaseColPic->getPicSym()->getMaxCUHeight() ) * cBaseColPic->getFrameWidthInCU() + ( iBX / cBaseColPic->getPicSym()->getMaxCUWidth() );
     3534  UInt baseMaxCUHeight = baseColPic->getPicSym()->getMaxCUHeight();
     3535  UInt baseMaxCUWidth  = baseColPic->getPicSym()->getMaxCUWidth();
     3536  UInt baseMinUnitSize = baseColPic->getMinCUWidth();
     3537 
     3538  uiCUAddrBase = ( iBY / baseMaxCUHeight ) * baseColPic->getFrameWidthInCU() + ( iBX / baseMaxCUWidth );
    36533539#else
    3654   uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth);
    3655 #endif
    3656 
    3657   assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame());
     3540  uiCUAddrBase = (iBY/g_uiMaxCUHeight)*baseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth);
     3541#endif
     3542
     3543  assert(uiCUAddrBase < baseColPic->getNumCUsInFrame());
    36583544
    36593545#if LAYER_CTB
    3660   UInt uiRasterAddrBase = ( iBY - (iBY/baseMaxCUHeight)*baseMaxCUHeight ) / baseMinUnitSize * cBaseColPic->getNumPartInWidth() + ( iBX - (iBX/baseMaxCUWidth)*baseMaxCUWidth ) / baseMinUnitSize;
    3661  
    3662   uiAbsPartIdxBase = g_auiLayerRasterToZscan[cBaseColPic->getLayerId()][uiRasterAddrBase];
     3546  UInt uiRasterAddrBase = ( iBY - (iBY/baseMaxCUHeight)*baseMaxCUHeight ) / baseMinUnitSize * baseColPic->getNumPartInWidth() + ( iBX - (iBX/baseMaxCUWidth)*baseMaxCUWidth ) / baseMinUnitSize;
     3547 
     3548  uiAbsPartIdxBase = g_auiLayerRasterToZscan[baseColPic->getLayerId()][uiRasterAddrBase];
    36633549#else
    3664   UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*cBaseColPic->getNumPartInWidth()
     3550  UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*baseColPic->getNumPartInWidth()
    36653551    + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize;
    36663552
     
    36683554#endif
    36693555
    3670   return cBaseColPic->getCU(uiCUAddrBase);
     3556  return baseColPic->getCU(uiCUAddrBase);
    36713557}
    36723558
     
    36803566  rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() );
    36813567}
     3568
     3569#if FAST_INTRA_SHVC
     3570/** generate limited set of remaining modes
     3571*\param   uiAbsPartIdx
     3572*\param   uiIntraDirPred  pointer to the array for MPM storage
     3573*\returns Number of intra coding modes (nb of remaining modes + 3 MPMs)
     3574*/
     3575Int TComDataCU::reduceSetOfIntraModes( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes )
     3576{
     3577  // check BL mode
     3578  UInt          uiCUAddrBase = 0, uiAbsPartAddrBase = 0;
     3579  // the right reference layerIdc should be specified, currently it is set to m_layerId-1
     3580  TComDataCU*   pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase, 0 );
     3581
     3582  if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA )
     3583  {
     3584    return( NUM_INTRA_MODE-1 );
     3585  }
     3586
     3587  // compute set of enabled modes g_reducedSetIntraModes[...]
     3588  Int authorizedMode[NUM_INTRA_MODE-1]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
     3589  Int nbModes;
     3590  for (nbModes=0; nbModes<3; nbModes++)  // add 3 MPMs 1st
     3591  {
     3592    g_reducedSetIntraModes[nbModes] = uiIntraDirPred[nbModes];
     3593    authorizedMode[ uiIntraDirPred[nbModes] ] = 0;
     3594  }
     3595
     3596  Int iColBaseDir = pcTempCU->getLumaIntraDir( uiAbsPartAddrBase );
     3597  if ( authorizedMode[iColBaseDir] )  //possibly add BL mode
     3598  {
     3599    g_reducedSetIntraModes[nbModes++] = iColBaseDir;
     3600    authorizedMode[ iColBaseDir ] = 0;
     3601  }
     3602
     3603  Int iRefMode = ( iColBaseDir > 1 ) ? iColBaseDir : uiIntraDirPred[0];
     3604  if ( iRefMode > 1 )    //add neighboring modes of refMode
     3605  {
     3606    UInt Left  = iRefMode;
     3607    UInt Right = iRefMode;
     3608    while ( nbModes < NB_REMAIN_MODES+3 )
     3609    {
     3610      Left = ((Left + 29) % 32) + 2;
     3611      Right = ((Right - 1 ) % 32) + 2;
     3612      if ( authorizedMode[Left] )   g_reducedSetIntraModes[nbModes++] = Left;
     3613      if ( authorizedMode[Right] )  g_reducedSetIntraModes[nbModes++] = Right;
     3614    }
     3615  }
     3616  else      //add pre-defined modes
     3617  {
     3618    Int  idx = 0;
     3619    while ( nbModes < NB_REMAIN_MODES+3 )
     3620    {
     3621      UInt mode = g_predefSetIntraModes[idx++];
     3622      if ( authorizedMode[mode] )   g_reducedSetIntraModes[nbModes++] = mode;
     3623    }
     3624  }
     3625
     3626  fullSetOfModes = 0;
     3627  return ( nbModes );
     3628}
     3629#endif
     3630
     3631#if REF_IDX_ME_ZEROMV
     3632Bool TComDataCU::xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)
     3633{
     3634  Bool checkZeroMVILR = true;
     3635
     3636  if(uhInterDir&0x1)  //list0
     3637  {
     3638    Int refIdxL0 = cMvFieldL0.getRefIdx();
     3639    if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId))
     3640    {
     3641      checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0);
     3642    }
     3643  }
     3644  if(uhInterDir&0x2)  //list1
     3645  {
     3646    Int refIdxL1  = cMvFieldL1.getRefIdx();
     3647    if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId))
     3648    {
     3649      checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0);
     3650    }
     3651  }
     3652
     3653  return checkZeroMVILR;
     3654}
     3655
     3656Bool TComDataCU::xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx)
     3657{
     3658  RefPicList eRefPicList = iRefList > 0? REF_PIC_LIST_1: REF_PIC_LIST_0;
     3659  assert(eRefPicList == REF_PIC_LIST_1);
     3660
     3661  Bool checkZeroMVILR = true;
     3662
     3663  if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(m_layerId))
     3664  {
     3665    AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo();
     3666    TComMv    cMv        = pcAMVPInfo->m_acMvCand[MvpIdx];
     3667    checkZeroMVILR &= (cMv.getHor() == 0 && cMv.getVer() == 0);
     3668  }
     3669
     3670  return checkZeroMVILR;
     3671}
     3672#endif
     3673
     3674#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     3675Bool TComDataCU::isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)
     3676{
     3677  Bool checkILR = false;
     3678
     3679  if(uhInterDir&0x1)  //list0
     3680  {
     3681    Int refIdxL0 = cMvFieldL0.getRefIdx();
     3682    checkILR = getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId);
     3683  }
     3684  if(uhInterDir&0x2)  //list1
     3685  {
     3686    Int refIdxL1  = cMvFieldL1.getRefIdx();
     3687    checkILR = checkILR || getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId);
     3688  }
     3689
     3690  return checkILR;
     3691}
     3692#endif
     3693
    36823694#endif //SVC_EXTENSION
    36833695//! \}
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r595 r713  
    352352 
    353353  Void          getPartIndexAndSize   ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight );
    354   UChar         getNumPartInter       ();
     354  UChar         getNumPartitions       ();
    355355  Bool          isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth);
    356356 
  • trunk/source/Lib/TLibCommon/TComMotionInfo.h

    r595 r713  
    141141  Void    setAllMvField( TComMvField const & mvField, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 );
    142142
    143 #if AVC_SYNTAX
    144   Void           setMv    (TComMv cMv,  Int iIdx )         { m_pcMv    [iIdx] = cMv; }
    145   Void           setRefIdx(Int iRefIdx, Int iIdx   )       { m_piRefIdx[iIdx] =  iRefIdx; }
    146 #endif
    147 
    148143  Void setNumPartition( Int iNumPart )
    149144  {
     
    159154 
    160155  Void compress(Char* pePredMode, Int scale);
     156
     157#if AVC_SYNTAX
     158  Void           setMv    (TComMv cMv,  Int iIdx )         { m_pcMv    [iIdx] = cMv; }
     159  Void           setRefIdx(Int iRefIdx, Int iIdx   )       { m_piRefIdx[iIdx] =  iRefIdx; }
     160#endif
    161161
    162162#if REF_IDX_MFM
  • trunk/source/Lib/TLibCommon/TComPic.h

    r595 r713  
    8989  TComPicYuv*           m_pcFullPelBaseRec[MAX_LAYERS];    // upsampled base layer recontruction for difference domain inter prediction
    9090#endif
     91#if Q0048_CGS_3D_ASYMLUT
     92  Int                   m_nFrameBit;
     93#endif
    9194
    9295public:
     
    115118  UInt          getTLayer()                { return m_uiTLayer;   }
    116119  Void          setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; }
     120
    117121  Bool          getUsedByCurr()             { return m_bUsedByCurr; }
    118122  Void          setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
     
    219223#endif
    220224
     225#if Q0048_CGS_3D_ASYMLUT
     226  Void  setFrameBit( Int n )  { m_nFrameBit = n;    }
     227  Int   getFrameBit()         { return m_nFrameBit; }
     228#endif
    221229};// END CLASS DEFINITION TComPic
    222230
  • trunk/source/Lib/TLibCommon/TComPicYuv.cpp

    r595 r713  
    174174  Int numCuInHeight = m_iPicHeight / m_iCuHeight + (m_iPicHeight % m_iCuHeight != 0);
    175175 
     176#if LAYER_CTB
     177  m_iLumaMarginX    = uiMaxCUWidth  + 16; // for 16-byte alignment
     178  m_iLumaMarginY    = uiMaxCUHeight + 16;  // margin for 8-tap filter and infinite padding
     179#else
    176180  m_iLumaMarginX    = g_uiMaxCUWidth  + 16; // for 16-byte alignment
    177181  m_iLumaMarginY    = g_uiMaxCUHeight + 16;  // margin for 8-tap filter and infinite padding
     182#endif
    178183 
    179184  m_apiPicBufY      = (Pel*)xMalloc( Pel, ( m_iPicWidth       + (m_iLumaMarginX  <<1)) * ( m_iPicHeight       + (m_iLumaMarginY  <<1)));
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r644 r713  
    447447  }
    448448
    449   for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartInter(); iPartIdx++ )
     449  for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartitions(); iPartIdx++ )
    450450  {
    451451    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
     
    768768#if O0215_PHASE_ALIGNMENT
    769769#if O0194_JOINT_US_BITSHIFT
    770 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag )
    771 {
    772   m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, phaseAlignFlag );
     770Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag )
     771{
     772  m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, phaseAlignFlag );
    773773}
    774774#else
  • trunk/source/Lib/TLibCommon/TComPrediction.h

    r644 r713  
    121121#if O0215_PHASE_ALIGNMENT
    122122#if O0194_JOINT_US_BITSHIFT
    123   Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );
     123  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag );
    124124#else
    125125  Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );
  • trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp

    r644 r713  
    112112    m_offsetClipTable[compIdx] = NULL;
    113113  }
     114#if !SAO_SGN_FUNC
    114115  m_signTable = NULL;
    115 
     116#endif
    116117 
    117118  m_lineBufWidth = 0;
     
    169170  }
    170171
     172#if !SAO_SGN_FUNC
    171173  //look-up table for clipping
     174  Int overallMaxSampleValue=0;
     175#endif
    172176  for(Int compIdx =0; compIdx < NUM_SAO_COMPONENTS; compIdx++)
    173177  {
     
    179183    Int maxOffsetValue = (g_saoMaxOffsetQVal[compIdx] << m_offsetStepLog2[compIdx]);
    180184#endif
     185#if !SAO_SGN_FUNC
     186    if (maxSampleValue>overallMaxSampleValue) overallMaxSampleValue=maxSampleValue;
     187#endif
    181188
    182189    m_offsetClipTable[compIdx] = new Int[(maxSampleValue + maxOffsetValue -1)+ (maxOffsetValue)+1 ]; //positive & negative range plus 0
     
    194201      *(offsetClipPtr -k -1 )              = 0;
    195202    }
    196     if(compIdx == SAO_Y) //g_bitDepthY is always larger than or equal to g_bitDepthC
    197     {
    198       m_signTable = new Short[ 2*(maxSampleValue-1) + 1 ];
    199       m_sign = &(m_signTable[maxSampleValue-1]);
    200 
    201       m_sign[0] = 0;
    202       for(Int k=1; k< maxSampleValue; k++)
    203       {
    204         m_sign[k] = 1;
    205         m_sign[-k]= -1;
    206       }
    207     }
    208   } 
    209 
     203  }
     204
     205#if !SAO_SGN_FUNC
     206  m_signTable = new Short[ 2*(overallMaxSampleValue-1) + 1 ];
     207  m_sign = &(m_signTable[overallMaxSampleValue-1]);
     208
     209  m_sign[0] = 0;
     210  for(Int k=1; k< overallMaxSampleValue; k++)
     211  {
     212    m_sign[k] = 1;
     213    m_sign[-k]= -1;
     214  }
     215#endif
    210216}
    211217
     
    226232    }
    227233  }
     234#if !SAO_SGN_FUNC
    228235  if( m_signTable )
    229236  {
    230237    delete[] m_signTable; m_signTable = NULL;
    231238  }
     239#endif
    232240}
    233241
     
    406414      for (y=0; y< height; y++)
    407415      {
     416#if SAO_SGN_FUNC
     417        signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]);
     418#else
    408419        signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]];
     420#endif
    409421        for (x=startX; x< endX; x++)
    410422        {
     423#if SAO_SGN_FUNC
     424          signRight = (Char)sgn(srcLine[x] - srcLine[x+1]);
     425#else
    411426          signRight = (Char)m_sign[srcLine[x] - srcLine[x+1]];
     427#endif
    412428          edgeType =  signRight + signLeft;
    413429          signLeft  = -signRight;
     
    437453      for (x=0; x< width; x++)
    438454      {
     455#if SAO_SGN_FUNC
     456        signUpLine[x] = (Char)sgn(srcLine[x] - srcLineAbove[x]);
     457#else
    439458        signUpLine[x] = (Char)m_sign[srcLine[x] - srcLineAbove[x]];
     459#endif
    440460      }
    441461
     
    447467        for (x=0; x< width; x++)
    448468        {
     469#if SAO_SGN_FUNC
     470          signDown  = (Char)sgn(srcLine[x] - srcLineBelow[x]);
     471#else
    449472          signDown  = (Char)m_sign[srcLine[x] - srcLineBelow[x]];
     473#endif
    450474          edgeType = signDown + signUpLine[x];
    451475          signUpLine[x]= -signDown;
     
    474498      for (x=startX; x< endX+1; x++)
    475499      {
     500#if SAO_SGN_FUNC
     501        signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x- 1]);
     502#else
    476503        signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x- 1]];
     504#endif
    477505      }
    478506
     
    483511      for(x= firstLineStartX; x< firstLineEndX; x++)
    484512      {
     513#if SAO_SGN_FUNC
     514        edgeType  =  sgn(srcLine[x] - srcLineAbove[x- 1]) - signUpLine[x+1];
     515#else
    485516        edgeType  =  m_sign[srcLine[x] - srcLineAbove[x- 1]] - signUpLine[x+1];
     517#endif
    486518        resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    487519      }
     
    497529        for (x=startX; x<endX; x++)
    498530        {
     531#if SAO_SGN_FUNC
     532          signDown =  (Char)sgn(srcLine[x] - srcLineBelow[x+ 1]);
     533#else
    499534          signDown =  (Char)m_sign[srcLine[x] - srcLineBelow[x+ 1]] ;
     535#endif
    500536          edgeType =  signDown + signUpLine[x];
    501537          resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
     
    503539          signDownLine[x+1] = -signDown;
    504540        }
     541#if SAO_SGN_FUNC
     542        signDownLine[startX] = (Char)sgn(srcLineBelow[startX] - srcLine[startX-1]);
     543#else
    505544        signDownLine[startX] = (Char)m_sign[srcLineBelow[startX] - srcLine[startX-1]];
     545#endif
    506546
    507547        signTmpLine  = signUpLine;
     
    519559      for(x= lastLineStartX; x< lastLineEndX; x++)
    520560      {
     561#if SAO_SGN_FUNC
     562        edgeType =  sgn(srcLine[x] - srcLineBelow[x+ 1]) + signUpLine[x];
     563#else
    521564        edgeType =  m_sign[srcLine[x] - srcLineBelow[x+ 1]] + signUpLine[x];
     565#endif
    522566        resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    523567
     
    537581      for (x=startX-1; x< endX; x++)
    538582      {
     583#if SAO_SGN_FUNC
     584        signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x+1]);
     585#else
    539586        signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x+1]];
     587#endif
    540588      }
    541589
     
    547595      for(x= firstLineStartX; x< firstLineEndX; x++)
    548596      {
     597#if SAO_SGN_FUNC
     598        edgeType = sgn(srcLine[x] - srcLineAbove[x+1]) -signUpLine[x-1];
     599#else
    549600        edgeType = m_sign[srcLine[x] - srcLineAbove[x+1]] -signUpLine[x-1];
     601#endif
    550602        resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    551603      }
     
    560612        for(x= startX; x< endX; x++)
    561613        {
     614#if SAO_SGN_FUNC
     615          signDown =  (Char)sgn(srcLine[x] - srcLineBelow[x-1]);
     616#else
    562617          signDown =  (Char)m_sign[srcLine[x] - srcLineBelow[x-1]] ;
     618#endif
    563619          edgeType =  signDown + signUpLine[x];
    564620          resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    565621          signUpLine[x-1] = -signDown;
    566622        }
     623#if SAO_SGN_FUNC
     624        signUpLine[endX-1] = (Char)sgn(srcLineBelow[endX-1] - srcLine[endX]);
     625#else
    567626        signUpLine[endX-1] = (Char)m_sign[srcLineBelow[endX-1] - srcLine[endX]];
     627#endif
    568628        srcLine  += srcStride;
    569629        resLine += resStride;
     
    576636      for(x= lastLineStartX; x< lastLineEndX; x++)
    577637      {
     638#if SAO_SGN_FUNC
     639        edgeType = sgn(srcLine[x] - srcLineBelow[x-1]) + signUpLine[x];
     640#else
    578641        edgeType = m_sign[srcLine[x] - srcLineBelow[x-1]] + signUpLine[x];
     642#endif
    579643        resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    580644
  • trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h

    r644 r713  
    5656extern UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS];
    5757#endif
     58#if SAO_SGN_FUNC
     59template <typename T> int sgn(T val)
     60{
     61  return (T(0) < val) - (val < T(0));
     62}
     63#endif
    5864
    5965class TComSampleAdaptiveOffset
     
    8894  UInt m_offsetStepLog2[NUM_SAO_COMPONENTS]; //offset step 
    8995  Int* m_offsetClip[NUM_SAO_COMPONENTS]; //clip table for fast operation
     96#if !SAO_SGN_FUNC
    9097  Short* m_sign; //sign table for fast operation
     98#endif
    9199  TComPicYuv*   m_tempPicYuv; //temporary buffer
    92100  Int m_picWidth;
     
    105113  Bool m_picSAOEnabled[NUM_SAO_COMPONENTS];
    106114  Int*   m_offsetClipTable[NUM_SAO_COMPONENTS];
     115#if !SAO_SGN_FUNC
    107116  Short* m_signTable;
     117#endif
    108118#if SVC_EXTENSION
    109119  UInt m_saoMaxOffsetQVal[NUM_SAO_COMPONENTS];
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r644 r713  
    7575, m_pcPic                         ( NULL )
    7676, m_colFromL0Flag                 ( 1 )
     77#if SETTING_NO_OUT_PIC_PRIOR
     78, m_noOutputPriorPicsFlag         ( false )
     79, m_noRaslOutputFlag              ( false )
     80, m_handleCraAsBlaFlag            ( false )
     81#endif
    7782, m_colRefIdx                     ( 0 )
    7883, m_uiTLayer                      ( 0 )
     
    111116, m_bCrossLayerBLAFlag            ( false )
    112117#endif
    113 #if NO_OUTPUT_OF_PRIOR_PICS
    114 , m_noOutputOfPriorPicsFlag       ( false )
    115 , m_noRaslOutputFlag              ( false )
    116 , m_handleCraAsBlaFlag            ( false )
    117 #endif
    118118#if POC_RESET_IDC_SIGNALLING
    119119, m_pocResetIdc                   ( 0 )
     
    536536      {
    537537        UInt refLayerIdc = m_interLayerPredLayerIdc[i];
     538        UInt refLayerId = m_pcVPS->getRefLayerId( m_layerId, refLayerIdc );
    538539#if RESAMPLING_CONSTRAINT_BUG_FIX
    539540#if O0098_SCALED_REF_LAYER_ID
    540         const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_pcVPS->getRefLayerId( m_layerId, m_interLayerPredLayerIdc[i] ));
     541        const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer(refLayerId);
    541542#else
    542543        const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]);
     
    548549                            );
    549550#endif
     551#if O0194_DIFFERENT_BITDEPTH_EL_BL
     552        Int sameBitDepth = g_bitDepthYLayer[m_layerId] - g_bitDepthYLayer[refLayerId] + g_bitDepthCLayer[m_layerId] - g_bitDepthCLayer[refLayerId];
     553
     554        if( !( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || !scalingOffset || !sameBitDepth
     555#if Q0048_CGS_3D_ASYMLUT
     556          || getPPS()->getCGSFlag()
     557#endif
     558          ) // ratio 1x
     559#else
    550560        if(!( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || (!scalingOffset)) // ratio 1x
     561#endif
    551562        {
    552563#if MOTION_RESAMPLING_CONSTRAINT
    553           UInt predType = m_pcVPS->getDirectDependencyType( m_layerId, m_pcVPS->getRefLayerId( m_layerId, refLayerIdc ) ) + 1;
     564          UInt predType = m_pcVPS->getDirectDependencyType( m_layerId, refLayerId ) + 1;
    554565
    555566          if( predType & 0x1 )
     
    596607    // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:
    597608#if SVC_EXTENSION    // inter-layer prediction is allowed for BLA, CRA pictures of nuh_layer_id>0
    598     // If the current picture is a BLA or CRA picture with nuh_layer_id equal to 0, the value of NumPocTotalCurr shall be equal to 0.
    599     // Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
     609    // - If the current picture is a BLA or CRA picture with nuh_layer_id equal to 0, the value of NumPocTotalCurr shall be equal to 0.
     610    // - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
    600611    if (getRapPicFlag() && getLayerId()==0)
    601612#else
    602     // If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
    603     // Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
     613    // - If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
     614    // - Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
    604615    if (getRapPicFlag())
    605616#endif
     
    10081019 */
    10091020#if NO_CLRAS_OUTPUT_FLAG
     1021Void TComSlice::decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag )
     1022{
     1023  if( !isIRAP() )
     1024  {
     1025    return;
     1026  }
     1027
     1028  Int pocCurr = getPOC();
     1029  TComPic* rpcPic = NULL;
     1030
     1031  // When the current picture is an IRAP picture with nuh_layer_id equal to 0 and NoClrasOutputFlag is equal to 1,
     1032  // all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked as "unused for reference".
     1033  if( m_layerId == 0 && noClrasOutputFlag )
     1034  {
     1035    // mark all pictures for all layers as not used for reference
     1036    TComList<TComPic*>::iterator iterPic = rcListPic.begin();
     1037    while( iterPic != rcListPic.end() )
     1038    {
     1039      rpcPic = *(iterPic);
     1040      if( rpcPic->getPOC() != pocCurr )
     1041      {
     1042        rpcPic->getSlice(0)->setReferenced(false);
     1043      }
     1044      iterPic++;
     1045    }
     1046  }
     1047
     1048  // When the current picture is an IRAP picture with NoRaslOutputFlag equal to 1,
     1049  // all reference pictures with nuh_layer_id equal to currPicLayerId currently in the DPB (if any) are marked as "unused for reference".
     1050  if( m_noRaslOutputFlag )
     1051  {
     1052    // mark all pictures of a current layer as not used for reference
     1053    TComList<TComPic*>::iterator iterPic = rcListPic.begin();
     1054    while( iterPic != rcListPic.end() )
     1055    {
     1056      rpcPic = *(iterPic);
     1057      if( rpcPic->getPOC() != pocCurr && rpcPic->getLayerId() == m_layerId )
     1058      {
     1059        rpcPic->getSlice(0)->setReferenced(false);
     1060      }
     1061      iterPic++;
     1062    }
     1063  }
     1064}
     1065
    10101066Void TComSlice::decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag)
    10111067#else
     
    10511107      pocCRA = pocCurr;
    10521108    }
     1109#if EFFICIENT_FIELD_IRAP
     1110    bRefreshPending = true;
     1111#endif
    10531112  }
    10541113  else // CRA or No DR
    10551114  {
     1115#if EFFICIENT_FIELD_IRAP
     1116    if(getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
     1117    {
     1118      if (bRefreshPending==true && pocCurr > m_iLastIDR) // IDR reference marking pending
     1119      {
     1120        TComList<TComPic*>::iterator        iterPic       = rcListPic.begin();
     1121        while (iterPic != rcListPic.end())
     1122        {
     1123          rpcPic = *(iterPic);
     1124          if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != m_iLastIDR)
     1125          {
     1126            rpcPic->getSlice(0)->setReferenced(false);
     1127          }
     1128          iterPic++;
     1129        }
     1130        bRefreshPending = false;
     1131      }
     1132    }
     1133    else
     1134    {
     1135#endif
    10561136    if (bRefreshPending==true && pocCurr > pocCRA) // CRA reference marking pending
    10571137    {
     
    10681148      bRefreshPending = false;
    10691149    }
     1150#if EFFICIENT_FIELD_IRAP
     1151    }
     1152#endif
    10701153    if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found
    10711154    {
     
    13231406    // in decoding order shall precede the IRAP picture in output order.
    13241407    // (Note that any picture following in output order would be present in the DPB)
     1408#if !SETTING_NO_OUT_PIC_PRIOR
    13251409    if(rpcPic->getSlice(0)->getPicOutputFlag() == 1)
     1410#else
     1411    if(rpcPic->getSlice(0)->getPicOutputFlag() == 1 && !this->getNoOutputPriorPicsFlag())
     1412#endif
    13261413    {
    13271414      if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP    ||
     
    15021589/** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet.
    15031590*/
     1591#if ALLOW_RECOVERY_POINT_AS_RAP
     1592Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess, Bool bUseRecoveryPoint)
     1593#else
    15041594Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess)
    1505 {
     1595#endif
     1596{
     1597#if ALLOW_RECOVERY_POINT_AS_RAP
     1598  Int atLeastOneUnabledByRecoveryPoint = 0;
     1599  Int atLeastOneFlushedByPreviousIDR = 0;
     1600#endif
    15061601  TComPic* rpcPic;
    15071602  Int i, isAvailable;
     
    15241619        if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()) == pReferencePictureSet->getPOC(i) && rpcPic->getSlice(0)->isReferenced())
    15251620        {
     1621#if ALLOW_RECOVERY_POINT_AS_RAP
     1622          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1623          {
     1624            isAvailable = 0;
     1625          }
     1626          else
     1627          {
    15261628          isAvailable = 1;
     1629        }
     1630#else
     1631          isAvailable = 1;
     1632#endif
    15271633        }
    15281634      }
     
    15341640        if(rpcPic->getIsLongTerm() && curPoc == refPoc && rpcPic->getSlice(0)->isReferenced())
    15351641        {
     1642#if ALLOW_RECOVERY_POINT_AS_RAP
     1643          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1644          {
     1645            isAvailable = 0;
     1646          }
     1647          else
     1648          {
    15361649          isAvailable = 1;
     1650        }
     1651#else
     1652          isAvailable = 1;
     1653#endif
    15371654        }
    15381655      }
     
    15571674        if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc)
    15581675        {
     1676#if ALLOW_RECOVERY_POINT_AS_RAP
     1677          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1678          {
     1679            isAvailable = 0;
     1680          }
     1681          else
     1682          {
    15591683          isAvailable = 1;
    15601684          rpcPic->setIsLongTerm(1);
    15611685          break;
     1686        }
     1687#else
     1688          isAvailable = 1;
     1689          rpcPic->setIsLongTerm(1);
     1690          break;
     1691#endif
    15621692        }
    15631693      }
     
    15871717        }
    15881718      }
     1719#if ALLOW_RECOVERY_POINT_AS_RAP
     1720      else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess)
     1721      {
     1722        atLeastOneUnabledByRecoveryPoint = 1;
     1723      }
     1724      else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL))
     1725      {
     1726        atLeastOneFlushedByPreviousIDR = 1;
     1727      }
     1728#endif
    15891729    }
    15901730  } 
     
    16021742      if(!rpcPic->getIsLongTerm() && rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i) && rpcPic->getSlice(0)->isReferenced())
    16031743      {
     1744#if ALLOW_RECOVERY_POINT_AS_RAP
     1745        if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1746        {
     1747          isAvailable = 0;
     1748        }
     1749        else
     1750        {
    16041751        isAvailable = 1;
     1752      }
     1753#else
     1754        isAvailable = 1;
     1755#endif
    16051756      }
    16061757    }
     
    16291780        }
    16301781      }
    1631     }
     1782#if ALLOW_RECOVERY_POINT_AS_RAP
     1783      else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess)
     1784      {
     1785        atLeastOneUnabledByRecoveryPoint = 1;
     1786      }
     1787      else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL))
     1788      {
     1789        atLeastOneFlushedByPreviousIDR = 1;
     1790      }
     1791#endif
     1792    }
     1793    }
     1794#if ALLOW_RECOVERY_POINT_AS_RAP
     1795  if(atLeastOneUnabledByRecoveryPoint || atLeastOneFlushedByPreviousIDR)
     1796  {
     1797    return -1;
    16321798  }   
     1799#endif
    16331800  if(atLeastOneLost)
    16341801  {
     
    16471814/** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set
    16481815*/
     1816#if ALLOW_RECOVERY_POINT_AS_RAP
     1817Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint)
     1818#else
    16491819Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP)
     1820#endif
    16501821{
    16511822  TComPic* rpcPic;
     
    16731844        pcRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i));
    16741845        pcRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP));
     1846#if ALLOW_RECOVERY_POINT_AS_RAP
     1847        pcRPS->setUsed(k, pcRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) );
     1848#endif
    16751849        if(pcRPS->getDeltaPOC(k) < 0)
    16761850        {
     
    16851859    }
    16861860  }
     1861#if EFFICIENT_FIELD_IRAP
     1862  Bool useNewRPS = false;
     1863  // if current picture is complimentary field associated to IRAP, add the IRAP to its RPS.
     1864  if(m_pcPic->isField())
     1865  {
     1866    TComList<TComPic*>::iterator iterPic = rcListPic.begin();
     1867    while ( iterPic != rcListPic.end())
     1868    {
     1869      rpcPic = *(iterPic++);
     1870      if(rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC()+1)
     1871      {
     1872        pcRPS->setDeltaPOC(k, 1);
     1873        pcRPS->setUsed(k, true);
     1874        nrOfPositivePictures++;
     1875        k ++;
     1876        useNewRPS = true;
     1877      }
     1878    }
     1879  }
     1880#endif
    16871881  pcRPS->setNumberOfNegativePictures(nrOfNegativePictures);
    16881882  pcRPS->setNumberOfPositivePictures(nrOfPositivePictures);
     
    16911885  // inter RPS prediction with.  Here we just use the reference used by pReferencePictureSet.
    16921886  // If pReferencePictureSet is not inter_RPS_predicted, then inter_RPS_prediction is for the current RPS also disabled.
    1693   if (!pReferencePictureSet->getInterRPSPrediction())
     1887  if (!pReferencePictureSet->getInterRPSPrediction()
     1888#if EFFICIENT_FIELD_IRAP
     1889    || useNewRPS
     1890#endif
     1891    )
    16941892  {
    16951893    pcRPS->setInterRPSPrediction(false);
     
    18882086  if( layerId == 0 )
    18892087  {
    1890     retVal = sps->getChromaFormatIdc();
     2088    if( vps->getAvcBaseLayerFlag() )
     2089    {
     2090      retVal = vps->getVpsRepFormat(layerId)->getChromaFormatVpsIdc();
     2091    }
     2092    else
     2093    {
     2094      retVal = sps->getChromaFormatIdc();
     2095    }
    18912096  }
    18922097  else
     
    20342239#endif
    20352240#if REPN_FORMAT_IN_VPS
     2241#if Q0195_REP_FORMAT_CLEANUP
     2242, m_repFormatIdxPresentFlag   (false)
     2243#else
    20362244, m_repFormatIdxPresentFlag   (true)
     2245#endif
    20372246, m_vpsNumRepFormats          (1)
    20382247#endif
     
    23062515Void TComVPS::setRefLayersFlags(Int currLayerId)
    23072516{
    2308   for (Int i = 0; i < getNumDirectRefLayers(currLayerId); i++)
     2517  for (Int i = 0; i < m_numDirectRefLayers[currLayerId]; i++)
    23092518  {
    23102519    UInt refLayerId = getRefLayerId(currLayerId, i);
    2311     setRecursiveRefLayerFlag(currLayerId, refLayerId, true);
     2520    m_recursiveRefLayerFlag[currLayerId][refLayerId] = true;
    23122521    for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++)
    23132522    {
    2314       setRecursiveRefLayerFlag(currLayerId, k, (getRecursiveRefLayerFlag(currLayerId, k) | getRecursiveRefLayerFlag(refLayerId, k)));
     2523      m_recursiveRefLayerFlag[currLayerId][k] = m_recursiveRefLayerFlag[currLayerId][k] | m_recursiveRefLayerFlag[refLayerId][k];
    23152524    }
    23162525  }
     
    23192528Void TComVPS::setNumRefLayers(Int currLayerId)
    23202529{
    2321   for (Int i = 0; i <= getMaxLayers(); i++)
    2322   {
    2323     UInt iNuhLId = getLayerIdInNuh(i);
     2530  for (Int i = 0; i < m_uiMaxLayers; i++)
     2531  {
     2532    UInt iNuhLId = m_layerIdInNuh[i];
    23242533    setRefLayersFlags(iNuhLId);
    23252534    for (UInt j = 0; j < MAX_NUM_LAYER_IDS; j++)
    23262535    {
    2327       m_numberRefLayers[iNuhLId] += (getRecursiveRefLayerFlag(iNuhLId, j) == true ? 1 : 0);
     2536      m_numberRefLayers[iNuhLId] += (m_recursiveRefLayerFlag[iNuhLId][j] == true ? 1 : 0);
    23282537    }
    23292538  }
     
    35263735
    35273736    TComPic* pcRefPicBL = pcRefPicRL[refLayerIdc];
     3737
    35283738    //set reference picture POC of each ILP reference
    35293739    Int thePoc = ilpPic[refLayerIdc]->getPOC();
     
    35323742    ilpPic[refLayerIdc]->getSlice(0)->setBaseColPic( refLayerIdc, pcRefPicBL );
    35333743
    3534     //copy reference pictures marking from the reference layer
    3535     ilpPic[refLayerIdc]->getSlice(0)->copySliceInfo(pcRefPicBL->getSlice(0));
     3744    //copy layer id from the reference layer   
     3745    ilpPic[refLayerIdc]->setLayerId( pcRefPicBL->getLayerId() );
     3746
     3747    //copy slice type from the reference layer
     3748    ilpPic[refLayerIdc]->getSlice(0)->setSliceType( pcRefPicBL->getSlice(0)->getSliceType() );
     3749
     3750    //copy "used for reference"
     3751    ilpPic[refLayerIdc]->getSlice(0)->setReferenced( pcRefPicBL->getSlice(0)->isReferenced() );
    35363752
    35373753    for( Int refList = 0; refList < 2; refList++ )
     
    35553771        ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(0, refPicList, refIdx);
    35563772        ilpPic[refLayerIdc]->getSlice(0)->setRefPic(NULL, refPicList, refIdx);
     3773      }
     3774
     3775      //copy reference pictures' marking from the reference layer
     3776      for(Int j = 0; j < MAX_NUM_REF + 1; j++)
     3777      {
     3778        ilpPic[refLayerIdc]->getSlice(0)->setIsUsedAsLongTerm(refList, j, pcRefPicBL->getSlice(0)->getIsUsedAsLongTerm(refList, j));
    35573779      }
    35583780    }
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r644 r713  
    231231{
    232232  ProfileTierLevel m_generalPTL;
    233   ProfileTierLevel m_subLayerPTL    [MAX_TLAYER-1];      // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 ( = 6 )
     233  ProfileTierLevel m_subLayerPTL    [MAX_TLAYER-1];      // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 (= 6)
    234234  Bool m_subLayerProfilePresentFlag [MAX_TLAYER-1];
    235235  Bool m_subLayerLevelPresentFlag   [MAX_TLAYER-1];
     
    581581#if VPS_TSLAYERS
    582582  Bool       m_maxTSLayersPresentFlag;
    583   UInt       m_maxTSLayerMinus1[MAX_VPS_LAYER_ID_PLUS1 - 1];
     583  UInt       m_maxTSLayerMinus1[MAX_LAYERS];
    584584#endif
    585585#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     
    684684  Bool       m_vpsVuiPresentFlag;
    685685#endif
     686  Bool       m_vpsExtensionFlag;
    686687
    687688#if O0164_MULTI_LAYER_HRD
     
    11311132
    11321133#if O0109_MOVE_VPS_VUI_FLAG
    1133   Bool   getVpsVuiPresentFlag()                                 { return m_vpsVuiPresentFlag; }
    1134   Void   setVpsVuiPresentFlag(Bool x)                           { m_vpsVuiPresentFlag = x; }
    1135 #endif
     1134  Bool   getVpsVuiPresentFlag()                        { return m_vpsVuiPresentFlag; }
     1135  Void   setVpsVuiPresentFlag(Bool x)                  { m_vpsVuiPresentFlag = x;    }
     1136#endif
     1137  Bool   getVpsExtensionFlag()                         { return m_vpsExtensionFlag;  }
     1138  Void   setVpsExtensionFlag(Bool x)                   { m_vpsExtensionFlag = x;     }
    11361139
    11371140#if !P0307_REMOVE_VPS_VUI_OFFSET
     
    17411744  Bool     m_pocResetInfoPresentFlag;
    17421745#endif
     1746#if Q0048_CGS_3D_ASYMLUT
     1747  Int      m_nCGSFlag;
     1748  Int      m_nCGSOutputBitDepthY; // not for syntax
     1749  Int      m_nCGSOutputBitDepthC; // not for syntax
     1750#endif
    17431751#endif
    17441752
     
    18811889  Bool getPocResetInfoPresentFlag   ()                    { return m_pocResetInfoPresentFlag; }
    18821890  Void setPocResetInfoPresentFlag   (const Bool val)      { m_pocResetInfoPresentFlag = val; }
     1891#endif
     1892#if Q0048_CGS_3D_ASYMLUT
     1893  Int     getCGSFlag()                { return m_nCGSFlag;  }
     1894  Void    setCGSFlag(Int n)           { m_nCGSFlag = n;     }
     1895  Int     getCGSOutputBitDepthY()     { return m_nCGSOutputBitDepthY;  }
     1896  Void    setCGSOutputBitDepthY(Int n){ m_nCGSOutputBitDepthY = n;     }
     1897  Int     getCGSOutputBitDepthC()     { return m_nCGSOutputBitDepthC;  }
     1898  Void    setCGSOutputBitDepthC(Int n){ m_nCGSOutputBitDepthC = n;     }
    18831899#endif
    18841900};
     
    19631979  UInt        m_colFromL0Flag;  // collocated picture from List0 flag
    19641980 
     1981#if SETTING_NO_OUT_PIC_PRIOR
     1982  Bool        m_noOutputPriorPicsFlag;
     1983  Bool        m_noRaslOutputFlag;
     1984  Bool        m_handleCraAsBlaFlag;
     1985#endif
     1986 
    19651987  UInt        m_colRefIdx;
    19661988  UInt        m_maxNumMergeCand;
     
    20302052  Bool        m_bCrossLayerBLAFlag;
    20312053#endif
    2032 #if NO_OUTPUT_OF_PRIOR_PICS
    2033   Bool        m_noOutputOfPriorPicsFlag;
    2034   Bool        m_noRaslOutputFlag;
    2035   Bool        m_handleCraAsBlaFlag;
    2036 #endif
    20372054#if POC_RESET_IDC_SIGNALLING
    20382055  Int         m_pocResetIdc;
     
    20432060  Bool        m_pocMsbValRequiredFlag;
    20442061  Bool        m_pocMsbValPresentFlag;
     2062#endif
     2063#if Q0048_CGS_3D_ASYMLUT
     2064  Int        m_nCGSOverWritePPS;  // for optimization, not output to bitstream
    20452065#endif
    20462066#endif //SVC_EXTENSION
     
    21302150  NalUnitType getNalUnitType    () const                        { return m_eNalUnitType;        }
    21312151  Bool      getRapPicFlag       (); 
    2132 #if NO_OUTPUT_OF_PRIOR_PICS
    2133   Bool      getBlaPicFlag       ();
    2134   Bool      getCraPicFlag       ();
    2135 #endif
    21362152  Bool      getIdrPicFlag       ()                              { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
    21372153  Bool      isIRAP              () const                        { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 
    21382154  Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic);
    21392155#if NO_CLRAS_OUTPUT_FLAG
     2156  Void      decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag );
    21402157  Void      decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag);
    21412158#else
     
    21632180#if SVC_EXTENSION
    21642181  Void      setRefPicList       ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL );
     2182#if Q0048_CGS_3D_ASYMLUT
     2183  Int       getCGSOverWritePPS()              { return m_nCGSOverWritePPS;    }
     2184  Void      setCGSOverWritePPS(Int n)         { m_nCGSOverWritePPS = n;       }
     2185#endif
    21652186#else
    21662187  Void      setRefPicList       ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false );
     
    22032224  Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );
    22042225  Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic );
    2205   Int       checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0);
    2206   Void      createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP);
     2226#if ALLOW_RECOVERY_POINT_AS_RAP
     2227  Int  checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);
     2228  Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);
     2229#else
     2230  Int  checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0);
     2231  Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP);
     2232#endif
    22072233
    22082234  Void setMaxNumMergeCand               (UInt val )         { m_maxNumMergeCand = val;                    }
    22092235  UInt getMaxNumMergeCand               ()                  { return m_maxNumMergeCand;                   }
     2236
     2237#if SETTING_NO_OUT_PIC_PRIOR
     2238  Void setNoOutputPriorPicsFlag         ( Bool val )        { m_noOutputPriorPicsFlag = val;                    }
     2239  Bool getNoOutputPriorPicsFlag         ()                  { return m_noOutputPriorPicsFlag;                   }
     2240
     2241  Void setNoRaslOutputFlag              ( Bool val )        { m_noRaslOutputFlag = val;                    }
     2242  Bool getNoRaslOutputFlag              ()                  { return m_noRaslOutputFlag;                   }
     2243
     2244  Void setHandleCraAsBlaFlag            ( Bool val )        { m_handleCraAsBlaFlag = val;                    }
     2245  Bool getHandleCraAsBlaFlag            ()                  { return m_handleCraAsBlaFlag;                   }
     2246#endif
    22102247
    22112248  Void setSliceMode                     ( UInt uiMode )     { m_sliceMode = uiMode;                     }
     
    23602397
    23612398  Void setILRPic(TComPic **pcIlpPic);
    2362 #if NO_OUTPUT_OF_PRIOR_PICS
    2363   Void setNoOutputOfPriorPicsFlag(const Bool x)   { m_noOutputOfPriorPicsFlag = x;    }
    2364   Bool getNoOutputOfPriorPicsFlag()               { return m_noOutputOfPriorPicsFlag; }
    2365 
    2366   Void setNoRaslOutputFlag    ( const Bool val )   { m_noRaslOutputFlag = val;  }
    2367   Bool getNoRaslOutputFlag    ()                   { return m_noRaslOutputFlag; }
    2368 
    2369   Void setHandleCraAsBlaFlag  ( const Bool val )   { m_handleCraAsBlaFlag = val;  }
    2370   Bool getHandleCraAsBlaFlag  ()                   { return m_handleCraAsBlaFlag; }
    2371 
    2372 #endif
    23732399#if POC_RESET_IDC_SIGNALLING
    23742400  Int       getPocResetIdc       ()                              { return m_pocResetIdc;       }
     
    23882414#endif
    23892415
     2416#if NO_OUTPUT_OF_PRIOR_PICS
     2417  Bool      getBlaPicFlag       ();
     2418  Bool      getCraPicFlag       ();
     2419#endif
     2420
    23902421#endif //SVC_EXTENSION
    23912422protected:
  • trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r644 r713  
    9999#if O0215_PHASE_ALIGNMENT
    100100#if O0194_JOINT_US_BITSHIFT
    101 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )
    102 #else
    103 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )
     101Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag )
     102#else
     103Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag )
    104104#endif
    105105#else
     
    116116  Int i, j;
    117117
     118#if O0194_JOINT_US_BITSHIFT
     119  UInt currLayerId = currSlice->getLayerId();
     120  UInt refLayerId  = currSlice->getVPS()->getRefLayerId( currLayerId, refLayerIdc );
     121#endif
     122
     123#if O0098_SCALED_REF_LAYER_ID
     124  const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId);
     125#else
     126  const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
     127#endif
     128
    118129  //========== Y component upsampling ===========
    119   const Window &scalEL = window;
    120 
    121130  Int widthBL   = pcBasePic->getWidth ();
    122131  Int heightBL  = pcBasePic->getHeight();
     
    127136  Int strideEL  = pcUsPic->getStride();
    128137
     138#if Q0200_CONFORMANCE_BL_SIZE
     139  Int chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
     140  const Window &confBL = currSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();
     141  Int xScal = TComSPS::getWinUnitX( chromaFormatIdc );
     142  Int yScal = TComSPS::getWinUnitY( chromaFormatIdc );
     143#endif
    129144#if P0312_VERT_PHASE_ADJ
    130145  Bool vertPhasePositionEnableFlag = scalEL.getVertPhasePositionEnableFlag();
     
    159174  Int scaleY = g_posScalingFactor[refLayerIdc][1];
    160175
    161 #if O0194_JOINT_US_BITSHIFT
    162   UInt currLayerId = currSlice->getLayerId();
    163   UInt refLayerId  = currSlice->getVPS()->getRefLayerId( currLayerId, refLayerIdc );
    164 #endif
    165 
    166176  // non-normative software optimization for certain simple resampling cases
    167177  if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x
     
    172182#if O0194_JOINT_US_BITSHIFT
    173183    Int shift = g_bitDepthYLayer[currLayerId] - g_bitDepthYLayer[refLayerId];
     184#if Q0048_CGS_3D_ASYMLUT
     185    if( currSlice->getPPS()->getCGSFlag() )
     186    {
     187      shift = g_bitDepthYLayer[currLayerId] - currSlice->getPPS()->getCGSOutputBitDepthY();
     188    }
     189    assert( shift >= 0 );
     190#endif
    174191#endif
    175192
     
    205222#if O0194_JOINT_US_BITSHIFT
    206223    shift = g_bitDepthCLayer[currLayerId] - g_bitDepthCLayer[refLayerId];
     224#if Q0048_CGS_3D_ASYMLUT
     225    if( currSlice->getPPS()->getCGSFlag() )
     226    {
     227      shift = g_bitDepthCLayer[currLayerId] - currSlice->getPPS()->getCGSOutputBitDepthC();
     228    }
     229#endif
    207230#endif
    208231
     
    254277    Int   phaseX = 2*phaseAlignFlag;
    255278#if P0312_VERT_PHASE_ADJ
     279#if Q0120_PHASE_CALCULATION
     280    Int   phaseY = 2*phaseAlignFlag;
     281#else
    256282    Int   phaseY = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( 2 * phaseAlignFlag );
     283#endif
    257284#else
    258285    Int   phaseY = 2*phaseAlignFlag;
     
    261288    Int   phaseX = 0;
    262289#if P0312_VERT_PHASE_ADJ
     290#if Q0120_PHASE_CALCULATION
     291    Int   phaseY = 0;
     292#else
    263293    Int   phaseY = (vertPhasePositionEnableFlag?(vertPhasePositionFlag *4):(0));
     294#endif
    264295#else
    265296    Int   phaseY = 0;
    266297#endif
    267298#endif
    268 
     299 
    269300#if ROUNDING_OFFSET
    270301    Int   addX = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
    271302    Int   addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
    272303#else
    273     Int   addX       = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
    274     Int   addY       = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
    275 #endif
    276 
    277     Int   deltaX     = 4 * phaseX;
    278     Int   deltaY     = 4 * phaseY;
     304    Int   addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
     305    Int   addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
     306#endif
     307
     308#if Q0120_PHASE_CALCULATION
     309    Int   deltaX = (Int)phaseAlignFlag <<3;
     310    Int   deltaY = (((Int)phaseAlignFlag <<3)>>(Int)vertPhasePositionEnableFlag) + ((Int)vertPhasePositionFlag<<3);
     311#else
     312    Int   deltaX = 4 * phaseX;
     313    Int   deltaY = 4 * phaseY;
     314#endif
     315
     316#if Q0200_CONFORMANCE_BL_SIZE
     317    deltaX -= ( confBL.getWindowLeftOffset() * xScal ) << 4;
     318    deltaY -= ( confBL.getWindowTopOffset() * yScal ) << 4;
     319#endif
    279320
    280321    Int shiftXM4 = shiftX - 4;
    281322    Int shiftYM4 = shiftY - 4;
    282323
    283     widthEL   = pcUsPic->getWidth ();
    284     heightEL  = pcUsPic->getHeight();
    285 
    286     widthBL   = pcBasePic->getWidth ();
    287     heightBL  = min<Int>( pcBasePic->getHeight(), heightEL );
     324    widthEL  = pcUsPic->getWidth ();
     325    heightEL = pcUsPic->getHeight();
     326
     327    widthBL  = pcBasePic->getWidth ();
     328    heightBL = min<Int>( pcBasePic->getHeight(), heightEL );
    288329
    289330    Int leftStartL = scalEL.getWindowLeftOffset();
     
    292333    Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset();
    293334    Int leftOffset = leftStartL > 0 ? leftStartL : 0;
    294 
    295335#if N0214_INTERMEDIATE_BUFFER_16BITS
    296336#if O0194_JOINT_US_BITSHIFT
    297337    // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth
    298338    Int shift1 = g_bitDepthYLayer[refLayerId] - 8;
     339#if Q0048_CGS_3D_ASYMLUT
     340    if( currSlice->getPPS()->getCGSFlag() )
     341    {
     342      shift1 = currSlice->getPPS()->getCGSOutputBitDepthY() - 8;
     343    }
     344#endif
    299345#else
    300346    Int shift1 = g_bitDepthY - 8;
     
    380426    widthBL   = pcBasePic->getWidth ();
    381427    heightBL  = pcBasePic->getHeight();
    382 
    383428    widthEL   = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
    384429    heightEL  = pcUsPic->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
     
    400445    Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1);
    401446    leftOffset = leftStartC > 0 ? leftStartC : 0;
    402 
    403447    shiftX = 16;
    404448    shiftY = 16;
     
    407451    Int phaseXC = phaseAlignFlag;
    408452#if P0312_VERT_PHASE_ADJ
     453#if Q0120_PHASE_CALCULATION
     454    Int phaseYC = phaseAlignFlag + 1;
     455#else
    409456    Int phaseYC = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( phaseAlignFlag + 1 );
     457#endif
    410458#else
    411459    Int phaseYC = phaseAlignFlag + 1;
     
    414462    Int phaseXC = 0;
    415463#if P0312_VERT_PHASE_ADJ
     464#if Q0120_PHASE_CALCULATION
     465    Int phaseYC = 1;
     466#else
    416467    Int phaseYC = vertPhasePositionEnableFlag ? (vertPhasePositionFlag * 4): 1;
     468#endif
    417469#else
    418470    Int phaseYC = 1;
     
    428480#endif
    429481
     482#if Q0120_PHASE_CALCULATION
     483    deltaX     = (Int)phaseAlignFlag << 2;
     484    deltaY     = ((( (Int)phaseAlignFlag +1)<<2)>>(Int)vertPhasePositionEnableFlag)+((Int)vertPhasePositionFlag<<3);
     485#else
    430486    deltaX     = 4 * phaseXC;
    431487    deltaY     = 4 * phaseYC;
     488#endif
     489
     490#if Q0200_CONFORMANCE_BL_SIZE
     491    deltaX -= ( ( confBL.getWindowLeftOffset() * xScal ) >> 1 ) << 4;
     492    deltaY  -= ( ( confBL.getWindowTopOffset() * yScal ) >> 1 ) << 4;
     493#endif
    432494
    433495    shiftXM4 = shiftX - 4;
     
    444506    // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth
    445507    shift1 = g_bitDepthCLayer[refLayerId] - 8;
     508#if Q0048_CGS_3D_ASYMLUT
     509    if( currSlice->getPPS()->getCGSFlag() )
     510    {
     511      shift1 = currSlice->getPPS()->getCGSOutputBitDepthC() - 8;
     512    }
     513#endif
    446514#else
    447515    shift1 = g_bitDepthC - 8;
  • trunk/source/Lib/TLibCommon/TComUpsampleFilter.h

    r644 r713  
    4545#if O0215_PHASE_ALIGNMENT
    4646#if O0194_JOINT_US_BITSHIFT
    47   Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );
     47  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag );
    4848#else
    4949  Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r644 r713  
    4242
    4343#define SYNTAX_BYTES                     10      ///< number of bytes taken by syntaxes per 4x4 block [RefIdxL0(1byte), RefIdxL1(1byte), MVxL0(2bytes), MVyL0(2bytes), MVxL1(2bytes), MVyL1(2bytes)]
    44 
    4544#if SVC_EXTENSION
    4645#define MAX_LAYERS                       8      ///< max number of layers the codec is supposed to handle
     
    5049#define O0137_MAX_LAYERID                1      ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1
    5150
     51#define Q0200_CONFORMANCE_BL_SIZE        1       ///< JCTVC-Q0200; use conformance picture size in re-sampling processs
    5252#define P0312_VERT_PHASE_ADJ             1      ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report)
     53#if P0312_VERT_PHASE_ADJ
     54#define Q0120_PHASE_CALCULATION          1      ///< JCTVC-Q0120 phase offset derivation for combination of spatial scalibility and field coding.
     55#endif
    5356#define P0130_EOB                        1      ///< JCTVC-P0130, set layer Id of EOB NALU to be fixed to 0
    5457#define P0307_REMOVE_VPS_VUI_OFFSET      1      ///< JCTVC-P0307, remove implementation related to VPS VUI offset signalling
     
    8184
    8285#define O0164_MULTI_LAYER_HRD            1      ///< JCTVC-O0164: Multi-layer HRD operation
     86#define Q0074_SEI_COLOR_MAPPING          1      ///< JCTVC-Q0074, SEI Color Mapping
    8387
    8488#define O0194_DIFFERENT_BITDEPTH_EL_BL   1      ///< JCTVC-O0194: Support for different bitdepth values for BL and EL, add required configuration parameters (and Some bugfixes when REPN_FORMAT_IN_VPS (JCTVC-N0092) is enabled)
     
    8690#define O0194_JOINT_US_BITSHIFT          1      ///< JCTVC-O0194: Joint Upsampling and bit-shift
    8791#endif
     92#define Q0048_CGS_3D_ASYMLUT             1      ///< JCTVC-Q0048: Colour gamut scalability with look-up table
     93#if Q0048_CGS_3D_ASYMLUT
     94#define O0194_WEIGHTED_PREDICTION_CGS    0
     95#else
    8896#define O0194_WEIGHTED_PREDICTION_CGS    1      ///< JCTVC-O0194: Weighted prediciton for color gamut scalability
     97#endif
    8998#define MFM_ENCCONSTRAINT                1      ///< JCTVC-O0216: Encoder constraint for motion field mapping
    9099#define VPS_NUH_LAYER_ID                 1      ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0
     
    185194#define TSLAYERS_IL_RPS                  1      ///< JCTVC-O0120 IL RPS based on max temporal sub-layers
    186195#define P0079_DERIVE_NUMACTIVE_REF_PICS  1      ///< JCTVC-P0079 Modification of derivation of variable NumActiveRefLayerPics
     196#define Q0060_MAX_TID_REF_EQUAL_TO_ZERO  1      ///< JCTVC-Q0060 handling the case max_tid_il_ref_pics_plus1 is equal to 0.
    187197#if REF_IDX_MFM
    188198#define N0139_POSITION_ROUNDING_OFFSET   1      ///< JCTVC-N0139: offset for collocated block in motion mapping
     
    226236#define O0096_DEFAULT_DEPENDENCY_TYPE    1      ///< JCTVC-O0096: specify default dependency type for all direct reference layers
    227237
     238#define Q0195_REP_FORMAT_CLEANUP         1      ///< JCTVC-Q0195: restructureing of rep_format() signaling
     239#define REP_FORMAT_FIX                   1      ///< update_rep_format_flag should be inferred to be equal to 0
     240
    228241#define RESAMPLING_CONSTRAINT_BUG_FIX    1
    229242#define O0098_SCALED_REF_LAYER_ID        1      ///< JCTVC-O0098: signal scaled reference id
     
    231244#define O0153_ALT_OUTPUT_LAYER_FLAG      1      ///< JCTVC-O0153: alt output layer flag
    232245#define P0300_ALT_OUTPUT_LAYER_FLAG      1      ///< JCTVC-P0300: alt output layer flag
     246
     247#define Q0165_OUTPUT_LAYER_SET           1      ///< JCTVC-Q0165: add a constraint to disallow an empty output layer set
     248#define Q0165_NUM_ADD_OUTPUT_LAYER_SETS  1      ///< JCTVC-Q0165: signal num_add_output_layer_set and default_target_output_layer_idc when vps_num_layer_sets_minus1 is greater than 0
    233249
    234250#define VPS_DPB_SIZE_TABLE               1      ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters
     
    264280//! \ingroup TLibCommon
    265281//! \{
     282#define HARMONIZE_GOP_FIRST_FIELD_COUPLE  1
     283#define FIX_FIELD_DEPTH                 1
     284#define EFFICIENT_FIELD_IRAP            1
     285#define ALLOW_RECOVERY_POINT_AS_RAP     1
    266286#define BUGFIX_INTRAPERIOD 1
    267287#define SAO_ENCODE_ALLOW_USE_PREDEBLOCK 1
    268288
     289#define SAO_SGN_FUNC 1
     290
    269291#define FIX1172 1 ///< fix ticket #1172
     292
     293#define SETTING_PIC_OUTPUT_MARK     1
     294#define SETTING_NO_OUT_PIC_PRIOR    1
     295#define FIX_EMPTY_PAYLOAD_NAL       1
     296#define FIX_WRITING_OUTPUT          1
     297#define FIX_OUTPUT_EOS              1
     298
     299#define FIX_POC_CRA_NORASL_OUTPUT   1
    270300
    271301#define MAX_NUM_PICS_IN_SOP           1024
Note: See TracChangeset for help on using the changeset viewer.