Changeset 1262 in 3DVCSoftware


Ignore:
Timestamp:
29 Jun 2015, 19:43:32 (9 years ago)
Author:
qualcomm
Message:
  1. enable ARP by NH_3D_ARP with simulation results included; 2. address Gerhard's comments on setBaseViewRefPicList; 3. align the software with the specification of checking the correct reference picture list proposed in JCT3V-F105
Location:
branches/HTM-14.1-update-dev4-Qualcomm
Files:
1 added
36 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/CommonDef.h

    r1200 r1262  
    363363#endif
    364364
    365 #if H_3D_IV_MERGE
     365#if H_3D_IV_MERGE || NH_3D_ARP
    366366#define MRG_MAX_NUM_CANDS_MEM       (MRG_MAX_NUM_CANDS+1) // one extra for inter-view motion prediction
    367367#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/ContextTables.h

    r1222 r1262  
    162162#define NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX  1
    163163
    164 #if H_3D_ARP
     164#if NH_3D_ARP
    165165#define NUM_ARPW_CTX                  3       ///< number of context models for weighting factor index used by advanced residual prediction
    166166#endif
     
    542542//! \}
    543543
    544 #if H_3D_ARP
     544#if NH_3D_ARP
    545545static const UChar
    546546INIT_ARPW[3][NUM_ARPW_CTX] =
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComCodingStatistics.h

    r1246 r1262  
    8282#if NH_3D_DBBP
    8383  STATS__CABAC_BITS__DBBP_FLAG,
     84#endif
     85#if NH_3D_ARP
     86  STATS__CABAC_BITS__ARP_FLAG,
    8487#endif
    8588  STATS__CABAC_BITS__SAO,
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp

    r1246 r1262  
    134134  m_pbSPIVMPFlag         = NULL;
    135135#endif
    136 #if H_3D_ARP
     136#if NH_3D_ARP
    137137  m_puhARPW              = NULL;
    138138#endif
     
    249249    }
    250250
    251 #if H_3D_ARP
    252     m_puhARPW            = new UChar[ uiNumPartition];
     251#if NH_3D_ARP
     252    m_puhARPW            = (UChar*  )xMalloc(UChar,   uiNumPartition);
    253253#endif
    254254#if H_3D_IC
     
    468468
    469469
    470 #if H_3D_ARP
    471     if ( m_puhARPW            ) { delete[] m_puhARPW;           m_puhARPW           = NULL; }
     470#if NH_3D_ARP
     471    if ( m_puhARPW            ) { xFree(m_puhARPW);             m_puhARPW           = NULL; }
    472472#endif
    473473#if H_3D_IC
     
    598598  memset( m_puhHeight         , maxCUHeight,                m_uiNumPartition * sizeof( *m_puhHeight ) );
    599599
    600 #if H_3D_ARP
    601     m_puhARPW   [ui] = pcFrom->getARPW( ui );
    602 #endif
    603600#if H_3D_IC
    604601    m_pbICFlag[ui]   =  pcFrom->m_pbICFlag[ui];
     
    651648  }
    652649
    653 #if H_3D_ARP
    654     memset( m_puhARPW           + firstElement, 0,                        numElements * sizeof( UChar )         );
     650#if NH_3D_ARP
     651  memset( m_puhARPW      ,      0,        m_uiNumPartition * sizeof( *m_puhARPW )         );
    655652#endif
    656653#if H_3D_IC
     
    809806      m_puhCbf[comp][ui] = 0;
    810807    }
    811 #if H_3D_ARP
    812       m_puhARPW[ui] = 0;
     808#if NH_3D_ARP
     809    m_puhARPW[ui] = 0;
    813810#endif
    814811#if H_3D_IC
     
    915912    memset( m_explicitRdpcmMode[comp],             NUMBER_OF_RDPCM_MODES, iSizeInUchar );
    916913  }
    917 #if H_3D_ARP
    918   memset( m_puhARPW,            0, iSizeInUchar  );
    919 #endif
     914
    920915
    921916  memset( m_puhDepth,     uiDepth, iSizeInUchar );
     
    923918  memset( m_puhHeight,         uhHeight, iSizeInUchar );
    924919  memset( m_pbIPCMFlag,        0, iSizeInBool  );
     920#if NH_3D_ARP
     921  memset( m_puhARPW,           0, iSizeInUchar  );
     922#endif
    925923#if H_3D_IC
    926924  memset( m_pbICFlag,          0, iSizeInBool  );
     
    982980      m_pbSPIVMPFlag[ui]=pcCU->m_pbSPIVMPFlag[uiPartOffset+ui];
    983981#endif
    984 #if H_3D_ARP
    985       m_puhARPW           [ui] = pcCU->getARPW( uiPartOffset+ui );
     982#if NH_3D_ARP
     983     m_puhARPW            [ui] = pcCU->getARPW( uiPartOffset + ui );
    986984#endif
    987985#if H_3D_IC
     
    10891087  m_pbSPIVMPFlag        = pcCU->getSPIVMPFlag()          + uiPart;
    10901088#endif
    1091 #if H_3D_ARP
     1089#if NH_3D_ARP
    10921090  m_puhARPW             = pcCU->getARPW()             + uiPart;
    10931091#endif
     
    12491247  m_apiMVPIdx[eRefPicList] = pcCU->getMVPIdx(eRefPicList) + uiAbsPartIdx;
    12501248  m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx;
    1251 #if H_3D_ARP
     1249#if NH_3D_ARP
    12521250  m_puhARPW            = pcCU->getARPW()                  + uiAbsPartIdx;
    12531251#endif   
     
    13431341  memcpy( m_pbDBBPFlag          + uiOffset, pcCU->getDBBPFlag(),          iSizeInBool  );
    13441342#endif
     1343#if NH_3D_ARP
     1344  memcpy( m_puhARPW             + uiOffset, pcCU->getARPW(),              iSizeInUchar );
     1345#endif
    13451346
    13461347  memcpy( m_puhDepth  + uiOffset, pcCU->getDepth(),  iSizeInUchar );
     
    13831384  }
    13841385
    1385 #if H_3D_ARP
    1386   memcpy( m_puhARPW             + uiOffset, pcCU->getARPW(),              iSizeInUchar );
    1387 #endif
     1386
    13881387#if H_3D_IC
    13891388  memcpy( m_pbICFlag            + uiOffset, pcCU->getICFlag(),            iSizeInBool );
     
    14731472  memcpy( pCtu->getDBBPFlag()          + m_absZIdxInCtu, m_pbDBBPFlag,          iSizeInBool  );
    14741473#endif
    1475 
     1474#if NH_3D_ARP
     1475  memcpy( pCtu->getARPW()              + m_absZIdxInCtu, m_puhARPW,             iSizeInUchar );
     1476#endif
    14761477  memcpy( pCtu->getDepth()  + m_absZIdxInCtu, m_puhDepth,  iSizeInUchar );
    14771478  memcpy( pCtu->getWidth()  + m_absZIdxInCtu, m_puhWidth,  iSizeInUchar );
     
    15061507  }
    15071508
    1508 #if H_3D_ARP
    1509   memcpy( rpcCU->getARPW()             + m_uiAbsIdxInLCU, m_puhARPW,             iSizeInUchar );
    1510 #endif
     1509
    15111510#if H_3D_IC
    15121511  memcpy( rpcCU->getICFlag()           + m_uiAbsIdxInLCU, m_pbICFlag,            iSizeInBool );
     
    15441543  memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart);
    15451544#endif
    1546 #endif
    1547 #if H_3D_ARP
    1548   memcpy( rpcCU->getARPW()             + uiPartOffset, m_puhARPW,             iSizeInUchar );
    15491545#endif
    15501546#if H_3D_IC
     
    21022098  return uiCtx;
    21032099}
    2104 #if H_3D_ARP
     2100#if NH_3D_ARP
    21052101UInt TComDataCU::getCTXARPWFlag( UInt uiAbsPartIdx )
    21062102{
     
    21092105  UInt        uiCtx = 0;
    21102106 
    2111   pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     2107  pcTempCU = getPULeft( uiTempPartIdx, m_absZIdxInCtu + uiAbsPartIdx );
    21122108  uiCtx    = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0;
    2113     return uiCtx;
     2109  return uiCtx;
    21142110}
    21152111#endif
     
    37063702  Bool bICFlag = getICFlag(uiAbsPartIdx);
    37073703#endif
    3708 #if H_3D_ARP
     3704#if NH_3D_ARP
    37093705  Bool bARPFlag = getARPW(uiAbsPartIdx) > 0;
    37103706#endif
     
    37443740      && !bICFlag
    37453741#endif
    3746 #if H_3D_ARP
     3742#if NH_3D_ARP
    37473743      && !bARPFlag
    37483744#endif
     
    41924188      !bICFlag &&
    41934189#endif
    4194 #if H_3D_ARP
     4190#if NH_3D_ARP
    41954191      !bARPFlag &&
    41964192#endif
     
    61316127Void TComDataCU::setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth )
    61326128{
     6129#if BUF_FIX
     6130  UInt uiCurrPartNumb = m_pcPic->getNumPartitionsInCtu() >> (uiDepth << 1);
     6131  assert(m_pcPic->getNumPartitionsInCtu() ==m_pcPic->getNumPartInCtuWidth()*m_pcPic->getNumPartInCtuHeight());
     6132#else
    61336133  UInt uiCurrPartNumb = m_pcPic->getNumPartInCtuWidth() >> (uiDepth << 1);
     6134#endif
    61346135  for (UInt ui = 0; ui < uiCurrPartNumb; ui++ )
    61356136  {
     
    66756676}
    66766677#endif
    6677 #if H_3D_ARP
     6678#if NH_3D_ARP
    66786679Void TComDataCU::setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth )
    66796680{
    6680   assert( sizeof( *m_puhARPW) == 1 );
    6681   memset( m_puhARPW + uiAbsPartIdx, w, m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ) );
     6681  setSubPart<UChar>( w, m_puhARPW, uiAbsPartIdx, uiDepth, 0 );
    66826682}
    66836683#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComDataCU.h

    r1246 r1262  
    5050#include "TComPattern.h"
    5151
    52 #if H_3D_ARP
    53 #include "TComYuv.h"
    54 #endif
    5552#if H_3D
    5653#include <algorithm>
     
    176173  Bool*         m_pbSPIVMPFlag;       ///< array of sub-PU IVMP flags to indicate whehter a block uses sub-PU IVMP ///< 0: non-SPIVMP; 1: SPIVMP
    177174#endif
    178 #if H_3D_ARP
     175#if NH_3D_ARP
    179176  UChar*        m_puhARPW;
    180177#endif
     
    251248
    252249  /// compute scaling factor from POC difference
    253 #if !H_3D_ARP
     250#if !NH_3D_ARP
    254251  Int           xGetDistScaleFactor   ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
    255252#endif
     
    268265  // create / destroy / initialize / copy
    269266  // -------------------------------------------------------------------------------------------------------------------
    270 #if H_3D_ARP
     267#if NH_3D_ARP
     268  /// compute scaling factor from POC difference
    271269  Int           xGetDistScaleFactor   ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
    272270#endif
     
    318316  Void          getPosInPic           ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY ) const;
    319317#endif
    320 
     318#if NH_3D_ARP
     319  Void          setSlice              ( TComSlice* pcSlice)     { m_pcSlice = pcSlice;       }
     320  Void          setPic                ( TComDataCU* pcCU  )     { m_pcPic              = pcCU->getPic(); }
     321#endif
    321322  // -------------------------------------------------------------------------------------------------------------------
    322323  // member functions for CU data
     
    531532    );   
    532533#endif
    533 #if H_3D_ARP
     534#if NH_3D_ARP
    534535  UChar*        getARPW            ()                        { return m_puhARPW;               }
    535536  UChar         getARPW            ( UInt uiIdx )            { return m_puhARPW[uiIdx];        }
    536537  Void          setARPW            ( UInt uiIdx, UChar w )   { m_puhARPW[uiIdx] = w;           }
    537538  Void          setARPWSubParts    ( UChar w, UInt uiAbsPartIdx, UInt uiDepth );
    538   Double        getARPWFactor      ( UInt uiIdx );
    539539#endif
    540540#if H_3D_IC
     
    710710  Bool          isIC      ( UInt uiPartIdx );
    711711#endif
    712 
    713712  // -------------------------------------------------------------------------------------------------------------------
    714713  // member functions for symbol prediction (most probable / mode conversion)
     
    729728  UInt          getCtxSkipFlag                  ( UInt   uiAbsPartIdx                                 );
    730729  UInt          getCtxInterDir                  ( UInt   uiAbsPartIdx                                 );
    731 #if H_3D_ARP
     730#if NH_3D_ARP
    732731  UInt          getCTXARPWFlag                  ( UInt   uiAbsPartIdx                                 );
    733732#endif 
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComInterpolationFilter.cpp

    r1200 r1262  
    7575};
    7676
    77 #if H_3D_ARP
     77#if NH_3D_ARP
    7878const Short TComInterpolationFilter::m_lumaFilterARP[4][NTAPS_LUMA_ARP] =
    7979{
     
    361361 */
    362362Void TComInterpolationFilter::filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast, const ChromaFormat fmt, const Int bitDepth
    363 #if H_3D_ARP
     363#if NH_3D_ARP
    364364    , Bool filterType
    365365#endif
     
    372372  else if (isLuma(compID))
    373373  {
    374 #if H_3D_ARP
     374    assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS);
     375#if NH_3D_ARP
    375376    if(filterType)
    376377    {
    377       filterHor<NTAPS_LUMA_ARP>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilterARP[frac]);
     378      filterHor<NTAPS_LUMA_ARP>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilterARP[frac]);
    378379    }
    379380    else
    380381    {
    381382#endif
    382 
    383     assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS);
    384     filterHor<NTAPS_LUMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]);
    385 #if H_3D_ARP
    386     }
    387 #endif
    388 
     383      filterHor<NTAPS_LUMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]);
     384#if NH_3D_ARP
     385    }
     386#endif
    389387  }
    390388  else
     
    392390    const UInt csx = getComponentScaleX(compID, fmt);
    393391    assert(frac >=0 && csx<2 && (frac<<(1-csx)) < CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS);
    394     filterHor<NTAPS_CHROMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac<<(1-csx)]);
     392#if NH_3D_ARP
     393    if(filterType)
     394    {
     395      filterHor<NTAPS_CHROMA_ARP>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilterARP[frac]);
     396    }
     397    else
     398    {
     399#endif
     400      filterHor<NTAPS_CHROMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac<<(1-csx)]);
     401#if NH_3D_ARP
     402    }
     403#endif
    395404  }
    396405}
     
    414423 */
    415424Void TComInterpolationFilter::filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth
    416 #if H_3D_ARP
     425#if NH_3D_ARP
    417426    , Bool filterType
    418427#endif
     
    425434  else if (isLuma(compID))
    426435  {
    427 #if H_3D_ARP
     436    assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS);
     437#if NH_3D_ARP
    428438    if(filterType)
    429439    {
    430       filterVer<NTAPS_LUMA_ARP>(g_bitDepthY, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilterARP[frac]);   
     440      filterVer<NTAPS_LUMA_ARP>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilterARP[frac]);   
    431441    }
    432442    else
    433443    {
    434444#endif
    435     assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS);
    436445    filterVer<NTAPS_LUMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]);
    437 #if H_3D_ARP
    438     }
    439 #endif
    440 
     446#if NH_3D_ARP
     447    }
     448#endif
    441449  }
    442450  else
     
    444452    const UInt csy = getComponentScaleY(compID, fmt);
    445453    assert(frac >=0 && csy<2 && (frac<<(1-csy)) < CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS);
     454#if NH_3D_ARP
     455    if(filterType)
     456    {
     457      filterVer<NTAPS_CHROMA_ARP>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilterARP[frac]);   
     458    }
     459    else
     460    {
     461#endif
    446462    filterVer<NTAPS_CHROMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac<<(1-csy)]);
    447   }
    448 }
    449 
    450 #if H_3D_ARP
    451     , Bool filterType
    452 #endif
    453 
    454 #if H_3D_ARP
    455     if(filterType)
    456     {
    457       filterHor<NTAPS_CHROMA_ARP>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilterARP[frac]);
    458     }
    459     else
    460     {
    461 #endif
    462 #if H_3D_ARP
    463     }
    464 #endif
    465 #if H_3D_ARP
    466     , Bool filterType
    467 #endif
    468 #if H_3D_ARP
    469     if(filterType)
    470     {
    471       filterVer<NTAPS_CHROMA_ARP>(g_bitDepthC, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilterARP[frac]);
    472     }
    473     else
    474     {
    475 #endif
    476 #if H_3D_ARP
    477     }
    478 #endif
    479 
    480 
    481 
     463#if NH_3D_ARP
     464    }
     465#endif
     466  }
     467}
    482468//! \}
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComInterpolationFilter.h

    r1200 r1262  
    4545//! \{
    4646
    47 #if H_3D_ARP
     47#if NH_3D_ARP
    4848#define NTAPS_LUMA_ARP    2 ///< Number of taps for luma
    4949#define NTAPS_CHROMA_ARP  2 ///< Number of taps for chroma
     
    6363  static const TFilterCoeff m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA];     ///< Luma filter taps
    6464  static const TFilterCoeff m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps
    65 #if H_3D_ARP
     65#if NH_3D_ARP
    6666  static const Short m_lumaFilterARP  [4][NTAPS_LUMA_ARP];     ///< Luma filter taps for ARP
    6767  static const Short m_chromaFilterARP[8][NTAPS_CHROMA_ARP];   ///< Chroma filter taps for ARP
     
    8383
    8484  Void filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac,               Bool isLast, const ChromaFormat fmt, const Int bitDepth
    85 #if H_3D_ARP
     85#if NH_3D_ARP
    8686    , Bool filterType = false
    8787#endif
    8888);
    8989  Void filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth
    90 #if H_3D_ARP
     90#if NH_3D_ARP
    9191    , Bool filterType = false
    9292#endif
     
    9494};
    9595
    96 #if H_3D_ARP
    97     , Bool filterType = false
    98 #endif
    99 #if H_3D_ARP
    100     , Bool filterType = false
    101 #endif
    102 
    10396//! \}
    10497
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComPic.cpp

    r1210 r1262  
    143143}
    144144#if NH_3D
     145#if NH_3D_ARP
     146Void TComPic::getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx )
     147{
     148  Int iMaxCUWidth   = (Int) ( getPicSym()->getSPS().getMaxCUWidth()  );
     149  Int iMaxCuHeight  = (Int) ( getPicSym()->getSPS().getMaxCUHeight() );
     150
     151  UInt uiMaxTotalCUDepth = getPicSym()->getSPS().getMaxTotalCUDepth();
     152  Int iBaseUnitWidth  = iMaxCUWidth >> uiMaxTotalCUDepth;
     153  Int iBaseUnitHeight = iMaxCUWidth >> uiMaxTotalCUDepth;
     154
     155  Int iNumCuInWidth   = getPicYuvRec()->getWidth(COMPONENT_Y) / iMaxCUWidth;
     156  iNumCuInWidth      += ( getPicYuvRec()->getWidth(COMPONENT_Y) % iMaxCUWidth ) ? 1 : 0;
     157
     158
     159  Int iCuX            = iX / iMaxCUWidth;
     160  Int iCuY            = iY / iMaxCuHeight;
     161  Int iBaseX          = ( iX - iCuX * iMaxCUWidth  ) / iBaseUnitWidth;
     162  Int iBaseY          = ( iY - iCuY * iMaxCuHeight ) / iBaseUnitHeight;
     163  Int iCuSizeInBases  = iMaxCuHeight                 / iBaseUnitWidth;
     164
     165  riCuAddr            = iCuY   * iNumCuInWidth + iCuX;
     166  Int iRastPartIdx    = iBaseY * iCuSizeInBases  + iBaseX;
     167  riAbsZorderIdx      = g_auiRasterToZscan[ iRastPartIdx ];
     168}
     169#endif
    145170Void TComPic::compressMotion(Int scale)
    146171#else
     
    283308  return getPicYuv( layerIdInNuh, poc, recon );
    284309}
    285 #if H_3D_ARP
     310#if NH_3D_ARP
    286311TComList<TComPic*>* TComPicLists::getPicList( Int layerIdInNuh )
    287312{
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComPic.h

    r1210 r1262  
    182182#endif
    183183#if NH_3D
     184#if NH_3D_ARP
     185  Void          getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx );
     186#endif
    184187  Void          compressMotion(Int scale);
    185188#else   
     
    248251  Void        push_back( TComList<TComPic*>* list ) { m_lists.push_back( list );   }
    249252  Int         size     ()                           { return (Int) m_lists.size(); }
    250 #if H_3D_ARP
     253#if NH_3D_ARP
    251254  TComList<TComPic*>*  getPicList   ( Int layerIdInNuh );
    252255#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComPicYuv.cpp

    r1200 r1262  
    306306  riY                 = iCuY * m_iCuHeight + iBaseY * m_iBaseUnitHeight;
    307307}
    308 
    309 Void
    310 TComPicYuv::getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx )
    311 {
    312   Int iCuX            = iX / m_iCuWidth;
    313   Int iCuY            = iY / m_iCuHeight;
    314   Int iBaseX          = ( iX - iCuX * m_iCuWidth  ) / m_iBaseUnitWidth;
    315   Int iBaseY          = ( iY - iCuY * m_iCuHeight ) / m_iBaseUnitHeight;
    316   Int iCuSizeInBases  = m_iCuWidth                  / m_iBaseUnitWidth;
    317   riCuAddr            = iCuY   * m_iNumCuInWidth + iCuX;
    318   Int iRastPartIdx    = iBaseY * iCuSizeInBases  + iBaseX;
    319   riAbsZorderIdx      = g_auiRasterToZscan[ iRastPartIdx ];
    320 }
    321308#endif
    322309Void TComPicYuv::setLumaTo( Pel pVal )
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComPicYuv.h

    r1200 r1262  
    167167  // Set Function
    168168  Void  setLumaTo    ( Pel pVal ); 
    169   Void  setChromaTo  ( Pel pVal );  
    170 #if H_3D_IV_MERGE
     169  Void  setChromaTo  ( Pel pVal );
     170#if H_3D_IV_MERGE 
    171171  // sample to block and block to sample conversion
    172172  Void  getTopLeftSamplePos( Int iCuAddr, Int iAbsZorderIdx, Int& riX, Int& riY );
    173   Void  getCUAddrAndPartIdx( Int iX, Int iY, Int& riCuAddr, Int& riAbsZorderIdx );
    174173#endif
    175174#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComPrediction.cpp

    r1222 r1262  
    123123  m_cYuvPredTemp.destroy();
    124124
    125 #if H_3D_ARP
     125#if NH_3D_ARP
    126126  m_acYuvPredBase[0].destroy();
    127127  m_acYuvPredBase[1].destroy();
     
    182182
    183183    m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC );
    184 #if H_3D_ARP
    185     m_acYuvPredBase[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
    186     m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
     184#if NH_3D_ARP
     185    m_acYuvPredBase[0] .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC );
     186    m_acYuvPredBase[1] .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC );
    187187#endif
    188188#if H_3D_VSP
     
    648648      Int RefPOCL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getPOC();
    649649      Int RefPOCL1 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_1, pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr))->getPOC();
    650 #if H_3D_ARP
     650#if NH_3D_ARP
    651651      if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr))
    652652#else
     
    13891389  pcCU->checkMvVertRest(cMv, eRefPicList, iRefIdx );
    13901390#endif
    1391 #if H_3D_ARP
    1392   if(pcCU->getARPW( uiPartAddr ) > 0  && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC())
    1393   {
    1394     xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , bi );
     1391#if NH_3D_ARP
     1392  if(  pcCU->getARPW( uiPartAddr ) > 0 )
     1393  {
     1394    if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC() )
     1395    {
     1396      xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , pcYuvPred , bi );
     1397    }
     1398    else
     1399    {
     1400      xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, bi );
     1401    }     
    13951402  }
    13961403  else
    13971404  {
    1398     if(  pcCU->getARPW( uiPartAddr ) > 0
    1399       && pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N
    1400       && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC()
    1401       )
    1402     {
    1403       xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi );
    1404     }
    1405     else
    1406     {
    14071405#endif
    14081406#if H_3D_IC
    14091407      Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() );
    14101408      xPredInterLumaBlk  ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
    1411 #if H_3D_ARP
     1409#if NH_3D_ARP
    14121410        , false
    14131411#endif
     
    14151413      bICFlag = bICFlag && (iWidth > 8);
    14161414      xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
    1417 #if H_3D_ARP
     1415#if NH_3D_ARP
    14181416        , false
    14191417#endif
     
    14271425  }
    14281426#endif
    1429 #if H_3D_ARP
    1430     }
     1427#if NH_3D_ARP
    14311428  }
    14321429#endif
     
    14791476#endif
    14801477
    1481 #if H_3D_ARP
    1482 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled )
    1483 {
    1484   Int         iRefIdx      = pNewMvFiled ? pNewMvFiled->getRefIdx() : pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );           
    1485   TComMv      cMv          = pNewMvFiled ? pNewMvFiled->getMv()     : pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr );
     1478#if NH_3D_ARP
     1479//temporal ARP
     1480Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
     1481{
     1482  Int         iRefIdx      = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );           
     1483  TComMv      cMv          = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr );
    14861484  Bool        bTobeScaled  = false;
    14871485  TComPic* pcPicYuvBaseCol = NULL;
     
    14971495  UChar dW = pcCU->getARPW ( uiPartAddr );
    14981496
    1499   {
    1500     Int arpRefIdx = pcCU->getSlice()->getFirstTRefIdx(eRefPicList);
    1501     if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() )
     1497  Int arpRefIdx = pcCU->getSlice()->getFirstTRefIdx(eRefPicList);
     1498  if (arpRefIdx < 0 || !pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan))
     1499  {
     1500    dW = 0;
     1501    bTobeScaled = false;
     1502  }
     1503  else
     1504  {
     1505    if( arpRefIdx != iRefIdx )
    15021506    {
    15031507      bTobeScaled = true;
    15041508    }
    1505 
    15061509    pcPicYuvBaseCol =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(),                              cDistparity.m_aVIdxCan );
    1507 
    15081510    pcPicYuvBaseRef =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC(), cDistparity.m_aVIdxCan );
    1509 
    1510     if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan))
    1511     {
    1512       dW = 0;
    1513       bTobeScaled = false;
    1514     }
    1515     else
    1516     {
    1517       assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC() );
    1518     }
    1519 
    1520     if(bTobeScaled)
    1521     {     
    1522       Int iCurrPOC    = pcCU->getSlice()->getPOC();
    1523       Int iColRefPOC  = pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx );
    1524       Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList,  0);
    1525       Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iCurrPOC, iColRefPOC);
    1526       if ( iScale != 4096 )
    1527       {
    1528         cMv = cMv.scaleMv( iScale );
    1529       }
    1530       iRefIdx = 0;
    1531     }
     1511  } 
     1512  if(bTobeScaled)
     1513  {     
     1514    Int iCurrPOC    = pcCU->getSlice()->getPOC();
     1515    Int iColRefPOC  = pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx   );
     1516    Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, arpRefIdx );
     1517    Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iCurrPOC, iColRefPOC);
     1518    if ( iScale != 4096 )
     1519    {
     1520      cMv = cMv.scaleMv( iScale );
     1521    }
     1522    iRefIdx = arpRefIdx;
    15321523  }
    15331524
    15341525  pcCU->clipMv(cMv);
    15351526  TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec();
    1536   xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true );
    1537   xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true );
     1527
     1528  for (UInt comp=COMPONENT_Y; comp< rpcYuvPred->getNumberValidComponents(); comp++)
     1529  {
     1530    const ComponentID compID=ComponentID(comp);
     1531    xPredInterBlk  ( compID,  pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true );
     1532  }
    15381533
    15391534  if( dW > 0 )
     
    15511546    pcCU->clipMv( cNBDV );
    15521547   
    1553     pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec();
    1554     xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true );
    1555     if (iWidth > 8)
    1556       xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true );
    1557    
    1558     pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec();
    1559     xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true );
    1560  
    1561     if (iWidth > 8)
    1562       xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true );
    1563    
     1548    TComPicYuv* pcPicYuvBaseColRec = pcPicYuvBaseCol->getPicYuvRec();
     1549    TComPicYuv* pcPicYuvBaseRefRec = pcPicYuvBaseRef->getPicYuvRec();
     1550
     1551    UInt uiCompNum = ( iWidth > 8 ) ? 3: 1;
     1552    for (UInt comp=COMPONENT_Y; comp< uiCompNum; comp++)
     1553    {
     1554      const ComponentID compID=ComponentID(comp);
     1555      xPredInterBlk  ( compID,  pcCU, pcPicYuvBaseColRec, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true );
     1556      xPredInterBlk  ( compID,  pcCU, pcPicYuvBaseRefRec, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true );
     1557    }   
     1558
    15641559    pYuvB0->subtractARP( pYuvB0 , pYuvB1 , uiPartAddr , iWidth , iHeight );
    1565 
    15661560    if( 2 == dW )
    15671561    {
    15681562      pYuvB0->multiplyARP( uiPartAddr , iWidth , iHeight , dW );
    15691563    }
    1570     rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi );
    1571   }
    1572 }
    1573 
     1564    rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi, pcCU->getSlice()->getSPS()->getBitDepths() );
     1565  }
     1566}
    15741567Bool TComPrediction::xCheckBiInterviewARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc )
    15751568{
     
    15771570  TComMv      cDMv          = pcCU->getCUMvField( eBaseRefPicList )->getMv( uiPartAddr );
    15781571  TComPic* pcPicYuvBaseCol  = pcCU->getSlice()->getRefPic( eBaseRefPicList, iRefIdx ); 
    1579   TComPicYuv* pcYuvBaseCol  = pcPicYuvBaseCol->getPicYuvRec();
    1580   Int uiLCUAddr,uiAbsPartAddr;
    15811572  Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2  + ((cDMv.getHor() + 2)>>2);
    15821573  Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2);
     
    15841575  irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX);
    15851576  irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 
    1586   pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
    1587   TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr );
     1577
     1578  Int uiLCUAddr,uiAbsPartAddr;
     1579  pcPicYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
     1580  TComDataCU *pColCU = pcPicYuvBaseCol->getCtu( uiLCUAddr );
    15881581
    15891582  TComPic* pcPicYuvBaseTRef = NULL;
     
    16361629  return false;
    16371630}
    1638 
    1639 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled )
     1631//inter-view ARP
     1632Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
    16401633{
    16411634  Int         iRefIdx       = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );           
     
    16501643  Bool bTMVAvai = false;     
    16511644  TComMv cBaseTMV;
    1652   if( pNewMvFiled )
    1653   {
    1654     iRefIdx = pNewMvFiled->getRefIdx();
    1655     cDMv = pNewMvFiled->getMv();
    1656   }
     1645
    16571646  pcCU->clipMv(cTempDMv);
    16581647
    1659   assert(dW > 0);
    1660   if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, pcPicYuvBaseCol->getViewIndex()))
    1661   {
    1662     dW = 0;
    1663   }
    1664   Int uiLCUAddr,uiAbsPartAddr;
    16651648  Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2  + ((cDMv.getHor() + 2)>>2);
    16661649  Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2);
     
    16681651  irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX);
    16691652  irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 
    1670   pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
    1671   TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr );
     1653 
     1654  Int uiLCUAddr,uiAbsPartAddr;
     1655  pcPicYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
     1656  TComDataCU *pColCU = pcPicYuvBaseCol->getCtu( uiLCUAddr );
    16721657  if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() )
    16731658  {
     
    17141699      Int iCurrTRefPoc;
    17151700      bTMVAvai = ( eBaseList != eRefPicList ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() );
    1716 
    17171701      if ( bTMVAvai )
    17181702      {
    1719         if( xCheckBiInterviewARP( pcCU, uiPartAddr, iWidth, iHeight, eBaseList, pcPicYuvCurrTRef, cBaseTMV, iCurrTRefPoc ) )
     1703        if( xCheckBiInterviewARP( pcCU, uiPartAddr, iWidth, iHeight, eBaseList, pcPicYuvCurrTRef, cBaseTMV, iCurrTRefPoc ) ) 
    17201704        {
    17211705          pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic( iCurrTRefPoc,  pcPicYuvBaseCol->getViewIndex() );
     
    17401724      RefPicList eRefPicListCurr = RefPicList(iList);
    17411725      Int iRef = pColCU->getCUMvField(eRefPicListCurr)->getRefIdx(uiAbsPartAddr);
    1742       if( iRef != -1)
     1726      if( iRef != -1 && pcCU->getSlice()->getArpRefPicAvailable( eRefPicListCurr, pcPicYuvBaseCol->getViewIndex()))
    17431727      {
    17441728        pcPicYuvBaseTRef = pColCU->getSlice()->getRefPic(eRefPicListCurr, iRef); 
     
    17741758  }
    17751759
    1776   xPredInterLumaBlk  ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ),        bTMVAvai);
    1777   xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ),        bTMVAvai);
    1778 
    1779   if( dW > 0 && bTMVAvai )
    1780   {
     1760  for (UInt comp=COMPONENT_Y; comp< rpcYuvPred->getNumberValidComponents(); comp++)
     1761  {
     1762    const ComponentID compID=ComponentID(comp);
     1763    xPredInterBlk  ( compID,  pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), bTMVAvai );
     1764  }
     1765
     1766  if( dW > 0 )
     1767  {
     1768    assert ( bTMVAvai );
    17811769    TComYuv*    pYuvCurrTRef    = &m_acYuvPredBase[0];
    17821770    TComYuv*    pYuvBaseTRef    = &m_acYuvPredBase[1];
     
    17921780      pYuvCurrTRef->clear(); pYuvBaseTRef->clear();
    17931781    }
    1794     xPredInterLumaBlk  ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true,   true);
    1795 
    1796     if (iWidth > 8)
    1797       xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true,   true);
    1798 
    1799     xPredInterLumaBlk  ( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, true,   true);
    1800 
    1801     if (iWidth > 8)
    1802       xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, true,   true);
     1782
     1783    UInt uiCompNum = ( iWidth > 8 ) ? 3: 1;
     1784    for (UInt comp=COMPONENT_Y; comp< uiCompNum; comp++)
     1785    {
     1786      const ComponentID compID=ComponentID(comp);
     1787      xPredInterBlk  ( compID,  pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true );
     1788      xPredInterBlk  ( compID,  pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true );
     1789    }
    18031790
    18041791    pYuvCurrTRef->subtractARP( pYuvCurrTRef , pYuvBaseTRef , uiPartAddr , iWidth , iHeight ); 
     
    18071794      pYuvCurrTRef->multiplyARP( uiPartAddr , iWidth , iHeight , dW );
    18081795    }
    1809     rpcYuvPred->addARP( rpcYuvPred , pYuvCurrTRef , uiPartAddr , iWidth , iHeight , !bi );
     1796    rpcYuvPred->addARP( rpcYuvPred , pYuvCurrTRef , uiPartAddr , iWidth , iHeight , !bi, pcCU->getSlice()->getSPS()->getBitDepths() );
    18101797  }
    18111798}
     
    19071894
    19081895Void TComPrediction::xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi, const Int bitDepth
    1909 #if H_3D_ARP
     1896#if NH_3D_ARP
    19101897    , Bool filterType
    19111898#endif
     
    19511938    m_if.filterHor(compID, ref, refStride, dst,  dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth
    19521939#endif
    1953 #if H_3D_ARP
     1940#if NH_3D_ARP
    19541941    , filterType
    19551942#endif
    1956 );
     1943     );
    19571944  }
    19581945  else if ( xFrac == 0 )
     
    19631950    m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth
    19641951#endif
    1965 #if H_3D_ARP
     1952#if NH_3D_ARP
    19661953    , filterType
    19671954#endif
    1968 );
     1955    );
    19691956  }
    19701957  else
     
    19761963
    19771964    m_if.filterHor(compID, ref - ((vFilterSize>>1) -1)*refStride, refStride, tmp, tmpStride, cxWidth, cxHeight+vFilterSize-1, xFrac, false,      chFmt, bitDepth
    1978 #if H_3D_ARP
     1965#if N_3D_ARP
    19791966    , filterType
    19801967#endif
    1981 );
     1968    );
    19821969#if H_3D_IC
    19831970    m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height,              yFrac, false, !bi || bICFlag
     
    19851972    m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight,               yFrac, false, !bi, chFmt, bitDepth
    19861973#endif
    1987 #if H_3D_ARP
     1974#if NH_3D_ARP
    19881975    , filterType
    19891976#endif
    1990 );
     1977    );
    19911978  }
    19921979
     
    20282015}
    20292016
    2030 
    2031 #if H_3D_ARP
    2032     , Bool filterType
    2033 #endif
    20342017#if H_3D_IC
    20352018    , Bool bICFlag
     
    20392022#else
    20402023#endif
    2041 #if H_3D_ARP
    2042     , filterType
    2043 #endif
    20442024#if H_3D_IC
    20452025    m_if.filterHorChroma(refCr, refStride, dstCr,  dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag
    20462026#else
    20472027#endif
    2048 #if H_3D_ARP
    2049     , filterType
    2050 #endif
    20512028#if H_3D_IC
    20522029    m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag
    20532030#else
    20542031#endif
    2055 #if H_3D_ARP
    2056     , filterType
    2057 #endif
    20582032#if H_3D_IC
    20592033    m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag
    20602034#else
    2061 #endif
    2062 #if H_3D_ARP
    2063     , filterType
    2064 #endif
    2065 #if H_3D_ARP
    2066     , filterType
    2067 #endif 
     2035#endif
    20682036#if H_3D_IC
    20692037    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight  , yFrac, false, !bi || bICFlag
    20702038#else
    20712039#endif
    2072 #if H_3D_ARP
    2073     , filterType
    2074 #endif
    2075 #if H_3D_ARP
    2076     , filterType
    2077 #endif
    20782040#if H_3D_IC
    20792041    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight  , yFrac, false, !bi || bICFlag
    20802042#else
    20812043#endif
    2082 #if H_3D_ARP
    2083     , filterType
    2084 #endif
    20852044#if H_3D_IC
    20862045  if( bICFlag )
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComPrediction.h

    r1222 r1262  
    4444#include "TComInterpolationFilter.h"
    4545#include "TComWeightPrediction.h"
    46 
     46#if NH_3D_ARP
     47#include "TComPic.h"
     48#endif
    4749// forward declaration
    4850class TComMv;
     
    7779  TComYuv   m_acYuvPred[NUM_REF_PIC_LIST_01];
    7880  TComYuv   m_cYuvPredTemp;
    79 #if H_3D_ARP
     81#if NH_3D_ARP
    8082  TComYuv   m_acYuvPredBase[2];
    8183#endif
     
    100102
    101103  // motion compensation functions
    102 #if H_3D_ARP
    103   Void xPredInterUniARP         ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false, TComMvField * pNewMvFiled = NULL );
    104   Bool xCheckBiInterviewARP     ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc );
    105   Void xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled = NULL );
     104#if NH_3D_ARP
     105  Void xPredInterUniARP         ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi );
     106  Void xPredInterUniARPviewRef  ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi );
     107  Bool xCheckBiInterviewARP     ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc );
    106108#endif
    107109
     
    114116
    115117  Void xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi, const Int bitDepth
    116 #if H_3D_ARP
     118#if NH_3D_ARP
    117119    , Bool filterType = false
    118120#endif
     
    122124 );
    123125
    124 #if H_3D_ARP
    125     , Bool filterType = false
    126 #endif
     126
    127127#if H_3D_IC
    128128    , Bool bICFlag    = false
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComSlice.cpp

    r1246 r1262  
    19961996      m_dimensionId[i][j] = 0;
    19971997    }
    1998 #if H_3D_ARP
     1998#if NH_3D_ARP
    19991999#endif
    20002000  } 
     
    36213621#endif
    36223622
    3623 #if H_3D_ARP
     3623#if NH_3D_ARP
    36243624Void TComSlice::setARPStepNum( TComPicLists*ivPicLists )
    36253625{
     
    36883688          m_arpRefPicAvailable[eRefPicList][layerIdInNuh] = false;
    36893689        }
     3690      }
     3691    }
     3692  }
     3693  if( m_nARPStepNum > 1)
     3694  {
     3695    for(Int i = 0; i < getNumActiveRefLayerPics(); i ++ )
     3696    {
     3697      Int  iLayerId = getRefPicLayerId( i );
     3698      Int  iViewIdx =   getVPS()->getViewIndex(iLayerId);
     3699      Bool bIsDepth = ( getVPS()->getDepthId  ( iLayerId ) == 1 );
     3700      if( iViewIdx<getViewIndex() && !bIsDepth )
     3701      {
     3702        setBaseViewRefPicList( ivPicLists->getPicList( iLayerId ), iViewIdx );
    36903703      }
    36913704    }
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComSlice.h

    r1210 r1262  
    25942594  Int        m_aiAlterRefIdx   [2];
    25952595#endif
    2596 #if H_3D_ARP
     2596#if NH_3D_ARP
    25972597  Bool       m_arpRefPicAvailable[2][MAX_NUM_LAYERS];
    25982598  TComList<TComPic*> * m_pBaseViewRefPicList[MAX_NUM_LAYERS];
     
    27182718  Bool                        getIcSkipParseFlag()                                   { return m_icSkipParseFlag;                                     }
    27192719#endif                                                                                                                                               
    2720 #if H_3D_ARP                                                                                                                                         
     2720#if NH_3D_ARP                                                                                                                                         
    27212721  Void                        setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx )      { m_pBaseViewRefPicList[iViewIdx] = pListPic; }                 
    27222722  Void                        setARPStepNum( TComPicLists*ivPicLists );                                                                             
     
    29252925  Int                         getAlterRefIdx          ( RefPicList e )               { return  m_aiAlterRefIdx[e];                                   }
    29262926#endif                                                                                                                                               
    2927 #if H_3D_ARP                                                                                                                                         
     2927#if NH_3D_ARP                                                                                                                                         
    29282928  Int                         getFirstTRefIdx        ( RefPicList e )                { return  m_aiFirstTRefIdx[e];                                  }
    29292929  Void                        setFirstTRefIdx        ( RefPicList e, Int i )         { m_aiFirstTRefIdx[e]    = i;                                   }
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComYuv.cpp

    r1200 r1262  
    487487}
    488488
    489 #if H_3D_ARP
    490 Void TComYuv::addARP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip )
    491 {
    492   addARPLuma   ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth   , uiHeight    , bClip );
    493   addARPChroma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1, uiHeight>>1 , bClip );
    494 }
    495 
    496 Void TComYuv::addARPLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip )
     489#if NH_3D_ARP
     490Void TComYuv::addARP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip, const BitDepths &clipBitDepths )
     491{
     492  addARPLuma   ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth   , uiHeight    , bClip , clipBitDepths);
     493  addARPChroma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1, uiHeight>>1 , bClip , clipBitDepths);
     494}
     495
     496Void TComYuv::addARPLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip, const BitDepths &clipBitDepths )
    497497{
    498498  Int x, y;
    499499
    500   Pel* pSrc0 = pcYuvSrc0->getLumaAddr( uiAbsPartIdx );
    501   Pel* pSrc1 = pcYuvSrc1->getLumaAddr( uiAbsPartIdx );
    502   Pel* pDst  = getLumaAddr( uiAbsPartIdx );
    503 
    504   UInt iSrc0Stride = pcYuvSrc0->getStride();
    505   UInt iSrc1Stride = pcYuvSrc1->getStride();
    506   UInt iDstStride  = getStride();
    507   Int iIFshift = IF_INTERNAL_PREC - g_bitDepthY;
     500  Pel* pSrc0 = pcYuvSrc0->getAddr( COMPONENT_Y, uiAbsPartIdx );
     501  Pel* pSrc1 = pcYuvSrc1->getAddr( COMPONENT_Y, uiAbsPartIdx );
     502  Pel* pDst  = getAddr( COMPONENT_Y, uiAbsPartIdx );
     503
     504  UInt iSrc0Stride = pcYuvSrc0->getStride(COMPONENT_Y);
     505  UInt iSrc1Stride = pcYuvSrc1->getStride(COMPONENT_Y);
     506  UInt iDstStride  = getStride(COMPONENT_Y);
     507  const Int clipbd = clipBitDepths.recon[CHANNEL_TYPE_LUMA];
     508  Int iIFshift = IF_INTERNAL_PREC - clipbd;
    508509  Int iOffSet  = ( 1 << ( iIFshift - 1 ) ) + IF_INTERNAL_OFFS;
     510
    509511  for ( y = uiHeight-1; y >= 0; y-- )
    510512  {
     
    514516      if( bClip )
    515517      {
    516         pDst[x] = ClipY( ( pDst[x] + iOffSet ) >> iIFshift );
     518        pDst[x] = Pel(ClipBD<Int>(Int( ( pDst[x] + iOffSet ) >> iIFshift ), clipbd));
    517519      }
    518520    }
     
    523525}
    524526
    525 Void TComYuv::addARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip )
     527Void TComYuv::addARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool bClip, const BitDepths &clipBitDepths )
    526528{
    527529  Int x, y;
    528530
    529   Pel* pSrcU0 = pcYuvSrc0->getCbAddr( uiAbsPartIdx );
    530   Pel* pSrcU1 = pcYuvSrc1->getCbAddr( uiAbsPartIdx );
    531   Pel* pSrcV0 = pcYuvSrc0->getCrAddr( uiAbsPartIdx );
    532   Pel* pSrcV1 = pcYuvSrc1->getCrAddr( uiAbsPartIdx );
    533   Pel* pDstU = getCbAddr( uiAbsPartIdx );
    534   Pel* pDstV = getCrAddr( uiAbsPartIdx );
    535 
    536   UInt  iSrc0Stride = pcYuvSrc0->getCStride();
    537   UInt  iSrc1Stride = pcYuvSrc1->getCStride();
    538   UInt  iDstStride  = getCStride();
    539 
    540   Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC;
     531  Pel* pSrcU0 = pcYuvSrc0->getAddr( COMPONENT_Cb, uiAbsPartIdx );
     532  Pel* pSrcU1 = pcYuvSrc1->getAddr( COMPONENT_Cb, uiAbsPartIdx );
     533  Pel* pSrcV0 = pcYuvSrc0->getAddr( COMPONENT_Cr, uiAbsPartIdx );
     534  Pel* pSrcV1 = pcYuvSrc1->getAddr( COMPONENT_Cr, uiAbsPartIdx );
     535  Pel* pDstU = getAddr( COMPONENT_Cb, uiAbsPartIdx );
     536  Pel* pDstV = getAddr( COMPONENT_Cr, uiAbsPartIdx );
     537
     538  UInt  iSrc0StrideCb = pcYuvSrc0->getStride(COMPONENT_Cb);
     539  UInt  iSrc1StrideCb = pcYuvSrc1->getStride(COMPONENT_Cb);
     540  UInt  iDstStrideCb  = getStride(COMPONENT_Cb);
     541
     542  UInt  iSrc0StrideCr = pcYuvSrc0->getStride(COMPONENT_Cr);
     543  UInt  iSrc1StrideCr = pcYuvSrc1->getStride(COMPONENT_Cr);
     544  UInt  iDstStrideCr  = getStride(COMPONENT_Cr);
     545
     546  const Int clipbd = clipBitDepths.recon[CHANNEL_TYPE_CHROMA];
     547  Int iIFshift = IF_INTERNAL_PREC - clipbd;
    541548  Int iOffSet  = ( 1 << ( iIFshift - 1 ) ) + IF_INTERNAL_OFFS;
    542549
     
    549556      if( bClip )
    550557      {
    551         pDstU[x] = ClipC( ( pDstU[x] + iOffSet ) >> iIFshift );
    552         pDstV[x] = ClipC( ( pDstV[x] + iOffSet ) >> iIFshift );
    553       }
    554     }
    555 
     558        pDstU[x] = Pel(ClipBD<Int>( Int( ( pDstU[x] + iOffSet ) >> iIFshift ), clipbd));
     559        pDstV[x] = Pel(ClipBD<Int>( Int( ( pDstV[x] + iOffSet ) >> iIFshift ), clipbd));
     560      }
     561    }
     562
     563    pSrcU0 += iSrc0StrideCb;
     564    pSrcU1 += iSrc1StrideCb;
     565    pSrcV0 += iSrc0StrideCr;
     566    pSrcV1 += iSrc1StrideCr;
     567    pDstU  += iDstStrideCb;
     568    pDstV  += iDstStrideCr;
     569  }
     570}
     571
     572Void TComYuv::subtractARP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight )
     573{
     574  subtractARPLuma  ( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth    , uiHeight    );
     575
     576  if (uiWidth > 8 && pcYuvSrc1->getNumberValidComponents() > 1)
     577  {
     578    subtractARPChroma( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth>>1 , uiHeight>>1 );
     579  }
     580}
     581
     582Void TComYuv::subtractARPLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight )
     583{
     584  Int x, y;
     585
     586  Pel* pSrc0 = pcYuvSrc0->getAddr(COMPONENT_Y, uiAbsPartIdx );
     587  Pel* pSrc1 = pcYuvSrc1->getAddr(COMPONENT_Y, uiAbsPartIdx );
     588  Pel* pDst  = getAddr           (COMPONENT_Y, uiAbsPartIdx );
     589
     590  Int  iSrc0Stride = pcYuvSrc0->getStride(COMPONENT_Y);
     591  Int  iSrc1Stride = pcYuvSrc1->getStride(COMPONENT_Y);
     592  Int  iDstStride  = getStride(COMPONENT_Y);
     593  for ( y = uiHeight-1; y >= 0; y-- )
     594  {
     595    for ( x = uiWidth-1; x >= 0; x-- )
     596    {
     597      pDst[x] = pSrc0[x] - pSrc1[x];
     598    }
     599    pSrc0 += iSrc0Stride;
     600    pSrc1 += iSrc1Stride;
     601    pDst  += iDstStride;
     602  }
     603}
     604
     605Void TComYuv::subtractARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight )
     606{
     607  Int x, y;
     608
     609  Pel* pSrcU0 = pcYuvSrc0->getAddr(COMPONENT_Cb, uiAbsPartIdx );
     610  Pel* pSrcU1 = pcYuvSrc1->getAddr(COMPONENT_Cb, uiAbsPartIdx );
     611  Pel* pSrcV0 = pcYuvSrc0->getAddr(COMPONENT_Cr, uiAbsPartIdx );
     612  Pel* pSrcV1 = pcYuvSrc1->getAddr(COMPONENT_Cr, uiAbsPartIdx );
     613  Pel* pDstU  = getAddr(COMPONENT_Cb, uiAbsPartIdx );
     614  Pel* pDstV  = getAddr(COMPONENT_Cr, uiAbsPartIdx );
     615
     616  Int  iSrc0Stride = pcYuvSrc0->getStride(COMPONENT_Cb);
     617  Int  iSrc1Stride = pcYuvSrc1->getStride(COMPONENT_Cb);
     618  Int  iDstStride  = getStride( COMPONENT_Cb );
     619  for ( y = uiHeight-1; y >= 0; y-- )
     620  {
     621    for ( x = uiWidth-1; x >= 0; x-- )
     622    {
     623      pDstU[x] = pSrcU0[x] - pSrcU1[x];
     624      pDstV[x] = pSrcV0[x] - pSrcV1[x];
     625    }
    556626    pSrcU0 += iSrc0Stride;
    557627    pSrcU1 += iSrc1Stride;
     
    563633}
    564634
    565 Void TComYuv::subtractARP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight )
    566 {
    567   subtractARPLuma  ( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth    , uiHeight    );
    568 
    569   if (uiWidth > 8)
    570     subtractARPChroma( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth>>1 , uiHeight>>1 );
    571 }
    572 
    573 Void TComYuv::subtractARPLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight )
    574 {
    575   Int x, y;
    576 
    577   Pel* pSrc0 = pcYuvSrc0->getLumaAddr( uiAbsPartIdx );
    578   Pel* pSrc1 = pcYuvSrc1->getLumaAddr( uiAbsPartIdx );
    579   Pel* pDst  = getLumaAddr( uiAbsPartIdx );
    580 
    581   Int  iSrc0Stride = pcYuvSrc0->getStride();
    582   Int  iSrc1Stride = pcYuvSrc1->getStride();
    583   Int  iDstStride  = getStride();
    584   for ( y = uiHeight-1; y >= 0; y-- )
    585   {
    586     for ( x = uiWidth-1; x >= 0; x-- )
    587     {
    588       pDst[x] = pSrc0[x] - pSrc1[x];
    589     }
    590     pSrc0 += iSrc0Stride;
    591     pSrc1 += iSrc1Stride;
    592     pDst  += iDstStride;
    593   }
    594 }
    595 
    596 Void TComYuv::subtractARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight )
    597 {
    598   Int x, y;
    599 
    600   Pel* pSrcU0 = pcYuvSrc0->getCbAddr( uiAbsPartIdx );
    601   Pel* pSrcU1 = pcYuvSrc1->getCbAddr( uiAbsPartIdx );
    602   Pel* pSrcV0 = pcYuvSrc0->getCrAddr( uiAbsPartIdx );
    603   Pel* pSrcV1 = pcYuvSrc1->getCrAddr( uiAbsPartIdx );
    604   Pel* pDstU  = getCbAddr( uiAbsPartIdx );
    605   Pel* pDstV  = getCrAddr( uiAbsPartIdx );
    606 
    607   Int  iSrc0Stride = pcYuvSrc0->getCStride();
    608   Int  iSrc1Stride = pcYuvSrc1->getCStride();
    609   Int  iDstStride  = getCStride();
    610   for ( y = uiHeight-1; y >= 0; y-- )
    611   {
    612     for ( x = uiWidth-1; x >= 0; x-- )
    613     {
    614       pDstU[x] = pSrcU0[x] - pSrcU1[x];
    615       pDstV[x] = pSrcV0[x] - pSrcV1[x];
    616     }
    617     pSrcU0 += iSrc0Stride;
    618     pSrcU1 += iSrc1Stride;
    619     pSrcV0 += iSrc0Stride;
    620     pSrcV1 += iSrc1Stride;
    621     pDstU  += iDstStride;
    622     pDstV  += iDstStride;
    623   }
    624 }
    625 
    626635Void TComYuv::multiplyARP( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW )
    627636{
    628637  multiplyARPLuma( uiAbsPartIdx , uiWidth , uiHeight , dW );
    629638
    630   if (uiWidth > 8)
     639  if ( uiWidth > 8 && getNumberValidComponents() > 1 )
     640  {
    631641    multiplyARPChroma( uiAbsPartIdx , uiWidth >> 1 , uiHeight >> 1 , dW );
     642  }
    632643}
    633644
     
    641652Void TComYuv::multiplyARPLuma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW )
    642653{
    643   Pel* pDst  = getLumaAddr( uiAbsPartIdx );
    644   Int  iDstStride  = getStride();
     654  Pel* pDst  = getAddr(COMPONENT_Y, uiAbsPartIdx );
     655  Int  iDstStride  = getStride(COMPONENT_Y);
    645656  for ( Int y = uiHeight-1; y >= 0; y-- )
    646657  {
     
    652663Void TComYuv::multiplyARPChroma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW )
    653664{
    654   Pel* pDstU  = getCbAddr( uiAbsPartIdx );
    655   Pel* pDstV  = getCrAddr( uiAbsPartIdx );
    656 
    657   Int  iDstStride  = getCStride();
     665  Pel* pDstU  = getAddr( COMPONENT_Cb, uiAbsPartIdx );
     666  Pel* pDstV  = getAddr( COMPONENT_Cr, uiAbsPartIdx );
     667
     668  Int  iDstStride  = getStride( COMPONENT_Cb );
    658669  for ( Int y = uiHeight-1; y >= 0; y-- )
    659670  {
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TComYuv.h

    r1200 r1262  
    206206#if NH_3D
    207207  Void         addClipPartLuma( Int bitDepth, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
    208 #if H_3D_ARP
    209   Void         addARP                     ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip );
    210   Void         addARPLuma                 ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip );
    211   Void         addARPChroma               ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip );
     208#if NH_3D_ARP
     209  Void         addARP                     ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip, const BitDepths &clipBitDepths );
     210  Void         addARPLuma                 ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip, const BitDepths &clipBitDepths );
     211  Void         addARPChroma               ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip, const BitDepths &clipBitDepths );
    212212  Void         subtractARP                ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight );
    213213  Void         subtractARPLuma            ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight );
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibCommon/TypeDef.h

    r1222 r1262  
    7373
    7474#define NH_3D_DBBP                         1
     75#define TEST 0
     76#define BUF_FIX 1
     77#define NH_3D_ARP                         1  // Advanced residual prediction (ARP), JCT3V-D0177
     78                                              // QC_MTK_INTERVIEW_ARP_F0123_F0108 JCT3V-F0123; JCT3V-F0108
     79                                              // SHARP_ARP_REF_CHECK_F0105        ARP reference picture selection and DPB check
     80                                              // LGE_ARP_CTX_F0161                JCT3V-F0161
     81                                              // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061
     82                                              // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053
     83                                              // 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
     84                                              // QC_I0051_ARP_SIMP         
     85                                              // SHARP_ARP_CHROMA_I0104     
     86                                              // MTK_I0072_IVARP_SCALING_FIX
     87                                              // 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
     88                                              // SEC_ARP_REM_ENC_RESTRICT_K0035    Removal of encoder restriction of ARP, JCT3V-K0035
    7589#endif
    7690
     
    101115                                              // MTK_TEXTURE_MRGCAND_BUGFIX_E0182  Bug fix for TEXTURE MERGING CANDIDATE     , JCT3V-E0182
    102116                                              // LGE_SIMP_DISP_AVAIL_J0041    // Use 2 status for disparity availability - DISP_AVAILABLE and DISP_NONE
    103 #define H_3D_ARP                          1   // Advanced residual prediction (ARP), JCT3V-D0177
    104                                               // QC_MTK_INTERVIEW_ARP_F0123_F0108 JCT3V-F0123; JCT3V-F0108
    105                                               // SHARP_ARP_REF_CHECK_F0105        ARP reference picture selection and DPB check
    106                                               // LGE_ARP_CTX_F0161                JCT3V-F0161
    107                                               // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061
    108                                               // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053
    109                                               // 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
    110                                               // QC_I0051_ARP_SIMP         
    111                                               // SHARP_ARP_CHROMA_I0104     
    112                                               // MTK_I0072_IVARP_SCALING_FIX
    113                                               // 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
    114                                               // SEC_ARP_REM_ENC_RESTRICT_K0035    Removal of encoder restriction of ARP, JCT3V-K0035
    115117#define H_3D_IC                           1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
    116118                                              // Unifying rounding offset, for IC part, JCT3V-D0135
     
    297299#endif
    298300///// ***** ADVANCED INTERVIEW RESIDUAL PREDICTION *********
    299 #if H_3D_ARP
     301#if NH_3D_ARP
    300302#define H_3D_ARP_WFNR                     3
    301303#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1246 r1262  
    33763376}
    33773377
    3378 #if H_3D_ARP
     3378#if NH_3D_ARP
    33793379Void TDecCavlc::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    33803380{
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.h

    r1222 r1262  
    117117  Void parseMergeFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
    118118  Void parseMergeIndex      ( TComDataCU* pcCU, UInt& ruiMergeIndex );
    119 #if H_3D_ARP
     119#if NH_3D_ARP
    120120  Void parseARPW            ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    121121#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibDecoder/TDecCu.cpp

    r1246 r1262  
    293293if(!pcCU->getSlice()->isIntra())
    294294  {
    295 #if H_3D_ARP && H_3D_IV_MERGE
     295#if NH_3D_ARP && H_3D_IV_MERGE
    296296    if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getIvMvPredFlag() )
    297297#else
    298 #if H_3D_ARP
    299     if( pcCU->getSlice()->getVPS()->getUseAdvRP(pcCU->getSlice()->getLayerId()) )
     298#if NH_3D_ARP
     299    if( pcCU->getSlice()->getIvResPredFlag( ) )
    300300#else
    301301#if H_3D_IV_MERGE
     
    399399    m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth );
    400400    UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
    401 #if H_3D_ARP
     401#if NH_3D_ARP
    402402    m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );
    403403#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.cpp

    r1246 r1262  
    105105}
    106106
    107 #if H_3D_ARP
     107#if NH_3D_ARP
    108108Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    109109{
     
    297297  //decodeSDCFlag ( pcCU, uiAbsPartIdx, uiDepth );
    298298
    299 #if H_3D_ARP
     299#if NH_3D_ARP
    300300  decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
    301301#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.h

    r1246 r1262  
    8585  virtual Void parseMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0;
    8686  virtual Void parseMergeIndex    ( TComDataCU* pcCU, UInt& ruiMergeIndex ) = 0;
    87 #if H_3D_ARP
     87#if NH_3D_ARP
    8888  virtual Void parseARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    8989#endif
     
    174174  Void decodePartSize          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    175175
    176 #if H_3D_ARP
     176#if NH_3D_ARP
    177177  Void decodeARPW              ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    178178#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp

    r1246 r1262  
    7373, m_cCUMergeFlagExtSCModel                   ( 1,             1,                      NUM_MERGE_FLAG_EXT_CTX               , m_contextModels + m_numContextModels, m_numContextModels)
    7474, m_cCUMergeIdxExtSCModel                    ( 1,             1,                      NUM_MERGE_IDX_EXT_CTX                , m_contextModels + m_numContextModels, m_numContextModels)
    75 #if H_3D_ARP
    76 , m_cCUPUARPWSCModel          ( 1,             1,               NUM_ARPW_CTX                  , m_contextModels + m_numContextModels, m_numContextModels)
     75#if NH_3D_ARP
     76, m_cCUPUARPWSCModel                         ( 1,             1,                             NUM_ARPW_CTX                  , m_contextModels + m_numContextModels, m_numContextModels)
    7777#endif
    7878#if H_3D_IC
     
    164164  m_cCUMergeFlagExtSCModel.initBuffer             ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT );
    165165  m_cCUMergeIdxExtSCModel.initBuffer              ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT );
    166 #if H_3D_ARP
    167   m_cCUPUARPWSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_ARPW );
     166#if NH_3D_ARP
     167  m_cCUPUARPWSCModel.initBuffer                   ( sliceType, qp, (UChar*)INIT_ARPW );
    168168#endif
    169169#if H_3D_IC
     
    240240  m_cCUDISFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_FLAG );
    241241  m_cCUDISTypeSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE );
    242 #endif
    243 #if H_3D_ARP
    244   m_cCUPUARPWSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_ARPW );
    245242#endif
    246243#if H_3D_IC
     
    24172414}
    24182415
    2419 #if H_3D_ARP
     2416#if NH_3D_ARP
    24202417Void TDecSbac::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    24212418{
    2422   UInt uiMaxW = pcCU->getSlice()->getARPStepNum() - 1;
    24232419  UInt uiW = 0;
    24242420  UInt uiOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx);
    24252421  UInt uiCode = 0;
    24262422
    2427   assert ( uiMaxW > 0 );
    2428 
    2429   m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 0 + uiOffset ) );
     2423  m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 0 + uiOffset ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__ARP_FLAG));
    24302424
    24312425  uiW = uiCode;
    24322426  if( 1 == uiW )   
    24332427  {
    2434     m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 2 ) );
     2428    m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 2 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__ARP_FLAG));
    24352429    uiW += ( 1 == uiCode ? 1 : 0 );
    24362430  }
     
    24382432  DTRACE_CU("iv_res_pred_weight_idx", uiW )
    24392433#endif
     2434 
    24402435  pcCU->setARPWSubParts( ( UChar )( uiW ) , uiAbsPartIdx, uiDepth ); 
    24412436}
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h

    r1222 r1262  
    139139  Void parseMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
    140140  Void parseMergeIndex    ( TComDataCU* pcCU, UInt& ruiMergeIndex );
    141 #if H_3D_ARP
     141#if NH_3D_ARP
    142142  Void parseARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    143143#endif
     
    190190  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
    191191  ContextModel3DBuffer m_cCUMergeIdxExtSCModel;
    192 #if H_3D_ARP
     192#if NH_3D_ARP
    193193  ContextModel3DBuffer m_cCUPUARPWSCModel;
    194194#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibDecoder/TDecTop.cpp

    r1210 r1262  
    11451145    pcSlice->setDefaultRefView();
    11461146#endif
    1147 #if H_3D_ARP
     1147#if NH_3D_ARP
    11481148    pcSlice->setARPStepNum(m_ivPicLists);
    1149     if( pcSlice->getARPStepNum() > 1 )
    1150     {
    1151       // GT: This seems to be broken, not all nuh_layer_ids are necessarily present
    1152       for(Int iLayerId = 0; iLayerId < nalu.m_nuhLayerId; iLayerId ++ )
    1153       {
    1154         Int  iViewIdx =   pcSlice->getVPS()->getViewIndex(iLayerId);
    1155         Bool bIsDepth = ( pcSlice->getVPS()->getDepthId  ( iLayerId ) == 1 );
    1156         if( iViewIdx<getViewIndex() && !bIsDepth )
    1157         {
    1158           pcSlice->setBaseViewRefPicList( m_ivPicLists->getPicList( iLayerId ), iViewIdx );
    1159         }
    1160       }
    1161     }
    11621149#endif
    11631150#else
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1222 r1262  
    25782578}
    25792579
    2580 #if H_3D_ARP
     2580#if NH_3D_ARP
    25812581Void TEncCavlc::codeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx )
    25822582{
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.h

    r1222 r1262  
    126126  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    127127  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    128 #if H_3D_ARP
     128#if NH_3D_ARP
    129129  Void codeARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    130130#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibEncoder/TEncCu.cpp

    r1246 r1262  
    6868  m_ppcTempCU      = new TComDataCU*[m_uhTotalDepth-1];
    6969
    70 #if H_3D_ARP
     70#if NH_3D_ARP
    7171  m_ppcWeightedTempCU = new TComDataCU*[m_uhTotalDepth-1];
    7272#endif
     
    9292    m_ppcBestCU[i] = new TComDataCU; m_ppcBestCU[i]->create( chromaFormat, uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) );
    9393    m_ppcTempCU[i] = new TComDataCU; m_ppcTempCU[i]->create( chromaFormat, uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) );
    94 #if H_3D_ARP
    95     m_ppcWeightedTempCU[i] = new TComDataCU; m_ppcWeightedTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) );
     94#if NH_3D_ARP
     95    m_ppcWeightedTempCU[i] = new TComDataCU; m_ppcWeightedTempCU[i]->create( chromaFormat, uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) );
    9696#endif 
    9797
     
    146146      m_ppcTempCU[i]->destroy();      delete m_ppcTempCU[i];      m_ppcTempCU[i] = NULL;
    147147    }
    148 #if H_3D_ARP
     148#if NH_3D_ARP
    149149    if(m_ppcWeightedTempCU[i])
    150150    {
     
    198198  }
    199199
    200 #if H_3D_ARP
     200#if NH_3D_ARP
    201201  if(m_ppcWeightedTempCU)
    202202  {
     
    279279  m_ppcBestCU[0]->initCtu( pCtu->getPic(), pCtu->getCtuRsAddr() );
    280280  m_ppcTempCU[0]->initCtu( pCtu->getPic(), pCtu->getCtuRsAddr() );
     281
     282#if NH_3D_ARP
     283  m_ppcWeightedTempCU[0]->initCtu( pCtu->getPic(), pCtu->getCtuRsAddr() );
     284#endif
    281285
    282286#if KWU_RC_MADPRED_E0227
     
    587591      if( rpcTempCU->getSlice()->getSliceType() != I_SLICE )
    588592      {
    589 #if H_3D_ARP && H_3D_IV_MERGE
     593#if NH_3D_ARP && H_3D_IV_MERGE
    590594        if( rpcTempCU->getSlice()->getIvResPredFlag() || rpcTempCU->getSlice()->getIvMvPredFlag() )
    591595#else
    592 #if H_3D_ARP
    593         if( rpcTempCU->getSlice()->getVPS()->getUseAdvRP(rpcTempCU->getSlice()->getLayerId()) )
     596#if NH_3D_ARP
     597        if( rpcTempCU->getSlice()->getIvResPredFlag() )
    594598#else
    595599#if H_3D_IV_MERGE
     
    12721276      TComDataCU* pcSubTempPartCU     = m_ppcTempCU[uhNextDepth];
    12731277      DEBUG_STRING_NEW(sTempDebug)
    1274 
     1278#if NH_3D_ARP
     1279      m_ppcWeightedTempCU[uhNextDepth]->setSlice( m_ppcWeightedTempCU[ uiDepth]->getSlice());
     1280      m_ppcWeightedTempCU[uhNextDepth]->setPic  ( m_ppcWeightedTempCU[ uiDepth] );
     1281#endif
    12751282      for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ )
    12761283      {
     
    15781585
    15791586    m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx );
    1580 #if H_3D_ARP
     1587#if NH_3D_ARP
    15811588    m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
    15821589#endif
     
    16211628  m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
    16221629#endif 
    1623 #if H_3D_ARP
     1630#if NH_3D_ARP
    16241631  m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
    16251632#endif
     
    17951802#endif
    17961803
    1797 #if H_3D_ARP
     1804#if NH_3D_ARP
    17981805  DisInfo cOrigDisInfo = rpcTempCU->getDvInfo(0);
    17991806#else
     
    18021809  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to CTU level
    18031810#if H_3D_VSP
    1804 #if !H_3D_ARP
     1811#if !NH_3D_ARP
    18051812  Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    18061813  memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     
    18321839  Int mergeCandBuffer[MRG_MAX_NUM_CANDS];
    18331840#endif
    1834 #if H_3D_ARP
    1835 for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )
    1836 #else
     1841
    18371842  for( UInt ui = 0; ui < numValidMergeCand; ++ui )
    1838 #endif
    1839 
    18401843  {
    18411844    mergeCandBuffer[ui] = 0;
     
    18551858  DEBUG_STRING_NEW(bestStr)
    18561859
    1857 #if H_3D_ARP
     1860#if NH_3D_ARP
    18581861  Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1;
     1862#if H_3D_IC
    18591863  if( nARPWMax < 0 || bICFlag )
     1864#else
     1865  if( nARPWMax < 0 )
     1866#endif
    18601867  {
    18611868    nARPWMax = 0;
    18621869  }
    1863   for( Int nARPW=nARPWMax; nARPW >= 0 ; nARPW-- )
    1864   {
    1865     memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS_MEM*sizeof(Int) );
    1866     rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
    1867     rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
     1870  for( Int nARPW = nARPWMax; nARPW >= 0 ; nARPW-- )
     1871  {
     1872#if NH_3D_IV_MERGE
     1873    memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS_MEM * sizeof(Int) );   
     1874#else
     1875    memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS * sizeof(Int) );
     1876#endif
     1877    rpcTempCU->setPartSizeSubParts(   SIZE_2Nx2N , 0 , uhDepth ); // interprets depth relative to LCU level
     1878    rpcTempCU->setARPWSubParts    ( (UChar)nARPW , 0 , uhDepth );
    18681879#if H_3D_IC
    18691880    rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth );
    18701881#endif
    18711882    rpcTempCU->getDvInfo(0) = cOrigDisInfo;
    1872     rpcTempCU->setDvInfoSubParts(cOrigDisInfo, 0, 0, uhDepth );
     1883    rpcTempCU->setDvInfoSubParts(cOrigDisInfo, 0, uhDepth );
    18731884    Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    18741885    memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     
    18971908      , numValidMergeCand
    18981909      );
    1899 
    1900 #else
    1901     rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, numValidMergeCand );
     1910#else
     1911    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    19021912#endif
    19031913
     
    19291939          rpcTempCU->setICFlagSubParts( bICFlag, 0, 0, uhDepth );
    19301940#endif
    1931 #if H_3D_ARP
    1932           rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
    1933 #endif
    19341941          rpcTempCU->setCUTransquantBypassSubParts( bTransquantBypassFlag, 0, uhDepth );
    19351942          rpcTempCU->setChromaQpAdjSubParts( bTransquantBypassFlag ? 0 : m_cuChromaQpOffsetIdxPlus1, 0, uhDepth );
     
    19371944          rpcTempCU->setMergeFlagSubParts( true, 0, 0, uhDepth ); // interprets depth relative to CTU level
    19381945          rpcTempCU->setMergeIndexSubParts( uiMergeCand, 0, 0, uhDepth ); // interprets depth relative to CTU level
     1946#if NH_3D_ARP
     1947          rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
     1948#endif
    19391949#if H_3D_VSP
    19401950          rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth );
     
    21122122
    21132123          rpcTempCU->initEstData( uhDepth, orgQP, bTransquantBypassFlag );
    2114 
    21152124          if( m_pcEncCfg->getUseFastDecisionForMerge() && !bestIsSkip )
    21162125          {
     
    21672176 delete[] puhInterDirSP;
    21682177#endif
    2169 #if H_3D_ARP
     2178#if NH_3D_ARP
    21702179 }
    21712180#endif
     
    21872196
    21882197  // prior to this, rpcTempCU will have just been reset using rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    2189 #if H_3D
     2198#if H_3D || NH_3D_ARP
    21902199  const Bool bTransquantBypassFlag = rpcTempCU->getCUTransquantBypass(0);
    21912200#endif
     
    21952204#endif
    21962205  UChar uhDepth = rpcTempCU->getDepth( 0 );
    2197 #if H_3D_ARP
     2206#if NH_3D_ARP
    21982207    Bool bFirstTime = true;
    21992208    Int nARPWMax    = rpcTempCU->getSlice()->getARPStepNum() - 1;
     2209#if H_3D_IC
    22002210    if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || rpcTempCU->getICFlag(0) )
     2211#else
     2212    if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N )
     2213#endif
    22012214    {
    22022215      nARPWMax = 0;
     
    22262239  rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
    22272240  rpcTempCU->setChromaQpAdjSubParts( rpcTempCU->getCUTransquantBypass(0) ? 0 : m_cuChromaQpOffsetIdxPlus1, 0, uhDepth );
    2228 #if H_3D_ARP
    2229       rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
    2230 #endif
    2231 #if H_3D_ARP
    2232       if( bFirstTime == false && nARPWMax )
    2233       {
    2234         rpcTempCU->copyPartFrom( m_ppcWeightedTempCU[uhDepth] , 0 , uhDepth );
    2235         rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
    2236 
    2237         m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] );
    2238       }
    2239       else
    2240       {
    2241         bFirstTime = false;
     2241#if NH_3D_ARP
     2242  rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
     2243#endif
     2244#if NH_3D_ARP
     2245  if( bFirstTime == false && nARPWMax )
     2246  {
     2247    rpcTempCU->copyPartFrom( m_ppcWeightedTempCU[uhDepth] , 0 , uhDepth );
     2248    rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
     2249
     2250    m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] );
     2251  }
     2252  else
     2253  {
     2254    bFirstTime = false;
    22422255#endif
    22432256#if AMP_MRG
     
    22522265  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] );
    22532266#endif
    2254 #if H_3D_ARP
    2255         if( nARPWMax )
    2256         {
    2257           m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth );
    2258         }
    2259       }
     2267#if NH_3D_ARP
     2268  if( nARPWMax )
     2269  {
     2270    m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth );
     2271  }
     2272  }
    22602273#endif
    22612274
     
    22632276  if ( !rpcTempCU->getMergeAMP() )
    22642277  {
    2265 #if H_3D_ARP
    2266         if( nARPWMax )
    2267         {
    2268           continue;
    2269         }
    2270         else
     2278#if NH_3D_ARP
     2279    if( nARPWMax )
     2280    {
     2281      continue;
     2282    }
     2283    else
    22712284#endif
    22722285    return;
     
    23802393      }
    23812394#endif
    2382 #if H_3D_ARP
     2395#if NH_3D_ARP
    23832396    }
    23842397#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibEncoder/TEncCu.h

    r1222 r1262  
    6969  TComDataCU**            m_ppcBestCU;      ///< Best CUs in each depth
    7070  TComDataCU**            m_ppcTempCU;      ///< Temporary CUs in each depth
    71 #if H_3D_ARP
     71#if NH_3D_ARP
    7272  TComDataCU**            m_ppcWeightedTempCU;
    7373#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.cpp

    r1222 r1262  
    184184#endif
    185185
    186 #if H_3D_ARP
     186#if NH_3D_ARP
    187187Void TEncEntropy::encodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx )
    188188{
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.h

    r1222 r1262  
    8484  virtual Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    8585  virtual Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    86 #if H_3D_ARP
     86#if NH_3D_ARP
    8787  virtual Void codeARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    8888#endif
     
    173173  Void encodeMergeFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    174174  Void encodeMergeIndex   ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    175 #if H_3D_ARP
     175#if NH_3D_ARP
    176176  Void encodeARPW         ( TComDataCU* pcCU, UInt uiAbspartIdx );
    177177#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibEncoder/TEncGOP.cpp

    r1210 r1262  
    14741474    pcSlice->setDefaultRefView();
    14751475#endif
    1476 #if H_3D_ARP
     1476#if NH_3D_ARP
    14771477    //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh
    14781478    pcSlice->setARPStepNum(m_ivPicLists);
    1479     if(pcSlice->getARPStepNum() > 1)
    1480     {
    1481       for(Int iLayerId = 0; iLayerId < getLayerId(); iLayerId ++ )
    1482       {
    1483         Int  iViewIdx =   pcSlice->getVPS()->getViewIndex(iLayerId);
    1484         Bool bIsDepth = ( pcSlice->getVPS()->getDepthId  ( iLayerId ) == 1 );
    1485         if( iViewIdx<getViewIndex() && !bIsDepth )
    1486         {
    1487           pcSlice->setBaseViewRefPicList( m_ivPicLists->getPicList( iLayerId ), iViewIdx );
    1488         }
    1489       }
    1490     }
    14911479#endif
    14921480#if H_3D_IC
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibEncoder/TEncSbac.cpp

    r1222 r1262  
    6868, m_cCUMergeFlagExtSCModel             ( 1,             1,                      NUM_MERGE_FLAG_EXT_CTX               , m_contextModels + m_numContextModels, m_numContextModels)
    6969, m_cCUMergeIdxExtSCModel              ( 1,             1,                      NUM_MERGE_IDX_EXT_CTX                , m_contextModels + m_numContextModels, m_numContextModels)
    70 #if H_3D_ARP
     70#if NH_3D_ARP
    7171, m_cCUPUARPWSCModel                   ( 1,             1,                      NUM_ARPW_CTX                         , m_contextModels + m_numContextModels, m_numContextModels)
    7272#endif                                                                                                               
     
    148148  m_cCUMergeFlagExtSCModel.initBuffer             ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
    149149  m_cCUMergeIdxExtSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT);
    150 #if H_3D_ARP
     150#if NH_3D_ARP
    151151  m_cCUPUARPWSCModel.initBuffer                   ( eSliceType, iQp, (UChar*)INIT_ARPW );
    152152#endif
     
    235235      curCost += m_cCUMergeFlagExtSCModel.calcCost             ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT);
    236236      curCost += m_cCUMergeIdxExtSCModel.calcCost              ( curSliceType, qp, (UChar*)INIT_MERGE_IDX_EXT);
    237 #if H_3D_ARP
     237#if NH_3D_ARP
    238238      curCost += m_cCUPUARPWSCModel.calcCost                   ( curSliceType, qp, (UChar*)INIT_ARPW );
    239239#endif                                                     
     
    302302  m_cCUDISTypeSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_DIS_TYPE );
    303303#endif
    304 #if H_3D_ARP
    305   m_cCUPUARPWSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_ARPW );
    306 #endif
    307304#if H_3D_IC
    308305  m_cCUICFlagSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_IC_FLAG );
     
    971968}
    972969
    973 #if H_3D_ARP
     970#if NH_3D_ARP
    974971Void TEncSbac::codeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx )
    975972{
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibEncoder/TEncSbac.h

    r1222 r1262  
    140140  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    141141  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    142 #if H_3D_ARP
     142#if NH_3D_ARP
    143143  Void codeARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    144144#endif
     
    212212  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
    213213  ContextModel3DBuffer m_cCUMergeIdxExtSCModel;
    214 #if H_3D_ARP
     214#if NH_3D_ARP
    215215  ContextModel3DBuffer m_cCUPUARPWSCModel;
    216216#endif
  • branches/HTM-14.1-update-dev4-Qualcomm/source/Lib/TLibEncoder/TEncSearch.cpp

    r1222 r1262  
    50075007  if ( pcCU->getSlice()->testWeightPred() && pcCU->getSlice()->getSliceType()==P_SLICE )
    50085008  {
    5009     xPredInterBlk( COMPONENT_Y, pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, true, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) );
     5009    xPredInterBlk( COMPONENT_Y, pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, true, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA)
     5010#if NH_3D_ARP
     5011      , false //add this for IC, otherwise, it could be removed
     5012#endif
     5013      );
    50105014  }
    50115015  else
    50125016  {
    50135017    xPredInterBlk( COMPONENT_Y, pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, false, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA)
    5014 #if H_3D_ARP
     5018#if NH_3D_ARP
    50155019      , false
    50165020#endif
     
    57815785    m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true);
    57825786    m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, true );
    5783 #if H_3D_ARP
     5787#if NH_3D_ARP
    57845788    m_pcEntropyCoder->encodeARPW( pcCU, 0 );
    57855789#endif
     
    70977101    m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true);
    70987102    m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, true);
    7099 #if H_3D_ARP
     7103#if NH_3D_ARP
    71007104    m_pcEntropyCoder->encodeARPW( pcCU, 0 );
    71017105#endif
     
    71247128    m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
    71257129#endif
    7126 #if H_3D_ARP
     7130#if NH_3D_ARP
    71277131    m_pcEntropyCoder->encodeARPW( pcCU , 0  );
    71287132#endif
Note: See TracChangeset for help on using the changeset viewer.