Changeset 1317 in 3DVCSoftware for branches/HTM-15.0-dev0/source/Lib/TLibCommon


Ignore:
Timestamp:
4 Sep 2015, 21:28:58 (10 years ago)
Author:
tech
Message:

Clean-ups. HLS.

Location:
branches/HTM-15.0-dev0/source/Lib/TLibCommon
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/CommonDef.h

    r1314 r1317  
    278278static const Int  MAX_NUM_VIDEO_SIGNAL_INFO =                     16 ;
    279279static const Int  MAX_NUM_SCALED_REF_LAYERS =     MAX_NUM_LAYERS - 1 ;
     280static const Int  MAX_NUM_PICS_RPS          =                     16 ;
     281static const Int  MAX_NUM_REF_LAYERS        =                     63 ; 
    280282#endif
    281283
     
    367369#endif
    368370
     371#if NH_MV
     372static const std::string NALU_TYPE_STR[] = { 
     373    "CODED_SLICE_TRAIL_N   ",  // 0
     374    "CODED_SLICE_TRAIL_R   ",  // 1
     375    "CODED_SLICE_TSA_N     ",  // 2
     376    "CODED_SLICE_TSA_R     ",  // 3
     377    "CODED_SLICE_STSA_N    ",  // 4
     378    "CODED_SLICE_STSA_R    ",  // 5
     379    "CODED_SLICE_RADL_N    ",  // 6
     380    "CODED_SLICE_RADL_R    ",  // 7
     381    "CODED_SLICE_RASL_N    ",  // 8
     382    "CODED_SLICE_RASL_R    ",  // 9
     383    "RESERVED_VCL_N10      ",
     384    "RESERVED_VCL_R11      ",
     385    "RESERVED_VCL_N12      ",
     386    "RESERVED_VCL_R13      ",
     387    "RESERVED_VCL_N14      ",
     388    "RESERVED_VCL_R15      ",
     389    "CODED_SLICE_BLA_W_LP  ",  // 16
     390    "CODED_SLICE_BLA_W_RADL",  // 17
     391    "CODED_SLICE_BLA_N_LP  ",  // 18
     392    "CODED_SLICE_IDR_W_RADL",  // 19
     393    "CODED_SLICE_IDR_N_LP  ",  // 20
     394    "CODED_SLICE_CRA       ",  // 21
     395    "RESERVED_IRAP_VCL22   ",
     396    "RESERVED_IRAP_VCL23   ",
     397    "RESERVED_VCL24        ",
     398    "RESERVED_VCL25        ",
     399    "RESERVED_VCL26        ",
     400    "RESERVED_VCL27        ",
     401    "RESERVED_VCL28        ",
     402    "RESERVED_VCL29        ",
     403    "RESERVED_VCL30        ",
     404    "RESERVED_VCL31        ",
     405    "VPS                   ",   // 32
     406    "SPS                   ",   // 33
     407    "PPS                   ",   // 34
     408    "ACCESS_UNIT_DELIMITER ",   // 35
     409    "EOS                   ",   // 36
     410    "EOB                   ",   // 37
     411    "FILLER_DATA           ",   // 38
     412    "PREFIX_SEI            ",   // 39
     413    "SUFFIX_SEI            ",   // 40
     414    "RESERVED_NVCL41       ",
     415    "RESERVED_NVCL42       ",
     416    "RESERVED_NVCL43       ",
     417    "RESERVED_NVCL44       ",
     418    "RESERVED_NVCL45       ",
     419    "RESERVED_NVCL46       ",
     420    "RESERVED_NVCL47       ",
     421    "UNSPECIFIED_48        ",
     422    "UNSPECIFIED_49        ",
     423    "UNSPECIFIED_50        ",
     424    "UNSPECIFIED_51        ",
     425    "UNSPECIFIED_52        ",
     426    "UNSPECIFIED_53        ",
     427    "UNSPECIFIED_54        ",
     428    "UNSPECIFIED_55        ",
     429    "UNSPECIFIED_56        ",
     430    "UNSPECIFIED_57        ",
     431    "UNSPECIFIED_58        ",
     432    "UNSPECIFIED_59        ",
     433    "UNSPECIFIED_60        ",
     434    "UNSPECIFIED_61        ",
     435    "UNSPECIFIED_62        ",
     436    "UNSPECIFIED_63        ",
     437    "INVALID               "               
     438  };
     439#endif
    369440
    370441#if NH_3D
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/Debug.cpp

    r1313 r1317  
    152152EnvVar DebugOptionList::ForceLumaMode         ("FORCE_LUMA_MODE",   "0", "Force a particular intra direction for Luma (0-34)"                                             );
    153153EnvVar DebugOptionList::ForceChromaMode       ("FORCE_CHROMA_MODE", "0", "Force a particular intra direction for chroma (0-5)"                                            );
    154 
    155 #if DEBUG_STRING
    156 EnvVar DebugOptionList::DebugString_Structure ("DEBUG_STRUCTURE",   "3", "Produce output on chosen structure                        bit0=intra, bit1=inter");
    157 EnvVar DebugOptionList::DebugString_Pred      ("DEBUG_PRED",        "3", "Produce output on prediction data.                        bit0=intra, bit1=inter");
    158 EnvVar DebugOptionList::DebugString_Resi      ("DEBUG_RESI",        "3", "Produce output on residual data.                          bit0=intra, bit1=inter");
    159 EnvVar DebugOptionList::DebugString_Reco      ("DEBUG_RECO",        "3", "Produce output on reconstructed data.                     bit0=intra, bit1=inter");
     154                                                                     
     155#if DEBUG_STRING                                                     
     156EnvVar DebugOptionList::DebugString_Structure ("DEBUG_STRUCTURE",   "0", "Produce output on chosen structure                        bit0=intra, bit1=inter");
     157EnvVar DebugOptionList::DebugString_Pred      ("DEBUG_PRED",        "0", "Produce output on prediction data.                        bit0=intra, bit1=inter");
     158EnvVar DebugOptionList::DebugString_Resi      ("DEBUG_RESI",        "0", "Produce output on residual data.                          bit0=intra, bit1=inter");
     159EnvVar DebugOptionList::DebugString_Reco      ("DEBUG_RECO",        "0", "Produce output on reconstructed data.                     bit0=intra, bit1=inter");
    160160EnvVar DebugOptionList::DebugString_InvTran   ("DEBUG_INV_QT",      "0", "Produce output on inverse-quantiser and transform stages. bit0=intra, bit1=inter");
    161161#endif
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/NAL.h

    r1313 r1317  
    9898        || m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R;
    9999  }
     100#if NH_MV
     101  Bool isIrap()
     102  {
     103   return  m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
     104        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     105        || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
     106        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     107        || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
     108        || m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA;
     109  }
     110
     111  Bool isIdr()
     112  {
     113    return  m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     114         || m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP;
     115  }
     116
     117  Bool isBla()
     118  {
     119    return  m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
     120         || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     121         || m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP;
     122  }
     123
     124  Bool isCra()
     125  {
     126   return  m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA;
     127  }
     128
     129
     130#endif
    100131  Bool isSei()
    101132  {
     
    108139    return ( (UInt)m_nalUnitType < 32 );
    109140  }
     141#if NH_MV
     142  Void print( )
     143  {
     144    std::cout << "Type: " << NALU_TYPE_STR[m_nalUnitType] << " LayerId: " << m_nuhLayerId << " TemporalId: " << m_temporalId;
     145  }
     146#endif
    110147};
    111148
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComBitStream.cpp

    r1313 r1317  
    4141#include <string.h>
    4242#include <memory.h>
    43 
     43#if NH_MV
     44#include "TComRom.h" // This is only here, since ENC_DEC_TRACE is currently there. Consider removing when this has changed.
     45#endif
    4446using namespace std;
    4547
     
    258260  m_numBitsRead += uiNumberOfBits;
    259261
     262#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
     263  if ( g_traceBitsRead )
     264  {
     265      Bool oldJustDoIt = g_bJustDoIt;
     266      g_bJustDoIt = true;
     267      writeToTraceFile( "Bits: ", m_numBitsRead, true );
     268      g_bJustDoIt = oldJustDoIt;
     269  }
     270#endif
     271
    260272  /* NB, bits are extracted from the MSB of each byte. */
    261273  UInt retval = 0;
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComCodingStatistics.h

    r1313 r1317  
    102102  STATS__CABAC_BITS__3D_IC,
    103103#endif
    104 #if NH_3D_DMM || NH_3D_SDC_INTRA || H_3D_INTER_SDC
     104#if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    105105  STATS__CABAC_BITS__DELTADC_SIGN_EP,
    106106  STATS__CABAC_BITS__DELTADC_PREFIX,
     
    174174    "CABAC_BITS__3D_IC"
    175175#endif
    176 #if NH_3D_DMM || NH_3D_SDC_INTRA || H_3D_INTER_SDC
     176#if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER
    177177   ,"STATS__CABAC_BITS__DELTADC_SIGN_EP"
    178178   ,"STATS__CABAC_BITS__DELTADC_PREFIX"
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r1313 r1317  
    29342934}
    29352935
    2936 #if NH_3D_FIX_PRUNING
     2936#if NH_3D
    29372937Bool TComDataCU::hasEqualMotion( Int dirA, const TComMvField* mvFieldA, Int dirB, const TComMvField* mvFieldB )
    29382938{
     
    30463046      if( !iLoop && ivCandDir[0] > 0)
    30473047      {
    3048 #if NH_3D_FIX_PRUNING
    30493048        if( hasEqualMotion(tmpDir, tmpMV, m_mergCands[MRG_IVMC].m_uDir, m_mergCands[MRG_IVMC].m_cMvField ))
    3050 #else
    3051         if(tmpDir == m_mergCands[MRG_IVMC].m_uDir && m_mergCands[MRG_IVMC].m_cMvField[0]==tmpMV[0] && m_mergCands[MRG_IVMC].m_cMvField[1]==tmpMV[1])
    3052 #endif
    30533049        {
    30543050            bRemove                         = true;
     
    31013097  }
    31023098
     3099
     3100#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
     3101  if ( g_traceMergeCandListConst )
     3102  {
     3103    for (Int i = 0; i<MRG_IVSHIFT+1; i++)
     3104    {
     3105      m_mergCands[i].print( i );
     3106    }
     3107  }
     3108#endif
     3109
     3110
    31033111  Int iCount = 0;
    31043112  TComMv cZeroMv;
     
    31563164    pcMvFieldNeighbours[(ui<<1)+1].setMvField(cZeroMv, NOT_VALID);
    31573165  }
     3166
    31583167  // copy extMergeCandList to output
    31593168  for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ui++ )
     
    31613170    puhInterDirNeighbours[ui] = uhInterDirNeighboursExt[ui];
    31623171    pcMvFieldNeighbours[ui<<1].setMvField(extMergeCandList[ui<<1].getMv(), extMergeCandList[ui<<1].getRefIdx());
     3172
    31633173    if ( getSlice()->isInterB() )
     3174    {
    31643175      pcMvFieldNeighbours[(ui<<1)+1].setMvField(extMergeCandList[(ui<<1)+1].getMv(), extMergeCandList[(ui<<1)+1].getRefIdx());
    3165   }
     3176    }
     3177  }
     3178
     3179#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
     3180  if ( g_traceMergeCandListConst )
     3181  {
     3182    std::cout << std::setfill(' ')                          << std::setw( 15 )
     3183      <<  "Num"                                             << std::setw( 15 )
     3184      <<  "Dir "                                            << std::setw( 15 )
     3185      <<  "L0 RefIdx"                                       << std::setw( 15 )
     3186      <<  "L0 Hor"                                          << std::setw( 15 )
     3187      <<  "L0 Ver"                                          << std::setw( 15 )
     3188      <<  "L1 RefIdx"                                       << std::setw( 15 )
     3189      <<  "L1 Hor"                                          << std::setw( 15 )
     3190      <<  "L1 Ver"                                          << std::setw( 15 )
     3191      << std::endl;
     3192
     3193    // copy extMergeCandList to output
     3194    for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ui++ )
     3195    {
     3196      UChar curDir        = puhInterDirNeighbours[ui];
     3197      TComMvField& curf   = pcMvFieldNeighbours[ui<<1];
     3198      TComMvField& curf2  = pcMvFieldNeighbours[(ui<<1)+1];
     3199
     3200      std::cout << std::setfill(' ')                         << std::setw( 15 )
     3201        << ui                                                << std::setw( 15 )       
     3202        << (UInt) curDir                                     << std::setw( 15 )   
     3203        << ((curDir & 1) ? curf.getRefIdx()       : MIN_INT) << std::setw( 15 )
     3204        << ((curDir & 1) ? curf.getMv().getHor()  : MIN_INT) << std::setw( 15 )
     3205        << ((curDir & 1) ? curf.getMv().getVer()  : MIN_INT) << std::setw( 15 );
     3206
     3207      if ( getSlice()->isInterB() )
     3208      {     
     3209        std::cout << ((curDir & 2) ? curf2.getRefIdx() : MIN_INT) << std::setw( 15 )
     3210          << ((curDir & 1) ? curf2.getMv().getHor()    : MIN_INT) << std::setw( 15 )
     3211          << ((curDir & 1) ? curf2.getMv().getVer()    : MIN_INT) << std::setw( 15 );
     3212      }
     3213      std::cout << std::endl;
     3214    }
     3215  }
     3216#endif
    31663217  numValidMergeCand = iCount;
    31673218  assert(iCount == getSlice()->getMaxNumMergeCand());
     
    35033554          continue;
    35043555        }
    3505 #if NH_3D_FIX_PRUNING
    35063556        if (hasEqualMotion( tmpDir, tmpMV, m_mergCands[MRG_A1+iCnloop].m_uDir, m_mergCands[MRG_A1+iCnloop].m_cMvField ) )
    3507 #else
    3508         if (tmpDir == m_mergCands[MRG_A1+iCnloop].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+iCnloop].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+iCnloop].m_cMvField[1])
    3509 #endif
    35103557        {
    35113558          m_mergCands[MRG_A1+iCnloop].m_bAvailable = false;
     
    35813628          continue;
    35823629        }
    3583 #if NH_3D_FIX_PRUNING
    35843630        if (hasEqualMotion(ivCandDir[0], tmpMV, m_mergCands[MRG_A1+i].m_uDir,  m_mergCands[MRG_A1+i].m_cMvField) )
    3585 #else
    3586         if (ivCandDir[0] == m_mergCands[MRG_A1+i].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+i].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+i].m_cMvField[1])
    3587 #endif
    35883631        {
    35893632          m_mergCands[MRG_A1+i].m_bAvailable = false;
     
    35943637    else
    35953638    {
    3596 #if NH_3D_FIX_PRUNING
    35973639      if( hasEqualMotion( ivCandDir[0], tmpMV, m_mergCands[MRG_T].m_uDir, m_mergCands[MRG_T].m_cMvField ) )
    3598 #else
    3599       if (m_mergCands[MRG_T].m_bAvailable && ivCandDir[0] == m_mergCands[MRG_T].m_uDir && tmpMV[0]==m_mergCands[MRG_T].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_T].m_cMvField[1])
    3600 #endif
    36013640      {
    36023641        bRemoveSpa                      = true;
     
    36473686      !bARPFlag &&
    36483687#endif
    3649 #if H_3D || NH_3D_FIX_VSP
     3688#if NH_3D
    36503689      (nPSW + nPSH > 12) &&
    36513690#endif
     
    36943733        continue;
    36953734      }
    3696 #if NH_3D_FIX_PRUNING
    36973735      if ( hasEqualMotion(ivCandDir[1], tmpMV, m_mergCands[MRG_A1+i].m_uDir, m_mergCands[MRG_A1+i].m_cMvField) )
    3698 #else
    3699       if (ivCandDir[1] == m_mergCands[MRG_A1+i].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+i].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+i].m_cMvField[1])
    3700 #endif
    37013736      {
    37023737        bRemoveSpa                      = true;
     
    48524887  }
    48534888}
     4889#if NH_3D
     4890Void TComDataCU::printMV( )
     4891
     4892
     4893  for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
     4894  {
     4895    std::cout << "L" << i;
     4896    m_acCUMvField[i].print(m_pePredMode);
     4897  }
     4898
     4899}
     4900#endif
    48544901
    48554902UInt TComDataCU::getCoefScanIdx(const UInt uiAbsPartIdx, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) const
     
    52845331#if NH_3D_NBDV_REF
    52855332          TComPic* picDepth = NULL;
    5286           assert(getSlice()->getRefPic(eRefPicList, refId)->getPOC() == getSlice()->getPOC());         
     5333          assert(getSlice()->getRefPic(eRefPicList, refId)->getPOC() == getSlice()->getPOC());           
    52875334#if H_3D_FCO_VSP_DONBDV_E0163
    52885335          picDepth  = getSlice()->getIvPic(true, getSlice()->getViewIndex() );
     
    56275674    if(!m_pcSlice->getIsDepth())
    56285675    {
    5629 #if H_3D_DBBP || NH_3D_ALIGN_SPIVMP_DBBP
     5676#if NH_3D_DBBP
    56305677      if (!getDBBPFlag(0))
    56315678#else
     
    58035850      iCurrPosY  += ( iHeight >> 1 );
    58045851    }
    5805 #if H_3D_DBBP || NH_3D_ALIGN_SPIVMP_DBBP
     5852#if NH_3D_DBBP
    58065853    for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    58075854#else
     
    58785925    }
    58795926#if NH_3D_SPIVMP
    5880 #if H_3D_DBBP || NH_3D_ALIGN_SPIVMP_DBBP
     5927#if NH_3D_DBBP
    58815928    for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    58825929#else
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComDataCU.h

    r1313 r1317  
    601601#if NH_3D
    602602  Void          compressMV            ( Int scale );
     603  Void          printMV               ( );
    603604#else           
    604605  Void          compressMV            ();
     
    644645
    645646  Bool          hasEqualMotion              ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx );
    646 #if NH_3D_FIX_PRUNING
     647#if NH_3D
    647648  Bool          hasEqualMotion              ( Int dirA, const TComMvField* mvFieldA,  Int dirB, const TComMvField* mvFieldB  );
    648649#endif
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComMotionInfo.cpp

    r1313 r1317  
    4444#include "TComPic.h"
    4545#endif
    46 
     46#if NH_MV
     47#include <iomanip>
     48#endif
    4749//! \ingroup TLibCommon
    4850//! \{
     
    377379  }
    378380}
     381
     382#if NH_MV
     383Void TComCUMvField::print(Char* pePredMode)
     384{
     385  for ( Int uiPartIdx = 0; uiPartIdx < m_uiNumPartition; uiPartIdx += 1 )
     386  {
     387    PredMode predMode = static_cast<PredMode>( pePredMode[ uiPartIdx ] );
     388
     389    if ( predMode == MODE_INTRA)
     390    {
     391      std::cout << std::setfill(' ') << "("
     392        << std::setw(3) <<  "   "    << ","
     393        << std::setw(3) <<  "   "    << ","
     394        << std::setw(3) <<  "   "    << ")";
     395    }
     396    else
     397    {
     398      ;
     399      std::cout << std::setfill(' ') << "("
     400        << std::setw(3) <<  (Int) m_piRefIdx[ uiPartIdx ]        << ","
     401        << std::setw(3) <<  m_pcMv[ uiPartIdx ].getHor()   << ","
     402        << std::setw(3) <<  m_pcMv[ uiPartIdx ].getVer()   << ")";
     403    }   
     404  }
     405}
     406
     407#if NH_3D_MLC
     408Void TComMotionCand::print( Int i )
     409{
     410  if (i == 0  )
     411  {
     412
     413    std::cout << std::setfill(' ')                          << std::setw( 15 )
     414      << "Num"                                              << std::setw( 15 )
     415      << "Avai"                                             << std::setw( 15 )
     416      << "Dir "                                             << std::setw( 15 )
     417      <<  "L0 RefIdx"                                       << std::setw( 15 )
     418      <<  "L0 Hor"                                          << std::setw( 15 )
     419      <<  "L0 Ver"                                          << std::setw( 15 )
     420      <<  "L1 RefIdx"                                       << std::setw( 15 )
     421      <<  "L1 Hor"                                          << std::setw( 15 )
     422      <<  "L1 Ver"                                          << std::setw( 15 )
     423      << "VspFlag"                                          << std::setw( 15 )
     424      << "SPIVMPFlag"                                       
     425      << std::endl;
     426  }
     427
     428  std::cout << std::setfill(' ')                                  << std::setw( 15 )
     429    << i                                                          << std::setw( 15 )
     430    << m_bAvailable                                               << std::setw( 15 )
     431    << (UInt) m_uDir                                              << std::setw( 15 )
     432    << ((m_uDir & 1) ? m_cMvField[0].getRefIdx()       : MIN_INT) << std::setw( 15 )
     433    << ((m_uDir & 1) ? m_cMvField[0].getMv().getHor()  : MIN_INT) << std::setw( 15 )
     434    << ((m_uDir & 1) ? m_cMvField[0].getMv().getVer()  : MIN_INT) << std::setw( 15 )
     435    << ((m_uDir & 2) ? m_cMvField[1].getRefIdx()       : MIN_INT) << std::setw( 15 )
     436    << ((m_uDir & 2) ? m_cMvField[1].getMv().getHor()  : MIN_INT) << std::setw( 15 )
     437    << ((m_uDir & 2) ? m_cMvField[1].getMv().getVer()  : MIN_INT) << std::setw( 15 )
     438    << m_iVspFlag                                                 << std::setw( 15 )
     439    << m_bSPIVMPFlag                                              << std::setw( 15 )
     440    << std::endl;
     441}
     442#endif
     443#endif
    379444//! \}
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComMotionInfo.h

    r1313 r1317  
    4343#include "CommonDef.h"
    4444#include "TComMv.h"
     45
    4546//! \ingroup TLibCommon
    4647//! \{
     
    188189 
    189190  Void compress(Char* pePredMode, Int scale);
     191#if NH_MV
     192  Void print   (Char* pePredMode);
     193#endif
    190194};
    191195
     
    281285#endif
    282286  }
     287
     288
     289  Void print( Int i );
     290
    283291};
     292
     293
    284294#endif
    285295
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComPic.cpp

    r1313 r1317  
    5454, m_bReconstructed                        (false)
    5555, m_bNeededForOutput                      (false)
    56 #if NH_MV
    57 , m_bPicOutputFlag                        (false)
    58 #endif
    5956, m_uiCurrSliceIdx                        (0)
    6057, m_bCheckLTMSB                           (false)
     
    6259, m_layerId                               (0)
    6360, m_viewId                                (0)
     61, m_bPicOutputFlag                        (false)
    6462#if NH_3D
    6563, m_viewIndex                             (0)
     
    8280  m_eRapRefList       = REF_PIC_LIST_0;
    8381  m_uiRapRefIdx       = 0;
     82#endif
     83#if NH_MV
     84  m_isPocResettingPic = false;   
     85  m_hasGeneratedRefPics = false;
     86  m_isFstPicOfAllLayOfPocResetPer = false;
     87  m_decodingOrder     = 0;
     88  m_noRaslOutputFlag  = false; 
     89  m_noClrasOutputFlag = false;
     90  m_picLatencyCount   = 0;
     91  m_isGenerated       = false;
     92  m_isGeneratedCl833  = false;
     93  m_activatesNewVps   = false;
    8494#endif
    8595}
     
    185195  }
    186196}
     197
    187198
    188199Bool  TComPic::getSAOMergeAvailability(Int currAddr, Int mergeAddr)
     
    231242
    232243#if NH_MV
    233 Void TComPic::print( Bool legend )
    234 {
    235   if ( legend )
    236     std::cout  << std::endl << "LId"        << "\t" << "POC"   << "\t" << "Rec"          << "\t" << "Ref"                       << "\t" << "LT"            <<  "\t" << "OutMark" <<  "\t" << "OutFlag" << std::endl;
    237   else
    238     std::cout  << getLayerId() << "\t" << getPOC()<< "\t" << getReconMark() << "\t" << getSlice(0)->isReferenced() << "\t" << getIsLongTerm() << "\t" << getOutputMark() << "\t" << getSlice(0)->getPicOutputFlag() <<std::endl;
    239 }
    240 
    241 TComPic* TComPicLists::getPic( Int layerIdInNuh, Int poc )
    242 {
    243   TComPic* pcPic = NULL;
    244   for(TComList<TComList<TComPic*>*>::iterator itL = m_lists.begin(); ( itL != m_lists.end() && pcPic == NULL ); itL++)
    245   {   
    246     for(TComList<TComPic*>::iterator itP=(*itL)->begin(); ( itP!=(*itL)->end() && pcPic == NULL ); itP++)
    247     {
    248       TComPic* currPic = (*itP);
    249       if ( ( currPic->getPOC() == poc ) && ( currPic->getLayerId() == layerIdInNuh ) )
    250       {
    251         pcPic = currPic ;     
    252       }
    253     }
    254   }
    255   return pcPic;
     244Bool TComPic::getPocResetPeriodId()
     245{
     246  return getSlice(0)->getPocResetIdc();
     247}
     248
     249Void TComPic::markAsUsedForShortTermReference()
     250{
     251  getSlice(0)->setReferenced( true );
     252  setIsLongTerm( false );
     253}
     254
     255Void TComPic::markAsUsedForLongTermReference()
     256{
     257  getSlice(0)->setReferenced( true );
     258  setIsLongTerm( true );
     259}
     260
     261
     262Void TComPic::markAsUnusedForReference()
     263{
     264  getSlice(0)->setReferenced( false );
     265  setIsLongTerm( false );
     266}
     267
     268
     269Bool TComPic::getMarkedUnUsedForReference()
     270{
     271  return !getSlice(0)->isReferenced( );
     272}
     273
     274
     275Bool TComPic::getMarkedAsShortTerm()
     276{
     277  return ( getSlice(0)->isReferenced( ) && !getIsLongTerm() );
     278}
     279
     280Void TComPic::print( Int outputLevel )
     281{
     282  if ( outputLevel== 0  )
     283  {
     284    std::cout  << std::endl
     285      << "LId"
     286      << "\t" << "POC"
     287      << "\t" << "Rec"
     288      << "\t" << "Ref"
     289      << "\t" << "LT"
     290      << "\t" << "OutMark"
     291      << "\t" << "OutFlag"
     292      << "\t" << "Type"
     293      << "\t" << "PReFlag"
     294      << std::endl;
     295  }
     296  else if( outputLevel == 1  )
     297  {
     298    std::cout  << getLayerId()
     299      << "\t" << getPOC()
     300      << "\t" << getReconMark()
     301      << "\t" << getSlice(0)->isReferenced()
     302      << "\t" << getIsLongTerm()
     303      << "\t" << getOutputMark()
     304      << "\t" << getSlice(0)->getPicOutputFlag()
     305      << "\t" << getSlice(0)->getNalUnitTypeString()
     306      << "\t" << getSlice(0)->getPocResetFlag()
     307      << std::endl;
     308  }
     309  else if ( outputLevel == 2  )
     310  {
     311    std::cout  << std:: setfill(' ')
     312      << " LayerId: "         << std::setw(2) << getLayerId()
     313      << "\t"  << " POC: "             << std::setw(5) << getPOC()
     314      << "\t"  << " Dec. Order: "      << std::setw(5) << getDecodingOrder()
     315      << "\t"  << " Referenced: "      << std::setw(1) << getSlice(0)->isReferenced()
     316      << "\t"  << " Pic type: "        <<                 getSlice(0)->getNalUnitTypeString()
     317      << "\t"  << " Generated: "       << std::setw(1) << getIsGenerated()
     318      << "\t"  << " Gen. Ref. Pics: "  << std::setw(1) << getHasGeneratedRefPics();
     319  }
     320  else if ( outputLevel == 4  )
     321  {
     322    std::cout  << std:: setfill(' ')
     323      << " LayerId: "         << std::setw(2) << getLayerId()
     324      << "\t"  << " POC: "             << std::setw(5) << getPOC()     
     325      << "\t"  << " Referenced: "      << std::setw(1) << getSlice(0)->isReferenced() << std::endl;
     326  }
    256327}
    257328
    258329#if NH_3D
    259 TComPic* TComPicLists::getPic( Int viewIndex, Bool depthFlag, Int poc )
    260 {
    261   return getPic   ( m_vps->getLayerIdInNuh( viewIndex, depthFlag ), poc );
    262 }
    263 #endif
    264 Void TComPicLists::print()
    265 {
    266   Bool first = true;     
    267   for(TComList<TComList<TComPic*>*>::iterator itL = m_lists.begin(); ( itL != m_lists.end() ); itL++)
    268   {   
    269     for(TComList<TComPic*>::iterator itP=(*itL)->begin(); ( itP!=(*itL)->end() ); itP++)
    270     {
    271       if ( first )
    272       {
    273         (*itP)->print( true );       
    274         first = false;
    275       }
    276       (*itP)->print( false );       
    277     }
    278   }
    279 }
    280 
    281 TComPicYuv* TComPicLists::getPicYuv( Int layerIdInNuh, Int poc, Bool reconFlag )
    282 {
    283   TComPic*    pcPic = getPic( layerIdInNuh, poc );
    284   TComPicYuv* pcPicYuv = NULL;
    285 
    286   if (pcPic != NULL)
    287   {
    288     if( reconFlag )
    289     {
    290       if ( pcPic->getReconMark() )
    291       {
    292         pcPicYuv = pcPic->getPicYuvRec();
    293       }
    294     }
    295     else
    296     {
    297       pcPicYuv = pcPic->getPicYuvOrg();
    298     }
    299   };
    300 
    301   return pcPicYuv;
    302 }
    303 
    304 #if NH_3D
    305 TComPicYuv* TComPicLists::getPicYuv( Int viewIndex, Bool depthFlag, Int poc, Bool recon )
    306 
    307   Int layerIdInNuh = m_vps->getLayerIdInNuh( viewIndex, depthFlag );
    308   return getPicYuv( layerIdInNuh, poc, recon );
    309 }
    310 #if NH_3D_ARP
    311 TComList<TComPic*>* TComPicLists::getPicList( Int layerIdInNuh )
    312 {
    313   TComList<TComList<TComPic*>*>::iterator itL = m_lists.begin();
    314   Int iLayer = 0;
    315 
    316   assert( layerIdInNuh < m_lists.size() );
    317 
    318   while( iLayer != layerIdInNuh )
    319   {
    320     itL++;
    321     iLayer++;
    322   }
    323 
    324   return *itL;
    325 }
    326 #endif
    327 #endif
    328 #endif // NH_MV
     330Void TComPic::printMotion()
     331{
     332  TComPicSym* pPicSym = getPicSym();
     333  for ( UInt uiCUAddr = 0; uiCUAddr < pPicSym->getNumberOfCtusInFrame(); uiCUAddr++ )
     334  {
     335    TComDataCU* pCtu = pPicSym->getCtu(uiCUAddr);
     336    std::cout << "CUAddr " << uiCUAddr << std::endl;
     337    pCtu->printMV();
     338    std::cout << std::endl;
     339  }
     340}
    329341
    330342#if NH_3D_NBDV
     
    437449          m_abTIVRINCurrRL[curCandPic][iColRefDir][iColRefIdx] = false;
    438450          Int iColViewIdx    = pcCandColSlice->getViewIndex();
     451#if H_3D_FIX_ARP_CHECK_NOT_IN_DPB
     452          // The picture pcCandColSlice->getRefPic((RefPicList)iColRefDir, iColRefIdx) might not be in DPB anymore
     453          // So don't access it directly.
     454          Int iColRefViewIdx = pcCandColSlice->getVPS()->getViewOrderIdx( pcCandColSlice->getRefLayerId( (RefPicList)iColRefDir, iColRefIdx ) );       
     455#else
    439456          Int iColRefViewIdx = pcCandColSlice->getRefPic((RefPicList)iColRefDir, iColRefIdx)->getViewIndex();
     457#endif
    440458          if(iColViewIdx == iColRefViewIdx)
    441459          {
     
    487505        {
    488506          if(pcCurrSlice->getRefPOC((RefPicList)iCurrRefDir, iCurrRefIdx ) == iTextRefPOC &&
    489              pcCurrSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId)
     507            pcCurrSlice->getRefPic((RefPicList)iCurrRefDir, iCurrRefIdx)->getViewIndex() == iTextRefViewId)
    490508          { 
    491             m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx;
     509            m_aiTexToDepRef[iTextRefDir][iTextRefIdx] = iCurrRefIdx;           
    492510          }
    493511        }
     
    504522}
    505523#endif
     524#endif
     525
     526Void TComAu::setPicLatencyCount( Int picLatenyCount )
     527{
     528  for(TComList<TComPic*>::iterator itP= begin();  itP!= end(); itP++)
     529  {     
     530    (*itP)->setPicLatencyCount( picLatenyCount );
     531  }
     532}
     533
     534TComPic* TComAu::getPic( Int nuhLayerId )
     535{
     536  TComPic* pic = NULL;
     537  for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (pic == NULL) ); itP++)
     538  {     
     539    if ( (*itP)->getLayerId() == nuhLayerId )
     540    {
     541      pic = (*itP);
     542    }
     543  }
     544  return pic;
     545}
     546
     547Void TComAu::addPic( TComPic* pic, Bool pocUnkown )
     548{
     549  if ( !empty() )
     550  {
     551    if (!pocUnkown)
     552    {
     553      assert( pic->getPOC()   == ( getPoc() ));
     554    }     
     555    pic->setPicLatencyCount( getPicLatencyCount() );
     556
     557    assert( getPic( pic->getLayerId() ) == NULL );
     558
     559    // Add sorted
     560    TComAu::iterator itP = begin();
     561    Bool inserted = false;
     562    while( !inserted )
     563    {
     564      if ( ( itP == end()) || pic->getLayerId() < (*itP)->getLayerId() )
     565      {
     566        insert(itP, pic );
     567        inserted = true;
     568      }
     569      else
     570      {
     571        ++itP;
     572      }       
     573    }     
     574  }
     575  else
     576  {
     577    pushBack( pic );     
     578  }
     579}
     580
     581Bool TComAu::containsPic( TComPic* pic )
     582{
     583  Bool isInList = false;
     584  for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (!isInList) ); itP++)
     585  {
     586    isInList = isInList || ( pic == (*itP));
     587  }
     588  return isInList;
     589}
     590
     591TComSubDpb::TComSubDpb( Int nuhLayerid )
     592{
     593  m_nuhLayerId = nuhLayerid;
     594}
     595
     596TComPic* TComSubDpb::getPic( Int poc )
     597{
     598  TComPic* pic = NULL;
     599  for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (pic == NULL) ); itP++)
     600  {     
     601    if ( (*itP)->getPOC() == poc )
     602    {
     603      pic = (*itP);
     604    }
     605  }
     606  return pic;
     607}
     608
     609TComPic* TComSubDpb::getPicFromLsb( Int pocLsb, Int maxPicOrderCntLsb )
     610{
     611  TComPic* pic = NULL;
     612  for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (pic == NULL) ); itP++)
     613  {     
     614    if ( ( (*itP)->getPOC() & ( maxPicOrderCntLsb - 1 ) ) == pocLsb )
     615    {
     616      pic = (*itP);
     617    }
     618  }
     619  return pic;
     620}
     621
     622TComPic* TComSubDpb::getShortTermRefPic( Int poc )
     623{
     624  TComPic* pic = NULL;
     625  for(TComList<TComPic*>::iterator itP= begin(); ( itP!= end() && (pic == NULL) ); itP++)
     626  {     
     627    if ( (*itP)->getPOC() == poc && (*itP)->getMarkedAsShortTerm() )
     628    {
     629      pic = (*itP);
     630    }
     631  }
     632  return pic;
     633}
     634
     635TComList<TComPic*> TComSubDpb::getPicsMarkedNeedForOutput()
     636{
     637  TComList<TComPic*> picsMarkedNeedForOutput;
     638
     639  for(TComList<TComPic*>::iterator itP= begin();  itP!= end() ; itP++ )
     640  {     
     641    if ( (*itP)->getOutputMark() )
     642    {
     643      picsMarkedNeedForOutput.push_back( (*itP) );
     644    }
     645  }
     646  return picsMarkedNeedForOutput;
     647}
     648
     649Void TComSubDpb::markAllAsUnusedForReference()
     650{
     651  for(TComList<TComPic*>::iterator itP= begin();  itP!= end() ; itP++ )
     652  {     
     653    (*itP)->markAsUnusedForReference();
     654  }
     655}
     656
     657Void TComSubDpb::addPic( TComPic* pic )
     658{
     659  assert( pic != NULL );
     660  assert( m_nuhLayerId == pic->getLayerId() || m_nuhLayerId == -1);     
     661  if ( !empty() )
     662  {
     663    assert( getPic( pic->getPOC() ) == NULL ); // Don't add twice; assert( pic->getLayerId() == m_nuhLayerId );           
     664
     665    // Add sorted
     666    TComSubDpb::iterator itP = begin();
     667    Bool inserted = false;
     668    while( !inserted )
     669    {
     670      if ( ( itP == end()) || pic->getPOC() < (*itP)->getPOC() )
     671      {
     672        insert(itP, pic );
     673        inserted = true;
     674      }
     675      else
     676      {
     677        ++itP;
     678      }       
     679    }     
     680  }
     681  else
     682  {
     683    pushBack( pic );
     684  }
     685}
     686
     687Void TComSubDpb::removePics( std::vector<TComPic*> picToRemove )
     688{
     689  for (Int i = 0; i < picToRemove.size(); i++ )
     690  {
     691    if( picToRemove[i] != NULL)
     692    {
     693      remove( picToRemove[i] );
     694    }
     695  }
     696}
     697
     698Bool TComSubDpb::areAllPicsMarkedNotNeedForOutput()
     699{
     700  return ( getPicsMarkedNeedForOutput().size() == 0 );
     701}
     702
     703
     704TComPicLists::~TComPicLists()
     705{
     706  emptyAllSubDpbs();
     707  for(TComList<TComSubDpb*>::iterator itL = m_subDpbs.begin(); ( itL != m_subDpbs.end()); itL++)
     708  {     
     709    if ( (*itL) != NULL )
     710    {
     711      delete (*itL);
     712      (*itL) = NULL;
     713    }
     714  }
     715}
     716
     717Void TComPicLists::addNewPic( TComPic* pic )
     718{
     719  getSubDpb ( pic->getLayerId() , true )->addPic( pic );
     720  getAu     ( pic->getPOC()     , true )->addPic( pic , false );
     721  if ( m_printPicOutput )
     722  {
     723    std::cout << "  Add    picture: ";
     724    pic->print( 2 );
     725    std::cout << std::endl;
     726  }
     727}
     728
     729Void TComPicLists::removePic( TComPic* pic )
     730{
     731  if (pic != NULL)
     732  {
     733
     734    TComSubDpb* curSubDpb = getSubDpb( pic->getLayerId(), false );
     735    curSubDpb->remove( pic );
     736
     737    TComAu* curAu = getAu     ( pic->getPOC(), false );       
     738
     739    if (curAu != NULL)
     740    {   
     741      curAu->remove( pic );
     742      // Remove AU when empty.
     743      if (curAu->empty() )
     744      {
     745        m_aus.remove( curAu );
     746        delete curAu;
     747      }
     748    }
     749
     750    if ( m_printPicOutput )
     751    {
     752      std::cout << "  Remove picture: ";
     753      pic->print( 2 );
     754      std::cout << std::endl;
     755    }
     756
     757    pic->destroy();
     758    delete pic;
     759  }
     760}
     761
     762TComPic* TComPicLists::getPic( Int layerIdInNuh, Int poc )
     763{
     764  TComPic* pcPic = NULL;
     765  TComSubDpb* subDpb = getSubDpb( layerIdInNuh, false );
     766  if ( subDpb != NULL )
     767  {
     768    pcPic = subDpb->getPic( poc );
     769  }
     770  return pcPic;
     771}
     772
     773TComPicYuv* TComPicLists::getPicYuv( Int layerIdInNuh, Int poc, Bool reconFlag )
     774{
     775  TComPic*    pcPic = getPic( layerIdInNuh, poc );
     776  TComPicYuv* pcPicYuv = NULL;
     777
     778  if (pcPic != NULL)
     779  {
     780    if( reconFlag )
     781    {
     782      if ( pcPic->getReconMark() )
     783      {
     784        pcPicYuv = pcPic->getPicYuvRec();
     785      }
     786    }
     787    else
     788    {
     789      pcPicYuv = pcPic->getPicYuvOrg();
     790    }
     791  };
     792
     793  return pcPicYuv;
     794}
     795
     796TComSubDpb* TComPicLists::getSubDpb( Int nuhLayerId, Bool create )
     797{
     798  TComSubDpb* subDpb = NULL;
     799  for(TComList<TComSubDpb*>::iterator itL = m_subDpbs.begin(); ( itL != m_subDpbs.end() && subDpb == NULL ); itL++)
     800  {     
     801    if ( (*itL)->getLayerId() == nuhLayerId )
     802    {       
     803      subDpb = (*itL);
     804    }
     805  } 
     806  if ( subDpb == NULL && create )
     807  {
     808    m_subDpbs.push_back( new TComSubDpb(nuhLayerId) );
     809  }
     810  return subDpb;
     811}
     812
     813TComList<TComSubDpb*>* TComPicLists::getSubDpbs()
     814{
     815  return (&m_subDpbs);
     816}
     817
     818TComAu* TComPicLists::addAu( Int poc )
     819{
     820  TComList<TComAu*>::iterator itA = m_aus.begin();
     821
     822  assert( getAu(poc, false) == NULL );
     823  Bool inserted = false;
     824  while( !inserted)
     825  {     
     826    if ( ( itA == m_aus.end()) || poc < (*itA)->getPoc() )
     827    {       
     828      m_aus.insert(itA, new TComAu );       
     829      inserted = true;
     830      --itA;
     831    }
     832    else
     833    {
     834      ++itA;
     835    }
     836  }
     837  return (*itA);
     838}
     839
     840TComAu* TComPicLists::getAu( Int poc, Bool create )
     841{
     842  TComAu* au = NULL;
     843
     844  for( TComList<TComAu*>::iterator itA = m_aus.begin(); ( itA != m_aus.end() && au == NULL ); itA++)
     845  {
     846    if ( (*itA)->getPoc() == poc )
     847    {       
     848      au = (*itA);
     849    }
     850  } 
     851
     852  if ( au == NULL && create )
     853  {
     854    au = addAu( poc );
     855  }
     856  return au;
     857}
     858
     859TComList<TComAu*>* TComPicLists::getAus()
     860{
     861  return (&m_aus);
     862}
     863
     864TComList<TComAu*> TComPicLists::getAusHavingPicsMarkedForOutput()
     865{
     866  TComList<TComAu*> ausHavingPicsForOutput;
     867  for(TComList<TComAu*>::iterator itA= m_aus.begin(); ( itA!=m_aus.end()); itA++)
     868  {
     869    Bool hasPicMarkedAsNeedForOutput = false;
     870    for( TComAu::iterator itP= (*itA)->begin(); (itP!=(*itA)->end() && !hasPicMarkedAsNeedForOutput); itP++  )
     871    {
     872      if( (*itP)->getOutputMark() )
     873      {
     874        hasPicMarkedAsNeedForOutput = true;
     875      }
     876    }
     877    if (hasPicMarkedAsNeedForOutput)
     878    {
     879      ausHavingPicsForOutput.pushBack( (*itA) );
     880    }
     881  }
     882  return ausHavingPicsForOutput;
     883}
     884
     885Void TComPicLists::markSubDpbAsUnusedForReference( Int layerIdInNuh )
     886{
     887  TComSubDpb* subDpb = getSubDpb( layerIdInNuh, false );
     888  markSubDpbAsUnusedForReference( *subDpb );
     889}
     890
     891Void TComPicLists::markSubDpbAsUnusedForReference( TComSubDpb& subDpb )
     892{
     893  for(TComList<TComPic*>::iterator itP=subDpb.begin(); ( itP!=subDpb.end()); itP++)
     894  {
     895    (*itP)->markAsUnusedForReference();
     896  }
     897}
     898
     899Void TComPicLists::markAllSubDpbAsUnusedForReference()
     900{
     901  for(TComList<TComSubDpb*>::iterator itS= m_subDpbs.begin(); ( itS!=m_subDpbs.end()); itS++)
     902  {
     903    markSubDpbAsUnusedForReference( *(*itS) );
     904  }
     905}
     906
     907Void TComPicLists::decrementPocsInSubDpb( Int nuhLayerId, Int deltaPocVal )
     908{
     909  TComSubDpb* subDpb = getSubDpb( nuhLayerId, false );
     910
     911  for(TComSubDpb::iterator itP = subDpb->begin(); itP!=subDpb->end(); itP++)
     912  {
     913    TComPic* pic = (*itP);
     914    for (Int i = 0; i < pic->getNumAllocatedSlice(); i++)
     915    {
     916      TComSlice* slice = pic->getSlice(i);
     917      slice->setPOC( slice->getPOC() - deltaPocVal );
     918    }   
     919  }
     920}
     921Void TComPicLists::emptyAllSubDpbs()
     922{
     923  emptySubDpbs( &m_subDpbs );
     924}
     925
     926Void TComPicLists::emptySubDpbs( TComList<TComSubDpb*>* subDpbs )
     927{
     928  assert( subDpbs != NULL );
     929  for( TComList<TComSubDpb*>::iterator itS = subDpbs->begin(); itS != subDpbs->end(); itS++ )
     930  {
     931    emptySubDpb( (*itS) );
     932  }
     933}
     934
     935Void TComPicLists::emptySubDpb( TComSubDpb* subDpb )
     936{
     937  if(subDpb != NULL)
     938  {
     939    while( !subDpb->empty() )
     940    {
     941      TComPic* curPic = *(subDpb->begin());
     942      removePic( curPic );
     943    }
     944  }
     945}
     946
     947Void TComPicLists::emptySubDpb( Int nuhLayerId )
     948{
     949  emptySubDpb( getSubDpb( nuhLayerId , false) );
     950}
     951
     952Void TComPicLists::emptyNotNeedForOutputAndUnusedForRef()
     953{
     954  for(TComList<TComSubDpb*>::iterator itS= m_subDpbs.begin(); ( itS!=m_subDpbs.end()); itS++)
     955  {
     956    emptySubDpbNotNeedForOutputAndUnusedForRef( *(*itS) );
     957  }
     958}
     959
     960Void TComPicLists::emptySubDpbNotNeedForOutputAndUnusedForRef( Int layerId )
     961{
     962  TComSubDpb* subDpb = getSubDpb( layerId, false );
     963  emptySubDpbNotNeedForOutputAndUnusedForRef( *subDpb );
     964}
     965
     966Void TComPicLists::emptySubDpbNotNeedForOutputAndUnusedForRef( TComSubDpb subDpb )
     967{
     968  for(TComSubDpb::iterator itP= subDpb.begin(); ( itP!=subDpb.end()); itP++)
     969  {
     970    TComPic* pic = (*itP);
     971    if ( !pic->getOutputMark() && pic->getMarkedUnUsedForReference() )
     972    {
     973      removePic( pic );
     974    }
     975  }
     976}
     977
     978Void TComPicLists::print()
     979{
     980  Bool first = true;     
     981  for(TComList<TComSubDpb*>::iterator itL = m_subDpbs.begin(); ( itL != m_subDpbs.end() ); itL++)
     982  {   
     983    for(TComList<TComPic*>::iterator itP=(*itL)->begin(); ( itP!=(*itL)->end() ); itP++)
     984    {
     985      if ( first )
     986      {
     987        (*itP)->print( true );       
     988        first = false;
     989      }
     990      (*itP)->print( false );       
     991    }
     992  }
     993}
     994
     995#if NH_3D
     996TComPicYuv* TComPicLists::getPicYuv( Int viewIndex, Bool depthFlag, Int poc, Bool recon )
     997
     998  Int layerIdInNuh = m_vps->getLayerIdInNuh( viewIndex, depthFlag );
     999  return getPicYuv( layerIdInNuh, poc, recon );
     1000}
     1001
     1002TComPic* TComPicLists::getPic( Int viewIndex, Bool depthFlag, Int poc )
     1003{
     1004  return getPic   ( m_vps->getLayerIdInNuh( viewIndex, depthFlag ), poc );
     1005}
     1006
     1007#endif
     1008
     1009#endif
     1010
     1011
    5061012
    5071013
    5081014//! \}
     1015
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComPic.h

    r1313 r1317  
    5454/// picture class (symbol + YUV buffers)
    5555
     56
     57
     58#if NH_MV
     59class TComPic;
     60
     61class TComDecodedRps
     62{
     63public:
     64
     65  TComDecodedRps()
     66  {
     67    m_refPicSetsCurr[0] = &m_refPicSetStCurrBefore;
     68    m_refPicSetsCurr[1] = &m_refPicSetStCurrAfter ;
     69    m_refPicSetsCurr[2] = &m_refPicSetLtCurr      ;
     70
     71    m_refPicSetsLt  [0] = &m_refPicSetLtCurr      ;
     72    m_refPicSetsLt  [1] = &m_refPicSetLtFoll      ;
     73
     74    m_refPicSetsAll [0] = &m_refPicSetStCurrBefore;
     75    m_refPicSetsAll [1] = &m_refPicSetStCurrAfter ;
     76    m_refPicSetsAll [2] = &m_refPicSetStFoll      ;
     77    m_refPicSetsAll [3] = &m_refPicSetLtCurr      ;
     78    m_refPicSetsAll [4] = &m_refPicSetLtFoll      ;
     79  };   
     80
     81  std::vector<Int>       m_pocStCurrBefore;
     82  std::vector<Int>       m_pocStCurrAfter;
     83  std::vector<Int>       m_pocStFoll;   
     84  std::vector<Int>       m_pocLtCurr;
     85  std::vector<Int>       m_pocLtFoll;
     86
     87  Int                    m_numPocStCurrBefore;
     88  Int                    m_numPocStCurrAfter;
     89  Int                    m_numPocStFoll;
     90  Int                    m_numPocLtCurr;
     91  Int                    m_numPocLtFoll;
     92
     93  std::vector<TComPic*>  m_refPicSetStCurrBefore;
     94  std::vector<TComPic*>  m_refPicSetStCurrAfter;
     95  std::vector<TComPic*>  m_refPicSetStFoll;
     96  std::vector<TComPic*>  m_refPicSetLtCurr;
     97  std::vector<TComPic*>  m_refPicSetLtFoll;   
     98
     99  std::vector<TComPic*>* m_refPicSetsCurr[3];
     100  std::vector<TComPic*>* m_refPicSetsLt  [2];
     101  std::vector<TComPic*>* m_refPicSetsAll [5];
     102
     103  // Annex F
     104  Int                    m_numActiveRefLayerPics0;
     105  Int                    m_numActiveRefLayerPics1;     
     106
     107  std::vector<TComPic*>  m_refPicSetInterLayer0;
     108  std::vector<TComPic*>  m_refPicSetInterLayer1;
     109};
     110#endif
     111
    56112class TComPic
    57113{
     
    72128  Bool                  m_bReconstructed;
    73129  Bool                  m_bNeededForOutput;
    74 #if NH_MV
    75   Bool                  m_bPicOutputFlag;         // Semantics variable
    76 #endif
     130
    77131  UInt                  m_uiCurrSliceIdx;         // Index of current slice
    78132  Bool                  m_bCheckLTMSB;
     
    87141  Int                   m_layerId;
    88142  Int                   m_viewId;
     143  Bool                  m_bPicOutputFlag;                // Semantics variable
     144  Bool                  m_hasGeneratedRefPics;
     145  Bool                  m_isPocResettingPic;
     146  Bool                  m_isFstPicOfAllLayOfPocResetPer;
     147  Int64                 m_decodingOrder;
     148  Bool                  m_noRaslOutputFlag;
     149  Bool                  m_noClrasOutputFlag;
     150  Int                   m_picLatencyCount;
     151  Bool                  m_isGenerated;
     152  Bool                  m_isGeneratedCl833;
     153  Bool                  m_activatesNewVps;
     154  TComDecodedRps        m_decodedRps;
     155#endif
    89156#if NH_3D
    90157  Int                   m_viewIndex;
     
    92159  Int**                 m_aaiCodedScale;
    93160  Int**                 m_aaiCodedOffset;
    94 #endif
    95 #endif
    96161#if NH_3D_QTLPC
    97162  Bool                  m_bReduceBitsQTL;
    98163#endif
    99164#if NH_3D_NBDV
    100   UInt        m_uiRapRefIdx;
    101   RefPicList  m_eRapRefList;
    102   Int         m_iNumDdvCandPics;
    103   Bool        m_abTIVRINCurrRL [2][2][MAX_NUM_REF]; //whether an inter-view reference picture with the same view index of the inter-view reference picture of temporal reference picture of current picture exists in current reference picture lists
    104   Int         m_aiTexToDepRef  [2][MAX_NUM_REF];
    105 #endif
    106 
     165  UInt                   m_uiRapRefIdx;
     166  RefPicList             m_eRapRefList;
     167  Int                    m_iNumDdvCandPics;
     168  Bool                   m_abTIVRINCurrRL [2][2][MAX_NUM_REF]; //whether an inter-view reference picture with the same view index of the inter-view reference picture of temporal reference picture of current picture exists in current reference picture lists
     169  Int                    m_aiTexToDepRef  [2][MAX_NUM_REF];
     170#endif
     171#endif
    107172public:
    108173  TComPic();
     
    115180  UInt          getTLayer() const               { return m_uiTLayer;   }
    116181  Void          setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; }
    117 #if NH_MV
    118   Void          setLayerId            ( Int layerId )    { m_layerId      = layerId; }
    119   Int           getLayerId            ()                 { return m_layerId;    }
    120   Void          setViewId             ( Int viewId )     { m_viewId = viewId;   }
    121   Int           getViewId             ()                 { return m_viewId;     }
    122 #if NH_3D
    123   Void          setViewIndex          ( Int viewIndex )  { m_viewIndex = viewIndex;   }
    124   Int           getViewIndex          ()                 { return m_viewIndex;     }
    125 
    126   Void          setIsDepth            ( Bool isDepth )   { m_isDepth = isDepth; }
    127   Bool          getIsDepth            ()                 { return m_isDepth; }
    128 
    129   Void          setScaleOffset( Int** pS, Int** pO )  { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
    130   Int**         getCodedScale ()                      { return m_aaiCodedScale;  }
    131   Int**         getCodedOffset()                      { return m_aaiCodedOffset; }
    132 #endif
    133 #endif
    134 #if NH_3D_QTLPC
    135   Bool          getReduceBitsFlag ()             { return m_bReduceBitsQTL;     }
    136   Void          setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag;    }
    137 #endif
    138182
    139183  Bool          getUsedByCurr() const            { return m_bUsedByCurr; }
     
    177221  Void          setOutputMark (Bool b) { m_bNeededForOutput = b;     }
    178222  Bool          getOutputMark () const      { return m_bNeededForOutput;  }
    179  #if NH_MV
    180   Void          setPicOutputFlag(Bool b) { m_bPicOutputFlag = b;      }
    181   Bool          getPicOutputFlag()       { return m_bPicOutputFlag ;  }
    182 #endif
    183 #if NH_3D
    184 #if NH_3D_ARP
    185   Void          getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx );
    186 #endif
    187   Void          compressMotion(Int scale);
    188 #else   
     223
     224#if !NH_3D
    189225  Void          compressMotion();
    190226#endif
     
    210246
    211247#if NH_MV
    212   Void          print( Bool legend );
     248   Void          setLayerId            ( Int layerId )    { m_layerId      = layerId; }
     249   Int           getLayerId            ()                 { return m_layerId;    }
     250   
     251   Void          setViewId             ( Int viewId )     { m_viewId = viewId;   }
     252   Int           getViewId             ()                 { return m_viewId;     }
     253
     254   Void          setPicOutputFlag(Bool b)                 { m_bPicOutputFlag = b;      }
     255   Bool          getPicOutputFlag()                       { return m_bPicOutputFlag ;  }
     256
     257   Bool          getPocResetPeriodId();
     258
     259   Void          markAsUsedForShortTermReference();
     260   Void          markAsUsedForLongTermReference();
     261   Void          markAsUnusedForReference();
     262
     263   Bool          getMarkedUnUsedForReference();
     264   Bool          getMarkedAsShortTerm();
     265
     266   Void          setHasGeneratedRefPics(Bool val)       { m_hasGeneratedRefPics  = val;    }
     267   Bool          getHasGeneratedRefPics( )              { return m_hasGeneratedRefPics;   }
     268
     269   Void          setIsPocResettingPic(Bool val)         { m_isPocResettingPic = val;    }
     270   Bool          getIsPocResettingPic( )                { return m_isPocResettingPic;   }
     271
     272   Void          setIsFstPicOfAllLayOfPocResetPer(Bool val) { m_isFstPicOfAllLayOfPocResetPer = val;  }
     273   Bool          getIsFstPicOfAllLayOfPocResetPer( )        { return m_isFstPicOfAllLayOfPocResetPer; }
     274
     275   Int64         getDecodingOrder( )                    { return m_decodingOrder;       }
     276   Void          setDecodingOrder( UInt64 val  )        { m_decodingOrder = val;        }
     277
     278   Bool          getNoRaslOutputFlag()                  { return m_noRaslOutputFlag;     }
     279   Void          setNoRaslOutputFlag( Bool b )          { m_noRaslOutputFlag = b;        }
     280
     281   Bool          getNoClrasOutputFlag()                 { return m_noClrasOutputFlag;    }
     282   Void          setNoClrasOutputFlag( Bool b )         { m_noClrasOutputFlag = b;       }
     283
     284   Int           getPicLatencyCount()                   { return m_picLatencyCount;      }
     285   Void          setPicLatencyCount( Int val )          { m_picLatencyCount = val;       }
     286
     287   Bool          getIsGenerated() const                 { return m_isGenerated;          }
     288   Void          setIsGenerated( Bool b )               { m_isGenerated = b;             }
     289
     290   Bool          getIsGeneratedCl833() const            { return m_isGeneratedCl833;     }
     291   Void          setIsGeneratedCl833( Bool b )          { m_isGeneratedCl833 = b;        }
     292
     293   Int           getTemporalId( )                       { return getSlice(0)->getTemporalId(); }
     294
     295   Bool          getActivatesNewVps()                   { return m_activatesNewVps;      }
     296   Void          setActivatesNewVps( Bool b )           { m_activatesNewVps = b;         }
     297
     298   TComDecodedRps* getDecodedRps()                      { return &m_decodedRps;          }
     299
     300   Bool          isIrap()                               { return getSlice(0)->isIRAP(); }
     301   Bool          isBla ()                               { return getSlice(0)->isBla (); }
     302   Bool          isIdr ()                               { return getSlice(0)->isIdr (); }
     303   Bool          isCra ()                               { return getSlice(0)->isCra (); }
     304   Bool          isSlnr ()                              { return getSlice(0)->isSlnr (); }
     305   Bool          isRasl ()                              { return getSlice(0)->isRasl (); }
     306   Bool          isRadl ()                              { return getSlice(0)->isRadl (); }
     307   Bool          isStsa ()                              { return getSlice(0)->isStsa (); }
     308   Bool          isTsa ()                               { return getSlice(0)->isTsa  (); }
     309
     310   Void          print( Int outputLevel );
     311
     312#if NH_3D
     313   Void          setViewIndex          ( Int viewIndex )  { m_viewIndex = viewIndex;   }
     314   Int           getViewIndex          ()                 { return m_viewIndex;     }
     315
     316   Void          setIsDepth            ( Bool isDepth )   { m_isDepth = isDepth; }
     317   Bool          getIsDepth            ()                 { return m_isDepth; }
     318
     319   Void          setScaleOffset( Int** pS, Int** pO )     { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
     320   Int**         getCodedScale ()                         { return m_aaiCodedScale;  }
     321   Int**         getCodedOffset()                         { return m_aaiCodedOffset; }
     322
     323   Void          compressMotion(Int scale);
     324   Void          printMotion( );
     325#if NH_3D_ARP
     326   Void          getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx );
     327#endif
     328#if NH_3D_QTLPC
     329   Bool          getReduceBitsFlag ()                     { return m_bReduceBitsQTL;     }
     330   Void          setReduceBitsFlag ( Bool bFlag )         { m_bReduceBitsQTL = bFlag;    }
    213331#endif
    214332#if NH_3D_NBDV
    215   Int           getNumDdvCandPics()                    {return m_iNumDdvCandPics;   }
    216   Int           getDisCandRefPictures(Int iColPOC);
    217   Void          setRapRefIdx(UInt uiRapRefIdx)         {m_uiRapRefIdx = uiRapRefIdx;}
    218   Void          setRapRefList(RefPicList eRefPicList)  {m_eRapRefList = eRefPicList;}
    219   Void          setNumDdvCandPics (Int i)              {m_iNumDdvCandPics = i;       }
    220   UInt          getRapRefIdx()                         {return m_uiRapRefIdx;       }
    221   RefPicList    getRapRefList()                        {return m_eRapRefList;       }
    222   Void          checkTemporalIVRef();
    223   Bool          isTempIVRefValid(Int currCandPic, Int iTempRefDir, Int iTempRefIdx);
    224   Void          checkTextureRef(  );
    225   Int           isTextRefValid(Int iTextRefDir, Int iTextRefIdx);
     333  Int            getNumDdvCandPics()                      { return m_iNumDdvCandPics;    }
     334  Int            getDisCandRefPictures(Int iColPOC);       
     335  Void           setRapRefIdx(UInt uiRapRefIdx)           { m_uiRapRefIdx = uiRapRefIdx; }
     336  Void           setRapRefList(RefPicList eRefPicList)    { m_eRapRefList = eRefPicList; }
     337  Void           setNumDdvCandPics (Int i)                { m_iNumDdvCandPics = i;       }
     338  UInt           getRapRefIdx()                           { return m_uiRapRefIdx;        }
     339  RefPicList     getRapRefList()                          { return m_eRapRefList;        }
     340  Void           checkTemporalIVRef();                     
     341  Bool           isTempIVRefValid(Int currCandPic, Int iTempRefDir, Int iTempRefIdx);
     342  Void           checkTextureRef(  );
     343  Int            isTextRefValid(Int iTextRefDir, Int iTextRefIdx);
     344#endif
     345#endif
    226346#endif
    227347
     
    241361
    242362#if NH_MV
     363
     364class TComAu : public TComList<TComPic*>
     365{
     366 
     367public:
     368
     369  Int                 getPoc            ( )                     {  assert(!empty()); return back()->getPOC            ();  }
     370  Void                setPicLatencyCount( Int picLatenyCount );
     371  Int                 getPicLatencyCount( )                     {  assert(!empty()); return back()->getPicLatencyCount();  } 
     372  TComPic*            getPic            ( Int nuhLayerId  );
     373  Void                addPic            ( TComPic* pic, Bool pocUnkown );
     374  Bool                containsPic       ( TComPic* pic ); 
     375};
     376
     377
     378class TComSubDpb : public TComList<TComPic*>
     379{
     380private:
     381  Int m_nuhLayerId;
     382public: 
     383  TComSubDpb( Int nuhLayerid );
     384
     385  Int                 getLayerId                      ( ) { return m_nuhLayerId; }
     386
     387  TComPic*            getPic                          ( Int poc  );
     388  TComPic*            getPicFromLsb                   ( Int pocLsb, Int maxPicOrderCntLsb );
     389  TComPic*            getShortTermRefPic              ( Int poc  );
     390  TComList<TComPic*>  getPicsMarkedNeedForOutput      ( );
     391
     392  Void                markAllAsUnusedForReference     ( );
     393
     394  Void                addPic                          ( TComPic* pic );
     395  Void                removePics                      ( std::vector<TComPic*> picToRemove );
     396  Bool                areAllPicsMarkedNotNeedForOutput( );
     397};
     398
    243399class TComPicLists
    244400{
    245401private:
    246   TComList<TComList<TComPic*>*> m_lists;
    247 #if NH_3D
    248   const TComVPS*                     m_vps;
     402  TComList<TComAu*    >       m_aus; 
     403  TComList<TComSubDpb*>       m_subDpbs;
     404  Bool                        m_printPicOutput;
     405#if NH_3D                     
     406  const TComVPS*              m_vps;
    249407#endif
    250408public:
    251   Void        push_back( TComList<TComPic*>* list ) { m_lists.push_back( list );   }
    252   Int         size     ()                           { return (Int) m_lists.size(); }
    253 #if NH_3D_ARP
    254   TComList<TComPic*>*  getPicList   ( Int layerIdInNuh );
    255 #endif
    256   TComPic*    getPic   ( Int layerIdInNuh,              Int poc );   
    257   TComPicYuv* getPicYuv( Int layerIdInNuh,              Int poc, Bool recon );
    258 #if NH_3D
    259   Void        setVPS   ( const TComVPS* vps ) { m_vps = vps;  };
    260   TComPic*    getPic   ( Int viewIndex, Bool depthFlag, Int poc );
    261   TComPicYuv* getPicYuv( Int viewIndex, Bool depthFlag, Int poc, Bool recon );
     409  ~TComPicLists();
     410
     411  // Add and remove single pictures
     412  Void                   addNewPic( TComPic* pic );
     413  Void                   removePic( TComPic* pic );
     414
     415  // Get Pics
     416  TComPic*               getPic                         ( Int layerIdInNuh, Int poc );
     417  TComPicYuv*            getPicYuv                      ( Int layerIdInNuh, Int poc, Bool recon );
     418
     419  // Get and AUs and SubDPBs
     420  TComSubDpb*            getSubDpb                      ( Int nuhLayerId, Bool create );
     421  TComList<TComSubDpb*>* getSubDpbs                     ( );
     422                                                       
     423  TComAu*                addAu                          ( Int poc  );
     424  TComAu*                getAu                          ( Int poc, Bool create );
     425  TComList<TComAu*>*     getAus                         ( );
     426  TComList<TComAu*>      getAusHavingPicsMarkedForOutput( );
     427
     428  // Mark pictures and set POCs
     429  Void                   markSubDpbAsUnusedForReference ( Int layerIdInNuh );
     430  Void                   markSubDpbAsUnusedForReference ( TComSubDpb& subDpb );
     431  Void                   markAllSubDpbAsUnusedForReference(  );
     432  Void                   decrementPocsInSubDpb          ( Int nuhLayerId, Int deltaPocVal );
     433 
     434  // Empty Sub DPBs
     435  Void                   emptyAllSubDpbs                ( );
     436  Void                   emptySubDpbs                   ( TComList<TComSubDpb*>* subDpbs);
     437  Void                   emptySubDpb                    ( TComSubDpb* subDpb);
     438  Void                   emptySubDpb                    ( Int nuhLayerId );
     439
     440  Void                   emptyNotNeedForOutputAndUnusedForRef      ( );
     441  Void                   emptySubDpbNotNeedForOutputAndUnusedForRef( Int layerId  );
     442  Void                   emptySubDpbNotNeedForOutputAndUnusedForRef( TComSubDpb subDpb ); 
     443
     444  // For printing to std::out
     445  Void                   setPrintPicOutput ( Bool printPicOutput ) { m_printPicOutput = printPicOutput; };
     446  Void                   print();
     447
     448#if NH_3D                                   
     449  Void                   setVPS                        ( const TComVPS* vps ) { m_vps = vps;  };
     450  TComPic*               getPic                        ( Int viewIndex, Bool depthFlag, Int poc );
     451  TComPicYuv*            getPicYuv                     ( Int viewIndex, Bool depthFlag, Int poc, Bool recon );
    262452#endif 
    263453
    264   Void print( ); 
    265 
    266 }; // END CLASS DEFINITION TComPicLists
    267 
    268 #endif
     454};
     455
     456// END CLASS DEFINITION TComPicLists
     457
     458#endif
     459
    269460
    270461//! \}
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComPicYuv.h

    r1313 r1317  
    166166  // Set border extension flag
    167167  Void          setBorderExtension(Bool b) { m_bIsBorderExtended = b; }
     168#if NH_MV
     169  Bool          getBorderExtension( )     { return m_bIsBorderExtended; }
     170#endif
    168171#if NH_3D
    169172  // Set Function
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComPrediction.cpp

    r1313 r1317  
    584584    pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]);
    585585  }
    586 #if H_3D_ARP || NH_3D_ALIGN_SPIVMP_RP // check this!
     586#if NH_3D_ARP
    587587  if( pcCU->getARPW( uiPartAddr ) != 0 )
    588588  {
     
    13021302  TComMv      cMv         = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr );
    13031303  pcCU->clipMv(cMv);
     1304
     1305#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
     1306  if ( g_traceMotionInfoBeforUniPred  )
     1307  {
     1308    std::cout << "RefPic POC     : " << pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()     << std::endl;
     1309    std::cout << "RefPic Layer Id: " << pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getLayerId() << std::endl;
     1310    std::cout << "RefIdx         : " << iRefIdx                                                           << std::endl;
     1311    std::cout << "RefPIcList     : " << eRefPicList                                                        << std::endl;
     1312  }
     1313#endif
     1314
    13041315#if NH_MV
    13051316  pcCU->checkMvVertRest(cMv, eRefPicList, iRefIdx );
     
    13091320  {
    13101321    if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC() )
    1311   {
     1322    {
    13121323      xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , pcYuvPred , bi );
    1313   }
    1314   else
    1315   {
     1324    }
     1325    else
     1326    {
    13161327      xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, bi );
    13171328    }     
    1318     }
    1319     else
    1320     {
    1321 #endif
    1322   for (UInt comp=COMPONENT_Y; comp<pcYuvPred->getNumberValidComponents(); comp++)
    1323   {
    1324     const ComponentID compID=ComponentID(comp);
     1329  }
     1330  else
     1331  {
     1332#endif
     1333
     1334    for (UInt comp=COMPONENT_Y; comp<pcYuvPred->getNumberValidComponents(); comp++)
     1335    {
     1336      const ComponentID compID=ComponentID(comp);
    13251337#if NH_3D_IC
    1326     Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ) && ( isLuma(compID) || (iWidth > 8) );
     1338      Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ) && ( isLuma(compID) || (iWidth > 8) );
    13271339      xPredInterBlk(compID,  pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID))
    13281340#if NH_3D_ARP
     
    13311343        , bICFlag );
    13321344#else
    1333     xPredInterBlk  (compID,  pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) );
    1334 #endif
    1335   }
     1345      xPredInterBlk  (compID,  pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) );
     1346#endif
     1347    }
    13361348#if NH_3D_ARP
    13371349  }
     
    18131825)
    18141826{
     1827#if NH_MV
     1828  assert( refPic->getBorderExtension() );
     1829#endif
    18151830  Int     refStride  = refPic->getStride(compID);
    18161831  Int     dstStride  = dstPic->getStride(compID);
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComPrediction.h

    r1313 r1317  
    176176  Void          combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize, Int bitDepthY );
    177177#endif
    178 
     178#if NH_3D
    179179  Pel  predIntraGetPredValDC      ( const Pel* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight, Bool bAbove, Bool bLeft );
    180 
     180#endif
    181181  Pel*  getPredictorPtr           ( const ComponentID compID, const Bool bUseFilteredPredictions )
    182182  {
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComRdCost.cpp

    r1313 r1317  
    133133  }
    134134
     135#if NH_MV
    135136  D_PRINT_INDENT( g_traceRDCost,  "Dist: " + n2s(uiDistortion) + " Bits: " + n2s(uiBits) + " RD Cost: " + n2s(dRdCost));
     137#endif
    136138  return dRdCost;
    137139}
     
    603605  cDtParam.bitDepth   = bitDepth;
    604606
    605 #if NH_3D_IC_FIX
    606607  cDtParam.bUseIC       = false;
    607 #endif
    608608#if NH_3D_SDC_INTER
    609609  cDtParam.bUseSDCMRSAD = false;
     
    36853685  }
    36863686
     3687#if NH_MV
    36873688  D_PRINT_INDENT( g_traceRDCost, "VSO Dist: " + n2s(uiDistortion) + " Bits: " + n2s(uiBits) + " RD Cost: " + n2s(dRdCost));
     3689#endif
    36883690
    36893691  return dRdCost;
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComRom.cpp

    r1313 r1317  
    222222#if NH_MV
    223223#if H_MV_HLS_PTL_LIMITS
    224  g_generalTierAndLevelLimits[ Level::LEVEL1   ] = TComGeneralTierAndLevelLimits(    36864,     350,  INT_MIN,   16,   1,   1 );
    225  g_generalTierAndLevelLimits[ Level::LEVEL2   ] = TComGeneralTierAndLevelLimits(   122880,    1500,  INT_MIN,   16,   1,   1 );
    226  g_generalTierAndLevelLimits[ Level::LEVEL2_1 ] = TComGeneralTierAndLevelLimits(   245760,    3000,  INT_MIN,   20,   1,   1 );
    227  g_generalTierAndLevelLimits[ Level::LEVEL3   ] = TComGeneralTierAndLevelLimits(   552960,    6000,  INT_MIN,   30,   2,   2 );
    228  g_generalTierAndLevelLimits[ Level::LEVEL3_1 ] = TComGeneralTierAndLevelLimits(   983040,   10000,  INT_MIN,   40,   3,   3 );
     224 g_generalTierAndLevelLimits[ Level::LEVEL1   ] = TComGeneralTierAndLevelLimits(    36864,     350,  MIN_INT,   16,   1,   1 );
     225 g_generalTierAndLevelLimits[ Level::LEVEL2   ] = TComGeneralTierAndLevelLimits(   122880,    1500,  MIN_INT,   16,   1,   1 );
     226 g_generalTierAndLevelLimits[ Level::LEVEL2_1 ] = TComGeneralTierAndLevelLimits(   245760,    3000,  MIN_INT,   20,   1,   1 );
     227 g_generalTierAndLevelLimits[ Level::LEVEL3   ] = TComGeneralTierAndLevelLimits(   552960,    6000,  MIN_INT,   30,   2,   2 );
     228 g_generalTierAndLevelLimits[ Level::LEVEL3_1 ] = TComGeneralTierAndLevelLimits(   983040,   10000,  MIN_INT,   40,   3,   3 );
    229229 g_generalTierAndLevelLimits[ Level::LEVEL4   ] = TComGeneralTierAndLevelLimits(  2228224,   12000,    30000,   75,   5,   5 );
    230230 g_generalTierAndLevelLimits[ Level::LEVEL4_1 ] = TComGeneralTierAndLevelLimits(  2228224,   20000,    50000,   75,   5,   5 );
     
    546546Bool g_disableNumbering = false;
    547547Bool g_disableHLSTrace = false;
    548 UInt64 g_stopAtCounter         = 4660;
    549 Bool g_traceCopyBack           = false;
    550 Bool g_decTraceDispDer         = false;
    551 Bool g_decTraceMvFromMerge     = false;
    552 Bool g_decTracePicOutput       = false;
     548UInt64 g_stopAtCounter       = 4660;
     549Bool g_traceCopyBack         = false;
     550Bool g_decTraceDispDer       = false;
     551Bool g_decTraceMvFromMerge   = false;
     552Bool g_decTracePicOutput     = false;
    553553Bool g_startStopTrace          = false;
    554 Bool g_outputPos               = false;
    555 Bool g_traceCameraParameters   = false;
    556 Bool g_encNumberOfWrittenBits  = false;
     554Bool g_outputPos             = false;   
     555Bool g_traceCameraParameters = false;
     556Bool g_encNumberOfWrittenBits     = false;
    557557Bool g_traceEncFracBits        = false;
    558558Bool g_traceIntraSearchCost    = false;
     
    561561Bool g_traceModeCheck          = false;
    562562UInt g_indent                  = false;
     563Bool g_decNumBitsRead          = false;
     564Bool g_traceMotionInfoBeforUniPred = false;
     565Bool g_traceMergeCandListConst = false;
     566Bool g_traceSubPBMotion       = false;
    563567#endif
    564568#endif
     
    693697  Bool startTrace = false;
    694698  if ( g_startStopTrace && poc == 0 && layerId == 0 )
    695   {   
     699  {
    696700    startTrace = ( cuPelX  == 0 ) && ( cuPelY  == 0 ) && ( cuWidth == 64 ) && ( cuHeight == 64 );
    697   }
     701    }
    698702  if ( startTrace )
    699703  {
     
    705709    g_traceModeCheck         = true;
    706710    g_traceCopyBack          = false;
    707  
     711    }
    708712  Bool stopTrace = false;
    709713  if ( g_startStopTrace && poc == 0 && layerId == 0 )
     
    752756    fflush ( g_hTrace );   
    753757  }
    754 }
    755 Void printStr( std::string str )
    756 {
    757   std::cout << str << std::endl;
    758 }
    759 Void printStrIndent( Bool b, std::string strStr )
    760 {
    761   if ( b )
    762   { 
    763     std::cout << std::string(g_indent, ' ');
    764     printStr( strStr );
    765   }
    766 }
    767 Void prinStrIncIndent( Bool b,  std::string strStr )
    768 {
    769   if ( b )
    770   {
    771     printStrIndent( true,  strStr );
    772     if (g_indent < 50)
    773     {
    774       g_indent++;
    775     }
    776   } 
    777 }
    778 Void decIndent( Bool b )
    779 {
    780   if (b && g_indent > 0)
    781   {
    782     g_indent--; 
    783   } 
    784758}
    785759#endif
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComRom.h

    r1313 r1317  
    9191extern const UChar  g_aucIntraModeNumFast_NotUseMPM[MAX_CU_DEPTH];
    9292extern const UChar  g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE];
     93#if NH_3D_DMM
    9394// ====================================================================================================================
    9495// Depth coding modes
    9596// ====================================================================================================================
    96 #if NH_3D_DMM
     97
    9798extern const WedgeResolution                                 g_dmmWedgeResolution [6];
    9899extern const UChar                                           g_dmm1TabIdxBits     [6];
     
    193194 extern Bool   g_traceSAOCost;
    194195 extern UInt   g_indent;
     196extern Bool   g_traceMotionInfoBeforUniPred;
     197 extern Bool   g_traceMergeCandListConst;
     198 extern Bool   g_traceSubPBMotion;
    195199#define DTRACE_CU(x,y)             writeToTraceFile( x,y, g_traceCU );
    196200#define DTRACE_PU(x,y)             writeToTraceFile( x,y, g_tracePU );
     
    232236#define DTRACE_CABAC_R( x,y )
    233237#define DTRACE_CABAC_N
     238#if NH_MV
    234239#define DTRACE_CU(x,y) ;             
    235240#define DTRACE_PU(x,y) ;           
     
    242247#define D_PRINT_INC_INDENT( b, str );
    243248#define D_PRINT_INDENT( b, str );
    244 
     249#endif
    245250#endif
    246251const Char* nalUnitTypeToString(NalUnitType type);
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r1313 r1317  
    66 * Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
     8
    89 *
    910 * Redistribution and use in source and binary forms, with or without
     
    112113, m_encCABACTableIdx              (I_SLICE)
    113114#if NH_MV
    114 , m_availableForTMVPRefFlag       ( true )
    115115, m_refPicSetInterLayer0          ( NULL )
    116116, m_refPicSetInterLayer1          ( NULL )
     
    121121, m_isDepth                       (false)
    122122#endif
    123 #if !H_MV_HLS7_GEN
     123#if NH_MV
    124124, m_pocResetFlag                  (false)
    125 #endif
    126 #if NH_MV
    127125, m_crossLayerBlaFlag             (false)
    128126#endif
     
    134132, m_pocResetIdc                   (0)
    135133, m_pocResetPeriodId              (0)
     134, m_hasPocResetPeriodIdPresent    (false)
    136135, m_fullPocResetFlag              (false)
    137136, m_pocLsbVal                     (0)
    138 , m_pocMsbValPresentFlag          (false)
    139 , m_pocMsbVal                     (0)
     137, m_pocMsbCycleValPresentFlag     (false)
     138, m_pocMsbCycleVal                (0)
    140139, m_pocMsbValRequiredFlag         (false)
    141140#endif
     
    155154#endif
    156155{
     156
     157#if NH_MV
     158  m_shortTermRefPicSetIdx = 0;
     159  m_numLongTermSps        = 0;
     160  m_numLongTermPics       = 0;
     161  for (Int i = 0; i < MAX_NUM_PICS_RPS; i++)
     162  {
     163    m_ltIdxSps          [i] = 0;
     164    m_deltaPocMsbCycleLt[i] = 0;
     165  }
     166  setSliceTemporalMvpEnabledFlag( false );
     167#endif
    157168  for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
    158169  {
     
    790801#endif
    791802
     803
    792804Int TComSlice::getNumRpsCurrTempList() const
    793805{
     
    806818  }
    807819#if NH_MV
    808   numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics();
     820    numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics();
    809821#endif
    810822  return numRpsCurrTempList;
     
    10971109  m_pcVPS                = pSrc->m_pcVPS;
    10981110#endif
    1099   m_pRPS                = pSrc->m_pRPS;  m_iLastIDR             = pSrc->m_iLastIDR;
     1111  m_pRPS                = pSrc->m_pRPS;
     1112  m_iLastIDR             = pSrc->m_iLastIDR;
    11001113
    11011114  m_pcPic                = pSrc->m_pcPic;
     
    11551168#if NH_MV
    11561169  // Additional slice header syntax elements
    1157 #if !H_MV_HLS7_GEN
    11581170  m_pocResetFlag               = pSrc->m_pocResetFlag;
    1159 #endif
    11601171  m_discardableFlag            = pSrc->m_discardableFlag;
    11611172  m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
     
    26702681  }
    26712682}
    2672 #endif
    2673 
     2683
     2684#endif
    26742685#endif // NH_MV
    26752686
     
    27192730, m_uiBitsForPOC              (  8)
    27202731, m_numLongTermRefPicSPS      (  0)
     2732#if NH_MV
     2733, m_numShortTermRefPicSets    (   0)
     2734#endif
    27212735, m_uiMaxTrSize               ( 32)
    27222736, m_bUseSAO                   (false)
     
    27502764  for ( Int i = 0; i < MAX_TLAYER; i++ )
    27512765  {
     2766#if NH_MV
     2767    m_uiSpsMaxLatencyIncreasePlus1[i] = 0;
     2768#else
    27522769    m_uiMaxLatencyIncrease[i] = 0;
     2770#endif
    27532771    m_uiMaxDecPicBuffering[i] = 1;
    27542772    m_numReorderPics[i]       = 0;
     
    30813099Void TComSPS::inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder )
    30823100{
    3083   const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx ));
    3084 
    30853101  if ( getMultiLayerExtSpsFlag() )
    30863102  {
     3103    const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx ));
    30873104    Int layerIdx = 0;         
    30883105    while (layerIdx < (Int) targetDecLayerIdList.size() )
     
    31093126        // This preliminary fix needs to be checked.
    31103127        assert( getNumReorderPics( i )     == maxNumReorderPics       );
    3111         assert( getMaxLatencyIncrease( i ) == maxLatencyIncreasePlus1 );
     3128        assert( getSpsMaxLatencyIncreasePlus1( i ) == maxLatencyIncreasePlus1 );
    31123129
    31133130      }
     
    31173134        setMaxDecPicBuffering( maxDecPicBufferingMinus1 + 1 , i);
    31183135        setNumReorderPics    ( maxNumReorderPics, i );
    3119         setMaxLatencyIncrease( maxLatencyIncreasePlus1 - 1 , i);
     3136        setSpsMaxLatencyIncreasePlus1( maxLatencyIncreasePlus1 , i);
    31203137      }
    31213138    }   
     
    34123429  }
    34133430}
    3414 
    34153431Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 )
    34163432{
     
    34353451    for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[li]-1); rIdx ++)
    34363452    {     
    3437       if (rIdx == 0 && li == 0) m_apcRefPicList[li][rIdx]->print( true );
     3453      if (rIdx == 0 && li == 0) m_apcRefPicList[li][rIdx]->print( 1 );
     3454      m_apcRefPicList[li][rIdx]->print( 0 );     
    34383455       
    3439       m_apcRefPicList[li][rIdx]->print( false );
    34403456    }
    34413457  }
     
    34563472  m_refPicSetInterLayer1 = refPicSetInterLayer1;
    34573473}
     3474
     3475TComPic* TComSlice::getRefPicSetInterLayer( Int setIdc, Int i ) const
     3476{
     3477  TComPic* pic = NULL;
     3478  if (setIdc == 0 )
     3479  {
     3480    pic = (*m_refPicSetInterLayer0)[ i ];
     3481  }
     3482  else if (setIdc == 1 )
     3483  {
     3484    pic = (*m_refPicSetInterLayer1)[ i ];
     3485  }
     3486
     3487  assert( pic != NULL );   
     3488
     3489  return pic;
     3490}
     3491
    34583492
    34593493TComPic* TComSlice::getPicFromRefPicSetInterLayer(Int setIdc, Int layerId ) const
     
    35723606#endif
    35733607}
     3608#endif
    35743609#if NH_3D_NBDV
    35753610Void TComSlice::setDefaultRefView()
     
    36873722      if( iViewIdx<getViewIndex() && !bIsDepth )
    36883723      {
    3689         setBaseViewRefPicList( ivPicLists->getPicList( iLayerId ), iViewIdx );
     3724        setBaseViewRefPicList( ivPicLists->getSubDpb( iLayerId, false ), iViewIdx );
    36903725      }
    36913726    }
     
    37103745        if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() )
    37113746        {
    3712           existInterViewRef = true;       
     3747          existInterViewRef = true;
    37133748        }
    37143749      }
     
    38333868#if NH_3D
    38343869Void TComSlice::setIvPicLists( TComPicLists* m_ivPicLists )
    3835 {
     3870{ 
    38363871  for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
    3837   {    
     3872  {
    38383873    for ( Int depthId = 0; depthId < 2; depthId++ )
    38393874    {
     
    39203955}
    39213956#endif
    3922 #endif
     3957
    39233958
    39243959
     
    39333968}
    39343969
    3935 Bool TComSlice::inferPocMsbValPresentFlag()
     3970Bool TComSlice::inferPocMsbCycleValPresentFlag()
    39363971{
    39373972  Bool pocMsbValPresentFlag;
     
    39523987}
    39533988
     3989
     3990Void TComSlice::f834decProcForRefPicListConst()
     3991{
     3992  // This process is invoked at the beginning of the decoding process for each P or B slice.
     3993  assert( getSliceType() == B_SLICE || getSliceType() == P_SLICE );
     3994
     3995  // Reference pictures are addressed through reference indices as specified in clause 8.5.3.3.2. A reference index is an index into
     3996  // a reference picture list. When decoding a P slice, there is a single reference picture list RefPicList0. When decoding a B
     3997  // slice, there is a second independent reference picture list RefPicList1 in addition to RefPicList0.
     3998
     3999  // At the beginning of the decoding process for each slice, the reference picture lists RefPicList0 and, for B slices, RefPicList1
     4000  // are derived as follows:
     4001
     4002  // The variable NumRpsCurrTempList0 is set equal to Max( num_ref_idx_l0_active_minus1 + 1, NumPicTotalCurr )
     4003  Int numRpsCurrTempList0 = std::max( getNumRefIdxL0ActiveMinus1() + 1, getNumPicTotalCurr() );
     4004
     4005  // and the list RefPicListTemp0 is constructed as follows:
     4006  std::vector<TComPic*> refPicListTemp0;
     4007  refPicListTemp0.resize((MAX_NUM_REF+1),NULL);
     4008
     4009  const TComDecodedRps* decRps = getPic()->getDecodedRps();
     4010
     4011  const std::vector<TComPic*>& refPicSetStCurrBefore  = decRps->m_refPicSetStCurrBefore;
     4012  const std::vector<TComPic*>& refPicSetStCurrAfter   = decRps->m_refPicSetStCurrAfter;
     4013  const std::vector<TComPic*>& refPicSetLtCurr        = decRps->m_refPicSetLtCurr;
     4014
     4015  const Int                    numPocStCurrBefore     = decRps->m_numPocStCurrBefore;
     4016  const Int                    numPocStCurrAfter      = decRps->m_numPocStCurrAfter;
     4017  const Int                    numPocLtCurr           = decRps->m_numPocLtCurr;
     4018
     4019  const Int                    numActiveRefLayerPics0 = decRps->m_numActiveRefLayerPics0;
     4020  const Int                    numActiveRefLayerPics1 = decRps->m_numActiveRefLayerPics1;
     4021
     4022  const std::vector<TComPic*>& refPicSetInterLayer0   = decRps->m_refPicSetInterLayer0;
     4023  const std::vector<TComPic*>& refPicSetInterLayer1   = decRps->m_refPicSetInterLayer1;
     4024
     4025  Int rIdx = 0;
     4026  while( rIdx < numRpsCurrTempList0 )
     4027  {
     4028    for(Int  i = 0; i < numPocStCurrBefore  &&  rIdx < numRpsCurrTempList0; rIdx++, i++ )
     4029    {
     4030      refPicListTemp0[ rIdx ] = refPicSetStCurrBefore[ i ];
     4031    }   
     4032
     4033    for(Int  i = 0; i < numActiveRefLayerPics0; rIdx++, i++ )
     4034    {
     4035      refPicListTemp0[ rIdx ] = refPicSetInterLayer0[ i ];
     4036    }
     4037
     4038    for(Int  i = 0;  i < numPocStCurrAfter  &&  rIdx < numRpsCurrTempList0; rIdx++, i++ )  // (F 65)
     4039    {
     4040      refPicListTemp0[ rIdx ] = refPicSetStCurrAfter[ i ];
     4041    }
     4042
     4043    for(Int  i = 0; i < numPocLtCurr  &&  rIdx < numRpsCurrTempList0; rIdx++, i++ )
     4044    {
     4045      refPicListTemp0[ rIdx ] = refPicSetLtCurr[ i ];
     4046    }
     4047
     4048    for(Int  i = 0; i < numActiveRefLayerPics1; rIdx++, i++ )
     4049    {
     4050      refPicListTemp0[ rIdx ] = refPicSetInterLayer1[ i ];
     4051    }
     4052  }
     4053
     4054  // The list RefPicList0 is constructed as follows:
     4055  TComRefPicListModification* rplm  = getRefPicListModification();
     4056  for( rIdx = 0; rIdx  <=  getNumRefIdxL0ActiveMinus1(); rIdx++ )      //  (F 66)
     4057  {
     4058    m_apcRefPicList[ 0 ][ rIdx ] = rplm->getRefPicListModificationFlagL0( ) ? refPicListTemp0[ rplm->getListEntryL0( rIdx )] : refPicListTemp0[ rIdx ];
     4059    // The decoding process below slice level requires the status
     4060    // of the reference pictures, when decoding the RPS. So store it here.
     4061    m_bIsUsedAsLongTerm[ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getIsLongTerm();
     4062    m_aiRefPOCList     [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getPOC();
     4063    m_aiRefLayerIdList [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getLayerId();
     4064  } 
     4065
     4066  std::vector<TComPic*> refPicListTemp1;
     4067  refPicListTemp1.resize((MAX_NUM_REF+1),NULL);
     4068
     4069  if (getSliceType() == B_SLICE )
     4070  {
     4071    // When the slice is a B slice, the variable NumRpsCurrTempList1 is set equal to
     4072    // Max( num_ref_idx_l1_active_minus1 + 1, NumPicTotalCurr ) and the list RefPicListTemp1 is constructed as follows:       
     4073    Int numRpsCurrTempList1 = std::max( getNumRefIdxL1ActiveMinus1() + 1, getNumPicTotalCurr() );
     4074
     4075    rIdx = 0;
     4076    while( rIdx < numRpsCurrTempList1 )
     4077    {
     4078      for( Int i = 0; i < numPocStCurrAfter  &&  rIdx < numRpsCurrTempList1; rIdx++, i++ )
     4079      {
     4080        refPicListTemp1[ rIdx ] = refPicSetStCurrAfter[ i ];
     4081      }
     4082      for( Int i = 0; i< numActiveRefLayerPics1; rIdx++, i++ )
     4083      {
     4084        refPicListTemp1[ rIdx ] = refPicSetInterLayer1[ i ];
     4085      }
     4086      for( Int i = 0;  i < numPocStCurrBefore  &&  rIdx < numRpsCurrTempList1; rIdx++, i++ )  // (F 67)
     4087      {
     4088        refPicListTemp1[ rIdx ] = refPicSetStCurrBefore[ i ];
     4089      }         
     4090      for( Int i = 0; i < numPocLtCurr  &&  rIdx < numRpsCurrTempList1; rIdx++, i++ )
     4091      {
     4092        refPicListTemp1[ rIdx ] = refPicSetLtCurr[ i ];
     4093      }
     4094      for( Int i = 0; i< numActiveRefLayerPics0; rIdx++, i++ )
     4095      {
     4096        refPicListTemp1[ rIdx ] = refPicSetInterLayer0[ i ];
     4097      }
     4098    }
     4099  }
     4100
     4101  if (getSliceType() == B_SLICE )
     4102  {
     4103    //   When the slice is a B slice, the list RefPicList1 is constructed as follows:
     4104    for( rIdx = 0; rIdx  <=  getNumRefIdxL1ActiveMinus1(); rIdx++ )      // (F 68)
     4105    {
     4106      m_apcRefPicList[ 1 ][ rIdx ] = rplm->getRefPicListModificationFlagL1() ? refPicListTemp1[ rplm->getListEntryL1( rIdx ) ] : refPicListTemp1[ rIdx ];
     4107
     4108      // The decoding process below slice level requires the marking status
     4109      // of the reference pictures, when decoding the RPS. So store it here.
     4110      m_bIsUsedAsLongTerm[ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getIsLongTerm();
     4111      m_aiRefPOCList     [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getPOC();
     4112      m_aiRefLayerIdList [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getLayerId();
     4113    }   
     4114  }
     4115}
     4116
     4117
     4118Void TComSlice::cl834DecProcForRefPicListConst()
     4119{
     4120  // This process is invoked at the beginning of the decoding process for each P or B slice.
     4121  assert( getSliceType() == B_SLICE || getSliceType() == P_SLICE );
     4122
     4123  // Reference pictures are addressed through reference indices as specified in clause 8.5.3.3.2. A reference index is an index into
     4124  // a reference picture list. When decoding a P slice, there is a single reference picture list RefPicList0. When decoding a B
     4125  // slice, there is a second independent reference picture list RefPicList1 in addition to RefPicList0.
     4126
     4127  // At the beginning of the decoding process for each slice, the reference picture lists RefPicList0 and, for B slices, RefPicList1
     4128  // are derived as follows:
     4129
     4130  // The variable NumRpsCurrTempList0 is set equal to Max( num_ref_idx_l0_active_minus1 + 1, NumPicTotalCurr )
     4131  Int numRpsCurrTempList0 = std::max( getNumRefIdxL0ActiveMinus1() + 1, getNumPicTotalCurr() );
     4132
     4133  // and the list RefPicListTemp0 is constructed as follows:
     4134  std::vector<TComPic*> refPicListTemp0;
     4135  refPicListTemp0.resize((MAX_NUM_REF+1),NULL);
     4136
     4137  const TComDecodedRps* decRps = getPic()->getDecodedRps();
     4138
     4139  const std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore;
     4140  const std::vector<TComPic*>& refPicSetStCurrAfter  = decRps->m_refPicSetStCurrAfter;
     4141  const std::vector<TComPic*>& refPicSetLtCurr       = decRps->m_refPicSetLtCurr;
     4142   
     4143  const Int                    numPocStCurrBefore    = decRps->m_numPocStCurrBefore;
     4144  const Int                    numPocStCurrAfter     = decRps->m_numPocStCurrAfter;
     4145  const Int                    numPocLtCurr          = decRps->m_numPocLtCurr;
     4146
     4147  Int rIdx = 0;
     4148  while( rIdx < numRpsCurrTempList0 )
     4149  {
     4150    for(Int  i = 0; i < numPocStCurrBefore  &&  rIdx < numRpsCurrTempList0; rIdx++, i++ )
     4151    {
     4152      refPicListTemp0[ rIdx ] = refPicSetStCurrBefore[ i ];
     4153    }   
     4154
     4155    for(Int  i = 0;  i < numPocStCurrAfter  &&  rIdx < numRpsCurrTempList0; rIdx++, i++ )  // (8 8)
     4156    {
     4157      refPicListTemp0[ rIdx ] = refPicSetStCurrAfter[ i ];
     4158    }
     4159
     4160    for(Int  i = 0; i < numPocLtCurr  &&  rIdx < numRpsCurrTempList0; rIdx++, i++ )
     4161    {
     4162      refPicListTemp0[ rIdx ] = refPicSetLtCurr[ i ];
     4163    }
     4164  }
     4165
     4166  // The list RefPicList0 is constructed as follows:
     4167
     4168  TComRefPicListModification* rplm = getRefPicListModification();
     4169  for( rIdx = 0; rIdx  <=  getNumRefIdxL0ActiveMinus1(); rIdx++ )      //   (8-9)
     4170  {
     4171    m_apcRefPicList[0][ rIdx ] = rplm->getRefPicListModificationFlagL0( ) ? refPicListTemp0[ rplm->getListEntryL0( rIdx )] : refPicListTemp0[ rIdx ];
     4172
     4173    // The decoding process below slice level requires the marking status
     4174    // of the reference pictures, when decoding the RPS. So store it here.
     4175    m_bIsUsedAsLongTerm[ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getIsLongTerm();
     4176    m_aiRefPOCList     [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getPOC();
     4177    m_aiRefLayerIdList [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getLayerId();
     4178  }
     4179
     4180  std::vector<TComPic*> refPicListTemp1;
     4181  refPicListTemp1.resize((MAX_NUM_REF+1),NULL);
     4182
     4183  if (getSliceType() == B_SLICE )
     4184  {
     4185    // When the slice is a B slice, the variable NumRpsCurrTempList1 is set equal to
     4186    // Max( num_ref_idx_l1_active_minus1 + 1, NumPicTotalCurr ) and the list RefPicListTemp1 is constructed as follows:
     4187    Int numRpsCurrTempList1 = std::max( getNumRefIdxL1ActiveMinus1() + 1, getNumPicTotalCurr() );
     4188
     4189    rIdx = 0;
     4190    while( rIdx < numRpsCurrTempList1 )
     4191    {
     4192      for( Int i = 0; i < numPocStCurrAfter  &&  rIdx < numRpsCurrTempList1; rIdx++, i++ )
     4193      {
     4194        refPicListTemp1[ rIdx ] = refPicSetStCurrAfter[ i ];
     4195      }
     4196      for( Int i = 0;  i < numPocStCurrBefore  &&  rIdx < numRpsCurrTempList1; rIdx++, i++ )  // (8-10)
     4197      {
     4198        refPicListTemp1[ rIdx ] = refPicSetStCurrBefore[ i ];
     4199      }         
     4200      for( Int i = 0; i < numPocLtCurr  &&  rIdx < numRpsCurrTempList1; rIdx++, i++ )
     4201      {
     4202        refPicListTemp1[ rIdx ] = refPicSetLtCurr[ i ];
     4203      }
     4204    }
     4205  }
     4206
     4207  if (getSliceType() == B_SLICE )
     4208  {
     4209    //   When the slice is a B slice, the list RefPicList1 is constructed as follows:
     4210    for( rIdx = 0; rIdx  <=  getNumRefIdxL1ActiveMinus1(); rIdx++ )      // (F 68)
     4211    {
     4212      m_apcRefPicList[ 1 ][ rIdx ] = rplm->getRefPicListModificationFlagL1() ? refPicListTemp1[ rplm->getListEntryL1( rIdx ) ] : refPicListTemp1[ rIdx ];
     4213
     4214      // The decoding process below slice level requires the marking status
     4215      // of the reference pictures, when decoding the RPS. So store it here.
     4216      m_bIsUsedAsLongTerm[ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getIsLongTerm();
     4217      m_aiRefPOCList     [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getPOC();
     4218      m_aiRefLayerIdList [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getLayerId();
     4219    }
     4220  }
     4221}
     4222
     4223Int TComSlice::getNumPicTotalCurr() const
     4224{
     4225  Int numPicTotalCurr = 0;
     4226#if NH_MV_FIX_NUM_POC_TOTAL_CUR
     4227  if ( !isIdr()  )
     4228  {
     4229    const TComStRefPicSet* stRps = getStRps( getCurrRpsIdx() );
     4230#endif
     4231    for( Int i = 0; i < stRps->getNumNegativePicsVar(); i++ )
     4232    {
     4233      if( stRps->getUsedByCurrPicS0Var( i ) )
     4234      {
     4235        numPicTotalCurr++;
     4236      }
     4237    }
     4238    for( Int i = 0; i < stRps->getNumPositivePicsVar(); i++)  //(7 55)
     4239    {
     4240      if( stRps->getUsedByCurrPicS1Var(i) )
     4241      {
     4242        numPicTotalCurr++;
     4243      }
     4244    }
     4245    for( Int i = 0; i < getNumLongTermSps() + getNumLongTermPics(); i++ )
     4246    {
     4247      if( getUsedByCurrPicLtVar( i ) )
     4248      {
     4249        numPicTotalCurr++;
     4250      }
     4251    }
     4252#if NH_MV_FIX_NUM_POC_TOTAL_CUR
     4253  }
     4254#endif
     4255
     4256  if ( decProcAnnexF() )
     4257  {
     4258    numPicTotalCurr += getNumActiveRefLayerPics();
     4259  }
     4260  return numPicTotalCurr;
     4261}
     4262
     4263
     4264
     4265Int TComSlice::getPocLsbLtVar( Int i )
     4266{
     4267  Int pocLsbLtVar;
     4268  if (i < getNumLongTermSps() )
     4269  {
     4270
     4271    pocLsbLtVar = getSPS()->getLtRefPicPocLsbSps( getLtIdxSps( i ) );
     4272  }
     4273  else
     4274  {
     4275    pocLsbLtVar = getPocLsbLt( i );
     4276  }
     4277  return pocLsbLtVar;
     4278}
     4279
     4280
     4281Bool TComSlice::getUsedByCurrPicLtVar( Int i ) const
     4282{
     4283  Bool usedByCurrPicLtVar;
     4284  if (i < getNumLongTermSps() )
     4285  {
     4286    usedByCurrPicLtVar = getSPS()->getUsedByCurrPicLtSPSFlag( getLtIdxSps( i ) );
     4287  }
     4288  else
     4289  {
     4290    usedByCurrPicLtVar = getUsedByCurrPicLtFlag( i );
     4291  }
     4292  return usedByCurrPicLtVar;
     4293}
     4294
     4295
     4296Int TComSlice::getDeltaPocMsbCycleLtVar( Int i ) const
     4297{
     4298  Int deltaPocMsbCycleVar;
     4299  if (i == 0 || i == getNumLongTermSps() )
     4300  {
     4301    deltaPocMsbCycleVar = getDeltaPocMsbCycleLt( i );
     4302  }
     4303  else
     4304  {
     4305    deltaPocMsbCycleVar = getDeltaPocMsbCycleLt( i ) + getDeltaPocMsbCycleLtVar( i - 1 );
     4306  }
     4307  return deltaPocMsbCycleVar;
     4308}
    39544309
    39554310#endif
     
    40744429
    40754430Void TComSlice::checkInCompPredRefLayers()
    4076 {
     4431{ 
    40774432  if ( getInCompPredFlag() )
    40784433  {
    40794434    for (Int i = 0; i < getNumCurCmpLIds(); i++ )
    4080     {
     4435    {     
    40814436      assert( getIvPic(!getIsDepth(), getInCmpRefViewIdcs( i ) ) != NULL );       
    40824437      //  It is a requirement of bitstream conformance that there
    40834438      //  is a picture in the DPB with PicOrderCntVal equal to the PicOrderCntVal of the current picture,
    40844439      //  and a nuh_layer_id value equal to ViewCompLayerId[ inCmpRefViewIdcs[ i ] ][ !DepthFlag ].
     4440    }
     4441  }
     4442}
     4443
     4444Void TComSlice::setPocsInCurrRPSs()
     4445{
     4446  // Currently only needed at decoder side;
     4447  m_pocsInCurrRPSs.clear();   
     4448  std::vector<TComPic*>** rpsCurr = getPic()->getDecodedRps()->m_refPicSetsCurr;
     4449  for (Int i = 0 ; i < 3; i++ )
     4450  {
     4451    for( Int j = 0; j < rpsCurr[i]->size(); j++ )
     4452    {
     4453      m_pocsInCurrRPSs.push_back( (*rpsCurr[i])[j]->getPOC() );
    40854454    }
    40864455  }
     
    46134982
    46144983  ProfileTierLevel* curProfileTierLevel = getGeneralPTL( );
     4984  assert( curProfileTierLevel != NULL );
    46154985
    46164986  if( !profilePresentFlag )
     
    46445014Void TComPTL::inferSubLayerValues(Int maxNumSubLayersMinus1, Int k, TComPTL* refPTL)
    46455015{
    4646   assert( k == 0 || refPTL != NULL );
    4647 
     5016  assert( k == 0 || refPTL != NULL );   
    46485017  for (Int i = maxNumSubLayersMinus1; i >= 0; i--)
    46495018  {
     
    46655034    }   
    46665035
     5036    assert( refProfileTierLevel != NULL );
    46675037    ProfileTierLevel* curProfileTierLevel = getSubLayerPTL( i );
     5038    assert( curProfileTierLevel != NULL );
    46685039    if( !getSubLayerLevelPresentFlag( i ) )
    46695040    {
     
    48835254}
    48845255
     5256
     5257Int TComDpbSize::getVpsMaxLatencyPictures( Int i, Int j ) const
     5258{
     5259  return getMaxVpsNumReorderPics( i, j ) + getMaxVpsLatencyIncreasePlus1(i, j) - 1;
     5260}
     5261
    48855262Void Window::scaleOffsets( Int scal )
    48865263{
     
    48945271  }
    48955272}
    4896 #endif
     5273
     5274Void TComStRefPicSet::inferRps( Int stRpsIdx, TComSPS* sps, Bool encoder )
     5275{
     5276  if ( getInterRefPicSetPredictionFlag() )
     5277  {
     5278    // When inter_ref_pic_set_prediction_flag is equal to 1, the variables DeltaPocS0[ stRpsIdx ][ i ], UsedByCurrPicS0[ stRpsIdx ][ i ],
     5279    // NumNegativePics[ stRpsIdx ], DeltaPocS1[ stRpsIdx ][ i ], UsedByCurrPicS1[ stRpsIdx ][ i ] and NumPositivePics[ stRpsIdx ] are
     5280    // derived as follows:
     5281
     5282    Int i = 0;
     5283    Int refRpsIdx = getRefRpsIdx( stRpsIdx );
     5284    TComStRefPicSet* refRps = sps->getStRefPicSet( refRpsIdx );
     5285
     5286    for( Int j = refRps->getNumPositivePicsVar( ) - 1; j >= 0; j-- )
     5287    {
     5288      Int dPoc = refRps->getDeltaPocS1Var( j ) + getDeltaRps();
     5289      if( dPoc < 0  &&  getUseDeltaFlag( refRps->getNumNegativePicsVar( ) + j ) )
     5290      {
     5291        setDeltaPocS0Var     ( i, dPoc );
     5292        setUsedByCurrPicS0Var( i++ , getUsedByCurrPicFlag( refRps->getNumNegativePicsVar( ) + j ) );
     5293      }
     5294    }
     5295    if( getDeltaRps() < 0  && getUseDeltaFlag( refRps->getNumDeltaPocs() ) )   //   (7 59)
     5296    {
     5297      setDeltaPocS0Var( i,  getDeltaRps() );
     5298      setUsedByCurrPicS0Var( i++ , getUsedByCurrPicFlag( refRps->getNumDeltaPocs() ) );
     5299    }
     5300    for( Int j = 0; j < refRps->getNumNegativePicsVar(); j++ )
     5301    {
     5302      Int dPoc = refRps->getDeltaPocS0Var( j ) + getDeltaRps();
     5303      if( dPoc < 0  &&  getUseDeltaFlag( j ) )
     5304      {
     5305        setDeltaPocS0Var( i , dPoc);
     5306        setUsedByCurrPicS0Var( i++ , getUsedByCurrPicFlag( j )) ;
     5307      }
     5308    }
     5309
     5310    setNumNegativePicsVar( i );
     5311
     5312    i = 0;
     5313    for( Int j = refRps->getNumNegativePicsVar() - 1; j  >=  0; j-- )
     5314    {
     5315      Int dPoc = refRps->getDeltaPocS0Var( j ) + getDeltaRps();
     5316      if( dPoc > 0  &&  getUseDeltaFlag( j ) )
     5317      {
     5318        setDeltaPocS1Var( i, dPoc );
     5319        setUsedByCurrPicS1Var(  i++, getUsedByCurrPicFlag( j ) ) ;
     5320      }
     5321    }
     5322
     5323    if( getDeltaRps() > 0  &&  getUseDeltaFlag( refRps->getNumDeltaPocs() ) ) //  (7 60)
     5324    {
     5325      setDeltaPocS1Var( i , getDeltaRps() );
     5326      setUsedByCurrPicS1Var( i++ , getUsedByCurrPicFlag( refRps->getNumDeltaPocs() ));
     5327    }
     5328
     5329    for( Int j = 0; j < refRps->getNumPositivePicsVar( ); j++)
     5330    {
     5331      Int dPoc = refRps->getDeltaPocS1Var( j ) + getDeltaRps();
     5332      if( dPoc > 0  &&  getUseDeltaFlag( refRps->getNumNegativePicsVar() + j ) )
     5333      {
     5334        setDeltaPocS1Var( i, dPoc);
     5335        setUsedByCurrPicS1Var( i++, getUsedByCurrPicFlag( refRps->getNumNegativePicsVar() + j ));
     5336      }
     5337    }
     5338    setNumPositivePicsVar(  i );
     5339  }
     5340  else
     5341  {
     5342    // When inter_ref_pic_set_prediction_flag is equal to 0, the variables NumNegativePics[ stRpsIdx ], NumPositivePics[ stRpsIdx ],
     5343    // UsedByCurrPicS0[ stRpsIdx ][ i ], UsedByCurrPicS1[ stRpsIdx ][ i ], DeltaPocS0[ stRpsIdx ][ i ] and DeltaPocS1[ stRpsIdx ][ i ]
     5344    // are derived as follows:
     5345
     5346    setNumNegativePicsVar( getNumNegativePics( ) );        //  (7 61)
     5347    setNumPositivePicsVar( getNumPositivePics( ) );         //  (7 62)
     5348
     5349    for (Int i = 0 ; i < getNumNegativePics(); i++ )
     5350    {     
     5351      setUsedByCurrPicS0Var( i,  getUsedByCurrPicS0Flag( i ) ); //  (7 63)
     5352      if (i == 0 )
     5353      {
     5354        setDeltaPocS0Var( i , -( getDeltaPocS0Minus1( i ) + 1 )); // (7 65)
     5355      }
     5356      else
     5357      {
     5358        setDeltaPocS0Var( i , getDeltaPocS0Var( i - 1 ) - ( getDeltaPocS0Minus1( i ) + 1 )); //  (7 67)
     5359      }
     5360    }
     5361
     5362    for (Int i = 0 ; i < getNumPositivePics(); i++ )
     5363    {     
     5364      setUsedByCurrPicS1Var( i,  getUsedByCurrPicS1Flag( i ) ); //  (7 64)
     5365
     5366      if (i == 0 )
     5367      {
     5368        setDeltaPocS1Var( i , getDeltaPocS1Minus1( i ) + 1    );      // (7 66)
     5369      }
     5370      else
     5371      {
     5372        setDeltaPocS1Var( i , getDeltaPocS1Var( i - 1 ) + ( getDeltaPocS1Minus1( i ) + 1 )); //  (7 68)
     5373      }
     5374    }
     5375  }
     5376}
     5377
     5378#endif
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComSlice.h

    r1313 r1317  
    5353class TComTrQuant;
    5454#if NH_MV
     55class TComDecodedRps;
    5556class TComPicLists;
    5657class TComVPS;
     
    6869
    6970/// Reference Picture Set class
     71
     72#if NH_MV
     73class TComStRefPicSet
     74{
     75  // This class is currently only used by the decoder.
     76  // TBD: Modify encoder to use also it.
     77
     78private:
     79
     80  // Syntax elements:
     81
     82  Bool m_interRefPicSetPredictionFlag;
     83  Int  m_deltaIdxMinus1;
     84  Bool m_deltaRpsSign;
     85  Int  m_absDeltaRpsMinus1;
     86  Bool m_usedByCurrPicFlag  [ MAX_NUM_PICS_RPS ];
     87  Bool m_useDeltaFlag       [ MAX_NUM_PICS_RPS ];
     88  Int  m_numNegativePics;   
     89  Int  m_numPositivePics;   
     90  Int  m_deltaPocS0Minus1   [ MAX_NUM_PICS_RPS ];
     91  Bool m_usedByCurrPicS0Flag[ MAX_NUM_PICS_RPS ];
     92  Int  m_deltaPocS1Minus1   [ MAX_NUM_PICS_RPS ];
     93  Bool m_usedByCurrPicS1Flag[ MAX_NUM_PICS_RPS ];
     94
     95  // Semantic variables:
     96  Int m_deltaPocS0Var       [ MAX_NUM_PICS_RPS ];
     97  Int m_deltaPocS1Var       [ MAX_NUM_PICS_RPS ];
     98  Int m_usedByCurrPicS0Var  [ MAX_NUM_PICS_RPS ];
     99  Int m_usedByCurrPicS1Var  [ MAX_NUM_PICS_RPS ];
     100  Int m_numNegativePicsVar  ;
     101  Int m_numPositivePicsVar  ;
     102
     103public:
     104
     105  TComStRefPicSet( )
     106  {
     107    // Set default inheritance values:
     108    setInterRefPicSetPredictionFlag( false );
     109    setDeltaIdxMinus1( 0 );
     110    for (Int j = 0; j < MAX_NUM_PICS_RPS; j++)
     111    {
     112      setUseDeltaFlag( j, true  );
     113    }   
     114  }
     115
     116  // Syntax elements:
     117  Void  setInterRefPicSetPredictionFlag( Bool flag )           { m_interRefPicSetPredictionFlag = flag; }
     118  Bool  getInterRefPicSetPredictionFlag(  ) const              { return m_interRefPicSetPredictionFlag; }
     119
     120  Void  setDeltaIdxMinus1( Int  val )                          { m_deltaIdxMinus1 = val;                }
     121  Int   getDeltaIdxMinus1(  ) const                            { return m_deltaIdxMinus1;               }
     122
     123  Void  setDeltaRpsSign( Bool flag )                           { m_deltaRpsSign = flag;                 }
     124  Bool  getDeltaRpsSign(  ) const                              { return m_deltaRpsSign;                 }
     125
     126  Void  setAbsDeltaRpsMinus1( Int  val )                       { m_absDeltaRpsMinus1 = val;             }
     127  Int   getAbsDeltaRpsMinus1(  ) const                         { return m_absDeltaRpsMinus1;            }
     128
     129  Void  setUsedByCurrPicFlag( Int j, Bool flag )               { m_usedByCurrPicFlag[j] = flag;         }
     130  Bool  getUsedByCurrPicFlag( Int j ) const                    { return m_usedByCurrPicFlag[j];         }
     131
     132  Void  setUseDeltaFlag( Int j, Bool flag )                    { m_useDeltaFlag[j] = flag;              }
     133  Bool  getUseDeltaFlag( Int j ) const                         { return m_useDeltaFlag[j];              }
     134
     135  Void  setNumNegativePics( Int  val )                         { m_numNegativePics = val;               }
     136  Int   getNumNegativePics(  ) const                           { return m_numNegativePics;              }
     137
     138  Void  setNumPositivePics( Int  val )                         { m_numPositivePics = val;               }
     139  Int   getNumPositivePics(  ) const                           { return m_numPositivePics;              }
     140
     141  Void  setDeltaPocS0Minus1( Int i, Int  val )                 { m_deltaPocS0Minus1[i] = val;           }
     142  Int   getDeltaPocS0Minus1( Int i ) const                     { return m_deltaPocS0Minus1[i];          }
     143
     144  Void  setUsedByCurrPicS0Flag( Int i, Bool flag )             { m_usedByCurrPicS0Flag[i] = flag;       }
     145  Bool  getUsedByCurrPicS0Flag( Int i ) const                  { return m_usedByCurrPicS0Flag[i];       }
     146
     147  Void  setDeltaPocS1Minus1( Int i, Int  val )                 { m_deltaPocS1Minus1[i] = val;           }
     148  Int   getDeltaPocS1Minus1( Int i ) const                     { return m_deltaPocS1Minus1[i];          }
     149
     150  Void  setUsedByCurrPicS1Flag( Int i, Bool flag )             { m_usedByCurrPicS1Flag[i] = flag;       }
     151  Bool  getUsedByCurrPicS1Flag( Int i ) const                  { return m_usedByCurrPicS1Flag[i];       }
     152
     153  // Semantics variables:
     154  Int   getRefRpsIdx(Int stRpsIdx ) const                      { return ( stRpsIdx - (getDeltaIdxMinus1() +  1) ); }
     155  Int   getDeltaRps()  const                                   { return (  ( 1 - 2 * getDeltaRpsSign() ) * ( getAbsDeltaRpsMinus1() + 1 ) ); }
     156  Int   getNumDeltaPocs() const                                { return ( getNumNegativePicsVar() + getNumPositivePicsVar());    }
     157
     158  Void  setNumNegativePicsVar( Int  val )                      { m_numNegativePicsVar = val;            }
     159  Int   getNumNegativePicsVar(  ) const                        { return m_numNegativePicsVar;           }
     160
     161  Void  setNumPositivePicsVar( Int  val )                      { m_numPositivePicsVar = val;            }
     162  Int   getNumPositivePicsVar(  ) const                        { return m_numPositivePicsVar;           }
     163
     164  Void  setDeltaPocS0Var( Int i, Int  val )                    { m_deltaPocS0Var[i] = val;              }
     165  Int   getDeltaPocS0Var( Int i ) const                        { return m_deltaPocS0Var[i];             }
     166
     167  Void  setUsedByCurrPicS0Var( Int i, Bool flag )              { m_usedByCurrPicS0Var[i] = flag;       }
     168  Bool  getUsedByCurrPicS0Var( Int i ) const                   { return m_usedByCurrPicS0Var[i];       }
     169
     170  Void  setDeltaPocS1Var( Int i, Int  val )                    { m_deltaPocS1Var[i] = val;             }
     171  Int   getDeltaPocS1Var( Int i ) const                        { return m_deltaPocS1Var[i];            }
     172
     173  Void  setUsedByCurrPicS1Var( Int i, Bool flag )              { m_usedByCurrPicS1Var[i] = flag;       }
     174  Bool  getUsedByCurrPicS1Var( Int i ) const                   { return m_usedByCurrPicS1Var[i];       }
     175
     176  Void  inferRps( Int stRpsIdx, TComSPS* sps, Bool encoder );
     177};
     178
     179#endif
     180
    70181class TComReferencePictureSet
    71182{
     
    302413{
    303414  ProfileTierLevel m_generalPTL;
     415#if !NH_MV
    304416  ProfileTierLevel m_subLayerPTL    [MAX_TLAYER-1];      // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 (= 6)
    305417  Bool m_subLayerProfilePresentFlag [MAX_TLAYER-1];
    306418  Bool m_subLayerLevelPresentFlag   [MAX_TLAYER-1];
     419#else
     420  ProfileTierLevel m_subLayerPTL    [MAX_TLAYER];        // However, highest index is 6, so we need one more.
     421  Bool m_subLayerProfilePresentFlag [MAX_TLAYER];
     422  Bool m_subLayerLevelPresentFlag   [MAX_TLAYER];
     423#endif
    307424
    308425public:
     
    804921
    805922  Void          setMaxVpsLatencyIncreasePlus1( Int i, Int j, Int  val )              { m_maxVpsLatencyIncreasePlus1[i][j] = val;                  }
    806   Int           getMaxVpsLatencyIncreasePlus1( Int i, Int j ) const                  { return m_maxVpsLatencyIncreasePlus1[i][j];                 }
     923  Int           getMaxVpsLatencyIncreasePlus1( Int i, Int j ) const                  { return m_maxVpsLatencyIncreasePlus1[i][j];                 }
     924  Int           getVpsMaxLatencyPictures     ( Int i, Int j ) const;
    807925};
    808926#endif
     
    9011019  Int         m_defaultDirectDependencyType;
    9021020 
    903 #if H_MV_HLS7_GEN
    904   Int         m_directDependencyType     [MAX_NUM_LAYERS] [MAX_NUM_LAYERS];
    905 #endif
    9061021  Bool        m_vpsVuiPresentFlag;
    9071022  TComVPSVUI  m_vpsVUI;
    908 #if !H_MV_HLS7_GEN
    9091023  Int         m_directDependencyType     [MAX_NUM_LAYERS] [MAX_NUM_LAYERS];
    910 #endif
    9111024
    9121025  // VPS EXTENSION SEMANTICS VARIABLES
     
    11191232  Void    setLayerSetIdxForOlsMinus1( Int outLayerSetIdx, Int val )             { m_layerSetIdxForOlsMinus1[ outLayerSetIdx ]  = val; }
    11201233  Int     getLayerSetIdxForOlsMinus1( Int outLayerSetIdx )           const      { return m_layerSetIdxForOlsMinus1[ outLayerSetIdx ]; }
    1121 #if NH_MV_FIX_TICKET_105
    11221234  Int     getLayerSetIdxForOlsMinus1Len( Int outLayerSetIdx )        const      { return gCeilLog2( getNumLayerSets() - 1 ); }
    1123 #else
    1124   Int     getLayerSetIdxForOlsMinus1Len( Int outLayerSetIdx )        const      { return gCeilLog2( getNumLayerSets() ); }
    1125 #endif
    11261235
    11271236  Void    setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag )            { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; }
     
    18031912
    18041913  TComRPSList      m_RPSList;
     1914#if NH_MV
     1915  std::vector<TComStRefPicSet> m_stRefPicSets;
     1916#endif
    18051917  Bool             m_bLongTermRefsPresent;
    18061918  Bool             m_TMVPFlagsPresent;
     
    18251937  UInt             m_uiBitsForPOC;
    18261938  UInt             m_numLongTermRefPicSPS;
     1939#if NH_MV
     1940  Int              m_numShortTermRefPicSets;
     1941#endif
    18271942  UInt             m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS];
    18281943  Bool             m_usedByCurrPicLtSPSFlag[MAX_NUM_LONG_TERM_REF_PICS];
     
    18381953  TComScalingList  m_scalingList;
    18391954  UInt             m_uiMaxDecPicBuffering[MAX_TLAYER];
     1955#if NH_MV
     1956  UInt             m_uiSpsMaxLatencyIncreasePlus1[MAX_TLAYER]; 
     1957  // Calling a member m_uiMaxLatencyIncrease although it is m_uiMaxLatencyIncreasePlus1 is really bad style. 
     1958#else
    18401959  UInt             m_uiMaxLatencyIncrease[MAX_TLAYER];  // Really max latency increase plus 1 (value 0 expresses no limit)
     1960#endif
    18411961
    18421962  Bool             m_useStrongIntraSmoothing;
     
    19112031  Void                   setConformanceWindow(Window& conformanceWindow )                                { m_conformanceWindow = conformanceWindow;                             }
    19122032
     2033#if NH_MV
     2034  UInt                   getNumLongTermRefPicsSps() const                                                 { return m_numLongTermRefPicSPS;                                       }
     2035#endif
     2036 
    19132037  UInt                   getNumLongTermRefPicSPS() const                                                 { return m_numLongTermRefPicSPS;                                       }
    19142038  Void                   setNumLongTermRefPicSPS(UInt val)                                               { m_numLongTermRefPicSPS = val;                                        }
     
    19392063  Void                   setBitsForPOC( UInt u )                                                         { m_uiBitsForPOC = u;                                                  }
    19402064  UInt                   getBitsForPOC() const                                                           { return m_uiBitsForPOC;                                               }
     2065#if NH_MV
     2066  UInt                   getMaxPicOrderCntLsb() const                                                    { return (1 << ( getLog2MaxPicOrderCntLsbMinus4() + 4) );  }
     2067  Int                    getLog2MaxPicOrderCntLsbMinus4() const                                          { return (getBitsForPOC() - 4);  }
     2068#endif
    19412069  Bool                   getUseAMP() const                                                               { return m_useAMP;                                                     }
    19422070  Void                   setUseAMP( Bool b )                                                             { m_useAMP = b;                                                        }
     
    19542082  const TComRPSList*     getRPSList() const                                                              { return &m_RPSList;                                                   }
    19552083  TComRPSList*           getRPSList()                                                                    { return &m_RPSList;                                                   }
     2084#if NH_MV
     2085  Void                   initStRefPicSets( )                                                             { m_stRefPicSets.resize( getNumShortTermRefPicSets() );                }
     2086  TComStRefPicSet*       getStRefPicSet( Int i )                                                         { return &(m_stRefPicSets[i]);                                         }
     2087  const TComStRefPicSet* getStRefPicSet( Int i ) const                                                   { return &(m_stRefPicSets[i]);                                         }
     2088  Bool                   getLongTermRefPicsPresentFlag() const                                           { return m_bLongTermRefsPresent;                                       }
     2089  Void                   setLongTermRefPicsPresentFlag(Bool b)                                           { m_bLongTermRefsPresent=b;                                            }
     2090#else
    19562091  Bool                   getLongTermRefsPresent() const                                                  { return m_bLongTermRefsPresent;                                       }
    19572092  Void                   setLongTermRefsPresent(Bool b)                                                  { m_bLongTermRefsPresent=b;                                            }
     2093#endif
    19582094  Bool                   getTMVPFlagsPresent() const                                                     { return m_TMVPFlagsPresent;                                           }
    19592095  Void                   setTMVPFlagsPresent(Bool b)                                                     { m_TMVPFlagsPresent=b;                                                }
     2096#if NH_MV
     2097  Bool                   getSpsTemporalMvpEnabledFlag() const                                            { return m_TMVPFlagsPresent;                                           }
     2098#endif
    19602099  // physical transform
    19612100  Void                   setMaxTrSize( UInt u )                                                          { m_uiMaxTrSize = u;                                                   }
     
    19882127  Void                   setPCMFilterDisableFlag( Bool bValue )                                          { m_bPCMFilterDisableFlag = bValue;                                    }
    19892128  Bool                   getPCMFilterDisableFlag() const                                                 { return m_bPCMFilterDisableFlag;                                      }
    1990 
     2129#if NH_MV
     2130  Void                  setNumShortTermRefPicSets( Int  val )                                            { m_numShortTermRefPicSets = val; }
     2131  Int                   getNumShortTermRefPicSets(  )const                                               { return m_numShortTermRefPicSets; }
     2132#endif
    19912133  Bool                   getScalingListFlag() const                                                      { return m_scalingListEnabledFlag;                                     }
    19922134  Void                   setScalingListFlag( Bool b )                                                    { m_scalingListEnabledFlag  = b;                                       }
     
    19982140  UInt                   getMaxDecPicBuffering(UInt tlayer) const                                        { return m_uiMaxDecPicBuffering[tlayer];                               }
    19992141  Void                   setMaxDecPicBuffering( UInt ui, UInt tlayer )                                   { assert(tlayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tlayer] = ui;    }
     2142#if NH_MV
     2143  UInt                   getSpsMaxDecPicBufferingMinus1(UInt tlayer) const                               { return m_uiMaxDecPicBuffering[tlayer] -1 ;                           }
     2144  UInt                   getSpsMaxLatencyIncreasePlus1(UInt tlayer) const                                { return m_uiSpsMaxLatencyIncreasePlus1[tlayer];                       }
     2145  Void                   setSpsMaxLatencyIncreasePlus1( UInt ui , UInt tlayer)                           { m_uiSpsMaxLatencyIncreasePlus1[tlayer] = ui;                         }
     2146  Int                    getSpsMaxLatencyPictures( Int i )  const                                       { return ( getSpsMaxNumReorderPics(i) + getSpsMaxLatencyIncreasePlus1(i)-1); }
     2147#else
    20002148  UInt                   getMaxLatencyIncrease(UInt tlayer) const                                        { return m_uiMaxLatencyIncrease[tlayer];                               }
    20012149  Void                   setMaxLatencyIncrease( UInt ui , UInt tlayer)                                   { m_uiMaxLatencyIncrease[tlayer] = ui;                                 }
     2150#endif
     2151
     2152#if NH_MV
     2153  Int                    getSpsMaxNumReorderPics(Int i ) const                                           { return getNumReorderPics( i );                                       }
     2154#endif
    20022155
    20032156  Void                   setUseStrongIntraSmoothing(Bool bVal)                                           { m_useStrongIntraSmoothing = bVal;                                    }
     
    21332286  Void    setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL1[idx] = refPicSetIdx; }
    21342287#if NH_MV
    2135   // Why not a listIdx for all members, would avoid code duplication??
     2288 
    21362289  Void    setRefPicSetIdxL(UInt li, UInt idx, UInt refPicSetIdx) {( li==0 ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ) = refPicSetIdx;              }
    21372290  UInt    getRefPicSetIdxL(UInt li, UInt idx )                   { return ( li == 0 ) ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ;                  }
    21382291  Void    setRefPicListModificationFlagL(UInt li, Bool flag)     { ( li==0  ? m_refPicListModificationFlagL0 : m_refPicListModificationFlagL1 ) = flag;  }
    21392292  Bool    getRefPicListModificationFlagL(UInt li )               { return ( li== 0) ? m_refPicListModificationFlagL0 : m_refPicListModificationFlagL1;   }
     2293
     2294  Int     getListEntryL0( Int i) const                           { assert(i<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL0[i];         }
     2295  Int     getListEntryL1( Int i) const                           { assert(i<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL1[i];         }
     2296
     2297  Int     getListEntryLXLen( Int numPicTotalCur ) const          { return gCeilLog2( numPicTotalCur );                                 } 
     2298
     2299  Void    setListEntryL0( Int i, Int  val )                      { m_RefPicSetIdxL0[i] = val;                                          }
     2300  Void    setListEntryL1( Int i, Int  val )                      { m_RefPicSetIdxL1[i] = val;                                          }
     2301
     2302
    21402303#endif
    21412304};
     
    24702633private:
    24712634  //  Bitstream writing
     2635#if NH_MV
     2636  Bool                       m_firstSliceSegmentInPicFlag;
     2637#endif
    24722638  Bool                       m_saoEnabledFlag[MAX_NUM_CHANNEL_TYPE];
    24732639  Int                        m_iPPSId;               ///< picture parameter set ID
     
    24752641#if NH_MV
    24762642  Int                        m_slicePicOrderCntLsb;   
     2643  Bool                       m_shortTermRefPicSetSpsFlag;
     2644  Int                        m_shortTermRefPicSetIdx;
     2645  Int                        m_numLongTermSps;
     2646  Int                        m_numLongTermPics;
     2647  Int                        m_ltIdxSps                     [MAX_NUM_PICS_RPS];
     2648  Int                        m_pocLsbLt                     [MAX_NUM_PICS_RPS];
     2649  Bool                       m_usedByCurrPicLtFlag          [MAX_NUM_PICS_RPS];
     2650  Bool                       m_deltaPocMsbPresentFlag       [MAX_NUM_PICS_RPS];
     2651  Int                        m_deltaPocMsbCycleLt           [MAX_NUM_PICS_RPS];
     2652  Bool                       m_sliceTemporalMvpEnabledFlag;
     2653  TComStRefPicSet            m_stRefPicSet;
    24772654#endif 
    24782655  Int                        m_iPOC;
     
    25102687  Int                        m_aiRefPOCList  [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];
    25112688#if NH_MV
    2512   Int         m_aiRefLayerIdList[2][MAX_NUM_REF+1];
     2689  Int                        m_aiRefLayerIdList[2][MAX_NUM_REF+1];
    25132690#endif
    25142691  Bool                       m_bIsUsedAsLongTerm[NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];
     
    25702747  SliceType                  m_encCABACTableIdx;           // Used to transmit table selection across slices.
    25712748#if NH_MV
    2572   Bool       m_availableForTMVPRefFlag;
    2573 #endif
    2574 
    2575 #if NH_MV
     2749
    25762750  std::vector<TComPic*>* m_refPicSetInterLayer0;
    25772751  std::vector<TComPic*>* m_refPicSetInterLayer1;
     
    25842758
    25852759// Additional slice header syntax elements
    2586 #if !H_MV_HLS7_GEN
    25872760  Bool       m_pocResetFlag;
    2588 #endif
     2761
    25892762  Bool       m_crossLayerBlaFlag;
    25902763  Bool       m_discardableFlag;
     
    25962769  Int        m_pocResetIdc;
    25972770  Int        m_pocResetPeriodId;
     2771
     2772  Bool       m_hasPocResetPeriodIdPresent;
     2773  DecodingProcess m_decodingProcess;
     2774  DecodingProcess m_decProcPocAndRps;
    25982775  Bool       m_fullPocResetFlag;
    25992776  Int        m_pocLsbVal;
    2600   Bool       m_pocMsbValPresentFlag;
    2601   Int        m_pocMsbVal;
     2777  Bool       m_pocMsbCycleValPresentFlag;
     2778  Int        m_pocMsbCycleVal;
    26022779  Bool       m_pocMsbValRequiredFlag;
    26032780
     
    26762853  Void                        setSlicePicOrderCntLsb( Int i )                        { m_slicePicOrderCntLsb = i;                                    }
    26772854  Int                         getSlicePicOrderCntLsb(  )  const                      { return m_slicePicOrderCntLsb;                                 }
     2855
     2856  Bool                        getFirstSliceSegementInPicFlag() const                 {  return m_firstSliceSegmentInPicFlag;                         }
     2857  Void                        setFirstSliceSegementInPicFlag(Bool val)               { m_firstSliceSegmentInPicFlag = val;                           }
    26782858#endif
    26792859  Bool                        getPicOutputFlag() const                               { return m_PicOutputFlag;                                       }
     
    27342914  Void                        setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx )      { m_pBaseViewRefPicList[iViewIdx] = pListPic; }                 
    27352915  Void                        setARPStepNum( TComPicLists*ivPicLists );                                                                             
     2916  Void                        setPocsInCurrRPSs( );
     2917
    27362918  TComPic*                    getBaseViewRefPic    ( UInt uiPOC , Int iViewIdx )     { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); }
    27372919  UInt                        getARPStepNum( )                                       { return m_nARPStepNum;                                         } 
     
    27462928  Bool                        getMvdL1ZeroFlag() const                               { return m_bLMvdL1Zero;                                         }
    27472929  Int                         getNumRpsCurrTempList() const;
     2930#if NH_MV
     2931  Int                         getNumPicTotalCurr() const;
     2932#endif
    27482933  Int                         getList1IdxToList0Idx( Int list1Idx ) const            { return m_list1IdxToList0Idx[list1Idx];                        }
    27492934  Void                        setReferenced(Bool b)                                  { m_bRefenced = b;                                              }
     
    27532938  Void                        setNalUnitType( NalUnitType e )                        { m_eNalUnitType      = e;                                      }
    27542939  NalUnitType                 getNalUnitType() const                                 { return m_eNalUnitType;                                        }
     2940#if NH_MV
     2941  std::string                 getNalUnitTypeString(    )                             { return NALU_TYPE_STR[ getNalUnitType() ]; };
     2942#endif
    27552943  Bool                        getRapPicFlag() const;
    27562944  Bool                        getIdrPicFlag() const                                  { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
    27572945  Bool                        isIRAP() const                                         { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23);  }
     2946#if NH_MV 
     2947  Bool                        isBla() const                                          { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP   )  || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ); }
     2948  Bool                        isIdr() const                                          { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL )  || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ); }
     2949  Bool                        isCra() const                                          { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ); }
     2950
     2951  Bool                        isSlnr() const                                         { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N  ||   
     2952                                                                                                getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N    ||   
     2953                                                                                                getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N   ||   
     2954                                                                                                getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N   ||   
     2955                                                                                                getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N   ||   
     2956                                                                                                getNalUnitType() == NAL_UNIT_RESERVED_VCL_N10     ||
     2957                                                                                                getNalUnitType() == NAL_UNIT_RESERVED_VCL_N12     ||           
     2958                                                                                                getNalUnitType() == NAL_UNIT_RESERVED_VCL_N14     );  }
     2959 
     2960  Bool                        isRasl() const                                          { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R )  || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N ); }
     2961  Bool                        isRadl() const                                          { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R )  || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N ); }
     2962  Bool                        isStsa() const                                          { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R )  || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N ); }
     2963  Bool                        isTsa()  const                                          { return ( getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_R )   || ( getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N ); }
     2964
     2965  Bool                        decProcClause8() const                                  { return ( m_decodingProcess == CLAUSE_8  ); }   
     2966  Bool                        decProcAnnexF()  const                                  { return ( decProcAnnexG()  || decProcAnnexH() || decProcAnnexI() ) ; }
     2967  Bool                        decProcAnnexG()  const                                  { return ( m_decodingProcess == ANNEX_G || decProcAnnexI()  ); }   
     2968  Bool                        decProcAnnexH()  const                                  { return ( m_decodingProcess == ANNEX_H  ); }   
     2969  Bool                        decProcAnnexI()  const                                  { return ( m_decodingProcess == ANNEX_I  ); }   
     2970  Int                         getCurrRpsIdx() const                                   { return ( getShortTermRefPicSetSpsFlag() ? getShortTermRefPicSetIdx() : getSPS()->getNumShortTermRefPicSets() ) ;}
     2971
     2972#endif
     2973
     2974
    27582975  Void                        checkCRA(const TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic);
    27592976  Void                        decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, const bool bEfficientFieldIRAPEnabled);
     
    27742991  Void                        setRefPOC( Int i, RefPicList e, Int iRefIdx )          { m_aiRefPOCList[e][iRefIdx] = i;                               }
    27752992  Void                        setNumRefIdx( RefPicList e, Int i )                    { m_aiNumRefIdx[e]    = i;                                      }
     2993#if NH_MV
     2994  Int                         getNumRefIdxL0ActiveMinus1() const                     { return ( getNumRefIdx(REF_PIC_LIST_0) -1);                    }
     2995  Int                         getNumRefIdxL1ActiveMinus1() const                     { return ( getNumRefIdx(REF_PIC_LIST_1) -1);                    }
     2996#endif
    27762997  Void                        setPic( TComPic* p )                                   { m_pcPic             = p;                                      }
    27772998  Void                        setDepth( Int iDepth )                                 { m_iDepth            = iDepth;                                 }
     
    28273048  Void                        setTLayer( UInt uiTLayer )                             { m_uiTLayer = uiTLayer;                                        }
    28283049#if NH_MV
    2829   Int                         getTemporalId          ( )                             { return (Int) m_uiTLayer;                                      }
     3050  Int                         getTemporalId( ) const                                 { return (Int) m_uiTLayer;                                      }
    28303051#endif
    28313052
     
    28363057#if NH_MV
    28373058  Void                        createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 );
     3059  Void                        f834decProcForRefPicListConst();
     3060  Void                        cl834DecProcForRefPicListConst();
     3061
    28383062  static Void                 markIvRefPicsAsShortTerm    ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 );
    28393063  static Void                 markCurrPic                 ( TComPic* currPic );
     
    28523076  Void                        setNoRaslOutputFlag( Bool val )                        { m_noRaslOutputFlag = val;                                     }
    28533077  Bool                        getNoRaslOutputFlag() const                            { return m_noRaslOutputFlag;                                    }
     3078
    28543079
    28553080  Void                        setHandleCraAsBlaFlag( Bool val )                      { m_handleCraAsBlaFlag = val;                                   }
     
    29153140  Bool                        getLFCrossSliceBoundaryFlag()                          { return m_LFCrossSliceBoundaryFlag;                            }
    29163141
     3142#if NH_MV
     3143  Void                        setShortTermRefPicSetSpsFlag( Bool flag )              { m_shortTermRefPicSetSpsFlag = flag;                           }
     3144  Bool                        getShortTermRefPicSetSpsFlag(  ) const                 { return m_shortTermRefPicSetSpsFlag;                           }
     3145
     3146  Int                         getShortTermRefPicSetIdxLen() const                    { return gCeilLog2( getSPS()->getNumShortTermRefPicSets() );    }
     3147  Void                        setShortTermRefPicSetIdx( Int  val )                   { m_shortTermRefPicSetIdx = val;                                }
     3148  Int                         getShortTermRefPicSetIdx(  ) const                     { return m_shortTermRefPicSetIdx;                               }
     3149 
     3150  Void                        setNumLongTermSps( Int  val )                          { m_numLongTermSps = val;                                       }
     3151  Int                         getNumLongTermSps(  ) const                            { return m_numLongTermSps;                                      }
     3152
     3153  Void                        setNumLongTermPics( Int  val )                         { m_numLongTermPics = val;                                      }
     3154  Int                         getNumLongTermPics(  ) const                           { return m_numLongTermPics;                                     }
     3155 
     3156  Int                         getLtIdxSpsLen() const                                 { return gCeilLog2( getSPS()->getNumLongTermRefPicsSps() );     }
     3157  Void                        setLtIdxSps( Int i, Int  val )                         { m_ltIdxSps[i] = val;                                          }
     3158  Int                         getLtIdxSps( Int i ) const                             { return m_ltIdxSps[i];                                         }
     3159
     3160  Int                         getPocLsbLtLen() const                                 { return (getSPS()->getLog2MaxPicOrderCntLsbMinus4()+ 4);       }
     3161  Void                        setPocLsbLt( Int i, Int  val )                         { m_pocLsbLt[i] = val;                                          }
     3162  Int                         getPocLsbLt( Int i ) const                             { return m_pocLsbLt[i];                                         }
     3163
     3164  Void                        setUsedByCurrPicLtFlag( Int i, Bool flag )             { m_usedByCurrPicLtFlag[i] = flag;                              }
     3165  Bool                        getUsedByCurrPicLtFlag( Int i ) const                  { return m_usedByCurrPicLtFlag[i];                              }
     3166
     3167  Void                        setDeltaPocMsbPresentFlag( Int i, Bool flag )          { m_deltaPocMsbPresentFlag[i] = flag;                           }
     3168  Bool                        getDeltaPocMsbPresentFlag( Int i ) const               { return m_deltaPocMsbPresentFlag[i];                           }
     3169
     3170  Void                        setDeltaPocMsbCycleLt( Int i, Int  val )               { m_deltaPocMsbCycleLt[i] = val;                                }
     3171  Int                         getDeltaPocMsbCycleLt( Int i ) const                   { return m_deltaPocMsbCycleLt[i];                               }
     3172
     3173  Void                        setSliceTemporalMvpEnabledFlag( Bool flag )            { m_enableTMVPFlag = flag;                         }
     3174  Bool                        getSliceTemporalMvpEnabledFlag(  ) const               { return m_enableTMVPFlag;                         }
     3175
     3176  TComStRefPicSet*            getLocalStRps( )                                       { return &m_stRefPicSet; };
     3177  const TComStRefPicSet*      getStRps( Int stRpsIdx ) const                         { return ( (stRpsIdx == getSPS()->getNumShortTermRefPicSets()) ? &m_stRefPicSet : getSPS()->getStRefPicSet( stRpsIdx ) ); };
     3178
     3179#endif
     3180
    29173181  Void                        setEnableTMVPFlag( Bool   b )                          { m_enableTMVPFlag = b;                                         }
    29183182  Bool                        getEnableTMVPFlag()                                    { return m_enableTMVPFlag;                                      }
     
    29223186
    29233187#if NH_MV
    2924   Void                        setAvailableForTMVPRefFlag( Bool   b )                 { m_availableForTMVPRefFlag = b;                                }
    2925   Bool                        getAvailableForTMVPRefFlag()                           { return m_availableForTMVPRefFlag;                             }
    2926 
    29273188  Void                        setLayerId     ( Int layerId )                         { m_layerId      = layerId;                                     }
    29283189  Int                         getLayerId     ()                 const                { return m_layerId;                                             }
     
    29323193  Void                        setViewIndex   ( Int viewIndex )                       { m_viewIndex = viewIndex;                                      }
    29333194  Int                         getViewIndex   ()                 const                { return m_viewIndex;                                           }
     3195
     3196  Void                        setDecodingProcess ( DecodingProcess decProc )         { m_decodingProcess = decProc;                                  }
     3197
     3198
    29343199#if NH_3D
    29353200#if NH_3D_TMVP
     
    29863251  Void                        checkCrossLayerBlaFlag ( ) const ;
    29873252
    2988 #if !H_MV_HLS7_GEN
     3253#if NH_MV
    29893254  Void                        setPocResetFlag( Bool flag )                           { m_pocResetFlag = flag;                                        }
    29903255  Bool                        getPocResetFlag(  ) const                              { return m_pocResetFlag;                                        }
     
    30103275  Void                        checkPocResetIdc( ) const                              { assert( !(getVPS()->getPocLsbNotPresentFlag( getLayerIdInVps() ) )  || !(getSlicePicOrderCntLsb() > 0 ) || !( getPocResetIdc() == 2) ); }
    30113276
     3277 
    30123278  Void                        setPocResetPeriodId( Int  val )                        { m_pocResetPeriodId = val;                                     }
    30133279  Int                         getPocResetPeriodId(  ) const                          { return m_pocResetPeriodId;                                    }
     
    30203286  Void                        checkPocLsbVal( ) const                                { assert( !(getVPS()->getPocLsbNotPresentFlag( getLayerIdInVps() ) )  || !getFullPocResetFlag() || ( getPocLsbVal() == 0 ) ); }
    30213287
     3288#if NH_MV
     3289  Void                        setHasPocResetPeriodIdPresent( Bool  val )              { m_hasPocResetPeriodIdPresent = val;                                }
     3290  Bool                        getHasPocResetPeriodIdPresent(  ) const                { return m_hasPocResetPeriodIdPresent;                               }
     3291
     3292  Void                        setPocMsbCycleValPresentFlag( Bool flag )              { m_pocMsbCycleValPresentFlag = flag;                                }
     3293  Bool                        getPocMsbCycleValPresentFlag(  )          const        { return m_pocMsbCycleValPresentFlag;                                }
     3294
     3295  Void                        setPocMsbCycleVal( Int  val )                          { m_pocMsbCycleVal = val;                                            }
     3296  Int                         getPocMsbCycleVal(  )         const                    { return m_pocMsbCycleVal;                                           }
     3297 
     3298  Int                         getPocLsbLtVar(Int i);
     3299  Bool                        getUsedByCurrPicLtVar(Int i) const;
     3300  Int                         getDeltaPocMsbCycleLtVar( Int i ) const;
     3301
     3302#else
    30223303  Void                        setPocMsbValPresentFlag( Bool flag )                   { m_pocMsbValPresentFlag = flag;                                }
    30233304  Bool                        getPocMsbValPresentFlag(  )          const             { return m_pocMsbValPresentFlag;                                }
     
    30253306  Void                        setPocMsbVal( Int  val )                               { m_pocMsbVal = val;                                            }
    30263307  Int                         getPocMsbVal(  )         const                         { return m_pocMsbVal;                                           }
     3308#endif
     3309
    30273310
    30283311  Bool                        getCraOrBlaPicFlag()       const                       { return ( getCraPicFlag() || getBlaPicFlag() );                }
    30293312  Bool                        getPocMsbValRequiredFlag() const                       { return ( getCraOrBlaPicFlag() && ( getVPS()->getVpsPocLsbAlignedFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 0 ) );  }
    30303313
    3031   UInt                        getPocLsbValLen() const                                { return getSPS()->getBitsForPOC();                             }; //log2_max_pic_order_cnt_lsb_minus4 + 4
     3314  UInt                        getPocLsbValLen() const                                { return getSPS()->getBitsForPOC();                             }; //log2_max_pic_order_cnt_lsb_minus4 + 4 
    30323315
    30333316  Bool getBlaPicFlag() const
     
    30693352  Void                        deriveInCmpPredAndCpAvailFlag( );
    30703353  Void                        init3dToolParameters();
    3071   Void                        checkInCompPredRefLayers();;
     3354  Void                        checkInCompPredRefLayers();
    30723355
    30733356  Bool                        getIvMvPredFlag           ( )                          { return m_ivMvPredFlag           ;                             };
     
    30953378#endif
    30963379#endif
     3380#if NH_MV
     3381 TComPic*                     getRefPicSetInterLayer( Int setIdc, Int i ) const;
     3382#endif
     3383
    30973384  // Inference
     3385#if NH_MV
     3386  Bool                        inferPocMsbCycleValPresentFlag();
     3387#else
    30983388  Bool                        inferPocMsbValPresentFlag();
     3389#endif
    30993390#endif
    31003391protected:
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TypeDef.h

    r1313 r1317  
    6161#define NH_3D          ( HEVC_EXT == 2)
    6262/////////////////////////////////////////////////////////////////////////////////////////
     63///////////////////////////////////   FIXES           /////////////////////////////////// 
     64/////////////////////////////////////////////////////////////////////////////////////////
     65#if NH_MV
     66#define NH_MV_FIX_NO_REF_PICS_CHECK               1 // !!SPEC!!
     67#define NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS  1 // Derivation of NumActiveRefLayerPIcs. !!SPEC!!
     68#define NH_MV_FIX_NUM_POC_TOTAL_CUR               1 // Derivation of NumPocTotalCur for IDR pictures. !!SPEC!!
     69#endif
     70#if NH_3D
     71#define H_3D_FIX_ARP_CHECK_NOT_IN_DPB     1
     72#endif
     73/////////////////////////////////////////////////////////////////////////////////////////
    6374///////////////////////////////////   MAJOR DEFINES   /////////////////////////////////// 
    6475/////////////////////////////////////////////////////////////////////////////////////////
    6576#if NH_MV
    66 #define NH_MV_FIX_TICKET_105              1 // layer_set_idx_for_ols_minus1 length
    67 #define NH_MV_FIX_TICKET_100              1 // Extra slice header bits
    6877#define H_MV_ENC_DEC_TRAC                 1  //< CU/PU level tracking
    69 #define H_MV_ENC_DEC_TRAC_FIX             1  // by SHARP
    7078#if NH_3D
    71 // FIXES
    72 #define NH_3D_FIX_TICKET_98               1 // Writing of depth intra skip flag
    73 #define NH_3D_FIX_TICKET_101              ( 1 && NH_3D_VER141_DEC_COMP_FLAG )  // Camera parameters for depth
    74 #define NH_3D_DIS_FIX                     1
    75 #define NH_3D_ENC_DEPTH_FIX               1 // Fix Intra TU coding.
    76 #define NH_3D_INTRA_SDC_RD_FIX            1 // Fix in RD- decision of intra SDC.
    77 #define NH_3D_DLT_FIX                     1 // Fixes numbers of parsed DLTs
    78 #define NH_3D_VER141_DEC_COMP_FLAG        0 // Makes decoding of this version compatible to HTM-14.1 by re-introducing HTM-14.1 bugs.
    79 #define NH_3D_ALIGN_SPIVMP_DBBP           1 // Further alignment of DBBP and SBP motion
    80 #define NH_3D_ALIGN_SPIVMP_RP             1 // Alignment of DBBP and RP
    81 #define NH_3D_FIX_VSP                     1
    82 #define NH_3D_VSO                         1
    83 #define NH_3D_NBDV                        1
    84 #define NH_3D_TMVP                        1   // QC_TMVP_C0047
    85                                               // Sony_M23639
    86                                               // H_3D_TMVP_SCALING_FIX_K0053       1   // QC/CY for K0053
    87 #define NH_3D_IC                          1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
    88                                               // Unifying rounding offset, for IC part, JCT3V-D0135
    89                                               // SHARP_ILLUCOMP_REFINE_E0046
    90                                               // MTK_CLIPPING_ALIGN_IC_E0168       // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168
    91                                               // LGE_IC_CTX_F0160 //JCT3V-F0160
    92                                               // SEC_ONLY_TEXTURE_IC_F0151
    93                                               // MTK_IC_FLAG_CABAC_SIMP_G0061
    94                                               // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121
    95                                               // MTK_LOW_LATENCY_IC_ENCODING_H0086  Low-latency IC encoding in JCT3V-H0086
    96                                               // MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX  1  // Remove the global variables used in JCT3V-H0086
    97                                               // SEC_IC_NEIGHBOR_CLIP_I0080    // Clipping of neighboring sample position, JCT3V-I0080
    98                                               // LGE_CHROMA_IC_J0050_J0034
    99 #define NH_3D_IC_FIX                      1   // Fix uninitialized value in cDtParam.bUseIC (it happened on intra block)
    100 #define NH_3D_FULL_PEL_DEPTH_MAP_MV_ACC   1   // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    101 #define NH_3D_QTLPC                       1   // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068
    102                                               // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units
    103                                               // MTK_TEX_DEP_PAR_G0055 Texture-partition-dependent depth partition. JCT3V-G0055
    104 #define NH_3D_NBDV_REF                    1
    105 #define NH_3D_MLC                         1
    106 #define NH_3D_FIX_PRUNING                 1
    107 #define NH_3D_VSP                         1
    108 #define NH_3D_IV_MERGE                    1
    109 #define NH_3D_SPIVMP                      1
    11079#define NH_3D_INTEGER_MV_DEPTH            1
    111 #define NH_3D_TEXT_MERGE                  1
    112 #define NH_3D_DBBP                         1
    113 #define BUF_FIX 1
    114 #define NH_3D_ARP                         1  // Advanced residual prediction (ARP), JCT3V-D0177
    115                                               // QC_MTK_INTERVIEW_ARP_F0123_F0108 JCT3V-F0123; JCT3V-F0108
    116                                               // SHARP_ARP_REF_CHECK_F0105        ARP reference picture selection and DPB check
    117                                               // LGE_ARP_CTX_F0161                JCT3V-F0161
    118                                               // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061
    119                                               // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053
    120                                               // MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085  Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085
    121                                               // QC_I0051_ARP_SIMP         
    122                                               // SHARP_ARP_CHROMA_I0104     
    123                                               // MTK_I0072_IVARP_SCALING_FIX
    124                                               // SEC_ARP_VIEW_REF_CHECK_J0037    Signaling iv_res_pred_weight_idx when the current slice has both view and temporal reference picture(s), JCT3V-J0037 item1
    125                                               // SEC_ARP_REM_ENC_RESTRICT_K0035    Removal of encoder restriction of ARP, JCT3V-K0035
    126 #define NH_3D_DMM                         1   // Depth modeling modes
    127 #define NH_3D_DLT                         1   // Depth Lookup Table
    128 #define NH_3D_SDC_INTRA                   1   // Segment-wise DC Coding method for INTRA
    129 #define NH_3D_SDC_INTER                   1   // Segment-wise DC Coding method for INTER 
    13080#define NH_3D_ENC_DEPTH                   1   // Encoder optimizations for depth, incl.
    13181                                              // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
     
    13383                                              // HHI_DMM4_ENC_I0066
    13484                                              // H_3D_FAST_DEPTH_INTRA
    135 #define NH_3D_DIS                         1
    13685#define NH_3D_FAST_TEXTURE_ENCODING       1   // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173
    137 #endif
    138 #if H_3D
    139 #define H_3D_QTLPC                        1   // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068
     86#define NH_3D_ARP                         1  // Advanced residual prediction (ARP), JCT3V-D0177
     87                                             // QC_MTK_INTERVIEW_ARP_F0123_F0108 JCT3V-F0123; JCT3V-F0108
     88                                             // SHARP_ARP_REF_CHECK_F0105        ARP reference picture selection and DPB check
     89                                             // LGE_ARP_CTX_F0161                JCT3V-F0161
     90                                             // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061
     91                                             // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053
     92                                             // MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085  Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085
     93                                             // QC_I0051_ARP_SIMP         
     94                                             // SHARP_ARP_CHROMA_I0104     
     95                                             // MTK_I0072_IVARP_SCALING_FIX
     96                                             // SEC_ARP_VIEW_REF_CHECK_J0037    Signaling iv_res_pred_weight_idx when the current slice has both view and temporal reference picture(s), JCT3V-J0037 item1
     97                                             // SEC_ARP_REM_ENC_RESTRICT_K0035    Removal of encoder restriction of ARP, JCT3V-K0035
     98#define NH_3D_QTLPC                        1   // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068
    14099                                              // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units
    141100                                              // MTK_TEX_DEP_PAR_G0055 Texture-partition-dependent depth partition. JCT3V-G0055
    142 #define H_3D_VSO                          1   // VSO, View synthesis optimization, includes:
     101#define NH_3D_VSO                          1   // VSO, View synthesis optimization, includes:
    143102                                              // HHI_VSO
    144103                                              // HHI_VSO_LS_TABLE_M23714 enable table base Lagrange multiplier optimization
     
    146105                                              // LGE_WVSO_A0119
    147106                                              // SCU_HS_VSD_BUGFIX_IMPROV_G0163
    148 #define H_3D_NBDV                         1   // Neighboring block disparity derivation
     107#define NH_3D_NBDV                         1   // Neighboring block disparity derivation
    149108                                              // QC_JCT3V-A0097
    150109                                              // LGE_DVMCP_A0126
     
    162121                                              // MTK_TEXTURE_MRGCAND_BUGFIX_E0182  Bug fix for TEXTURE MERGING CANDIDATE     , JCT3V-E0182
    163122                                              // LGE_SIMP_DISP_AVAIL_J0041    // Use 2 status for disparity availability - DISP_AVAILABLE and DISP_NONE
    164 #define H_3D_IC                           1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
     123#define NH_3D_IC                          1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
    165124                                              // Unifying rounding offset, for IC part, JCT3V-D0135
    166125                                              // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC
     
    176135                                              // LGE_CHROMA_IC_J0050_J0034
    177136#if NH_3D_NBDV
    178 #define H_3D_NBDV_REF                     1   // Depth oriented neighboring block disparity derivation
     137#define NH_3D_NBDV_REF                     1   // Depth oriented neighboring block disparity derivation
    179138                                              // MTK_D0156
    180139                                              // MERL_D0166: Reference view selection in NBDV & Bi-VSP
     
    184143                                              // SEC_VER_DONBDV_H0103          Vertical DV Restriction for DoNBDV
    185144#endif
    186 #define H_3D_VSP                          1   // View synthesis prediction
     145#define NH_3D_VSP                          1   // View synthesis prediction
    187146                                              // MERL_C0152: Basic VSP
    188147                                              // MERL_D0166: Reference view selection in NBDV & Bi-VSP
     
    202161                                              // MTK_MRG_LIST_SIZE_CLEANUP_J0059   1   // Include VSP for deriving merge candidate list size, JCT3V-J0059
    203162                                              // SEC_A1_BASED_VSP_J0039            1   // Removal of redundant VSP in Merge list
    204 #define H_3D_IV_MERGE                     1   // Inter-view motion merge candidate
     163#define NH_3D_MLC                          1
     164#define NH_3D_IV_MERGE                     1  // Inter-view motion merge candidate
    205165                                              // HHI_INTER_VIEW_MOTION_PRED
    206166                                              // SAIT_IMPROV_MOTION_PRED_M24829, improved inter-view motion vector prediction
     
    209169                                              // MTK_INTERVIEW_MERGE_A0049     , second part
    210170                                              // QC_AMVP_MRG_UNIFY_IVCAN_C0051     
    211                                               // TEXTURE MERGING CANDIDATE     , JCT3V-C0137
    212171                                              // QC_INRIA_MTK_MRG_E0126
    213172                                              // ETRIKHU_MERGE_REUSE_F0093 QC_DEPTH_IV_MRG_F0125, JCT3V-F0125: Depth oriented Inter-view MV candidate
    214                                               // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode
    215173                                              // MTK_NBDV_IVREF_FIX_G0067      , Disable IvMC, VSP when IVREF is not available, JCT3V-G0067
    216174                                              // SEC_DEPTH_DV_DERIVAITON_G0074, Simplification of DV derivation for depth, JCT3V-G0074
     
    225183                                              // SEC_SIMP_SHIFTED_DV_I0086     Simplification of Shifted DV candidate, JCT3V-I0086
    226184                                              // SEC_SHIFTED_IVMC_POS_K0036    Position Derivation for Shifted-IVMC, JCT3V-K0036
    227 #define H_3D_TMVP                         1   // QC_TMVP_C0047
     185#define NH_3D_TEXT_MERGE                  1
     186                                              // TEXTURE MERGING CANDIDATE     , JCT3V-C0137
     187                                              // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode
     188#define NH_3D_TMVP                        1   // QC_TMVP_C0047
    228189                                              // Sony_M23639
    229190                                              // H_3D_TMVP_SCALING_FIX_K0053       1   // QC/CY for K0053
    230 #define H_3D_DIM                          1   // DIM, Depth intra modes, includes:
     191#define NH_3D_DMM                         1   // Depth modeling modes
     192                                              // HHI_DMM_PRED_TEX
    231193                                              // HHI_DMM_WEDGE_INTRA
    232                                               // HHI_DMM_PRED_TEX
    233194                                              // FIX_WEDGE_NOFLOAT_D0036
    234195                                              // LGE_EDGE_INTRA_A0070
    235196                                              // LGE_DMM3_SIMP_C0044
    236197                                              // QC_DC_PREDICTOR_D0183
     198                                              // LGE_CONCATENATE_D0141
     199                                              // PKU_QC_DEPTH_INTRA_UNI_D0195
     200                                              // SEC_DMM2_E0146_HHIFIX Removal of DMM2 from DMMs
     201                                              // ZJU_DEPTH_INTRA_MODE_E0204 Simplified Binarization for depth_intra_mode
     202                                              // SCU_HS_DMM4_REMOVE_DIV_E0242 DMM4 Division Removal
     203                                              // LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1   Removal of overlap between DMM3 and DMM1
     204                                              // SEC_DMM3_RBC_F0147 Removal of DMM3 and RBC from DMMs
     205                                              // HHI_DIM_PREDSAMP_FIX_F0171
     206                                              // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes
     207                                              // LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135  Use only one context for CABAC of dim_not_present_flag
     208                                              // QC_SIMP_DELTADC_CODING_H0131   Simplify detaDC entropy coding
     209                                              // MTK_DMM_SIMP_CODE_H0092        Remove CABAC context for DMM1 mode coding
     210                                              // MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113 Use only one context for CABAC of delta_dc_flag as in JCTVC-H0084, JCTVC-H0100 and JCTVC-H0113
     211                                              // HS_DMM_SIGNALLING_I0120
     212                                              // SHARP_DMM1_I0110 LUT size reduction for DMM1 proposed in JCT3V-I0110
     213                                              // MTK_DMM_SIM_J0035
     214                                              // SHARP_DMM_CLEAN_K0042             1   // Generate DMM pattern with rotation
     215#define NH_3D_DLT                         1   // Depth Lookup Table
    237216                                              // HHI_DELTADC_DLT_D0035
    238                                               // PKU_QC_DEPTH_INTRA_UNI_D0195
     217                                              // LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 JCT3V-F0159
     218                                              // SEC_NO_RESI_DLT_H0105   
     219                                              // MTK_DLT_CODING_FIX_H0091
     220                                              // H_3D_DELTA_DLT
     221                                              // RWTH_DLT_CLIP_I0057
     222                                              // SHARP_DLT_SIMP_J0029 DLT(DepthValue2Idx[]) table derivation cleanup 
     223#define NH_3D_SDC_INTRA                   1   // Segment-wise DC Coding method for INTRA
     224#define NH_3D_SDC_INTER                   1   // Segment-wise DC Coding method for INTER 
    239225                                              // RWTH_SDC_DLT_B0036
    240226                                              // INTEL_SDC64_D0193
    241227                                              // RWTH_SDC_CTX_SIMPL_D0032
    242                                               // LGE_CONCATENATE_D0141
    243228                                              // FIX_SDC_ENC_RD_WVSO_D0163
    244229                                              // MTK_SAMPLE_BASED_SDC_D0110
    245                                               // SEC_DMM2_E0146_HHIFIX Removal of DMM2 from DMMs
    246                                               // ZJU_DEPTH_INTRA_MODE_E0204 Simplified Binarization for depth_intra_mode
    247230                                              // KWU_SDC_SIMPLE_DC_E0117 Simplified DC calculation for SDC
    248                                               // SCU_HS_DMM4_REMOVE_DIV_E0242 DMM4 Division Removal
    249231                                              // LGE_SDC_REMOVE_DC_E0158 Removal of DC mode from SDC
    250                                               // LGE_PKU_DMM3_OVERLAP_E0159_HHIFIX 1   Removal of overlap between DMM3 and DMM1
    251                                               // LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 JCT3V-F0159
    252                                               // HHI_DIM_PREDSAMP_FIX_F0171
    253                                               // SEC_DMM3_RBC_F0147 Removal of DMM3 and RBC from DMMs
    254                                               // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes
    255232                                              // Unify intra SDC and inter SDC
    256233                                              // QC_GENERIC_SDC_G0122 Generalize SDC to all depth intra modes
     
    259236                                              // QC_PKU_SDC_SPLIT_G0123 Intra SDC Split
    260237                                              // HS_DMM_SDC_PREDICTOR_UNIFY_H0108  Unification of DMM and SDC predictor derivation
    261                                               // LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135  Use only one context for CABAC of dim_not_present_flag
    262                                               // QC_SIMP_DELTADC_CODING_H0131   Simplify detaDC entropy coding
    263                                               // MTK_DMM_SIMP_CODE_H0092        Remove CABAC context for DMM1 mode coding
    264                                               // MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113 Use only one context for CABAC of delta_dc_flag as in JCTVC-H0084, JCTVC-H0100 and JCTVC-H0113
    265238                                              // MTK_SDC_FLAG_FIX_H0095                          Remove conditional check of PCM flag based on SDC flag, JCTVC-H0095
    266                                               // SEC_NO_RESI_DLT_H0105   
    267                                               // MTK_DLT_CODING_FIX_H0091
    268                                               // HS_DMM_SIGNALLING_I0120
    269                                               // SHARP_DMM1_I0110 LUT size reduction for DMM1 proposed in JCT3V-I0110
    270239                                              // FAST_SDC_OFFSET_DECISION_I0084
    271240                                              // SEPARATE_FLAG_I0085
    272                                               // H_3D_DELTA_DLT
    273                                               // RWTH_DLT_CLIP_I0057
    274                                               // MTK_DMM_SIM_J0035
    275241                                              // MTK_J0033
    276                                               // SHARP_DLT_SIMP_J0029 DLT(DepthValue2Idx[]) table derivation cleanup
    277                                               // SHARP_DMM_CLEAN_K0042             1   // Generate DMM pattern with rotation
    278 #define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
    279242                                              // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding
    280243                                              // SEC_INTER_SDC_G0101 Improved inter SDC with multiple DC candidates
    281 #define H_3D_INTER_SDC_FIX                1
    282 #define H_3D_SPIVMP                       1   // H_3D_SPIVMP JCT3V-F0110: Sub-PU level inter-view motion prediction
     244#define NH_3D_SPIVMP                       1   // H_3D_SPIVMP JCT3V-F0110: Sub-PU level inter-view motion prediction
    283245                                              // SEC_SPIVMP_MCP_SIZE_G0077, Apply SPIVMP only to 2Nx2N partition, JCT3V-G0077
    284246                                              // QC_SPIVMP_MPI_G0119 Sub-PU level MPI merge candidate
    285247                                              // Simplification on Sub-PU level temporal interview motion prediction
    286248                                              // MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
    287 #define H_3D_DBBP                         1   // DBBP: Depth-based Block Partitioning and Merging
     249#define NH_3D_DBBP                         1   // DBBP: Depth-based Block Partitioning and Merging
    288250                                              // MTK_DBBP_AMP_REM_H0072   
    289251                                              // RWTH_DBBP_NO_SPU_H0057   
     
    298260                                              // RWTH_DBBP_NO_SATD_K0028
    299261                                              // HS_DBBP_CLEAN_K0048
    300 #define H_3D_DDD                          1   // Disparity derived depth coding
    301                                               // LGE_DDD_REMOVAL_J0042_J0030 DDD removal
    302 #define H_3D_DIS                          1   // Depth intra skip
     262#define NH_3D_DIS                         1   // Depth intra skip
    303263                                              // SEC_DEPTH_INTRA_SKIP_MODE_K0033  Depth intra skip mode
    304264#define H_3D_FCO                          0   // Flexible coding order for 3D
    305 #define H_3D_FAST_INTRA_SDC               1   // I0123
    306265// OTHERS
    307266                                              // MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 // Progressive MV Compression, JCT3V-E0170
    308 #define H_3D_FAST_TEXTURE_ENCODING        1   // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173
    309267                                              // MTK_FAST_TEXTURE_ENCODING_E0173
    310 #if H_3D_DIM
    311 #define H_3D_FAST_DEPTH_INTRA             1   // Fast DMM Selection
    312                                               // SCU_HS_FAST_DEPTH_INTRA_E0238_HHIFIX
    313 #endif
    314268//HLS
    315269                                             // HHI_DEPENDENCY_SIGNALLING_I1_J0107
     
    321275                                             // H_3D_DIRECT_DEP_TYPE     
    322276// Rate Control
    323 #define KWU_FIX_URQ                       1
     277#define KWU_FIX_URQ                       0
    324278#define KWU_RC_VIEWRC_E0227               0  ///< JCT3V-E0227, view-wise target bitrate allocation
    325279#define KWU_RC_MADPRED_E0227              0  ///< JCT3V-E0227, inter-view MAD prediction
    326 #endif // H_3D
     280#endif // NH_3D
    327281/////////////////////////////////////////////////////////////////////////////////////////
    328282///////////////////////////////////   DERIVED DEFINES /////////////////////////////////// 
     
    349303#if NH_3D_ARP
    350304#define H_3D_ARP_WFNR                     3
    351 #endif
    352 ///// ***** DEPTH INTRA MODES *********
    353 #if H_3D_DIM
    354                                               // HHI_DMM4_ENC_I0066
    355 #define H_3D_DIM_DMM                      1   // Depth Modeling Modes
    356 #define H_3D_DIM_SDC                      1   // Simplified Depth Coding method
    357 #define H_3D_DIM_DLT                      1   // Depth Lookup Table
    358 #define H_3D_DIM_ENC                      1   // Depth Intra encoder optimizations, includes:
    359                                               // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
    360                                               // LG_ZEROINTRADEPTHRESI_A0087
    361305#endif
    362306/////////////////////////////////////////////////////////////////////////////////////
     
    389333// TBD: Check if integration is necessary.
    390334#define H_MV_HLS_PTL_LIMITS                  0
    391 #define H_MV_HLS7_GEN                        0  // General changes (not tested)
    392 // POC
    393 // #define H_MV_HLS_7_POC_P0041_3            0 // (POC/P0041/POC reset) #3 It was remarked that we should require each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture. This was agreed. Decision: Adopt (with constraint for discardable_flag as described above)
    394 // #define H_MV_HLS_7_POC_P0041_FIXES        0 // (POC/P0041/Fixes) For each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture.
    395 // #define H_MV_HLS_7_POC_P0056_4            0 // (POC/P0056/layer tree poc) #4 Proposal 1: If the POC reset approach is adopted as the basis for multi-layer POC derivation, it is proposed to derive the POC anchor picture from the previous TID0 picture (that is not a RASL picture, a RADL picture or a sub-layer non-reference picture and not with discardable_flag equal to 1) of  the current layer or any of its reference layer. This is asserted to improve loss resilience and reduce bit rate overhead. Decision: Adopt Proposal 1 (with the suggested modifications Ewith text provided as P0297).
    396 // SEI related
    397 //#define H_MV_HLS_8_SEI_NODOC_53  0 // #53 (SEI    /NODOC/Added Multiview view position SEI message) Plain copy from AVC.
    398 //#define H_MV_HLS_8_SEI_NODOC_52  0 // #52 (SEI    /NODOC/Added Multiview acquisition information SEI) Plain copy from AVC.
    399 //#define H_MV_HLS_8_SEI_NODOC_51  0 // #51 (SEI    /NODOC/Added Multiview scene information SEI message)
    400 //#define H_MV_HLS_8_SEI_Q0189_35  0 // #35 (SEI    /Q0189/SEI message for indicating constraints on TMVP) Proposal 2.3,  SEI message for indicating constraints on TMVP
    401 //#define H_MV_HLS_8_EDF_Q0116_29  0 // #29 (ED.FIX /Q0116/Recovery point SEI) , consider adding a note regarding how random accessibility is affected by the recovery point SEI message
    402 //#define H_MV_HLS_8_GEN_Q0183_23  0 // #23 (GEN    /Q0183/SEI clean-ups) numerous small clean-ups on SEI messages.
    403 //#define H_MV_HLS_8_MIS_Q0247_49  0 // #49 (MISC   /Q0247/frame-field information SEI message)
    404 //#define H_MV_HLS_8_MIS_Q0189_34  0 // #34 (MISC   /Q0189/slice temporal mvp enabled flag) Proposal 2.2, clarification of semantics of slice temporal mvp enabled flag
    405 //#define H_MV_HLS_8_EDF_Q0081_01  0 // #1  (ED.FIX /Q0081/alpha channel persist) On reuse of alpha planes in auxiliary pictures. It was asked why there would not be a presumption that the alpha channel content would simply persist, without needing the flag to indicate it. Decision (Ed.): Delegated to editors to clarify, as necessary, that the alpha channel content persists until cancelled or updated in output order.
    406 //#define H_MV_HLS_8_SEI_Q0253_37  0 // #37 (SEI    /Q0253/layer not present), modified semantics of layers not present SEI message to correct bug introduced during editing
    407 //#define H_MV_HLS_8_SEI_Q0045_11  0 // #11 (SEI    /Q0045/Overlay) Proposal for an SEI message on selectable overlays. Decision: Adopt (modified for variable-length strings).
    408 //#define H_MV_HLS_7_SEI_P0133_28  0 // (SEI/P0133/Recovery point SEI) #28 Decision: Adopt change to recover point semantics only (-v3)
    409 //#define H_MV_HLS_7_SEI_P0123_25  0 // (SEI/P0123/Alpha channel info) #25 Add alpha channel information SEI message Decision: Adopt. Constrain the bit depth indicated to be equal to the coded bit depth of the aux picture.
    410 // DPB
    411 //#define H_MV_HLS_8_HRD_Q0102_09  0 // #9  (HRD    /Q0102/NoOutputOfPriorPicsFlag) It was suggested that also the separate_colour_plane_flag should affect inference of NoOutputOfPriorPicsFlag. Decision (Ed.): Agreed (affects RExt text).
    412 //#define H_MV_HLS_8_DBP_Q0154_38  0 // #38 (DBP    /Q0154/VPS DPB) Proposal in C.5.2.1: Add in the decoding process that when a new VPS is activated, all pictures in the DPB are marked as unused for reference
    413 //#define H_MV_HLS_8_HRD_Q0154_10  0 // #10 (HRD    /Q0154/DPB Flushing and parameters) On picture flushing and DPB parameters Decision: Adopted (some details to be discussed further in BoG).
    414 //#define H_MV_HLS_7_OTHER_P0187_1 0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
    415 // OTHERS
    416 //#define H_MV_HLS_8_HSB_Q0041_03  0 // #3  (HS     /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows ?// #define H_MV_HLS_7_OTHER_P0187_1          0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
    417 //#define H_MV_HLS_8_MIS_Q0078_24  0 // #24 (MISC   /Q0078/scan and pic type) , Items 3 b,c and 4, clarifying which pictures in an output layer sets are applied the values of general_progressive_source_flag, general_interlaced_source_flag, general_non_packed_constraint_flag and general_frame_only_constraint_flag.
    418 //#define H_MV_HLS_7_HRD_P0138_6   0 //     (HRD/P0138/HRD parameters for bitstreams excluding) #6 Decision: Adopt (as revised in updated contribution, with the specification of a flag in the BP SEI (HRD/P0192/sub-DPB) #12 Establish sub-DPBs based on the representation format indicated at the VPS level. It was suggested that the expressed shared capacity limit would need to be less than or equal to the sum of the individual capacity limits. Decision: Adopt as modified. Further study is encouraged on profile/level constraint selections.
    419335/////////////////////////////////////////////////////////////////////////////////////////
    420336///////////////////////////////////   HM RELATED DEFINES ////////////////////////////////
     
    871787#define NUM_SAO_BO_CLASSES_LOG2  5
    872788#define NUM_SAO_BO_CLASSES       (1<<NUM_SAO_BO_CLASSES_LOG2)
     789#if NH_MV
     790enum DecodingProcess
     791{
     792  INVALID,
     793  CLAUSE_8,
     794  ANNEX_C,
     795  ANNEX_F,
     796  ANNEX_G,
     797  ANNEX_H,
     798  ANNEX_I 
     799};
     800#endif
    873801namespace Profile
    874802{
     
    1017945  AUX_ID = 3,
    1018946};
     947enum DecProcPart
     948{
     949  START_PIC,
     950  FINALIZE_PIC
     951};
    1019952#endif
    1020953#if NH_3D
Note: See TracChangeset for help on using the changeset viewer.