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


Ignore:
Timestamp:
17 Aug 2013, 06:27:19 (11 years ago)
Author:
seregin
Message:

merge SHM-3.0-dev branch

Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

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

    r313 r345  
    5757
    5858#if SVC_EXTENSION
    59 #define NV_VERSION        "trunk"                 ///< Current software version
     59#define NV_VERSION        "3.0"                 ///< Current software version
    6060#else
    6161#define NV_VERSION        "11.0"                ///< Current software version
  • trunk/source/Lib/TLibCommon/ContextTables.h

    r313 r345  
    9292#define NUM_SAO_MERGE_FLAG_CTX        1       ///< number of context models for SAO merge flags
    9393#define NUM_SAO_TYPE_IDX_CTX          1       ///< number of context models for SAO type index
    94 #if INTRA_BL
    95 #define NUM_INTRA_BL_PRED_CTX         3
    96 #endif
    9794
    9895#define NUM_TRANSFORMSKIP_FLAG_CTX    1       ///< number of context models for transform skipping
     
    330327};
    331328
    332 #if INTRA_BL
    333 static const UChar
    334 INIT_INTRA_BL_PRED_FLAG[3][NUM_INTRA_BL_PRED_CTX] =
    335 {
    336   { 185,  185,  201, },
    337   { 197,  197,  185, },
    338   { 197,  197,  185, },
    339 };
    340 #endif
    341329static const UChar
    342330INIT_TRANSFORMSKIP_FLAG[3][2*NUM_TRANSFORMSKIP_FLAG_CTX] =
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r313 r345  
    16431643  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    16441644 
    1645 #if INTRA_BL
    1646   iLeftIntraDir  = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) && ( !pcTempCU->isIntraBL( uiTempPartIdx ) ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : DC_IDX ) : DC_IDX;
    1647 #else
    16481645  iLeftIntraDir  = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : DC_IDX ) : DC_IDX;
    1649 #endif
    16501646 
    16511647  // Get intra direction of above PU
    16521648  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, true );
    16531649 
    1654 #if INTRA_BL
    1655   iAboveIntraDir = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) && ( !pcTempCU->isIntraBL( uiTempPartIdx ) ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : DC_IDX ) : DC_IDX;
    1656 #else
    16571650  iAboveIntraDir = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : DC_IDX ) : DC_IDX;
    1658 #endif
    1659  
    1660 #if SVC_BL_CAND_INTRA
    1661   if(m_layerId > 0)
    1662   {
    1663     UInt uiCUAddrBase, uiAbsPartAddrBase;
    1664     pcTempCU = getBaseColCU( uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase );
    1665 
    1666     if(pcTempCU->getPredictionMode( uiAbsPartAddrBase ) == MODE_INTRA )
    1667     {
    1668       Int iColBaseDir = pcTempCU->getLumaIntraDir( uiAbsPartAddrBase );
    1669       if( iColBaseDir != iAboveIntraDir && iColBaseDir != iLeftIntraDir && iAboveIntraDir != iLeftIntraDir)
    1670       {
    1671         uiIntraDirPred[0] = iColBaseDir;
    1672         uiIntraDirPred[1] = iLeftIntraDir;
    1673         uiIntraDirPred[2] = iAboveIntraDir;
    1674         if( piMode )
    1675         {
    1676           *piMode = 2;
    1677         }
    1678         uiPredNum = 3;
    1679         return uiPredNum;
    1680       }
    1681       else
    1682       {
    1683         iAboveIntraDir = (iColBaseDir == iLeftIntraDir) ? iAboveIntraDir : iLeftIntraDir;
    1684         iLeftIntraDir  = iColBaseDir;
    1685       }
    1686     }
    1687   }
    1688 #endif
    16891651 
    16901652  uiPredNum = 3;
     
    18281790  UInt log2CbSize = g_aucConvertToBit[getWidth( absPartIdx )] + 2;
    18291791  PartSize  partSize  = getPartitionSize( absPartIdx );
    1830 #if INTRA_BL
    1831   UInt quadtreeTUMaxDepth = isIntra( absPartIdx ) ? m_pcSlice->getSPS()->getQuadtreeTUMaxDepthIntra() : m_pcSlice->getSPS()->getQuadtreeTUMaxDepthInter();
    1832 #else
    18331792  UInt quadtreeTUMaxDepth = getPredictionMode( absPartIdx ) == MODE_INTRA ? m_pcSlice->getSPS()->getQuadtreeTUMaxDepthIntra() : m_pcSlice->getSPS()->getQuadtreeTUMaxDepthInter();
    1834 #endif
    18351793  Int intraSplitFlag = ( getPredictionMode( absPartIdx ) == MODE_INTRA && partSize == SIZE_NxN ) ? 1 : 0;
    18361794  Int interSplitFlag = ((quadtreeTUMaxDepth == 1) && (getPredictionMode( absPartIdx ) == MODE_INTER) && (partSize != SIZE_2Nx2N) );
     
    18541812  return log2MinTUSizeInCU;
    18551813}
    1856 
    1857 #if INTRA_BL
    1858 UInt TComDataCU::getCtxIntraBLFlag( UInt uiAbsPartIdx )
    1859 {
    1860 #if INTRA_BL_CTX_CHANGE
    1861   Int cuDepth = getDepth(uiAbsPartIdx);
    1862   Int maxCuDepth = g_uiMaxCUDepth - g_uiAddCUDepth;
    1863   UInt uiCtx = (maxCuDepth==3 && cuDepth > 0) ? (cuDepth - 1) : cuDepth;
    1864   return uiCtx;
    1865 #else
    1866   TComDataCU* pcTempCU;
    1867   UInt        uiTempPartIdx;
    1868   UInt        uiCtx = 0;
    1869  
    1870   // Get BCBP of left PU
    1871 #if DEPENDENT_SLICES
    1872   Bool bDepSliceRestriction = ( !m_pcSlice->getPPS()->getDependentSliceEnabledFlag());
    1873   pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, bDepSliceRestriction );
    1874 #else
    1875   pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    1876 #endif 
    1877   uiCtx    = ( pcTempCU ) ? pcTempCU->isIntraBL( uiTempPartIdx ) : 0;
    1878  
    1879   // Get BCBP of above PU
    1880 #if DEPENDENT_SLICES
    1881   pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, bDepSliceRestriction );
    1882 #else
    1883   pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    1884 #endif 
    1885   uiCtx   += ( pcTempCU ) ? pcTempCU->isIntraBL( uiTempPartIdx ) : 0;
    1886  
    1887   return uiCtx;
    1888 #endif
    1889 }
    1890 #endif
    18911814
    18921815#if REF_IDX_ME_ZEROMV
     
    25862509  deriveLeftRightTopIdxGeneral( uiAbsPartIdx, uiPUIdx, uiPartIdxLT, uiPartIdxRT );
    25872510  deriveLeftBottomIdxGeneral  ( uiAbsPartIdx, uiPUIdx, uiPartIdxLB );
    2588 #if SVC_MVP
    2589   // BL collocated
    2590   TComDataCU *pcColCU = NULL;
    2591   UInt uiCUAddrBase = 0, uiAbsPartAddrBase = 0;
    2592 #if AVC_BASE
    2593   if( !this->getSlice()->getVPS()->getAvcBaseLayerFlag() || AVC_SYNTAX )
    2594 #endif
    2595   {
    2596     TComMvField cMvFieldBaseColCU[2];
    2597     if(m_layerId) 
    2598     {
    2599       pcColCU = getBaseColCU( m_layerId - 1, xP + nPSW/2, yP + nPSH/2, uiCUAddrBase, uiAbsPartAddrBase );
    2600 
    2601 #if INTRA_BL
    2602       if( pcColCU && pcColCU->isIntraBL( uiAbsPartAddrBase ) )
    2603       {
    2604         pcColCU = NULL;
    2605       }
    2606 #endif
    2607 
    2608       if(pcColCU && !pcColCU->isIntra( uiAbsPartAddrBase ) )
    2609       {
    2610         abCandIsInter[iCount] = true;
    2611 
    2612         // get interDir
    2613         puhInterDirNeighbours[iCount] = pcColCU->getInterDir( uiAbsPartAddrBase );
    2614 
    2615         pcMvFieldNeighbours[(iCount << 1)].setMvField( TComMv(0,0), -1);
    2616         pcMvFieldNeighbours[(iCount << 1) + 1].setMvField( TComMv(0,0), -1);
    2617 
    2618         if( puhInterDirNeighbours[iCount] & 1 )
    2619         {
    2620           pcColCU->getMvField( pcColCU, uiAbsPartAddrBase, REF_PIC_LIST_0, cMvFieldBaseColCU[0]);
    2621           scaleBaseMV( m_layerId - 1, pcMvFieldNeighbours[iCount<<1], cMvFieldBaseColCU[0] );
    2622         }
    2623 
    2624         if ( getSlice()->isInterB() && puhInterDirNeighbours[iCount] & 2 )
    2625         {
    2626           pcColCU->getMvField( pcColCU, uiAbsPartAddrBase, REF_PIC_LIST_1, cMvFieldBaseColCU[1] );
    2627           scaleBaseMV( m_layerId - 1, pcMvFieldNeighbours[(iCount<<1)+1], cMvFieldBaseColCU[1] );
    2628         }
    2629 
    2630         if( puhInterDirNeighbours[iCount] > 0 )
    2631         {
    2632           if ( mrgCandIdx == iCount )
    2633           {
    2634             return;
    2635           }
    2636           iCount ++;
    2637         }
    2638       }
    2639     }
    2640   }
    2641 #endif
    26422511
    26432512  //left
     
    26452514  TComDataCU* pcCULeft = 0;
    26462515  pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB );
    2647 #if INTRA_BL
    2648   if( pcCULeft && pcCULeft->isIntraBL( uiLeftPartIdx ) )
    2649   {
    2650     pcCULeft = NULL;
    2651   }
    2652 #endif
     2516
    26532517  Bool isAvailableA1 = pcCULeft &&
    26542518  pcCULeft->isDiffMER(xP -1, yP+nPSH-1, xP, yP) &&
    2655 #if SVC_MVP
    2656   ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0])) &&
    2657 #endif
    26582519  !( uiPUIdx == 1 && (cCurPS == SIZE_Nx2N || cCurPS == SIZE_nLx2N || cCurPS == SIZE_nRx2N) ) &&
    26592520  !pcCULeft->isIntra( uiLeftPartIdx ) ;
     
    26852546  TComDataCU* pcCUAbove = 0;
    26862547  pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT );
    2687 #if INTRA_BL
    2688   if( pcCUAbove && pcCUAbove->isIntraBL( uiAbovePartIdx ) )
    2689   {
    2690     pcCUAbove = NULL;
    2691   }
    2692 #endif
     2548
    26932549  Bool isAvailableB1 = pcCUAbove &&
    2694 #if SVC_MVP
    2695   ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0] )) &&
    2696 #endif
    26972550  pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP) &&
    26982551  !( uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD) ) &&
     
    27252578  TComDataCU* pcCUAboveRight = 0;
    27262579  pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT );
    2727 #if INTRA_BL
    2728   if( pcCUAboveRight && pcCUAboveRight->isIntraBL( uiAboveRightPartIdx ) )
    2729   {
    2730     pcCUAboveRight = NULL;
    2731   }
    2732 #endif
     2580
    27332581  Bool isAvailableB0 = pcCUAboveRight &&
    2734 #if SVC_MVP && !IL_MRG_SIMPLIFIED_PRUNING
    2735   ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCUAboveRight->hasEqualMotion( uiAboveRightPartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0] )) &&
    2736 #endif
    27372582  pcCUAboveRight->isDiffMER(xP+nPSW, yP-1, xP, yP) &&
    27382583  !pcCUAboveRight->isIntra( uiAboveRightPartIdx );
     
    27612606
    27622607  //left bottom
    2763 #if SVC_MVP
    2764   if( iCount < 4 )
    2765   {
    2766 #endif
    27672608  UInt uiLeftBottomPartIdx = 0;
    27682609  TComDataCU* pcCULeftBottom = 0;
    27692610  pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB );
    2770 #if INTRA_BL
    2771   if( pcCULeftBottom && pcCULeftBottom->isIntraBL( uiLeftBottomPartIdx ) )
    2772   {
    2773     pcCULeftBottom = NULL;
    2774   }
    2775 #endif
     2611
    27762612  Bool isAvailableA0 = pcCULeftBottom &&
    27772613  pcCULeftBottom->isDiffMER(xP-1, yP+nPSH, xP, yP) &&
    2778 #if SVC_MVP && !IL_MRG_SIMPLIFIED_PRUNING
    2779   ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCULeftBottom->hasEqualMotion( uiLeftBottomPartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0])) &&
    2780 #endif
    27812614  !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) ;
    27822615  if ( isAvailableA0 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) )
     
    28022635    return;
    28032636  }
    2804 #if SVC_MVP
    2805   }
    2806 #endif
    28072637
    28082638  // above left
     
    28122642    TComDataCU* pcCUAboveLeft = 0;
    28132643    pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr );
    2814 #if INTRA_BL
    2815     if( pcCUAboveLeft && pcCUAboveLeft->isIntraBL( uiAboveLeftPartIdx ) )
    2816     {
    2817       pcCUAboveLeft = NULL;
    2818     }
    2819 #endif
     2644
    28202645    Bool isAvailableB2 = pcCUAboveLeft &&
    28212646    pcCUAboveLeft->isDiffMER(xP-1, yP-1, xP, yP) &&
    2822 #if SVC_MVP && !IL_MRG_SIMPLIFIED_PRUNING
    2823     ( !pcColCU || pcColCU->isIntra( uiAbsPartAddrBase ) || !pcCUAboveLeft->hasEqualMotion( uiAboveLeftPartIdx, puhInterDirNeighbours[0], &pcMvFieldNeighbours[0] )) &&
    2824 #endif
    28252647    !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx );
    28262648    if ( isAvailableB2 && ( !isAvailableA1 || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) )
     
    31232945  UInt idx;
    31242946  tmpCU = getPUBelowLeft(idx, uiPartIdxLB);
    3125 #if INTRA_BL
    3126   bAddedSmvp = (tmpCU != NULL) && (!tmpCU->isIntra(idx));
    3127 #else
    31282947  bAddedSmvp = (tmpCU != NULL) && (tmpCU->getPredictionMode(idx) != MODE_INTRA);
    3129 #endif
    31302948
    31312949  if (!bAddedSmvp)
    31322950  {
    31332951    tmpCU = getPULeft(idx, uiPartIdxLB);
    3134 #if INTRA_BL
    3135     bAddedSmvp = (tmpCU != NULL) && (!tmpCU->isIntra(idx));
    3136 #else
    31372952    bAddedSmvp = (tmpCU != NULL) && (tmpCU->getPredictionMode(idx) != MODE_INTRA);
    3138 #endif
    31392953  }
    31402954
     
    35623376
    35633377  // use coldir.
    3564 #if M0457_COL_PICTURE_SIGNALING
     3378#if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    35653379  TComPic *pColPic;
    35663380  if (m_layerId > 0 && getSlice()->getAltColIndicationFlag())
     
    36993513  if (scaleFactor > 0)
    37003514  {
    3701 #if SVC_MVP
    3702     m_acCUMvField[0].compress(m_pePredMode, m_puhInterDir, scaleFactor);
    3703     m_acCUMvField[1].compress(m_pePredMode, m_puhInterDir, scaleFactor);   
    3704 #else
    37053515    m_acCUMvField[0].compress(m_pePredMode, scaleFactor);
    37063516    m_acCUMvField[1].compress(m_pePredMode, scaleFactor);   
    3707 #endif
    37083517  }
    37093518}
     
    41373946}
    41383947
    4139 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED
    4140 Void TComDataCU::getBaseLumaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride )
    4141 {
    4142   TComPicYuv* pcBaseRec = getSlice()->getFullPelBaseRec();
    4143   UInt uiStrideBase = pcBaseRec->getStride();
    4144   Pel* piBase = pcBaseRec->getLumaAddr( getAddr(), getZorderIdxInCU() + uiAbsPartIdx );
    4145  
    4146   for ( UInt y = 0; y < uiHeight; y ++ )
    4147   {
    4148     memcpy( piPred + y * uiStride, piBase + y * uiStrideBase, uiWidth * sizeof( Pel ) );
    4149   }
    4150 }
    4151 
    4152 Void TComDataCU::getBaseChromaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, UInt uiChromaId )
    4153 {
    4154   TComPicYuv* pcBaseRec = getSlice()->getFullPelBaseRec();
    4155 
    4156   UInt uiStrideBase = pcBaseRec->getCStride();
    4157   Pel* piBase;
    4158  
    4159   if( uiChromaId == 0 )
    4160   {
    4161     piBase = pcBaseRec->getCbAddr( getAddr(), getZorderIdxInCU() + uiAbsPartIdx );
    4162   }
    4163   else
    4164   {
    4165     piBase = pcBaseRec->getCrAddr( getAddr(), getZorderIdxInCU() + uiAbsPartIdx );
    4166   }
    4167  
    4168   for ( UInt y = 0; y < uiHeight; y ++ )
    4169   {
    4170     memcpy( piPred + y * uiStride, piBase + y * uiStrideBase, uiWidth * sizeof( Pel ) );
    4171   }
    4172 }
    4173 
    4174 #endif
    4175 
    41763948#if SVC_COL_BLK
    41773949TComDataCU*  TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )
     
    42734045#endif
    42744046
     4047#if N0139_POSITION_ROUNDING_OFFSET
     4048  iBX += 4;
     4049  iBY += 4;
     4050#endif
     4051
    42754052#if SCALED_REF_LAYER_OFFSETS
    42764053  if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight() ||
     
    43344111}
    43354112#endif
    4336 
    4337 #if SVC_MVP
    4338 Bool TComDataCU::hasEqualMotion( UInt uiAbsPartIdx, UChar uchInterDir, TComMvField* pcMvField  )
    4339 {
    4340   if ( getInterDir( uiAbsPartIdx ) != uchInterDir )
    4341   {
    4342     return false;
    4343   }
    4344 
    4345   for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
    4346   {
    4347     if ( getInterDir( uiAbsPartIdx ) & ( 1 << uiRefListIdx ) )
    4348     {
    4349       if ( getCUMvField( RefPicList( uiRefListIdx ) )->getMv( uiAbsPartIdx )  != pcMvField[uiRefListIdx].getMv() ||
    4350         getCUMvField( RefPicList( uiRefListIdx ) )->getRefIdx( uiAbsPartIdx ) != pcMvField[uiRefListIdx].getRefIdx() )
    4351       {
    4352         return false;
    4353       }
    4354     }
    4355   }
    4356 
    4357   return true;
    4358 }
    4359 #endif
    4360 
    43614113//! \}
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r313 r345  
    485485  Void          deriveLeftBottomIdxGeneral    ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB );
    486486 
    487 #if SVC_MVP
    488   Bool          hasEqualMotion              ( UInt uiAbsPartIdx, UChar uchInterDir, TComMvField* pcMvField  );
    489 #endif
    490  
    491487  // -------------------------------------------------------------------------------------------------------------------
    492488  // member functions for modes
    493489  // -------------------------------------------------------------------------------------------------------------------
    494490 
    495 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED
    496   Void          getBaseLumaBlk   ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride );
    497   Void          getBaseChromaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, UInt uiChromaId );
    498 #endif
    499 #if INTRA_BL
    500   Bool          isIntraBL ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_INTRA_BL; }
    501   Bool          isIntra   ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_INTRA || m_pePredMode[ uiPartIdx ] == MODE_INTRA_BL; }
    502 #else
    503491  Bool          isIntra   ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; }
    504 #endif
    505492  Bool          isSkipped ( UInt uiPartIdx );                                                     ///< SKIP (no residual)
    506493  Bool          isBipredRestriction( UInt puIdx );
     
    529516  UInt&         getTotalBins            ()                            { return m_uiTotalBins;                                                                                                  }
    530517
    531 #if INTRA_BL
    532   UInt          getCtxIntraBLFlag               ( UInt   uiAbsPartIdx                                 );
    533 #endif 
    534 
     518#if REF_IDX_FRAMEWORK
    535519#if FAST_INTRA_SHVC
    536520  Int           reduceSetOfIntraModes              (  UInt   uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes );
     
    540524  Bool xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1);
    541525  Bool xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx);
     526#endif
    542527#endif
    543528
     
    553538  UInt          getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra);
    554539
     540#if REF_IDX_FRAMEWORK
    555541#if SVC_COL_BLK
    556542  TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );
    557543  TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );
    558544  Void          scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase );
     545#endif
    559546#endif
    560547};
  • trunk/source/Lib/TLibCommon/TComMotionInfo.cpp

    r313 r345  
    328328 * \param scale      Factor by which to subsample motion information
    329329 */
    330 #if SVC_MVP
    331 Void TComCUMvField::compress(Char* pePredMode, UChar* peInterDir, Int scale)
    332 #else
    333330Void TComCUMvField::compress(Char* pePredMode, Int scale)
    334 #endif
    335331{
    336332  Int N = scale * scale;
     
    351347      pePredMode[ uiPartIdx + i ] = predMode;
    352348      m_piRefIdx[ uiPartIdx + i ] = iRefIdx;
    353 #if SVC_MVP
    354       peInterDir[ uiPartIdx + i ] = peInterDir[ uiPartIdx ];
    355 #endif
    356349    }
    357350  }
  • trunk/source/Lib/TLibCommon/TComMotionInfo.h

    r313 r345  
    158158  }
    159159 
    160 #if SVC_MVP
    161   Void compress(Char* pePredMode, UChar* peInterDir, Int scale);
    162 #else
    163160  Void compress(Char* pePredMode, Int scale);
    164 #endif
    165161
    166162#if REF_IDX_MFM
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r313 r345  
    408408}
    409409
    410 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED
    411 Void TComPrediction::getBaseBlk( TComDataCU* pcCU, TComYuv* pcYuvPred, Int iPartAddr, Int iWidth, Int iHeight )
    412 {
    413   pcCU->getBaseLumaBlk( iWidth, iHeight, iPartAddr, pcYuvPred->getLumaAddr( iPartAddr ), pcYuvPred->getStride() );
    414   pcCU->getBaseChromaBlk( iWidth >> 1, iHeight >> 1, iPartAddr, pcYuvPred->getCbAddr( iPartAddr ), pcYuvPred->getCStride(), 0 );
    415   pcCU->getBaseChromaBlk( iWidth >> 1, iHeight >> 1, iPartAddr, pcYuvPred->getCrAddr( iPartAddr ), pcYuvPred->getCStride(), 1 );
    416 }
    417 #endif
    418 
    419410Void TComPrediction::motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx )
    420411{
  • trunk/source/Lib/TLibCommon/TComPrediction.h

    r313 r345  
    101101 
    102102  Void    initTempBuff();
    103  
    104 #if INTRA_BL
    105   Void getBaseBlk ( TComDataCU* pcCU, TComYuv* pcYuvPred, Int iPartAddr, Int iWidth, Int iHeight );
    106 #endif
     103
    107104  // inter
    108105  Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 );
     
    121118  Int  getPredicBufHeight()       { return m_iYuvExtHeight; }
    122119
     120#if REF_IDX_FRAMEWORK
    123121#if SVC_UPSAMPLING
    124122#if SCALED_REF_LAYER_OFFSETS
     
    128126#endif
    129127#endif
     128#endif
    130129};
    131130
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r313 r345  
    124124  m_numILRRefIdx = 0;
    125125#endif
    126 #if M0457_COL_PICTURE_SIGNALING
     126#if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING
    127127  m_altColIndicationFlag = false;
    128128  m_colRefLayerIdx       = 0;
     
    385385
    386386#if REF_IDX_FRAMEWORK
    387 #if ZERO_NUM_DIRECT_LAYERS
    388387  if( m_layerId == 0 || ( m_layerId > 0 && ( m_activeNumILRRefIdx == 0 || !((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) ) ) )
    389 #else
    390   if ((getLayerId() == 0) ||
    391       ((getSPS()->getLayerId()) &&  !((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&
    392        (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)) )
    393      )
    394 #endif
    395388  {
    396389#endif
     
    458451#if ILR_RESTR
    459452    Int maxSubLayerForILPPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()) : 0;
    460 #if ZERO_NUM_DIRECT_LAYERS
    461453    if( m_layerId > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=  maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )  )
    462 #else
    463     if( m_layerId > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )  )
    464 #endif
    465454#else //#if ILR_RESTR
    466 #if ZERO_NUM_DIRECT_LAYERS
    467455    if( m_layerId > 0 && m_activeNumILRRefIdx > 0 )
    468 #else
    469     if( m_layerId > 0 )
    470 #endif
    471456#endif //#if ILR_RESTR
    472457    {
     
    599584      rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
    600585    }
    601     for ( i=0; i<NumPocStCurr1; i++, cIdx++)
    602     {
    603       rpsCurrList0[cIdx] = RefPicSetStCurr1[i];
    604     }
    605     for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
    606     {
    607       rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
    608     }   
    609 
     586#if RPL_INIT_N0316_N0082
    610587#if REF_IDX_FRAMEWORK
    611588    if( m_layerId > 0 )
     
    619596        Int refLayerIdc = m_interLayerPredLayerIdc[i];
    620597#if ILR_RESTR
     598        Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());
     599        if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
     600#endif
     601          rpsCurrList0[cIdx] = ilpPic[refLayerIdc];
     602      }
     603    }
     604#endif
     605#endif
     606    for ( i=0; i<NumPocStCurr1; i++, cIdx++)
     607    {
     608      rpsCurrList0[cIdx] = RefPicSetStCurr1[i];
     609    }
     610    for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
     611    {
     612      rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
     613    }   
     614#if !RPL_INIT_N0316_N0082
     615#if REF_IDX_FRAMEWORK
     616    if( m_layerId > 0 )
     617    {
     618#if JCTVC_M0458_INTERLAYER_RPS_SIG
     619      for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++)     
     620#else
     621      for( i = 0; i < m_numILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++)
     622#endif
     623      {
     624        Int refLayerIdc = m_interLayerPredLayerIdc[i];
     625#if ILR_RESTR
    621626         Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());
    622627        if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
     
    625630      }
    626631    }
     632#endif
    627633#endif
    628634  assert(cIdx == numPocTotalCurr);
     
    707713  TComRefPicListModification* refPicListModification = &m_RefPicListModification;
    708714  Int numberOfRpsCurrTempList = this->getNumRpsCurrTempList();  // total number of ref pics in listTemp0 including inter-layer ref pics
     715#if RPL_INIT_N0316_N0082
     716  Int numberOfPocBeforeCurr = this->getNumNegativeRpsCurrTempList();  // number of negative temporal ref pics
     717#endif
    709718
    710719  assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 1);
     
    712721
    713722  //set L0 inter-layer reference picture modification
     723#if RPL_INIT_N0316_N0082
     724  Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true;
     725#else
    714726  Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == numberOfRpsCurrTempList) ? false : true;
     727#endif
     728#if FINAL_RPL_CHANGE_N0082
     729  hasModification = false; //modification is not necessary
     730#endif
    715731  refPicListModification->setRefPicListModificationFlagL0(hasModification);
    716732  if(hasModification)
     
    736752#endif
    737753      {
     754#if RPL_INIT_N0316_N0082
     755        if((numberOfPocBeforeCurr) >= m_aiNumRefIdx[REF_PIC_LIST_0])
     756          refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr);
     757        else
     758        {
     759          refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr);
     760          for (Int j = numberOfPocBeforeCurr; j < (m_aiNumRefIdx[REF_PIC_LIST_0] - i); j++)
     761            refPicListModification->setRefPicSetIdxL0(j, j + m_activeNumILRRefIdx);
     762        }
     763#else
    738764        refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfRpsCurrTempList - i);
     765#endif
    739766      }
    740767    }
     
    773800}
    774801#endif
    775 
     802#if RPL_INIT_N0316_N0082
     803Int TComSlice::getNumNegativeRpsCurrTempList()
     804{
     805  if( m_eSliceType == I_SLICE )
     806  {
     807    return 0;
     808  }
     809
     810  Int numPocBeforeCurr = 0;
     811  for( UInt i = 0; i < m_pcRPS->getNumberOfNegativePictures(); i++ )
     812  {
     813    if(m_pcRPS->getUsed(i))
     814    {
     815      numPocBeforeCurr++;
     816    }
     817  }
     818
     819  return numPocBeforeCurr;
     820}
     821#endif
    776822Int TComSlice::getNumRpsCurrTempList()
    777823{
     
    16161662#endif
    16171663#if JCTVC_M0203_INTERLAYER_PRED_IDC
     1664#if N0120_MAX_TID_REF_PRESENT_FLAG
     1665  m_maxTidIlRefPicsPlus1PresentFlag = true;
     1666#endif
    16181667  for( Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++)
    16191668  {
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r313 r345  
    456456  UInt       m_layerIdInVps[MAX_VPS_LAYER_ID_PLUS1];            // Maps layer_id_in_nuh with the layer ID in the VPS
    457457#endif
     458#if ILP_SSH_SIG
     459  Bool       m_ilpSshSignalingEnabledFlag;
     460#endif
    458461#if VPS_EXTN_PROFILE_INFO
    459462  // Profile-tier-level signalling related
     
    491494  UInt       m_maxSublayerForIlpPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1];
    492495#endif
     496#if N0120_MAX_TID_REF_PRESENT_FLAG
     497  Bool       m_maxTidIlRefPicsPlus1PresentFlag;
     498#endif
    493499#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    494500  Bool       m_singleLayerForNonIrapFlag;
     
    588594  UInt   getLayerIdInVps(Int id)                                { return m_layerIdInVps[id];       }
    589595  Void   setLayerIdInVps(Int id, UInt x)                        { m_layerIdInVps[id] = x;          }
     596#endif
     597#if ILP_SSH_SIG
     598    Bool   getIlpSshSignalingEnabledFlag()                      { return m_ilpSshSignalingEnabledFlag;}
     599    Void   setIlpSshSignalingEnabledFlag(Bool x)                { m_ilpSshSignalingEnabledFlag = x;}
    590600#endif
    591601#if VPS_EXTN_PROFILE_INFO
     
    653663  Void   setMaxSublayerForIlpPlus1(Int layerId, UInt maxSublayer)   { m_maxSublayerForIlpPlus1[layerId] = maxSublayer;            }
    654664#endif
     665#if N0120_MAX_TID_REF_PRESENT_FLAG
     666  Bool   getMaxTidIlRefPicsPlus1PresentFlag()                   { return m_maxTidIlRefPicsPlus1PresentFlag ;}
     667  Void   setMaxTidIlRefPicsPlus1PresentFlag(Bool x)             { m_maxTidIlRefPicsPlus1PresentFlag = x;}
     668#endif
    655669#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    656670  Bool   getSingleLayerForNonIrapFlag()                             { return m_singleLayerForNonIrapFlag; }
     
    15601574  Bool      getMvdL1ZeroFlag ()                                  { return m_bLMvdL1Zero;    }
    15611575  Int       getNumRpsCurrTempList();
     1576#if RPL_INIT_N0316_N0082
     1577  Int       getNumNegativeRpsCurrTempList();
     1578#endif
    15621579  Int       getList1IdxToList0Idx ( Int list1Idx )               { return m_list1IdxToList0Idx[list1Idx]; }
    15631580  Void      setReferenced(Bool b)                               { m_bRefenced = b; }
     
    17781795  Void      setMFMEnabledFlag(Bool flag)                { m_bMFMEnabledFlag = flag; }
    17791796  Bool      getMFMEnabledFlag()                         { return m_bMFMEnabledFlag; }
     1797#if !REMOVE_COL_PICTURE_SIGNALING
    17801798  Void      setColRefLayerIdx(Int i)                    { m_colRefLayerIdx = i;     }
    17811799  Int       getColRefLayerIdx()                         { return m_colRefLayerIdx;  }
     
    17841802  Void      setMotionPredIlp(TComPic *ilpPic)           { m_pcIlpPic = ilpPic; }
    17851803  TComPic*  getMotionPredIlp()                          { return m_pcIlpPic; }
     1804#endif
    17861805#endif
    17871806#endif
  • trunk/source/Lib/TLibCommon/TComTrQuant.cpp

    r313 r345  
    12351235    uiMode = pcCU->getLumaIntraDir( uiAbsPartIdx );
    12361236  }
    1237 #if INTRA_BL_DST4x4
    1238   else if(eTType == TEXT_LUMA && pcCU->isIntraBL(uiAbsPartIdx) )
    1239   {
    1240     uiMode = DC_IDX; //Using DST
    1241   }
    1242 #endif
    12431237  else
    12441238  {
     
    13141308    Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)eTxt];
    13151309    assert(scalingListType < 6);
    1316 #if NO_RESIDUAL_FLAG_FOR_BLPRED
    1317     if(pcCU->isIntraBL(uiAbsPartIdx) && eTxt == TEXT_LUMA)
    1318     {
    1319       invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eTxt, DC_IDX, pResi, uiStride, rpcCoeff, uiWidth, uiHeight, scalingListType, pcCU->getTransformSkip(uiAbsPartIdx, eTxt) );
    1320     }
    1321     else
    1322     {
    1323       invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eTxt, REG_DCT, pResi, uiStride, rpcCoeff, uiWidth, uiHeight, scalingListType, pcCU->getTransformSkip(uiAbsPartIdx, eTxt) );
    1324     }
    1325 #else
    13261310    invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eTxt, REG_DCT, pResi, uiStride, rpcCoeff, uiWidth, uiHeight, scalingListType, pcCU->getTransformSkip(uiAbsPartIdx, eTxt) );
    1327 #endif
    13281311  }
    13291312  else
     
    18091792  Int     ui16CtxCbf          = 0;
    18101793  Int     iBestLastIdxP1      = 0;
    1811 #if NO_RESIDUAL_FLAG_FOR_BLPRED
    1812   if( (!pcCU->isIntra( uiAbsPartIdx ) || pcCU->isIntraBL( uiAbsPartIdx )) && eTType == TEXT_LUMA && pcCU->getTransformIdx( uiAbsPartIdx ) == 0 )
    1813 #else
    18141794  if( !pcCU->isIntra( uiAbsPartIdx ) && eTType == TEXT_LUMA && pcCU->getTransformIdx( uiAbsPartIdx ) == 0 )
    1815 #endif
    18161795  {
    18171796    ui16CtxCbf   = 0;
  • trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r313 r345  
    99{
    1010  {  0,  0,  0, 64,  0,  0,  0,  0}, //
     11#if ARBITRARY_SPATIAL_RATIO
     12  {  0,  1, -3, 63,  4, -2,  1,  0},
     13  { -1,  2, -5, 62,  8, -3,  1,  0},
     14  { -1,  3, -8, 60, 13, -4,  1,  0},
     15  { -1,  4,-10, 58, 17, -5,  1,  0},
     16#else
    1117  {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, //
    1218  {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, //
    1319  {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, //
    1420  {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, //
    15   { -1, 4, -11, 52, 26,  -8, 3, -1}, // <-> actual phase shift 1/3, used for spatial scalability x1.5     
     21#endif
     22  { -1, 4, -11, 52, 26,  -8,  3, -1}, // <-> actual phase shift 1/3, used for spatial scalability x1.5     
     23#if ARBITRARY_SPATIAL_RATIO
     24  { -1, 3,  -9, 47, 31, -10,  4, -1},
     25  { -1, 4, -11, 45, 34, -10,  4, -1},
     26#else
    1627  {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, //       
    1728  {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, //
    18   { -1, 4, -11, 40, 40, -11, 4, -1}, // <-> actual phase shift 1/2, equal to HEVC MC, used for spatial scalability x2
     29#endif
     30  { -1, 4, -11, 40, 40, -11,  4, -1}, // <-> actual phase shift 1/2, equal to HEVC MC, used for spatial scalability x2
     31#if ARBITRARY_SPATIAL_RATIO
     32  { -1,  4, -10, 34, 45, -11,  4, -1},
     33  { -1,  4, -10, 31, 47,  -9,  3, -1},
     34#else
    1935  {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, //
    2036  {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, //
     37#endif
    2138  { -1, 3,  -8, 26, 52, -11, 4, -1}, // <-> actual phase shift 2/3, used for spatial scalability x1.5
     39#if ARBITRARY_SPATIAL_RATIO
     40  { 0,  1,  -5, 17, 58, -10,  4, -1},
     41  { 0,  1,  -4, 13, 60,  -8,  3, -1},
     42  { 0,  1,  -3,  8, 62,  -5,  2, -1},
     43  { 0,  1,  -2,  4, 63,  -3,  1,  0}
     44#else
    2245  {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, //
    2346  {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, //
    2447  {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, //
    2548  {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}  //
     49#endif
    2650};
    2751
    2852const Int TComUpsampleFilter::m_chromaFixedFilter[16][NTAPS_US_CHROMA] =
    2953{
    30 #if CHROMA_UPSAMPLING
    3154  {  0, 64,  0,  0},//
     55#if ARBITRARY_SPATIAL_RATIO
     56  { -2, 62,  4,  0},
     57  { -2, 58, 10, -2},
     58  { -4, 56, 14, -2},
     59#else
    3260  {CNU,CNU,CNU,CNU},//
    3361  {CNU,CNU,CNU,CNU},//
    3462  {CNU,CNU,CNU,CNU},//
     63#endif
    3564  { -4, 54, 16, -2},// <-> actual phase shift 1/4,equal to HEVC MC, used for spatial scalability x1.5 (only for accurate Chroma alignement)
    3665  { -6, 52, 20, -2},// <-> actual phase shift 1/3, used for spatial scalability x1.5   
    3766  { -6, 46, 28, -4},// <-> actual phase shift 3/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement)     
     67#if ARBITRARY_SPATIAL_RATIO
     68  { -4, 42, 30, -4},
     69#else
    3870  {CNU,CNU,CNU,CNU},//
     71#endif
    3972  { -4, 36, 36, -4},// <-> actual phase shift 1/2,equal to HEVC MC, used for spatial scalability x2
    4073  { -4, 30, 42, -4},// <-> actual phase shift 7/12, used for spatial scalability x1.5 (only for accurate Chroma alignement)
     74#if ARBITRARY_SPATIAL_RATIO
     75  { -4, 28, 46, -6},
     76#else
    4177  {CNU,CNU,CNU,CNU},//
     78#endif
    4279  { -2, 20, 52, -6},// <-> actual phase shift 2/3, used for spatial scalability x1.5
     80#if ARBITRARY_SPATIAL_RATIO
     81  {-2, 16, 54, -4},
     82  {-2, 14, 56, -4},
     83#else
    4384  {CNU,CNU,CNU,CNU},//
    4485  {CNU,CNU,CNU,CNU},//
     86#endif
    4587  { -2, 10, 58, -2},// <-> actual phase shift 7/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 
    4688  {  0,  4, 62, -2} // <-> actual phase shift 11/12, used for spatial scalability x1.5 (only for accurate Chroma alignement)
    47 #else
    48   {  0, 64,  0,  0},//
    49   {CNU,CNU,CNU,CNU},//
    50   {CNU,CNU,CNU,CNU},//
    51   {CNU,CNU,CNU,CNU},//
    52   { -4, 54, 16, -2},// <-> actual phase shift 1/4,equal to HEVC MC, used for spatial scalability x1.5 (only for accurate Chroma alignement)
    53   { -5, 50, 22, -3},// <-> actual phase shift 1/3, used for spatial scalability x1.5   
    54   { -6, 46, 28, -4},// <-> actual phase shift 3/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement)     
    55   {CNU,CNU,CNU,CNU},//
    56   { -4, 36, 36, -4},// <-> actual phase shift 1/2,equal to HEVC MC, used for spatial scalability x2
    57   { -4, 30, 43, -5},// <-> actual phase shift 7/12, used for spatial scalability x1.5 (only for accurate Chroma alignement)
    58   {CNU,CNU,CNU,CNU},//
    59   { -3, 22, 50, -5},// <-> actual phase shift 2/3, used for spatial scalability x1.5
    60   {CNU,CNU,CNU,CNU},//
    61   {CNU,CNU,CNU,CNU},//
    62   { -2, 10, 58, -2},// <-> actual phase shift 7/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 
    63   { -1,  5, 62, -2} // <-> actual phase shift 11/12, used for spatial scalability x1.5 (only for accurate Chroma alignement)
    64 #endif
    6589};
    6690
     
    183207    }
    184208
     209#if ARBITRARY_SPATIAL_RATIO
     210    assert ( widthEL >= widthBL );
     211    assert ( heightEL >= heightBL );
     212#else
    185213    assert ( widthEL == widthBL || widthEL == 2*widthBL || 2*widthEL == 3*widthBL );
    186214    assert ( heightEL == heightBL || heightEL == 2*heightBL || 2*heightEL == 3*heightBL );
     215#endif
    187216
    188217    pcBasePic->setBorderExtension(false);
     
    195224    Int   phaseY = 0;
    196225
     226#if ROUNDING_OFFSET
     227    Int   addX = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
     228    Int   addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
     229#else
    197230    Int   addX       = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
    198231    Int   addY       = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
     232#endif
    199233
    200234    Int   deltaX     = 4 * phaseX;
     
    216250    Int topStartL  = scalEL.getWindowTopOffset();
    217251    Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset();
     252#if BUGFIX_RESAMPLE
     253    Int leftOffset = leftStartL > 0 ? leftStartL : 0;
     254#endif
     255#endif
     256
     257#if  N0214_INTERMEDIATE_BUFFER_16BITS
     258    Int shift1 = g_bitDepthY - 8;
    218259#endif
    219260
     
    236277      for( j = 0; j < heightBL ; j++ )
    237278      {
     279#if  N0214_INTERMEDIATE_BUFFER_16BITS
     280        *piDstY = sumLumaHor(piSrcY, coeff) >> shift1;
     281#else
    238282        *piDstY = sumLumaHor(piSrcY, coeff);
     283#endif
    239284        piSrcY += strideBL;
    240285        piDstY += strideEL;
     
    248293    pcTempPic->setHeight(heightEL);
    249294
     295#if  N0214_INTERMEDIATE_BUFFER_16BITS
     296    Int nShift = US_FILTER_PREC*2 - shift1;
     297#else
    250298    const Int nShift = US_FILTER_PREC*2;
     299#endif
    251300    Int iOffset = 1 << (nShift - 1);
    252301
     
    269318      piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL;
    270319#if SCALED_REF_LAYER_OFFSETS
     320#if BUGFIX_RESAMPLE
     321      Pel* piDstY0 = piDstBufY + j * strideEL;           
     322      piDstY = piDstY0 + leftOffset;
     323      piSrcY += leftOffset;
     324
     325      for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- )
     326      {
     327        *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift));
     328        piSrcY++;
     329        piDstY++;
     330      }
     331
     332      for( i = rightEndL; i < pcTempPic->getWidth(); i++ )
     333      {
     334        *piDstY = piDstY0[rightEndL-1];
     335        piDstY++;
     336      }
     337
     338      piDstY = piDstY0;
     339      for( i = 0; i < leftStartL; i++ )
     340      {
     341        *piDstY = piDstY0[leftStartL];
     342        piDstY++;
     343      }
     344#else
    271345#if 1 // it should provide identical result
    272346      Pel* piDstY0 = piDstBufY + j * strideEL;           
     
    308382      }
    309383#endif
     384#endif
    310385#else
    311386      piDstY = piDstBufY + j * strideEL;
     
    351426    Int topStartC  = scalEL.getWindowTopOffset() >> 1;
    352427    Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1);
     428#if BUGFIX_RESAMPLE
     429    leftOffset = leftStartC > 0 ? leftStartC : 0;
     430#endif
    353431#endif
    354432
     
    359437    phaseY = 1;
    360438
     439#if ROUNDING_OFFSET
     440    addX       = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
     441    addY       = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
     442#else
    361443    addX       = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
    362444    addY       = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
     445#endif
    363446
    364447    deltaX     = 4 * phaseX;
     
    379462    widthBL   = pcBasePic->getWidth () >> 1;
    380463    heightBL  = min<Int>( pcBasePic->getHeight() >> 1, heightEL );
     464#endif
     465
     466#if  N0214_INTERMEDIATE_BUFFER_16BITS
     467    shift1 = g_bitDepthC - 8;
    381468#endif
    382469
     
    401488      for( j = 0; j < heightBL ; j++ )
    402489      {
     490#if  N0214_INTERMEDIATE_BUFFER_16BITS
     491        *piDstU = sumChromaHor(piSrcU, coeff) >> shift1;
     492        *piDstV = sumChromaHor(piSrcV, coeff) >> shift1;
     493#else
    403494        *piDstU = sumChromaHor(piSrcU, coeff);
    404495        *piDstV = sumChromaHor(piSrcV, coeff);
     496#endif
    405497
    406498        piSrcU += strideBL;
     
    416508    pcTempPic->extendPicBorder   (); // extend the border.
    417509    pcTempPic->setHeight(heightEL << 1);
     510
     511#if  N0214_INTERMEDIATE_BUFFER_16BITS
     512    nShift = US_FILTER_PREC*2 - shift1;
     513    iOffset = 1 << (nShift - 1);
     514#endif
    418515
    419516#if SCALED_REF_LAYER_OFFSETS
     
    436533      piSrcV = piTempBufV  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
    437534#if SCALED_REF_LAYER_OFFSETS
     535#if BUGFIX_RESAMPLE
     536      Pel* piDstU0 = piDstBufU + j*strideEL;
     537      Pel* piDstV0 = piDstBufV + j*strideEL;
     538      piDstU = piDstU0 + leftOffset;
     539      piDstV = piDstV0 + leftOffset;
     540      piSrcU += leftOffset;
     541      piSrcV += leftOffset;
     542
     543      for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- )
     544      {
     545        *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
     546        *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
     547        piSrcU++;
     548        piSrcV++;
     549        piDstU++;
     550        piDstV++;
     551      }
     552
     553      for( i = rightEndC; i < pcTempPic->getWidth() >> 1; i++ )
     554      {
     555        *piDstU = piDstU0[rightEndC-1];
     556        *piDstV = piDstV0[rightEndC-1];
     557        piDstU++;
     558        piDstV++;
     559      }
     560
     561      piDstU = piDstU0;
     562      piDstV = piDstV0;
     563      for( i = 0; i < leftStartC; i++ )
     564      {
     565        *piDstU = piDstU0[leftStartC];
     566        *piDstV = piDstV0[leftStartC];
     567        piDstU++;
     568        piDstV++;
     569      }
     570#else
    438571#if 1 // it should provide identical result
    439572      Pel* piDstU0 = piDstBufU + j*strideEL;
     
    490623      }
    491624#endif
     625#endif
    492626#else
    493627      piDstU = piDstBufU + j*strideEL;
  • trunk/source/Lib/TLibCommon/TComYuv.cpp

    r313 r345  
    184184}
    185185
    186 #if NO_RESIDUAL_FLAG_FOR_BLPRED
    187 Void TComYuv::copyFromPicLuma  ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiZorderIdxInCU, UInt uiAbsZorderIdx, UInt uiWidth, UInt uiHeight )
    188 {
    189   Int  y;
    190 
    191   Pel* pDst     = getLumaAddr(uiAbsZorderIdx);
    192   Pel* pSrc     = pcPicYuvSrc->getLumaAddr ( iCuAddr, uiZorderIdxInCU + uiAbsZorderIdx );
    193 
    194   UInt  iDstStride  = getStride();
    195   UInt  iSrcStride  = pcPicYuvSrc->getStride();
    196   for ( y = uiHeight; y != 0; y-- )
    197   {
    198     ::memcpy( pDst, pSrc, sizeof(Pel)*uiWidth);
    199     pDst += iDstStride;
    200     pSrc += iSrcStride;
    201   }
    202 }
    203 
    204 Void TComYuv::copyFromPicChroma( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiZorderIdxInCU, UInt uiAbsZorderIdx, UInt uiCWidth, UInt uiCHeight, UInt uiChromaId  )
    205 {
    206   Int  y;
    207 
    208   if (!uiChromaId)
    209   {
    210     Pel* pDstU      = getCbAddr(uiAbsZorderIdx);
    211     Pel* pSrcU      = pcPicYuvSrc->getCbAddr( iCuAddr, uiZorderIdxInCU + uiAbsZorderIdx );
    212 
    213     UInt  iDstStride = getCStride();
    214     UInt  iSrcStride = pcPicYuvSrc->getCStride();
    215     for ( y = uiCHeight; y != 0; y-- )
    216     {
    217       ::memcpy( pDstU, pSrcU, sizeof(Pel)*(uiCWidth) );
    218       pSrcU += iSrcStride;
    219       pDstU += iDstStride;
    220     }
    221   }
    222   else
    223   {
    224     Pel* pDstV      = getCrAddr(uiAbsZorderIdx);
    225     Pel* pSrcV      = pcPicYuvSrc->getCrAddr( iCuAddr, uiZorderIdxInCU + uiAbsZorderIdx );
    226 
    227     UInt  iDstStride = getCStride();
    228     UInt  iSrcStride = pcPicYuvSrc->getCStride();
    229     for ( y = uiCHeight; y != 0; y-- )
    230     {
    231       ::memcpy( pDstV, pSrcV, sizeof(Pel)*(uiCWidth) );
    232       pSrcV += iSrcStride;
    233       pDstV += iDstStride;
    234     }
    235   }
    236 }
    237 #endif
    238 
    239186Void TComYuv::copyToPartYuv( TComYuv* pcYuvDst, UInt uiDstPartIdx )
    240187{
  • trunk/source/Lib/TLibCommon/TComYuv.h

    r313 r345  
    115115  Void    copyFromPicLuma      ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiAbsZorderIdx );
    116116  Void    copyFromPicChroma    ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiAbsZorderIdx );
    117 #if NO_RESIDUAL_FLAG_FOR_BLPRED
    118   Void    copyFromPicLuma  ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiZorderIdxInCU, UInt uiAbsZorderIdx, UInt uiWidth, UInt uiHeight );
    119   Void    copyFromPicChroma( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiZorderIdxInCU, UInt uiAbsZorderIdx, UInt uiCWidth, UInt uiCHeight, UInt uiChromaId  );
    120 #endif
    121117 
    122118  //  Copy Small YUV buffer to the part of other Big YUV buffer
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r313 r345  
    4141#define SVC_EXTENSION                    1
    4242
     43#define N0139_POSITION_ROUNDING_OFFSET   1
     44
    4345#define SYNTAX_BYTES                     10      ///< number of bytes taken by syntaxes per 4x4 block [RefIdxL0(1byte), RefIdxL1(1byte), MVxL0(2bytes), MVyL0(2bytes), MVxL1(2bytes), MVyL1(2bytes)]
    4446
    4547#if SVC_EXTENSION
    4648#define MAX_LAYERS                       2      ///< max number of layers the codec is supposed to handle
    47 
     49#define RPL_INIT_N0316_N0082             1      ///< N0316, N0082: initial reference picture list construction
     50#define FINAL_RPL_CHANGE_N0082           1      ///< N0082: final ref picture list change (encoder)
    4851#define M0464_TILE_BOUNDARY_ALIGNED_FLAG 1      ///< VUI flag to indicate tile boundary alignment
    4952#define M0463_VUI_EXT_ILP_REF            1      ///< VUI extension inter-layer dependency offset signalling
     
    5154#define SCALED_REF_LAYER_OFFSET_FLAG     0      ///< M0309: Signal scaled reference layer offsets in SPS
    5255#define SCALED_REF_LAYER_OFFSETS         1      ///< M0309: Signal scaled reference layer offsets in SPS
     56
     57#define ILP_SSH_SIG                      1      ///< JCTVC-N0195 proposal 2, JCTVC-N0118: add presence flag in VPS ext to condition inter-layer prediction signaling in slice segment header
     58#define SPL_FLG_CHK                      1      ///< JCTVC-N0195 proposal 5, JCTVC-N0085: constrain sum of lengths to be less than or equal to 6
     59#define ILP_NUM_REF_CHK                  1      ///< JCTVC-N0195 proposal 1, JCTVC-N0081, JCTVC-N0154, JCTVC-N0217: a condition on signaling inter_layer_pred_layer_idc[ i ], to avoid sending when NumDirectRefLayers equals NumActiveRefLayerPics, and instead infer values
    5360
    5461#define VPS_RENAME                       1      ///< Rename variables max_layer_id and num_layer_sets_minus1 in VPS
     
    7481#define SVC_COL_BLK                      1      ///< get co-located block
    7582#define SVC_UPSAMPLING                   1      ///< upsampling filters
    76 #define CHROMA_UPSAMPLING                1      ///< L0335: Chroma upsampling with 5 bits coefficients
     83#define ROUNDING_OFFSET                  1      ///< JCTVC-N0111: upsampling rounding offset using scalling factors
     84#define N0214_INTERMEDIATE_BUFFER_16BITS 1      ///< JCTVC-N0214 support base layer input more than 8 bits
     85#define ARBITRARY_SPATIAL_RATIO          0      ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio
     86#define BUGFIX_RESAMPLE                  1      ///< JCTVC-N0055: resampling bug fix for positive left scalled offset
    7787
    7888#define SIMPLIFIED_MV_POS_SCALING        1      ///< M0133/M0449: inter-layer MV scaling and pixel mapping position calculation
     
    97107#define JCTVC_M0458_INTERLAYER_RPS_SIG   1      ///< implementation of JCTVC-L0178
    98108#if JCTVC_M0458_INTERLAYER_RPS_SIG
    99 #define ZERO_NUM_DIRECT_LAYERS           1      ///< support of zero direct reference layers
    100109#define MAX_ONE_RESAMPLING_DIRECT_LAYERS 1      ///< Allow maximum of one resampling process for direct reference layers
    101110#endif
    102111#define JCTVC_M0203_INTERLAYER_PRED_IDC  1      ///< implementation of JCTVC-M0203 Inter-layer Prediction Indication
    103112#if JCTVC_M0203_INTERLAYER_PRED_IDC
    104 #define ILR_RESTR                        1     ///< JCTVC-M0209 Inter-layer RPS and RPL
     113#define ILR_RESTR                        1      ///< JCTVC-M0209 Inter-layer RPS and RPL
     114#define N0120_MAX_TID_REF_PRESENT_FLAG   1      ///< JCTVC-N0120 max_tid_ref_pics_plus1_present_flag
    105115#endif
    106116#if REF_IDX_MFM
     117#define REMOVE_COL_PICTURE_SIGNALING     1      ///< JCTVC-N0107 remove alternative collocated picture signalling
    107118#define M0457_COL_PICTURE_SIGNALING      1
    108119#endif
    109120
    110121#if !VPS_EXTN_DIRECT_REF_LAYERS || !M0457_PREDICTION_INDICATIONS || !JCTVC_M0458_INTERLAYER_RPS_SIG
    111 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0
     122#define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0      ///< shall be 0, JCTVC-N0107
    112123#else
    113 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0
    114 #endif
    115 
    116 #else
    117 #define INTRA_BL                         1      ///< inter-layer texture prediction
    118 
    119 #if INTRA_BL
    120 #define INTRA_BL_DST4x4                  1      ///< L0067/L0204: DST4x4 for Intra BL
    121 #define NO_RESIDUAL_FLAG_FOR_BLPRED      1      ///< L0437: Root cbf for Intra_BL
    122 #define IL_MRG_SIMPLIFIED_PRUNING        1      ///< M0124: simplified pruning, Only the left and above candidates are checked with BL-C candidate for redundancy removal
    123 #define INTRA_BL_CTX_CHANGE              1      ///< M0075: spatial dependency removal for IntraBL flag context derivation
    124 
    125 // Hooks
    126 #define SVC_MVP                          1      ///< motion hook for merge mode as an example
    127 #if !AVC_BASE && !AVC_SYNTAX
    128 #define SVC_BL_CAND_INTRA                0      ///< Intra Base Mode Prediction hook as an example
    129 #endif
    130 
     124#define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0      ///< shall be 0, JCTVC-N0107
    131125#endif
    132126#endif
     
    134128#define FAST_INTRA_SHVC                  1      ///< M0115: reduction number of intra modes in the EL (encoder only)
    135129#if FAST_INTRA_SHVC
    136   #define NB_REMAIN_MODES                2      ///< nb of remaining modes (M0115)
    137 #endif
    138 
    139 #define RC_SHVC_HARMONIZATION            1  ///< JCTVC-M0037, rate control for SHVC
     130#define NB_REMAIN_MODES                  2      ///< nb of remaining modes (M0115)
     131#endif
     132
     133#define RC_SHVC_HARMONIZATION            1      ///< JCTVC-M0037, rate control for SHVC
    140134
    141135#else
     
    472466  MODE_INTER,           ///< inter-prediction mode
    473467  MODE_INTRA,           ///< intra-prediction mode
    474 #if INTRA_BL
    475   MODE_INTRA_BL,        ///< inter-layer intra-prediction mode
    476 #endif
    477468  MODE_NONE = 15
    478469};
Note: See TracChangeset for help on using the changeset viewer.