Changeset 652 in SHVCSoftware for branches/SHM-6-dev


Ignore:
Timestamp:
7 Apr 2014, 23:08:52 (11 years ago)
Author:
seregin
Message:

update to HM-14.0

Location:
branches/SHM-6-dev/source
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-6-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r644 r652  
    257257      Bool outputPicturesFlag = true; 
    258258#if NO_OUTPUT_OF_PRIOR_PICS
    259       if( m_acTDecTop[nalu.m_layerId].getNoOutputOfPriorPicsFlags() )
     259      if( m_acTDecTop[nalu.m_layerId].getNoOutputPriorPicsFlag() )
    260260      {
    261261        outputPicturesFlag = false;
     
    449449      loopFiltered = (nalu.m_nalUnitType == NAL_UNIT_EOS);
    450450    }
     451#if !FIX_WRITING_OUTPUT
     452#if SETTING_NO_OUT_PIC_PRIOR
     453    if (bNewPicture && m_cTDecTop.getNoOutputPriorPicsFlag())
     454    {
     455      m_cTDecTop.checkNoOutputPriorPics( pcListPic );
     456    }
     457#endif
     458#endif
    451459
    452460    if( pcListPic )
     
    460468        openedReconFile = true;
    461469      }
     470#if FIX_WRITING_OUTPUT
     471      // write reconstruction to file
     472      if( bNewPicture )
     473      {
     474        xWriteOutput( pcListPic, nalu.m_temporalId );
     475      }
     476#if SETTING_NO_OUT_PIC_PRIOR
     477      if ( (bNewPicture || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA) && m_cTDecTop.getNoOutputPriorPicsFlag() )
     478      {
     479        m_cTDecTop.checkNoOutputPriorPics( pcListPic );
     480        m_cTDecTop.setNoOutputPriorPicsFlag (false);
     481      }
     482#endif
     483#endif
    462484      if ( bNewPicture &&
    463485           (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     
    471493      if (nalu.m_nalUnitType == NAL_UNIT_EOS)
    472494      {
     495#if FIX_OUTPUT_EOS
     496        xWriteOutput( pcListPic, nalu.m_temporalId );
     497#else
    473498        xFlushOutput( pcListPic );       
    474       }
    475       // write reconstruction to file
     499#endif
     500      }
     501      // write reconstruction to file -- for additional bumping as defined in C.5.2.3
     502#if FIX_WRITING_OUTPUT
     503      if(!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL_N && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL31)
     504#else
    476505      if(bNewPicture)
     506#endif
    477507      {
    478508        xWriteOutput( pcListPic, nalu.m_temporalId );
     
    586616  TComList<TComPic*>::iterator iterPic   = pcListPic->begin();
    587617  Int numPicsNotYetDisplayed = 0;
     618  Int dpbFullness = 0;
     619#if SVC_EXTENSION
     620TComSPS* activeSPS = m_acTDecTop[layerId].getActiveSPS();
     621#else
     622  TComSPS* activeSPS = m_cTDecTop.getActiveSPS();
     623#endif
     624  UInt numReorderPicsHighestTid;
     625  UInt maxDecPicBufferingHighestTid;
     626  UInt maxNrSublayers = activeSPS->getMaxTLayers();
     627
     628  if(m_iMaxTemporalLayer == -1 || m_iMaxTemporalLayer >= maxNrSublayers)
     629  {
     630    numReorderPicsHighestTid = activeSPS->getNumReorderPics(maxNrSublayers-1);
     631    maxDecPicBufferingHighestTid =  activeSPS->getMaxDecPicBuffering(maxNrSublayers-1);
     632  }
     633  else
     634  {
     635    numReorderPicsHighestTid = activeSPS->getNumReorderPics(m_iMaxTemporalLayer);
     636    maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering(m_iMaxTemporalLayer);
     637  }
    588638
    589639  while (iterPic != pcListPic->end())
     
    597647    {
    598648      numPicsNotYetDisplayed++;
     649      dpbFullness++;
     650    }
     651    else if(pcPic->getSlice( 0 )->isReferenced())
     652    {
     653      dpbFullness++;
    599654    }
    600655    iterPic++;
     
    619674
    620675#if SVC_EXTENSION
    621       if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed >  pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1)
    622         && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed >  pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_aiPOCLastDisplay[layerId]+1 || m_aiPOCLastDisplay[layerId]<0)))
    623 #else
    624       if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed >  pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1)
    625         && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed >  pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay<0)))
     676      if( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() &&
     677        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) &&
     678        (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) &&       
     679        (pcPicTop->getPOC() == m_aiPOCLastDisplay[layerId]+1 || m_aiPOCLastDisplay[layerId]<0) )
     680#else
     681      if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() &&
     682          (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) &&
     683          (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) &&
     684          (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay < 0))
    626685#endif
    627686      {
     
    720779
    721780#if SVC_EXTENSION
    722       if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed >  pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_aiPOCLastDisplay[layerId]))
    723 #else
    724       if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed >  pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay))
     781      if( pcPic->getOutputMark() && pcPic->getPOC() > m_aiPOCLastDisplay[layerId] &&
     782        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) )
     783#else
     784      if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay &&
     785        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
    725786#endif
    726787      {
    727788        // write to file
    728789        numPicsNotYetDisplayed--;
    729 #if SVC_EXTENSION
    730         if ( m_pchReconFile[layerId] )
     790        if(pcPic->getSlice(0)->isReferenced() == false)
     791        {
     792          dpbFullness--;
     793        }
     794#if SVC_EXTENSION
     795        if( m_pchReconFile[layerId] )
    731796        {
    732797          const Window &conf = pcPic->getConformanceWindow();
  • branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r649 r652  
    710710  ("IntraPeriod,-ip",         m_iIntraPeriod,              -1, "Intra period in frames, (-1: only first frame)")
    711711#endif
     712#if ALLOW_RECOVERY_POINT_AS_RAP
     713  ("DecodingRefreshType,-dr", m_iDecodingRefreshType,       0, "Intra refresh type (0:none 1:CRA 2:IDR 3:RecPointSEI)")
     714#else
    712715  ("DecodingRefreshType,-dr", m_iDecodingRefreshType,       0, "Intra refresh type (0:none 1:CRA 2:IDR)")
     716#endif
    713717  ("GOPSize,g",               m_iGOPSize,                   1, "GOP size of temporal structure")
    714718  // motion options
     
    905909  ("SEIToneMapCameraIsoSpeedIdc",                     m_cameraIsoSpeedIdc,                        0, "Indicates the camera ISO speed for daylight illumination")
    906910  ("SEIToneMapCameraIsoSpeedValue",                   m_cameraIsoSpeedValue,                    400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO")
     911  ("SEIToneMapExposureIndexIdc",                      m_exposureIndexIdc,                         0, "Indicates the exposure index setting of the camera")
     912  ("SEIToneMapExposureIndexValue",                    m_exposureIndexValue,                     400, "Specifies the exposure index setting of the cameran of Extended_ISO")
    907913  ("SEIToneMapExposureCompensationValueSignFlag",     m_exposureCompensationValueSignFlag,        0, "Specifies the sign of ExposureCompensationValue")
    908914  ("SEIToneMapExposureCompensationValueNumerator",    m_exposureCompensationValueNumerator,       0, "Specifies the numerator of ExposureCompensationValue")
     
    15871593  xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" );
    15881594#endif
     1595#if ALLOW_RECOVERY_POINT_AS_RAP
     1596  xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 3,                   "Decoding Refresh Type must be comprised between 0 and 3 included" );
     1597  if(m_iDecodingRefreshType == 3)
     1598  {
     1599    xConfirmPara( !m_recoveryPointSEIEnabled,                                               "When using RecoveryPointSEI messages as RA points, recoveryPointSEI must be enabled" );
     1600  }
     1601#else
    15891602  xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 2,                   "Decoding Refresh Type must be equal to 0, 1 or 2" );
     1603#endif
    15901604#if !SVC_EXTENSION
    15911605  xConfirmPara( m_iQP <  -6 * (m_internalBitDepthY - 8) || m_iQP > 51,                    "QP exceeds supported range (-QpBDOffsety to 51)" );
     
    21602174    xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4");
    21612175    xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0");
     2176    xConfirmPara( m_exposureIndexValue  == 0, "SEIToneMapExposureIndexValue shall not be equal to 0");
    21622177    xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100");
    21632178    xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue");
  • branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.h

    r644 r652  
    255255  Int       m_cameraIsoSpeedIdc;
    256256  Int       m_cameraIsoSpeedValue;
     257  Int       m_exposureIndexIdc;
     258  Int       m_exposureIndexValue;
    257259  Int       m_exposureCompensationValueSignFlag;
    258260  Int       m_exposureCompensationValueNumerator;
  • branches/SHM-6-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r649 r652  
    767767  m_cTEncTop.setTMISEICameraIsoSpeedIdc                   ( m_cameraIsoSpeedIdc );
    768768  m_cTEncTop.setTMISEICameraIsoSpeedValue                 ( m_cameraIsoSpeedValue );
     769  m_cTEncTop.setTMISEIExposureIndexIdc                    ( m_exposureIndexIdc );
     770  m_cTEncTop.setTMISEIExposureIndexValue                  ( m_exposureIndexValue );
    769771  m_cTEncTop.setTMISEIExposureCompensationValueSignFlag   ( m_exposureCompensationValueSignFlag );
    770772  m_cTEncTop.setTMISEIExposureCompensationValueNumerator  ( m_exposureCompensationValueNumerator );
  • branches/SHM-6-dev/source/Lib/TLibCommon/CommonDef.h

    r644 r652  
    6060#define NV_VERSION        "5.1 (HM-13.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
  • branches/SHM-6-dev/source/Lib/TLibCommon/SEI.h

    r644 r652  
    142142  SEIActiveParameterSets()
    143143    : activeVPSId            (0)
    144     , m_fullRandomAccessFlag (false)
    145     , m_noParamSetUpdateFlag (false)
     144    , m_selfContainedCvsFlag (false)
     145    , m_noParameterSetUpdateFlag (false)
    146146    , numSpsIdsMinus1        (0)
    147147  {}
     
    149149
    150150  Int activeVPSId;
    151   Bool m_fullRandomAccessFlag;
    152   Bool m_noParamSetUpdateFlag;
     151  Bool m_selfContainedCvsFlag;
     152  Bool m_noParameterSetUpdateFlag;
    153153  Int numSpsIdsMinus1;
    154   std::vector<Int> activeSeqParamSetId;
     154  std::vector<Int> activeSeqParameterSetId;
    155155};
    156156
     
    393393  Int    m_cameraIsoSpeedIdc;
    394394  Int    m_cameraIsoSpeedValue;
     395  Int    m_exposureIndexIdc;
     396  Int    m_exposureIndexValue;
    395397  Int    m_exposureCompensationValueSignFlag;
    396398  Int    m_exposureCompensationValueNumerator;
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r595 r652  
    16901690}
    16911691
    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 
    17561692UInt TComDataCU::getCtxSplitFlag( UInt uiAbsPartIdx, UInt uiDepth )
    17571693{
     
    18091745  return log2MinTUSizeInCU;
    18101746}
    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
    18741747
    18751748UInt TComDataCU::getCtxSkipFlag( UInt uiAbsPartIdx )
     
    21682041}
    21692042
    2170 UChar TComDataCU::getNumPartInter()
     2043UChar TComDataCU::getNumPartitions()
    21712044{
    21722045  UChar iNumPart = 0;
     
    36803553  rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() );
    36813554}
     3555
     3556#if FAST_INTRA_SHVC
     3557/** generate limited set of remaining modes
     3558*\param   uiAbsPartIdx
     3559*\param   uiIntraDirPred  pointer to the array for MPM storage
     3560*\returns Number of intra coding modes (nb of remaining modes + 3 MPMs)
     3561*/
     3562Int TComDataCU::reduceSetOfIntraModes( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes )
     3563{
     3564  // check BL mode
     3565  UInt          uiCUAddrBase = 0, uiAbsPartAddrBase = 0;
     3566  // the right reference layerIdc should be specified, currently it is set to m_layerId-1
     3567  TComDataCU*   pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase, 0 );
     3568
     3569  if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA )
     3570  {
     3571    return( NUM_INTRA_MODE-1 );
     3572  }
     3573
     3574  // compute set of enabled modes g_reducedSetIntraModes[...]
     3575  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};
     3576  Int nbModes;
     3577  for (nbModes=0; nbModes<3; nbModes++)  // add 3 MPMs 1st
     3578  {
     3579    g_reducedSetIntraModes[nbModes] = uiIntraDirPred[nbModes];
     3580    authorizedMode[ uiIntraDirPred[nbModes] ] = 0;
     3581  }
     3582
     3583  Int iColBaseDir = pcTempCU->getLumaIntraDir( uiAbsPartAddrBase );
     3584  if ( authorizedMode[iColBaseDir] )  //possibly add BL mode
     3585  {
     3586    g_reducedSetIntraModes[nbModes++] = iColBaseDir;
     3587    authorizedMode[ iColBaseDir ] = 0;
     3588  }
     3589
     3590  Int iRefMode = ( iColBaseDir > 1 ) ? iColBaseDir : uiIntraDirPred[0];
     3591  if ( iRefMode > 1 )    //add neighboring modes of refMode
     3592  {
     3593    UInt Left  = iRefMode;
     3594    UInt Right = iRefMode;
     3595    while ( nbModes < NB_REMAIN_MODES+3 )
     3596    {
     3597      Left = ((Left + 29) % 32) + 2;
     3598      Right = ((Right - 1 ) % 32) + 2;
     3599      if ( authorizedMode[Left] )   g_reducedSetIntraModes[nbModes++] = Left;
     3600      if ( authorizedMode[Right] )  g_reducedSetIntraModes[nbModes++] = Right;
     3601    }
     3602  }
     3603  else      //add pre-defined modes
     3604  {
     3605    Int  idx = 0;
     3606    while ( nbModes < NB_REMAIN_MODES+3 )
     3607    {
     3608      UInt mode = g_predefSetIntraModes[idx++];
     3609      if ( authorizedMode[mode] )   g_reducedSetIntraModes[nbModes++] = mode;
     3610    }
     3611  }
     3612
     3613  fullSetOfModes = 0;
     3614  return ( nbModes );
     3615}
     3616#endif
     3617
     3618#if REF_IDX_ME_ZEROMV
     3619Bool TComDataCU::xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)
     3620{
     3621  Bool checkZeroMVILR = true;
     3622
     3623  if(uhInterDir&0x1)  //list0
     3624  {
     3625    Int refIdxL0 = cMvFieldL0.getRefIdx();
     3626    if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId))
     3627    {
     3628      checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0);
     3629    }
     3630  }
     3631  if(uhInterDir&0x2)  //list1
     3632  {
     3633    Int refIdxL1  = cMvFieldL1.getRefIdx();
     3634    if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId))
     3635    {
     3636      checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0);
     3637    }
     3638  }
     3639
     3640  return checkZeroMVILR;
     3641}
     3642
     3643Bool TComDataCU::xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx)
     3644{
     3645  RefPicList eRefPicList = iRefList > 0? REF_PIC_LIST_1: REF_PIC_LIST_0;
     3646  assert(eRefPicList == REF_PIC_LIST_1);
     3647
     3648  Bool checkZeroMVILR = true;
     3649
     3650  if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(m_layerId))
     3651  {
     3652    AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo();
     3653    TComMv    cMv        = pcAMVPInfo->m_acMvCand[MvpIdx];
     3654    checkZeroMVILR &= (cMv.getHor() == 0 && cMv.getVer() == 0);
     3655  }
     3656
     3657  return checkZeroMVILR;
     3658}
     3659#endif
     3660
     3661#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     3662Bool TComDataCU::isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)
     3663{
     3664  Bool checkILR = false;
     3665
     3666  if(uhInterDir&0x1)  //list0
     3667  {
     3668    Int refIdxL0 = cMvFieldL0.getRefIdx();
     3669    checkILR = getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId);
     3670  }
     3671  if(uhInterDir&0x2)  //list1
     3672  {
     3673    Int refIdxL1  = cMvFieldL1.getRefIdx();
     3674    checkILR = checkILR || getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId);
     3675  }
     3676
     3677  return checkILR;
     3678}
     3679#endif
     3680
    36823681#endif //SVC_EXTENSION
    36833682//! \}
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComDataCU.h

    r595 r652  
    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 
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComMotionInfo.h

    r595 r652  
    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
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComPic.h

    r595 r652  
    115115  UInt          getTLayer()                { return m_uiTLayer;   }
    116116  Void          setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; }
     117
    117118  Bool          getUsedByCurr()             { return m_bUsedByCurr; }
    118119  Void          setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComPrediction.cpp

    r644 r652  
    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 );
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp

    r644 r652  
    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
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h

    r644 r652  
    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];
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp

    r644 r652  
    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 )
     
    596596    // 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:
    597597#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.
     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.
    600600    if (getRapPicFlag() && getLayerId()==0)
    601601#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.
     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.
    604604    if (getRapPicFlag())
    605605#endif
     
    10511051      pocCRA = pocCurr;
    10521052    }
     1053#if EFFICIENT_FIELD_IRAP
     1054    bRefreshPending = true;
     1055#endif
    10531056  }
    10541057  else // CRA or No DR
    10551058  {
     1059#if EFFICIENT_FIELD_IRAP
     1060    if(getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
     1061    {
     1062      if (bRefreshPending==true && pocCurr > m_iLastIDR) // IDR reference marking pending
     1063      {
     1064        TComList<TComPic*>::iterator        iterPic       = rcListPic.begin();
     1065        while (iterPic != rcListPic.end())
     1066        {
     1067          rpcPic = *(iterPic);
     1068          if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != m_iLastIDR)
     1069          {
     1070            rpcPic->getSlice(0)->setReferenced(false);
     1071          }
     1072          iterPic++;
     1073        }
     1074        bRefreshPending = false;
     1075      }
     1076    }
     1077    else
     1078    {
     1079#endif
    10561080    if (bRefreshPending==true && pocCurr > pocCRA) // CRA reference marking pending
    10571081    {
     
    10681092      bRefreshPending = false;
    10691093    }
     1094#if EFFICIENT_FIELD_IRAP
     1095    }
     1096#endif
    10701097    if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found
    10711098    {
     
    13231350    // in decoding order shall precede the IRAP picture in output order.
    13241351    // (Note that any picture following in output order would be present in the DPB)
     1352#if !SETTING_NO_OUT_PIC_PRIOR
    13251353    if(rpcPic->getSlice(0)->getPicOutputFlag() == 1)
     1354#else
     1355    if(rpcPic->getSlice(0)->getPicOutputFlag() == 1 && !this->getNoOutputPriorPicsFlag())
     1356#endif
    13261357    {
    13271358      if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP    ||
     
    15021533/** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet.
    15031534*/
     1535#if ALLOW_RECOVERY_POINT_AS_RAP
     1536Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess, Bool bUseRecoveryPoint)
     1537#else
    15041538Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess)
    1505 {
     1539#endif
     1540{
     1541#if ALLOW_RECOVERY_POINT_AS_RAP
     1542  Int atLeastOneUnabledByRecoveryPoint = 0;
     1543  Int atLeastOneFlushedByPreviousIDR = 0;
     1544#endif
    15061545  TComPic* rpcPic;
    15071546  Int i, isAvailable;
     
    15241563        if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()) == pReferencePictureSet->getPOC(i) && rpcPic->getSlice(0)->isReferenced())
    15251564        {
     1565#if ALLOW_RECOVERY_POINT_AS_RAP
     1566          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1567          {
     1568            isAvailable = 0;
     1569          }
     1570          else
     1571          {
    15261572          isAvailable = 1;
     1573        }
     1574#else
     1575          isAvailable = 1;
     1576#endif
    15271577        }
    15281578      }
     
    15341584        if(rpcPic->getIsLongTerm() && curPoc == refPoc && rpcPic->getSlice(0)->isReferenced())
    15351585        {
     1586#if ALLOW_RECOVERY_POINT_AS_RAP
     1587          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1588          {
     1589            isAvailable = 0;
     1590          }
     1591          else
     1592          {
    15361593          isAvailable = 1;
     1594        }
     1595#else
     1596          isAvailable = 1;
     1597#endif
    15371598        }
    15381599      }
     
    15571618        if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc)
    15581619        {
     1620#if ALLOW_RECOVERY_POINT_AS_RAP
     1621          if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1622          {
     1623            isAvailable = 0;
     1624          }
     1625          else
     1626          {
    15591627          isAvailable = 1;
    15601628          rpcPic->setIsLongTerm(1);
    15611629          break;
     1630        }
     1631#else
     1632          isAvailable = 1;
     1633          rpcPic->setIsLongTerm(1);
     1634          break;
     1635#endif
    15621636        }
    15631637      }
     
    15871661        }
    15881662      }
     1663#if ALLOW_RECOVERY_POINT_AS_RAP
     1664      else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess)
     1665      {
     1666        atLeastOneUnabledByRecoveryPoint = 1;
     1667      }
     1668      else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL))
     1669      {
     1670        atLeastOneFlushedByPreviousIDR = 1;
     1671      }
     1672#endif
    15891673    }
    15901674  } 
     
    16021686      if(!rpcPic->getIsLongTerm() && rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getPOC() + pReferencePictureSet->getDeltaPOC(i) && rpcPic->getSlice(0)->isReferenced())
    16031687      {
     1688#if ALLOW_RECOVERY_POINT_AS_RAP
     1689        if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess)
     1690        {
     1691          isAvailable = 0;
     1692        }
     1693        else
     1694        {
    16041695        isAvailable = 1;
     1696      }
     1697#else
     1698        isAvailable = 1;
     1699#endif
    16051700      }
    16061701    }
     
    16291724        }
    16301725      }
    1631     }
     1726#if ALLOW_RECOVERY_POINT_AS_RAP
     1727      else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess)
     1728      {
     1729        atLeastOneUnabledByRecoveryPoint = 1;
     1730      }
     1731      else if(bUseRecoveryPoint && (this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_N_LP || this->getAssociatedIRAPType()==NAL_UNIT_CODED_SLICE_IDR_W_RADL))
     1732      {
     1733        atLeastOneFlushedByPreviousIDR = 1;
     1734      }
     1735#endif
     1736    }
     1737    }
     1738#if ALLOW_RECOVERY_POINT_AS_RAP
     1739  if(atLeastOneUnabledByRecoveryPoint || atLeastOneFlushedByPreviousIDR)
     1740  {
     1741    return -1;
    16321742  }   
     1743#endif
    16331744  if(atLeastOneLost)
    16341745  {
     
    16471758/** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set
    16481759*/
     1760#if ALLOW_RECOVERY_POINT_AS_RAP
     1761Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint)
     1762#else
    16491763Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP)
     1764#endif
    16501765{
    16511766  TComPic* rpcPic;
     
    16731788        pcRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i));
    16741789        pcRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP));
     1790#if ALLOW_RECOVERY_POINT_AS_RAP
     1791        pcRPS->setUsed(k, pcRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) );
     1792#endif
    16751793        if(pcRPS->getDeltaPOC(k) < 0)
    16761794        {
     
    16851803    }
    16861804  }
     1805#if EFFICIENT_FIELD_IRAP
     1806  Bool useNewRPS = false;
     1807  // if current picture is complimentary field associated to IRAP, add the IRAP to its RPS.
     1808  if(m_pcPic->isField())
     1809  {
     1810    TComList<TComPic*>::iterator iterPic = rcListPic.begin();
     1811    while ( iterPic != rcListPic.end())
     1812    {
     1813      rpcPic = *(iterPic++);
     1814      if(rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC()+1)
     1815      {
     1816        pcRPS->setDeltaPOC(k, 1);
     1817        pcRPS->setUsed(k, true);
     1818        nrOfPositivePictures++;
     1819        k ++;
     1820        useNewRPS = true;
     1821      }
     1822    }
     1823  }
     1824#endif
    16871825  pcRPS->setNumberOfNegativePictures(nrOfNegativePictures);
    16881826  pcRPS->setNumberOfPositivePictures(nrOfPositivePictures);
     
    16911829  // inter RPS prediction with.  Here we just use the reference used by pReferencePictureSet.
    16921830  // If pReferencePictureSet is not inter_RPS_predicted, then inter_RPS_prediction is for the current RPS also disabled.
    1693   if (!pReferencePictureSet->getInterRPSPrediction())
     1831  if (!pReferencePictureSet->getInterRPSPrediction()
     1832#if EFFICIENT_FIELD_IRAP
     1833    || useNewRPS
     1834#endif
     1835    )
    16941836  {
    16951837    pcRPS->setInterRPSPrediction(false);
  • branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.h

    r644 r652  
    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];
     
    19631963  UInt        m_colFromL0Flag;  // collocated picture from List0 flag
    19641964 
     1965#if SETTING_NO_OUT_PIC_PRIOR
     1966  Bool        m_noOutputPriorPicsFlag;
     1967  Bool        m_noRaslOutputFlag;
     1968  Bool        m_handleCraAsBlaFlag;
     1969#endif
     1970 
    19651971  UInt        m_colRefIdx;
    19661972  UInt        m_maxNumMergeCand;
     
    20292035#if O0149_CROSS_LAYER_BLA_FLAG
    20302036  Bool        m_bCrossLayerBLAFlag;
    2031 #endif
    2032 #if NO_OUTPUT_OF_PRIOR_PICS
    2033   Bool        m_noOutputOfPriorPicsFlag;
    2034   Bool        m_noRaslOutputFlag;
    2035   Bool        m_handleCraAsBlaFlag;
    20362037#endif
    20372038#if POC_RESET_IDC_SIGNALLING
     
    21302131  NalUnitType getNalUnitType    () const                        { return m_eNalUnitType;        }
    21312132  Bool      getRapPicFlag       (); 
    2132 #if NO_OUTPUT_OF_PRIOR_PICS
    2133   Bool      getBlaPicFlag       ();
    2134   Bool      getCraPicFlag       ();
    2135 #endif
    21362133  Bool      getIdrPicFlag       ()                              { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
    21372134  Bool      isIRAP              () const                        { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 
     
    22032200  Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );
    22042201  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);
     2202#if ALLOW_RECOVERY_POINT_AS_RAP
     2203  Int  checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);
     2204  Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);
     2205#else
     2206  Int  checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0);
     2207  Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP);
     2208#endif
    22072209
    22082210  Void setMaxNumMergeCand               (UInt val )         { m_maxNumMergeCand = val;                    }
    22092211  UInt getMaxNumMergeCand               ()                  { return m_maxNumMergeCand;                   }
     2212
     2213#if SETTING_NO_OUT_PIC_PRIOR
     2214  Void setNoOutputPriorPicsFlag         ( Bool val )        { m_noOutputPriorPicsFlag = val;                    }
     2215  Bool getNoOutputPriorPicsFlag         ()                  { return m_noOutputPriorPicsFlag;                   }
     2216
     2217  Void setNoRaslOutputFlag              ( Bool val )        { m_noRaslOutputFlag = val;                    }
     2218  Bool getNoRaslOutputFlag              ()                  { return m_noRaslOutputFlag;                   }
     2219
     2220  Void setHandleCraAsBlaFlag            ( Bool val )        { m_handleCraAsBlaFlag = val;                    }
     2221  Bool getHandleCraAsBlaFlag            ()                  { return m_handleCraAsBlaFlag;                   }
     2222#endif
    22102223
    22112224  Void setSliceMode                     ( UInt uiMode )     { m_sliceMode = uiMode;                     }
     
    23602373
    23612374  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
    23732375#if POC_RESET_IDC_SIGNALLING
    23742376  Int       getPocResetIdc       ()                              { return m_pocResetIdc;       }
     
    23882390#endif
    23892391
     2392#if NO_OUTPUT_OF_PRIOR_PICS
     2393  Bool      getBlaPicFlag       ();
     2394  Bool      getCraPicFlag       ();
     2395#endif
     2396
    23902397#endif //SVC_EXTENSION
    23912398protected:
  • branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h

    r644 r652  
    264264//! \ingroup TLibCommon
    265265//! \{
     266#define HARMONIZE_GOP_FIRST_FIELD_COUPLE  1
     267#define FIX_FIELD_DEPTH                 1
     268#define EFFICIENT_FIELD_IRAP            1
     269#define ALLOW_RECOVERY_POINT_AS_RAP     1
    266270#define BUGFIX_INTRAPERIOD 1
    267271#define SAO_ENCODE_ALLOW_USE_PREDEBLOCK 1
    268272
     273#define SAO_SGN_FUNC 1
     274
    269275#define FIX1172 1 ///< fix ticket #1172
     276
     277#define SETTING_PIC_OUTPUT_MARK     1
     278#define SETTING_NO_OUT_PIC_PRIOR    1
     279#define FIX_EMPTY_PAYLOAD_NAL       1
     280#define FIX_WRITING_OUTPUT          1
     281#define FIX_OUTPUT_EOS              1
     282
     283#define FIX_POC_CRA_NORASL_OUTPUT   1
    270284
    271285#define MAX_NUM_PICS_IN_SOP           1024
  • branches/SHM-6-dev/source/Lib/TLibDecoder/AnnexBread.h

    r595 r652  
    6565  , m_Input(istream)
    6666  {
    67     istream.exceptions(std::istream::eofbit);
     67    istream.exceptions(std::istream::eofbit | std::istream::badbit);
    6868  }
    6969
  • branches/SHM-6-dev/source/Lib/TLibDecoder/SEIread.cpp

    r644 r652  
    518518{
    519519  UInt val;
    520   READ_CODE(4, val, "active_vps_id");      sei.activeVPSId = val;
    521   READ_FLAG( val, "full_random_access_flag");  sei.m_fullRandomAccessFlag = val ? true : false;
    522   READ_FLAG( val, "no_param_set_update_flag"); sei.m_noParamSetUpdateFlag = val ? true : false;
     520  READ_CODE(4, val, "active_video_parameter_set_id");   sei.activeVPSId = val;
     521  READ_FLAG(   val, "self_contained_cvs_flag");         sei.m_selfContainedCvsFlag = val ? true : false;
     522  READ_FLAG(   val, "no_parameter_set_update_flag");    sei.m_noParameterSetUpdateFlag = val ? true : false;
    523523  READ_UVLC(   val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val;
    524524
    525   sei.activeSeqParamSetId.resize(sei.numSpsIdsMinus1 + 1);
     525  sei.activeSeqParameterSetId.resize(sei.numSpsIdsMinus1 + 1);
    526526  for (Int i=0; i < (sei.numSpsIdsMinus1 + 1); i++)
    527527  {
    528     READ_UVLC(val, "active_seq_param_set_id");  sei.activeSeqParamSetId[i] = val;
    529   }
    530 
    531   UInt uibits = m_pcBitstream->getNumBitsUntilByteAligned();
    532  
    533   while(uibits--)
    534   {
    535     READ_FLAG(val, "alignment_bit");
    536   }
     528    READ_UVLC(val, "active_seq_parameter_set_id");      sei.activeSeqParameterSetId[i] = val;
     529  }
     530
     531  xParseByteAlign();
    537532}
    538533
     
    812807    case 4:
    813808      {
    814         READ_CODE( 8, val, "camera_iso_speed_idc" );                     sei.m_cameraIsoSpeedValue = val;
    815         if( sei.m_cameraIsoSpeedValue == 255) //Extended_ISO
     809        READ_CODE( 8, val, "camera_iso_speed_idc" );                     sei.m_cameraIsoSpeedIdc = val;
     810        if( sei.m_cameraIsoSpeedIdc == 255) //Extended_ISO
    816811        {
    817812          READ_CODE( 32,   val,   "camera_iso_speed_value" );            sei.m_cameraIsoSpeedValue = val;
     813        }
     814        READ_CODE( 8, val, "exposure_index_idc" );                       sei.m_exposureIndexIdc = val;
     815        if( sei.m_exposureIndexIdc == 255) //Extended_ISO
     816        {
     817          READ_CODE( 32,   val,   "exposure_index_value" );              sei.m_exposureIndexValue = val;
    818818        }
    819819        READ_FLAG( val, "exposure_compensation_value_sign_flag" );       sei.m_exposureCompensationValueSignFlag = val;
  • branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r649 r652  
    681681    for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
    682682    {
    683       READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1");
     683      READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
    684684      pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
    685       READ_UVLC ( uiCode, "sps_num_reorder_pics" );
     685      READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
    686686      pcSPS->setNumReorderPics(uiCode, i);
    687       READ_UVLC ( uiCode, "sps_max_latency_increase_plus1");
     687      READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
    688688      pcSPS->setMaxLatencyIncrease( uiCode, i );
    689689
     
    887887  READ_CODE( 6,  uiCode,  "vps_reserved_zero_6bits" );            assert(uiCode == 0);
    888888#endif
    889   READ_CODE( 3,  uiCode,  "vps_max_sub_layers_minus1" );          pcVPS->setMaxTLayers( uiCode + 1 ); assert(uiCode <= 6);
     889  READ_CODE( 3,  uiCode,  "vps_max_sub_layers_minus1" );          pcVPS->setMaxTLayers( uiCode + 1 ); assert(uiCode+1 <= MAX_TLAYER);
    890890  READ_FLAG(     uiCode,  "vps_temporal_id_nesting_flag" );       pcVPS->setTemporalNestingFlag( uiCode ? true:false );
    891891  assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
     
    21022102  if( rpcSlice->getRapPicFlag())
    21032103  {
    2104 #if !NO_OUTPUT_OF_PRIOR_PICS
    2105     READ_FLAG( uiCode, "no_output_of_prior_pics_flag" );  //ignored
    2106 #else
    2107     READ_FLAG( uiCode, "no_output_of_prior_pics_flag" );  rpcSlice->setNoOutputOfPriorPicsFlag( uiCode ? true : false );
     2104    READ_FLAG( uiCode, "no_output_of_prior_pics_flag" );  //ignored -- updated already
     2105#if SETTING_NO_OUT_PIC_PRIOR
     2106    rpcSlice->setNoOutputPriorPicsFlag(uiCode ? true : false);
     2107#else
     2108    rpcSlice->setNoOutputPicPrior( false );
    21082109#endif
    21092110  }
     
    23052306        else
    23062307        {
    2307           uiCode = 0;
     2308          uiCode = 0;       
    23082309        }
    23092310        *rps = *(sps->getRPSList()->getReferencePictureSet(uiCode));
  • branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCu.cpp

    r595 r652  
    715715{
    716716  UInt  uiInitTrDepth = ( pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1 );
    717   UInt  uiNumPart     = pcCU->getNumPartInter();
     717  UInt  uiNumPart     = pcCU->getNumPartitions();
    718718  UInt  uiNumQParts   = pcCU->getTotalNumPart() >> 2;
    719719 
  • branches/SHM-6-dev/source/Lib/TLibDecoder/TDecGop.cpp

    r595 r652  
    248248  }
    249249
     250#if SETTING_PIC_OUTPUT_MARK
     251  rpcPic->setOutputMark(rpcPic->getSlice(0)->getPicOutputFlag() ? true : false);
     252#else
    250253  rpcPic->setOutputMark(true);
     254#endif
    251255  rpcPic->setReconMark(true);
    252256}
  • branches/SHM-6-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r644 r652  
    7979  m_prevSliceSkipped = false;
    8080  m_skippedPOC = 0;
    81 #if NO_CLRAS_OUTPUT_FLAG
    82   m_noClrasOutputFlag          = false;
     81#if SETTING_NO_OUT_PIC_PRIOR
     82  m_bFirstSliceInBitstream  = true;
     83  m_lastPOCNoOutputPriorPics = -1;
     84  m_craNoRaslOutputFlag = false;
     85  m_isNoOutputPriorPics = false;
     86#endif
     87#if NO_CLRAS_OUTPUT_FLAG 
    8388  m_layerInitializedFlag       = false;
    84   m_firstPicInLayerDecodedFlag = false;
    85   m_noOutputOfPriorPicsFlags   = false;
     89  m_firstPicInLayerDecodedFlag = false; 
    8690  m_bRefreshPending            = false;
    8791#endif
     
    503507
    504508  // Execute Deblock + Cleanup
    505 
    506509  m_cGopDecoder.filterPicture(pcPic);
    507510
     
    517520  return;
    518521}
     522
     523#if SETTING_NO_OUT_PIC_PRIOR
     524Void TDecTop::checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic)
     525{
     526  if (!rpcListPic || !m_isNoOutputPriorPics) return;
     527
     528  TComList<TComPic*>::iterator  iterPic   = rpcListPic->begin();
     529
     530  while (iterPic != rpcListPic->end())
     531  {
     532    TComPic*& pcPicTmp = *(iterPic++);
     533    if (m_lastPOCNoOutputPriorPics != pcPicTmp->getPOC())
     534    {
     535      pcPicTmp->setOutputMark(false);
     536    }
     537  }
     538}
     539#endif
    519540
    520541#if EARLY_REF_PIC_MARKING
     
    843864  TComPic*&   pcPic         = m_pcPic;
    844865#if SVC_EXTENSION
    845 #if !NO_OUTPUT_OF_PRIOR_PICS
    846 #if NO_CLRAS_OUTPUT_FLAG
    847   Bool bFirstSliceInSeq;
    848 #endif
    849 #endif
    850866  m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getPrefetchedVPS(0) );
    851867#if OUTPUT_LAYER_SET_INDEX
     
    900916  m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType);
    901917
    902 #if NO_OUTPUT_OF_PRIOR_PICS
    903   // Infer the value of NoOutputOfPriorPicsFlag
    904   if( m_apcSlicePilot->getRapPicFlag() )
    905   {
    906     if ( m_apcSlicePilot->getBlaPicFlag() || m_apcSlicePilot->getIdrPicFlag()  ||
    907         (m_apcSlicePilot->getCraPicFlag() && m_bFirstSliceInSequence) ||
    908         (m_apcSlicePilot->getCraPicFlag() && m_apcSlicePilot->getHandleCraAsBlaFlag()))
    909     {
    910       m_apcSlicePilot->setNoRaslOutputFlag( true );
     918#if SETTING_NO_OUT_PIC_PRIOR
     919  //For inference of NoOutputOfPriorPicsFlag
     920  if (m_apcSlicePilot->getRapPicFlag())
     921  {
     922    if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) ||
     923        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) ||
     924        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag()))
     925    {
     926      m_apcSlicePilot->setNoRaslOutputFlag(true);
     927    }
     928    //the inference for NoOutputPriorPicsFlag
     929    if (!m_bFirstSliceInBitstream && m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag())
     930    {
     931      if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)
     932      {
     933        m_apcSlicePilot->setNoOutputPriorPicsFlag(true);
     934      }
    911935    }
    912936    else
    913937    {
    914       m_apcSlicePilot->setNoRaslOutputFlag( false );
    915     }
     938      m_apcSlicePilot->setNoOutputPriorPicsFlag(false);
     939    }
     940
     941    if(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)
     942    {
     943      m_craNoRaslOutputFlag = m_apcSlicePilot->getNoRaslOutputFlag();
     944    }
     945  }
     946  if (m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoOutputPriorPicsFlag())
     947  {
     948    m_lastPOCNoOutputPriorPics = m_apcSlicePilot->getPOC();
     949    m_isNoOutputPriorPics = true;
     950  }
     951  else
     952  {
     953    m_isNoOutputPriorPics = false;
     954  }
     955
     956  //For inference of PicOutputFlag
     957  if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R)
     958  {
     959    if ( m_craNoRaslOutputFlag )
     960    {
     961      m_apcSlicePilot->setPicOutputFlag(false);
     962    }
     963  }
     964#endif
     965
     966#if FIX_POC_CRA_NORASL_OUTPUT
     967  if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1
     968  {
     969    Int iMaxPOClsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC();
     970    m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) );
    916971  }
    917972#endif
     
    9751030    if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getNoRaslOutputFlag() )
    9761031    {
    977       this->setNoOutputOfPriorPicsFlags( true );
     1032      this->setNoOutputPriorPicsFlag( true );
    9781033    }
    9791034    else if( m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag() )
    9801035    {
    981       this->setNoOutputOfPriorPicsFlags( m_apcSlicePilot->getNoOutputOfPriorPicsFlag() );
     1036      this->setNoOutputPriorPicsFlag( m_apcSlicePilot->getNoOutputPriorPicsFlag() );
    9821037    }
    9831038    else
     
    9851040      if( this->m_ppcTDecTop[0]->getNoClrasOutputFlag() )
    9861041      {
    987         this->setNoOutputOfPriorPicsFlags( true );
     1042        this->setNoOutputPriorPicsFlag( true );
    9881043      }
    9891044    }
     
    10061061#else
    10071062  //we should only get a different poc for a new picture (with CTU address==0)
    1008   if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (!m_apcSlicePilot->getSliceCurStartCUAddr()==0))
     1063  if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (m_apcSlicePilot->getSliceCurStartCUAddr()!=0))
    10091064  {
    10101065    printf ("Warning, the first slice of a picture might have been lost!\n");
     
    10501105#endif
    10511106  }
    1052 #if !NO_OUTPUT_OF_PRIOR_PICS
    1053 #if NO_CLRAS_OUTPUT_FLAG
    1054   bFirstSliceInSeq = m_bFirstSliceInSequence;
    1055 #endif
    1056 #endif
    10571107  m_bFirstSliceInSequence = false;
     1108#if SETTING_NO_OUT_PIC_PRIOR 
     1109  m_bFirstSliceInBitstream  = false;
     1110#endif
    10581111#if POC_RESET_FLAG
    10591112  // This operation would do the following:
     
    12161269#endif
    12171270
    1218 #if !NO_OUTPUT_OF_PRIOR_PICS
    1219 #if NO_CLRAS_OUTPUT_FLAG
    1220     if (m_layerId == 0 &&
    1221         (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
    1222       || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    1223       || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
    1224       || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    1225       || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
    1226       || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA))
    1227     {
    1228       if (bFirstSliceInSeq)
    1229       {
    1230         setNoClrasOutputFlag(true);
    1231       }
    1232       else if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
    1233             || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    1234             || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP)
    1235       {
    1236         setNoClrasOutputFlag(true);
    1237       }
    1238 #if O0149_CROSS_LAYER_BLA_FLAG
    1239       else if ((m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP) &&
    1240                m_apcSlicePilot->getCrossLayerBLAFlag())
    1241       {
    1242         setNoClrasOutputFlag(true);
    1243       }
    1244 #endif
    1245       else
    1246       {
    1247         setNoClrasOutputFlag(false);
    1248       }
    1249       if (getNoClrasOutputFlag())
    1250       {
    1251         for (UInt i = 0; i < m_apcSlicePilot->getVPS()->getMaxLayers(); i++)
    1252         {
    1253           m_ppcTDecTop[i]->setLayerInitializedFlag(false);
    1254           m_ppcTDecTop[i]->setFirstPicInLayerDecodedFlag(false);
    1255         }
    1256       }
    1257     }
    1258 #endif
    1259 
    1260 #if NO_CLRAS_OUTPUT_FLAG
    1261     m_apcSlicePilot->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, m_cListPic, getNoClrasOutputFlag());
    1262 #endif
    1263 #else
     1271#if NO_OUTPUT_OF_PRIOR_PICS
    12641272    if ( m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() && getNoClrasOutputFlag() )
    12651273    {
     
    12731281    // Buffer initialize for prediction.
    12741282    m_cPrediction.initTempBuff();
    1275 #if !ALIGNED_BUMPING
     1283#if ALIGNED_BUMPING
     1284    m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic);
     1285#else
    12761286    m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS());
    1277 #else
    1278     m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic);
    12791287#endif
    12801288    //  Get a new picture buffer
     
    18091817      SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin());
    18101818      m_parameterSetManagerDecoder.applyPrefetchedPS();
    1811       assert(seiAps->activeSeqParamSetId.size()>0);
    1812       if( !m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParamSetId[0] ) )
     1819      assert(seiAps->activeSeqParameterSetId.size()>0);
     1820      if( !m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParameterSetId[0] ) )
    18131821      {
    18141822        printf ("Warning SPS activation with Active parameter set SEI failed");
     
    18371845      SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin());
    18381846      m_parameterSetManagerDecoder.applyPrefetchedPS();
    1839       assert(seiAps->activeSeqParamSetId.size()>0);
    1840       if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))
     1847      assert(seiAps->activeSeqParameterSetId.size()>0);
     1848      if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] ))
    18411849      {
    18421850        printf ("Warning SPS activation with Active parameter set SEI failed");
     
    19972005      return false;
    19982006     
     2007    case NAL_UNIT_FILLER_DATA:
     2008      return false;
    19992009     
    20002010    case NAL_UNIT_RESERVED_VCL_N10:
     
    20172027    case NAL_UNIT_RESERVED_VCL31:
    20182028     
    2019     case NAL_UNIT_FILLER_DATA:
    20202029    case NAL_UNIT_RESERVED_NVCL41:
    20212030    case NAL_UNIT_RESERVED_NVCL42:
  • branches/SHM-6-dev/source/Lib/TLibDecoder/TDecTop.h

    r644 r652  
    104104  Bool                    m_prevSliceSkipped;
    105105  Int                     m_skippedPOC;
     106#if SETTING_NO_OUT_PIC_PRIOR 
     107  Bool                    m_bFirstSliceInBitstream;
     108  Int                     m_lastPOCNoOutputPriorPics;
     109  Bool                    m_isNoOutputPriorPics;
     110  Bool                    m_craNoRaslOutputFlag;    //value of variable NoRaslOutputFlag of the last CRA pic
     111#endif
    106112
    107113#if SVC_EXTENSION
     
    136142#endif
    137143
    138 #if NO_CLRAS_OUTPUT_FLAG
    139   Bool                    m_noClrasOutputFlag;
     144#if NO_CLRAS_OUTPUT_FLAG 
    140145  Bool                    m_layerInitializedFlag;
    141146  Bool                    m_firstPicInLayerDecodedFlag;
    142   Bool                    m_noOutputOfPriorPicsFlags;
    143 
    144   Bool                   m_bRefreshPending;
     147  Bool                    m_bRefreshPending;
    145148#endif
    146149#if RESOLUTION_BASED_DPB
    147   Int                    m_subDpbIdx;     // Index to the sub-DPB that the layer belongs to.
    148                                           // When new VPS is activated, this should be re-initialized to -1
     150  Int                     m_subDpbIdx;     // Index to the sub-DPB that the layer belongs to.
     151                                           // When new VPS is activated, this should be re-initialized to -1
    149152#endif
    150153public:
     
    166169  Void  deletePicBuffer();
    167170
     171 
     172  TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS(); }
     173
     174
    168175  Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic);
     176#if SETTING_NO_OUT_PIC_PRIOR 
     177  Void  checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic);
     178  Bool  getNoOutputPriorPicsFlag ()         { return m_isNoOutputPriorPics; }
     179  Void  setNoOutputPriorPicsFlag (Bool val) { m_isNoOutputPriorPics = val; }
     180#endif
     181
    169182#if SVC_EXTENSION
    170183#if EARLY_REF_PIC_MARKING
     
    239252  fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; }
    240253#endif
    241 #if NO_OUTPUT_OF_PRIOR_PICS
    242 #if NO_CLRAS_OUTPUT_FLAG
    243   Bool getNoOutputOfPriorPicsFlags()         { return m_noOutputOfPriorPicsFlags;}
    244   Void setNoOutputOfPriorPicsFlags(Bool x)   { m_noOutputOfPriorPicsFlags = x;   }
    245 #endif
    246 #endif
    247254protected:
    248255  Void  xGetNewPicBuffer  (TComSlice* pcSlice, TComPic*& rpcPic);
     
    265272
    266273#if NO_CLRAS_OUTPUT_FLAG
    267   Int  getNoClrasOutputFlag()                { return m_noClrasOutputFlag;}
    268   Void setNoClrasOutputFlag(Bool x)          { m_noClrasOutputFlag = x;   }
     274  Int  getNoClrasOutputFlag()                { return m_craNoRaslOutputFlag;}
     275  Void setNoClrasOutputFlag(Bool x)          { m_craNoRaslOutputFlag = x;   }
    269276  Int  getLayerInitializedFlag()             { return m_layerInitializedFlag;}
    270277  Void setLayerInitializedFlag(Bool x)       { m_layerInitializedFlag = x;   }
    271278  Int  getFirstPicInLayerDecodedFlag()       { return m_firstPicInLayerDecodedFlag;}
    272279  Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x;   }
    273 #if !NO_OUTPUT_OF_PRIOR_PICS
    274   Int  getNoOutputOfPriorPicsFlags()         { return m_noOutputOfPriorPicsFlags;}
    275   Void setNoOutputOfPriorPicsFlags(Bool x)   { m_noOutputOfPriorPicsFlags = x;   }
    276 #endif
    277280#endif
    278281};// END CLASS DEFINITION TDecTop
  • branches/SHM-6-dev/source/Lib/TLibEncoder/AnnexBwrite.h

    r595 r652  
    5858
    5959    static const Char start_code_prefix[] = {0,0,0,1};
    60     if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
     60    if (it == au.begin() || nalu.m_nalUnitType == NAL_UNIT_VPS || nalu.m_nalUnitType == NAL_UNIT_SPS || nalu.m_nalUnitType == NAL_UNIT_PPS)
    6161    {
    6262      /* From AVC, When any of the following conditions are fulfilled, the
  • branches/SHM-6-dev/source/Lib/TLibEncoder/NALwrite.cpp

    r595 r652  
    9191  vector<uint8_t>& rbsp   = nalu.m_Bitstream.getFIFO();
    9292
    93 #if P0130_EOB
    94   if (rbsp.size() == 0) return;
    95 #endif
     93  if (rbsp.size() == 0)
     94  {
     95    return;
     96  }
    9697
    9798  for (vector<uint8_t>::iterator it = rbsp.begin(); it != rbsp.end();)
  • branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.cpp

    r644 r652  
    333333Void SEIWriter::xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei)
    334334{
    335   WRITE_CODE(sei.activeVPSId,     4, "active_vps_id");
    336   WRITE_FLAG(sei.m_fullRandomAccessFlag, "full_random_access_flag");
    337   WRITE_FLAG(sei.m_noParamSetUpdateFlag, "no_param_set_update_flag");
     335  WRITE_CODE(sei.activeVPSId,     4,         "active_video_parameter_set_id");
     336  WRITE_FLAG(sei.m_selfContainedCvsFlag,     "self_contained_cvs_flag");
     337  WRITE_FLAG(sei.m_noParameterSetUpdateFlag, "no_parameter_set_update_flag");
    338338  WRITE_UVLC(sei.numSpsIdsMinus1,    "num_sps_ids_minus1");
    339339
    340   assert (sei.activeSeqParamSetId.size() == (sei.numSpsIdsMinus1 + 1));
    341 
    342   for (Int i = 0; i < sei.activeSeqParamSetId.size(); i++)
    343   {
    344     WRITE_UVLC(sei.activeSeqParamSetId[i], "active_seq_param_set_id");
    345   }
    346 
    347   UInt uiBits = m_pcBitIf->getNumberOfWrittenBits();
    348   UInt uiAlignedBits = ( 8 - (uiBits&7) ) % 8; 
    349   if(uiAlignedBits)
    350   {
    351     WRITE_FLAG(1, "alignment_bit" );
    352     uiAlignedBits--;
    353     while(uiAlignedBits--)
    354     {
    355       WRITE_FLAG(0, "alignment_bit" );
    356     }
    357   }
     340  assert (sei.activeSeqParameterSetId.size() == (sei.numSpsIdsMinus1 + 1));
     341
     342  for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++)
     343  {
     344    WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id");
     345  }
     346  xWriteByteAlign();
    358347}
    359348
     
    550539        {
    551540          WRITE_CODE( sei.m_cameraIsoSpeedValue,    32,    "camera_iso_speed_value" );
     541        }
     542        WRITE_CODE( sei.m_exposureIndexIdc,     8,    "exposure_index_idc" );
     543        if( sei.m_exposureIndexIdc == 255) //Extended_ISO
     544        {
     545          WRITE_CODE( sei.m_exposureIndexValue,     32,    "exposure_index_value" );
    552546        }
    553547        WRITE_FLAG( sei.m_exposureCompensationValueSignFlag,           "exposure_compensation_value_sign_flag" );
     
    633627    for (UInt i = (sei.m_defaultOpFlag ? 1 : 0); i <= sei.m_nestingNumOpsMinus1; i++)
    634628    {
     629      WRITE_CODE( sei.m_nestingNoOpMaxTemporalIdPlus1, 3, "nesting_no_op_max_temporal_id" );
    635630      WRITE_CODE( sei.m_nestingMaxTemporalIdPlus1[i], 3,  "nesting_max_temporal_id"       );
    636631      WRITE_UVLC( sei.m_nestingOpIdx[i],                  "nesting_op_idx"                );
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r649 r652  
    16121612  if ( pcSlice->getRapPicFlag() )
    16131613  {
    1614 #if NO_OUTPUT_OF_PRIOR_PICS
    1615     WRITE_FLAG( pcSlice->getNoOutputOfPriorPicsFlag(), "no_output_of_prior_pics_flag" );
     1614#if SETTING_NO_OUT_PIC_PRIOR
     1615    WRITE_FLAG( pcSlice->getNoOutputPriorPicsFlag() ? 1 : 0, "no_output_of_prior_pics_flag" );
    16161616#else
    16171617    WRITE_FLAG( 0, "no_output_of_prior_pics_flag" );
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCfg.h

    r644 r652  
    235235  Int       m_cameraIsoSpeedIdc;
    236236  Int       m_cameraIsoSpeedValue;
     237  Int       m_exposureIndexIdc;
     238  Int       m_exposureIndexValue;
    237239  Int       m_exposureCompensationValueSignFlag;
    238240  Int       m_exposureCompensationValueNumerator;
     
    639641  Void  setTMISEICameraIsoSpeedValue(Int b)                  {  m_cameraIsoSpeedValue = b;  }
    640642  Int   getTMISEICameraIsoSpeedValue()                       {  return m_cameraIsoSpeedValue;  }
     643  Void  setTMISEIExposureIndexIdc(Int b)                     {  m_exposureIndexIdc = b;  }
     644  Int   getTMISEIExposurIndexIdc()                           {  return m_exposureIndexIdc;  }
     645  Void  setTMISEIExposureIndexValue(Int b)                   {  m_exposureIndexValue = b;  }
     646  Int   getTMISEIExposurIndexValue()                         {  return m_exposureIndexValue;  }
    641647  Void  setTMISEIExposureCompensationValueSignFlag(Int b)    {  m_exposureCompensationValueSignFlag = b;  }
    642648  Int   getTMISEIExposureCompensationValueSignFlag()         {  return m_exposureCompensationValueSignFlag;  }
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r644 r652  
    7575  m_iNumPicCoded        = 0; //Niko
    7676  m_bFirst              = true;
     77#if ALLOW_RECOVERY_POINT_AS_RAP
     78  m_iLastRecoveryPicPOC = 0;
     79#endif
    7780 
    7881  m_pcCfg               = NULL;
     
    163166  SEIActiveParameterSets *seiActiveParameterSets = new SEIActiveParameterSets();
    164167  seiActiveParameterSets->activeVPSId = m_pcCfg->getVPS()->getVPSId();
    165   seiActiveParameterSets->m_fullRandomAccessFlag = false;
    166   seiActiveParameterSets->m_noParamSetUpdateFlag = false;
     168  seiActiveParameterSets->m_selfContainedCvsFlag = false;
     169  seiActiveParameterSets->m_noParameterSetUpdateFlag = false;
    167170  seiActiveParameterSets->numSpsIdsMinus1 = 0;
    168   seiActiveParameterSets->activeSeqParamSetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1);
    169   seiActiveParameterSets->activeSeqParamSetId[0] = sps->getSPSId();
     171  seiActiveParameterSets->activeSeqParameterSetId.resize(seiActiveParameterSets->numSpsIdsMinus1 + 1);
     172  seiActiveParameterSets->activeSeqParameterSetId[0] = sps->getSPSId();
    170173  return seiActiveParameterSets;
    171174}
    172 
    173175
    174176SEIFramePacking* TEncGOP::xCreateSEIFramePacking()
     
    271273       seiToneMappingInfo->m_cameraIsoSpeedValue = m_pcCfg->getTMISEICameraIsoSpeedValue();
    272274       assert( seiToneMappingInfo->m_cameraIsoSpeedValue !=0 );
     275       seiToneMappingInfo->m_exposureIndexIdc = m_pcCfg->getTMISEIExposurIndexIdc();
     276       seiToneMappingInfo->m_exposureIndexValue = m_pcCfg->getTMISEIExposurIndexValue();
     277       assert( seiToneMappingInfo->m_exposureIndexValue !=0 );
    273278       seiToneMappingInfo->m_exposureCompensationValueSignFlag = m_pcCfg->getTMISEIExposureCompensationValueSignFlag();
    274279       seiToneMappingInfo->m_exposureCompensationValueNumerator = m_pcCfg->getTMISEIExposureCompensationValueNumerator();
     
    435440  UInt *accumNalsDU = NULL;
    436441  SEIDecodingUnitInfo decodingUnitInfoSEI;
     442#if EFFICIENT_FIELD_IRAP
     443  Int IRAPGOPid = -1;
     444  Bool IRAPtoReorder = false;
     445  Bool swapIRAPForward = false;
     446  if(isField)
     447  {
     448    Int pocCurr;
     449#if SVC_EXTENSION
     450    for ( Int iGOPid=iPicIdInGOP; iGOPid < iPicIdInGOP+1; iGOPid++ )
     451#else
     452    for ( Int iGOPid=0; iGOPid < m_iGopSize; iGOPid++ )
     453#endif   
     454    {
     455      // determine actual POC
     456      if(iPOCLast == 0) //case first frame or first top field
     457      {
     458        pocCurr=0;
     459      }
     460      else if(iPOCLast == 1 && isField) //case first bottom field, just like the first frame, the poc computation is not right anymore, we set the right value
     461      {
     462        pocCurr = 1;
     463      }
     464      else
     465      {
     466        pocCurr = iPOCLast - iNumPicRcvd + m_pcCfg->getGOPEntry(iGOPid).m_POC - isField;
     467      }
     468
     469      // check if POC corresponds to IRAP
     470      NalUnitType tmpUnitType = getNalUnitType(pocCurr, m_iLastIDR, isField);
     471      if(tmpUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && tmpUnitType <= NAL_UNIT_CODED_SLICE_CRA) // if picture is an IRAP
     472      {
     473        if(pocCurr%2 == 0 && iGOPid < m_iGopSize-1 && m_pcCfg->getGOPEntry(iGOPid).m_POC == m_pcCfg->getGOPEntry(iGOPid+1).m_POC-1)
     474        { // if top field and following picture in enc order is associated bottom field
     475          IRAPGOPid = iGOPid;
     476          IRAPtoReorder = true;
     477          swapIRAPForward = true;
     478          break;
     479        }
     480        if(pocCurr%2 != 0 && iGOPid > 0 && m_pcCfg->getGOPEntry(iGOPid).m_POC == m_pcCfg->getGOPEntry(iGOPid-1).m_POC+1)
     481        {
     482          // if picture is an IRAP remember to process it first
     483          IRAPGOPid = iGOPid;
     484          IRAPtoReorder = true;
     485          swapIRAPForward = false;
     486          break;
     487        }
     488      }
     489    }
     490  }
     491#endif
    437492#if SVC_EXTENSION
    438493  for ( Int iGOPid=iPicIdInGOP; iGOPid < iPicIdInGOP+1; iGOPid++ )
     
    441496#endif
    442497  {
     498#if EFFICIENT_FIELD_IRAP
     499    if(IRAPtoReorder)
     500    {
     501      if(swapIRAPForward)
     502      {
     503        if(iGOPid == IRAPGOPid)
     504        {
     505          iGOPid = IRAPGOPid +1;
     506        }
     507        else if(iGOPid == IRAPGOPid +1)
     508        {
     509          iGOPid = IRAPGOPid;
     510        }
     511      }
     512      else
     513      {
     514        if(iGOPid == IRAPGOPid -1)
     515        {
     516          iGOPid = IRAPGOPid;
     517        }
     518        else if(iGOPid == IRAPGOPid)
     519        {
     520          iGOPid = IRAPGOPid -1;
     521        }
     522      }
     523    }
     524#endif
    443525    UInt uiColDir = 1;
    444526    //-- For time output for each slice
     
    510592    if(pocCurr>=m_pcCfg->getFramesToBeEncoded())
    511593    {
     594#if EFFICIENT_FIELD_IRAP
     595      if(IRAPtoReorder)
     596      {
     597        if(swapIRAPForward)
     598        {
     599          if(iGOPid == IRAPGOPid)
     600          {
     601            iGOPid = IRAPGOPid +1;
     602            IRAPtoReorder = false;
     603          }
     604          else if(iGOPid == IRAPGOPid +1)
     605          {
     606            iGOPid --;
     607          }
     608        }
     609        else
     610        {
     611          if(iGOPid == IRAPGOPid)
     612          {
     613            iGOPid = IRAPGOPid -1;
     614          }
     615          else if(iGOPid == IRAPGOPid -1)
     616          {
     617            iGOPid = IRAPGOPid;
     618            IRAPtoReorder = false;
     619          }
     620        }
     621      }
     622#endif
    512623      continue;
    513624    }
     
    9321043    }
    9331044
    934     // Do decoding refresh marking if any
    935 #if NO_CLRAS_OUTPUT_FLAG
    936     pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic, m_pcEncTop->getNoClrasOutputFlag());
    937 #else
    938     pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic);
    939 #endif
    940     m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid);
    941     pcSlice->getRPS()->setNumberOfLongtermPictures(0);
     1045#if EFFICIENT_FIELD_IRAP
    9421046#if FIX1172
    9431047    if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     
    9541058    pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
    9551059#endif
    956 
     1060#endif
     1061    // Do decoding refresh marking if any
     1062#if NO_CLRAS_OUTPUT_FLAG
     1063    pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic, m_pcEncTop->getNoClrasOutputFlag());
     1064#else
     1065    pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic);
     1066#endif
     1067    m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid);
     1068    pcSlice->getRPS()->setNumberOfLongtermPictures(0);
     1069#if EFFICIENT_FIELD_IRAP
     1070#else
     1071#if FIX1172
     1072    if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     1073      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     1074      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
     1075      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     1076      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
     1077      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )  // IRAP picture
     1078    {
     1079      m_associatedIRAPType = pcSlice->getNalUnitType();
     1080      m_associatedIRAPPOC = pocCurr;
     1081    }
     1082    pcSlice->setAssociatedIRAPType(m_associatedIRAPType);
     1083    pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
     1084#endif
     1085#endif
     1086
     1087#if ALLOW_RECOVERY_POINT_AS_RAP
     1088    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP())
     1089#if EFFICIENT_FIELD_IRAP
     1090      || (isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1)
     1091#endif
     1092      )
     1093    {
     1094      pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP(), m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3);
     1095    }
     1096#else
    9571097    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false) != 0) || (pcSlice->isIRAP()))
    9581098    {
    9591099      pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP());
    9601100    }
     1101#endif
    9611102#if ALIGNED_BUMPING
    9621103    pcSlice->checkLeadingPictureRestrictions(rcListPic);
     
    18491990      pictureTimingSEI.m_auCpbRemovalDelay = std::min<Int>(std::max<Int>(1, m_totalCoded - m_lastBPSEI), static_cast<Int>(pow(2, static_cast<double>(pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getCpbRemovalDelayLengthMinus1()+1)))); // Syntax element signalled as minus, hence the .
    18501991#if POC_RESET_FLAG
    1851       pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pocCurr - m_totalCoded;
    1852 #else
    1853       pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pcSlice->getPOC() - m_totalCoded;
     1992      pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1) + pocCurr - m_totalCoded;
     1993#else
     1994      pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1) + pcSlice->getPOC() - m_totalCoded;
     1995#endif
     1996#if EFFICIENT_FIELD_IRAP
     1997      if(IRAPGOPid > 0 && IRAPGOPid < m_iGopSize)
     1998      {
     1999        // if pictures have been swapped there is likely one more picture delay on their tid. Very rough approximation
     2000        pictureTimingSEI.m_picDpbOutputDelay ++;
     2001      }
    18542002#endif
    18552003      Int factor = pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2;
     
    19752123#endif
    19762124      sei_recovery_point.m_brokenLinkFlag    = false;
     2125#if ALLOW_RECOVERY_POINT_AS_RAP
     2126      if(m_pcCfg->getDecodingRefreshType() == 3)
     2127      {
     2128        m_iLastRecoveryPicPOC = pocCurr;
     2129      }
     2130#endif
    19772131
    19782132#if O0164_MULTI_LAYER_HRD
     
    21102264          }
    21112265          m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     2266
     2267#if SETTING_NO_OUT_PIC_PRIOR
     2268          if (pcSlice->isIRAP())
     2269          {
     2270            if (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP)
     2271            {
     2272              pcSlice->setNoRaslOutputFlag(true);
     2273            }
     2274            //the inference for NoOutputPriorPicsFlag
     2275            if (!m_bFirst && pcSlice->isIRAP() && pcSlice->getNoRaslOutputFlag())
     2276            {
     2277              if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)
     2278              {
     2279                pcSlice->setNoOutputPriorPicsFlag(true);
     2280              }
     2281            }
     2282          }
     2283#endif
     2284
    21122285          tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits();
    21132286          m_pcEntropyCoder->encodeSliceHeader(pcSlice);
     
    26572830
    26582831      delete[] pcSubstreamsOut;
     2832
     2833#if EFFICIENT_FIELD_IRAP
     2834    if(IRAPtoReorder)
     2835    {
     2836      if(swapIRAPForward)
     2837      {
     2838        if(iGOPid == IRAPGOPid)
     2839        {
     2840          iGOPid = IRAPGOPid +1;
     2841          IRAPtoReorder = false;
     2842        }
     2843        else if(iGOPid == IRAPGOPid +1)
     2844        {
     2845          iGOPid --;
     2846        }
     2847      }
     2848      else
     2849      {
     2850        if(iGOPid == IRAPGOPid)
     2851        {
     2852          iGOPid = IRAPGOPid -1;
     2853        }
     2854        else if(iGOPid == IRAPGOPid -1)
     2855        {
     2856          iGOPid = IRAPGOPid;
     2857          IRAPtoReorder = false;
     2858        }
     2859      }
     2860    }
     2861#endif
    26592862  }
    26602863  delete pcBitstreamRedirect;
     
    29183121    case NAL_UNIT_CODED_SLICE_CRA:        return "CRA";
    29193122    case NAL_UNIT_CODED_SLICE_RADL_R:     return "RADL_R";
     3123    case NAL_UNIT_CODED_SLICE_RADL_N:     return "RADL_N";
    29203124    case NAL_UNIT_CODED_SLICE_RASL_R:     return "RASL_R";
     3125    case NAL_UNIT_CODED_SLICE_RASL_N:     return "RASL_N";
    29213126    case NAL_UNIT_VPS:                    return "VPS";
    29223127    case NAL_UNIT_SPS:                    return "SPS";
     
    33163521    return NAL_UNIT_CODED_SLICE_IDR_W_RADL;
    33173522  }
     3523#if EFFICIENT_FIELD_IRAP
     3524  if(isField && pocCurr == 1)
     3525  {
     3526    // to avoid the picture becoming an IRAP
     3527    return NAL_UNIT_CODED_SLICE_TRAIL_R;
     3528  }
     3529#endif
     3530
     3531#if ALLOW_RECOVERY_POINT_AS_RAP
     3532  if(m_pcCfg->getDecodingRefreshType() != 3 && (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0)
     3533#else
    33183534  if ((pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0)
     3535#endif
    33193536  {
    33203537    if (m_pcCfg->getDecodingRefreshType() == 1)
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncGOP.h

    r644 r652  
    8282  Int                     m_iNumPicCoded;
    8383  Bool                    m_bFirst;
     84#if ALLOW_RECOVERY_POINT_AS_RAP
     85  Int                     m_iLastRecoveryPicPOC;
     86#endif
    8487 
    8588  //  Access channel
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r644 r652  
    952952        for (y=0; y<endY; y++)
    953953        {
     954#if SAO_SGN_FUNC
     955          signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]);
     956#else
    954957          signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]];
     958#endif
    955959          for (x=startX; x<endX; x++)
    956960          {
     961#if SAO_SGN_FUNC
     962            signRight =  (Char)sgn(srcLine[x] - srcLine[x+1]);
     963#else
    957964            signRight =  (Char)m_sign[srcLine[x] - srcLine[x+1]];
     965#endif
    958966            edgeType  =  signRight + signLeft;
    959967            signLeft  = -signRight;
     
    975983            for(y=0; y<skipLinesB[typeIdx]; y++)
    976984            {
     985#if SAO_SGN_FUNC
     986              signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]);
     987#else
    977988              signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]];
     989#endif
    978990              for (x=startX; x<endX; x++)
    979991              {
     992#if SAO_SGN_FUNC
     993                signRight =  (Char)sgn(srcLine[x] - srcLine[x+1]);
     994#else
    980995                signRight =  (Char)m_sign[srcLine[x] - srcLine[x+1]];
     996#endif
    981997                edgeType  =  signRight + signLeft;
    982998                signLeft  = -signRight;
     
    10261042#endif
    10271043        {
     1044#if SAO_SGN_FUNC
     1045          signUpLine[x] = (Char)sgn(srcLine[x] - srcLineAbove[x]);
     1046#else
    10281047          signUpLine[x] = (Char)m_sign[srcLine[x] - srcLineAbove[x]];
     1048#endif
    10291049        }
    10301050
     
    10401060#endif
    10411061          {
     1062#if SAO_SGN_FUNC
     1063            signDown  = (Char)sgn(srcLine[x] - srcLineBelow[x]);
     1064#else
    10421065            signDown  = (Char)m_sign[srcLine[x] - srcLineBelow[x]];
     1066#endif
    10431067            edgeType  = signDown + signUpLine[x];
    10441068            signUpLine[x]= -signDown;
     
    10651089              for (x=startX; x<endX; x++)
    10661090              {
     1091#if SAO_SGN_FUNC
     1092                edgeType = sgn(srcLine[x] - srcLineBelow[x]) + sgn(srcLine[x] - srcLineAbove[x]);
     1093#else
    10671094                edgeType = m_sign[srcLine[x] - srcLineBelow[x]] + m_sign[srcLine[x] - srcLineAbove[x]];
     1095#endif
    10681096                diff [edgeType] += (orgLine[x] - srcLine[x]);
    10691097                count[edgeType] ++;
     
    11081136        for (x=startX; x<endX+1; x++)
    11091137        {
     1138#if SAO_SGN_FUNC
     1139          signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x-1]);
     1140#else
    11101141          signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x-1]];
     1142#endif
    11111143        }
    11121144
     
    11221154        for(x=firstLineStartX; x<firstLineEndX; x++)
    11231155        {
     1156#if SAO_SGN_FUNC
     1157          edgeType = sgn(srcLine[x] - srcLineAbove[x-1]) - signUpLine[x+1];
     1158#else
    11241159          edgeType = m_sign[srcLine[x] - srcLineAbove[x-1]] - signUpLine[x+1];
     1160#endif
    11251161          diff [edgeType] += (orgLine[x] - srcLine[x]);
    11261162          count[edgeType] ++;
     
    11371173          for (x=startX; x<endX; x++)
    11381174          {
     1175#if SAO_SGN_FUNC
     1176            signDown = (Char)sgn(srcLine[x] - srcLineBelow[x+1]);
     1177#else
    11391178            signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x+1]] ;
     1179#endif
    11401180            edgeType = signDown + signUpLine[x];
    11411181            diff [edgeType] += (orgLine[x] - srcLine[x]);
     
    11441184            signDownLine[x+1] = -signDown;
    11451185          }
     1186#if SAO_SGN_FUNC
     1187          signDownLine[startX] = (Char)sgn(srcLineBelow[startX] - srcLine[startX-1]);
     1188#else
    11461189          signDownLine[startX] = (Char)m_sign[srcLineBelow[startX] - srcLine[startX-1]];
     1190#endif
    11471191
    11481192          signTmpLine  = signUpLine;
     
    11681212              for (x=startX; x< endX; x++)
    11691213              {
     1214#if SAO_SGN_FUNC
     1215                edgeType = sgn(srcLine[x] - srcLineBelow[x+1]) + sgn(srcLine[x] - srcLineAbove[x-1]);
     1216#else
    11701217                edgeType = m_sign[srcLine[x] - srcLineBelow[x+1]] + m_sign[srcLine[x] - srcLineAbove[x-1]];
     1218#endif
    11711219                diff [edgeType] += (orgLine[x] - srcLine[x]);
    11721220                count[edgeType] ++;
     
    12061254        for (x=startX-1; x<endX; x++)
    12071255        {
     1256#if SAO_SGN_FUNC
     1257          signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x+1]);
     1258#else
    12081259          signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x+1]];
     1260#endif
    12091261        }
    12101262
     
    12251277        for(x=firstLineStartX; x<firstLineEndX; x++)
    12261278        {
     1279#if SAO_SGN_FUNC
     1280          edgeType = sgn(srcLine[x] - srcLineAbove[x+1]) - signUpLine[x-1];
     1281#else
    12271282          edgeType = m_sign[srcLine[x] - srcLineAbove[x+1]] - signUpLine[x-1];
     1283#endif
    12281284          diff [edgeType] += (orgLine[x] - srcLine[x]);
    12291285          count[edgeType] ++;
     
    12401296          for(x=startX; x<endX; x++)
    12411297          {
     1298#if SAO_SGN_FUNC
     1299            signDown = (Char)sgn(srcLine[x] - srcLineBelow[x-1]);
     1300#else
    12421301            signDown = (Char)m_sign[srcLine[x] - srcLineBelow[x-1]] ;
     1302#endif
    12431303            edgeType = signDown + signUpLine[x];
    12441304
     
    12481308            signUpLine[x-1] = -signDown;
    12491309          }
     1310#if SAO_SGN_FUNC
     1311          signUpLine[endX-1] = (Char)sgn(srcLineBelow[endX-1] - srcLine[endX]);
     1312#else
    12501313          signUpLine[endX-1] = (Char)m_sign[srcLineBelow[endX-1] - srcLine[endX]];
     1314#endif
    12511315          srcLine  += srcStride;
    12521316          orgLine  += orgStride;
     
    12671331              for (x=startX; x<endX; x++)
    12681332              {
     1333#if SAO_SGN_FUNC
     1334                edgeType = sgn(srcLine[x] - srcLineBelow[x-1]) + sgn(srcLine[x] - srcLineAbove[x+1]);
     1335#else
    12691336                edgeType = m_sign[srcLine[x] - srcLineBelow[x-1]] + m_sign[srcLine[x] - srcLineAbove[x+1]];
     1337#endif
    12701338                diff [edgeType] += (orgLine[x] - srcLine[x]);
    12711339                count[edgeType] ++;
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncSbac.h

    r644 r652  
    9595  Void  codeSliceHeader         ( TComSlice* pcSlice );
    9696  Void  codeTilesWPPEntryPoint( TComSlice* pSlice );
    97 #if POC_RESET_IDC_SIGNALLING
    98   Void  codeSliceHeaderExtn     ( TComSlice* pSlice, Int shBitsWrittenTillNow );
    99 #endif
    10097  Void  codeTerminatingBit      ( UInt uilsLast      );
    10198  Void  codeSliceFinish         ();
     
    108105
    109106#if SVC_EXTENSION
     107#if POC_RESET_IDC_SIGNALLING
     108  Void  codeSliceHeaderExtn     ( TComSlice* pSlice, Int shBitsWrittenTillNow );
     109#endif
    110110  Void codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled, UInt* saoMaxOffsetQVal);
    111111  Void codeSAOBlkParam(SAOBlkParam& saoBlkParam
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r595 r652  
    23982398{
    23992399  UInt    uiDepth        = pcCU->getDepth(0);
    2400   UInt    uiNumPU        = pcCU->getNumPartInter();
     2400  UInt    uiNumPU        = pcCU->getNumPartitions();
    24012401  UInt    uiInitTrDepth  = pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1;
    24022402  UInt    uiWidth        = pcCU->getWidth (0) >> uiInitTrDepth;
     
    31303130  TComMv        cMvTemp[2][33];
    31313131 
    3132   Int           iNumPart    = pcCU->getNumPartInter();
     3132  Int           iNumPart    = pcCU->getNumPartitions();
    31333133  Int           iNumPredDir = pcCU->getSlice()->isInterP() ? 1 : 2;
    31343134 
     
    46124612   
    46134613    m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] );
    4614 #if 0 // check
    4615     {
    4616       m_pcEntropyCoder->resetBits();
    4617       m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0) );
    4618       const UInt uiBitsForCoeff = m_pcEntropyCoder->getNumberOfWrittenBits();
    4619       m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] );
    4620       if( uiBitsForCoeff != uiBits )
    4621         assert( 0 );
    4622     }
    4623 #endif
     4614   
    46244615    uiBits = 0;
    46254616    {
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncSlice.cpp

    r644 r652  
    225225  Int depth;
    226226  {
     227#if FIX_FIELD_DEPTH   
     228    Int poc = rpcSlice->getPOC();
     229    if(isField)
     230    {
     231      poc = (poc/2)%(m_pcCfg->getGOPSize()/2);
     232    }
     233    else
     234    {
     235      poc = poc%m_pcCfg->getGOPSize();   
     236    }
     237#else
    227238    Int poc = rpcSlice->getPOC()%m_pcCfg->getGOPSize();
     239#endif
    228240    if ( poc == 0 )
    229241    {
     
    248260      }
    249261    }
     262#if FIX_FIELD_DEPTH 
     263#if HARMONIZE_GOP_FIRST_FIELD_COUPLE
     264    if(poc != 0)
     265    {
     266#endif
     267    if(isField && rpcSlice->getPOC()%2 == 1)
     268    {
     269      depth ++;
     270    }
     271#if HARMONIZE_GOP_FIRST_FIELD_COUPLE
     272  }
     273#endif
     274#endif
    250275  }
    251276
     
    254279
    255280  eSliceType=B_SLICE;
     281#if EFFICIENT_FIELD_IRAP
     282  if(!(isField && pocLast == 1))
     283  {
     284#endif // EFFICIENT_FIELD_IRAP
     285#if ALLOW_RECOVERY_POINT_AS_RAP
     286  if(m_pcCfg->getDecodingRefreshType() == 3)
     287  {
     288    eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0             || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType;
     289  }
     290  else
     291  {
    256292  eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType;
     293  }
     294#else
     295  eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType;
     296#endif
     297#if EFFICIENT_FIELD_IRAP
     298  }
     299#endif
    257300
    258301  rpcSlice->setSliceType    ( eSliceType );
     
    423466#if HB_LAMBDA_FOR_LDC
    424467  // restore original slice type
     468 
     469#if EFFICIENT_FIELD_IRAP
     470  if(!(isField && pocLast == 1))
     471  {
     472#endif // EFFICIENT_FIELD_IRAP
     473#if ALLOW_RECOVERY_POINT_AS_RAP
     474  if(m_pcCfg->getDecodingRefreshType() == 3)
     475  {
     476    eSliceType = (pocLast == 0 || (pocCurr)           % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType;
     477
     478  }
     479  else
     480  {
    425481  eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType;
     482  }
     483#else
     484  eSliceType = (pocLast == 0 || (pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType;
     485#endif
     486#if EFFICIENT_FIELD_IRAP
     487  }
     488#endif // EFFICIENT_FIELD_IRAP
    426489
    427490#if SVC_EXTENSION
     
    544607  // store lambda
    545608  slice->setSliceQp( sliceQP );
     609#if ADAPTIVE_QP_SELECTION
    546610  slice->setSliceQpBase ( sliceQP );
     611#endif
    547612  m_pcRdCost ->setLambda( lambda );
    548613  // for RDO
     
    10411106
    10421107      m_pcRateCtrl->setRCQP( estQP );
     1108#if ADAPTIVE_QP_SELECTION
    10431109      pcCU->getSlice()->setSliceQpBase( estQP );
     1110#endif
    10441111    }
    10451112
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncTop.h

    r644 r652  
    273273
    274274  /// encode several number of pictures until end-of-sequence
    275   Void encode( bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut,
     275  Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut,
    276276              std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, Bool isTff);
    277277
Note: See TracChangeset for help on using the changeset viewer.