Changeset 373 in 3DVCSoftware for branches/HTM-6.2-dev2-Qualcomm


Ignore:
Timestamp:
5 May 2013, 05:25:40 (12 years ago)
Author:
zhang
Message:

JCT3V-D0177: ARP

Location:
branches/HTM-6.2-dev2-Qualcomm
Files:
2 added
57 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-6.2-dev2-Qualcomm/CommonTestConditionsCfgs/baseCfg_2view+depth.cfg

    r296 r373  
    192192MultiviewMvRegMode        : 1                                      # use original depth maps for regularizing inter-view motion vector
    193193MultiviewMvRegLambdaScale : 1.0                                    # lambda scale factor for inter-view motion vector regularization
    194 MultiviewResPred          : 1                                      # inter-view residual prediction (0:off, 1:on)
     194MultiviewResPred          : 1                                      # advanced inter-view residual prediction (0:off, 1:on)
    195195InterViewSkip             : 0                                      # interview SKIP mode
    196196InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
  • branches/HTM-6.2-dev2-Qualcomm/CommonTestConditionsCfgs/baseCfg_2view.cfg

    r210 r373  
    186186MultiviewMvRegMode        : 0                                      # use original depth maps for regularizing inter-view motion vector
    187187MultiviewMvRegLambdaScale : 0.0                                    # lambda scale factor for inter-view motion vector regularization
    188 MultiviewResPred          : 1                                      # inter-view residual prediction (0:off, 1:on)
     188MultiviewResPred          : 1                                      # advanced inter-view residual prediction (0:off, 1:on)
    189189InterViewSkip             : 0                                      # interview SKIP mode
    190190InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
  • branches/HTM-6.2-dev2-Qualcomm/CommonTestConditionsCfgs/baseCfg_3view+depth.cfg

    r296 r373  
    196196MultiviewMvRegMode        : 1                                      # use original depth maps for regularizing inter-view motion vector
    197197MultiviewMvRegLambdaScale : 1.0                                    # lambda scale factor for inter-view motion vector regularization
    198 MultiviewResPred          : 1                                      # inter-view residual prediction (0:off, 1:on)
     198MultiviewResPred          : 1                                      # advanced inter-view residual prediction (0:off, 1:on)
    199199InterViewSkip             : 0                                      # interview SKIP mode
    200200InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
  • branches/HTM-6.2-dev2-Qualcomm/CommonTestConditionsCfgs/baseCfg_3view.cfg

    r210 r373  
    188188MultiviewMvRegMode        : 0                                      # use original depth maps for regularizing inter-view motion vector
    189189MultiviewMvRegLambdaScale : 0.0                                    # lambda scale factor for inter-view motion vector regularization
    190 MultiviewResPred          : 1                                      # inter-view residual prediction (0:off, 1:on)
     190MultiviewResPred          : 1                                      # advanced inter-view residual prediction (0:off, 1:on)
    191191InterViewSkip             : 0                                      # interview SKIP mode
    192192InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
  • branches/HTM-6.2-dev2-Qualcomm/cfg/IBPsetting_balloons.cfg

    r297 r373  
    199199MultiviewMvRegMode        : 1                                      # use original depth maps for regularizing inter-view motion vector
    200200MultiviewMvRegLambdaScale : 1.0                                    # lambda scale factor for inter-view motion vector regularization
    201 MultiviewResPred          : 1                                      # inter-view residual prediction (0:off, 1:on)
     201MultiviewResPred          : 1                                      # advanced inter-view residual prediction (0:off, 1:on)
    202202InterViewSkip             : 0                                      # interview SKIP mode
    203203InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
  • branches/HTM-6.2-dev2-Qualcomm/cfg/IBPsetting_gtfly.cfg

    r297 r373  
    199199MultiviewMvRegMode        : 1                                      # use original depth maps for regularizing inter-view motion vector
    200200MultiviewMvRegLambdaScale : 1.0                                    # lambda scale factor for inter-view motion vector regularization
    201 MultiviewResPred          : 1                                      # inter-view residual prediction (0:off, 1:on)
     201MultiviewResPred          : 1                                      # advanced inter-view residual prediction (0:off, 1:on)
    202202InterViewSkip             : 0                                      # interview SKIP mode
    203203InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
  • branches/HTM-6.2-dev2-Qualcomm/cfg/IBPsetting_kendo.cfg

    r297 r373  
    199199MultiviewMvRegMode        : 1                                      # use original depth maps for regularizing inter-view motion vector
    200200MultiviewMvRegLambdaScale : 1.0                                    # lambda scale factor for inter-view motion vector regularization
    201 MultiviewResPred          : 1                                      # inter-view residual prediction (0:off, 1:on)
     201MultiviewResPred          : 1                                      # advanced inter-view residual prediction (0:off, 1:on)
    202202InterViewSkip             : 0                                      # interview SKIP mode
    203203InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
  • branches/HTM-6.2-dev2-Qualcomm/cfg/IBPsetting_news.cfg

    r297 r373  
    199199MultiviewMvRegMode        : 1                                      # use original depth maps for regularizing inter-view motion vector
    200200MultiviewMvRegLambdaScale : 1.0                                    # lambda scale factor for inter-view motion vector regularization
    201 MultiviewResPred          : 1                                      # inter-view residual prediction (0:off, 1:on)
     201MultiviewResPred          : 1                                      # advanced inter-view residual prediction (0:off, 1:on)
    202202InterViewSkip             : 0                                      # interview SKIP mode
    203203InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
  • branches/HTM-6.2-dev2-Qualcomm/cfg/IBPsetting_poznanhall.cfg

    r297 r373  
    199199MultiviewMvRegMode        : 1                                      # use original depth maps for regularizing inter-view motion vector
    200200MultiviewMvRegLambdaScale : 1.0                                    # lambda scale factor for inter-view motion vector regularization
    201 MultiviewResPred          : 1                                      # inter-view residual prediction (0:off, 1:on)
     201MultiviewResPred          : 1                                      # advanced inter-view residual prediction (0:off, 1:on)
    202202InterViewSkip             : 0                                      # interview SKIP mode
    203203InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
  • branches/HTM-6.2-dev2-Qualcomm/cfg/IBPsetting_poznanstreet.cfg

    r297 r373  
    199199MultiviewMvRegMode        : 1                                      # use original depth maps for regularizing inter-view motion vector
    200200MultiviewMvRegLambdaScale : 1.0                                    # lambda scale factor for inter-view motion vector regularization
    201 MultiviewResPred          : 1                                      # inter-view residual prediction (0:off, 1:on)
     201MultiviewResPred          : 1                                      # advanced inter-view residual prediction (0:off, 1:on)
    202202InterViewSkip             : 0                                      # interview SKIP mode
    203203InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
  • branches/HTM-6.2-dev2-Qualcomm/cfg/IBPsetting_undodancer.cfg

    r297 r373  
    199199MultiviewMvRegMode        : 1                                      # use original depth maps for regularizing inter-view motion vector
    200200MultiviewMvRegLambdaScale : 1.0                                    # lambda scale factor for inter-view motion vector regularization
    201 MultiviewResPred          : 1                                      # inter-view residual prediction (0:off, 1:on)
     201MultiviewResPred          : 1                                      # advanced inter-view residual prediction (0:off, 1:on)
    202202InterViewSkip             : 0                                      # interview SKIP mode
    203203InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
  • branches/HTM-6.2-dev2-Qualcomm/source/App/TAppEncoder/TAppEncCfg.cpp

    r332 r373  
    383383#endif
    384384#if H3D_IVRP
     385#if QC_ARP_D0177
     386  ("MultiviewResPred", m_nUseAdvResPred,           (UInt)0, "usage of Advanced residual prediction" )
     387#else
    385388  ("MultiviewResPred", m_uiMultiviewResPredMode,   (UInt)0, "usage of inter-view residual prediction" )
     389#endif
    386390#endif
    387391
     
    917921#endif
    918922#if H3D_IVRP
     923#if QC_ARP_D0177
     924  xConfirmPara     ( m_nUseAdvResPred < 0 || m_nUseAdvResPred > 1 , "0<=ARP<=1" );
     925#else
    919926  xConfirmPara    ( m_uiMultiviewResPredMode > 1,                                     "MultiviewResPred must be less than or equal to 1" );
    920927  xConfirmPara    ( m_uiMultiviewResPredMode > 0 && m_uiPredDepthMapGeneration == 0 , "MultiviewResPred > 0 requires PredDepthMapGen > 0" );
     928#endif
    921929#endif
    922930  if( m_bUsingDepthMaps )
     
    16721680  printf("IVSEnable: %d ", m_bUseIVS);
    16731681#endif
     1682#if QC_ARP_D0177
     1683  printf(" ARP:%d  " , m_nUseAdvResPred  );
     1684#endif
    16741685  printf("\n");
    16751686
  • branches/HTM-6.2-dev2-Qualcomm/source/App/TAppEncoder/TAppEncCfg.h

    r332 r373  
    217217  Double    m_dMultiviewMvRegLambdaScale;                     ///< lambda scale for multiview motion vectors regularization
    218218#endif
    219 #if H3D_IVRP
     219#if H3D_IVRP
     220#if QC_ARP_D0177
     221  UInt      m_nUseAdvResPred;
     222#else
    220223  UInt      m_uiMultiviewResPredMode;          ///< using multiview residual prediction
     224#endif
    221225#endif
    222226
  • branches/HTM-6.2-dev2-Qualcomm/source/App/TAppEncoder/TAppEncTop.cpp

    r332 r373  
    223223#endif
    224224#if H3D_IVRP
     225#if QC_ARP_D0177
     226    m_acTEncTopList[iViewIdx]->setUseAdvRP                     ( iViewIdx ? m_nUseAdvResPred             : 0   );
     227    m_acTEncTopList[iViewIdx]->setARPStepNum                   ( iViewIdx ? QC_ARP_WFNR                  : 1   );
     228#else
    225229    m_acTEncTopList[iViewIdx]->setMultiviewResPredMode         ( m_uiMultiviewResPredMode );
     230#endif
    226231#endif
    227232
     
    560565      m_acTEncDepthTopList[iViewIdx]->setMultiviewMvRegLambdaScale    ( 0.0 );
    561566#endif
    562 #if H3D_IVRP
    563       m_acTEncDepthTopList[iViewIdx]->setMultiviewResPredMode         ( 0 );
     567#if H3D_IVRP
     568#if QC_ARP_D0177
     569    m_acTEncDepthTopList[iViewIdx]->setUseAdvRP                          ( 0 );
     570    m_acTEncDepthTopList[iViewIdx]->setARPStepNum                        ( 1 );
     571#else
     572    m_acTEncDepthTopList[iViewIdx]->setMultiviewResPredMode         ( 0 );
     573#endif
    564574#endif
    565575
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/ContextTables.h

    r332 r373  
    487487#endif
    488488};
     489#if QC_ARP_D0177
     490#define NUM_ARPW_CTX                  4       ///< number of context models for generalized residual prediction weighting factor
     491static const UChar
     492INIT_ARPW[3][NUM_ARPW_CTX] =
     493{
     494  { 154 , 154 , 154 , 154 },
     495  { 154 , 154 , 154 , 154 },
     496  { 154 , 154 , 154 , 154 },
     497};
     498#endif
    489499
    490500#if LGE_EDGE_INTRA_A0070
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp

    r351 r373  
    225225  m_pbResPredFlag      = NULL;
    226226#endif
     227#if QC_ARP_D0177
     228  m_puhARPW           = NULL;
     229#endif
    227230#if LGE_EDGE_INTRA_A0070
    228231  m_pucEdgeCode         = NULL;
     
    301304    m_pbResPredAvailable = (Bool*  )xMalloc(Bool,   uiNumPartition);
    302305    m_pbResPredFlag      = (Bool*  )xMalloc(Bool,   uiNumPartition);
     306#if QC_ARP_D0177
     307    m_puhARPW            = new UChar[ uiNumPartition];
     308#endif
    303309#endif
    304310    m_puhLumaIntraDir    = (UChar* )xMalloc(UChar,  uiNumPartition);
     
    463469    if ( m_pDvInfo            ) { xFree(m_pDvInfo);             m_pDvInfo           = NULL; }
    464470#endif
     471#if QC_ARP_D0177
     472    if ( m_puhARPW           )  { delete[] m_puhARPW;          m_puhARPW          = NULL; }
     473#endif
    465474    if ( m_puhLumaIntraDir    ) { xFree(m_puhLumaIntraDir);     m_puhLumaIntraDir   = NULL; }
    466475    if ( m_puhChromaIntraDir  ) { xFree(m_puhChromaIntraDir);   m_puhChromaIntraDir = NULL; }
     
    636645    m_pbSDCFlag[ui] = pcFrom->getSDCFlag(ui);
    637646#endif
     647#if QC_ARP_D0177
     648    m_puhARPW[ui] = pcFrom->getARPW( ui );
     649#endif
    638650    m_puhWidth  [ui] = pcFrom->getWidth(ui);
    639651    m_puhHeight [ui] = pcFrom->getHeight(ui);
     
    733745    memset( m_pbResPredFlag            + firstElement, 0    , sizeof( Bool ) * numElements );
    734746#endif
     747#if QC_ARP_D0177
     748    memset( m_puhARPW                  + firstElement, 0    , sizeof( UChar ) * numElements  );
     749#endif
    735750  }
    736751 
     
    875890      m_pbResPredFlag[ui]      = 0;
    876891#endif
     892#if QC_ARP_D0177
     893      m_puhARPW[ui] = 0;
     894#endif
    877895      m_puhLumaIntraDir[ui] = 2;
    878896      m_puhChromaIntraDir[ui] = 0;
     
    9851003  memset( m_pbResPredAvailable, 0, iSizeInBool  );
    9861004  memset( m_pbResPredFlag,      0, iSizeInBool  );
     1005#endif
     1006#if QC_ARP_D0177
     1007  memset( m_puhARPW,            0, iSizeInUchar  );
    9871008#endif
    9881009  memset( m_puhLumaIntraDir,    2, iSizeInUchar );
     
    11021123      m_pbResPredFlag     [ui] = pcCU->m_pbResPredFlag     [ uiPartOffset + ui ];
    11031124#endif
     1125#if QC_ARP_D0177
     1126      m_puhARPW           [ui] = pcCU->getARPW( uiPartOffset+ui );
     1127#endif
    11041128#if RWTH_SDC_DLT_B0036
    11051129      m_pbSDCFlag         [ui] = pcCU->m_pbSDCFlag         [ uiPartOffset + ui ];
     
    12241248  m_pbResPredFlag       = pcCU->getResPredFlag ()     + uiPart;
    12251249#endif
     1250#if QC_ARP_D0177
     1251  m_puhARPW             = pcCU->getARPW() + uiPart;
     1252#endif
    12261253  m_puhLumaIntraDir     = pcCU->getLumaIntraDir()     + uiPart;
    12271254  m_puhChromaIntraDir   = pcCU->getChromaIntraDir()   + uiPart;
     
    13921419  m_pbResPredFlag      = pcCU->getResPredFlag ()          + uiAbsPartIdx;
    13931420#endif
     1421#if QC_ARP_D0177
     1422  m_puhARPW           = pcCU->getARPW()                 + uiAbsPartIdx;
     1423#endif
    13941424  m_apiMVPIdx[eRefPicList] = pcCU->getMVPIdx(eRefPicList) + uiAbsPartIdx;
    13951425  m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx;
     
    14091439// Copy small CU to bigger CU.
    14101440// One of quarter parts overwritten by predicted sub part.
    1411 Void TComDataCU::copyPartFrom( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth )
     1441Void TComDataCU::copyPartFrom( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth
     1442#if QC_ARP_D0177
     1443     ,
     1444    Bool bRP
     1445#endif
     1446    )
    14121447{
    14131448  assert( uiPartUnitIdx<4 );
     
    14461481  memcpy( m_pbResPredFlag       + uiOffset, pcCU->getResPredFlag(),       iSizeInBool  );
    14471482#endif
     1483#if QC_ARP_D0177
     1484  memcpy( m_puhARPW            + uiOffset,  pcCU->getARPW(),              iSizeInUchar );
     1485#endif
    14481486  memcpy( m_puhLumaIntraDir     + uiOffset, pcCU->getLumaIntraDir(),      iSizeInUchar );
    14491487  memcpy( m_puhChromaIntraDir   + uiOffset, pcCU->getChromaIntraDir(),    iSizeInUchar );
     
    15221560
    15231561#if LGE_EDGE_INTRA_A0070
     1562#if QC_ARP_D0177
     1563  if( !bRP && pcCU->getSlice()->getSPS()->isDepth() )
     1564#else
    15241565  if( getSlice()->getSPS()->isDepth() )
     1566#endif
    15251567  {
    15261568    memcpy( getEdgeCode( uiOffset ), pcCU->getEdgeCode(0), iSizeInUchar * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 );
     
    15881630  memcpy( rpcCU->getResPredFlag()       + m_uiAbsIdxInLCU, m_pbResPredFlag,       iSizeInBool  );
    15891631#endif
     1632#if QC_ARP_D0177
     1633  memcpy( rpcCU->getARPW()              + m_uiAbsIdxInLCU, m_puhARPW,             iSizeInUchar );
     1634#endif
    15901635  memcpy( rpcCU->getLumaIntraDir()      + m_uiAbsIdxInLCU, m_puhLumaIntraDir,     iSizeInUchar );
    15911636  memcpy( rpcCU->getChromaIntraDir()    + m_uiAbsIdxInLCU, m_puhChromaIntraDir,   iSizeInUchar );
     
    17181763  memcpy( rpcCU->getResPredAvail()      + uiPartOffset, m_pbResPredAvailable,  iSizeInBool  );
    17191764  memcpy( rpcCU->getResPredFlag()       + uiPartOffset, m_pbResPredFlag,       iSizeInBool  );
     1765#endif
     1766#if QC_ARP_D0177
     1767  memcpy( rpcCU->getARPW()              + uiPartOffset, m_puhARPW,            iSizeInUchar );
    17201768#endif
    17211769  memcpy( rpcCU->getLumaIntraDir()      + uiPartOffset, m_puhLumaIntraDir,     iSizeInUchar );
     
    27092757  return uiCtx;
    27102758}
    2711 
     2759#if QC_ARP_D0177
     2760UInt TComDataCU::getCTXARPWFlag( UInt uiAbsPartIdx )
     2761{
     2762  TComDataCU* pcTempCU;
     2763  UInt        uiTempPartIdx;
     2764  UInt        uiCtx = 0;
     2765 
     2766  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     2767  uiCtx    = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0;
     2768 
     2769  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     2770  uiCtx   += ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1): 0;
     2771 
     2772  return uiCtx;
     2773}
     2774#endif
    27122775#if LGE_ILLUCOMP_B0045
    27132776UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx )
     
    36323695#endif //H3D_NBDV
    36333696
    3634 #if H3D_IVRP
     3697#if H3D_IVRP & !QC_ARP_D0177
    36353698  Bool bDVAvail = true;
    36363699#endif
     
    36893752    cDisInfo.m_aVIdxCan[0] = 0;
    36903753#endif
    3691 #if H3D_IVRP
     3754#if H3D_IVRP & !QC_ARP_D0177
    36923755    bDVAvail = false;
    36933756#endif
     
    37523815  iPdmDir[1] = iPdmInterDir;
    37533816#endif // H3D_NBDV
    3754 #if H3D_IVRP
     3817#if H3D_IVRP & !QC_ARP_D0177
    37553818  if (m_pcSlice->getSPS()->getMultiviewResPredMode()==1 && iPdmDir[0] && !bNoPdmMerge && cCurPS == SIZE_2Nx2N && bDVAvail)
    37563819  {
     
    72787341TComDataCU::getResidualSamples( UInt uiPartIdx, Bool bRecon, TComYuv* pcYuv )
    72797342{
     7343#if !QC_ARP_D0177
    72807344  TComResidualGenerator*  pcResidualGenerator = m_pcSlice->getSPS()->getResidualGenerator();
    72817345  ROFRS( pcResidualGenerator, false );
     7346#endif
     7347
    72827348#if H3D_NBDV
    72837349  DisInfo cDisInfo;
     
    73087374#if !QC_CU_NBDV_D0181
    73097375  getDisMvpCandNBDV( 0, 0,  &cDisInfo, false ); 
    7310 
    73117376  if( cDisInfo.iN == 0)
    73127377#else
     
    73267391  }
    73277392  else
     7393#if QC_ARP_D0177
     7394  if(m_pcSlice->getSPS()->getUseAdvRP()) 
     7395  {
     7396     m_pePartSize[0] = m_peSaved;
     7397     return true;
     7398  }
     7399  else
     7400    return false;
     7401#else
    73287402  {
    73297403    Bool bAvailable = pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, cDisInfo.m_acMvCand[0], bRecon );       
     
    73317405    return bAvailable;
    73327406  }
     7407#endif
    73337408#else
    73347409  return pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, bRecon );
     
    73367411}
    73377412#endif
    7338 
     7413#if QC_ARP_D0177
     7414Void TComDataCU::setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth )
     7415{
     7416  assert( sizeof( *m_puhARPW) == 1 );
     7417  memset( m_puhARPW + uiAbsPartIdx, w, m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ) );
     7418}
     7419#endif
    73397420#if LGE_EDGE_INTRA_A0070
    73407421Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion )
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComDataCU.h

    r351 r373  
    214214  Bool*         m_pbResPredFlag;      ///< array of residual prediction flags
    215215#endif
    216 
     216#if QC_ARP_D0177
     217  UChar*        m_puhARPW;
     218#endif
    217219#if LGE_EDGE_INTRA_A0070
    218220  UChar*        m_pucEdgeCode;          ///< array of edge code
     
    301303 
    302304  /// compute scaling factor from POC difference
     305#if !QC_ARP_D0177
    303306  Int           xGetDistScaleFactor   ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
    304  
     307#endif
    305308  Void xDeriveCenterIdx( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxCenter );
    306309  Bool xGetCenterCol( UInt uiPartIdx, RefPicList eRefPicList, int iRefIdx, TComMv *pcMv );
     
    316319  // create / destroy / initialize / copy
    317320  // -------------------------------------------------------------------------------------------------------------------
    318  
     321#if QC_ARP_D0177
     322  Int           xGetDistScaleFactor   ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
     323#endif 
     324
    319325  Void          create                ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize
    320326#if ADAPTIVE_QP_SELECTION
     
    337343#endif
    338344  );
    339   Void          copyPartFrom          ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth );
     345  Void          copyPartFrom          ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth
     346#if QC_ARP_D0177
     347      ,
     348      Bool bRP = false
     349#endif
     350  );
    340351 
    341352  Void          copyToPic             ( UChar uiDepth );
     
    585596  Bool          getResidualSamples( UInt uiPartIdx, Bool bRecon, TComYuv* pcYuv = 0 );
    586597#endif
     598#if QC_ARP_D0177
     599  UChar*        getARPW          ()                        { return m_puhARPW;               }
     600  UChar         getARPW          ( UInt uiIdx )            { return m_puhARPW[uiIdx];        }
     601  Void          setARPW          ( UInt uiIdx, UChar w )   { m_puhARPW[uiIdx] = w;           }
     602  Void          setARPWSubParts  ( UChar w, UInt uiAbsPartIdx, UInt uiDepth );
     603  Double        getARPWFactor    ( UInt uiIdx );
     604#endif
    587605  // -------------------------------------------------------------------------------------------------------------------
    588606  // member functions for accessing partition information
     
    705723  UInt          getCtxResPredFlag               ( UInt   uiAbsPartIdx                                 );
    706724#endif
    707  
     725#if QC_ARP_D0177
     726  UInt          getCTXARPWFlag                 ( UInt   uiAbsPartIdx                                 );
     727#endif 
    708728  UInt          getSliceStartCU         ( UInt pos )                  { return m_uiSliceStartCU[pos-m_uiAbsIdxInLCU];                                                                                          }
    709729  UInt          getEntropySliceStartCU  ( UInt pos )                  { return m_uiEntropySliceStartCU[pos-m_uiAbsIdxInLCU];                                                                                   }
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComDepthMapGenerator.h

    r332 r373  
    8080
    8181  UInt      getPdm  ()                            { if( m_aacActiveSPS[0][1] ) { return m_aacActiveSPS[0][1]->getPredDepthMapGeneration(); } return 0; }
    82 #if H3D_IVRP
     82#if H3D_IVRP & !QC_ARP_D0177
    8383  UInt      getResPrd ()                          { if( m_aacActiveSPS[0][1] ) { return m_aacActiveSPS[0][1]->getMultiviewResPredMode  (); } return 0; }
    8484#endif
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComInterpolationFilter.cpp

    r56 r373  
    7272  { -2, 10, 58, -2 }
    7373};
    74 
     74#if QC_ARP_D0177
     75const Short TComInterpolationFilter::m_lumaFilterARP[4][NTAPS_LUMA_ARP] =
     76{
     77  {64,  0},
     78  {48, 16},
     79  {32, 32},
     80  {16, 48}
     81};
     82const Short TComInterpolationFilter::m_chromaFilterARP[8][NTAPS_CHROMA_ARP] =
     83{
     84  {64,  0},
     85  {56,  8},
     86  {48, 16},
     87  {40, 24},
     88  {32, 32},
     89  {24, 40},
     90  {16, 48},
     91  {8,  56}
     92};
     93#endif
    7594// ====================================================================================================================
    7695// Private member functions
     
    320339 * \param  isLast     Flag indicating whether it is the last filtering operation
    321340 */
    322 Void TComInterpolationFilter::filterHorLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast )
     341Void TComInterpolationFilter::filterHorLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast
     342#if QC_ARP_D0177
     343    ,
     344    Bool filterType
     345#endif
     346    )
    323347{
    324348  assert(frac >= 0 && frac < 4);
     
    330354  else
    331355  {
    332     filterHor<NTAPS_LUMA>(src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]);
     356#if QC_ARP_D0177
     357    if(filterType)
     358      filterHor<NTAPS_LUMA_ARP>(src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilterARP[frac]);
     359    else
     360#endif
     361      filterHor<NTAPS_LUMA>(src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]);
    333362  }
    334363}
     
    347376 * \param  isLast     Flag indicating whether it is the last filtering operation
    348377 */
    349 Void TComInterpolationFilter::filterVerLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast )
     378Void TComInterpolationFilter::filterVerLuma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast
     379#if QC_ARP_D0177
     380    ,
     381    Bool filterType
     382#endif
     383    )
    350384{
    351385  assert(frac >= 0 && frac < 4);
     
    357391  else
    358392  {
    359     filterVer<NTAPS_LUMA>(src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]);   
     393#if QC_ARP_D0177
     394    if(filterType)
     395      filterVer<NTAPS_LUMA_ARP>(src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilterARP[frac]);   
     396    else
     397#endif
     398      filterVer<NTAPS_LUMA>(src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]);   
    360399  }
    361400}
     
    373412 * \param  isLast     Flag indicating whether it is the last filtering operation
    374413 */
    375 Void TComInterpolationFilter::filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast )
     414Void TComInterpolationFilter::filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast
     415#if QC_ARP_D0177
     416    ,
     417    Bool filterType
     418#endif
     419    )
    376420{
    377421  assert(frac >= 0 && frac < 8);
     
    383427  else
    384428  {
     429#if QC_ARP_D0177
     430    if(filterType)
     431      filterHor<NTAPS_CHROMA_ARP>(src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilterARP[frac]);   
     432    else
     433#endif
    385434    filterHor<NTAPS_CHROMA>(src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac]);
    386435  }
     
    400449 * \param  isLast     Flag indicating whether it is the last filtering operation
    401450 */
    402 Void TComInterpolationFilter::filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast )
     451Void TComInterpolationFilter::filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast
     452#if QC_ARP_D0177
     453    ,
     454    Bool filterType
     455#endif
     456    )
    403457{
    404458  assert(frac >= 0 && frac < 8);
     
    410464  else
    411465  {
    412     filterVer<NTAPS_CHROMA>(src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac]);   
     466#if QC_ARP_D0177
     467    if(filterType)
     468      filterVer<NTAPS_CHROMA_ARP>(src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilterARP[frac]); 
     469    else
     470#endif
     471      filterVer<NTAPS_CHROMA>(src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac]);   
    413472  }
    414473}
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComInterpolationFilter.h

    r56 r373  
    4444//! \ingroup TLibCommon
    4545//! \{
     46#if QC_ARP_D0177
     47#define NTAPS_LUMA_ARP    2 ///< Number of taps for luma
     48#define NTAPS_CHROMA_ARP  2 ///< Number of taps for chroma
     49#endif
    4650
    4751#define NTAPS_LUMA        8 ///< Number of taps for luma
     
    5862  static const Short m_lumaFilter[4][NTAPS_LUMA];     ///< Luma filter taps
    5963  static const Short m_chromaFilter[8][NTAPS_CHROMA]; ///< Chroma filter taps
    60  
     64#if QC_ARP_D0177
     65  static const Short m_lumaFilterARP  [4][NTAPS_LUMA_ARP];     ///< Luma filter taps
     66  static const Short m_chromaFilterARP[8][NTAPS_CHROMA_ARP]; ///< Chroma filter taps
     67#endif
     68
    6169  static Void filterCopy(const Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Bool isFirst, Bool isLast);
    6270 
     
    7381  ~TComInterpolationFilter() {}
    7482
    75   Void filterHorLuma  (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac,               Bool isLast );
    76   Void filterVerLuma  (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast );
    77   Void filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac,               Bool isLast );
    78   Void filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast );
     83  Void filterHorLuma  (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac,               Bool isLast
     84#if QC_ARP_D0177
     85    ,
     86    Bool filterType = 0
     87#endif
     88    );
     89  Void filterVerLuma  (Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast
     90#if QC_ARP_D0177
     91    ,
     92    Bool filterType = 0
     93#endif
     94    );
     95  Void filterHorChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac,               Bool isLast
     96#if QC_ARP_D0177
     97    ,
     98    Bool filterType = 0
     99#endif
     100    );
     101  Void filterVerChroma(Pel *src, Int srcStride, Short *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast
     102#if QC_ARP_D0177
     103    ,
     104    Bool filterType = 0
     105#endif
     106    );
    79107};
    80108
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComPicYuv.cpp

    r332 r373  
    488488  }
    489489}
    490 
     490#if QC_ARP_D0177
     491Void  TComPicYuv::clearPic()
     492{
     493  ::memset ( m_apiPicBufY, 0 , sizeof (Pel) * ( m_iPicWidth       + (m_iLumaMarginX   << 1)) * ( m_iPicHeight       + (m_iLumaMarginY   << 1)) );
     494  ::memset ( m_apiPicBufU, 0 , sizeof (Pel) * ((m_iPicWidth >> 1) + (m_iChromaMarginX << 1)) * ((m_iPicHeight >> 1) + (m_iChromaMarginY << 1)) );
     495  ::memset ( m_apiPicBufV, 0 , sizeof (Pel) * ((m_iPicWidth >> 1) + (m_iChromaMarginX << 1)) * ((m_iPicHeight >> 1) + (m_iChromaMarginY << 1)) );
     496}
     497#endif
    491498//! \}
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComPicYuv.h

    r56 r373  
    183183  Void  setLumaTo    ( Pel pVal ); 
    184184  Void  setChromaTo  ( Pel pVal ); 
    185 
     185#if QC_ARP_D0177
     186  Void    clearPic();
     187#endif
    186188};// END CLASS DEFINITION TComPicYuv
    187189
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComPrediction.cpp

    r332 r373  
    7878
    7979  m_cYuvPredTemp.destroy();
    80 
     80#if QC_ARP_D0177
     81  m_acYuvPredBase[0].destroy();
     82  m_acYuvPredBase[1].destroy();
     83  m_acYuvDiff[0].destroy();
     84  m_acYuvDiff[1].destroy();
     85#endif
    8186  if( m_pLumaRecBuffer )
    8287  {
     
    119124
    120125    m_cYuvPredTemp.create( g_uiMaxCUWidth, g_uiMaxCUHeight );
     126#if QC_ARP_D0177
     127    m_acYuvPredBase[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
     128    m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
     129    m_acYuvDiff    [0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
     130    m_acYuvDiff    [1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
     131#endif
    121132  }
    122133
     
    751762}
    752763
    753 #if H3D_IVRP
     764#if H3D_IVRP & !QC_ARP_D0177
    754765Void TComPrediction::residualPrediction(TComDataCU* pcCU, TComYuv* pcYuvPred, TComYuv* pcYuvResPred)
    755766{
     
    810821  }
    811822#endif
    812 
     823#if QC_ARP_D0177
     824  if( pcCU->getSlice()->getSPS()->isDepth() == false
     825    && pcCU->getSlice()->getSPS()->getViewId() > 0
     826    && pcCU->getSlice()->getSPS()->getUseAdvRP() > 0
     827    && pcCU->getARPW( uiPartAddr ) > 0
     828    && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC()
     829    && (pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N || pcCU->isSkipped(uiPartAddr))
     830    )
     831  {
     832    xPredInterUniARP( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , iPartIdx , bi );
     833  }
     834  else
     835  {
     836#endif
    813837#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    814838  if( pcCU->getSlice()->getSPS()->isDepth() )
     
    911935   }
    912936#endif
    913 }
    914 
     937#if QC_ARP_D0177
     938  }
     939#endif
     940}
     941
     942#if QC_ARP_D0177
     943Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi, TComMvField * pNewMvFiled )
     944{
     945  Int         iRefIdx     = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );           
     946  TComMv      cMv         = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr );
     947  Bool        bTobeScaled = false;
     948  UChar dW = pcCU->getARPW ( uiPartAddr );
     949  TComPic* pcPicYuvBaseCol =  NULL;
     950  TComPic* pcPicYuvBaseRef =  NULL;
     951  DisInfo cDistparity;
     952
     953  if( pNewMvFiled )
     954  {
     955    iRefIdx = pNewMvFiled->getRefIdx();
     956    cMv = pNewMvFiled->getMv();
     957  }
     958
     959#if QC_CU_NBDV_D0181
     960  cDistparity.bDV           = pcCU->getDvInfo(uiPartAddr).bDV;
     961  if( cDistparity.bDV )
     962  {
     963#if MERL_VSP_C0152
     964    cDistparity.m_acMvCand[0] = pcCU->getDvInfo(0).m_acMvCandNoRef[0];
     965#else
     966    cDistparity.m_acMvCand[0] = pcCU->getDvInfo(0).m_acMvCand[0];
     967#endif
     968    assert(pcCU->getDvInfo(uiPartAddr).bDV ==  pcCU->getDvInfo(0).bDV);
     969    cDistparity.m_aVIdxCan[0] = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan[0];
     970    cDistparity.iN            = pcCU->getDvInfo(uiPartAddr).iN;
     971  }
     972  else
     973    cDistparity.iN    =  0;
     974#else
     975  pcCU->getDisMvpCandNBDV( iPartIdx, uiPartAddr,  &cDistparity, false );
     976#endif
     977
     978  dW = !cDistparity.iN ? 0: dW;
     979  if( cDistparity.iN )
     980  {
     981    if(dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC()!= pcCU->getSlice()->getPOC())
     982      bTobeScaled = true;
     983    pcPicYuvBaseCol =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(),                              cDistparity.m_aVIdxCan[0] );
     984    pcPicYuvBaseRef =  pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC(), cDistparity.m_aVIdxCan[0] );
     985    if( (!pcPicYuvBaseCol || pcPicYuvBaseCol->getPOC() != pcCU->getSlice()->getPOC()) || (!pcPicYuvBaseRef || pcPicYuvBaseRef->getPOC() != pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() ))
     986    {
     987      dW = 0;
     988      bTobeScaled = false;
     989    }
     990    else
     991      assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, 0 )->getPOC() );
     992    if(bTobeScaled)
     993    {     
     994      Int iCurrPOC = pcCU->getSlice()->getPOC();
     995      Int iColRefPOC  = pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx );
     996      Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList,  0);
     997      Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iCurrPOC, iColRefPOC);
     998      if ( iScale != 4096 )
     999        cMv = cMv.scaleMv( iScale );
     1000      iRefIdx = 0;
     1001    }
     1002  }
     1003  pcCU->clipMv(cMv);
     1004  TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec();
     1005  xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
     1006#if LGE_ILLUCOMP_B0045
     1007    , false
     1008#endif
     1009    , true
     1010    );
     1011  xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
     1012#if LGE_ILLUCOMP_B0045
     1013    , false
     1014#endif
     1015    , true
     1016    );
     1017  if( dW > 0 )
     1018  {
     1019    TComYuv * pYuvmB0 = &m_acYuvPredBase[0];
     1020    TComYuv * pYuvB1  = &m_acYuvPredBase[1];
     1021    assert ( cDistparity.iN == 1 );
     1022    pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec();
     1023    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cDistparity.m_acMvCand[0], iWidth, iHeight, pYuvB1, bi
     1024#if LGE_ILLUCOMP_B0045
     1025      , false
     1026#endif
     1027      ,  true
     1028      );
     1029    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cDistparity.m_acMvCand[0], iWidth, iHeight, pYuvB1, bi
     1030#if LGE_ILLUCOMP_B0045
     1031      , false
     1032#endif
     1033      , true
     1034      );
     1035    pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec();
     1036    TComMv cMVwithDisparity = cMv + cDistparity.m_acMvCand[0];
     1037    pcCU->clipMv(cMVwithDisparity);
     1038    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvmB0, bi
     1039#if LGE_ILLUCOMP_B0045
     1040      , false
     1041#endif
     1042      , true
     1043      );
     1044    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvmB0, bi
     1045#if LGE_ILLUCOMP_B0045
     1046      , false
     1047#endif
     1048      , true
     1049      );
     1050    pYuvB1->subtractARP( pYuvB1 , pYuvmB0 , uiPartAddr , iWidth , iHeight );
     1051    if(dW == 2)
     1052      pYuvB1->multiplyARP( uiPartAddr , iWidth , iHeight , dW );
     1053    rpcYuvPred->addARP( rpcYuvPred , pYuvB1 , uiPartAddr , iWidth , iHeight , !bi );
     1054  }
     1055}
     1056#endif
    9151057
    9161058#if MERL_VSP_C0152
     
    11081250 */
    11091251#if LGE_ILLUCOMP_B0045
    1110 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag)
    1111 #else
    1112 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi )
     1252Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag
     1253#if QC_ARP_D0177
     1254    ,
     1255    Int filterType
     1256#endif
     1257    )
     1258#else
     1259Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi
     1260#if QC_ARP_D0177
     1261    ,
     1262    Int filterType
     1263#endif
     1264    )
    11131265#endif
    11141266{
     
    11291281  if ( yFrac == 0 )
    11301282  {
    1131     m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac,       !bi );
     1283    m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac,       !bi
     1284#if QC_ARP_D0177
     1285    ,
     1286    filterType
     1287#endif
     1288    );
    11321289  }
    11331290  else if ( xFrac == 0 )
    11341291  {
    1135     m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi );
     1292    m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi
     1293#if QC_ARP_D0177
     1294    ,
     1295    filterType
     1296#endif
     1297    );
    11361298  }
    11371299  else
     
    11431305    Int halfFilterSize = ( filterSize >> 1 );
    11441306
    1145     m_if.filterHorLuma(ref - (halfFilterSize-1)*refStride, refStride, tmp, tmpStride, width, height+filterSize-1, xFrac, false     );
    1146     m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height,              yFrac, false, !bi);   
     1307    m_if.filterHorLuma(ref - (halfFilterSize-1)*refStride, refStride, tmp, tmpStride, width, height+filterSize-1, xFrac, false     
     1308 #if QC_ARP_D0177
     1309    ,
     1310    filterType
     1311#endif
     1312    );
     1313    m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height,              yFrac, false, !bi
     1314 #if QC_ARP_D0177
     1315    ,
     1316    filterType
     1317#endif
     1318    );   
    11471319  }
    11481320
     
    11851357 */
    11861358#if LGE_ILLUCOMP_B0045
    1187 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag )
    1188 #else
    1189 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi )
     1359Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag
     1360#if QC_ARP_D0177
     1361    ,
     1362    Int filterType
     1363#endif   
     1364    )
     1365#else
     1366Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi
     1367#if QC_ARP_D0177
     1368  , Int filterType
     1369#endif
     1370  )
    11901371#endif
    11911372{
     
    12151396  if ( yFrac == 0 )
    12161397  {
    1217     m_if.filterHorChroma(refCb, refStride, dstCb,  dstStride, cxWidth, cxHeight, xFrac, !bi);   
    1218     m_if.filterHorChroma(refCr, refStride, dstCr,  dstStride, cxWidth, cxHeight, xFrac, !bi);   
     1398    m_if.filterHorChroma(refCb, refStride, dstCb,  dstStride, cxWidth, cxHeight, xFrac, !bi
     1399#if QC_ARP_D0177
     1400    ,
     1401    filterType
     1402#endif   
     1403    );   
     1404    m_if.filterHorChroma(refCr, refStride, dstCr,  dstStride, cxWidth, cxHeight, xFrac, !bi
     1405#if QC_ARP_D0177
     1406    ,
     1407    filterType
     1408#endif   
     1409    );   
    12191410  }
    12201411  else if ( xFrac == 0 )
    12211412  {
    1222     m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi);   
    1223     m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi);   
     1413    m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi
     1414 #if QC_ARP_D0177
     1415    ,
     1416    filterType
     1417#endif   
     1418    );   
     1419    m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi
     1420 #if QC_ARP_D0177
     1421    ,
     1422    filterType
     1423#endif   
     1424    );   
    12241425  }
    12251426  else
    12261427  {
    1227     m_if.filterHorChroma(refCb - (halfFilterSize-1)*refStride, refStride, extY,  extStride, cxWidth, cxHeight+filterSize-1, xFrac, false);
    1228     m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight  , yFrac, false, !bi);
     1428    m_if.filterHorChroma(refCb - (halfFilterSize-1)*refStride, refStride, extY,  extStride, cxWidth, cxHeight+filterSize-1, xFrac, false
     1429#if QC_ARP_D0177
     1430    ,
     1431    filterType
     1432#endif   
     1433    );
     1434    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight  , yFrac, false, !bi
     1435#if QC_ARP_D0177
     1436    ,
     1437    filterType
     1438#endif   
     1439    );
    12291440   
    1230     m_if.filterHorChroma(refCr - (halfFilterSize-1)*refStride, refStride, extY,  extStride, cxWidth, cxHeight+filterSize-1, xFrac, false);
    1231     m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight  , yFrac, false, !bi);   
     1441    m_if.filterHorChroma(refCr - (halfFilterSize-1)*refStride, refStride, extY,  extStride, cxWidth, cxHeight+filterSize-1, xFrac, false
     1442#if QC_ARP_D0177
     1443    ,
     1444    filterType
     1445#endif   
     1446    );
     1447    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight  , yFrac, false, !bi
     1448#if QC_ARP_D0177
     1449    ,
     1450    filterType
     1451#endif   
     1452    );   
    12321453  }
    12331454#if LGE_ILLUCOMP_B0045
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComPrediction.h

    r332 r373  
    6969  TComYuv   m_acYuvPred[2];
    7070  TComYuv   m_cYuvPredTemp;
     71#if QC_ARP_D0177
     72  TComYuv   m_acYuvPredBase[2];
     73  TComYuv   m_acYuvDiff[2];
     74#endif
    7175  TComYuv m_filteredBlock[4][4];
    7276  TComYuv m_filteredBlockTmp[4];
     
    8690 
    8791  // motion compensation functions
     92#if QC_ARP_D0177
     93  Void xPredInterUniARP       ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false, TComMvField * pNewMvFiled = NULL );
     94#endif
    8895#if MERL_VSP_C0152
    8996  Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,       UInt uiAbsPartIdx,        Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0, Bool bi=false );
     
    113120
    114121#if LGE_ILLUCOMP_B0045
    115   Void xPredInterLumaBlk  ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag = false );
    116   Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag = false );
    117 #else
    118   Void xPredInterLumaBlk  ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi );
    119   Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi );
     122  Void xPredInterLumaBlk  ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag = false
     123#if QC_ARP_D0177
     124    ,
     125    Int filterType = 0
     126#endif
     127    );
     128  Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag = false
     129#if QC_ARP_D0177
     130    ,
     131    Int filterType = 0
     132#endif
     133    );
     134#else
     135  Void xPredInterLumaBlk  ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi
     136#if QC_ARP_D0177
     137    ,
     138    Int filterType = 0
     139#endif
     140    );
     141  Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi
     142#if QC_ARP_D0177
     143    ,
     144    Int filterType = 0
     145#endif
     146    );
    120147#endif
    121148  Void xWeightedAverage         ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst );
     
    169196#endif
    170197
    171 #if H3D_IVRP
     198#if H3D_IVRP & !QC_ARP_D0177
    172199  Void residualPrediction         (TComDataCU* pcCU, TComYuv* pcYuvPred, TComYuv* pcYuvResPred);
    173200#endif
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComResidualGenerator.cpp

    r351 r373  
    4444
    4545
    46 #if H3D_IVRP
     46#if H3D_IVRP & !QC_ARP_D0177
    4747
    4848
     
    225225  }
    226226}
    227 
     227#endif
     228
     229#if !QC_ARP_D0177
    228230#if H3D_NBDV
    229231Bool
     
    249251}
    250252 
    251 #if H3D_NBDV
     253#if H3D_NBDV 
    252254Bool
    253255TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, TComMv iDisp, Bool bRecon) 
     
    263265  }
    264266  UInt uiXPosInRefView = uiXPos , uiYPosInRefView = uiYPos;
     267#if QC_ARP_D0177
     268  if(pcPic->getSPS()->getMultiviewResPredMode())
     269  {
     270#endif
    265271#if H3D_NBDV
    266272  xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, iDisp, &uiXPosInRefView , &uiYPosInRefView , bRecon  );
     
    269275#endif
    270276  return true;
     277#if QC_ARP_D0177
     278  }
     279  else
     280    return true;
     281#endif
    271282}
    272283
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComResidualGenerator.h

    r332 r373  
    5050
    5151
    52 #if H3D_IVRP
     52#if H3D_IVRP & !QC_ARP_D0177
    5353
    5454class TComResidualGenerator
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComSlice.cpp

    r332 r373  
    13861386}
    13871387#endif
    1388 
     1388#if QC_ARP_D0177
     1389Void TComSlice::setARPStepNum()                                 
     1390{
     1391  Bool bAllIvRef = false;
     1392  if(!getSPS()->getUseAdvRP())
     1393    m_nARPStepNum = 0;
     1394  else
     1395  {
     1396    for( Int iRefListId = 0; iRefListId < 2; iRefListId++ )
     1397    {
     1398      RefPicList  eRefPicList = RefPicList( iRefListId );
     1399      Int iNumRefIdx = getNumRefIdx(eRefPicList);
     1400      if( iNumRefIdx <= 0 )
     1401        continue;
     1402      for (Int i = 0; i < iNumRefIdx; i++)
     1403      {
     1404        if(getRefPic( REF_PIC_LIST_0, i)->getPOC() != getPOC())
     1405        {
     1406          bAllIvRef = true;
     1407          break;
     1408        }
     1409      }
     1410      if( bAllIvRef == true )
     1411        break;
     1412    }
     1413    if(bAllIvRef== true)
     1414      m_nARPStepNum = getSPS()->getARPStepNum();
     1415    else
     1416      m_nARPStepNum = 0;
     1417  }
     1418}
     1419#endif
    13891420// ------------------------------------------------------------------------------------------------
    13901421// Video parameter set (VPS)
     
    15761607  m_uiMultiviewMvPredMode    = 0;
    15771608#endif
    1578 
     1609#if QC_ARP_D0177
     1610  m_nUseAdvResPred           = 0;
     1611  m_nARPStepNum              = 1;
     1612#endif
    15791613  ::memset( m_aiUsableInterViewRefs, 0, sizeof( m_aiUsableInterViewRefs ) );
    15801614 
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComSlice.h

    r332 r373  
    5454class TComDepthMapGenerator;
    5555#endif
    56 #if H3D_IVRP
     56#if H3D_IVRP & !QC_ARP_D0177
    5757class TComResidualGenerator;
    5858#endif
     
    390390#endif
    391391#if H3D_IVRP
     392#if QC_ARP_D0177
     393  UInt         m_nUseAdvResPred;
     394  UInt         m_nARPStepNum;
     395#else
    392396  UInt  m_uiMultiviewResPredMode;
     397#endif
    393398#endif
    394399
     
    396401  TComDepthMapGenerator* m_pcDepthMapGenerator;
    397402#endif
    398 #if H3D_IVRP
     403#if H3D_IVRP & !QC_ARP_D0177
    399404  TComResidualGenerator* m_pcResidualGenerator;
    400405#endif
     
    643648  Void setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode = 0, UInt uiPdmMvPredMode = 0, UInt uiPdmPrec = 0, Int** aaiPdmScaleNomDelta = 0, Int** aaiPdmOffset = 0 );
    644649#endif
    645 #if H3D_IVRP
     650#if H3D_IVRP & !QC_ARP_D0177
    646651  Void  setMultiviewResPredMode  ( UInt uiResPrdMode ) { m_uiMultiviewResPredMode = uiResPrdMode; }
    647652#endif
     
    658663#endif
    659664#if H3D_IVRP
     665#if QC_ARP_D0177
     666  UInt  getUseAdvRP()              { return m_nUseAdvResPred;   }
     667  Void  setUseAdvRP(UInt n)        { m_nUseAdvResPred = n;      }
     668  UInt  getARPStepNum()            { return m_nARPStepNum;      }
     669  Void  setARPStepNum(UInt n)      { m_nARPStepNum = n;         }
     670#else
    660671  UInt  getMultiviewResPredMode  ()          { return m_uiMultiviewResPredMode;   }
     672#endif
    661673#endif
    662674
     
    665677  TComDepthMapGenerator*  getDepthMapGenerator()                                              { return m_pcDepthMapGenerator; }
    666678#endif
    667 #if H3D_IVRP
     679#if H3D_IVRP & !QC_ARP_D0177
    668680  Void                    setResidualGenerator( TComResidualGenerator* pcResidualGenerator )  { m_pcResidualGenerator = pcResidualGenerator; }
    669681  TComResidualGenerator*  getResidualGenerator()                                              { return m_pcResidualGenerator; }
     
    11071119  Bool        m_bApplyIC;
    11081120#endif
     1121#if QC_ARP_D0177
     1122  TComList<TComPic*> * m_pBaseViewRefPicList[MAX_VIEW_NUM];
     1123  UInt                 m_nARPStepNum;
     1124#endif
    11091125#if INTER_VIEW_VECTOR_SCALING_C0115|QC_MVHEVC_B0046
    11101126  Bool       m_bIVScalingFlag;
     
    12531269  Void      setRefPicListMvc    ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics );
    12541270  Void      setRefPOCnViewListsMvc();
    1255 
     1271#if QC_ARP_D0177
     1272  Void      setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx )      { m_pBaseViewRefPicList[iViewIdx] = pListPic; }
     1273  TComPic*  getBaseViewRefPic    ( UInt uiPOC , Int iViewIdx )                       { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); }
     1274  Void      setARPStepNum();                                 
     1275  UInt      getARPStepNum( )                                      { return m_nARPStepNum;      } 
     1276#endif
    12561277  Void      setColDir           ( UInt uiDir ) { m_uiColDir = uiDir; }
    12571278#if COLLOCATED_REF_IDX
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComYuv.cpp

    r332 r373  
    741741  }
    742742}
     743#if QC_ARP_D0177
     744Void TComYuv::addARP(TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip )
     745{
     746  addARPLuma   ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth   , uiHeight    , bClip );
     747  addARPChroma ( pcYuvSrc0, pcYuvSrc1, uiAbsPartIdx, uiWidth>>1, uiHeight>>1 , bClip );
     748}
     749
     750Void TComYuv::addARPLuma(TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip )
     751{
     752  Int x, y;
     753
     754  Pel* pSrc0 = pcYuvSrc0->getLumaAddr( uiAbsPartIdx );
     755  Pel* pSrc1 = pcYuvSrc1->getLumaAddr( uiAbsPartIdx );
     756  Pel* pDst  = getLumaAddr( uiAbsPartIdx );
     757
     758  UInt iSrc0Stride = pcYuvSrc0->getStride();
     759  UInt iSrc1Stride = pcYuvSrc1->getStride();
     760  UInt iDstStride  = getStride();
     761  for ( y = uiHeight-1; y >= 0; y-- )
     762  {
     763    for ( x = uiWidth-1; x >= 0; x-- )
     764    {
     765      pDst[x] = pSrc0[x] + pSrc1[x];
     766      if( bClip )
     767        pDst[x] = Clip( pDst[x] );
     768    }
     769    pSrc0 += iSrc0Stride;
     770    pSrc1 += iSrc1Stride;
     771    pDst  += iDstStride;
     772  }
     773}
     774
     775Void TComYuv::addARPChroma(TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip )
     776{
     777  Int x, y;
     778
     779  Pel* pSrcU0 = pcYuvSrc0->getCbAddr( uiAbsPartIdx );
     780  Pel* pSrcU1 = pcYuvSrc1->getCbAddr( uiAbsPartIdx );
     781  Pel* pSrcV0 = pcYuvSrc0->getCrAddr( uiAbsPartIdx );
     782  Pel* pSrcV1 = pcYuvSrc1->getCrAddr( uiAbsPartIdx );
     783  Pel* pDstU = getCbAddr( uiAbsPartIdx );
     784  Pel* pDstV = getCrAddr( uiAbsPartIdx );
     785
     786  UInt  iSrc0Stride = pcYuvSrc0->getCStride();
     787  UInt  iSrc1Stride = pcYuvSrc1->getCStride();
     788  UInt  iDstStride  = getCStride();
     789  for ( y = uiHeight-1; y >= 0; y-- )
     790  {
     791    for ( x = uiWidth-1; x >= 0; x-- )
     792    {
     793      pDstU[x] = pSrcU0[x] + pSrcU1[x];
     794      pDstV[x] = pSrcV0[x] + pSrcV1[x];
     795      if( bClip )
     796      {
     797        pDstU[x] = Clip( pDstU[x] );
     798        pDstV[x] = Clip( pDstV[x] );
     799      }
     800    }
     801
     802    pSrcU0 += iSrc0Stride;
     803    pSrcU1 += iSrc1Stride;
     804    pSrcV0 += iSrc0Stride;
     805    pSrcV1 += iSrc1Stride;
     806    pDstU  += iDstStride;
     807    pDstV  += iDstStride;
     808  }
     809}
     810
     811Void TComYuv::subtractARP(TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight)
     812{
     813  subtractARPLuma  ( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth    , uiHeight    );
     814  subtractARPChroma( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth>>1 , uiHeight>>1 );
     815}
     816
     817Void TComYuv::subtractARPLuma(TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight)
     818{
     819  Int x, y;
     820
     821  Pel* pSrc0 = pcYuvSrc0->getLumaAddr( uiAbsPartIdx );
     822  Pel* pSrc1 = pcYuvSrc1->getLumaAddr( uiAbsPartIdx );
     823  Pel* pDst  = getLumaAddr( uiAbsPartIdx );
     824
     825  Int  iSrc0Stride = pcYuvSrc0->getStride();
     826  Int  iSrc1Stride = pcYuvSrc1->getStride();
     827  Int  iDstStride  = getStride();
     828  for ( y = uiHeight-1; y >= 0; y-- )
     829  {
     830    for ( x = uiWidth-1; x >= 0; x-- )
     831    {
     832      pDst[x] = pSrc0[x] - pSrc1[x];
     833    }
     834    pSrc0 += iSrc0Stride;
     835    pSrc1 += iSrc1Stride;
     836    pDst  += iDstStride;
     837  }
     838}
     839
     840Void TComYuv::subtractARPChroma(TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight)
     841{
     842  Int x, y;
     843
     844  Pel* pSrcU0 = pcYuvSrc0->getCbAddr( uiAbsPartIdx );
     845  Pel* pSrcU1 = pcYuvSrc1->getCbAddr( uiAbsPartIdx );
     846  Pel* pSrcV0 = pcYuvSrc0->getCrAddr( uiAbsPartIdx );
     847  Pel* pSrcV1 = pcYuvSrc1->getCrAddr( uiAbsPartIdx );
     848  Pel* pDstU  = getCbAddr( uiAbsPartIdx );
     849  Pel* pDstV  = getCrAddr( uiAbsPartIdx );
     850
     851  Int  iSrc0Stride = pcYuvSrc0->getCStride();
     852  Int  iSrc1Stride = pcYuvSrc1->getCStride();
     853  Int  iDstStride  = getCStride();
     854  for ( y = uiHeight-1; y >= 0; y-- )
     855  {
     856    for ( x = uiWidth-1; x >= 0; x-- )
     857    {
     858      pDstU[x] = pSrcU0[x] - pSrcU1[x];
     859      pDstV[x] = pSrcV0[x] - pSrcV1[x];
     860    }
     861    pSrcU0 += iSrc0Stride;
     862    pSrcU1 += iSrc1Stride;
     863    pSrcV0 += iSrc0Stride;
     864    pSrcV1 += iSrc1Stride;
     865    pDstU  += iDstStride;
     866    pDstV  += iDstStride;
     867  }
     868}
     869
     870Void TComYuv::multiplyARP( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW )
     871{
     872  multiplyARPLuma( uiAbsPartIdx , uiWidth , uiHeight , dW );
     873  multiplyARPChroma( uiAbsPartIdx , uiWidth >> 1 , uiHeight >> 1 , dW );
     874}
     875
     876Void TComYuv::xxMultiplyLine( Pel * pSrcDst , UInt uiWidth , UChar dW )
     877{
     878  assert( dW == 2 );
     879  for( UInt x = 0 ; x < uiWidth ; x++ )
     880    pSrcDst[x] =  pSrcDst[x] >> 1;
     881}
     882
     883Void TComYuv::multiplyARPLuma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW )
     884{
     885  Pel* pDst  = getLumaAddr( uiAbsPartIdx );
     886  Int  iDstStride  = getStride();
     887  for ( Int y = uiHeight-1; y >= 0; y-- )
     888  {
     889    xxMultiplyLine( pDst , uiWidth , dW );
     890    pDst  += iDstStride;
     891  }
     892}
     893
     894Void TComYuv::multiplyARPChroma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW )
     895{
     896  Pel* pDstU  = getCbAddr( uiAbsPartIdx );
     897  Pel* pDstV  = getCrAddr( uiAbsPartIdx );
     898
     899  Int  iDstStride  = getCStride();
     900  for ( Int y = uiHeight-1; y >= 0; y-- )
     901  {
     902    xxMultiplyLine( pDstU , uiWidth , dW );
     903    xxMultiplyLine( pDstV , uiWidth , dW );
     904    pDstU  += iDstStride;
     905    pDstV  += iDstStride;
     906  }
     907}
     908#endif
    743909//! \}
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TComYuv.h

    r332 r373  
    199199
    200200  __inline Pel  xClip  (Pel x )      { return ( (x < 0) ? 0 : (x > (Pel)g_uiIBDI_MAX) ? (Pel)g_uiIBDI_MAX : x ); }
     201#if QC_ARP_D0177
     202  Void    addARP           ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip );
     203  Void    addARPLuma       ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip );
     204  Void    addARPChroma     ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip );
     205  Void    subtractARP      ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight );
     206  Void    subtractARPLuma  ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight );
     207  Void    subtractARPChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight );
     208  Void    multiplyARP      ( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW );
     209  Void    multiplyARPLuma  ( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW );
     210  Void    multiplyARPChroma( UInt uiAbsPartIdx , UInt uiWidth , UInt uiHeight , UChar dW );
     211private:
     212  Void    xxMultiplyLine( Pel * pSrcDst , UInt uiWidth , UChar dW );
     213#endif
    201214};// END CLASS DEFINITION TComYuv
    202215
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon/TypeDef.h

    r351 r373  
    9595                                              // FIX_LG_RESTRICTEDRESPRED_M24766   1
    9696
     97#define QC_ARP_D0177            1      ////< advanced residual prediction
     98#if QC_ARP_D0177
     99#define QC_ARP_WFNR       3
     100#endif
    97101///// ***** DISPARITY VECTOR DERIVATION *********
    98102#define H3D_NBDV                          1   // Neighboring block disparity derivation
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r332 r373  
    14931493#endif
    14941494#if H3D_IVRP
    1495     pcSPS->setMultiviewResPredMode  ( 0 );
    1496 #endif
     1495#if QC_ARP_D0177
     1496     pcSPS->setUseAdvRP  ( 0 );
     1497     pcSPS->setARPStepNum( 1 );
     1498#else
     1499     pcSPS->setMultiviewResPredMode  ( 0 );
     1500#endif
     1501#endif
     1502
    14971503    }
    14981504    else
     
    15441550#endif
    15451551#if H3D_IVRP
     1552#if QC_ARP_D0177
     1553      pcSPS->setUseAdvRP  ( 0 );
     1554      pcSPS->setARPStepNum( 1 );
     1555#else
    15461556      pcSPS->setMultiviewResPredMode  ( 0 );
    15471557#endif
     1558#endif
     1559
    15481560      }
    15491561      else
     
    15731585        UInt uiMultiviewMvPredMode = 0;
    15741586#endif
    1575 #if H3D_IVRP
     1587#if H3D_IVRP & !QC_ARP_D0177
    15761588      UInt uiMultiviewResPredMode = 0;
    15771589#endif
     
    15881600          READ_UVLC( uiMultiviewMvPredMode, "multi_view_mv_pred_mode" );
    15891601#endif
    1590 #if H3D_IVRP
     1602#if H3D_IVRP & !QC_ARP_D0177
    15911603          READ_FLAG( uiMultiviewResPredMode, "multi_view_residual_pred_mode" );
    15921604#endif
     
    15991611#endif
    16001612#if H3D_IVRP
     1613#if QC_ARP_D0177
     1614      READ_FLAG( uiCode , "advanced_residual_pred_flag" );           pcSPS->setUseAdvRP( uiCode );
     1615      if( pcSPS->getUseAdvRP()  )
     1616          pcSPS->setARPStepNum( QC_ARP_WFNR );
     1617      else
     1618       pcSPS->setARPStepNum( 1 );
     1619#else
    16011620      pcSPS->setMultiviewResPredMode  ( uiMultiviewResPredMode );
    16021621#endif
     1622#endif
     1623
    16031624      }
    16041625    }
     
    24242445}
    24252446#endif
    2426 
     2447#if QC_ARP_D0177
     2448Void TDecCavlc::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2449{
     2450  assert( false );
     2451}
     2452#endif
    24272453#if RWTH_SDC_DLT_B0036
    24282454Void TDecCavlc::parseSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCAVLC.h

    r332 r373  
    144144  Void parseResPredFlag     ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth );
    145145#endif
     146#if QC_ARP_D0177
     147  Void parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx,UInt uiDepth );
     148#endif
    146149  Void parseSplitFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    147150  Void parsePartSize        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCu.cpp

    r351 r373  
    5454  m_ppcYuvResi = NULL;
    5555  m_ppcYuvReco = NULL;
    56 #if H3D_IVRP
     56#if H3D_IVRP & !QC_ARP_D0177
    5757  m_ppcYuvResPred = NULL;
    5858#endif
     
    8282  m_ppcYuvResi = new TComYuv*[m_uiMaxDepth-1];
    8383  m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1];
    84 #if H3D_IVRP
     84#if H3D_IVRP & !QC_ARP_D0177
    8585  m_ppcYuvResPred = new TComYuv*   [m_uiMaxDepth-1];
    8686#endif
     
    9696    m_ppcYuvResi[ui] = new TComYuv;    m_ppcYuvResi[ui]->create( uiWidth, uiHeight );
    9797    m_ppcYuvReco[ui] = new TComYuv;    m_ppcYuvReco[ui]->create( uiWidth, uiHeight );
    98 #if H3D_IVRP
     98#if H3D_IVRP & !QC_ARP_D0177
    9999    m_ppcYuvResPred[ui] = new TComYuv;    m_ppcYuvResPred[ui]->create( uiWidth, uiHeight );
    100100#endif
     
    120120    m_ppcYuvResi[ui]->destroy(); delete m_ppcYuvResi[ui]; m_ppcYuvResi[ui] = NULL;
    121121    m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL;
    122 #if H3D_IVRP
     122#if H3D_IVRP & !QC_ARP_D0177
    123123    m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL;
    124124#endif
     
    128128  delete [] m_ppcYuvResi; m_ppcYuvResi = NULL;
    129129  delete [] m_ppcYuvReco; m_ppcYuvReco = NULL;
    130 #if H3D_IVRP
     130#if H3D_IVRP & !QC_ARP_D0177
    131131  delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL;
    132132#endif
     
    317317      if(!pcCU->getSlice()->isIntra())
    318318      {
     319#if QC_ARP_D0177
     320        if(( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() || pcCU->getSlice()->getSPS()->getUseAdvRP())             && pcCU->getSlice()->getViewId())
     321#else
    319322        if(( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() || pcCU->getSlice()->getSPS()->getMultiviewResPredMode()) && pcCU->getSlice()->getViewId())
     323#endif
    320324        { 
    321325          m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true );
     
    443447    }
    444448#endif
     449#if QC_ARP_D0177
     450    if( pcCU->getSlice()->getSPS()->getUseAdvRP() )
     451    {
     452      pcCU->setResPredAvailSubParts ( false, uiAbsPartIdx, 0, uiDepth );
     453      pcCU->setResPredFlagSubParts  ( false, uiAbsPartIdx, 0, uiDepth );
     454      m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth, m_ppcCU[uiDepth], 0 );
     455    }
     456#endif
    445457    xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
    446458    return;
     
    494506  }
    495507#endif
    496 
     508#if QC_ARP_D0177
     509  if (pcCU->getSlice()->getSPS()->getUseAdvRP() && pcCU->isIntra( uiAbsPartIdx ) )
     510  {
     511    pcCU->setResPredAvailSubParts ( 0, uiAbsPartIdx, 0, uiDepth );
     512    pcCU->setResPredFlagSubParts  ( 0, uiAbsPartIdx, 0, uiDepth );
     513  }
     514#endif
    497515#if HHI_MPI
    498516    if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == uiDepth )
     
    704722  m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] );
    705723#endif
    706 #if H3D_IVRP
     724#if H3D_IVRP & !QC_ARP_D0177
    707725  if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
    708726  {
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecCu.h

    r296 r373  
    6161  TComYuv**           m_ppcYuvResi;       ///< array of residual buffer
    6262  TComYuv**           m_ppcYuvReco;       ///< array of prediction & reconstruction buffer
    63 #if H3D_IVRP
     63#if H3D_IVRP & !QC_ARP_D0177
    6464  TComYuv**           m_ppcYuvResPred;    ///< residual prediction buffer
    6565#endif
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.cpp

    r332 r373  
    108108}
    109109
     110#if QC_ARP_D0177
     111Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx )
     112{
     113  if( pcCU->getSlice()->getViewId() == 0 || pcCU->getSlice()->getIsDepth() == true || !pcCU->getSlice()->getARPStepNum() )
     114    return;
     115  assert( !pcCU->isIntra( uiAbsPartIdx ) );
     116  Bool bResPredAvailable = !pcCU->getSlice()->getARPStepNum() ? false: ((pcCU->getPartitionSize(uiAbsPartIdx)==SIZE_2Nx2N || pcCU->isSkipped(uiAbsPartIdx)) ? true: false);
     117  if(!bResPredAvailable)
     118    pcCU->setARPWSubParts( 0 , uiAbsPartIdx, uiDepth ); 
     119  else
     120    m_pcEntropyDecoderIf->parseARPW( pcCU , uiAbsPartIdx , uiDepth );
     121}
     122#endif
    110123Void TDecEntropy::decodeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    111124{
     
    189202  {
    190203    decodePUWise( pcCU, uiAbsPartIdx, uiDepth, pcSubCU );
     204#if QC_ARP_D0177
     205    if( pcCU->getSlice()->getSPS()->getUseAdvRP() )
     206    {
     207      decodeARPW( pcCU , uiAbsPartIdx , uiDepth, pcSubCU, 0  );
     208    }
     209#endif
    191210  }
    192211}
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecEntropy.h

    r332 r373  
    106106  virtual Void parseResPredFlag   ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    107107#endif
     108#if QC_ARP_D0177
     109  virtual Void parseARPW         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     110#endif
    108111  virtual Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    109112  virtual Void parsePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     
    198201  Void decodeMergeFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
    199202  Void decodeMergeIndex        ( TComDataCU* pcSubCU, UInt uiPartIdx, UInt uiPartAddr, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth );
     203#if QC_ARP_D0177
     204  Void decodeARPW              ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx );
     205#endif
    200206  Void decodePredMode          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    201207  Void decodePartSize          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecGop.cpp

    r296 r373  
    9393                   ,TComDepthMapGenerator*  pcDepthMapGenerator
    9494#endif
    95 #if H3D_IVRP
     95#if H3D_IVRP & !QC_ARP_D0177
    9696                  ,TComResidualGenerator*  pcResidualGenerator
    9797#endif
     
    109109  m_pcDepthMapGenerator   = pcDepthMapGenerator;
    110110#endif
    111 #if H3D_IVRP
     111#if H3D_IVRP & !QC_ARP_D0177
    112112  m_pcResidualGenerator   = pcResidualGenerator;
    113113#endif
     
    298298      m_pcDepthMapGenerator->predictDepthMap  ( rpcPic );
    299299#endif
    300 #if H3D_IVRP
     300#if H3D_IVRP & !QC_ARP_D0177
    301301      m_pcResidualGenerator->initViewComponent( rpcPic );
    302302#endif
     
    331331  else
    332332  {
    333 #if H3D_IVRP
     333#if H3D_IVRP & !QC_ARP_D0177
    334334    // set residual picture
    335335    m_pcResidualGenerator->setRecResidualPic( rpcPic );
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecGop.h

    r296 r373  
    9090  TComDepthMapGenerator*  m_pcDepthMapGenerator;
    9191#endif
    92 #if H3D_IVRP
     92#if H3D_IVRP & !QC_ARP_D0177
    9393  TComResidualGenerator*  m_pcResidualGenerator;
    9494#endif
     
    118118                 ,TComDepthMapGenerator*  pcDepthMapGenerator
    119119#endif
    120 #if H3D_IVRP
     120#if H3D_IVRP & !QC_ARP_D0177
    121121                ,TComResidualGenerator*  pcResidualGenerator
    122122#endif
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp

    r332 r373  
    6464#if H3D_IVRP
    6565, m_cResPredFlagSCModel       ( 1,             1,               NUM_RES_PRED_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     66#endif
     67#if QC_ARP_D0177
     68, m_cCUPUARPW                 ( 1,             1,               NUM_ARPW_CTX                 , m_contextModels + m_numContextModels, m_numContextModels)
    6669#endif
    6770, m_cCUPartSizeSCModel        ( 1,             1,               NUM_PART_SIZE_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     
    162165  m_cResPredFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_RES_PRED_FLAG );
    163166#endif
     167#if QC_ARP_D0177
     168  m_cCUPUARPW.initBuffer                ( sliceType, qp, (UChar*)INIT_ARPW );
     169#endif
    164170  m_cCUAlfCtrlFlagSCModel.initBuffer     ( sliceType, qp, (UChar*)INIT_ALF_CTRL_FLAG );
    165171  m_cCUPartSizeSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_PART_SIZE );
     
    248254#if H3D_IVRP
    249255  m_cResPredFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_RES_PRED_FLAG );
     256#endif
     257#if QC_ARP_D0177
     258  m_cCUPUARPW.initBuffer                 ( eSliceType, iQp, (UChar*)INIT_ARPW );
    250259#endif
    251260  m_cCUAlfCtrlFlagSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_ALF_CTRL_FLAG );
     
    22352244}
    22362245#endif
    2237 
     2246#if QC_ARP_D0177
     2247Void TDecSbac::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2248{
     2249  UInt nMaxW = pcCU->getSlice()->getARPStepNum() - 1;
     2250  assert (nMaxW >= 0);
     2251  UInt nW = 0;
     2252  if( nMaxW > 0 )
     2253  {
     2254    UInt nOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx);
     2255    assert( 0 <= nOffset && nOffset <= 2 );
     2256    UInt uiCode = 0;
     2257    m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPW.get( 0, 0, 0 + nOffset ) );
     2258    nW = uiCode;
     2259    if( nW == 1 )   
     2260    {
     2261      m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPW.get( 0, 0, 3 ) );
     2262      nW += ( uiCode == 1 );
     2263    }
     2264  }
     2265  pcCU->setARPWSubParts( ( UChar )( nW ) , uiAbsPartIdx, uiDepth ); 
     2266}
     2267#endif
    22382268#if LGE_EDGE_INTRA_A0070
    22392269Void TDecSbac::xParseEdgeIntraInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h

    r332 r373  
    176176  Void parseResPredFlag   ( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth );
    177177#endif
     178#if QC_ARP_D0177
     179  Void parseARPW          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     180#endif
    178181  Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    179182  Void parsePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     
    218221#if H3D_IVRP
    219222  ContextModel3DBuffer m_cResPredFlagSCModel;
     223#endif
     224#if QC_ARP_D0177
     225  ContextModel3DBuffer m_cCUPUARPW;
    220226#endif
    221227  ContextModel3DBuffer m_cCUPartSizeSCModel;
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecTop.cpp

    r332 r373  
    403403  m_cDepthMapGenerator.destroy();
    404404#endif
    405 #if H3D_IVRP
     405#if H3D_IVRP & !QC_ARP_D0177
    406406  m_cResidualGenerator.destroy();
    407407#endif
     
    420420                    , &m_cDepthMapGenerator
    421421#endif
    422 #if H3D_IVRP
     422#if H3D_IVRP & !QC_ARP_D0177
    423423                    , &m_cResidualGenerator
    424424#endif
     
    434434#endif
    435435#endif
    436 #if H3D_IVRP
     436#if H3D_IVRP & !QC_ARP_D0177
    437437  m_cResidualGenerator.init( &m_cTrQuant, &m_cDepthMapGenerator );
    438438#endif
     
    860860    }
    861861#endif
    862 #if H3D_IVRP
     862#if H3D_IVRP & !QC_ARP_D0177
    863863    m_cResidualGenerator.create( true, m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement );
    864864#endif
     
    10831083    std::vector<TComPic*> apcInterViewRefPics = m_tAppDecTop->getInterViewRefPics( m_viewId, pcSlice->getPOC(), m_isDepth, pcSlice->getSPS() );
    10841084    pcSlice->setRefPicListMvc( m_cListPic, apcInterViewRefPics );
    1085 
     1085#if QC_ARP_D0177
     1086    //pcSlice->setBaseViewRefPicList( m_tAppDecTop->getTDecTop( 0 , false )->getListPic() );
     1087    pcSlice->setARPStepNum();
     1088    if(pcSlice->getARPStepNum() > 1)
     1089    {
     1090      for(Int iViewIdx = 0; iViewIdx < pcSlice->getViewId(); iViewIdx ++ )
     1091        pcSlice->setBaseViewRefPicList( m_tAppDecTop->getTDecTop( iViewIdx, false )->getListPic(), iViewIdx );
     1092    }
     1093#endif
    10861094    // For generalized B
    10871095    // note: maybe not existed case (always L0 is copied to L1 if L1 is empty)
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibDecoder/TDecTop.h

    r296 r373  
    213213  TComDepthMapGenerator   m_cDepthMapGenerator;
    214214#endif
    215 #if H3D_IVRP
     215#if H3D_IVRP & !QC_ARP_D0177
    216216  TComResidualGenerator   m_cResidualGenerator;
    217217#endif
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.cpp

    r332 r373  
    711711        WRITE_UVLC( pcSPS->getMultiviewMvPredMode(), "multi_view_mv_pred_mode" );
    712712#endif
    713 #if H3D_IVRP
     713#if H3D_IVRP & !QC_ARP_D0177
    714714        WRITE_FLAG  ( pcSPS->getMultiviewResPredMode(), "multi_view_residual_pred_mode" );
    715715#endif
    716716      }
     717#endif
     718#if QC_ARP_D0177
     719      WRITE_FLAG( pcSPS->getUseAdvRP () ? 1 : 0,       "advanced_residual_pred_flag"  );
    717720#endif
    718721    }
     
    13211324}
    13221325#endif
    1323 
     1326#if QC_ARP_D0177
     1327Void TEncCavlc::codeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx )
     1328{
     1329  assert( false );
     1330}
     1331#endif
    13241332Void TEncCavlc::codeAlfCtrlFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
    13251333
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.h

    r332 r373  
    160160  Void codeResPredFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    161161#endif
     162#if QC_ARP_D0177
     163  virtual Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     164#endif
    162165  Void codeAlfCtrlFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    163166
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncCfg.h

    r332 r373  
    333333#endif
    334334#if H3D_IVRP
     335#if QC_ARP_D0177
     336  UInt      m_nUseAdvResPred;
     337  UInt      m_nARPStepNum;
     338#else
    335339  UInt        m_uiMultiviewResPredMode;
     340#endif
    336341#endif
    337342
     
    414419#endif
    415420#if H3D_IVRP
     421#if QC_ARP_D0177
     422  UInt       getUseAdvRP                    ()                  { return m_nUseAdvResPred; }
     423  Void       setUseAdvRP                    ( UInt  u )         { m_nUseAdvResPred = u;    }
     424  UInt       getARPStepNum                  ()                  { return m_nARPStepNum;    }
     425  Void       setARPStepNum                  ( UInt  u )         { m_nARPStepNum = u;       }
     426#else
    416427  Void      setMultiviewResPredMode         ( UInt  u )      { m_uiMultiviewResPredMode     = u; }
     428#endif
    417429#endif
    418430 
     
    809821  Int       getViewOrderIdx                 ()      { return  m_iViewOrderIdx; }    // will be changed to view_id
    810822#endif
     823
    811824};
    812825
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncCu.cpp

    r351 r373  
    6464  m_ppcBestCU      = new TComDataCU*[m_uhTotalDepth-1];
    6565  m_ppcTempCU      = new TComDataCU*[m_uhTotalDepth-1];
    66  
     66#if QC_ARP_D0177
     67  m_ppcWeightedTempCU = new TComDataCU*[m_uhTotalDepth-1];
     68#endif
    6769  m_ppcPredYuvBest = new TComYuv*[m_uhTotalDepth-1];
    6870  m_ppcResiYuvBest = new TComYuv*[m_uhTotalDepth-1];
     
    9193    m_ppcBestCU[i] = new TComDataCU; m_ppcBestCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) );
    9294    m_ppcTempCU[i] = new TComDataCU; m_ppcTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) );
    93    
     95#if QC_ARP_D0177
     96    m_ppcWeightedTempCU[i] = new TComDataCU; m_ppcWeightedTempCU[i]->create( uiNumPartitions, uiWidth, uiHeight, false, uiMaxWidth >> (m_uhTotalDepth - 1) );
     97#endif   
    9498    m_ppcPredYuvBest[i] = new TComYuv; m_ppcPredYuvBest[i]->create(uiWidth, uiHeight);
    9599    m_ppcResiYuvBest[i] = new TComYuv; m_ppcResiYuvBest[i]->create(uiWidth, uiHeight);
     
    170174    {
    171175      m_ppcResPredTmp [i]->destroy(); delete m_ppcResPredTmp[i];  m_ppcResPredTmp[i] = NULL;
     176    }
     177#endif
     178#if QC_ARP_D0177
     179    if(m_ppcWeightedTempCU[i])
     180    {
     181      m_ppcWeightedTempCU[i]->destroy(); delete m_ppcWeightedTempCU[i]; m_ppcWeightedTempCU[i] = NULL;
    172182    }
    173183#endif
     
    596606      if( rpcTempCU->getSlice()->getSliceType() != I_SLICE )
    597607      {
     608#if QC_ARP_D0177
     609        if(( rpcTempCU->getSlice()->getSPS()->getMultiviewMvPredMode() || rpcTempCU->getSlice()->getSPS()->getUseAdvRP()) && rpcTempCU->getSlice()->getViewId())
     610#else
    598611        if(( rpcTempCU->getSlice()->getSPS()->getMultiviewMvPredMode() || rpcTempCU->getSlice()->getSPS()->getMultiviewResPredMode()) && rpcTempCU->getSlice()->getViewId())
     612#endif
    599613        { 
    600614          PartSize ePartTemp = rpcTempCU->getPartitionSize(0);
     
    624638      {
    625639#if H3D_IVRP
     640#if QC_ARP_D0177
     641        Bool  bResPredAvailable   = false;
     642        Bool  bResPredAllowed     =                    (!rpcBestCU->getSlice()->getSPS()->isDepth                () );
     643        bResPredAllowed           = bResPredAllowed && ( rpcBestCU->getSlice()->getSPS()->getViewId              () );
     644        if( bResPredAllowed )
     645        {
     646          bResPredAvailable       = rpcBestCU->getResidualSamples( 0, true, m_ppcResPredTmp[uiDepth] );
     647        }
     648        for( UInt uiResPrdId = 0; uiResPrdId < (rpcBestCU->getSlice()->getSPS()->getUseAdvRP()? 1: ( bResPredAvailable ? 2 : 1 )); uiResPrdId++ )
     649#else
    626650        Bool  bResPredAvailable   = false;
    627651        UInt uiResPrdId = 0;
     652#endif
    628653        {
    629654          Bool bResPredFlag  = ( uiResPrdId > 0 );
     
    743768      {
    744769#if H3D_IVRP
     770#if QC_ARP_D0177
     771        Bool  bResPredAvailable   = false;
     772        Bool  bResPredAllowed     =                    (!rpcBestCU->getSlice()->getSPS()->isDepth                () );
     773        bResPredAllowed           = bResPredAllowed && ( rpcBestCU->getSlice()->getSPS()->getViewId              () );
     774        if( bResPredAllowed )
     775        {
     776          bResPredAvailable       = rpcBestCU->getResidualSamples( 0, true, m_ppcResPredTmp[uiDepth] );
     777        }
     778        for( UInt uiResPrdId = 0; uiResPrdId < (rpcBestCU->getSlice()->getSPS()->getUseAdvRP()? 1: ( bResPredAvailable ? 2 : 1 )); uiResPrdId++ )
     779#else
    745780        Bool  bResPredAvailable   = false;
    746781        UInt uiResPrdId = 0;
     782#endif
    747783        {
    748784          Bool bResPredFlag  = ( uiResPrdId > 0 );
     
    17951831        );
    17961832#endif
     1833#if QC_ARP_D0177
     1834    m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx, 0, uiDepth);
     1835#endif
    17971836    finishCU(pcCU,uiAbsPartIdx,uiDepth);
    17981837    return;
     
    18611900  Int numValidMergeCand = 0;
    18621901
     1902#if QC_ARP_D0177
     1903  Bool  bResPrdAvail  = rpcTempCU->getResPredAvail( 0 );
     1904  Bool  bResPrdFlag   = rpcTempCU->getResPredFlag ( 0 );
     1905#endif
    18631906#if LGE_ILLUCOMP_B0045
    18641907  Bool  bICFlag = rpcTempCU->getICFlag(0);
     
    18931936  rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    18941937#endif
    1895 #if H3D_IVRP
     1938#if H3D_IVRP & !QC_ARP_D0177
    18961939  Bool bResPredAvail = rpcTempCU->getResPredAvail(0);
    18971940#endif
    18981941
    18991942  Bool bestIsSkip = false;
    1900  
     1943#if QC_ARP_D0177
     1944  Int nGRPW = rpcTempCU->getSlice()->getARPStepNum() - 1;
     1945  if(nGRPW < 0 || !bResPrdAvail )
     1946    nGRPW = 0;
     1947  for( ; nGRPW >= 0 ; nGRPW-- )
     1948  {
     1949#endif 
    19011950  for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
    19021951  {
     
    19321981          rpcTempCU->setPredModeSubParts( MODE_SKIP, 0, uhDepth ); // interprets depth relative to LCU level
    19331982          rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
     1983#if QC_ARP_D0177
     1984          if(rpcTempCU->getSlice()->getSPS()->getUseAdvRP())
     1985            rpcTempCU->setARPWSubParts( ( UChar )nGRPW , 0 , uhDepth );
     1986#endif
    19341987          rpcTempCU->setMergeFlagSubParts( true, 0, 0, uhDepth ); // interprets depth relative to LCU level
    19351988          rpcTempCU->setMergeIndexSubParts( uiMergeCand, 0, 0, uhDepth ); // interprets depth relative to LCU level
     
    19552008
    19562009#if H3D_IVRP
     2010#if !QC_ARP_D0177
    19572011          rpcTempCU->setResPredAvailSubParts(bResPredAvail, 0, 0, uhDepth);
     2012#else
     2013          rpcTempCU->setResPredAvailSubParts( bResPrdAvail, 0, 0, uhDepth );
     2014          rpcTempCU->setResPredFlagSubParts ( bResPrdFlag,  0, 0, uhDepth );
     2015#endif 
    19582016#endif
    19592017#if LGE_ILLUCOMP_B0045
    19602018          rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uhDepth);
    19612019#endif
    1962 
     2020#if QC_ARP_D0177
     2021          if(rpcTempCU->getSlice()->getSPS()->getUseAdvRP())
     2022          {
     2023            bool bSignalflag[2] = {true, true};
     2024            for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ )
     2025            {
     2026              Int iRefIdx = cMvFieldNeighbours[uiRefListIdx + 2*uiMergeCand].getRefIdx();
     2027              RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     2028              if(iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx))
     2029                bSignalflag[uiRefListIdx] = false;
     2030            }
     2031            if(!bSignalflag[0]&& !bSignalflag[1])
     2032            {
     2033              rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth );
     2034            }
     2035          }
     2036#endif
    19632037          // do MC
    19642038#if HHI_INTERVIEW_SKIP
     
    19732047            m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
    19742048#endif
    1975 #if H3D_IVRP
     2049#if H3D_IVRP & !QC_ARP_D0177
    19762050            if (uiMergeCand == 0 && rpcTempCU->getResPredAvail(0))
    19772051            {
     
    19922066              m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
    19932067#endif
    1994 #if H3D_IVRP
     2068#if H3D_IVRP & !QC_ARP_D0177
    19952069              if (uiMergeCand == 0 && rpcTempCU->getResPredAvail(0))
    19962070              {
     
    20492123    }
    20502124  }
     2125#if QC_ARP_D0177
     2126  }
     2127#endif
    20512128}
    20522129
     
    20662143{
    20672144  UChar uhDepth = rpcTempCU->getDepth( 0 );
    2068  
     2145#if QC_ARP_D0177
     2146  Bool bFirstTime = true;
     2147  Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1;
     2148  if(nARPWMax < 0 || !rpcTempCU->getResPredAvail( 0 ) )
     2149    nARPWMax = 0;
     2150  if( ePartSize != SIZE_2Nx2N)
     2151    nARPWMax = 0;
     2152  Int nARPWStart = 0 , nARPWStep = 1;
     2153  for( Int nCount = 0 , nGRPW = nARPWStart ; nCount <= nARPWMax ; nCount++ , nGRPW += nARPWStep )
     2154  {
     2155    if( bFirstTime == false && rpcTempCU->getSlice()->getSPS()->getUseAdvRP() )
     2156      rpcTempCU->initEstData( rpcTempCU->getDepth(0), rpcTempCU->getQP(0) );
     2157#endif 
    20692158#if HHI_VSO
    20702159  if( m_pcRdCost->getUseRenModel() )
     
    20932182  rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
    20942183
     2184#if QC_ARP_D0177
     2185  if(rpcTempCU->getSlice()->getSPS()->getUseAdvRP())
     2186    rpcTempCU->setARPWSubParts( ( UChar )nGRPW , 0 , uhDepth );
     2187#endif
     2188#if QC_ARP_D0177
     2189  if( bFirstTime == false && rpcTempCU->getSlice()->getSPS()->getUseAdvRP())
     2190  {
     2191    assert(!rpcTempCU->getSlice()->getSPS()->isDepth());
     2192    rpcTempCU->copyPartFrom( m_ppcWeightedTempCU[uhDepth] , 0 , uhDepth, true );
     2193    rpcTempCU->setARPWSubParts( ( UChar )nGRPW , 0 , uhDepth );
     2194#if MERL_VSP_C0152
     2195    m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth], 0);
     2196#else
     2197    m_pcPredSearch->motionCompensation( rpcTempCU , m_ppcPredYuvTemp[uhDepth] );
     2198#endif
     2199    if(rpcTempCU->getPartitionSize(0)==SIZE_2Nx2N)
     2200    {
     2201      bool bSignalflag[2] = {true, true};
     2202      for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ )
     2203      {
     2204        RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     2205        Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0);
     2206        if(iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx))
     2207          bSignalflag[uiRefListIdx] = false;
     2208      }
     2209      if(!bSignalflag[0]&& !bSignalflag[1])
     2210        rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth );
     2211    }
     2212  }
     2213  else
     2214  {
     2215    bFirstTime = false;
     2216#endif
    20952217#if AMP_MRG
    20962218  rpcTempCU->setMergeAMP (true);
     
    21072229#endif
    21082230#endif
     2231#if QC_ARP_D0177
     2232   if(rpcTempCU->getSlice()->getSPS()->getUseAdvRP())
     2233   {
     2234     m_ppcWeightedTempCU[uhDepth]->copyPartFrom( rpcTempCU , 0 , uhDepth );
     2235     if(rpcTempCU->getSlice()->getSPS()->getUseAdvRP() && rpcTempCU->getPartitionSize(0)==SIZE_2Nx2N)
     2236     {
     2237       bool bSignalflag[2] = {true, true};
     2238       for(UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx ++ )
     2239       {
     2240         RefPicList eRefList = uiRefListIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     2241         Int iRefIdx = rpcTempCU->getCUMvField(eRefList)->getRefIdx(0);
     2242         if(iRefIdx < 0 || rpcTempCU->getSlice()->getPOC() == rpcTempCU->getSlice()->getRefPOC(eRefList, iRefIdx))
     2243           bSignalflag[uiRefListIdx] = false;
     2244       }
     2245       if(!bSignalflag[0]&& !bSignalflag[1])
     2246         rpcTempCU->setARPWSubParts( 0 , 0 , uhDepth );
     2247     }
     2248   }
     2249  }
     2250#endif
    21092251
    21102252#if AMP_MRG
    21112253  if ( !rpcTempCU->getMergeAMP() )
    21122254  {
     2255#if QC_ARP_D0177
     2256    if(rpcTempCU->getSlice()->getSPS()->getUseAdvRP())
     2257      continue;
     2258    else
     2259#endif
    21132260    return;
    21142261  }
     
    21512298  xCheckDQP( rpcTempCU );
    21522299  xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth);
     2300#if QC_ARP_D0177
     2301  }
     2302#endif
    21532303}
    21542304
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncCu.h

    r296 r373  
    6969  TComDataCU**            m_ppcBestCU;      ///< Best CUs in each depth
    7070  TComDataCU**            m_ppcTempCU;      ///< Temporary CUs in each depth
     71#if QC_ARP_D0177
     72  TComDataCU**            m_ppcWeightedTempCU;   
     73#endif
    7174  UChar                   m_uhTotalDepth;
    7275 
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.cpp

    r332 r373  
    456456
    457457
     458#if QC_ARP_D0177
     459Void TEncEntropy::encodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD, UInt uiDepth)
     460{
     461  if( pcCU->getSlice()->getViewId() == 0 || pcCU->getSlice()->getIsDepth() == true || !pcCU->getSlice()->getARPStepNum() )
     462  {
     463    return;
     464  }
     465  assert( pcCU->isIntra( uiAbsPartIdx ) == false );
     466  if( bRD )
     467  {
     468    uiAbsPartIdx = 0;
     469  }
     470  bool bSignalflag[2] = {true, true};
     471  if (!(pcCU->getPartitionSize(uiAbsPartIdx)==SIZE_2Nx2N || pcCU->isSkipped(uiAbsPartIdx)))
     472  {
     473    assert(pcCU->getARPW (uiAbsPartIdx) == 0);
     474    bSignalflag[0] = false;
     475    bSignalflag[1] = false;
     476 }
     477  if (!(bSignalflag[0]|| bSignalflag[1]))
     478  {
     479    assert(pcCU->getARPW (uiAbsPartIdx) == 0);
     480    if (uiDepth != -1)
     481      pcCU->setARPWSubParts(0, uiAbsPartIdx, uiDepth);
     482  }
     483  else
     484     m_pcEntropyCoderIf->codeARPW( pcCU, uiAbsPartIdx );
     485 
     486}
     487#endif
    458488/** parse the fixed length code (smaller than one max value) in ALF
    459489 * \param run: coded value
     
    12331263  {
    12341264    encodePUWise( pcCU, uiAbsPartIdx, bRD );
     1265#if QC_ARP_D0177
     1266    encodeARPW( pcCU , uiAbsPartIdx , bRD );
     1267#endif
    12351268  }
    12361269}
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncEntropy.h

    r332 r373  
    117117  virtual Void codeResPredFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    118118#endif
     119#if QC_ARP_D0177
     120  virtual Void codeARPW         ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     121#endif
    119122  virtual Void codeSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    120123 
     
    250253  Void encodeMergeFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx );
    251254  Void encodeMergeIndex   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD = false );
     255#if QC_ARP_D0177
     256  Void encodeARPW              ( TComDataCU* pcCU, UInt uiAbspartIdx , Bool bRD = false, UInt uiDepth = -1);
     257#endif
    252258  Void encodeAlfCtrlFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    253259
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncGOP.cpp

    r332 r373  
    7878  m_pcDepthMapGenerator = NULL;
    7979#endif
    80 #if H3D_IVRP
     80#if H3D_IVRP & !QC_ARP_D0177
    8181  m_pcResidualGenerator = NULL;
    8282#endif
     
    131131  m_pcDepthMapGenerator  = pcTEncTop->getDepthMapGenerator();
    132132#endif
    133 #if H3D_IVRP
     133#if H3D_IVRP & !QC_ARP_D0177
    134134  m_pcResidualGenerator  = pcTEncTop->getResidualGenerator();
    135135#endif
     
    390390      std::vector<TComPic*> apcInterViewRefPics = tAppEncTop->getInterViewRefPics( m_pcEncTop->getViewId(), pcSlice->getPOC(), m_pcEncTop->getIsDepth(), pcSlice->getSPS() );
    391391      pcSlice->setRefPicListMvc( rcListPic, apcInterViewRefPics );
    392 
     392#if QC_ARP_D0177
     393      pcSlice->setARPStepNum();
     394      if(pcSlice->getARPStepNum() > 1)
     395      {
     396        for(Int iViewIdx = 0; iViewIdx < pcSlice->getViewId(); iViewIdx ++ )
     397          pcSlice->setBaseViewRefPicList( tAppEncTop->getTEncTop( iViewIdx , false )->getListPic(), iViewIdx );
     398      }
     399#endif
    393400      //  Slice info. refinement
    394401      if( pcSlice->getSliceType() == B_SLICE )
     
    754761      m_pcDepthMapGenerator->covertOrgDepthMap( pcPic );
    755762#endif
    756 #if H3D_IVRP
     763#if H3D_IVRP & !QC_ARP_D0177
    757764      m_pcResidualGenerator->initViewComponent( pcPic );
    758765#endif
     
    818825      pcSlice = pcPic->getSlice(0);
    819826
    820 #if H3D_IVRP
     827#if H3D_IVRP & !QC_ARP_D0177
    821828      // set residual picture
    822829      m_pcResidualGenerator->setRecResidualPic( pcPic );
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncGOP.h

    r296 r373  
    9797  TComDepthMapGenerator*  m_pcDepthMapGenerator;
    9898#endif
    99 #if H3D_IVRP
     99#if H3D_IVRP & !QC_ARP_D0177
    100100  TComResidualGenerator*  m_pcResidualGenerator;
    101101#endif
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncSbac.cpp

    r332 r373  
    7272#if H3D_IVRP
    7373, m_cResPredFlagSCModel       ( 1,             1,               NUM_RES_PRED_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     74#endif
     75#if QC_ARP_D0177
     76, m_cCUPUARPW                 ( 1,             1,               NUM_ARPW_CTX                 , m_contextModels + m_numContextModels, m_numContextModels)
    7477#endif
    7578, m_cCUPartSizeSCModel        ( 1,             1,               NUM_PART_SIZE_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     
    158161  m_cResPredFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_RES_PRED_FLAG );
    159162#endif
     163#if QC_ARP_D0177
     164  m_cCUPUARPW.initBuffer                 ( eSliceType, iQp, (UChar*)INIT_ARPW );
     165#endif
    160166  m_cCUPartSizeSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_PART_SIZE );
    161167  m_cCUAMPSCModel.initBuffer             ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS );
     
    311317  m_cResPredFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_RES_PRED_FLAG );
    312318#endif
     319#if QC_ARP_D0177
     320  m_cCUPUARPW.initBuffer                 ( eSliceType, iQp, (UChar*)INIT_ARPW );
     321#endif
    313322  m_cCUPartSizeSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_PART_SIZE );
    314323  m_cCUAMPSCModel.initBuffer             ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS );
     
    840849}
    841850#endif
    842 
     851#if QC_ARP_D0177
     852Void TEncSbac::codeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx )
     853{
     854  Int nW = pcCU->getARPW( uiAbsPartIdx );
     855  Int nMaxW = pcCU->getSlice()->getARPStepNum() - 1;
     856  assert( 0 <= nW && nW <= nMaxW );
     857  assert(nMaxW > 0);
     858  if( nMaxW > 0 )
     859  {
     860    Int nOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx);
     861    assert( 0 <= nOffset && nOffset <= 2 );
     862    Int nBinNum = nW + ( nW != nMaxW );
     863    m_pcBinIf->encodeBin( nW != 0 , m_cCUPUARPW.get( 0, 0, 0 + nOffset ) );
     864    if( nBinNum > 1 )
     865       m_pcBinIf->encodeBin( nW == nMaxW , m_cCUPUARPW.get( 0, 0, 3 ) );
     866  }
     867}
     868#endif
    843869Void TEncSbac::codeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    844870{
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncSbac.h

    r332 r373  
    209209  Void codeResPredFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    210210#endif
     211#if QC_ARP_D0177
     212  virtual Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     213#endif
    211214  Void codeSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    212215#if H3D_IVMP
     
    265268#if H3D_IVRP
    266269  ContextModel3DBuffer m_cResPredFlagSCModel;
     270#endif
     271#if QC_ARP_D0177
     272  ContextModel3DBuffer m_cCUPUARPW;
    267273#endif
    268274  ContextModel3DBuffer m_cCUPartSizeSCModel;
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncSearch.cpp

    r332 r373  
    46744674#endif
    46754675      );
     4676#if QC_ARP_D0177
     4677    m_pcEntropyCoder->encodeARPW       ( pcCU , 0 , true );
     4678#endif
    46764679#endif
    46774680#if HHI_MPI
     
    59545957      );
    59555958#endif
     5959#if QC_ARP_D0177
     5960    m_pcEntropyCoder->encodeARPW( pcCU , 0 , true );
     5961#endif
    59565962    ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
    59575963  }
     
    59775983#endif
    59785984      );
     5985#if QC_ARP_D0177
     5986    m_pcEntropyCoder->encodeARPW( pcCU , 0 , true );
     5987#endif
    59795988#endif
    59805989#if HHI_MPI
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncTop.cpp

    r332 r373  
    120120  m_cDepthMapGenerator. create( false, getSourceWidth(), getSourceHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement, PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) );
    121121#endif
    122 #if H3D_IVRP
     122#if H3D_IVRP & !QC_ARP_D0177
    123123  m_cResidualGenerator. create( false, getSourceWidth(), getSourceHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement );
    124124#endif
     
    251251  m_cDepthMapGenerator. destroy();
    252252#endif
    253 #if H3D_IVRP
     253#if H3D_IVRP & !QC_ARP_D0177
    254254  m_cResidualGenerator. destroy();
    255255#endif
     
    347347#endif
    348348#endif
    349 #if H3D_IVRP
     349#if H3D_IVRP & !QC_ARP_D0177
    350350  m_cResidualGenerator.init( &m_cTrQuant, &m_cDepthMapGenerator );
    351351#endif
     
    722722#endif
    723723#if H3D_IVRP
     724#if QC_ARP_D0177
     725    m_cSPS.setUseAdvRP              ( 0 );
     726    m_cSPS.setARPStepNum            ( 1 );
     727#else
    724728    m_cSPS.setMultiviewResPredMode  ( 0 );
    725729#endif
     730#endif
     731
    726732  }
    727733  else
     
    742748#endif
    743749#if H3D_IVRP
    744       m_cSPS.setMultiviewResPredMode  ( m_uiMultiviewResPredMode );
     750#if QC_ARP_D0177
     751     m_cSPS.setUseAdvRP  ( m_viewId > 0   ? m_nUseAdvResPred : 0 );
     752     m_cSPS.setARPStepNum( m_viewId > 0   ? QC_ARP_WFNR      : 1 );
     753#else
     754     m_cSPS.setMultiviewResPredMode  ( m_uiMultiviewResPredMode );
     755#endif
    745756#endif
    746757    }
     
    751762#endif
    752763#if H3D_IVRP
     764#if QC_ARP_D0177
     765      m_cSPS.setUseAdvRP              ( 0 );
     766      m_cSPS.setARPStepNum            ( 1 );
     767#else
    753768      m_cSPS.setMultiviewResPredMode  ( 0 );
     769#endif
    754770#endif
    755771    }
  • branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibEncoder/TEncTop.h

    r296 r373  
    103103  TComDepthMapGenerator   m_cDepthMapGenerator;           ///< depth map generator
    104104#endif
    105 #if H3D_IVRP
     105#if H3D_IVRP & !QC_ARP_D0177
    106106  TComResidualGenerator   m_cResidualGenerator;           ///< generator for residual pictures
    107107#endif
     
    234234  TComDepthMapGenerator*  getDepthMapGenerator  () { return  &m_cDepthMapGenerator;   }
    235235#endif
    236 #if H3D_IVRP
     236#if H3D_IVRP & !QC_ARP_D0177
    237237  TComResidualGenerator*  getResidualGenerator  () { return  &m_cResidualGenerator;   }
    238238#endif
Note: See TracChangeset for help on using the changeset viewer.