Changeset 1325 in SHVCSoftware


Ignore:
Timestamp:
22 Jul 2015, 00:35:39 (9 years ago)
Author:
seregin
Message:

port rev 4403

Location:
branches/SHM-dev/source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r1324 r1325  
    12031203  ("FieldCoding",                                     m_isField,                                        false, "Signals if it's a field based coding")
    12041204  ("TopFieldFirst, Tff",                              m_isTopFieldFirst,                                false, "In case of field based coding, signals whether if it's a top field first or not")
     1205  ("EfficientFieldIRAPEnabled",                       m_bEfficientFieldIRAPEnabled,                      true, "Enable to code fields in a specific, potentially more efficient, order.")
    12051206
    12061207  // Profile and level
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r1324 r1325  
    8888  Bool      m_isField;                                        ///< enable field coding
    8989  Bool      m_isTopFieldFirst;
     90  Bool      m_bEfficientFieldIRAPEnabled;                     ///< enable an efficient field IRAP structure.
    9091#else
    9192  Char*     m_pchInputFile;                                   ///< source file name
     
    103104  Bool      m_isField;                                        ///< enable field coding
    104105  Bool      m_isTopFieldFirst;
     106  Bool      m_bEfficientFieldIRAPEnabled;                     ///< enable an efficient field IRAP structure.
    105107
    106108  Int       m_conformanceWindowMode;
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1324 r1325  
    716716    m_acTEncTop[layer].setLog2MaxMvLengthVertical               ( m_log2MaxMvLengthVertical );
    717717    m_acTEncTop[layer].setElRapSliceTypeB                       (layer == 0? 0 : m_elRapSliceBEnabled);
     718    m_acTEncTop[layer].setEfficientFieldIRAPEnabled             ( m_bEfficientFieldIRAPEnabled );
    718719
    719720    if( layer > 0 )
     
    10871088  m_cTEncTop.setLog2MaxMvLengthHorizontal                         ( m_log2MaxMvLengthHorizontal );
    10881089  m_cTEncTop.setLog2MaxMvLengthVertical                           ( m_log2MaxMvLengthVertical );
     1090  m_cTEncTop.setEfficientFieldIRAPEnabled                         ( m_bEfficientFieldIRAPEnabled );
    10891091}
    10901092#endif //SVC_EXTENSION
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1319 r1325  
    864864}
    865865
    866 Void TComSlice::decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag)
     866Void TComSlice::decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, const bool bEfficientFieldIRAPEnabled)
    867867#else
    868 Void TComSlice::decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic)
     868Void TComSlice::decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, const bool bEfficientFieldIRAPEnabled)
    869869#endif
    870870{
     
    915915      pocCRA = pocCurr;
    916916    }
    917 #if EFFICIENT_FIELD_IRAP
    918     bRefreshPending = true;
    919 #endif
     917    if (bEfficientFieldIRAPEnabled)
     918    {
     919      bRefreshPending = true;
     920    }
    920921  }
    921922  else // CRA or No DR
    922923  {
    923 #if EFFICIENT_FIELD_IRAP
    924     if(getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
     924    if(bEfficientFieldIRAPEnabled && (getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL))
    925925    {
    926926      if (bRefreshPending==true && pocCurr > m_iLastIDR) // IDR reference marking pending
     
    941941    else
    942942    {
    943 #endif
    944943      if (bRefreshPending==true && pocCurr > pocCRA) // CRA reference marking pending
    945944      {
     
    956955        bRefreshPending = false;
    957956      }
    958 #if EFFICIENT_FIELD_IRAP
    959     }
    960 #endif
     957    }
    961958    if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found
    962959    {
     
    16641661*/
    16651662#if ALLOW_RECOVERY_POINT_AS_RAP
    1666 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint)
     1663Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint, const Bool bEfficientFieldIRAPEnabled)
    16671664#else
    1668 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP)
     1665Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP, const Bool bEfficientFieldIRAPEnabled)
    16691666#endif
    16701667{
     
    16751672  Int nrOfPositivePictures = 0;
    16761673  TComReferencePictureSet* pcRPS = this->getLocalRPS();
    1677 #if EFFICIENT_FIELD_IRAP
    1678   Bool irapIsInRPS = false;
    1679 #endif
     1674  Bool irapIsInRPS = false; // Used when bEfficientFieldIRAPEnabled==true
    16801675#if SVC_POC
    16811676  Bool pocsAdjusted = false;
     
    17141709#endif
    17151710        pcRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP));
    1716 #if ALLOW_RECOVERY_POINT_AS_RAP
     1711        if (bEfficientFieldIRAPEnabled)
     1712        {
    17171713#if SVC_POC
    1718         pcRPS->setUsed(k, pcRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + deltaPOC < pocRandomAccess) );
     1714          pcRPS->setUsed(k, pcRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + deltaPOC < pocRandomAccess) );
    17191715#else
    1720         pcRPS->setUsed(k, pcRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) );
    1721 #endif
    1722 #endif
     1716          pcRPS->setUsed(k, pcRPS->getUsed(k) && !(bUseRecoveryPoint && this->getPOC() > pocRandomAccess && this->getPOC() + pReferencePictureSet->getDeltaPOC(i) < pocRandomAccess) );
     1717#endif
     1718        }
     1719
    17231720        if(pcRPS->getDeltaPOC(k) < 0)
    17241721        {
     
    17271724        else
    17281725        {
    1729 #if EFFICIENT_FIELD_IRAP
    1730           if(rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC()+1)
     1726          if(bEfficientFieldIRAPEnabled && rpcPic->getPicSym()->getSlice(0)->getPOC() == this->getAssociatedIRAPPOC() && this->getAssociatedIRAPPOC() == this->getPOC()+1)
    17311727          {
    17321728            irapIsInRPS = true;
    17331729          }
    1734 #endif
    17351730          nrOfPositivePictures++;
    17361731        }
     
    17401735  }
    17411736
    1742 #if EFFICIENT_FIELD_IRAP
    17431737  Bool useNewRPS = false;
    17441738  // if current picture is complimentary field associated to IRAP, add the IRAP to its RPS.
    1745   if(m_pcPic->isField() && !irapIsInRPS)
     1739  if(bEfficientFieldIRAPEnabled && m_pcPic->isField() && !irapIsInRPS)
    17461740  {
    17471741    TComList<TComPic*>::iterator iterPic = rcListPic.begin();
     
    17591753    }
    17601754  }
    1761 #endif
    17621755  pcRPS->setNumberOfNegativePictures(nrOfNegativePictures);
    17631756  pcRPS->setNumberOfPositivePictures(nrOfPositivePictures);
     
    17661759  // inter RPS prediction with.  Here we just use the reference used by pReferencePictureSet.
    17671760  // If pReferencePictureSet is not inter_RPS_predicted, then inter_RPS_prediction is for the current RPS also disabled.
    1768   if (!pReferencePictureSet->getInterRPSPrediction()
    1769 #if EFFICIENT_FIELD_IRAP
    1770     || useNewRPS
    1771 #endif
     1761  if (!pReferencePictureSet->getInterRPSPrediction() || useNewRPS
    17721762#if SVC_POC
    17731763    || pocsAdjusted  // inter RPS prediction does not work if POCs have been adjusted
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1319 r1325  
    489489  Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; }
    490490
     491  Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)
     492  {
     493    m_enabledFlag     = true;
     494    m_winLeftOffset   = offsetLeft;
     495    m_winRightOffset  = offsetLRight;
     496    m_winTopOffset    = offsetLTop;
     497    m_winBottomOffset = offsetLBottom;
     498  }
     499
    491500#if SVC_EXTENSION
    492501  Bool hasEqualOffset(const Window& ref) const
     
    499508#endif
    500509
    501  Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)
    502   {
    503     m_enabledFlag     = true;
    504     m_winLeftOffset   = offsetLeft;
    505     m_winRightOffset  = offsetLRight;
    506     m_winTopOffset    = offsetLTop;
    507     m_winBottomOffset = offsetLBottom;
    508   }
    509510};
     511
     512
    510513
    511514#if SVC_EXTENSION
     
    22192222#if NO_CLRAS_OUTPUT_FLAG
    22202223  Void                        decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId = 0 );
    2221   Void                        decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag);
     2224  Void                        decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, const bool bEfficientFieldIRAPEnabled, Bool noClrasOutputFlag);
    22222225#else
    2223   Void                        decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic);
     2226  Void                        decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, const bool bEfficientFieldIRAPEnabled);
    22242227#endif
    22252228  Void                        setSliceType( SliceType e )                            { m_eSliceType        = e;                                      }
     
    23062309#if ALLOW_RECOVERY_POINT_AS_RAP
    23072310  Int                         checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);
    2308   Void                        createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);
     2311  Void                        createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint, const Bool bEfficientFieldIRAPEnabled);
    23092312#else
    23102313  Int                         checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0);
    2311   Void                        createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP);
     2314  Void                        createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP, const Bool bEfficientFieldIRAPEnabled);
    23122315#endif
    23132316  Void                        setMaxNumMergeCand(UInt val )                          { m_maxNumMergeCand = val;                                      }
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1324 r1325  
    165165
    166166#define HARMONIZE_GOP_FIRST_FIELD_COUPLE                  1
    167 #define EFFICIENT_FIELD_IRAP                              1
    168167#define ALLOW_RECOVERY_POINT_AS_RAP                       1
    169168#define BUGFIX_INTRAPERIOD                                1
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1324 r1325  
    370370
    371371  Bool      m_useStrongIntraSmoothing;                        ///< enable the use of strong intra smoothing (bi_linear interpolation) for 32x32 blocks when reference samples are flat.
     372  Bool      m_bEfficientFieldIRAPEnabled;                     ///< enable to code fields in a specific, potentially more efficient, order.
     373
    372374#if SVC_EXTENSION
    373375  UInt      m_layerId;   
     
    896898  Bool         getUseStrongIntraSmoothing ()                         { return m_useStrongIntraSmoothing; }
    897899
     900  Void         setEfficientFieldIRAPEnabled( Bool b )                { m_bEfficientFieldIRAPEnabled = b; }
     901  Bool         getEfficientFieldIRAPEnabled( ) const                 { return m_bEfficientFieldIRAPEnabled; }
     902
    898903  Void         setActiveParameterSetsSEIEnabled ( Int b )            { m_activeParameterSetsSEIEnabled = b; }
    899904  Int          getActiveParameterSetsSEIEnabled ()                   { return m_activeParameterSetsSEIEnabled; }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1321 r1325  
    997997    pictureTimingSEI->m_auCpbRemovalDelay = std::min<Int>(std::max<Int>(1, m_totalCoded - m_lastBPSEI), static_cast<Int>(pow(2, static_cast<Double>(hrd->getCpbRemovalDelayLengthMinus1()+1)))); // Syntax element signalled as minus, hence the .
    998998    pictureTimingSEI->m_picDpbOutputDelay = slice->getSPS()->getNumReorderPics(slice->getSPS()->getMaxTLayers()-1) + slice->getPOC() - m_totalCoded;
    999 #if EFFICIENT_FIELD_IRAP
    1000     if(IRAPGOPid > 0 && IRAPGOPid < m_iGopSize)
     999    if(m_pcCfg->getEfficientFieldIRAPEnabled() && IRAPGOPid > 0 && IRAPGOPid < m_iGopSize)
    10011000    {
    10021001      // if pictures have been swapped there is likely one more picture delay on their tid. Very rough approximation
    10031002      pictureTimingSEI->m_picDpbOutputDelay ++;
    10041003    }
    1005 #endif
    10061004    Int factor = hrd->getTickDivisorMinus2() + 2;
    10071005    pictureTimingSEI->m_picDpbOutputDuDelay = factor * pictureTimingSEI->m_picDpbOutputDelay;
     
    12851283}
    12861284
    1287 #if EFFICIENT_FIELD_IRAP
    12881285class EfficientFieldIRAPMapping
    12891286{
     
    13001297    { }
    13011298
     1299#if SVC_EXTENSION
    13021300    Void initialize(const Bool isField, const Int picIdInGOP, const Int gopSize, const Int POCLast, const Int numPicRcvd, const Int lastIDR, TEncGOP *pEncGop, TEncCfg *pCfg);
     1301#else
     1302    Void initialize(const Bool isField, const Int gopSize, const Int POCLast, const Int numPicRcvd, const Int lastIDR, TEncGOP *pEncGop, TEncCfg *pCfg);
     1303#endif
    13031304
    13041305    Int adjustGOPid(const Int gopID);
     
    14221423}
    14231424
    1424 #endif
    14251425
    14261426static UInt calculateCollocatedFromL1Flag(TEncCfg *pCfg, const Int GOPid, const Int gopSize)
     
    15041504  SEIDecodingUnitInfo decodingUnitInfoSEI;
    15051505
    1506 #if EFFICIENT_FIELD_IRAP
    15071506  EfficientFieldIRAPMapping effFieldIRAPMap;
     1507  if (m_pcCfg->getEfficientFieldIRAPEnabled())
     1508  {
    15081509#if SVC_EXTENSION
    1509   effFieldIRAPMap.initialize(isField, iPicIdInGOP, m_iGopSize, iPOCLast, iNumPicRcvd, m_iLastIDR, this, m_pcCfg);
    1510 #else
    1511   effFieldIRAPMap.initialize(isField, m_iGopSize, iPOCLast, iNumPicRcvd, m_iLastIDR, this, m_pcCfg);
    1512 #endif
    1513 #endif
     1510    effFieldIRAPMap.initialize(isField, iPicIdInGOP, m_iGopSize, iPOCLast, iNumPicRcvd, m_iLastIDR, this, m_pcCfg);
     1511#else
     1512    effFieldIRAPMap.initialize(isField, m_iGopSize, iPOCLast, iNumPicRcvd, m_iLastIDR, this, m_pcCfg);
     1513#endif
     1514  }
    15141515
    15151516  // reset flag indicating whether pictures have been encoded
     
    15241525#endif
    15251526  {
    1526 #if EFFICIENT_FIELD_IRAP
    1527     iGOPid=effFieldIRAPMap.adjustGOPid(iGOPid);
    1528 #endif
     1527    if (m_pcCfg->getEfficientFieldIRAPEnabled())
     1528    {
     1529      iGOPid=effFieldIRAPMap.adjustGOPid(iGOPid);
     1530    }
    15291531
    15301532    //-- For time output for each slice
     
    15551557    if(pocCurr>=m_pcCfg->getFramesToBeEncoded())
    15561558    {
    1557 #if EFFICIENT_FIELD_IRAP
    1558       iGOPid=effFieldIRAPMap.restoreGOPid(iGOPid);
    1559 #endif
     1559      if (m_pcCfg->getEfficientFieldIRAPEnabled())
     1560      {
     1561        iGOPid=effFieldIRAPMap.restoreGOPid(iGOPid);
     1562      }
    15601563      continue;
    15611564    }
     
    18981901      }
    18991902    }
    1900 
    1901 #if EFFICIENT_FIELD_IRAP
    1902     if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
    1903       || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    1904       || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
    1905       || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    1906       || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
    1907       || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )  // IRAP picture
    1908     {
    1909       m_associatedIRAPType = pcSlice->getNalUnitType();
     1903    if (m_pcCfg->getEfficientFieldIRAPEnabled())
     1904    {
     1905      if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     1906        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     1907        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
     1908        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     1909        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
     1910        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )  // IRAP picture
     1911      {
     1912        m_associatedIRAPType = pcSlice->getNalUnitType();
    19101913#if SVC_POC
    1911       m_associatedIRAPPOC = pcSlice->getPOC();
    1912       m_associatedIrapPocBeforeReset = pocCurr;
    1913 #else
    1914       m_associatedIRAPPOC = pocCurr;
    1915 #endif
    1916     }
    1917     pcSlice->setAssociatedIRAPType(m_associatedIRAPType);
    1918     pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
     1914        m_associatedIRAPPOC = pcSlice->getPOC();
     1915        m_associatedIrapPocBeforeReset = pocCurr;
     1916#else
     1917        m_associatedIRAPPOC = pocCurr;
     1918#endif
     1919      }
     1920      pcSlice->setAssociatedIRAPType(m_associatedIRAPType);
     1921      pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
    19191922#if SVC_POC
    1920     pcSlice->setAssociatedIrapPocBeforeReset(m_associatedIrapPocBeforeReset);
    1921 #endif
    1922 #endif
     1923      pcSlice->setAssociatedIrapPocBeforeReset(m_associatedIrapPocBeforeReset);
     1924#endif
     1925    }
    19231926    // Do decoding refresh marking if any
    19241927#if NO_CLRAS_OUTPUT_FLAG
    1925     pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic, m_pcEncTop->getNoClrasOutputFlag());
    1926 #else
    1927     pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic);
     1928    pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic, m_pcCfg->getEfficientFieldIRAPEnabled(), m_pcEncTop->getNoClrasOutputFlag());
     1929#else
     1930    pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic, m_pcCfg->getEfficientFieldIRAPEnabled());
    19281931#endif
    19291932#if SVC_POC
     
    19331936    m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid);
    19341937    pcSlice->getRPS()->setNumberOfLongtermPictures(0);
    1935 #if !EFFICIENT_FIELD_IRAP
    1936     if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
    1937       || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    1938       || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
    1939       || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    1940       || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
    1941       || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )  // IRAP picture
    1942     {
    1943       m_associatedIRAPType = pcSlice->getNalUnitType();
    1944       m_associatedIRAPPOC = pocCurr;
    1945     }
    1946     pcSlice->setAssociatedIRAPType(m_associatedIRAPType);
    1947     pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
    1948 #endif
     1938    if (!m_pcCfg->getEfficientFieldIRAPEnabled())
     1939    {
     1940      if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     1941        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     1942        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
     1943        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     1944        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
     1945        || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )  // IRAP picture
     1946      {
     1947        m_associatedIRAPType = pcSlice->getNalUnitType();
     1948        m_associatedIRAPPOC = pocCurr;
     1949      }
     1950      pcSlice->setAssociatedIRAPType(m_associatedIRAPType);
     1951      pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
     1952    }
    19491953
    19501954#if ALLOW_RECOVERY_POINT_AS_RAP
    19511955    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP())
    1952 #if EFFICIENT_FIELD_IRAP
    1953       || (isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1)
    1954 #endif
     1956      || (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1)
    19551957      )
    19561958    {
    1957       pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP(), m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3);
     1959      pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP(), m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3, m_pcCfg->getEfficientFieldIRAPEnabled());
    19581960    }
    19591961#else
    19601962    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false) != 0) || (pcSlice->isIRAP()))
    19611963    {
    1962       pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP());
     1964      pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP(), m_pcCfg->getEfficientFieldIRAPEnabled());
    19631965    }
    19641966#endif
     
    28382840    }
    28392841
    2840 #if EFFICIENT_FIELD_IRAP
    2841     xCreatePictureTimingSEI(effFieldIRAPMap.GetIRAPGOPid(), leadingSeiMessages, nestedSeiMessages, duInfoSeiMessages, pcSlice, isField, duData);
    2842 #else
    2843     xCreatePictureTimingSEI(0, leadingSeiMessages, nestedSeiMessages, duInfoSeiMessages, pcSlice, isField, duData);
    2844 #endif
     2842    xCreatePictureTimingSEI(m_pcCfg->getEfficientFieldIRAPEnabled()?effFieldIRAPMap.GetIRAPGOPid():0, leadingSeiMessages, nestedSeiMessages, duInfoSeiMessages, pcSlice, isField, duData);
    28452843    if (m_pcCfg->getScalableNestingSEIEnabled())
    28462844    {
     
    28942892    fflush(stdout);
    28952893
    2896 #if EFFICIENT_FIELD_IRAP
    2897     iGOPid=effFieldIRAPMap.restoreGOPid(iGOPid);
    2898 #endif
     2894    if (m_pcCfg->getEfficientFieldIRAPEnabled())
     2895    {
     2896      iGOPid=effFieldIRAPMap.restoreGOPid(iGOPid);
     2897    }
    28992898  } // iGOPid-loop
    29002899
     
    34773476  }
    34783477
    3479 #if EFFICIENT_FIELD_IRAP
    3480   if(isField && pocCurr == 1)
     3478  if(m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pocCurr == 1)
    34813479  {
    34823480    // to avoid the picture becoming an IRAP
    34833481    return NAL_UNIT_CODED_SLICE_TRAIL_R;
    34843482  }
    3485 #endif
    34863483
    34873484#if ALLOW_RECOVERY_POINT_AS_RAP
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp

    r1318 r1325  
    306306
    307307  eSliceType=B_SLICE;
    308 #if EFFICIENT_FIELD_IRAP
    309   if(!(isField && pocLast == 1))
    310   {
    311 #endif // EFFICIENT_FIELD_IRAP
     308  if(!(isField && pocLast == 1) || !m_pcCfg->getEfficientFieldIRAPEnabled())
     309  {
    312310#if ALLOW_RECOVERY_POINT_AS_RAP
    313311    if(m_pcCfg->getDecodingRefreshType() == 3)
     
    322320    }
    323321#endif
    324 #if EFFICIENT_FIELD_IRAP
    325   }
    326 #endif
     322  }
    327323
    328324  rpcSlice->setSliceType    ( eSliceType );
     
    456452  // restore original slice type
    457453
    458 #if EFFICIENT_FIELD_IRAP
    459   if(!(isField && pocLast == 1))
    460   {
    461 #endif // EFFICIENT_FIELD_IRAP
     454  if(!(isField && pocLast == 1) || !m_pcCfg->getEfficientFieldIRAPEnabled())
     455  {
    462456#if ALLOW_RECOVERY_POINT_AS_RAP
    463457    if(m_pcCfg->getDecodingRefreshType() == 3)
     
    472466    }
    473467#endif
    474 #if EFFICIENT_FIELD_IRAP
    475   }
    476 #endif // EFFICIENT_FIELD_IRAP
     468  }
    477469
    478470#if SVC_EXTENSION
Note: See TracChangeset for help on using the changeset viewer.