Changeset 167 in 3DVCSoftware for branches/HTM-4.1-dev1-Qualcomm


Ignore:
Timestamp:
5 Nov 2012, 02:24:25 (12 years ago)
Author:
qualcomm
Message:

JCT3V-B0047

Location:
branches/HTM-4.1-dev1-Qualcomm/source/Lib
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp

    r163 r167  
    35133513  {
    35143514#if LGE_DVMCP
    3515 #if LGE_IVMP_PARALLEL_MERGE_B0136
     3515#if LGE_IVMP_PARALLEL_MERGE_B0136 && !QC_SIMPLE_NBDV_B0047
    35163516    getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true, REF_PIC_LIST_X, -1, true );
    35173517#else
    3518     getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true );
     3518    getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo
     3519#if LGE_IVMP_PARALLEL_MERGE_B0136==QC_SIMPLE_NBDV_B0047
     3520,
     3521true
     3522#endif
     3523);
    35193524#endif
    35203525#else
     
    49014906
    49024907#if LGE_DVMCP
     4908#if QC_SIMPLE_NBDV_B0047
     4909Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo
     4910#if LGE_IVMP_PARALLEL_MERGE_B0136
     4911                                , Bool bParMerge
     4912#endif
     4913#else
    49034914Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0
    49044915#if LGE_IVMP_PARALLEL_MERGE_B0136
    49054916                                , Bool bParMerge
    49064917#endif
     4918#endif
    49074919                                )
    49084920{
    49094921  PartSize eCUMode = getPartitionSize( uiPartAddr );
    49104922  TComDataCU* pcTmpCU = NULL;
     4923#if !QC_SIMPLE_NBDV_B0047
    49114924  TComDataCU* pcCULeft = NULL;
     4925#endif
    49124926  pDInfo->iN = 0;
    49134927
     
    49174931  UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();
    49184932
    4919   Int   aiDvMcpDvCand[2][7] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ ºúÓ°¿¡¼­ »ç¿E?DV¸¦ ÀúÀE
     4933#if QC_SIMPLE_NBDV_B0047
     4934  const Int iNumofDvMCP = 7;
     4935  Int   aiDvMcpDvCand[2][iNumofDvMCP] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal
     4936  Bool  abDvMcpFlag  [2][iNumofDvMCP] = {{false,},{false,}};
     4937#else
     4938  Int   aiDvMcpDvCand[2][7] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal
    49204939  Bool  abDvMcpFlag  [2][7] = {{false,},{false,}};
    49214940  //Int   aiRefPOC     [2][7] = {{-1,},{-1}}; // debug
     4941#endif
    49224942  TComMv cTmpMvPred, cMv;
    49234943  Bool  bTmpIsSkipped = false;
     
    49584978#endif
    49594979
    4960 
     4980#if !QC_SIMPLE_NBDV_B0047
    49614981  pcCULeft = pcTmpCU;
    49624982  UInt uiLeftPartIdx = uiIdx;
     4983#endif
     4984
    49634985  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
    49644986  {
     
    52125234  if ( getSlice()->getPPS()->getEnableTMVPFlag() )
    52135235  {
     5236#if !QC_SIMPLE_NBDV_B0047
    52145237    UInt uiPUIdx = uiPartIdx;
    52155238    UInt uiAbsPartAddr = uiPartAddr;
     
    53695392      }
    53705393    }
     5394#else
     5395    TComMv cColMv;
     5396    Int iTargetViewIdx = 0;
     5397    Int iTStartViewIdx = 0;
     5398    UInt uiPartIdxRB, uiBRIdx;
     5399    Int uiViewIdxCurr= getSlice()->getViewId();
     5400    UInt uiPartIdxCenter;
     5401    xDeriveCenterIdx( eCUMode, uiPartIdx, uiPartIdxCenter );
     5402
     5403    Int uiLCUIdx = getAddr();
     5404    Int uiLCUnew = uiLCUIdx;
     5405    eCUMode = getPartitionSize( 0 );
     5406    deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB ); 
     5407    uiBRIdx = uiPartIdxLT;
     5408    UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB];
     5409    if ( (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) &&(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() ))  // image boundary check
     5410    {
     5411      if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) &&           // is not at the last column of LCU
     5412      ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row    of LCU
     5413      {
     5414        uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ];
     5415      }
     5416      else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 )           // is not at the last column of LCU But is last row of LCU
     5417      {
     5418        uiBRIdx = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ];
     5419        uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU();
     5420      }
     5421      else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU
     5422      {
     5423        uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ];
     5424        uiLCUnew = uiLCUIdx + 1;
     5425      }
     5426      else //is the right bottom corner of LCU                       
     5427      {
     5428        uiBRIdx = 0;
     5429        uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU() + 1;
     5430      }
     5431    }
     5432    const Int iNumofCandPic = 2;
     5433    for(Int i =0; i < iNumofCandPic; i++)
     5434    {
     5435      Int lpRef=0;
     5436      if(i == 0)
     5437      {   //check the col-located picture
     5438        eRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0);
     5439#if COLLOCATED_REF_IDX
     5440        lpRef = getSlice()->getColRefIdx();
     5441#else
     5442        Int lpRef = 0;
     5443#endif
     5444      }
     5445      else
     5446      {
     5447        if(!(getPic()->getRapbCheck()))
     5448          break;
     5449        eRefPicList=getPic()->getRapRefList();
     5450        lpRef=getPic()->getRapRefIdx();
     5451      }
     5452
     5453      if( m_pcSlice->getViewId() == getSlice()->getRefPic( eRefPicList, lpRef)->getViewId() )
     5454      {
     5455        if (uiViewIdxCurr > 1) 
     5456        {
     5457          if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) )
     5458          {
     5459            clipMv(cColMv);
     5460            pDInfo->m_acMvCand[pDInfo->iN] = cColMv;
     5461            pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx;
     5462            return ;
     5463          }
     5464        }
     5465
     5466        if(xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiPartIdxCenter,  cColMv, iTargetViewIdx, iTStartViewIdx ))
     5467        {
     5468          clipMv(cColMv);
     5469          pDInfo->m_acMvCand[pDInfo->iN] = cColMv;
     5470          pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx;
     5471          return ;
     5472        }
     5473        if(uiViewIdxCurr == 1) 
     5474        {
     5475          if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) )
     5476          {
     5477            clipMv(cColMv);
     5478            pDInfo->m_acMvCand[pDInfo->iN] = cColMv;
     5479            pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx;
     5480            return ;
     5481          }
     5482        }
     5483      }
     5484    }
     5485#endif
    53715486  } // if TMVP Flag
    53725487
    53735488  if( bDvMcpIsFound ) // skip dvmcp
    53745489  {
     5490#if QC_SIMPLE_NBDV_B0047
     5491    for( Int i=1 ; i<iNumofDvMCP-1 ; i++ ) // 5 spatial
     5492#else
    53755493    for( Int i=1 ; i<7 ; i++ ) // 5 spatial + 1 temporal
     5494#endif
    53765495    {
    53775496      for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    53895508    }
    53905509  }
    5391 
    53925510  return;
    5393 
    5394 }
    5395 #endif
    5396 
     5511}
     5512#endif
    53975513#endif
    53985514
     
    54345550      cDisInfo.iN = 0;
    54355551#if LGE_DVMCP
     5552#if QC_SIMPLE_NBDV_B0047
     5553      getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo);
     5554#else
    54365555      getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx );
     5556#endif
    54375557#else
    54385558      getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo );
     
    54865606  {
    54875607#if LGE_DVMCP
     5608#if QC_SIMPLE_NBDV_B0047
     5609    getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo);
     5610#else
    54885611    getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx );
     5612#endif
    54895613#else
    54905614    getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo );
     
    61726296Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx )
    61736297{
    6174 #if LGE_DVMCP
     6298#if LGE_DVMCP && !QC_SIMPLE_NBDV_B0047
    61756299  Int  iDvMcpDispX[2] = {-1,};
    61766300  Bool bDvMcpFlag [2] = { false, };
     
    61916315    return false;
    61926316  }
    6193 #if LGE_DVMCP
     6317#if LGE_DVMCP && !QC_SIMPLE_NBDV_B0047
    61946318  Bool bColIsSkipped = pColCU->isSkipped( uiAbsPartAddr );
    61956319#endif
     
    62156339    if ( iColViewIdx    == iColRefViewIdx ) // temporal vector
    62166340    {
    6217 #if LGE_DVMCP
     6341#if LGE_DVMCP && !QC_SIMPLE_NBDV_B0047
    62186342      if( iColViewIdx >0 )
    62196343      {
     
    62426366  }
    62436367
    6244 #if LGE_DVMCP
     6368#if LGE_DVMCP && !QC_SIMPLE_NBDV_B0047
    62456369  for( Int ilist=0 ; ilist<2 ; ilist++ )
    62466370  {
     
    73607484  m_pePartSize[0] =  SIZE_2Nx2N;
    73617485#if LGE_DVMCP
     7486#if QC_SIMPLE_NBDV_B0047
     7487  getDisMvpCand2( 0, 0,  &cDisInfo);
     7488#else
    73627489  getDisMvpCand2( 0, 0,  &cDisInfo, true );
     7490#endif
    73637491#else
    73647492  getDisMvpCand        ( 0, 0,  &cDisInfo );
  • branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.h

    r163 r167  
    538538  Void          getDisMvpCand        ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo );
    539539#if LGE_DVMCP
     540#if QC_SIMPLE_NBDV_B0047
     541  Void          getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo
     542#if LGE_IVMP_PARALLEL_MERGE_B0136
     543    , Bool bParMerg = false
     544#endif
     545    );
     546#else
    540547  Void          getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1
    541548#if LGE_IVMP_PARALLEL_MERGE_B0136
     
    543550#endif
    544551    );
     552#endif
    545553#endif
    546554
  • branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComPic.cpp

    r100 r167  
    8181  m_aaiCodedScale     = 0;
    8282  m_aaiCodedOffset    = 0;
     83#if QC_SIMPLE_NBDV_B0047
     84  m_bRapCheck = false;
     85  m_eRapRefList = REF_PIC_LIST_0;
     86  m_uiRapRefIdx = 0;
     87#endif
     88
    8389}
    8490
     
    480486  }
    481487}
     488#if QC_SIMPLE_NBDV_B0047
     489Bool TComPic::getDisCandRefPictures(Int iColPOC)
     490{
     491  UInt uiTempLayerCurr=7;
     492  TComSlice* currSlice = getCurrSlice();
     493  UInt iPOCCurr=currSlice->getPOC();
     494  UInt iPOCDiff = 255;
     495  Bool  bRAP=false;
     496  Bool bCheck = false;
     497  Int MaxRef = currSlice->getNumRefIdx(RefPicList(0));
     498  RefPicList eRefPicList = REF_PIC_LIST_0 ;
     499  if(currSlice->isInterB())
     500  {
     501    if(currSlice->getNumRefIdx(RefPicList(0))< currSlice->getNumRefIdx(RefPicList(1)))
     502      MaxRef = currSlice->getNumRefIdx(RefPicList(1));
     503  }
     504  for(Int lpRef = 0; lpRef < MaxRef; lpRef++)
     505  {
     506    for(Int lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr ++)
     507    {
     508      eRefPicList = RefPicList(0);
     509      if(currSlice->isInterB())
     510        eRefPicList = RefPicList(lpNr==0 ? (currSlice->getColDir()): (1-currSlice->getColDir()));
     511      if(iColPOC == currSlice->getRefPOC(eRefPicList, lpRef))
     512        continue;
     513      if(lpRef >= currSlice->getNumRefIdx(eRefPicList)||(currSlice->getViewId() != currSlice->getRefPic( eRefPicList, lpRef)->getViewId()))
     514        continue;
     515      Int iTempPoc = currSlice->getRefPic(eRefPicList, lpRef)->getPOC();
     516      UInt uiTempLayer = currSlice->getRefPic(eRefPicList, lpRef)->getCurrSlice()->getTLayer();
     517      Int iTempDiff = (iTempPoc > iPOCCurr) ? (iTempPoc - iPOCCurr): (iPOCCurr - iTempPoc);
     518      bRAP = (currSlice->getRefPic(eRefPicList, lpRef)->getCurrSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV? 1:0);
     519      if( bRAP)
     520      {
     521         bCheck = true;
     522         this->setRapRefIdx(lpRef);
     523         this->setRapRefList(eRefPicList);
     524         return bCheck;
     525      }
     526      if(uiTempLayerCurr > uiTempLayer)
     527      {
     528        bCheck = true;
     529        if(uiTempLayerCurr == uiTempLayer)
     530        {
     531          if(iPOCDiff > iTempDiff)
     532          {
     533            iPOCDiff=iTempDiff;
     534            if(iPOCDiff < 255)
     535            {
     536              this->setRapRefIdx(lpRef);
     537              this->setRapRefList(eRefPicList);
     538            }
     539          }
     540        }
     541        else
     542        {
     543          iPOCDiff=iTempDiff;
     544          uiTempLayerCurr = uiTempLayer;
     545          this->setRapRefIdx(lpRef);
     546          this->setRapRefList(eRefPicList);
     547        }
     548      }
     549    }
     550  }
     551  return bCheck;
     552}
     553#endif
    482554
    483555#if HHI_INTERVIEW_SKIP
  • branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComPic.h

    r126 r167  
    8282  Bool          m_checked;
    8383#endif
     84#if QC_SIMPLE_NBDV_B0047
     85  UInt        m_uiRapRefIdx;
     86  RefPicList  m_eRapRefList;
     87  Bool        m_bRapCheck;
     88#endif
    8489#endif
    8590#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    173178#if HHI_INTER_VIEW_RESIDUAL_PRED
    174179  TComPicYuv*   getResidual()         { return  m_pcResidual; }
     180#endif
     181#if QC_SIMPLE_NBDV_B0047
     182  UInt          getRapRefIdx()                         {return m_uiRapRefIdx;}
     183  RefPicList    getRapRefList()                        {return m_eRapRefList;}
     184  Void          setRapRefIdx(UInt uiRapRefIdx)         {m_uiRapRefIdx = uiRapRefIdx;}
     185  Void          setRapRefList(RefPicList eRefPicList)  {m_eRapRefList = eRefPicList;}
     186  Bool          getRapbCheck()                         {return m_bRapCheck;}
     187  Void          setRapbCheck(Bool bCheck)              {m_bRapCheck = bCheck;}
     188  Bool          getDisCandRefPictures(Int iColPOC);
    175189#endif
    176190
  • branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TypeDef.h

    r163 r167  
    7777    #define DIS_CANS                      1
    7878#endif                                 
    79                                        
     79#define QC_SIMPLE_NBDV_B0047              1   //JCT2-B0047
    8080#define MTK_INTERVIEW_MERGE_A0049         1   //  JCT2-A0049 second part
    8181#define SHARP_INTERVIEW_DECOUPLE_B0111    1   //  JCT3V-B0111 decoupling inter-view candidate
  • branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibDecoder/TDecGop.cpp

    r100 r167  
    312312#endif
    313313
     314#if QC_SIMPLE_NBDV_B0047
     315    if(pcSlice->getViewId() && pcSlice->getSPS()->getMultiviewMvPredMode())
     316    {
     317      Int iColPoc = pcSlice->getRefPOC(RefPicList(pcSlice->getColDir()), pcSlice->getColRefIdx());
     318      rpcPic->setRapbCheck(rpcPic->getDisCandRefPictures(iColPoc));
     319    }
     320#endif
    314321
    315322    m_pcSbacDecoders[0].load(m_pcSbacDecoder);
  • branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibEncoder/TEncGOP.cpp

    r120 r167  
    719719#endif
    720720
     721#if QC_SIMPLE_NBDV_B0047
     722      if(pcSlice->getViewId() && pcSlice->getSPS()->getMultiviewMvPredMode())
     723      {
     724        Int iColPoc = pcSlice->getRefPOC(RefPicList(pcSlice->getColDir()), pcSlice->getColRefIdx());
     725        pcPic->setRapbCheck(pcPic->getDisCandRefPictures(iColPoc));
     726      }
     727#endif
    721728      while(uiNextCUAddr<uiRealEndAddress) // determine slice boundaries
    722729      {
Note: See TracChangeset for help on using the changeset viewer.