Changeset 77 in 3DVCSoftware for trunk/source/Lib/TLibCommon


Ignore:
Timestamp:
14 Jun 2012, 16:38:29 (13 years ago)
Author:
tech
Message:

Merged with branch/HTM-3.0Samsung REV74 including:

  • restricted residual prediction m24766
  • Inter-view residual prediction m24938
  • VPS concept m24714,m24878, m24945,m24896, m2491
  • reference list modification, restriction on IDR m24876, m24874
  • depth based motion parameter prediction m24829

Fixed bugs:

  • interview prediction
  • VSO

Added:

  • xcode project
Location:
trunk/source/Lib/TLibCommon
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/CommonDef.h

    r56 r77  
    5858
    5959#define HM_VERSION        "6.1"
    60 #define NV_VERSION        "3.0"                 ///< Current software version
     60#define NV_VERSION        "3.1rc1"                 ///< Current software version
    6161
    6262// ====================================================================================================================
     
    138138#define PDM_NO_INTER_UPDATE               1         // no update for inter (but not inter-view) predicted blocks
    139139#define PDM_MERGE_POS                     0         // position of pdm in merge list (0..4)
     140#if SAIT_IMPROV_MOTION_PRED_M24829
     141#define PDM_AMVP_POS                      0         // position of pdm in amvp list  (0..3)
     142#else
    140143#define PDM_AMVP_POS                      2         // position of pdm in amvp list  (0..3)
     144#endif
    141145#define PDM_OUTPUT_PRED_DEPTH_MAP         0         // output prediction depth map (for debugging)
    142146
     
    168172#define LOG2_DISP_PREC_LUT                              2                               ///< log2 of disparity precision used in integer disparity LUTs
    169173
     174// ====================================================================================================================
     175// VPS constants
     176// ====================================================================================================================
     177#if VIDYO_VPS_INTEGRATION
     178#define MAX_LAYER_NUM                     MAX_VIEW_NUM
     179#define VPS_EXTENSION_TYPE_MULTI_VIEW     0
     180#endif
    170181
    171182// ====================================================================================================================
     
    483494  NAL_UNIT_RESERVED_23,
    484495  NAL_UNIT_UNSPECIFIED_24,
     496#if VIDYO_VPS_INTEGRATION
     497        NAL_UNIT_VPS,
     498#else
    485499  NAL_UNIT_UNSPECIFIED_25,
     500#endif
    486501  NAL_UNIT_UNSPECIFIED_26,
    487502  NAL_UNIT_UNSPECIFIED_27,
  • trunk/source/Lib/TLibCommon/NAL.h

    r56 r77  
    5151  NalRefIdc   m_nalRefIDC;   ///< nal_ref_idc
    5252#endif
     53#if VIDYO_VPS_INTEGRATION
     54        unsigned    m_layerId;
     55  unsigned    m_temporalId;  ///< temporal_id
     56#else
    5357  Int         m_viewId;      ///< view_id
    5458  Bool        m_isDepth;     ///< is_depth
     
    5660#if !H0388
    5761  bool        m_OutputFlag;  ///< output_flag
     62#endif
    5863#endif
    5964
     
    6469    NalUnitType nalUnitType,
    6570    Bool        nalRefFlag,
     71#if !VIDYO_VPS_INTEGRATION   
    6672    Int         viewId,
    6773    Bool        isDepth,
    68     Int         temporalId = 0)
     74#else
     75    unsigned    layerId,
     76#endif
     77    unsigned       temporalId = 0)
    6978    :m_nalUnitType (nalUnitType)
    7079    ,m_nalRefFlag  (nalRefFlag)
     80#if !VIDYO_VPS_INTEGRATION
    7181    ,m_viewId      (viewId)
    7282    ,m_isDepth     (isDepth)
     83#else
     84    ,m_layerId     (layerId)
     85#endif
    7386    ,m_temporalId  (temporalId)
    7487  {}
     
    8396    m_nalUnitType = nalUnitType;
    8497    m_nalRefIDC   = nalRefIDC;
     98#if !VIDYO_VPS_INTEGRATION
    8599    m_viewId      = viewId;
    86100    m_isDepth     = isDepth;
     101#else
     102                m_layerId = layerId;
     103#endif
    87104    m_temporalId  = temporalID;
    88105  }
     
    92109    NalUnitType  nalUnitType,
    93110    NalRefIdc    nalRefIDC,
     111#if !VIDYO_VPS_INTEGRATION   
    94112    Int          viewId,
    95113    Bool         isDepth,
     114#else
     115    unsigned         layerId,
     116#endif
    96117    unsigned     temporalID = 0,
    97118    bool         outputFlag = true)
     
    99120    m_nalUnitType = nalUnitType;
    100121    m_nalRefIDC   = nalRefIDC;
     122#if !VIDYO_VPS_INTEGRATION
    101123    m_viewId      = viewId;
    102124    m_isDepth     = isDepth;
     125#else
     126                m_layerId = layerId;
     127#endif
    103128    m_temporalId  = temporalID;
    104129    m_OutputFlag  = outputFlag;
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r56 r77  
    28832883}
    28842884
     2885#if LG_RESTRICTEDRESPRED_M24766
     2886Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU)
     2887{
     2888        UInt uiNumPartition  = bLCU ? (getWidth(uiAbsPartIdx)*getHeight(uiAbsPartIdx) >> 4) : m_uiNumPartition;
     2889        UInt uiTmpAbsPartIdx = bLCU ? uiAbsPartIdx : 0;
     2890
     2891        switch ( m_pePartSize[uiTmpAbsPartIdx] )
     2892        {
     2893        case SIZE_2NxN:
     2894                riWidth = getWidth(uiTmpAbsPartIdx);      riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 1;
     2895                break;
     2896        case SIZE_Nx2N:
     2897                riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx);      ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 2;
     2898                break;
     2899        case SIZE_NxN:
     2900                riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiNumPartition >> 2 ) * uiPartIdx;
     2901                break;
     2902        case SIZE_2NxnU:
     2903                riWidth     = getWidth(uiTmpAbsPartIdx);
     2904                riHeight    = ( uiPartIdx == 0 ) ?  getHeight(uiTmpAbsPartIdx) >> 2 : ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 );
     2905                ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 3;
     2906                break;
     2907        case SIZE_2NxnD:
     2908                riWidth     = getWidth(uiTmpAbsPartIdx);
     2909                riHeight    = ( uiPartIdx == 0 ) ?  ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ) : getHeight(uiTmpAbsPartIdx) >> 2;
     2910                ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 1) + (uiNumPartition >> 3);
     2911                break;
     2912        case SIZE_nLx2N:
     2913                riWidth     = ( uiPartIdx == 0 ) ? getWidth(uiTmpAbsPartIdx) >> 2 : ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 );
     2914                riHeight    = getHeight(uiTmpAbsPartIdx);
     2915                ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 4;
     2916                break;
     2917        case SIZE_nRx2N:
     2918                riWidth     = ( uiPartIdx == 0 ) ? ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ) : getWidth(uiTmpAbsPartIdx) >> 2;
     2919                riHeight    = getHeight(uiTmpAbsPartIdx);
     2920                ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 2) + (uiNumPartition >> 4);
     2921                break;
     2922        default:
     2923                assert ( m_pePartSize[0] == SIZE_2Nx2N );
     2924                riWidth = getWidth(uiTmpAbsPartIdx);      riHeight = getHeight(uiTmpAbsPartIdx);      ruiPartAddr = 0;
     2925                break;
     2926        }
     2927}
     2928#else
    28852929Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight )
    28862930{
     
    29222966  }
    29232967}
    2924 
     2968#endif
     2969
     2970#if LG_RESTRICTEDRESPRED_M24766
     2971Int TComDataCU::getResiPredMode(UInt uiPartAddr)
     2972{
     2973        Int iAddResiShift = -1;
     2974
     2975        for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++)
     2976        {
     2977                RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     2978                Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr);
     2979                if(iBestRefIdx >= 0 && getSlice()->getViewId() == getSlice()->getRefViewId(eRefList, iBestRefIdx))
     2980                        iAddResiShift++;
     2981        }
     2982
     2983        return iAddResiShift;
     2984}
     2985
     2986Void TComDataCU::getPUResiPredShift(Int *iPUResiPredShift, UInt uiAbsPartIndex)
     2987{
     2988        UInt uiPartSize = getPartitionSize(uiAbsPartIndex);
     2989        UInt uiPartAddr;
     2990        Int iWidth, iHeight;
     2991        Int iAddResiShift;
     2992
     2993        if(uiPartSize == SIZE_2Nx2N)
     2994        {
     2995                iAddResiShift = getResiPredMode(uiAbsPartIndex);
     2996                for(UInt i = 0; i < 4; i++)
     2997                        iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiAbsPartIndex) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
     2998                return;
     2999        }
     3000
     3001        if(uiPartSize == SIZE_2NxN || uiPartSize == SIZE_2NxnU || uiPartSize == SIZE_2NxnD)
     3002        {
     3003                for(UInt i = 0; i < 2; i++)
     3004                {
     3005                        getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true);
     3006                        uiPartAddr += uiAbsPartIndex;
     3007                        iAddResiShift = getResiPredMode(uiPartAddr);
     3008                        iPUResiPredShift[2*i] = iPUResiPredShift[2*i+1] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
     3009                }
     3010                return;
     3011        }
     3012
     3013        if(uiPartSize == SIZE_Nx2N || uiPartSize == SIZE_nLx2N || uiPartSize == SIZE_nRx2N)
     3014        {
     3015                for(UInt i = 0; i < 2; i++)
     3016                {
     3017                        getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true);
     3018                        uiPartAddr += uiAbsPartIndex;
     3019                        iAddResiShift = getResiPredMode(uiPartAddr);
     3020                        iPUResiPredShift[i] = iPUResiPredShift[2+i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
     3021                }
     3022                return;
     3023        }
     3024
     3025        if(uiPartSize == SIZE_NxN)
     3026        {
     3027                for(UInt i = 0; i < 4; i++)
     3028                {
     3029                        getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true);
     3030                        uiPartAddr += uiAbsPartIndex;
     3031                        iAddResiShift = getResiPredMode(uiPartAddr);
     3032                        iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
     3033                }
     3034        }
     3035
     3036}
     3037#endif
    29253038
    29263039Void TComDataCU::getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField )
     
    47234836  Int iNeibRefPOC;
    47244837
     4838#if HHI_FIX
     4839  if( pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) >= 0 )
     4840  {
     4841    iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) );
     4842    if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) )
     4843      return false;
     4844    if( iNeibRefPOC == iCurrRefPOC ) // Same Reference Frame But Diff List//
     4845    {
     4846      TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx);
     4847
     4848      clipMv(cMvPred);
     4849      pInfo->m_acMvCand[ pInfo->iN++] = cMvPred;
     4850      return true;
     4851    }
     4852  }
     4853#endif
    47254854  //---------------  V1 (END) ------------------//
    47264855  if( pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0)
     
    48514980  iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx();
    48524981#else
     4982#if HHI_FIX
     4983  if( pColCU->getSlice()->getRefViewId( eColRefPicList, iColRefIdx ) != pColCU->getSlice()->getViewId() )
     4984#else
    48534985  if( pColCU->getSlice()->getRefViewId( eColRefPicList, iColRefIdx ) != m_pcSlice->getRefPic( eRefPicList, riRefIdx )->getViewId() )
     4986#endif
    48544987  {
    48554988    return false;
     
    48675000  else if((iColPOC == iColRefPOC)&&(iCurrPOC == iCurrRefPOC))
    48685001    iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx);
     5002#if HHI_FIX //GT: fix reported by Sony
     5003  else
     5004    return false;
     5005#endif
    48695006#else
    48705007  iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC);
     
    58395976#if HHI_INTER_VIEW_RESIDUAL_PRED
    58405977Bool
    5841 TComDataCU::getResidualSamples( UInt uiPartIdx, TComYuv* pcYuv )
     5978TComDataCU::getResidualSamples( UInt uiPartIdx,
     5979#if QC_SIMPLIFIEDIVRP_M24938
     5980  Bool bRecon ,
     5981#endif
     5982  TComYuv* pcYuv )
    58425983{
    58435984  TComResidualGenerator*  pcResidualGenerator = m_pcSlice->getSPS()->getResidualGenerator();
    58445985  ROFRS( pcResidualGenerator, false );
    5845   return pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv );
     5986  return pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv
     5987#if QC_SIMPLIFIEDIVRP_M24938
     5988    , bRecon
     5989#endif
     5990    );
    58465991}
    58475992#endif
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r56 r77  
    521521#endif
    522522#if HHI_INTER_VIEW_RESIDUAL_PRED
    523   Bool          getResidualSamples( UInt uiPartIdx, TComYuv* pcYuv = 0 );
     523  Bool          getResidualSamples( UInt uiPartIdx,
     524#if QC_SIMPLIFIEDIVRP_M24938
     525    Bool bRecon ,
     526#endif
     527    TComYuv* pcYuv = 0 );
    524528#endif
    525529  // -------------------------------------------------------------------------------------------------------------------
    526530  // member functions for accessing partition information
    527531  // -------------------------------------------------------------------------------------------------------------------
    528  
     532#if LG_RESTRICTEDRESPRED_M24766
     533  Void          getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false);
     534#else
    529535  Void          getPartIndexAndSize   ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight );
     536#endif
     537#if LG_RESTRICTEDRESPRED_M24766
     538  Int           getResiPredMode(UInt uiPartAddr);
     539  Void          getPUResiPredShift (Int *iPUPredResiShift, UInt uiAbsPartIndex);
     540#endif
    530541  UChar         getNumPartInter       ();
    531542  Bool          isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth);
  • trunk/source/Lib/TLibCommon/TComDepthMapGenerator.cpp

    r56 r77  
    122122}
    123123
     124#if VIDYO_VPS_INTEGRATION
     125Void
     126TComDepthMapGenerator::init( TComPrediction* pcPrediction, TComVPSAccess* pcVPSAccess, TComSPSAccess* pcSPSAccess, TComAUPicAccess* pcAUPicAccess )
     127#else
    124128Void
    125129TComDepthMapGenerator::init( TComPrediction* pcPrediction, TComSPSAccess* pcSPSAccess, TComAUPicAccess* pcAUPicAccess )
     130#endif
    126131{
    127132  AOF( pcPrediction  );
     
    130135  uninit();
    131136  m_pcPrediction  = pcPrediction;
     137#if VIDYO_VPS_INTEGRATION
     138  m_pcVPSAccess   = pcVPSAccess;
     139#endif
    132140  m_pcSPSAccess   = pcSPSAccess;
    133141  m_pcAUPicAccess = pcAUPicAccess;
     
    157165
    158166  // update SPS list and AU pic list and set depth map generator in SPS
     167#if VIDYO_VPS_INTEGRATION
     168  m_pcVPSAccess  ->addVPS( pcPic->getVPS() );
     169#endif
    159170  m_pcSPSAccess  ->addSPS( pcPic->getSPS() );
    160171  m_pcAUPicAccess->addPic( pcPic );
     
    14671478  Int           iCurrPosY;
    14681479  pcPredDepthMap->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );
     1480#if SAIT_IMPROV_MOTION_PRED_M24829 // max disparity within PU
     1481  Int DiWidth  = iCurrPosX+(iWidth  >> m_uiSubSampExpX);
     1482  Int DiHeight = iCurrPosY+(iHeight >> m_uiSubSampExpY);
     1483  Int maxDepth = MIN_INT;
     1484
     1485  for(Int y=iCurrPosY; y<DiHeight ;y++)
     1486  {
     1487    for(Int x=iCurrPosX; x<DiWidth; x++)
     1488    {
     1489      if(piPredDepthMap[ x + y * iCurrStride ] > maxDepth)
     1490      {
     1491        maxDepth = piPredDepthMap[ x + y * iCurrStride ];
     1492      }
     1493    }
     1494  }
     1495  iCurrPosX  += ( ( iWidth  >> m_uiSubSampExpX ) - 1 ) >> 1;
     1496  iCurrPosY  += ( ( iHeight >> m_uiSubSampExpY ) - 1 ) >> 1;
     1497  riPrdDepth  = maxDepth;
     1498#else
    14691499  iCurrPosX  += ( ( iWidth  >> m_uiSubSampExpX ) - 1 ) >> 1;
    14701500  iCurrPosY  += ( ( iHeight >> m_uiSubSampExpY ) - 1 ) >> 1;
    14711501  riPrdDepth  = piPredDepthMap[ iCurrPosX + iCurrPosY * iCurrStride ];
     1502#endif
    14721503  if( piPosX )
    14731504  {
  • trunk/source/Lib/TLibCommon/TComDepthMapGenerator.h

    r56 r77  
    5050
    5151#if DEPTH_MAP_GENERATION
    52 
     52#if VIDYO_VPS_INTEGRATION
     53class TComVPSAccess // would be better to have a real VPS buffer
     54{
     55public:
     56  TComVPSAccess ()  { clear(); }
     57  ~TComVPSAccess()  {}
     58
     59  Void      clear   ()                                { ::memset( m_aacVPS, 0x00, sizeof( m_aacVPS ) ); m_uiActiceVPSId = 0;}
     60  Void      addVPS  ( TComVPS* pcVPS )                { m_aacVPS[ pcVPS->getVPSId() ] = pcVPS; }
     61  TComVPS*  getVPS  ( UInt uiVPSId )                  { return m_aacVPS[ uiVPSId ]; }
     62  TComVPS*  getActiveVPS  ( )                         { return m_aacVPS[ m_uiActiceVPSId ]; }
     63  Void      setActiveVPSId  ( UInt activeVPSId )      { m_uiActiceVPSId = activeVPSId; }
     64private:
     65  TComVPS*  m_aacVPS[ MAX_NUM_VPS ];
     66  UInt      m_uiActiceVPSId;
     67};
     68#endif
    5369
    5470class TComSPSAccess // would be better to have a real SPS buffer
     
    113129  Void  destroy               ();
    114130
     131#if VIDYO_VPS_INTEGRATION
     132  Void  init( TComPrediction* pcPrediction, TComVPSAccess* pcVPSAccess, TComSPSAccess* pcSPSAccess, TComAUPicAccess* pcAUPicAccess );
     133#endif
    115134  Void  init                  ( TComPrediction* pcPrediction, TComSPSAccess* pcSPSAccess, TComAUPicAccess* pcAUPicAccess );
    116135  Void  uninit                ();
     
    136155
    137156  TComPrediction*   getPrediction ()  { return m_pcPrediction;  }
     157#if VIDYO_VPS_INTEGRATION
     158  TComVPSAccess*    getVPSAccess  ()  { return m_pcVPSAccess;   }
     159#endif
    138160  TComSPSAccess*    getSPSAccess  ()  { return m_pcSPSAccess;   }
    139161  TComAUPicAccess*  getAUPicAccess()  { return m_pcAUPicAccess; }
     
    198220  Bool              m_bDecoder;
    199221  TComPrediction*   m_pcPrediction;
     222#if VIDYO_VPS_INTEGRATION
     223  TComVPSAccess*    m_pcVPSAccess;
     224#endif
    200225  TComSPSAccess*    m_pcSPSAccess;
    201226  TComAUPicAccess*  m_pcAUPicAccess;
  • trunk/source/Lib/TLibCommon/TComPic.h

    r56 r77  
    120120  TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
    121121  TComSlice*    getCurrSlice()        { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx);  }
     122#if VIDYO_VPS_INTEGRATION
     123  TComVPS*      getVPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS();  }
     124#endif
    122125  TComSPS*      getSPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS();  }
    123126  Int           getPOC()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
  • trunk/source/Lib/TLibCommon/TComResidualGenerator.cpp

    r56 r77  
    221221
    222222Bool
    223 TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv )
     223TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv
     224#if QC_SIMPLIFIEDIVRP_M24938
     225  , Bool bRecon
     226#endif
     227  )
    224228{
    225229  AOF(  pcCU );
     
    231235  iBlkHeight  = pcCU->getHeight ( 0 );
    232236  pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iXPos, iYPos );
    233   return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv );
     237  return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv
     238#if QC_SIMPLIFIEDIVRP_M24938
     239    , bRecon
     240#endif
     241    );
    234242}
    235243 
    236244Bool
    237 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv )
     245TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv
     246#if QC_SIMPLIFIEDIVRP_M24938
     247  , Bool bRecon
     248#endif
     249  )
    238250{
    239251  UInt  uiBaseViewId  = m_pcDepthMapGenerator->getBaseViewId( 0 );
     
    243255    pcYuv = m_ppcYuvTmp[1];
    244256  }
    245   xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv );
     257#if QC_SIMPLIFIEDIVRP_M24938
     258  UInt uiXPosInRefView = uiXPos , uiYPosInRefView = uiYPos;
     259#endif
     260  xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv
     261#if QC_SIMPLIFIEDIVRP_M24938
     262    , &uiXPosInRefView , &uiYPosInRefView , bRecon
     263#endif
     264    );
     265
     266#if QC_SIMPLIFIEDIVRP_M24938
     267  return xIsNonZeroByCBF( uiBaseViewId , uiXPosInRefView , uiYPosInRefView , uiBlkWidth , uiBlkHeight );
     268#else
    246269  return xIsNonZero( pcYuv, uiBlkWidth, uiBlkHeight );
    247 }
     270#endif
     271}
     272
     273#if QC_SIMPLIFIEDIVRP_M24938
     274Bool TComResidualGenerator::xIsNonZeroByCBF( UInt uiBaseViewId , UInt uiXPos , UInt uiYPos, UInt uiBlkWidth , UInt uiBlkHeight )
     275{
     276  TComPic* pcBasePic   = m_pcAUPicAccess->getPic( uiBaseViewId );
     277  const Int nMaxPicX = pcBasePic->getSPS()->getPicWidthInLumaSamples() - 1;
     278  const Int nMaxPicY = pcBasePic->getSPS()->getPicHeightInLumaSamples() - 1;
     279  for( UInt y = 0 ; y < uiBlkHeight ; y +=4 )
     280  {
     281    for( UInt x = 0 ; x <= uiBlkWidth ; x += 4 )
     282    {      // to cover both the mapped CU and the 1-pixel-right-shifted mapped CU
     283      Int iCuAddr = 0, iAbsZorderIdx = 0;
     284      pcBasePic->getPicYuvRec()->getCUAddrAndPartIdx( Min( uiXPos + x , nMaxPicX ) , Min( uiYPos + y , nMaxPicY ) , iCuAddr , iAbsZorderIdx );
     285      TComDataCU *pCUInRefView = pcBasePic->getCU( iCuAddr );
     286      if( pCUInRefView->isIntra( iAbsZorderIdx ) )
     287        // no inter-view residual pred from a intra CU
     288        continue;
     289      UInt uiTempTrDepth = pCUInRefView->getTransformIdx( iAbsZorderIdx );
     290      if( pCUInRefView->getCbf( iAbsZorderIdx , TEXT_LUMA , uiTempTrDepth )
     291        || pCUInRefView->getCbf( iAbsZorderIdx , TEXT_CHROMA_U , uiTempTrDepth )
     292        || pCUInRefView->getCbf( iAbsZorderIdx , TEXT_CHROMA_V , uiTempTrDepth ) )
     293        return( true );
     294}
     295  }
     296
     297  return( false );
     298}
     299#endif
    248300
    249301
     
    335387  Pel*    pRes      = pcCUResidual->getLumaAddr();
    336388  UInt    uiLumaTrMode, uiChromaTrMode;
     389#if LG_RESTRICTEDRESPRED_M24766
     390  Int     iPUPredResiShift[4];
     391#endif
    337392  pcCU->convertTransIdx             ( 0, pcCU->getTransformIdx( 0 ), uiLumaTrMode, uiChromaTrMode );
    338393#if H0736_AVC_STYLE_QP_RANGE
     
    361416  {
    362417    AOF( pcCU->getResPredAvail( 0 ) );
    363     Bool bOK = pcCU->getResidualSamples( 0, m_ppcYuvTmp[0] );
     418    Bool bOK = pcCU->getResidualSamples( 0,
     419#if QC_SIMPLIFIEDIVRP_M24938
     420      true,
     421#endif
     422      m_ppcYuvTmp[0] );
    364423    AOF( bOK );
     424#if LG_RESTRICTEDRESPRED_M24766
     425        pcCU->getPUResiPredShift(iPUPredResiShift, 0);
     426        pcCUResidual->add(iPUPredResiShift, pcCU->getPartitionSize(0), m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) );
     427#else
    365428    pcCUResidual->add( m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) );
     429#endif
    366430  }
    367431
     
    423487
    424488Void 
    425 TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv )
     489TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv
     490#if QC_SIMPLIFIEDIVRP_M24938
     491  , UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon
     492#endif
     493  )
    426494{
    427495  //===== set and check some basic variables =====
     
    456524  Pel*          pSrcSamplesY= pcBaseRes->getLumaAddr ( 0 ) + uiYPos * iSrcStrideY;
    457525  Pel*          pDesSamplesY= pcYuv    ->getLumaAddr ();
     526
     527#if QC_SIMPLIFIEDIVRP_M24938
     528  if( puiXPosInRefView != NULL )
     529    *puiXPosInRefView = Max( 0, Min( iYMaxPosX, iYRefPosX0 ) );
     530  if( puiYPosInRefView != NULL )
     531    *puiYPosInRefView = uiYPos;
     532  if( bRecon == false )
     533    return;
     534#endif
     535
    458536  for(   Int iY = 0; iY < iYHeight; iY++, pSrcSamplesY += iSrcStrideY, pDesSamplesY += iDesStrideY )
    459537  {
  • trunk/source/Lib/TLibCommon/TComResidualGenerator.h

    r5 r77  
    6969  Void  setRecResidualPic     ( TComPic*      pcPic );
    7070
    71   Bool  getResidualSamples    ( TComDataCU*   pcCU,  UInt uiPUIdx, TComYuv* pcYuv );
    72   Bool  getResidualSamples    ( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv );
     71  Bool  getResidualSamples    ( TComDataCU*   pcCU,  UInt uiPUIdx, TComYuv* pcYuv
     72#if QC_SIMPLIFIEDIVRP_M24938
     73    , Bool bRecon
     74#endif
     75    );
     76  Bool  getResidualSamples    ( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv
     77#if QC_SIMPLIFIEDIVRP_M24938
     78    , Bool bRecon
     79#endif
     80    );
    7381
    7482private:
     
    8088  Void  xClearResidual        (                      TComYuv* pcCUResidual, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight );
    8189
    82   Void  xSetPredResidualBlock ( TComPic*      pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv );
     90  Void  xSetPredResidualBlock ( TComPic*      pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv
     91#if QC_SIMPLIFIEDIVRP_M24938
     92    , UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon
     93#endif
     94    );
    8395  Bool  xIsNonZero            ( TComYuv*      pcYuv, UInt uiBlkWidth, UInt uiBlkHeight );
     96#if QC_SIMPLIFIEDIVRP_M24938
     97  Bool  xIsNonZeroByCBF       ( UInt uiBaseViewId , UInt uiXPos , UInt uiYPos, UInt uiBlkWidth , UInt uiBlkHeight );
     98#endif
    8499
    85100  Void  xDumpResidual         ( TComPic*      pcPic, char* pFilenameBase );
  • trunk/source/Lib/TLibCommon/TComRom.cpp

    r56 r77  
    11881188  assert( uiWidth == uiHeight );
    11891189
    1190   UChar    uhStartX,    uhStartY,    uhEndX,    uhEndY;
    1191   Int   iStepStartX, iStepStartY, iStepEndX, iStepEndY;
     1190  UChar    uhStartX = 0,    uhStartY = 0,    uhEndX = 0,    uhEndY = 0;
     1191  Int   iStepStartX = 0, iStepStartY = 0, iStepEndX = 0, iStepEndY = 0;
    11921192
    11931193  UInt uiBlockSize = 0;
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r61 r77  
    13051305}
    13061306
     1307// ------------------------------------------------------------------------------------------------
     1308// Video parameter set (VPS)
     1309// ------------------------------------------------------------------------------------------------
     1310#if VIDYO_VPS_INTEGRATION
     1311TComVPS::TComVPS()
     1312: m_VPSId                     (  0)
     1313, m_uiMaxTLayers              (  1)
     1314, m_uiMaxLayers               (  1)
     1315, m_bTemporalIdNestingFlag    (false)
     1316, m_uiExtensionType           (  0)
     1317{
     1318  for( Int i = 0; i < MAX_LAYER_NUM; i++)
     1319  {
     1320    m_uiDependentLayer[i] = i? i-1: 0;
     1321    m_bDependentFlag[i] = false;
     1322    m_uiViewId[i] = 0;
     1323    m_bDepthFlag[i] = 0;
     1324    m_iViewOrderIdx[i] = 0;
     1325  }
     1326 
     1327  for( Int i = 0; i < MAX_TLAYER; i++)
     1328  {
     1329    m_numReorderPics[i] = 0;
     1330    m_uiMaxDecPicBuffering[i] = 0;
     1331    m_uiMaxLatencyIncrease[i] = 0;
     1332  }
     1333}
     1334
     1335TComVPS::~TComVPS()
     1336{
     1337       
     1338       
     1339}
     1340
     1341#endif
     1342
    13071343
    13081344// ------------------------------------------------------------------------------------------------
     
    13111347
    13121348TComSPS::TComSPS()
     1349#if VIDYO_VPS_INTEGRATION
     1350: m_VPSId                     (  0)
     1351, m_SPSId                     (  0)
     1352#else
    13131353: m_SPSId                     (  0)
     1354#endif
    13141355, m_ProfileIdc                (  0)
    13151356, m_LevelIdc                  (  0)
     
    21552196, m_ppsMap(MAX_NUM_PPS)
    21562197, m_apsMap(MAX_NUM_APS)
     2198#if VIDYO_VPS_INTEGRATION
     2199, m_vpsMap(MAX_NUM_VPS)
     2200#endif
    21572201{
    21582202}
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r56 r77  
    144144#endif
    145145
     146#if VIDYO_VPS_INTEGRATION
     147/// VPS class
     148
     149class TComVPS
     150{
     151private:
     152  Int         m_VPSId;
     153        UInt                            m_uiMaxTLayers;
     154        UInt                            m_uiMaxLayers;
     155        Bool                            m_bTemporalIdNestingFlag;
     156
     157        UInt        m_uiExtensionType;
     158 
     159  Bool        m_bDependentFlag[MAX_LAYER_NUM];
     160  UInt        m_uiViewId[MAX_LAYER_NUM];
     161  Bool        m_bDepthFlag[MAX_LAYER_NUM];
     162  Int         m_iViewOrderIdx[MAX_LAYER_NUM];
     163  UInt        m_uiDependentLayer[MAX_LAYER_NUM];
     164
     165  UInt        m_numReorderPics[MAX_TLAYER];
     166  UInt        m_uiMaxDecPicBuffering[MAX_TLAYER];
     167  UInt        m_uiMaxLatencyIncrease[MAX_TLAYER];
     168 
     169public:
     170  TComVPS();
     171  virtual ~TComVPS();
     172       
     173  Int     getVPSId       ()                   { return m_VPSId;          }
     174  Void    setVPSId       (Int i)              { m_VPSId = i;             }
     175       
     176  UInt    getMaxTLayers  ()                   { return m_uiMaxTLayers;   }
     177  Void    setMaxTLayers  (UInt t)             { m_uiMaxTLayers = t; }
     178   
     179  UInt    getMaxLayers   ()                   { return m_uiMaxLayers;   }
     180        Void    setMaxLayers   (UInt l)             { m_uiMaxLayers = l; }
     181       
     182  Bool    getTemporalNestingFlag   ()         { return m_uiMaxLayers;   }
     183        Void    setTemporalNestingFlag   (UInt t)   { m_bTemporalIdNestingFlag = t; }
     184 
     185  Void    setExtensionType(UInt v)                     { m_uiExtensionType = v;    }
     186  UInt    getExtensionType()                             { return m_uiExtensionType; }
     187 
     188  Void    setDependentFlag(Bool d, UInt layer)              { m_bDependentFlag[layer] = d;    }
     189  Bool    getDependentFlag(UInt layer)                      { return m_bDependentFlag[layer]; }
     190
     191  Void    setViewId(UInt v, UInt layer)                     { m_uiViewId[layer] = v;    }
     192  UInt    getViewId(UInt layer)                             { return m_uiViewId[layer]; }
     193 
     194  Void    setDepthFlag(Bool d, UInt layer)                  { m_bDepthFlag[layer] = d;    }
     195  Bool    getDepthFlag(UInt layer)                          { return m_bDepthFlag[layer]; }
     196
     197  Void    setViewOrderIdx(Int v, UInt layer)                { m_iViewOrderIdx[layer] = v;    }
     198  Int     getViewOrderIdx(UInt layer)                       { return m_iViewOrderIdx[layer]; }
     199 
     200  Void    setDependentLayer(UInt v, UInt layer)                     { m_uiDependentLayer[layer] = v;    }
     201  UInt    getDependentLayer(UInt layer)                             { return m_uiDependentLayer[layer]; }
     202 
     203  Void    setNumReorderPics(UInt v, UInt tLayer)                { m_numReorderPics[tLayer] = v;    }
     204  UInt    getNumReorderPics(UInt tLayer)                        { return m_numReorderPics[tLayer]; }
     205 
     206  Void    setMaxDecPicBuffering(UInt v, UInt tLayer)          { m_uiMaxDecPicBuffering[tLayer] = v;    }
     207  UInt    getMaxDecPicBuffering(UInt tLayer)                  { return m_uiMaxDecPicBuffering[tLayer]; }
     208 
     209  Void    setMaxLatencyIncrease(UInt v, UInt tLayer)                { m_uiMaxLatencyIncrease[tLayer] = v;    }
     210  UInt    getMaxLatencyIncrease(UInt tLayer)                        { return m_uiMaxLatencyIncrease[tLayer]; }
     211 
     212};
     213
     214#endif
     215
    146216/// SPS class
    147217class TComSPS
    148218{
    149219private:
     220#if VIDYO_VPS_INTEGRATION
     221        Int                                     m_VPSId;
     222#endif
    150223  Int         m_SPSId;
    151224  Int         m_ProfileIdc;
     
    305378  TComSPS();
    306379  virtual ~TComSPS();
    307 
     380#if VIDYO_VPS_INTEGRATION
     381        Int  getVPSId       ()         { return m_VPSId;          }
     382  Void setVPSId       (Int i)    { m_VPSId = i;             }
     383#endif
    308384  Int  getSPSId       ()         { return m_SPSId;          }
    309385  Void setSPSId       (Int i)    { m_SPSId = i;             }
     
    11091185 
    11101186  // access channel
     1187#if VIDYO_VPS_INTEGRATION
     1188  TComVPS*    m_pcVPS;
     1189#endif
    11111190  TComSPS*    m_pcSPS;
    11121191  TComPPS*    m_pcPPS;
     
    11931272  Void      initTiles();
    11941273
    1195  
     1274#if VIDYO_VPS_INTEGRATION
     1275  Void      setVPS          ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; }
     1276  TComVPS*  getVPS          () { return m_pcVPS; }
     1277#endif
    11961278  Void      setSPS          ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; }
    11971279  TComSPS*  getSPS          () { return m_pcSPS; }
     
    15381620  ParameterSetManager();
    15391621  virtual ~ParameterSetManager();
    1540 
     1622#if VIDYO_VPS_INTEGRATION
     1623  //! store video parameter set and take ownership of it
     1624  Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); };
     1625  //! get pointer to existing video parameter set 
     1626  TComVPS* getVPS(Int vpsId)  { return m_vpsMap.getPS(vpsId); };
     1627  TComVPS* getFirstVPS()      { return m_vpsMap.getFirstPS(); };
     1628#endif
    15411629  //! store sequence parameter set and take ownership of it
    15421630  Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); };
     
    15601648  ParameterSetMap<TComPPS> m_ppsMap;
    15611649  ParameterSetMap<TComAPS> m_apsMap;
     1650#if VIDYO_VPS_INTEGRATION
     1651  ParameterSetMap<TComVPS> m_vpsMap;
     1652#endif
    15621653};
    15631654
  • trunk/source/Lib/TLibCommon/TComYuv.cpp

    r56 r77  
    392392}
    393393
    394 
     394#if LG_RESTRICTEDRESPRED_M24766
     395Void
     396TComYuv::add(Int *iPUResiPredShift, PartSize uhPartitionSize,  TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
     397{
     398        addLuma   (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth,    iHeight,    bSubtract );
     399        addChroma (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth>>1, iHeight>>1, bSubtract );
     400}
     401#else
    395402Void
    396403TComYuv::add( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
     
    399406  addChroma ( pcYuvAdd, iWidth>>1, iHeight>>1, bSubtract );
    400407}
    401 
     408#endif
     409
     410#if LG_RESTRICTEDRESPRED_M24766
     411void
     412TComYuv::getPUXYOffset(PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset)
     413{
     414        switch(uhPartitionSize)
     415        {         
     416        case SIZE_2NxN:
     417                iXOffset = iWidth;      iYOffset = iHeight >> 1;   break;
     418        case SIZE_2NxnU:
     419                iXOffset = iWidth;      iYOffset = iHeight >> 2;   break;
     420        case SIZE_2NxnD:
     421                iXOffset = iWidth;      iYOffset = (iHeight >> 1) + (iHeight >> 2);   break;
     422        case SIZE_Nx2N:
     423                iXOffset = iWidth >> 1; iYOffset = iHeight; break;
     424        case SIZE_nLx2N:
     425                iXOffset = iWidth >> 2; iYOffset = iHeight; break;
     426        case SIZE_nRx2N:
     427                iXOffset = (iWidth >> 1) + (iWidth >> 2); iYOffset = iHeight; break;
     428        case SIZE_NxN:
     429                iXOffset = iWidth >> 1; iYOffset = iHeight >> 1;  break;
     430        default:
     431                assert(uhPartitionSize == SIZE_2Nx2N);
     432                iXOffset = iWidth;        iYOffset = iHeight;     break;
     433        }
     434}
     435#endif
     436
     437#if LG_RESTRICTEDRESPRED_M24766
     438Void
     439TComYuv::addLuma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
     440#else
    402441Void
    403442TComYuv::addLuma( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
     443#endif
    404444{
    405445  Int   iScale      = ( bSubtract ? -1 : 1 );
     
    408448  Pel*  pAddSamples = pcYuvAdd->getLumaAddr();
    409449  Pel*  pDstSamples = getLumaAddr();
     450
     451#if LG_RESTRICTEDRESPRED_M24766
     452  Int iXOffset, iYOffset;
     453
     454  getPUXYOffset(uhPartitionSize, iWidth, iHeight, iXOffset, iYOffset);
     455
     456  for( Int iY = 0; iY < iYOffset; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride )
     457  {
     458          if(iPUResiPredShift[0] >= 0)
     459          {
     460                  for( Int iX = 0; iX < iXOffset; iX++ )
     461                  {
     462                          pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[0]);
     463                  }
     464          }
     465
     466          if(iPUResiPredShift[1] >= 0)
     467          {
     468                  for( Int iX = iXOffset; iX < iWidth; iX++ )
     469                  {
     470                          pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[1]);
     471                  }
     472          }
     473  }
     474
     475  for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride )
     476  {
     477          if(iPUResiPredShift[2] >= 0)
     478          {
     479                  for( Int iX = 0; iX < iXOffset; iX++ )
     480                  {
     481                          pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[2]);
     482                  }
     483          }
     484
     485          if(iPUResiPredShift[3] >= 0)
     486          {
     487                  for( Int iX = iXOffset; iX < iWidth; iX++ )
     488                  {
     489                          pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[3]);
     490                  }
     491          }
     492  }
     493#else
    410494  for( Int iY = 0; iY < iHeight; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride )
    411495  {
     
    415499    }
    416500  }
    417 }
    418 
     501#endif
     502}
     503
     504#if LG_RESTRICTEDRESPRED_M24766
     505Void
     506TComYuv::addChroma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
     507#else
    419508Void
    420509TComYuv::addChroma( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
     510#endif
    421511{
    422512  Int   iScale        = ( bSubtract ? -1 : 1 );
     
    427517  Pel*  pDstSamplesCb = getCbAddr();
    428518  Pel*  pDstSamplesCr = getCrAddr();
     519
     520#if LG_RESTRICTEDRESPRED_M24766
     521  Int iXOffset, iYOffset;
     522 
     523  getPUXYOffset(uhPartitionSize, iWidth, iHeight, iXOffset, iYOffset);
     524
     525  for( Int iY = 0; iY < iYOffset; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride,
     526          pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride  )
     527  {
     528          if(iPUResiPredShift[0] >= 0)
     529          {
     530                  for( Int iX = 0; iX < iXOffset; iX++ )
     531                  {
     532                          pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[0]);
     533                          pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[0]);
     534                  }
     535          }
     536
     537          if(iPUResiPredShift[1] >= 0)
     538          {
     539                  for( Int iX = iXOffset; iX < iWidth; iX++ )
     540                  {
     541                          pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[1]);
     542                          pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[1]);
     543                  }
     544          }
     545  }
     546
     547  for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride,
     548          pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride  )
     549  {
     550          if(iPUResiPredShift[2] >= 0)
     551          {
     552                  for( Int iX = 0; iX < iXOffset; iX++ )
     553                  {
     554                          pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[2]);
     555                          pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[2]);
     556                  }
     557          }
     558
     559          if(iPUResiPredShift[3] >= 0)
     560          {
     561                  for( Int iX = iXOffset; iX < iWidth; iX++ )
     562                  {
     563                          pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[3]);
     564                          pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[3]);
     565                  }
     566          }
     567  }
     568#else
    429569  for( Int iY = 0; iY < iHeight; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride,
    430570                                       pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride  )
     
    436576    }
    437577  }
     578#endif
    438579}
    439580
     
    535676}
    536677
     678#if LG_RESTRICTEDRESPRED_M24766
     679Void TComYuv::subtract(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
     680{
     681        subtractLuma  (iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1,  uiTrUnitIdx, uiPartSize    );
     682        subtractChroma(iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1,  uiTrUnitIdx, uiPartSize>>1 );
     683}
     684#else
    537685Void TComYuv::subtract( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
    538686{
     
    540688  subtractChroma( pcYuvSrc0, pcYuvSrc1,  uiTrUnitIdx, uiPartSize>>1 );
    541689}
    542 
     690#endif
     691
     692#if LG_RESTRICTEDRESPRED_M24766
     693Void TComYuv::subtractLuma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
     694#else
    543695Void TComYuv::subtractLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
     696#endif
    544697{
    545698  Int x, y;
     
    552705  Int  iSrc1Stride = pcYuvSrc1->getStride();
    553706  Int  iDstStride  = getStride();
     707
     708#if LG_RESTRICTEDRESPRED_M24766
     709  Int iXOffset, iYOffset;
     710
     711  getPUXYOffset(uhPartitionSize, uiPartSize, uiPartSize, iXOffset, iYOffset);
     712
     713  for ( y = uiPartSize-1; y >= iYOffset; y-- )
     714  {
     715          if(iPUResiPredShift[3] >= 0)
     716          {
     717                  for ( x = uiPartSize-1; x >= iXOffset; x-- )
     718                  {
     719                          pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]);
     720                  }
     721          }
     722
     723          if(iPUResiPredShift[2] >= 0)
     724          {
     725                  for ( x = iXOffset-1; x >= 0; x-- )
     726                  {
     727                          pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]);
     728                  }
     729          }
     730          pSrc0 += iSrc0Stride;
     731          pSrc1 += iSrc1Stride;
     732          pDst  += iDstStride;
     733  }
     734
     735  for ( y = iYOffset-1; y >= 0; y-- )
     736  {
     737          if(iPUResiPredShift[1] >= 0)
     738          {
     739                  for ( x = uiPartSize-1; x >= iXOffset; x-- )
     740                  {
     741                          pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]);
     742                  }
     743          }
     744
     745          if(iPUResiPredShift[0] >= 0)
     746          {
     747                  for ( x = iXOffset-1; x >= 0; x-- )
     748                  {
     749                          pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]);
     750                  }
     751          }
     752          pSrc0 += iSrc0Stride;
     753          pSrc1 += iSrc1Stride;
     754          pDst  += iDstStride;
     755  }
     756
     757#else
    554758  for ( y = uiPartSize-1; y >= 0; y-- )
    555759  {
     
    562766    pDst  += iDstStride;
    563767  }
    564 }
    565 
     768#endif
     769}
     770
     771#if LG_RESTRICTEDRESPRED_M24766
     772Void TComYuv::subtractChroma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
     773#else
    566774Void TComYuv::subtractChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
     775#endif
    567776{
    568777  Int x, y;
     
    578787  Int  iSrc1Stride = pcYuvSrc1->getCStride();
    579788  Int  iDstStride  = getCStride();
     789#if LG_RESTRICTEDRESPRED_M24766
     790  Int iXOffset, iYOffset;
     791 
     792  getPUXYOffset(uhPartitionSize, uiPartSize, uiPartSize, iXOffset, iYOffset);
     793
     794  for ( y = uiPartSize-1; y >= iYOffset; y-- )
     795  {
     796          if(iPUResiPredShift[3] >= 0)
     797          {
     798                  for ( x = uiPartSize-1; x >= iXOffset; x-- )
     799                  {
     800                          pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[3]);
     801                          pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[3]);
     802                  }
     803          }
     804
     805          if(iPUResiPredShift[2] >= 0)
     806          {
     807                  for ( x = iXOffset-1; x >= 0; x-- )
     808                  {
     809                          pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[2]);
     810                          pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[2]);
     811                  }
     812          }
     813          pSrcU0 += iSrc0Stride;
     814          pSrcU1 += iSrc1Stride;
     815          pSrcV0 += iSrc0Stride;
     816          pSrcV1 += iSrc1Stride;
     817          pDstU  += iDstStride;
     818          pDstV  += iDstStride;
     819  }
     820
     821  for ( y = iYOffset-1; y >= 0; y-- )
     822  {
     823          if(iPUResiPredShift[1] >= 0)
     824          {
     825                  for ( x = uiPartSize-1; x >= iXOffset; x-- )
     826                  {
     827                          pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[1]);
     828                          pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[1]);
     829                  }
     830          }
     831
     832          if(iPUResiPredShift[0] >= 0)
     833          {
     834                  for ( x = iXOffset-1; x >= 0; x-- )
     835                  {
     836                          pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[0]);
     837                          pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[0]);
     838                  }
     839          }
     840          pSrcU0 += iSrc0Stride;
     841          pSrcU1 += iSrc1Stride;
     842          pSrcV0 += iSrc0Stride;
     843          pSrcV1 += iSrc1Stride;
     844          pDstU  += iDstStride;
     845          pDstV  += iDstStride;
     846  }
     847#else
    580848  for ( y = uiPartSize-1; y >= 0; y-- )
    581849  {
     
    592860    pDstV  += iDstStride;
    593861  }
     862#endif
    594863}
    595864
  • trunk/source/Lib/TLibCommon/TComYuv.h

    r56 r77  
    146146  Void    addClipPartLuma   ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); //GT
    147147
    148  
     148#if LG_RESTRICTEDRESPRED_M24766
    149149  //  pcYuvSrc0 - pcYuvSrc1 -> m_apiBuf
     150  Void    subtract          (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
     151  Void    subtractLuma      (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
     152  Void    subtractChroma    (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
     153#else
    150154  Void    subtract          ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
    151155  Void    subtractLuma      ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
    152156  Void    subtractChroma    ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
     157#endif
    153158 
    154159  //  (pcYuvSrc0 + pcYuvSrc1)/2 for YUV partition
     
    161166  //   Remove High frequency
    162167  Void    removeHighFreq    ( TComYuv* pcYuvSrc, UInt uiPartIdx, UInt uiWidht, UInt uiHeight );
    163  
     168#if LG_RESTRICTEDRESPRED_M24766
     169  void    getPUXYOffset     (PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset);
     170  Void    add               (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false );
     171  Void    addLuma           (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract );
     172  Void    addChroma         (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract );
     173#else
    164174  Void    add               ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false );
    165175  Void    addLuma           ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract );
    166176  Void    addChroma         ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract );
     177#endif
    167178
    168179  Void    clip              ( Int iWidth, Int iHeight );
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r56 r77  
    4646#define HHI_INTER_VIEW_MOTION_PRED        1   // inter-view motion parameter prediction
    4747#define HHI_INTER_VIEW_RESIDUAL_PRED      1   // inter-view residual prediction
     48#define HHI_FIX                           1   // inter-view prediction and other fixes
    4849
    4950#define HHI_VSO                           1
    5051#define HHI_VSO_LS_TABLE                  1
    5152#define HHI_VSO_DIST_INT                  1
     53#define HHI_VSO_SYNTH_DIST_OUT            0
     54#define HHI_VSO_COLOR_PLANES              1
    5255
    5356#define HHI_INTERVIEW_SKIP                1
     
    6770#define HHI_FULL_PEL_DEPTH_MAP_MV_ACC   1   // full-pel mv accuracy for depth maps
    6871
    69 
    70 
     72#if HHI_INTER_VIEW_MOTION_PRED
     73#define SAIT_IMPROV_MOTION_PRED_M24829  1   // improved inter-view motion vector prediction
     74#else
     75#define SAIT_IMPROV_MOTION_PRED_M24829  0   
     76#endif
     77
     78#if HHI_INTER_VIEW_RESIDUAL_PRED
     79#define LG_RESTRICTEDRESPRED_M24766     1   // restricted inter-view residual prediction
     80#define QC_SIMPLIFIEDIVRP_M24938        1
     81#else
     82#define LG_RESTRICTEDRESPRED_M24766     0
     83#define QC_SIMPLIFIEDIVRP_M24938        0
     84#endif
    7185
    7286
     
    344358#define COMPLETE_SLICES_IN_TILE     1 // Among the constraints between slices and tiles, all slices within a tile shall be complete (JCTVC-H0348/JCTVC-H0463) for SliceMode 1&2
    345359#define WPP_SIMPLIFICATION          1 // JCTVC-H0349/JCTVC-0517
     360
     361// ====================================================================================================================
     362// VPS INTEGRATION
     363// ====================================================================================================================
     364#define VIDYO_VPS_INTEGRATION       1
     365#if VIDYO_VPS_INTEGRATION
     366#define MAX_NUM_VPS 10
     367#endif
     368
    346369// ====================================================================================================================
    347370// Basic type redefinition
     
    751774};
    752775
    753 
    754776//! \}
    755777
Note: See TracChangeset for help on using the changeset viewer.