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

JCT3V-D0177: ARP

Location:
branches/HTM-6.2-dev2-Qualcomm/source/Lib/TLibCommon
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.