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


Ignore:
Timestamp:
21 Oct 2013, 13:41:29 (12 years ago)
Author:
seregin
Message:

reintegrate SHM-3.1-dev branch

Location:
trunk
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

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

    r352 r442  
    5757
    5858#if SVC_EXTENSION
    59 #define NV_VERSION        "3.0.1"                 ///< Current software version
    60 #else
    61 #define NV_VERSION        "11.0"                ///< Current software version
     59#define NV_VERSION        "3.1"                 ///< Current software version
     60#else
     61#define NV_VERSION        "12.0"                ///< Current software version
    6262#endif
    6363
  • trunk/source/Lib/TLibCommon/SEI.h

    r313 r442  
    7575    LAYERS_PRESENT                       = 137,
    7676#endif
     77#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     78    INTER_LAYER_CONSTRAINED_TILE_SETS    = 138
     79#endif
    7780  };
    7881 
     
    381384};
    382385
     386#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     387class SEIInterLayerConstrainedTileSets : public SEI
     388{
     389public:
     390  PayloadType payloadType() const { return INTER_LAYER_CONSTRAINED_TILE_SETS; }
     391
     392  SEIInterLayerConstrainedTileSets() {}
     393  virtual ~SEIInterLayerConstrainedTileSets() {}
     394
     395  Bool m_ilAllTilesExactSampleValueMatchFlag;
     396  Bool m_ilOneTilePerTileSetFlag;
     397  UInt m_ilNumSetsInMessageMinus1;
     398  Bool m_skippedTileSetPresentFlag;
     399  UInt m_ilctsId[256];
     400  UInt m_ilNumTileRectsInSetMinus1[256];
     401  UInt m_ilTopLeftTileIndex[256][440];
     402  UInt m_ilBottomRightTileIndex[256][440];
     403  UInt m_ilcIdc[256];
     404  Bool m_ilExactSampleValueMatchFlag[256];
     405  UInt m_allTilesIlcIdc;
     406};
     407#endif
     408
     409
    383410typedef std::list<SEI*> SEIMessages;
    384411
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r345 r442  
    12731273  UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();
    12741274 
     1275#if REPN_FORMAT_IN_VPS
     1276  if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getPicWidthInLumaSamples() )
     1277#else
    12751278  if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )
     1279#endif
    12761280  {
    12771281    uiARPartUnitIdx = MAX_UINT;
     
    13351339  UInt uiAbsZorderCUIdxLB = g_auiZscanToRaster[ m_uiAbsIdxInLCU ] + (m_puhHeight[0] / m_pcPic->getMinCUHeight() - 1)*m_pcPic->getNumPartInWidth();
    13361340  UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();
    1337  
     1341
     1342#if REPN_FORMAT_IN_VPS
     1343  if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getPicHeightInLumaSamples() )
     1344#else
    13381345  if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() )
     1346#endif
    13391347  {
    13401348    uiBLPartUnitIdx = MAX_UINT;
     
    13841392  UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();
    13851393 
     1394#if REPN_FORMAT_IN_VPS
     1395  if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getPicHeightInLumaSamples())
     1396#else
    13861397  if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples())
     1398#endif
    13871399  {
    13881400    uiBLPartUnitIdx = MAX_UINT;
     
    14321444  UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();
    14331445 
     1446#if REPN_FORMAT_IN_VPS
     1447  if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getPicWidthInLumaSamples() )
     1448#else
    14341449  if( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )
     1450#endif
    14351451  {
    14361452    uiARPartUnitIdx = MAX_UINT;
     
    17031719{
    17041720  // check BL mode
    1705   UInt          uiCUAddrBase, uiAbsPartAddrBase;
     1721  UInt          uiCUAddrBase = 0, uiAbsPartAddrBase = 0;
    17061722  // the right reference layerIdc should be specified, currently it is set to m_layerId-1
    1707   TComDataCU*   pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase );
     1723  TComDataCU*   pcTempCU = getBaseColCU(m_layerId - 1, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase, 0 );
    17081724
    17091725  if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA )
     
    26842700    Int uiLCUIdx = -1;
    26852701
     2702#if REPN_FORMAT_IN_VPS
     2703    if      ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getPicWidthInLumaSamples() )  // image boundary check
     2704    {
     2705    }
     2706    else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getPicHeightInLumaSamples() )
     2707    {
     2708    }
     2709#else
    26862710    if      ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )  // image boundary check
    26872711    {
     
    26902714    {
    26912715    }
     2716#endif
    26922717    else
    26932718    {
     
    30203045    uiAbsPartIdx = g_auiZscanToRaster[uiPartIdxRB];
    30213046    Int uiLCUIdx = -1;
     3047#if REPN_FORMAT_IN_VPS
     3048    if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdx] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getPicWidthInLumaSamples() )  // image boundary check
     3049    {
     3050    }
     3051    else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdx] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getPicHeightInLumaSamples() )
     3052    {
     3053    }
     3054#else
    30223055    if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdx] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )  // image boundary check
    30233056    {
     
    30263059    {
    30273060    }
     3061#endif
    30283062    else
    30293063    {
     
    30953129  Int  iMvShift = 2;
    30963130  Int iOffset = 8;
     3131#if REPN_FORMAT_IN_VPS
     3132  Int iHorMax = ( m_pcSlice->getPicWidthInLumaSamples() + iOffset - m_uiCUPelX - 1 ) << iMvShift;
     3133#else
    30973134  Int iHorMax = ( m_pcSlice->getSPS()->getPicWidthInLumaSamples() + iOffset - m_uiCUPelX - 1 ) << iMvShift;
     3135#endif
    30983136  Int iHorMin = (       -(Int)g_uiMaxCUWidth - iOffset - (Int)m_uiCUPelX + 1 ) << iMvShift;
    30993137 
     3138#if REPN_FORMAT_IN_VPS
     3139  Int iVerMax = ( m_pcSlice->getPicHeightInLumaSamples() + iOffset - m_uiCUPelY - 1 ) << iMvShift;
     3140#else
    31003141  Int iVerMax = ( m_pcSlice->getSPS()->getPicHeightInLumaSamples() + iOffset - m_uiCUPelY - 1 ) << iMvShift;
     3142#endif
    31013143  Int iVerMin = (       -(Int)g_uiMaxCUHeight - iOffset - (Int)m_uiCUPelY + 1 ) << iMvShift;
    31023144 
     
    39463988}
    39473989
    3948 #if SVC_COL_BLK
    3949 TComDataCU*  TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )
    3950 {
    3951 #if 1 // it should provide identical resutls
     3990#if SVC_EXTENSION
     3991TComDataCU*  TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping )
     3992{
    39523993  UInt uiPelX = getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiCuAbsPartIdx] ];
    39533994  UInt uiPelY = getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiCuAbsPartIdx] ];
    39543995
    3955   return getBaseColCU( refLayerIdc, uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase );
    3956 #else
    3957   TComPic* cBaseColPic = m_pcSlice->getBaseColPic();
    3958 
    3959 #if SVC_UPSAMPLING
    3960   Int widthBL   = cBaseColPic->getPicYuvRec()->getWidth () - cBaseColPic->getPicYuvRec()->getPicCropLeftOffset() - cBaseColPic->getPicYuvRec()->getPicCropRightOffset();
    3961   Int heightBL  = cBaseColPic->getPicYuvRec()->getHeight() - cBaseColPic->getPicYuvRec()->getPicCropTopOffset() - cBaseColPic->getPicYuvRec()->getPicCropBottomOffset();
    3962 
    3963   Int widthEL   = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset();
    3964   Int heightEL  = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset();
    3965 #else
    3966   Int widthBL   = cBaseColPic->getPicYuvRec()->getWidth();
    3967   Int heightBL  = cBaseColPic->getPicYuvRec()->getHeight();
    3968 
    3969   Int widthEL   = m_pcPic->getPicYuvRec()->getWidth();
    3970   Int heightEL  = m_pcPic->getPicYuvRec()->getHeight();
    3971 #endif
    3972 
    3973   if (widthBL == widthEL && heightEL == heightBL)
    3974   {
    3975     uiAbsPartIdxBase = uiCuAbsPartIdx + m_uiAbsIdxInLCU;
    3976     uiCUAddrBase = m_uiCUAddr;
    3977   }
    3978   else
    3979   {
    3980     UInt uiMinUnitSize = m_pcPic->getMinCUWidth();
    3981     UInt uiRasterAddr  = g_auiZscanToRaster[uiCuAbsPartIdx];
    3982     UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();
    3983 
    3984     Int iEX = m_uiCUPelX + uiMinUnitSize*(uiRasterAddr%uiNumPartInCUWidth);
    3985     Int iEY = m_uiCUPelY + uiMinUnitSize*(uiRasterAddr/uiNumPartInCUWidth);
    3986 
    3987     Int iBX = (iEX*widthBL + widthEL/2)/widthEL;
    3988     Int iBY = (iEY*heightBL+ heightEL/2)/heightEL;
    3989 
    3990     uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth);
    3991 
    3992     assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame());
    3993    
    3994     UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*cBaseColPic->getNumPartInWidth()
    3995                           + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize;
    3996 
    3997     uiAbsPartIdxBase = g_auiRasterToZscan[uiRasterAddrBase];
    3998   }
    3999 
    4000   return cBaseColPic->getCU(uiCUAddrBase);
    4001 #endif
    4002 }
    4003 
    4004 TComDataCU*  TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )
     3996  return getBaseColCU( refLayerIdc, uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase, iMotionMapping );
     3997}
     3998
     3999TComDataCU*  TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping )
    40054000{
    40064001  TComPic* cBaseColPic = m_pcSlice->getBaseColPic(refLayerIdc);
    4007 
    4008 #if !SIMPLIFIED_MV_POS_SCALING
    4009 #if SVC_UPSAMPLING && !ILP_DECODED_PICTURE
    4010   const Window &confBL = cBaseColPic->getPicYuvRec()->getConformanceWindow();
    4011   const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow();
    4012 
    4013   Int widthBL   = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    4014   Int heightBL  = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    4015 
    4016   Int widthEL   = m_pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    4017   Int heightEL  = m_pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    4018 #else
    4019   Int widthBL   = cBaseColPic->getPicYuvRec()->getWidth();
    4020   Int heightBL  = cBaseColPic->getPicYuvRec()->getHeight();
    4021 
    4022   Int widthEL   = m_pcPic->getPicYuvRec()->getWidth();
    4023   Int heightEL  = m_pcPic->getPicYuvRec()->getHeight();
    4024 #endif
    4025 #endif
    40264002
    40274003  uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX);
     
    40304006  UInt uiMinUnitSize = m_pcPic->getMinCUWidth();
    40314007
    4032 #if SIMPLIFIED_MV_POS_SCALING
    40334008#if SCALED_REF_LAYER_OFFSETS
    40344009  Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset();
     
    40404015  Int iBY = (uiPelY*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;
    40414016#endif
    4042 #else
    4043   Int iBX = (uiPelX*widthBL + widthEL/2)/widthEL;
    4044   Int iBY = (uiPelY*heightBL+ heightEL/2)/heightEL;
    4045 #endif
    40464017
    40474018#if N0139_POSITION_ROUNDING_OFFSET
    4048   iBX += 4;
    4049   iBY += 4;
     4019  if( iMotionMapping == 1 )
     4020  {
     4021    iBX += 4;
     4022    iBY += 4;
     4023  }
    40504024#endif
    40514025
     
    40604034  }
    40614035
    4062 #if AVC_SYNTAX && !ILP_DECODED_PICTURE
    4063 #if !ILP_DECODED_PICTURE
    4064   const Window &confBL = cBaseColPic->getPicYuvRec()->getConformanceWindow();
    4065   const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow();
    4066 
    4067   Int widthBL   = m_pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    4068   Int heightBL  = m_pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    4069 #endif
    4070   if( iBX >= widthBL || iBY >= heightBL ) //outside of the reference layer cropped picture
    4071   {
    4072     return NULL;
    4073   }
    4074 #endif
    4075 
    40764036  uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth);
    40774037
     
    40904050  TComMvField cMvFieldBase;
    40914051  TComMv cMv;
    4092 #if SIMPLIFIED_MV_POS_SCALING
     4052
    40934053  cMv = rcMvFieldBase.getMv().scaleMv( g_mvScalingFactor[refLayerIdc][0], g_mvScalingFactor[refLayerIdc][1] );
    4094 #else
    4095   const Window &confBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow();
    4096   const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow();
    4097 
    4098   Int widthBL   = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    4099   Int heightBL  = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    4100 
    4101   Int widthEL   = m_pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    4102   Int heightEL  = m_pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    4103 
    4104   Int iMvX = (rcMvFieldBase.getHor()*widthEL + (widthBL/2 -1) * (rcMvFieldBase.getHor() > 0 ? 1: -1) )/widthBL;
    4105   Int iMvY = (rcMvFieldBase.getVer()*heightEL + (heightBL/2 -1) * (rcMvFieldBase.getVer() > 0 ? 1: -1) )/heightBL;
    4106 
    4107   cMv.set(iMvX, iMvY);
    4108 #endif
    41094054
    41104055  rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() );
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r345 r442  
    516516  UInt&         getTotalBins            ()                            { return m_uiTotalBins;                                                                                                  }
    517517
    518 #if REF_IDX_FRAMEWORK
     518#if SVC_EXTENSION
    519519#if FAST_INTRA_SHVC
    520520  Int           reduceSetOfIntraModes              (  UInt   uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes );
     
    538538  UInt          getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra);
    539539
    540 #if REF_IDX_FRAMEWORK
    541 #if SVC_COL_BLK
    542   TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );
    543   TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );
     540#if SVC_EXTENSION
     541  TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping = 0 );
     542  TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping = 0 );
    544543  Void          scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase );
    545 #endif
    546544#endif
    547545};
  • trunk/source/Lib/TLibCommon/TComLoopFilter.cpp

    r313 r442  
    180180      UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsZorderIdx] ];
    181181      UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsZorderIdx] ];
     182#if REPN_FORMAT_IN_VPS
     183      if( ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) )
     184#else
    182185      if( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) )
     186#endif
    183187      {
    184188        xDeblockCU( pcCU, uiAbsZorderIdx, uiDepth+1, Edge );
  • trunk/source/Lib/TLibCommon/TComMv.h

    r313 r442  
    4040
    4141#include "CommonDef.h"
     42#include <cstdlib>
    4243
    4344//! \ingroup TLibCommon
     
    149150    return TComMv( mvx, mvy );
    150151  }
    151 #if SIMPLIFIED_MV_POS_SCALING
     152#if SVC_EXTENSION
    152153  const TComMv scaleMv( Int iScaleX, Int iScaleY ) const
    153154  {
  • trunk/source/Lib/TLibCommon/TComPic.cpp

    r313 r442  
    5353, m_bUsedByCurr                           (false)
    5454, m_bIsLongTerm                           (false)
    55 , m_bIsUsedAsLongTerm                     (false)
    5655, m_apcPicSym                             (NULL)
    5756, m_pcPicYuvPred                          (NULL)
     
    213212  UInt maxNumSUInLCU = getNumPartInCU();
    214213  UInt numLCUInPic   = getNumCUsInFrame();
     214#if REPN_FORMAT_IN_VPS
     215  UInt picWidth      = getSlice(0)->getPicWidthInLumaSamples();
     216  UInt picHeight     = getSlice(0)->getPicHeightInLumaSamples();
     217#else
    215218  UInt picWidth      = getSlice(0)->getSPS()->getPicWidthInLumaSamples();
    216219  UInt picHeight     = getSlice(0)->getSPS()->getPicHeightInLumaSamples();
     220#endif
    217221  Int  numLCUsInPicWidth = getFrameWidthInCU();
    218222  Int  numLCUsInPicHeight= getFrameHeightInCU();
     
    524528}
    525529
    526 #if REF_IDX_FRAMEWORK
     530#if SVC_EXTENSION
    527531Void copyOnetoOnePicture(    // SVC_NONCOLL
    528532                  Pel *in,       
     
    570574Void TComPic::copyUpsampledMvField(UInt refLayerIdc, TComPic* pcPicBase)
    571575{
    572 #if AVC_SYNTAX && !ILP_DECODED_PICTURE
    573   const Window &confBL = pcPicBase->getConformanceWindow();
    574   const Window &confEL = getPicYuvRec()->getConformanceWindow();
    575 
    576   Int widthBL   = pcPicBase->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    577   Int heightBL  = pcPicBase->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    578 
    579   Int widthEL   = getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    580   Int heightEL  = getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    581 #endif
    582 
    583576  UInt numPartitions   = 1<<(g_uiMaxCUDepth<<1);
    584577  UInt widthMinPU      = g_uiMaxCUWidth/(1<<g_uiMaxCUDepth);
     
    598591
    599592      TComDataCU *pcColCU = 0;
    600       pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx);
    601 
    602 #if AVC_SYNTAX && !ILP_DECODED_PICTURE
    603       Int xBL = ( (pelX + 8) * widthBL + widthEL/2 ) / widthEL;
    604       Int yBL = ( (pelY + 8) * heightBL+ heightEL/2 ) / heightEL;
    605 
    606       if( ( xBL < widthBL && yBL < heightBL ) && pcColCU && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) )  //base layer unit not skip and invalid mode
    607 #else
     593      pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx, 1);
     594
    608595      if( pcColCU && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) )  //base layer unit not skip and invalid mode
    609 #endif
    610596      {
    611597        for(UInt refPicList = 0; refPicList < 2; refPicList++)  //for each reference list
     
    670656  }
    671657
    672 #if ILP_DECODED_PICTURE
    673658  UInt   width      = this->getPicYuvRec()->getWidth();
    674659  UInt   height     = this->getPicYuvRec()->getHeight();
    675 #else
    676   const Window &conf = this->getPicYuvRec()->getConformanceWindow();
    677   UInt   width      = this->getPicYuvRec()->getWidth() - conf.getWindowLeftOffset() - conf.getWindowRightOffset();
    678   UInt   height     = this->getPicYuvRec()->getHeight() - conf.getWindowTopOffset() - conf.getWindowBottomOffset();
    679 #endif
     660
    680661  UInt64 poc        = (UInt64)this->getPOC();
    681662  UInt   partWidth  = width / 4;
     
    754735  }
    755736
    756 #if ILP_DECODED_PICTURE
    757737  UInt   width       = this->getPicYuvRec()->getWidth();
    758738  UInt   height      = this->getPicYuvRec()->getHeight();
    759 #else
    760   const Window &conf = this->getConformanceWindow();
    761   UInt   width       = this->getPicYuvRec()->getWidth() - conf.getWindowLeftOffset() - conf.getWindowRightOffset();
    762   UInt   height      = this->getPicYuvRec()->getHeight() - conf.getWindowTopOffset() - conf.getWindowBottomOffset();
    763 #endif
    764739
    765740  UInt64 poc        = (UInt64)this->getPOC();
  • trunk/source/Lib/TLibCommon/TComPic.h

    r313 r442  
    6666  Bool                  m_bUsedByCurr;            //  Used by current picture
    6767  Bool                  m_bIsLongTerm;            //  IS long term picture
    68   Bool                  m_bIsUsedAsLongTerm;      //  long term picture is used as reference before
    6968  TComPicSym*           m_apcPicSym;              //  Symbol
    7069 
     
    8887  Window                m_defaultDisplayWindow;
    8988
     89  Bool                  m_isTop;
     90  Bool                  m_isField;
     91 
    9092  std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink;
    9193
     
    194196  std::vector<TComDataCU*>& getOneSliceCUDataForNDBFilter      (Int sliceID) { return m_vSliceCUDataLink[sliceID];}
    195197
     198  /* field coding parameters*/
     199
     200  Void              setTopField(bool b)                  {m_isTop = b;}
     201  Bool              isTopField()                         {return m_isTop;}
     202  Void              setField(bool b)                     {m_isField = b;}
     203  Bool              isField()                            {return m_isField;}
     204
    196205  /** transfer ownership of seis to this picture */
    197206  void setSEIs(SEIMessages& seis) { m_SEIs = seis; }
     
    207216  const SEIMessages& getSEIs() const { return m_SEIs; }
    208217
    209 #if REF_IDX_FRAMEWORK
     218#if SVC_EXTENSION
    210219  Void  copyUpsampledPictureYuv(TComPicYuv*   pcPicYuvIn, TComPicYuv*   pcPicYuvOut);
    211 #endif
    212220#if AVC_SYNTAX
    213221  Void readBLSyntax( fstream* filestream, UInt numBytes );
    214222#endif
     223#endif
    215224#if SYNTAX_OUTPUT
    216225  Void wrireBLSyntax( fstream* filestream, UInt numBytes );
  • trunk/source/Lib/TLibCommon/TComPicSym.cpp

    r313 r442  
    6161,m_uiNumAllocatedSlice (0)
    6262,m_apcTComDataCU (NULL)
    63 ,m_iTileBoundaryIndependenceIdr (0)
    6463,m_iNumColumnsMinus1 (0)
    6564,m_iNumRowsMinus1(0)
     
    116115  m_puiCUOrderMap = new UInt[m_uiNumCUsInFrame+1];
    117116  m_puiTileIdxMap = new UInt[m_uiNumCUsInFrame];
     117#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     118  m_piTileSetIdxMap = new Int[m_uiNumCUsInFrame];
     119  m_pucTileSetType = new UChar[m_uiNumCUsInFrame];
     120  m_pbSkippedTileSetFlag = new Bool[m_uiNumCUsInFrame];
     121#endif
    118122  m_puiInverseCUOrderMap = new UInt[m_uiNumCUsInFrame+1];
    119123
     
    147151  m_apcTComDataCU = NULL;
    148152
    149 #if AVC_BASE || REF_IDX_FRAMEWORK
     153#if SVC_EXTENSION
    150154  if( m_apcTComTile )
    151155  {
     
    156160  }
    157161  delete [] m_apcTComTile;
    158 #if AVC_BASE || REF_IDX_FRAMEWORK
     162#if SVC_EXTENSION
    159163  }
    160164#endif
     
    167171  delete [] m_puiTileIdxMap;
    168172  m_puiTileIdxMap = NULL;
     173#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     174  delete [] m_piTileSetIdxMap;
     175  m_piTileSetIdxMap = NULL;
     176  delete [] m_pucTileSetType;
     177  m_pucTileSetType = NULL;
     178  delete [] m_pbSkippedTileSetFlag;
     179  m_pbSkippedTileSetFlag = NULL;
     180#endif
    169181
    170182  delete [] m_puiInverseCUOrderMap;
  • trunk/source/Lib/TLibCommon/TComPicSym.h

    r313 r442  
    100100  TComDataCU**  m_apcTComDataCU;        ///< array of CU data
    101101 
    102   Int           m_iTileBoundaryIndependenceIdr;
    103102  Int           m_iNumColumnsMinus1;
    104103  Int           m_iNumRowsMinus1;
     
    106105  UInt*         m_puiCUOrderMap;       //the map of LCU raster scan address relative to LCU encoding order
    107106  UInt*         m_puiTileIdxMap;       //the map of the tile index relative to LCU raster scan address
     107#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     108  Int*          m_piTileSetIdxMap;     //the map of the tile set index relative to LCU raster scan address
     109  UChar*        m_pucTileSetType;
     110  Bool*         m_pbSkippedTileSetFlag;
     111#endif
    108112  UInt*         m_puiInverseCUOrderMap;
    109113
     
    144148  UInt         getCUOrderMap( Int encCUOrder )                       { return *(m_puiCUOrderMap + (encCUOrder>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : encCUOrder)); }
    145149  UInt         getTileIdxMap( Int i )                                { return *(m_puiTileIdxMap + i); }
     150#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     151  Void         setTileSetIdxMap( Int i, Int tileSetIdx, UChar setType, Bool skipFlag )
     152  {
     153    m_piTileSetIdxMap[i]       = tileSetIdx;
     154    m_pucTileSetType[i]        = setType;
     155    m_pbSkippedTileSetFlag[i]  = skipFlag;
     156  }
     157  Int          getTileSetIdxMap( Int i )                             { return *(m_piTileSetIdxMap + i); }
     158  UChar        getTileSetType( Int i )                               { return *(m_pucTileSetType + i); }
     159  Bool         getSkippedTileSetFlag( Int i )                        { return *(m_pbSkippedTileSetFlag + i); }
     160#endif
    146161  Void         setInverseCUOrderMap( Int cuAddr, Int encCUOrder )    { *(m_puiInverseCUOrderMap + cuAddr) = encCUOrder; }
    147162  UInt         getInverseCUOrderMap( Int cuAddr )                    { return *(m_puiInverseCUOrderMap + (cuAddr>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : cuAddr)); }
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r345 r442  
    696696  Int k, l, bottomLeft, topRight;
    697697  Int horPred;
    698   Int leftColumn[MAX_CU_SIZE], topRow[MAX_CU_SIZE], bottomRow[MAX_CU_SIZE], rightColumn[MAX_CU_SIZE];
     698  Int leftColumn[MAX_CU_SIZE+1], topRow[MAX_CU_SIZE+1], bottomRow[MAX_CU_SIZE], rightColumn[MAX_CU_SIZE];
    699699  UInt blkSize = width;
    700700  UInt offset2D = width;
  • trunk/source/Lib/TLibCommon/TComPrediction.h

    r345 r442  
    118118  Int  getPredicBufHeight()       { return m_iYuvExtHeight; }
    119119
    120 #if REF_IDX_FRAMEWORK
     120#if SVC_EXTENSION
    121121#if SVC_UPSAMPLING
    122122#if SCALED_REF_LAYER_OFFSETS
  • trunk/source/Lib/TLibCommon/TComRdCost.h

    r313 r442  
    116116private:
    117117  // for distortion
    118   Int                     m_iBlkWidth;
    119   Int                     m_iBlkHeight;
    120118 
    121119#if AMP_SAD
  • trunk/source/Lib/TLibCommon/TComRom.cpp

    r313 r442  
    5555  ::memset( g_aucConvertToBit,   -1, sizeof( g_aucConvertToBit ) );
    5656  c=0;
    57   for ( i=4; i<MAX_CU_SIZE; i*=2 )
     57  for ( i=4; i<=MAX_CU_SIZE; i*=2 )
    5858  {
    5959    g_aucConvertToBit[ i ] = c;
    6060    c++;
    6161  }
    62   g_aucConvertToBit[ i ] = c;
    6362 
    6463  c=2;
     
    278277
    279278#if FAST_UDI_USE_MPM
    280 const UChar g_aucIntraModeNumFast[7] =
     279const UChar g_aucIntraModeNumFast[MAX_CU_DEPTH] =
    281280{
    282281  3,  //   2x2
     
    285284  3,  //  16x16   
    286285  3,  //  32x32   
    287   3,  //  64x64   
    288   3   // 128x128 
     286  3   //  64x64   
    289287};
    290288#else // FAST_UDI_USE_MPM
    291 const UChar g_aucIntraModeNumFast[7] =
     289const UChar g_aucIntraModeNumFast[MAX_CU_DEPTH] =
    292290{
    293291  3,  //   2x2
     
    296294  4,  //  16x16   33
    297295  4,  //  32x32   33
    298   5,  //  64x64   33
    299   4   // 128x128  33
     296  5   //  64x64   33
    300297};
    301298#endif // FAST_UDI_USE_MPM
     
    523520Int  g_eTTable[4] = {0,3,1,2};
    524521
    525 #if SIMPLIFIED_MV_POS_SCALING
     522#if SVC_EXTENSION
    526523Int g_mvScalingFactor  [MAX_LAYERS][2] = {{0,0}, {0,0}};
    527524Int g_posScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}};
     525
     526#if IL_SL_SIGNALLING_N0371
     527Int ref_scalingListDC         [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];
     528Int ref_scalingListCoef       [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][MAX_MATRIX_COEF_NUM];
     529Int activeRefPPSId            [MAX_LAYERS];
     530Int activeRefSPSId            [MAX_LAYERS];
     531#endif
    528532#endif
    529533
  • trunk/source/Lib/TLibCommon/TComRom.h

    r313 r442  
    5151// ====================================================================================================================
    5252
    53 #define     MAX_CU_DEPTH            7                           // log2(LCUSize)
     53#define     MAX_CU_DEPTH            6                           // log2(LCUSize)
    5454#define     MAX_CU_SIZE             (1<<(MAX_CU_DEPTH))         // maximum allowable size of CU
    5555#define     MIN_PU_SIZE             4
     
    131131// ====================================================================================================================
    132132
    133 extern const UChar  g_aucIntraModeNumFast[7];
     133extern const UChar  g_aucIntraModeNumFast[ MAX_CU_DEPTH ];
    134134
    135135#if FAST_INTRA_SHVC
     
    279279extern Int  g_eTTable[4];
    280280
    281 #if SIMPLIFIED_MV_POS_SCALING
     281#if SVC_EXTENSION
    282282extern Int g_mvScalingFactor  [MAX_LAYERS][2];
    283283extern Int g_posScalingFactor [MAX_LAYERS][2];
     284
     285#if IL_SL_SIGNALLING_N0371
     286extern Int ref_scalingListDC         [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];
     287extern Int ref_scalingListCoef       [MAX_LAYERS][SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM][MAX_MATRIX_COEF_NUM];
     288extern Int activeRefPPSId            [MAX_LAYERS];
     289extern Int activeRefSPSId            [MAX_LAYERS]; 
     290#endif   
    284291#endif
    285292
  • trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp

    r313 r442  
    14141414      UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsZorderIdx] ];
    14151415      UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsZorderIdx] ];
     1416#if REPN_FORMAT_IN_VPS
     1417      if( ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) )
     1418#else
    14161419      if( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) )
     1420#endif
    14171421        xPCMCURestoration( pcCU, uiAbsZorderIdx, uiDepth+1 );
    14181422    }
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r349 r442  
    4646
    4747#if SVC_EXTENSION
    48   ParameterSetMap<TComVPS> ParameterSetManager::m_vpsMap(MAX_NUM_VPS);
    49   Int ParameterSetManager::m_activeVPSId = -1;
     48ParameterSetMap<TComVPS> ParameterSetManager::m_vpsMap(MAX_NUM_VPS);
     49Int ParameterSetManager::m_activeVPSId = -1;
     50#if IL_SL_SIGNALLING_N0371
     51TComSPS* TComSPS::m_pcSPS[MAX_LAYERS];
     52TComPPS* TComPPS::m_pcPPS[MAX_LAYERS];
     53#endif
    5054#endif
    5155
     
    7175, m_iDepth                        ( 0 )
    7276, m_bRefenced                     ( false )
     77#if POC_RESET_FLAG
     78, m_bPocResetFlag                 ( false )
     79#endif
    7380#if SH_DISCARDABLE_FLAG
    7481, m_bDiscardableFlag              ( false )
     
    116123#if SVC_EXTENSION
    117124  memset( m_pcBaseColPic, 0, sizeof( m_pcBaseColPic ) );
    118 #if REF_IDX_FRAMEWORK
    119125#if JCTVC_M0458_INTERLAYER_RPS_SIG
    120126  m_activeNumILRRefIdx        = 0;
     
    133139#endif
    134140#endif
    135 #endif
    136141
    137142  initEqualRef();
     
    168173#if SVC_EXTENSION
    169174  m_layerId = layerId;
    170 #endif
    171   m_aiNumRefIdx[0]      = 0;
    172   m_aiNumRefIdx[1]      = 0;
    173 #if REF_IDX_FRAMEWORK
    174175#if JCTVC_M0458_INTERLAYER_RPS_SIG
    175176  m_activeNumILRRefIdx        = 0;
     
    177178#else
    178179  m_numILRRefIdx              = 0;
    179 #endif 
     180#endif
    180181#if M0457_IL_SAMPLE_PRED_ONLY_FLAG
    181182  m_numSamplePredRefLayers       = 0;
     
    183184#endif
    184185#endif
     186  m_aiNumRefIdx[0]      = 0;
     187  m_aiNumRefIdx[1]      = 0;
     188 
    185189  m_colFromL0Flag = 1;
    186190 
     
    273277    pcPic = *(iterPic);
    274278  }
     279#if POC_RESET_FLAG
     280  assert( pcPic->getSlice(0)->isReferenced() );
     281#endif
    275282  return  pcPic;
    276283}
     
    286293  if (!pocHasMsb)
    287294  {
    288     poc = poc % pocCycle;
     295    poc = poc & (pocCycle - 1);
    289296  }
    290297 
     
    297304      if (!pocHasMsb)
    298305      {
    299         picPoc = picPoc % pocCycle;
     306        picPoc = picPoc & (pocCycle - 1);
    300307      }
    301308     
     
    384391  Int i;
    385392
    386 #if REF_IDX_FRAMEWORK
     393#if SVC_EXTENSION
    387394  if( m_layerId == 0 || ( m_layerId > 0 && ( m_activeNumILRRefIdx == 0 || !((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) ) ) )
    388395  {
     
    439446    pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 
    440447  }
    441 #if REF_IDX_FRAMEWORK
    442   }
    443 #endif
    444 
    445 #if REF_IDX_FRAMEWORK
     448#if SVC_EXTENSION
     449  }
     450#endif
     451
     452#if SVC_EXTENSION
    446453  for( i = 0; i < m_activeNumILRRefIdx; i++ )
    447454  {
     
    450457
    451458#if ILR_RESTR
    452     Int maxSubLayerForILPPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()) : 0;
    453     if( m_layerId > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=  maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )  )
     459    Int maxTidIlRefPicsPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()) : 0;
     460    if( m_layerId > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=  maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )  )
    454461#else //#if ILR_RESTR
    455462    if( m_layerId > 0 && m_activeNumILRRefIdx > 0 )
     
    477484  TComPic*  rpsCurrList0[MAX_NUM_REF+1];
    478485  TComPic*  rpsCurrList1[MAX_NUM_REF+1];
    479 #if REF_IDX_FRAMEWORK
     486#if SVC_EXTENSION
    480487#if ILR_RESTR
    481488  Int numInterLayerRPSPics = 0;
     
    488495    for( i=0; i < m_pcVPS->getNumDirectRefLayers( m_layerId ); i++ )
    489496    {
    490       Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[i]->getSlice(0)->getLayerId());
    491       if( ((Int)(ilpPic[i]->getSlice(0)->getTLayer())<= maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag() ) )
     497      Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[i]->getSlice(0)->getLayerId());
     498      if( ((Int)(ilpPic[i]->getSlice(0)->getTLayer())<= maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag() ) )
    492499      {
    493500        numInterLayerRPSPics++;
     
    499506      m_activeNumILRRefIdx = numInterLayerRPSPics;
    500507    }
    501 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS && SIMPLIFIED_MV_POS_SCALING
     508#if MAX_ONE_RESAMPLING_DIRECT_LAYERS
     509#if SCALABILITY_MASK_E0104
     510    if( m_pcVPS->getScalabilityMask(2) )
     511#else
    502512    if( m_pcVPS->getScalabilityMask(1) )
     513#endif
    503514    {
    504515      Int numResampler = 0;
     516#if MOTION_RESAMPLING_CONSTRAINT
     517      Int numMotionResamplers = 0;
     518      Int refResamplingLayer[MAX_LAYERS];
     519      memset( refResamplingLayer, 0, sizeof( refResamplingLayer ) );
     520#endif
    505521      const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]);
    506522      Int scalingOffset = ((scalEL.getWindowLeftOffset()   == 0 ) &&
     
    513529      {
    514530        UInt refLayerIdc = m_interLayerPredLayerIdc[i];
    515         if(!( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) && (scalingOffset)) // ratio 1x
     531        if(!( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || (!scalingOffset)) // ratio 1x
    516532        {
     533#if MOTION_RESAMPLING_CONSTRAINT
     534          UInt predType = m_pcVPS->getDirectDependencyType( m_layerId, m_pcVPS->getRefLayerId( m_layerId, refLayerIdc ) ) + 1;
     535
     536          if( predType & 0x1 )
     537          {
     538            numResampler++;
     539            refResamplingLayer[i] = refLayerIdc + 1;
     540          }
     541
     542          if( predType & 0x2 )
     543          {
     544            numMotionResamplers++;
     545            refResamplingLayer[i] -= refLayerIdc + 1;
     546          }
     547#else
    517548          numResampler++;
     549#endif
    518550        }
    519551      }
    520 
    521       //Bitstream constraint for SHVC: The picture resampling process as specified in subclause G.8.1.4.1 shall not be invoked more than once for decoding of each particular picture.
     552     
     553      // When both picture sample values and picture motion field resampling processes are invoked for decoding of a particular picture, they shall be applied to the same reference layer picture.
     554      if( m_activeNumILRRefIdx > 1 && numResampler > 0 )
     555      {
     556        for( i=0; i < m_activeNumILRRefIdx; i++ )
     557        {
     558          assert( refResamplingLayer[i] >= 0 && "Motion and sample inter-layer prediction shall be from the same layer" );
     559        }
     560      }
     561
     562      // Bitstream constraint for SHVC: The picture resampling process as specified in subclause G.8.1.4.1 shall not be invoked more than once for decoding of each particular picture.
    522563      assert(numResampler <= 1);
     564#if MOTION_RESAMPLING_CONSTRAINT
     565      assert( numMotionResamplers <= 1  && "Up to 1 motion resampling is allowed" );
     566#endif
    523567    }
    524568#endif
     
    584628      rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
    585629    }
     630#if SVC_EXTENSION
    586631#if RPL_INIT_N0316_N0082
    587 #if REF_IDX_FRAMEWORK
    588632    if( m_layerId > 0 )
    589633    {
     
    596640        Int refLayerIdc = m_interLayerPredLayerIdc[i];
    597641#if ILR_RESTR
    598         Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());
    599         if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
     642        Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());
     643        if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
    600644#endif
    601645          rpsCurrList0[cIdx] = ilpPic[refLayerIdc];
     
    613657    }   
    614658#if !RPL_INIT_N0316_N0082
    615 #if REF_IDX_FRAMEWORK
     659#if SVC_EXTENSION
    616660    if( m_layerId > 0 )
    617661    {
     
    624668        Int refLayerIdc = m_interLayerPredLayerIdc[i];
    625669#if ILR_RESTR
    626          Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());
    627         if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
     670         Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());
     671        if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
    628672#endif
    629673        rpsCurrList0[cIdx] = ilpPic[refLayerIdc];
     
    650694    }   
    651695
    652 #if REF_IDX_FRAMEWORK
     696#if SVC_EXTENSION
    653697    if( m_layerId > 0 )
    654698    {
     
    661705        Int refLayerIdc = m_interLayerPredLayerIdc[i];
    662706#if ILR_RESTR
    663         Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());
    664         if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
     707        Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());
     708        if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
    665709#endif
    666710        rpsCurrList1[cIdx] = ilpPic[refLayerIdc];
     
    680724    m_apcRefPicList[0][rIdx] = rpsCurrList0[ cIdx ];
    681725#if RPL_INIT_N0316_N0082
    682     m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 && cIdx < NumPocStCurr0 + m_activeNumILRRefIdx );
     726    m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 && cIdx < NumPocStCurr0 + m_activeNumILRRefIdx ) || ( cIdx >= NumPocStCurr0 + NumPocStCurr1 + m_activeNumILRRefIdx );
    683727#else
    684728    m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );
     
    702746}
    703747
    704 #if REF_IDX_FRAMEWORK
     748#if SVC_EXTENSION
    705749Void TComSlice::setRefPicListModificationSvc()
    706750{
     
    721765#endif
    722766
     767#if N0147_IRAP_ALIGN_FLAG
     768  assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 0);
     769  assert(m_aiNumRefIdx[REF_PIC_LIST_1] > 0);
     770#else
    723771  assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 1);
    724772  assert(m_aiNumRefIdx[REF_PIC_LIST_1] > 1);
     773#endif
    725774
    726775  //set L0 inter-layer reference picture modification
     
    729778#else
    730779  Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == numberOfRpsCurrTempList) ? false : true;
     780#endif
     781#if N0147_IRAP_ALIGN_FLAG
     782  hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_0] > 1 );
    731783#endif
    732784#if FINAL_RPL_CHANGE_N0082
     
    758810#if RPL_INIT_N0316_N0082
    759811        if((numberOfPocBeforeCurr) >= m_aiNumRefIdx[REF_PIC_LIST_0])
     812        {
    760813          refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr);
     814        }
    761815        else
    762816        {
    763817          refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr);
    764818          for (Int j = numberOfPocBeforeCurr; j < (m_aiNumRefIdx[REF_PIC_LIST_0] - i); j++)
     819          {
    765820            refPicListModification->setRefPicSetIdxL0(j, j + m_activeNumILRRefIdx);
     821          }
    766822        }
    767823#else
     
    774830  //set L1 inter-layer reference picture modification
    775831  hasModification = (m_aiNumRefIdx[REF_PIC_LIST_1] == numberOfRpsCurrTempList) ? false : true;
     832#if N0147_IRAP_ALIGN_FLAG
     833  hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_1] > 1 );
     834#endif
     835
    776836  refPicListModification->setRefPicListModificationFlagL1(hasModification);
    777837  if(hasModification)
     
    828888  Int numRpsCurrTempList = 0;
    829889
    830 #if REF_IDX_FRAMEWORK
     890#if SVC_EXTENSION
    831891  if( m_eSliceType == I_SLICE || ( m_pcSPS->getLayerId() &&
    832892    (m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&
     
    836896#endif
    837897  {
    838 #if REF_IDX_FRAMEWORK
     898#if SVC_EXTENSION
    839899#if JCTVC_M0458_INTERLAYER_RPS_SIG
    840900    return m_activeNumILRRefIdx;
     
    853913    }
    854914  }
    855 #if REF_IDX_FRAMEWORK
     915#if SVC_EXTENSION
    856916  if( m_layerId > 0 )
    857917  {
     
    907967}
    908968
    909 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic)
     969Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic)
    910970{
    911971  for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++)
     
    933993  {
    934994    pocCRA = getPOC();
    935     prevRAPisBLA = false;
     995    associatedIRAPType = getNalUnitType();
    936996  }
    937997  else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) // CRA picture found
    938998  {
    939999    pocCRA = getPOC();
    940     prevRAPisBLA = false;
     1000    associatedIRAPType = getNalUnitType();
    9411001  }
    9421002  else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     
    9451005  {
    9461006    pocCRA = getPOC();
    947     prevRAPisBLA = true;
     1007    associatedIRAPType = getNalUnitType();
    9481008  }
    9491009}
     
    9701030{
    9711031  TComPic*                 rpcPic;
     1032  setAssociatedIRAPPOC(pocCRA);
    9721033  Int pocCurr = getPOC();
    9731034
     
    10761137  m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
    10771138  memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) );
    1078 #elif REF_IDX_FRAMEWORK
    1079   m_numILRRefIdx               = pSrc->m_numILRRefIdx;
    10801139#endif
    10811140#endif
     
    11381197}
    11391198
    1140 Int TComSlice::m_prevPOC = 0;
     1199Int TComSlice::m_prevTid0POC = 0;
    11411200
    11421201/** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag.
     
    11931252}
    11941253
     1254
     1255Void TComSlice::checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic)
     1256{
     1257  TComPic* rpcPic;
     1258
     1259  Int nalUnitType = this->getNalUnitType();
     1260
     1261  // When a picture is a leading picture, it shall be a RADL or RASL picture.
     1262  if(this->getAssociatedIRAPPOC() > this->getPOC())
     1263  {
     1264    // Do not check IRAP pictures since they may get a POC lower than their associated IRAP
     1265    if(nalUnitType < NAL_UNIT_CODED_SLICE_BLA_W_LP ||
     1266       nalUnitType > NAL_UNIT_RESERVED_IRAP_VCL23)
     1267    {
     1268      assert(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
     1269             nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R ||
     1270             nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
     1271             nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R);
     1272    }
     1273  }
     1274
     1275  // When a picture is a trailing picture, it shall not be a RADL or RASL picture.
     1276  if(this->getAssociatedIRAPPOC() < this->getPOC())
     1277  {
     1278    assert(nalUnitType != NAL_UNIT_CODED_SLICE_RASL_N &&
     1279           nalUnitType != NAL_UNIT_CODED_SLICE_RASL_R &&
     1280           nalUnitType != NAL_UNIT_CODED_SLICE_RADL_N &&
     1281           nalUnitType != NAL_UNIT_CODED_SLICE_RADL_R);
     1282  }
     1283
     1284  // No RASL pictures shall be present in the bitstream that are associated
     1285  // with a BLA picture having nal_unit_type equal to BLA_W_RADL or BLA_N_LP.
     1286  if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
     1287     nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
     1288  {
     1289    assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_W_RADL &&
     1290           this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_N_LP);
     1291  }
     1292
     1293  // No RASL pictures shall be present in the bitstream that are associated with
     1294  // an IDR picture.
     1295  if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
     1296     nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
     1297  {
     1298    assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_N_LP   &&
     1299           this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL);
     1300  }
     1301
     1302  // No RADL pictures shall be present in the bitstream that are associated with
     1303  // a BLA picture having nal_unit_type equal to BLA_N_LP or that are associated
     1304  // with an IDR picture having nal_unit_type equal to IDR_N_LP.
     1305  if(nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
     1306     nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R)
     1307  {
     1308    assert(this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_BLA_N_LP   &&
     1309           this->getAssociatedIRAPType() != NAL_UNIT_CODED_SLICE_IDR_N_LP);
     1310  }
     1311
     1312  // loop through all pictures in the reference picture buffer
     1313  TComList<TComPic*>::iterator iterPic = rcListPic.begin();
     1314  while ( iterPic != rcListPic.end())
     1315  {
     1316    rpcPic = *(iterPic++);
     1317    if (rpcPic->getPOC() == this->getPOC())
     1318    {
     1319      continue;
     1320    }
     1321
     1322    // Any picture that has PicOutputFlag equal to 1 that precedes an IRAP picture
     1323    // in decoding order shall precede the IRAP picture in output order.
     1324    // (Note that any picture following in output order would be present in the DPB)
     1325    if(rpcPic->getSlice(0)->getPicOutputFlag() == 1)
     1326    {
     1327      if(nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP    ||
     1328         nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP    ||
     1329         nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL  ||
     1330         nalUnitType == NAL_UNIT_CODED_SLICE_CRA         ||
     1331         nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP    ||
     1332         nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL)
     1333      {
     1334        assert(rpcPic->getPOC() < this->getPOC());
     1335      }
     1336    }
     1337
     1338    // Any picture that has PicOutputFlag equal to 1 that precedes an IRAP picture
     1339    // in decoding order shall precede any RADL picture associated with the IRAP
     1340    // picture in output order.
     1341    if(rpcPic->getSlice(0)->getPicOutputFlag() == 1)
     1342    {
     1343      if((nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
     1344          nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R))
     1345      {
     1346        // rpcPic precedes the IRAP in decoding order
     1347        if(this->getAssociatedIRAPPOC() > rpcPic->getSlice(0)->getAssociatedIRAPPOC())
     1348        {
     1349          // rpcPic must not be the IRAP picture
     1350          if(this->getAssociatedIRAPPOC() != rpcPic->getPOC())
     1351          {
     1352            assert(rpcPic->getPOC() < this->getPOC());
     1353          }
     1354        }
     1355      }
     1356    }
     1357
     1358    // When a picture is a leading picture, it shall precede, in decoding order,
     1359    // all trailing pictures that are associated with the same IRAP picture.
     1360    if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
     1361       nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R ||
     1362       nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
     1363       nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R)
     1364    {
     1365      if(rpcPic->getSlice(0)->getAssociatedIRAPPOC() == this->getAssociatedIRAPPOC())
     1366      {
     1367        // rpcPic is a picture that preceded the leading in decoding order since it exist in the DPB
     1368        // rpcPic would violate the constraint if it was a trailing picture
     1369        assert(rpcPic->getPOC() <= this->getAssociatedIRAPPOC());
     1370      }
     1371    }
     1372
     1373    // Any RASL picture associated with a CRA or BLA picture shall precede any
     1374    // RADL picture associated with the CRA or BLA picture in output order
     1375    if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
     1376       nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
     1377    {
     1378      if((this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_N_LP   ||
     1379          this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_LP   ||
     1380          this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ||
     1381          this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA)       &&
     1382          this->getAssociatedIRAPPOC() == rpcPic->getSlice(0)->getAssociatedIRAPPOC())
     1383      {
     1384        if(rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N ||
     1385           rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R)
     1386        {
     1387          assert(rpcPic->getPOC() > this->getPOC());
     1388        }
     1389      }
     1390    }
     1391
     1392    // Any RASL picture associated with a CRA picture shall follow, in output
     1393    // order, any IRAP picture that precedes the CRA picture in decoding order.
     1394    if(nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ||
     1395       nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R)
     1396    {
     1397      if(this->getAssociatedIRAPType() == NAL_UNIT_CODED_SLICE_CRA)
     1398      {
     1399        if(rpcPic->getSlice(0)->getPOC() < this->getAssociatedIRAPPOC() &&
     1400           (rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP   ||
     1401            rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP   ||
     1402            rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ||
     1403            rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP   ||
     1404            rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL ||
     1405            rpcPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA))
     1406        {
     1407          assert(this->getPOC() > rpcPic->getSlice(0)->getPOC());
     1408        }
     1409      }
     1410    }
     1411  }
     1412}
     1413
    11951414/** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet.
    11961415*/
     
    11991418  TComPic* rpcPic;
    12001419  Int i, isReference;
     1420
     1421  checkLeadingPictureRestrictions(rcListPic);
    12011422
    12021423  // loop through all pictures in the reference picture buffer
     
    12351456      else
    12361457      {
    1237         if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()))
     1458        Int pocCycle = 1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC();
     1459        Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC() & (pocCycle-1);
     1460        Int refPoc = pReferencePictureSet->getPOC(i) & (pocCycle-1);
     1461        if(rpcPic->getIsLongTerm() && curPoc == refPoc)
    12381462        {
    12391463          isReference = 1;
     
    12951519      else
    12961520      {
    1297         if(rpcPic->getIsLongTerm() && (rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == pReferencePictureSet->getPOC(i)%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()) && rpcPic->getSlice(0)->isReferenced())
     1521        Int pocCycle = 1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC();
     1522        Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC() & (pocCycle-1);
     1523        Int refPoc = pReferencePictureSet->getPOC(i) & (pocCycle-1);
     1524        if(rpcPic->getIsLongTerm() && curPoc == refPoc && rpcPic->getSlice(0)->isReferenced())
    12981525        {
    12991526          isAvailable = 1;
     
    13141541        if (!pReferencePictureSet->getCheckLTMSBPresent(i))
    13151542        {
    1316           curPoc = curPoc % pocCycle;
    1317           refPoc = refPoc % pocCycle;
     1543          curPoc = curPoc & (pocCycle - 1);
     1544          refPoc = refPoc & (pocCycle - 1);
    13181545        }
    13191546       
     
    15891816}
    15901817
     1818#if REPN_FORMAT_IN_VPS
     1819UInt TComSlice::getPicWidthInLumaSamples()
     1820{
     1821  TComSPS *sps = getSPS();
     1822  TComVPS *vps = getVPS();
     1823  UInt retVal, layerId = getLayerId();
     1824  if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )
     1825  {
     1826    retVal = sps->getPicWidthInLumaSamples();
     1827  }
     1828  else
     1829  {
     1830    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getPicWidthVpsInLumaSamples();
     1831  }
     1832  return retVal;
     1833}
     1834UInt TComSlice::getPicHeightInLumaSamples()
     1835{
     1836  TComSPS *sps = getSPS();
     1837  TComVPS *vps = getVPS();
     1838  UInt retVal, layerId = getLayerId();
     1839  if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )
     1840  {
     1841    retVal = sps->getPicHeightInLumaSamples();
     1842  }
     1843  else
     1844  {
     1845    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getPicHeightVpsInLumaSamples();
     1846  }
     1847  return retVal;
     1848}
     1849UInt TComSlice::getChromaFormatIdc()
     1850{
     1851  TComSPS *sps = getSPS();
     1852  TComVPS *vps = getVPS();
     1853  UInt retVal, layerId = getLayerId();
     1854  if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )
     1855  {
     1856    retVal = sps->getChromaFormatIdc();
     1857  }
     1858  else
     1859  {
     1860    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getChromaFormatVpsIdc();
     1861  }
     1862  return retVal;
     1863}
     1864UInt TComSlice::getBitDepthY()
     1865{
     1866  TComSPS *sps = getSPS();
     1867  TComVPS *vps = getVPS();
     1868  UInt retVal, layerId = getLayerId();
     1869  if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )
     1870  {
     1871    retVal = sps->getBitDepthY();
     1872  }
     1873  else
     1874  {
     1875    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsLuma();
     1876  }
     1877  return retVal;
     1878}
     1879UInt TComSlice::getBitDepthC()
     1880{
     1881  TComSPS *sps = getSPS();
     1882  TComVPS *vps = getVPS();
     1883  UInt retVal, layerId = getLayerId();
     1884  if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )
     1885  {
     1886    retVal = sps->getBitDepthC();
     1887  }
     1888  else
     1889  {
     1890    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsChroma();
     1891  }
     1892  return retVal;
     1893}
     1894Int TComSlice::getQpBDOffsetY()
     1895{
     1896  return (getBitDepthY() - 8) * 6;
     1897}
     1898Int TComSlice::getQpBDOffsetC()
     1899{
     1900  return (getBitDepthC() - 8) * 6;
     1901}
     1902
     1903RepFormat::RepFormat()
     1904: m_chromaFormatVpsIdc          (0)
     1905, m_separateColourPlaneVpsFlag  (false)
     1906, m_picWidthVpsInLumaSamples    (0)
     1907, m_picHeightVpsInLumaSamples   (0)
     1908, m_bitDepthVpsLuma             (0)
     1909, m_bitDepthVpsChroma           (0)
     1910{}
     1911#endif
     1912
    15911913// ------------------------------------------------------------------------------------------------
    15921914// Video parameter set (VPS)
     
    16171939, m_defaultOneTargetOutputLayerFlag    (false)
    16181940#endif
     1941#if VPS_VUI_BITRATE_PICRATE
     1942, m_bitRatePresentVpsFlag     (false)
     1943, m_picRatePresentVpsFlag     (false)
     1944#endif
     1945#if REPN_FORMAT_IN_VPS
     1946, m_repFormatIdxPresentFlag   (true)
     1947, m_vpsNumRepFormats          (1)
     1948#endif
     1949#if VIEW_ID_RELATED_SIGNALING
     1950, m_viewIdLenMinus1           (0)
     1951#endif
    16191952{
    16201953  for( Int i = 0; i < MAX_TLAYER; i++)
     
    16651998  m_maxOneActiveRefLayerFlag = true;
    16661999#endif
     2000#if N0147_IRAP_ALIGN_FLAG
     2001  m_crossLayerIrapAlignFlag = true;
     2002#endif
    16672003#if JCTVC_M0203_INTERLAYER_PRED_IDC
    16682004#if N0120_MAX_TID_REF_PRESENT_FLAG
    1669   m_maxTidIlRefPicsPlus1PresentFlag = true;
     2005  m_maxTidRefPresentFlag = true;
    16702006#endif
    16712007  for( Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++)
    16722008  {
    1673     m_maxSublayerForIlpPlus1[i] = m_uiMaxTLayers + 1;
    1674   }
     2009    m_maxTidIlRefPicsPlus1[i] = m_uiMaxTLayers + 1;
     2010  }
     2011#endif
     2012#if TILE_BOUNDARY_ALIGNED_FLAG
     2013   ::memset(m_tileBoundariesAlignedFlag,  0, sizeof(m_tileBoundariesAlignedFlag));
     2014#endif
     2015#if N0160_VUI_EXT_ILP_REF
     2016   m_numIlpRestrictedRefLayers = false;
     2017   ::memset(m_minSpatialSegmentOffsetPlus1,  0, sizeof(m_minSpatialSegmentOffsetPlus1));
     2018   ::memset(m_ctuBasedOffsetEnabledFlag,     0, sizeof(m_ctuBasedOffsetEnabledFlag));
     2019   ::memset(m_minHorizontalCtuOffsetPlus1,   0, sizeof(m_minHorizontalCtuOffsetPlus1));
     2020#endif
     2021#if VPS_VUI_BITRATE_PICRATE 
     2022  ::memset(m_bitRatePresentFlag, 0, sizeof(m_bitRatePresentFlag));
     2023  ::memset(m_picRatePresentFlag, 0, sizeof(m_picRatePresentFlag));
     2024  ::memset(m_avgBitRate        , 0, sizeof(m_avgBitRate)        );
     2025  ::memset(m_maxBitRate        , 0, sizeof(m_maxBitRate)        );
     2026  ::memset(m_constPicRateIdc   , 0, sizeof(m_constPicRateIdc)   );
     2027  ::memset(m_avgPicRate        , 0, sizeof(m_avgPicRate)        );
     2028#endif
     2029#if REPN_FORMAT_IN_VPS
     2030  ::memset( m_vpsRepFormatIdx, 0, sizeof(m_vpsRepFormatIdx) );
     2031#endif
     2032#if VIEW_ID_RELATED_SIGNALING
     2033  ::memset(m_viewIdVal, 0, sizeof(m_viewIdVal));
    16752034#endif
    16762035}
     
    17042063    setNumLayersInIdList(i, n);
    17052064  }
     2065}
     2066#endif
     2067
     2068#if IL_SL_SIGNALLING_N0371
     2069Bool TComVPS::checkLayerDependency(UInt i, UInt j)
     2070{
     2071  if( this->getDirectDependencyFlag(i, j) == true )
     2072  {                                                                                                                                   
     2073    return true;                                                                                                                       
     2074  }                                                                                                                                   
     2075  else                                                                                                                                   
     2076  {                                                                                                                                   
     2077    for(UInt k=i-1; k>j; k--)
     2078    {                                                                                                                               
     2079      if( this->getDirectDependencyFlag(i, k) == true )
     2080      {                                                                                                                           
     2081        checkLayerDependency( k,j );                                                                                           
     2082      }
     2083    }
     2084  }
     2085  return false;       
     2086}
     2087#endif
     2088
     2089#if VIEW_ID_RELATED_SIGNALING
     2090Int TComVPS::getNumViews()
     2091{
     2092  Int numViews = 1;
     2093  for( Int i = 0; i <= getMaxLayers() - 1; i++ )
     2094  {
     2095    Int lId = getLayerIdInNuh( i );
     2096    if ( i > 0 && ( getViewIndex( lId ) != getScalabilityId( i - 1, VIEW_ORDER_INDEX ) ) )
     2097    {
     2098      numViews++;
     2099    }   
     2100  }
     2101
     2102  return numViews;
     2103}
     2104Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType )
     2105{
     2106  return getScalabilityMask( scalType ) ? getDimensionId( layerIdInVps, scalTypeToScalIdx( scalType ) ) : 0;
     2107
     2108Int TComVPS::scalTypeToScalIdx( ScalabilityType scalType )
     2109{
     2110  assert( scalType >= 0 && scalType <= MAX_VPS_NUM_SCALABILITY_TYPES );
     2111  assert( scalType == MAX_VPS_NUM_SCALABILITY_TYPES || getScalabilityMask( scalType ) );
     2112  Int scalIdx = 0;
     2113  for( Int curScalType = 0; curScalType < scalType; curScalType++ )
     2114  {
     2115    scalIdx += ( getScalabilityMask( curScalType ) ? 1 : 0 );
     2116
     2117  }
     2118
     2119  return scalIdx;
    17062120}
    17072121#endif
     
    17592173, m_numScaledRefLayerOffsets  (0)
    17602174#endif
     2175#if REPN_FORMAT_IN_VPS
     2176, m_updateRepFormatFlag       (false)
     2177#endif
    17612178{
    17622179  for ( Int i = 0; i < MAX_TLAYER; i++ )
     
    18022219
    18032220  TimingInfo *timingInfo = vui->getTimingInfo();
    1804   timingInfo->setTimingInfoPresentFlag( true );
    1805   switch( frameRate )
    1806   {
    1807   case 24:
    1808     timingInfo->setNumUnitsInTick( 1125000 );    timingInfo->setTimeScale    ( 27000000 );
    1809     break;
    1810   case 25:
    1811     timingInfo->setNumUnitsInTick( 1080000 );    timingInfo->setTimeScale    ( 27000000 );
    1812     break;
    1813   case 30:
    1814     timingInfo->setNumUnitsInTick( 900900 );     timingInfo->setTimeScale    ( 27000000 );
    1815     break;
    1816   case 50:
    1817     timingInfo->setNumUnitsInTick( 540000 );     timingInfo->setTimeScale    ( 27000000 );
    1818     break;
    1819   case 60:
    1820     timingInfo->setNumUnitsInTick( 450450 );     timingInfo->setTimeScale    ( 27000000 );
    1821     break;
    1822   default:
    1823     timingInfo->setNumUnitsInTick( 1001 );       timingInfo->setTimeScale    ( 60000 );
    1824     break;
    1825   }
    1826 
    1827   Bool rateCnt = ( bitRate > 0 );
    1828   hrd->setNalHrdParametersPresentFlag( rateCnt );
    1829   hrd->setVclHrdParametersPresentFlag( rateCnt );
    1830 
    1831   hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) );
    1832 
    1833   if( hrd->getSubPicCpbParamsPresentFlag() )
    1834   {
    1835     hrd->setTickDivisorMinus2( 100 - 2 );                          //
    1836     hrd->setDuCpbRemovalDelayLengthMinus1( 7 );                    // 8-bit precision ( plus 1 for last DU in AU )
    1837     hrd->setSubPicCpbParamsInPicTimingSEIFlag( true );
    1838     hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 );                 // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay
     2221#if TIMING_INFO_NONZERO_LAYERID_SPS
     2222  if( getLayerId() > 0 )
     2223  {
     2224    timingInfo->setTimingInfoPresentFlag( false );
    18392225  }
    18402226  else
    18412227  {
    1842     hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 
    1843   }
    1844 
    1845   hrd->setBitRateScale( 4 );                                       // in units of 2~( 6 + 4 ) = 1,024 bps
    1846   hrd->setCpbSizeScale( 6 );                                       // in units of 2~( 4 + 4 ) = 1,024 bit
    1847   hrd->setDuCpbSizeScale( 6 );                                       // in units of 2~( 4 + 4 ) = 1,024 bit
     2228#endif
     2229    timingInfo->setTimingInfoPresentFlag( true );
     2230    switch( frameRate )
     2231    {
     2232    case 24:
     2233      timingInfo->setNumUnitsInTick( 1125000 );    timingInfo->setTimeScale    ( 27000000 );
     2234      break;
     2235    case 25:
     2236      timingInfo->setNumUnitsInTick( 1080000 );    timingInfo->setTimeScale    ( 27000000 );
     2237      break;
     2238    case 30:
     2239      timingInfo->setNumUnitsInTick( 900900 );     timingInfo->setTimeScale    ( 27000000 );
     2240      break;
     2241    case 50:
     2242      timingInfo->setNumUnitsInTick( 540000 );     timingInfo->setTimeScale    ( 27000000 );
     2243      break;
     2244    case 60:
     2245      timingInfo->setNumUnitsInTick( 450450 );     timingInfo->setTimeScale    ( 27000000 );
     2246      break;
     2247    default:
     2248      timingInfo->setNumUnitsInTick( 1001 );       timingInfo->setTimeScale    ( 60000 );
     2249      break;
     2250    }
     2251
     2252    Bool rateCnt = ( bitRate > 0 );
     2253    hrd->setNalHrdParametersPresentFlag( rateCnt );
     2254    hrd->setVclHrdParametersPresentFlag( rateCnt );
     2255
     2256    hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) );
     2257
     2258    if( hrd->getSubPicCpbParamsPresentFlag() )
     2259    {
     2260      hrd->setTickDivisorMinus2( 100 - 2 );                          //
     2261      hrd->setDuCpbRemovalDelayLengthMinus1( 7 );                    // 8-bit precision ( plus 1 for last DU in AU )
     2262      hrd->setSubPicCpbParamsInPicTimingSEIFlag( true );
     2263      hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 );                 // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay
     2264    }
     2265    else
     2266    {
     2267      hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 
     2268    }
     2269
     2270    hrd->setBitRateScale( 4 );                                       // in units of 2~( 6 + 4 ) = 1,024 bps
     2271    hrd->setCpbSizeScale( 6 );                                       // in units of 2~( 4 + 4 ) = 1,024 bit
     2272    hrd->setDuCpbSizeScale( 6 );                                       // in units of 2~( 4 + 4 ) = 1,024 bit
    18482273 
    1849   hrd->setInitialCpbRemovalDelayLengthMinus1(15);                  // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit
    1850   if( randomAccess )
    1851   {
    1852     hrd->setCpbRemovalDelayLengthMinus1(5);                        // 32 = 2^5 (plus 1)
    1853     hrd->setDpbOutputDelayLengthMinus1 (5);                        // 32 + 3 = 2^6
    1854   }
    1855   else
    1856   {
    1857     hrd->setCpbRemovalDelayLengthMinus1(9);                        // max. 2^10
    1858     hrd->setDpbOutputDelayLengthMinus1 (9);                        // max. 2^10
    1859   }
     2274    hrd->setInitialCpbRemovalDelayLengthMinus1(15);                  // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit
     2275    if( randomAccess )
     2276    {
     2277      hrd->setCpbRemovalDelayLengthMinus1(5);                        // 32 = 2^5 (plus 1)
     2278      hrd->setDpbOutputDelayLengthMinus1 (5);                        // 32 + 3 = 2^6
     2279    }
     2280    else
     2281    {
     2282      hrd->setCpbRemovalDelayLengthMinus1(9);                        // max. 2^10
     2283      hrd->setDpbOutputDelayLengthMinus1 (9);                        // max. 2^10
     2284    }
    18602285
    18612286/*
    1862    Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported.
     2287     Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported.
    18632288*/
    1864   Int i, j;
    1865   UInt birateValue, cpbSizeValue;
    1866   UInt ducpbSizeValue;
    1867   UInt duBitRateValue = 0;
    1868 
    1869   for( i = 0; i < MAX_TLAYER; i ++ )
    1870   {
    1871     hrd->setFixedPicRateFlag( i, 1 );
    1872     hrd->setPicDurationInTcMinus1( i, 0 );
    1873     hrd->setLowDelayHrdFlag( i, 0 );
    1874     hrd->setCpbCntMinus1( i, 0 );
    1875 
    1876     birateValue  = bitRate;
    1877     cpbSizeValue = bitRate;                                     // 1 second
    1878     ducpbSizeValue = bitRate/numDU;
    1879     duBitRateValue = bitRate;
    1880     for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ )
    1881     {
    1882       hrd->setBitRateValueMinus1( i, j, 0, ( birateValue  - 1 ) );
    1883       hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) );
    1884       hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) );
    1885       hrd->setCbrFlag( i, j, 0, ( j == 0 ) );
    1886 
    1887       hrd->setBitRateValueMinus1( i, j, 1, ( birateValue  - 1) );
    1888       hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) );
    1889       hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) );
    1890       hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) );
    1891       hrd->setCbrFlag( i, j, 1, ( j == 0 ) );
    1892     }
    1893   }
     2289    Int i, j;
     2290    UInt birateValue, cpbSizeValue;
     2291    UInt ducpbSizeValue;
     2292    UInt duBitRateValue = 0;
     2293
     2294    for( i = 0; i < MAX_TLAYER; i ++ )
     2295    {
     2296      hrd->setFixedPicRateFlag( i, 1 );
     2297      hrd->setPicDurationInTcMinus1( i, 0 );
     2298      hrd->setLowDelayHrdFlag( i, 0 );
     2299      hrd->setCpbCntMinus1( i, 0 );
     2300
     2301      birateValue  = bitRate;
     2302      cpbSizeValue = bitRate;                                     // 1 second
     2303      ducpbSizeValue = bitRate/numDU;
     2304      duBitRateValue = bitRate;
     2305      for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ )
     2306      {
     2307        hrd->setBitRateValueMinus1( i, j, 0, ( birateValue  - 1 ) );
     2308        hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) );
     2309        hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) );
     2310        hrd->setCbrFlag( i, j, 0, ( j == 0 ) );
     2311
     2312        hrd->setBitRateValueMinus1( i, j, 1, ( birateValue  - 1) );
     2313        hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) );
     2314        hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) );
     2315        hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) );
     2316        hrd->setCbrFlag( i, j, 1, ( j == 0 ) );
     2317      }
     2318    }
     2319#if TIMING_INFO_NONZERO_LAYERID_SPS
     2320  }
     2321#endif
    18942322}
    18952323const Int TComSPS::m_winUnitX[]={1,2,2,1};
     
    21522580TComScalingList::TComScalingList()
    21532581{
    2154   m_useTransformSkip = false;
    21552582  init();
    21562583}
     2584
    21572585TComScalingList::~TComScalingList()
    21582586{
     
    21622590/** set default quantization matrix to array
    21632591*/
     2592#if IL_SL_SIGNALLING_N0371
     2593Void TComSlice::setDefaultScalingList( UInt layerId )
     2594#else
    21642595Void TComSlice::setDefaultScalingList()
     2596#endif
    21652597{
    21662598  for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
     
    21682600    for(UInt listId=0;listId<g_scalingListNum[sizeId];listId++)
    21692601    {
     2602#if IL_SL_SIGNALLING_N0371
     2603      getScalingList()->processDefaultMarix(sizeId, listId, layerId);
     2604#else
    21702605      getScalingList()->processDefaultMarix(sizeId, listId);
     2606#endif
    21712607    }
    21722608  }
     
    23432779 * \param Index of input matrix
    23442780 */
     2781#if IL_SL_SIGNALLING_N0371
     2782Void TComScalingList::processDefaultMarix(UInt sizeId, UInt listId, UInt layerId)
     2783#else
    23452784Void TComScalingList::processDefaultMarix(UInt sizeId, UInt listId)
    2346 {
     2785#endif
     2786{
     2787#if IL_SL_SIGNALLING_N0371
     2788  Int i,coefNum = min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]);
     2789  UInt* scan  = (sizeId == 0) ? g_auiSigLastScan [ SCAN_DIAG ] [ 1 ] :  g_sigLastScanCG32x32;
     2790  Int *src = getScalingListDefaultAddress(sizeId, listId);   
     2791#endif
     2792
    23472793  ::memcpy(getScalingListAddress(sizeId, listId),getScalingListDefaultAddress(sizeId,listId),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]));
     2794
     2795#if IL_SL_SIGNALLING_N0371
     2796  for(i = 0; i < coefNum; i++)
     2797  {
     2798    ref_scalingListCoef[layerId][sizeId][listId][i] = src[scan[i]];
     2799  }
     2800#endif
     2801
    23482802  setScalingListDC(sizeId,listId,SCALING_LIST_DC);
     2803#if IL_SL_SIGNALLING_N0371
     2804  ref_scalingListDC[layerId][sizeId][listId] = SCALING_LIST_DC;
     2805#endif
    23492806}
    23502807
    23512808/** check DC value of matrix for default matrix signaling
    23522809 */
     2810#if IL_SL_SIGNALLING_N0371
     2811Void TComScalingList::checkDcOfMatrix( UInt layerId )
     2812#else
    23532813Void TComScalingList::checkDcOfMatrix()
     2814#endif
    23542815{
    23552816  for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
     
    23602821      if(getScalingListDC(sizeId,listId) == 0)
    23612822      {
     2823#if IL_SL_SIGNALLING_N0371
     2824        processDefaultMarix(sizeId, listId, layerId);
     2825#else
    23622826        processDefaultMarix(sizeId, listId);
     2827#endif
    23632828      }
    23642829    }
     
    24412906        m_activeVPSId = vpsId;
    24422907        m_activeSPSId = spsId;
     2908
     2909#if IL_SL_SIGNALLING_N0371
     2910        activeRefPPSId[ sps->getLayerId() ] = ppsId;
     2911        activeRefSPSId[ sps->getLayerId() ] = spsId;
     2912#endif
     2913
    24432914        return true;
    24442915      }
     
    25543025    return;
    25553026  }       
     3027#if POC_RESET_FLAG
     3028  if( this->getPocResetFlag() )
     3029  {
     3030    setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, 0));
     3031  }
     3032  else
     3033  {
     3034    setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC()));
     3035  }
     3036#else
    25563037  setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC()));
     3038#endif
    25573039}
    25583040#endif
     
    25683050    //set reference picture POC of each ILP reference
    25693051    Int thePoc = ilpPic[refLayerIdc]->getPOC();
    2570     assert(thePoc >= 0); 
     3052    assert(thePoc >= 0);
    25713053    assert(thePoc == pcRefPicBL->getPOC());
    25723054
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r345 r442  
    156156  Void     setScalingListPresentFlag    (Bool b)                               { m_scalingListPresentFlag = b;    }
    157157  Bool     getScalingListPresentFlag    ()                                     { return m_scalingListPresentFlag; }
    158   Bool     getUseTransformSkip    ()                                     { return m_useTransformSkip; }     
    159   Void     setUseTransformSkip    (Bool b)                               { m_useTransformSkip = b;    }
     158
     159#if IL_SL_SIGNALLING_N0371
     160  UInt     m_layerId;
     161
     162  Void     setPredScalingListFlag    (Bool b)                               { m_predScalingListFlag = b;    }
     163  Bool     getPredScalingListFlag    ()                                     { return m_predScalingListFlag; }
     164  Void     setScalingListRefLayerId  (UInt b)                               { m_scalingListRefLayerId = b;  }
     165  UInt     getScalingListRefLayerId  ()                                     { return m_scalingListRefLayerId; }
     166#endif
     167
    160168  Int*     getScalingListAddress          (UInt sizeId, UInt listId)           { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient
    161169  Bool     checkPredMode                  (UInt sizeId, UInt listId);
     
    163171  UInt     getRefMatrixId                 (UInt sizeId, UInt listId)           { return m_refMatrixId[sizeId][listId]; }     //!< get reference matrix ID
    164172  Int*     getScalingListDefaultAddress   (UInt sizeId, UInt listId);                                                        //!< get default matrix coefficient
     173
     174#if IL_SL_SIGNALLING_N0371
     175  Void     processDefaultMarix            (UInt sizeId, UInt listId, UInt layerId );
     176#else
    165177  Void     processDefaultMarix            (UInt sizeId, UInt listId);
     178#endif
     179
    166180  Void     setScalingListDC               (UInt sizeId, UInt listId, UInt u)   { m_scalingListDC[sizeId][listId] = u; }      //!< set DC value
    167181
    168182  Int      getScalingListDC               (UInt sizeId, UInt listId)           { return m_scalingListDC[sizeId][listId]; }   //!< get DC value
     183
     184#if IL_SL_SIGNALLING_N0371
     185  Void     setLayerId(UInt layerId) { m_layerId = layerId; }
     186  UInt     getLayerId() { return m_layerId; }
     187  Void     checkDcOfMatrix                ( UInt m_layerId );
     188#else
    169189  Void     checkDcOfMatrix                ();
     190#endif
     191
    170192  Void     processRefMatrix               (UInt sizeId, UInt listId , UInt refListId );
    171193  Bool     xParseScalingList              (Char* pchFile);
     
    178200  UInt     m_refMatrixId                 [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID
    179201  Bool     m_scalingListPresentFlag;                                                //!< flag for using default matrix
     202
     203#if IL_SL_SIGNALLING_N0371
     204  Bool     m_predScalingListFlag;                                                   //!< flag for inter-layer scaling-list prediction
     205  UInt     m_scalingListRefLayerId;                                                 //!< scaling_list_ref_layer_id 
     206#endif
     207
    180208  UInt     m_predMatrixId                [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index
    181   Int      *m_scalingListCoef            [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix
    182   Bool     m_useTransformSkip;                                                      //!< transform skipping flag for setting default scaling matrix for 4x4
     209  Int      *m_scalingListCoef            [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix                                           
    183210};
    184211
     
    406433};
    407434
     435#if REPN_FORMAT_IN_VPS
     436class RepFormat
     437{
     438  Int  m_chromaFormatVpsIdc;
     439  Bool m_separateColourPlaneVpsFlag;
     440  Int  m_picWidthVpsInLumaSamples;
     441  Int  m_picHeightVpsInLumaSamples;
     442  Int  m_bitDepthVpsLuma;               // coded as minus8
     443  Int  m_bitDepthVpsChroma;             // coded as minus8
     444
     445public:
     446  RepFormat();
     447
     448  Int  getChromaFormatVpsIdc()        { return m_chromaFormatVpsIdc; }
     449  Void setChromaFormatVpsIdc(Int x)   { m_chromaFormatVpsIdc = x;    }
     450
     451  Bool getSeparateColourPlaneVpsFlag()        { return m_separateColourPlaneVpsFlag; }
     452  Void setSeparateColourPlaneVpsFlag(Bool x)  { m_separateColourPlaneVpsFlag = x;    }
     453
     454  Int  getPicWidthVpsInLumaSamples()        { return m_picWidthVpsInLumaSamples; }
     455  Void setPicWidthVpsInLumaSamples(Int x)   { m_picWidthVpsInLumaSamples = x;    }
     456
     457  Int  getPicHeightVpsInLumaSamples()        { return m_picHeightVpsInLumaSamples; }
     458  Void setPicHeightVpsInLumaSamples(Int x)   { m_picHeightVpsInLumaSamples = x;    }
     459
     460  Int  getBitDepthVpsLuma()           { return m_bitDepthVpsLuma;   }
     461  Void setBitDepthVpsLuma(Int x)      { m_bitDepthVpsLuma = x;      }
     462
     463  Int  getBitDepthVpsChroma()           { return m_bitDepthVpsChroma;   }
     464  Void setBitDepthVpsChroma(Int x)      { m_bitDepthVpsChroma = x;      }
     465};
     466#endif
    408467class TComVPS
    409468{
     
    436495  Int         m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
    437496  Int         m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1];
     497#endif
     498#if IL_SL_SIGNALLING_N0371
     499  Bool        m_scalingListLayerDependency[MAX_LAYERS][MAX_LAYERS];  // layer dependency for scaling list
     500#endif
     501#if VPS_EXTN_OFFSET
     502  UInt        m_extensionOffset;
    438503#endif
    439504  TComPTL     m_pcPTL;
     
    491556  Bool       m_maxOneActiveRefLayerFlag;
    492557#endif
     558#if N0147_IRAP_ALIGN_FLAG
     559  Bool       m_crossLayerIrapAlignFlag;
     560#endif
    493561#if JCTVC_M0203_INTERLAYER_PRED_IDC
    494   UInt       m_maxSublayerForIlpPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1];
     562  UInt       m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1];
    495563#endif
    496564#if N0120_MAX_TID_REF_PRESENT_FLAG
    497   Bool       m_maxTidIlRefPicsPlus1PresentFlag;
     565  Bool       m_maxTidRefPresentFlag;
    498566#endif
    499567#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    500568  Bool       m_singleLayerForNonIrapFlag;
     569#endif
     570#if TILE_BOUNDARY_ALIGNED_FLAG
     571  Bool       m_tileBoundariesAlignedFlag[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     572#endif
     573#if N0160_VUI_EXT_ILP_REF   
     574  Bool        m_numIlpRestrictedRefLayers;
     575  Int         m_minSpatialSegmentOffsetPlus1[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     576  Bool        m_ctuBasedOffsetEnabledFlag   [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     577  Int         m_minHorizontalCtuOffsetPlus1 [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     578#endif
     579#if VPS_VUI_BITRATE_PICRATE
     580  Bool        m_bitRatePresentVpsFlag;
     581  Bool        m_picRatePresentVpsFlag;
     582  Bool        m_bitRatePresentFlag  [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     583  Bool        m_picRatePresentFlag  [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     584  Int         m_avgBitRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     585  Int         m_maxBitRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     586  Int         m_constPicRateIdc     [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     587  Int         m_avgPicRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     588#endif
     589#if REPN_FORMAT_IN_VPS
     590  Bool       m_repFormatIdxPresentFlag;
     591  Int        m_vpsNumRepFormats;            // coded as minus1
     592  RepFormat  m_vpsRepFormat[16];
     593  Int        m_vpsRepFormatIdx[16];
     594#endif
     595#if VIEW_ID_RELATED_SIGNALING
     596  Int         m_viewIdLenMinus1;
     597  Int         m_viewIdVal                [MAX_LAYERS];
    501598#endif
    502599public:
     
    565662  Void    deriveLayerIdListVariables();
    566663#endif
     664
     665#if IL_SL_SIGNALLING_N0371
     666  Bool    checkLayerDependency(UInt i, UInt j);
     667  Bool    getScalingListLayerDependency  ( UInt layerId, UInt refLayerId )            { return m_scalingListLayerDependency[layerId][refLayerId]; }
     668  Void    setScalingListLayerDependency  ( UInt layerId, UInt refLayerId, Bool val  ) { m_scalingListLayerDependency[layerId][refLayerId] = val;  }
     669#endif
     670
    567671  TComPTL* getPTL() { return &m_pcPTL; }
    568672  TimingInfo* getTimingInfo() { return &m_timingInfo; }
     
    659763  Void   setMaxOneActiveRefLayerFlag(Bool x)                                    { m_maxOneActiveRefLayerFlag = x;                         }
    660764#endif
     765#if N0147_IRAP_ALIGN_FLAG
     766  Bool   getCrossLayerIrapAlignFlag()                                           { return m_crossLayerIrapAlignFlag;                      }
     767  Void   setCrossLayerIrapAlignFlag(Bool x)                                     { m_crossLayerIrapAlignFlag = x;                         }
     768#endif
    661769#if JCTVC_M0203_INTERLAYER_PRED_IDC
    662   Bool   getMaxSublayerForIlpPlus1(Int layerId)                     { return m_maxSublayerForIlpPlus1[layerId];                   }
    663   Void   setMaxSublayerForIlpPlus1(Int layerId, UInt maxSublayer)   { m_maxSublayerForIlpPlus1[layerId] = maxSublayer;            }
     770  UInt   getMaxTidIlRefPicsPlus1(Int layerId)                     { return m_maxTidIlRefPicsPlus1[layerId];                   }
     771  Void   setMaxTidIlRefPicsPlus1(Int layerId, UInt maxSublayer)   { m_maxTidIlRefPicsPlus1[layerId] = maxSublayer;            }
    664772#endif
    665773#if N0120_MAX_TID_REF_PRESENT_FLAG
    666   Bool   getMaxTidIlRefPicsPlus1PresentFlag()                   { return m_maxTidIlRefPicsPlus1PresentFlag ;}
    667   Void   setMaxTidIlRefPicsPlus1PresentFlag(Bool x)             { m_maxTidIlRefPicsPlus1PresentFlag = x;}
     774  Bool   getMaxTidRefPresentFlag()                                  { return m_maxTidRefPresentFlag ;}
     775  Void   setMaxTidRefPresentFlag(Bool x)                            { m_maxTidRefPresentFlag = x;}
    668776#endif
    669777#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    670778  Bool   getSingleLayerForNonIrapFlag()                             { return m_singleLayerForNonIrapFlag; }
    671779  Void   setSingleLayerForNonIrapFlag(Bool x)                       { m_singleLayerForNonIrapFlag = x;    }
     780#endif
     781#if TILE_BOUNDARY_ALIGNED_FLAG 
     782  Bool   getTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId)           { return m_tileBoundariesAlignedFlag[currLayerId][refLayerId]; }
     783  Void   setTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId, Bool x)   { m_tileBoundariesAlignedFlag[currLayerId][refLayerId] = x; }
     784#endif
     785#if N0160_VUI_EXT_ILP_REF 
     786  Bool  getNumIlpRestrictedRefLayers   ( )                                         { return m_numIlpRestrictedRefLayers        ;}
     787  Void  setNumIlpRestrictedRefLayers   ( Int val )                                 { m_numIlpRestrictedRefLayers         = val;}
     788 
     789  Int  getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId )          { return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];}
     790  Void setMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId, Int val ) { m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId] = val;}
     791 
     792  Bool getCtuBasedOffsetEnabledFlag   ( Int currLayerId, Int refLayerId )            { return m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId];}
     793  Void setCtuBasedOffsetEnabledFlag   ( Int currLayerId, Int refLayerId, Bool flag ) { m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId] = flag;}
     794 
     795  Int  getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId )            { return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];}
     796  Void setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val )   { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val;} 
     797#endif
     798#if VPS_VUI_BITRATE_PICRATE
     799  Bool getBitRatePresentVpsFlag()       { return m_bitRatePresentVpsFlag; }
     800  Void setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x;    }
     801  Bool getPicRatePresentVpsFlag()       { return m_picRatePresentVpsFlag; }
     802  Void setPicRatePresentVpsFlag(Bool x) { m_picRatePresentVpsFlag = x;    }
     803
     804  Bool getBitRatePresentFlag(Int i, Int j)          { return m_bitRatePresentFlag[i][j]; }
     805  Void setBitRatePresentFlag(Int i, Int j, Bool x)  { m_bitRatePresentFlag[i][j] = x;    }
     806  Bool getPicRatePresentFlag(Int i, Int j)          { return m_picRatePresentFlag[i][j]; }
     807  Void setPicRatePresentFlag(Int i, Int j, Bool x)  { m_picRatePresentFlag[i][j] = x;    }
     808 
     809  Int  getAvgBitRate(Int i, Int j)          { return m_avgBitRate[i][j]; }
     810  Void setAvgBitRate(Int i, Int j, Int x)   { m_avgBitRate[i][j] = x;    }
     811  Int  getMaxBitRate(Int i, Int j)          { return m_maxBitRate[i][j]; }
     812  Void setMaxBitRate(Int i, Int j, Int x)   { m_maxBitRate[i][j] = x;    }
     813 
     814  Int  getConstPicRateIdc(Int i, Int j)          { return m_constPicRateIdc[i][j]; }
     815  Void setConstPicRateIdc(Int i, Int j, Int x)   { m_constPicRateIdc[i][j] = x;    }
     816  Int  getAvgPicRate(Int i, Int j)          { return m_avgPicRate[i][j]; }
     817  Void setAvgPicRate(Int i, Int j, Int x)   { m_avgPicRate[i][j] = x;    }
     818#endif
     819
     820#if REPN_FORMAT_IN_VPS
     821  Bool   getRepFormatIdxPresentFlag()       { return m_repFormatIdxPresentFlag; }
     822  Void   setRepFormatIdxPresentFlag(Bool x) { m_repFormatIdxPresentFlag = x;    }
     823
     824  Int    getVpsNumRepFormats()              { return m_vpsNumRepFormats;        }
     825  Void   setVpsNumRepFormats(Int x)         { m_vpsNumRepFormats = x;           }
     826
     827  RepFormat* getVpsRepFormat(Int idx)       { return &m_vpsRepFormat[idx];      }
     828
     829  Int    getVpsRepFormatIdx(Int idx)        { return m_vpsRepFormatIdx[idx];   }
     830  Void   setVpsRepFormatIdx(Int idx, Int x) { m_vpsRepFormatIdx[idx] = x;      }         
     831#endif
     832#if VIEW_ID_RELATED_SIGNALING
     833  Void    setViewIdLenMinus1( Int  val )                                   { m_viewIdLenMinus1 = val; }
     834  Int     getViewIdLenMinus1(  )                                           { return m_viewIdLenMinus1; }
     835
     836  Void    setViewIdVal( Int viewOrderIndex, Int  val )                     { m_viewIdVal[viewOrderIndex] = val; }
     837  Int     getViewIdVal( Int viewOrderIndex )                               { return m_viewIdVal[viewOrderIndex]; }
     838  Int     getScalabilityId(Int, ScalabilityType scalType );
     839
     840  Int     getViewIndex    ( Int layerIdInNuh )                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX  ); }   
     841
     842  Int     getNumViews();
     843  Int     scalTypeToScalIdx( ScalabilityType scalType );
     844#endif
     845#if VPS_EXTN_OFFSET
     846  Int     getExtensionOffset()                 { return m_extensionOffset;   }
     847  Void    setExtensionOffset( UInt offset )    { m_extensionOffset = offset; }
    672848#endif
    673849};
     
    9511127  Bool        m_scalingListEnabledFlag;
    9521128  Bool        m_scalingListPresentFlag;
     1129
    9531130  TComScalingList*     m_scalingList;   //!< ScalingList class pointer
     1131
    9541132  UInt        m_uiMaxDecPicBuffering[MAX_TLAYER];
    9551133  UInt        m_uiMaxLatencyIncrease[MAX_TLAYER];  // Really max latency increase plus 1 (value 0 expresses no limit)
     
    9751153#if SVC_EXTENSION
    9761154  UInt m_layerId;
     1155
     1156#if IL_SL_SIGNALLING_N0371
     1157  TComVPS*    m_pVPS;
     1158  static TComSPS* m_pcSPS[MAX_LAYERS];
     1159  Bool        m_predScalingListFlag;
     1160  UInt        m_scalingListRefLayerId;
     1161#endif
     1162
    9771163#endif
    9781164#if REF_IDX_MFM
     
    9841170  UInt        m_numScaledRefLayerOffsets;
    9851171  Window      m_scaledRefLayerWindow[MAX_LAYERS];
     1172#endif
     1173#if REPN_FORMAT_IN_VPS
     1174  Bool m_updateRepFormatFlag;
    9861175#endif
    9871176public:
     
    10941283  Bool getScalingListPresentFlag()         { return m_scalingListPresentFlag;     }
    10951284  Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag  = b;       }
     1285
     1286#if IL_SL_SIGNALLING_N0371
     1287  Bool getPredScalingListFlag()         { return m_predScalingListFlag;     }
     1288  Void setPredScalingListFlag( Bool b ) { m_predScalingListFlag  = b;       }
     1289  UInt getScalingListRefLayerId()         { return m_scalingListRefLayerId;   }
     1290  Void setScalingListRefLayerId( UInt b ) { m_scalingListRefLayerId  = b;       }
     1291
     1292  TComVPS*  getVPS()                      { return  m_pVPS; }
     1293  Void      setVPS( TComVPS* vps )        { m_pVPS = vps;   }
     1294  static   TComSPS* getSPS(UInt layerId)               { return m_pcSPS[layerId]; }
     1295  static   Void     setSPS(UInt layerId, TComSPS* sps) { m_pcSPS[layerId] = sps;  }
     1296#endif
     1297
    10961298  Void setScalingList      ( TComScalingList *scalingList);
    10971299  TComScalingList* getScalingList ()       { return m_scalingList; }               //!< get ScalingList class pointer in SPS
     1300
    10981301  UInt getMaxDecPicBuffering  (UInt tlayer)            { return m_uiMaxDecPicBuffering[tlayer]; }
    10991302  Void setMaxDecPicBuffering  ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui;   }
     
    11421345  Void     setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x; }
    11431346  Window&  getScaledRefLayerWindow( Int x )   { return m_scaledRefLayerWindow[x]; }
     1347#endif
     1348#if REPN_FORMAT_IN_VPS
     1349  Bool     getUpdateRepFormatFlag()       { return m_updateRepFormatFlag; }
     1350  Void     setUpdateRepFormatFlag(Bool x) { m_updateRepFormatFlag = x;    }
    11441351#endif
    11451352};
     
    12251432  Int      m_deblockingFilterTcOffsetDiv2;      //< tc offset for deblocking filter
    12261433  Bool     m_scalingListPresentFlag;
     1434
     1435#if SVC_EXTENSION
     1436  UInt m_layerId;
     1437
     1438#if IL_SL_SIGNALLING_N0371
     1439  static TComPPS* m_pcPPS[MAX_LAYERS];
     1440  Bool     m_predScalingListFlag;
     1441  UInt     m_scalingListRefLayerId;
     1442#endif
     1443
     1444#endif
     1445
    12271446  TComScalingList*     m_scalingList;   //!< ScalingList class pointer
     1447
    12281448  Bool m_listsModificationPresentFlag;
    12291449  UInt m_log2ParallelMergeLevelMinus2;
     
    13391559  Bool     getScalingListPresentFlag()         { return m_scalingListPresentFlag;     }
    13401560  Void     setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag  = b;       }
     1561
     1562#if IL_SL_SIGNALLING_N0371
     1563  Void     setLayerId(UInt layerId) { m_layerId = layerId; }
     1564  UInt     getLayerId() { return m_layerId; }
     1565
     1566  Bool     getPredScalingListFlag()         { return m_predScalingListFlag;     }
     1567  Void     setPredScalingListFlag( Bool b ) { m_predScalingListFlag  = b;       }
     1568  UInt     getScalingListRefLayerId()         { return m_scalingListRefLayerId;     }
     1569  Void     setScalingListRefLayerId( UInt b ) { m_scalingListRefLayerId  = b;       }
     1570
     1571  static   TComPPS* getPPS(UInt layerId)               { return m_pcPPS[layerId]; }
     1572  static   Void     setPPS(UInt layerId, TComPPS* pps) { m_pcPPS[layerId] = pps;  }
     1573#endif
     1574
    13411575  Void     setScalingList      ( TComScalingList *scalingList);
    13421576  TComScalingList* getScalingList ()          { return m_scalingList; }         //!< get ScalingList class pointer in PPS
     
    13841618  Int         m_iPOC;
    13851619  Int         m_iLastIDR;
    1386   static Int  m_prevPOC;
     1620  Int         m_iAssociatedIRAP;
     1621  NalUnitType m_iAssociatedIRAPType;
     1622  static Int  m_prevTid0POC;
    13871623  TComReferencePictureSet *m_pcRPS;
    13881624  TComReferencePictureSet m_LocalRPS;
     
    14041640  Int         m_interLayerPredLayerIdc  [MAX_VPS_LAYER_ID_PLUS1];
    14051641#else
    1406 #if REF_IDX_FRAMEWORK
     1642#if SVC_EXTENSION
    14071643  Int         m_numILRRefIdx;       //< for inter-layer reference picture ser
    14081644#endif
     
    14291665  Bool        m_bRefenced;
    14301666 
     1667#if POC_RESET_FLAG
     1668  Bool        m_bPocResetFlag;
     1669  Int         m_pocValueBeforeReset;
     1670#endif 
    14311671#if SH_DISCARDABLE_FLAG
    14321672  Bool        m_bDiscardableFlag;
    14331673#endif
    1434 
    14351674  // access channel
    14361675  TComVPS*    m_pcVPS;
     
    14601699  TComPic*    m_pcBaseColPic[MAX_LAYERS];
    14611700  TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS];
    1462 #if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING
     1701#if M0457_COL_PICTURE_SIGNALING
    14631702  Int         m_numMotionPredRefLayers;
    14641703#if REF_IDX_MFM
     
    15421781  Void      setRPSidx          ( Int iBDidx ) { m_iBDidx = iBDidx; }
    15431782  Int       getRPSidx          () { return m_iBDidx; }
    1544   Int       getPrevPOC      ()                          { return  m_prevPOC;       }
     1783  Int       getPrevTid0POC      ()                        { return  m_prevTid0POC;       }
    15451784  TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; }
    15461785  Void      setLastIDR(Int iIDRPOC)                       { m_iLastIDR = iIDRPOC; }
    15471786  Int       getLastIDR()                                  { return m_iLastIDR; }
     1787  Void      setAssociatedIRAPPOC(Int iAssociatedIRAPPOC)             { m_iAssociatedIRAP = iAssociatedIRAPPOC; }
     1788  Int       getAssociatedIRAPPOC()                        { return m_iAssociatedIRAP; }
     1789  Void      setAssociatedIRAPType(NalUnitType associatedIRAPType)    { m_iAssociatedIRAPType = associatedIRAPType; }
     1790  NalUnitType getAssociatedIRAPType()                        { return m_iAssociatedIRAPType; }
    15481791  SliceType getSliceType    ()                          { return  m_eSliceType;         }
    15491792  Int       getPOC          ()                          { return  m_iPOC;           }
     
    15711814  Void      checkColRefIdx      (UInt curSliceIdx, TComPic* pic);
    15721815  Bool      getIsUsedAsLongTerm (Int i, Int j)                  { return m_bIsUsedAsLongTerm[i][j]; }
     1816  Void      setIsUsedAsLongTerm (Int i, Int j, Bool value)      { m_bIsUsedAsLongTerm[i][j] = value; }
    15731817  Bool      getCheckLDC     ()                                  { return m_bCheckLDC; }
    15741818  Bool      getMvdL1ZeroFlag ()                                  { return m_bLMvdL1Zero;    }
     
    15801824  Void      setReferenced(Bool b)                               { m_bRefenced = b; }
    15811825  Bool      isReferenced()                                      { return m_bRefenced; }
    1582   Void      setPOC              ( Int i )                       { m_iPOC              = i; if(getTLayer()==0) m_prevPOC=i; }
     1826  Bool      isReferenceNalu()                                   { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); }
     1827  Void      setPOC              ( Int i )                       { m_iPOC              = i; if ((getTLayer()==0) && (isReferenceNalu() && (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) {m_prevTid0POC=i;} }
    15831828  Void      setNalUnitType      ( NalUnitType e )               { m_eNalUnitType      = e;      }
    15841829  NalUnitType getNalUnitType    () const                        { return m_eNalUnitType;        }
     
    15911836#endif
    15921837
     1838#if POC_RESET_FLAG
     1839  Bool      getPocResetFlag  ()                              { return m_bPocResetFlag; }
     1840  Void      setPocResetFlag  (Bool b)                        { m_bPocResetFlag = b; }
     1841  Int       getPocValueBeforeReset ()                        { return m_pocValueBeforeReset; }
     1842  Void      setPocValueBeforeReset (Int x)                   { m_pocValueBeforeReset = x ; }
     1843#endif
    15931844#if SH_DISCARDABLE_FLAG
    15941845  Bool      getDiscardableFlag  ()                              { return m_bDiscardableFlag; }
     
    15961847#endif
    15971848
    1598   Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic);
     1849  Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic);
    15991850  Void      decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic);
    16001851  Void      setSliceType        ( SliceType e )                 { m_eSliceType        = e;      }
     
    16651916  Void setTLayerInfo( UInt uiTLayer );
    16661917  Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum );
     1918  Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic );
    16671919  Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList);
    16681920  Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );
     
    17311983  Void  setScalingList              ( TComScalingList* scalingList ) { m_scalingList = scalingList; }
    17321984  TComScalingList*   getScalingList ()                               { return m_scalingList; }
     1985
     1986#if IL_SL_SIGNALLING_N0371
     1987  Void  setDefaultScalingList       ( UInt m_layerId );
     1988#else
    17331989  Void  setDefaultScalingList       ();
     1990#endif
     1991
    17341992  Bool  checkDefaultScalingList     ();
    17351993  Void      setCabacInitFlag  ( Bool val ) { m_cabacInitFlag = val;      }  //!< set CABAC initial flag
     
    17612019#endif
    17622020
    1763 #if REF_IDX_FRAMEWORK
    17642021  Void      setRefPicListModificationSvc();
    17652022  Int       getNumILRRefIdx     ( )                     { return  m_pcVPS->getNumDirectRefLayers( m_layerId ); }
     
    17892046#endif
    17902047
    1791 #if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING
     2048#if M0457_COL_PICTURE_SIGNALING
    17922049  Void      setNumMotionPredRefLayers(int i)            { m_numMotionPredRefLayers = i; }
    17932050  Int       getNumMotionPredRefLayers()                 { return m_numMotionPredRefLayers; }
     
    18062063#endif
    18072064
    1808 #else
    1809   // temporal solution for IntraBL. Only one reference layer is supported.
    1810   Int       getActiveNumILRRefIdx     ( )               { return  1; }
    1811   Int       getInterLayerPredLayerIdc (UInt layerIdx)   { return  m_layerId - 1;}
    1812   Void      setActiveNumILRRefIdx     ( Int i )         {}
    1813   Void      setInterLayerPredEnabledFlag( Bool   val )  {}
    1814 #endif
    1815 
    18162065TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); }
    18172066
    18182067#endif //SVC_EXTENSION
    18192068
     2069#if REPN_FORMAT_IN_VPS
     2070  UInt getPicWidthInLumaSamples();
     2071  UInt getPicHeightInLumaSamples();
     2072  UInt getChromaFormatIdc();
     2073  UInt getBitDepthY();
     2074  UInt getBitDepthC();
     2075  Int getQpBDOffsetY();
     2076  Int getQpBDOffsetC();
     2077#endif
    18202078protected:
    18212079  TComPic*  xGetRefPic  (TComList<TComPic*>& rcListPic,
  • trunk/source/Lib/TLibCommon/TComTrQuant.cpp

    r345 r442  
    4242#include "TComPic.h"
    4343#include "ContextTables.h"
    44 
     44#define MAYBE_BUGFIX 1
    4545typedef struct
    4646{
     
    5050  Double d64SigCost;
    5151  Double d64SigCost_0;
     52#if MAYBE_BUGFIX
     53  Void init()
     54  {
     55    iNNZbeforePos0 = 0;
     56  d64CodedLevelandDist = 0;
     57  d64UncodedDist = 0;
     58  d64SigCost = 0;
     59  d64SigCost_0 = 0;
     60  }
     61#endif
    5262} coeffGroupRDStats;
    5363
     
    10331043
    10341044    Int qpScaled;
     1045#if REPN_FORMAT_IN_VPS
     1046    Int qpBDOffset = (eTType == TEXT_LUMA)? pcCU->getSlice()->getQpBDOffsetY() : pcCU->getSlice()->getQpBDOffsetC();
     1047#else
    10351048    Int qpBDOffset = (eTType == TEXT_LUMA)? pcCU->getSlice()->getSPS()->getQpBDOffsetY() : pcCU->getSlice()->getSPS()->getQpBDOffsetC();
     1049#endif
    10361050
    10371051    if(eTType == TEXT_LUMA)
     
    15811595    UInt uiCGPosY   = uiCGBlkPos / uiNumBlkSide;
    15821596    UInt uiCGPosX   = uiCGBlkPos - (uiCGPosY * uiNumBlkSide);
     1597#if MAYBE_BUGFIX
     1598    rdStats.init();
     1599#else
    15831600    ::memset( &rdStats, 0, sizeof (coeffGroupRDStats));
    1584    
     1601#endif
    15851602    const Int patternSigCtx = TComTrQuant::calcPatternSigCtx(uiSigCoeffGroupFlag, uiCGPosX, uiCGPosY, uiWidth, uiHeight);
    15861603    for (Int iScanPosinCG = uiCGSize-1; iScanPosinCG >= 0; iScanPosinCG--)
     
    24772494/** set flat matrix value to quantized coefficient
    24782495 */
     2496#if IL_SL_SIGNALLING_N0371
     2497Void TComTrQuant::setFlatScalingList( UInt m_layerId )
     2498#else
    24792499Void TComTrQuant::setFlatScalingList()
     2500#endif
    24802501{
    24812502  UInt size,list;
     
    24862507    for(list = 0; list <  g_scalingListNum[size]; list++)
    24872508    {
     2509#if IL_SL_SIGNALLING_N0371
     2510      ref_scalingListDC[m_layerId][size][list] = SCALING_LIST_DC;
     2511      for(UInt i=0; i<MAX_MATRIX_COEF_NUM; i++)
     2512      {
     2513        ref_scalingListCoef[m_layerId][size][list][i] = SCALING_LIST_DC;
     2514      }
     2515#endif
     2516
    24882517      for(qp=0;qp<SCALING_LIST_REM_NUM;qp++)
    24892518      {
  • trunk/source/Lib/TLibCommon/TComTrQuant.h

    r313 r442  
    181181  Void setUseScalingList   ( Bool bUseScalingList){ m_scalingListEnabledFlag = bUseScalingList; };
    182182  Bool getUseScalingList   (){ return m_scalingListEnabledFlag; };
     183
     184#if IL_SL_SIGNALLING_N0371
     185  Void setFlatScalingList  ( UInt m_layerId );
     186#else
    183187  Void setFlatScalingList  ();
     188#endif
     189
    184190  Void xsetFlatScalingList ( UInt list, UInt size, UInt qp);
    185191  Void xSetScalingListEnc  ( TComScalingList *scalingList, UInt list, UInt size, UInt qp);
  • trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r345 r442  
    151151  Pel* piDstV;
    152152
    153 #if SIMPLIFIED_MV_POS_SCALING
    154153  Int scaleX = g_posScalingFactor[refLayerIdc][0];
    155154  Int scaleY = g_posScalingFactor[refLayerIdc][1];
    156 #else
    157   Int   scaleX     = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL;
    158   Int   scaleY     = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL;
    159 #endif
    160155
    161156  if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x
    162157  {
    163     piSrcY = piSrcBufY - scalEL.getWindowLeftOffset() - scalEL.getWindowTopOffset() * strideEL;
    164     piDstY = piDstBufY;
    165     for( i = 0; i < heightEL; i++ )
     158    piSrcY = piSrcBufY;
     159    piDstY = piDstBufY + scalEL.getWindowLeftOffset() + scalEL.getWindowTopOffset() * strideEL;
     160    for( i = 0; i < heightBL; i++ )
    166161    {
    167162      memcpy( piDstY, piSrcY, sizeof(Pel) * widthBL );
     
    179174    strideEL  = pcUsPic->getCStride();
    180175
    181     piSrcU = piSrcBufU - ( scalEL.getWindowLeftOffset() >> 1 ) - ( scalEL.getWindowTopOffset() >> 1 ) * strideEL;
    182     piSrcV = piSrcBufV - ( scalEL.getWindowLeftOffset() >> 1 ) - ( scalEL.getWindowTopOffset() >> 1 ) * strideEL;
    183 
    184     piDstU = piDstBufU;
    185     piDstV = piDstBufV;
    186 
    187     for( i = 0; i < heightEL; i++ )
     176    piSrcU = piSrcBufU;
     177    piSrcV = piSrcBufV;
     178
     179    piDstU = piDstBufU + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL;
     180    piDstV = piDstBufV + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL;
     181
     182    for( i = 0; i < heightBL; i++ )
    188183    {
    189184      memcpy( piDstU, piSrcU, sizeof(Pel) * widthBL );
     
    238233    Int shiftYM4 = shiftY - 4;
    239234
    240 #if ILP_DECODED_PICTURE
    241235    widthEL   = pcUsPic->getWidth ();
    242236    heightEL  = pcUsPic->getHeight();
     
    244238    widthBL   = pcBasePic->getWidth ();
    245239    heightBL  = min<Int>( pcBasePic->getHeight(), heightEL );
    246 #endif
    247240#if SCALED_REF_LAYER_OFFSETS
    248241    Int leftStartL = scalEL.getWindowLeftOffset();
     
    395388    }
    396389
    397 #if ILP_DECODED_PICTURE
    398390#if SCALED_REF_LAYER_OFFSETS
    399391    widthBL   = pcBasePic->getWidth ();
     
    408400    widthEL   = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    409401    heightEL  = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    410 #endif
    411402#endif
    412403
     
    451442    shiftYM4 = shiftY - 4;
    452443
    453 #if !SIMPLIFIED_MV_POS_SCALING
    454     scaleX     = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL;
    455     scaleY     = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL;
    456 #endif
    457 
    458 #if ILP_DECODED_PICTURE
    459444    widthEL   = pcUsPic->getWidth () >> 1;
    460445    heightEL  = pcUsPic->getHeight() >> 1;
     
    462447    widthBL   = pcBasePic->getWidth () >> 1;
    463448    heightBL  = min<Int>( pcBasePic->getHeight() >> 1, heightEL );
    464 #endif
    465449
    466450#if  N0214_INTERMEDIATE_BUFFER_16BITS
     
    639623#endif
    640624    }
    641 
     625  }
    642626    pcUsPic->setBorderExtension(false);
    643627    pcUsPic->extendPicBorder   (); // extend the border.
     
    647631    pcTempPic->setBorderExtension(false);
    648632    pcBasePic->setBorderExtension(false);
    649   }
    650633}
    651634#endif //SVC_EXTENSION
  • trunk/source/Lib/TLibCommon/TComWeightPrediction.h

    r313 r442  
    5353class TComWeightPrediction
    5454{
    55   wpScalingParam  m_wp0[3], m_wp1[3];
    56 
    5755public:
    5856  TComWeightPrediction();
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r345 r442  
    4141#define SVC_EXTENSION                    1
    4242
    43 #define N0139_POSITION_ROUNDING_OFFSET   1
    44 
    4543#define SYNTAX_BYTES                     10      ///< number of bytes taken by syntaxes per 4x4 block [RefIdxL0(1byte), RefIdxL1(1byte), MVxL0(2bytes), MVyL0(2bytes), MVxL1(2bytes), MVyL1(2bytes)]
    4644
     45#define RANDOM_ACCESS_SEI_FIX            1
    4746#if SVC_EXTENSION
     47#define VPS_NUH_LAYER_ID                 1      ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0
    4848#define MAX_LAYERS                       2      ///< max number of layers the codec is supposed to handle
    49 #define RPL_INIT_N0316_N0082             1      ///< N0316, N0082: initial reference picture list construction
    50 #define FINAL_RPL_CHANGE_N0082           1      ///< N0082: final ref picture list change (encoder)
    51 #define M0464_TILE_BOUNDARY_ALIGNED_FLAG 1      ///< VUI flag to indicate tile boundary alignment
    52 #define M0463_VUI_EXT_ILP_REF            1      ///< VUI extension inter-layer dependency offset signalling
     49#define POC_RESET_FLAG                   1      ///< JCTVC-N0244: POC reset flag for  layer pictures.
     50#define ALIGN_TSA_STSA_PICS              1      ///< JCTVC-N0084: Alignment of TSA and STSA pictures across AU.
     51#define REPN_FORMAT_IN_VPS               1      ///< JCTVC-N0092: Signal represenation format (spatial resolution, bit depth, colour format) in the VPS
     52#define TIMING_INFO_NONZERO_LAYERID_SPS  1      ///< JCTVC-N0085: Semantics of vui_timing_info_present_flag to always set that flag to zero for non-zero layer ID SPS
     53#define RPL_INIT_N0316_N0082             1      ///< JCTVC-N0316, JCTVC-N0082: initial reference picture list construction
     54#define FINAL_RPL_CHANGE_N0082           1      ///< JCTVC-N0082: final ref picture list change (encoder)
     55#if FINAL_RPL_CHANGE_N0082
     56#define EXTERNAL_USEDBYCURR_N0082        1      ///< JCTVC-N0082: final ref picture list change (encoder) //dev ver.
     57#define TEMP_SCALABILITY_FIX             1      ///< fix for temporal scalability
     58#endif
     59#define IL_SL_SIGNALLING_N0371           0      ///< JCTVC-N0371: inter-layer scaling list
     60#define M0464_TILE_BOUNDARY_ALIGNED_FLAG 0      ///< JCTVC-M0464: VUI flag to indicate tile boundary alignment
     61#define M0463_VUI_EXT_ILP_REF            0      ///< JCTVC-M0463: VUI extension inter-layer dependency offset signalling
    5362#define SPS_EXTENSION                    1      ///< Define sps_extension() syntax structure
    54 #define SCALED_REF_LAYER_OFFSET_FLAG     0      ///< M0309: Signal scaled reference layer offsets in SPS
    55 #define SCALED_REF_LAYER_OFFSETS         1      ///< M0309: Signal scaled reference layer offsets in SPS
     63#define SCALED_REF_LAYER_OFFSETS         1      ///< JCTVC-M0309: Signal scaled reference layer offsets in SPS
     64#define VERT_MV_CONSTRAINT               1      ///< Vertical MV component constraint flag
     65#define SCALABILITY_MASK_E0104           1      ///< JCT3V-E0104: scalability mask for depth
    5666
    5767#define ILP_SSH_SIG                      1      ///< JCTVC-N0195 proposal 2, JCTVC-N0118: add presence flag in VPS ext to condition inter-layer prediction signaling in slice segment header
     
    6676#define VPS_EXTN_PROFILE_INFO            1      ///< Include profile information for layer sets in VPS extension
    6777#define VPS_EXTN_DIRECT_REF_LAYERS       1      ///< Include indication of direct dependency of layers in VPS extension
    68 #define VPS_OUTPUT_LAYER_SET_IDX         1      ///< M0268: Signal output_layer_set_idx[i] as output_layer_set_idx_minus1[i]
    69 #define VPS_MOVE_DIR_DEPENDENCY_FLAG     1      ///< M0268: Move the syntax element direct_dependency_flag to follow the syntax element dimension_id
    70 #define VPS_PROFILE_OUTPUT_LAYERS        1      ///< M0268: Signal profile information and output layer information as in Sec. 3 of M0268v2
    71 #define SPS_SUB_LAYER_INFO               1      ///< M0268: Do not signal sps_max_sub_layers_minus1 and sps_temporal_id_nesting_flag for nuh_layer_id greater than 0
    72 #define VPS_SPLIT_FLAG                   1      ///< M0163: Do not signal dimension_id and the last dimension_id_len_minus1, when splitting_flag is equal to 1.
     78#define VPS_OUTPUT_LAYER_SET_IDX         1      ///< JCTVC-M0268: Signal output_layer_set_idx[i] as output_layer_set_idx_minus1[i]
     79#define VPS_MOVE_DIR_DEPENDENCY_FLAG     1      ///< JCTVC-M0268: Move the syntax element direct_dependency_flag to follow the syntax element dimension_id
     80#define VPS_PROFILE_OUTPUT_LAYERS        1      ///< JCTVC-M0268: Signal profile information and output layer information as in Sec. 3 of M0268v2
     81#define SPS_SUB_LAYER_INFO               1      ///< JCTVC-M0268: Do not signal sps_max_sub_layers_minus1 and sps_temporal_id_nesting_flag for nuh_layer_id greater than 0
     82#define VPS_SPLIT_FLAG                   1      ///< JCTVC-M0163: Do not signal dimension_id and the last dimension_id_len_minus1, when splitting_flag is equal to 1.
    7383#define M0457_PREDICTION_INDICATIONS     1
    7484#define M0040_ADAPTIVE_RESOLUTION_CHANGE 1
    75 #endif
    76 
    77 #define SH_DISCARDABLE_FLAG              1      ///< M0152: Use one reserved flag in the slice header for discardable flag
     85#define VPS_VUI                          1      ///< Include function structure for VPS VUI
     86
     87#if VPS_VUI
     88#define TILE_BOUNDARY_ALIGNED_FLAG       1      ///< JCTVC-N0160/JCTVC-N0199 proposal 2 variant 2: VPS VUI flag to indicate tile boundary alignment
     89#define N0160_VUI_EXT_ILP_REF            1      ///< VUI extension inter-layer dependency offset signalling
     90#define VPS_VUI_BITRATE_PICRATE          1      ///< JCTVC-N0085: Signal bit rate and picture in VPS VUI
     91#else
     92#define M0464_TILE_BOUNDARY_ALIGNED_FLAG 0      ///< VUI flag to indicate tile boundary alignment
     93#endif //VPS_VUI
     94
     95#endif
     96
     97#define VPS_EXTN_OFFSET                  1      ///< implementation of vps_extension_offset syntax element
     98#define SPS_PTL_FIX                      1      ///< remove profile_tier_level from enhancement layer SPS
     99#define SH_DISCARDABLE_FLAG              1      ///< JCTVC-M0152: Use one reserved flag in the slice header for discardable flag
    78100
    79101#define DERIVE_LAYER_ID_LIST_VARIABLES   1      ///< Derived variables based on the variables in VPS - for use in syntax table parsing
    80102
    81 #define SVC_COL_BLK                      1      ///< get co-located block
    82103#define SVC_UPSAMPLING                   1      ///< upsampling filters
    83104#define ROUNDING_OFFSET                  1      ///< JCTVC-N0111: upsampling rounding offset using scalling factors
    84 #define N0214_INTERMEDIATE_BUFFER_16BITS 1      ///< JCTVC-N0214 support base layer input more than 8 bits
     105#define N0214_INTERMEDIATE_BUFFER_16BITS 1      ///< JCTVC-N0214: support base layer input more than 8 bits
    85106#define ARBITRARY_SPATIAL_RATIO          0      ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio
    86107#define BUGFIX_RESAMPLE                  1      ///< JCTVC-N0055: resampling bug fix for positive left scalled offset
    87108
    88 #define SIMPLIFIED_MV_POS_SCALING        1      ///< M0133/M0449: inter-layer MV scaling and pixel mapping position calculation
    89 #define ILP_DECODED_PICTURE              1      ///< M0274: use decoded picture for inter-layer prediction
    90109#define JCTVC_M0259_LAMBDAREFINEMENT     1      ///< JCTVC-M0259: lambda refinement (encoder only optimization)
    91110#define RESTR_CHK                        1      ///< JCTVC-M0208 proposal 1
    92111#define ILP_RAP                          1      ///< JCTVC-M0208 proposal 3
    93112
    94 #define REF_IDX_FRAMEWORK                1      ///< inter-layer reference framework
    95 
    96 #define IDR_ALIGNMENT                    1      ///< align IDR picures across layers
    97 
    98113#define AVC_BASE                         1      ///< YUV BL reading for AVC base SVC
    99114#if AVC_BASE
     
    101116#endif
    102117
    103 #if REF_IDX_FRAMEWORK
    104 #define REF_IDX_ME_ZEROMV                1      ///< L0051: use zero motion for inter-layer reference picture (without fractional ME)
    105 #define ENCODER_FAST_MODE                1      ///< L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1.
    106 #define REF_IDX_MFM                      1      ///< L0336: motion vector mapping of inter-layer reference picture
     118#define REF_IDX_ME_ZEROMV                1      ///< JCTVC-L0051: use zero motion for inter-layer reference picture (without fractional ME)
     119#define ENCODER_FAST_MODE                1      ///< JCTVC-L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1.
     120#define REF_IDX_MFM                      1      ///< JCTVC-L0336: motion vector mapping of inter-layer reference picture
    107121#define JCTVC_M0458_INTERLAYER_RPS_SIG   1      ///< implementation of JCTVC-L0178
    108122#if JCTVC_M0458_INTERLAYER_RPS_SIG
    109123#define MAX_ONE_RESAMPLING_DIRECT_LAYERS 1      ///< Allow maximum of one resampling process for direct reference layers
    110 #endif
    111 #define JCTVC_M0203_INTERLAYER_PRED_IDC  1      ///< implementation of JCTVC-M0203 Inter-layer Prediction Indication
     124#define MOTION_RESAMPLING_CONSTRAINT     1      ///< JCTVC-N0108: Allow maximum of one motion resampling process for direct reference layers, and use motion inter-layer prediction from the same layer as texture inter-layer prediction.
     125#endif
     126#define JCTVC_M0203_INTERLAYER_PRED_IDC  1      ///< JCTVC-M0203: implementation of Inter-layer Prediction Indication
    112127#if JCTVC_M0203_INTERLAYER_PRED_IDC
    113 #define ILR_RESTR                        1      ///< JCTVC-M0209 Inter-layer RPS and RPL
    114 #define N0120_MAX_TID_REF_PRESENT_FLAG   1      ///< JCTVC-N0120 max_tid_ref_pics_plus1_present_flag
     128#define ILR_RESTR                        1      ///< JCTVC-M0209: Inter-layer RPS and RPL
     129#define ILR_RESTR_FIX                    1      ///< Fix encoder crash when temporal layers are used with scalable coding
     130#define EARLY_REF_PIC_MARKING            1      ///< Decoded picture marking of sub-layer non-reference pictures
     131#define N0120_MAX_TID_REF_PRESENT_FLAG   1      ///< JCTVC-N0120: max_tid_ref_pics_plus1_present_flag
     132#define N0120_MAX_TID_REF_CFG            1      ///< set max_tid_il_ref_pics_plus1 and max_tid_ref_present_flag in the config. file (configuration setting)
    115133#endif
    116134#if REF_IDX_MFM
    117 #define REMOVE_COL_PICTURE_SIGNALING     1      ///< JCTVC-N0107 remove alternative collocated picture signalling
     135#define REMOVE_COL_PICTURE_SIGNALING     1      ///< JCTVC-N0107: remove alternative collocated picture signalling
    118136#define M0457_COL_PICTURE_SIGNALING      1
     137#define N0139_POSITION_ROUNDING_OFFSET   1      ///< JCTVC-N0139: offset for collocated block in motion mapping
    119138#endif
    120139
     
    124143#define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0      ///< shall be 0, JCTVC-N0107
    125144#endif
    126 #endif
    127 
    128 #define FAST_INTRA_SHVC                  1      ///< M0115: reduction number of intra modes in the EL (encoder only)
     145
     146#define N0147_IRAP_ALIGN_FLAG            1      ///< a flag to indicatate whether IRAPs are aligned across layers
     147#if !N0147_IRAP_ALIGN_FLAG
     148#define IDR_ALIGNMENT                    1      ///< align IDR picures across layers : As per JCTVC-N0373, IDR are not required to be aligned.
     149#endif
     150#define FAST_INTRA_SHVC                  1      ///< JCTVC-M0115: reduction number of intra modes in the EL (encoder only)
    129151#if FAST_INTRA_SHVC
    130 #define NB_REMAIN_MODES                  2      ///< nb of remaining modes (M0115)
    131 #endif
    132 
    133 #define RC_SHVC_HARMONIZATION            1      ///< JCTVC-M0037, rate control for SHVC
    134 
    135 #else
    136 #define ILP_DECODED_PICTURE              0
     152#define NB_REMAIN_MODES                  2      ///< JCTVC-M0115: nb of remaining modes
     153#endif
     154
     155#define RC_SHVC_HARMONIZATION            1      ///< JCTVC-M0037: rate control for SHVC
     156
     157#define VIEW_ID_RELATED_SIGNALING        1      ///< Introduce syntax elements view_id_len_minus1 and view_id_val
     158#define M0043_LAYERS_PRESENT_SEI         0      ///< JCTVC-M0043: add layers present SEI. Macro shall be equal to 0 according to the JCTVC-N0174 discussion. The code is to be removed.
     159#define N0383_IL_CONSTRAINED_TILE_SETS_SEI  1
     160#define N0065_LAYER_POC_ALIGNMENT        1
     161#else
    137162#define SYNTAX_OUTPUT                    0
    138163#endif // SVC_EXTENSION
     
    143168
    144169#define FIX1071 1 ///< fix for issue #1071
    145 #define M0043_LAYERS_PRESENT_SEI         0 ///< M0043: add layers present SEI
    146170
    147171#define MAX_NUM_PICS_IN_SOP           1024
     
    606630  };
    607631}
     632#if VIEW_ID_RELATED_SIGNALING
     633/// scalability types
     634  enum ScalabilityType
     635  {
     636    VIEW_ORDER_INDEX  = 1,
     637    SCALABILITY_ID = 2,
     638  };
     639#endif
    608640//! \}
    609641
Note: See TracChangeset for help on using the changeset viewer.