Changeset 313 in 3DVCSoftware


Ignore:
Timestamp:
20 Mar 2013, 21:35:14 (12 years ago)
Author:
tech
Message:

Reintegrated branch 6.0-dev0 rev. 312.

Location:
trunk/source
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r296 r313  
    429429      m_cVPS.setDependentLayer                                        ( layerId-1, layerId);
    430430#endif
     431#if FCO_FIX_SPS_CHANGE
     432      m_acTEncDepthTopList[iViewIdx]->setCamParPrecision              ( m_cCameraData.getCamParsCodedPrecision  () );
     433      m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader          ( m_cCameraData.getVaryingCameraParameters() );
     434      m_acTEncDepthTopList[iViewIdx]->setCodedScale                   ( m_cCameraData.getCodedScale             () );
     435      m_acTEncDepthTopList[iViewIdx]->setCodedOffset                  ( m_cCameraData.getCodedOffset            () );
     436#else
    431437      m_acTEncDepthTopList[iViewIdx]->setCamParPrecision              ( 0 );
    432438      m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader          ( false );
    433439      m_acTEncDepthTopList[iViewIdx]->setCodedScale                   ( 0 );
    434440      m_acTEncDepthTopList[iViewIdx]->setCodedOffset                  ( 0 );
     441#endif
    435442
    436443      //====== Coding Structure ========
     
    970977    {
    971978      Int  iNumEncoded = 0;
     979
    972980#if !QC_MVHEVC_B0046
    973981      UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId );
     
    977985      }
    978986#endif
     987
    979988
    980989#if FLEX_CODING_ORDER_M23723
     
    9941003            assert(isdigit(m_pchMVCJointCodingOrder[i]));
    9951004            iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     1005#if (FCO_FIX && MERL_VSP_C0152)
     1006            Int iCurPoc = m_acTEncTopList[iViewIdx]->getFrameId(gopId);
     1007            if( iCurPoc < m_acTEncTopList[iViewIdx]->getFrameToBeEncoded() && iViewIdx!=0 )
     1008            {
     1009              TComPic* pcBaseTxtPic   = getPicFromView(  0, m_acTEncTopList[iViewIdx]->getFrameId(gopId), false ); //get base view reconstructed texture
     1010              TComPic* pcBaseDepthPic = getPicFromView(  0, m_acTEncTopList[iViewIdx]->getFrameId(gopId), true );  //get base view reconstructed depth
     1011              TEncSlice* pEncSlice = m_acTEncTopList[iViewIdx]->getSliceEncoder();
     1012              pEncSlice->setRefPicBaseTxt(pcBaseTxtPic);
     1013              pEncSlice->setRefPicBaseDepth(pcBaseDepthPic);
     1014            }
     1015            setBWVSPLUT( iViewIdx, gopId, false);           
     1016#endif
    9961017
    9971018            m_acTEncTopList[iViewIdx]->encode( eos[iViewIdx], pcPicYuvOrg, *m_picYuvRec[iViewIdx], outputAccessUnits, iNumEncoded, gopId );
     
    10081029              assert(isdigit(m_pchMVCJointCodingOrder[i]));
    10091030              iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     1031
    10101032#if SAIT_VSO_EST_A0033
    10111033              if( m_bUseVSO && iNextPoc < m_iFrameToBeEncoded )
     
    10151037              }
    10161038#endif
     1039#if (FCO_FIX && MERL_VSP_C0152)
     1040              Int iCurPocDepth = m_acTEncDepthTopList[iViewIdx]->getFrameId(gopId);
     1041              if( iCurPocDepth < m_acTEncDepthTopList[iViewIdx]->getFrameToBeEncoded() && iViewIdx!=0 )
     1042              {
     1043                TComPic* pcBaseDepthPic = getPicFromView(  0, m_acTEncDepthTopList[iViewIdx]->getFrameId(gopId), true );
     1044                TEncSlice* pcSlice = (TEncSlice*) m_acTEncDepthTopList[iViewIdx]->getSliceEncoder();
     1045                pcSlice->setRefPicBaseDepth(pcBaseDepthPic);
     1046              }
     1047              setBWVSPLUT( iViewIdx, gopId, true);
     1048#endif
    10171049              m_acTEncDepthTopList[iViewIdx]->encode( depthEos[iViewIdx], pcDepthPicYuvOrg, *m_picYuvDepthRec[iViewIdx], outputAccessUnits, iNumDepthEncoded, gopId );
    10181050              xWriteOutput(bitstreamFile, iNumDepthEncoded, outputAccessUnits, iViewIdx, true);
     
    10391071
    10401072#if MERL_VSP_C0152
     1073#if MERL_VSP_C0152_BugFix_ForNoDepthCase
     1074        if(m_bUsingDepthMaps) //VSP can be used only when depth is available as input
     1075        {
     1076#endif
    10411077        Int iCurPoc = m_acTEncDepthTopList[iViewIdx]->getFrameId(gopId);
    10421078        if( iCurPoc < m_acTEncDepthTopList[iViewIdx]->getFrameToBeEncoded() && iViewIdx!=0 )
     
    10491085        }
    10501086        setBWVSPLUT( iViewIdx, gopId, false);
     1087#if MERL_VSP_C0152_BugFix_ForNoDepthCase
     1088        }
     1089        else
     1090        {
     1091          Int iCurPoc = m_acTEncTopList[iViewIdx]->getFrameId(gopId);
     1092          if( iCurPoc < m_acTEncTopList[iViewIdx]->getFrameToBeEncoded() && iViewIdx!=0 )
     1093          {
     1094            TEncSlice* pEncSlice = m_acTEncTopList[iViewIdx]->getSliceEncoder();
     1095            pEncSlice->setRefPicBaseTxt(NULL);//Initialize the base view reconstructed texture buffer
     1096            pEncSlice->setRefPicBaseDepth(NULL);//Initialize the base view reconstructed depth buffer
     1097          }
     1098        }
     1099#endif
     1100
    10511101#endif
    10521102        // call encoding function for one frame
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r296 r313  
    8181                                          UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDInfo )
    8282{
     83#if MERL_VSP_C0152_BugFix_ForNoDepthCase
     84  TComPic* pRefPicBaseDepth = NULL;
     85  pRefPicBaseDepth = getSlice()->getRefPicBaseDepth();
     86  if(ucVspMergePos == VSP_MERGE_POS && pRefPicBaseDepth) //VSP can be used only when depth is used as input
     87#else
     88  if( ucVspMergePos == VSP_MERGE_POS )
     89#endif
    8390  if( ucVspMergePos == VSP_MERGE_POS )
    8491  {
     
    35963603#if H3D_IVMP
    35973604#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     3605#if FCO_FIX
     3606  const Int extraMergeCand = ( ( ( getSlice()->getIsDepth() && m_pcSlice->getTexturePic() ) || getSlice()->getSPS()->getMultiviewMvPredMode() )? 1 : 0 );
     3607#else
    35983608  const Int extraMergeCand = ( ( getSlice()->getIsDepth() || getSlice()->getSPS()->getMultiviewMvPredMode() )? 1 : 0 );
     3609#endif
    35993610#else
    36003611  const Int extraMergeCand = ( getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     
    36513662  if(!bNoPdmMerge)
    36523663  {
     3664#if FCO_DVP_REFINE_C0132_C0170
     3665    if( !getPic()->getDepthCoded() )
     3666#endif
    36533667    getDisMvpCandNBDV(uiPUIdx, uiAbsPartIdx, &cDisInfo , true
    36543668#if MERL_VSP_C0152
     
    36573671);
    36583672  }
     3673#if FCO_DVP_REFINE_C0132_C0170
     3674  if(getPic()->getDepthCoded() )
     3675  {
     3676    TComPic*      pcCodedDepthMap = getPic()->getRecDepthMap();
     3677    TComMv        cColMv;
     3678
     3679    cColMv.setZero();
     3680    estimateDVFromDM(uiPUIdx, pcCodedDepthMap, uiAbsPartIdx, &cColMv, false);
     3681
     3682    cDisInfo.iN = 1;
     3683    cDisInfo.m_acMvCand[0].setHor( cColMv.getHor() );
     3684    cDisInfo.m_acMvCand[0].setVer( cColMv.getVer() );
     3685    cDisInfo.m_aVIdxCan[0] = 0;
     3686
     3687  }
     3688#endif
    36593689  if(cDisInfo.iN==0)
    36603690  {
     
    36693699
    36703700#if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137
     3701#if FCO_FIX
     3702  if( m_pcSlice->getIsDepth() && m_pcSlice->getTexturePic() )
     3703#else
    36713704  if( m_pcSlice->getIsDepth())
     3705#endif
    36723706  {
    36733707    UInt uiPartIdxCenter;
     
    51405174  Int width  = pcBaseViewDepthPicYuv->getWidth();
    51415175  Int height = pcBaseViewDepthPicYuv->getHeight();
    5142 
     5176#if MTK_DVPREFINE_BVSP_BUG_FIX
     5177  Int depthPosX = Clip3(0,   width - iWidth,  iBlkX + (mv->getHor()>>2));
     5178  Int depthPosY = Clip3(0,   height - iHeight,  iBlkY + (mv->getVer()>>2));
     5179#else
    51435180  Int depthPosX = Clip3(0,   width - iWidth  - 1,  iBlkX + (mv->getHor()>>2));
    51445181  Int depthPosY = Clip3(0,   height- iHeight - 1,  iBlkY + (mv->getVer()>>2));
    5145 
     5182#endif
    51465183  Pel *depth  = pcBaseViewDepthPicYuv->getLumaAddr() + depthPosX + depthPosY * depStride;
    51475184  Pel  maxDepth = 0;
     
    51495186  if ( bSimpleDvpRefine )
    51505187  {
     5188#if MTK_DVPREFINE_BVSP_BUG_FIX
     5189    Int depthStartPosX = Clip3(0,   width - iWidth,  iBlkX + (mv->getHor()>>2));
     5190    Int depthStartPosY = Clip3(0,   height - iHeight,  iBlkY + (mv->getVer()>>2));
     5191    Int depthEndPosX = Clip3(0,   width - 1,  iBlkX + iWidth - 1  + (mv->getHor()>>2));
     5192    Int depthEndPosY = Clip3(0,   height - 1,  iBlkY + iHeight - 1 + (mv->getVer()>>2));
     5193#else
    51515194    Int depthStartPosX = Clip3(0,   width - iWidth  - 1,  iBlkX + (mv->getHor()>>2));
    51525195    Int depthStartPosY = Clip3(0,   height- iHeight - 1,  iBlkY + (mv->getVer()>>2));
    51535196    Int depthEndPosX = Clip3(0,   width - iWidth  - 1,  iBlkX + iWidth  + (mv->getHor()>>2));
    51545197    Int depthEndPosY = Clip3(0,   height- iHeight - 1,  iBlkY + iHeight + (mv->getVer()>>2));
     5198#endif
    51555199    Int iCenterX = (depthStartPosX + depthEndPosX) >> 1;
    51565200    Int iCenterY = (depthStartPosY + depthEndPosY) >> 1;
     
    60796123      DisInfo cDisInfo;
    60806124      cDisInfo.iN = 0;
     6125#if FCO_DVP_REFINE_C0132_C0170
     6126      if( !getPic()->getDepthCoded() )
     6127#endif
    60816128      getDisMvpCandNBDV(uiPartIdx, uiPartAddr, &cDisInfo, false
    60826129#if MERL_VSP_C0152
     
    60846131#endif
    60856132              );
     6133#if FCO_DVP_REFINE_C0132_C0170
     6134      if(getPic()->getDepthCoded() )
     6135      {
     6136        TComPic*      pcCodedDepthMap = getPic()->getRecDepthMap();
     6137        TComMv        cColMv;
     6138
     6139        cColMv.setZero();
     6140        estimateDVFromDM(uiPartIdx, pcCodedDepthMap, uiPartAddr, &cColMv, false);
     6141
     6142        cDisInfo.iN = 1;
     6143        cDisInfo.m_acMvCand[0].setHor( cColMv.getHor() );
     6144        cDisInfo.m_acMvCand[0].setVer( cColMv.getVer() );
     6145        cDisInfo.m_aVIdxCan[0] = 0;
     6146      }
     6147#endif
    60866148      if(cDisInfo.iN==0)
    60876149      {
     
    79217983  PartSize m_peSaved =  getPartitionSize( 0 );
    79227984  m_pePartSize[0] =  SIZE_2Nx2N;
     7985#if FCO_DVP_REFINE_C0132_C0170
     7986  if(getPic()->getDepthCoded() )
     7987  {
     7988    TComPic*      pcCodedDepthMap = getPic()->getRecDepthMap();
     7989    TComMv        cColMv;
     7990
     7991    cColMv.setZero();
     7992    estimateDVFromDM(0, pcCodedDepthMap, 0, &cColMv, false);
     7993
     7994    cDisInfo.iN = 1;
     7995    cDisInfo.m_acMvCand[0].setHor( cColMv.getHor() );
     7996    cDisInfo.m_acMvCand[0].setVer( cColMv.getVer() );
     7997    cDisInfo.m_aVIdxCan[0] = 0;
     7998
     7999  }
     8000  else
     8001#endif
    79238002  getDisMvpCandNBDV( 0, 0,  &cDisInfo, false );
    79248003  if( cDisInfo.iN == 0)
  • trunk/source/Lib/TLibCommon/TComPic.cpp

    r296 r313  
    5959#endif
    6060#endif
     61#if FCO_DVP_REFINE_C0132_C0170
     62  m_bDepthCoded       = false;
     63  m_pcRecDepthMap     = NULL;
     64#endif
    6165#if H3D_IVMP
    6266  m_pcOrgDepthMap     = NULL;
  • trunk/source/Lib/TLibCommon/TComPic.h

    r296 r313  
    7373#endif
    7474
     75#if FCO_DVP_REFINE_C0132_C0170
     76  Bool                  m_bDepthCoded;
     77  TComPic*              m_pcRecDepthMap;   
     78#endif
     79
    7580#if LG_ZEROINTRADEPTHRESI_A0087
    7681  Int                   m_uiIntraPeriod;
     
    171176  Bool          getCandPicCheckedFlag ()                { return m_checked;}
    172177#endif
     178#endif
     179
     180#if FCO_DVP_REFINE_C0132_C0170
     181  void setRecDepthMap(TComPic * pRecPic)                { m_pcRecDepthMap = pRecPic; }
     182  TComPic * getRecDepthMap()                            { return m_pcRecDepthMap; }
     183  void setDepthCoded(Bool flag)                         { m_bDepthCoded = flag; }
     184  Bool getDepthCoded()                                  { return m_bDepthCoded; }
    173185#endif
    174186
  • trunk/source/Lib/TLibCommon/TComPicYuv.cpp

    r56 r313  
    6060  m_piPicOrgU       = NULL;
    6161  m_piPicOrgV       = NULL;
    62  
     62
     63#if FIX_APPENCTOP_T_ONLY
     64  m_cuOffsetY       = NULL;
     65  m_cuOffsetC       = NULL;
     66  m_buOffsetY       = NULL;
     67  m_buOffsetC       = NULL;
     68#endif 
     69
    6370  m_bIsBorderExtended = false;
    6471}
     
    137144  if( m_apiPicBufU ){ xFree( m_apiPicBufU );    m_apiPicBufU = NULL; }
    138145  if( m_apiPicBufV ){ xFree( m_apiPicBufV );    m_apiPicBufV = NULL; }
    139 
     146#if FIX_APPENCTOP_T_ONLY
     147  if( m_cuOffsetY )
     148  {
     149#endif
    140150  delete[] m_cuOffsetY;
    141151  delete[] m_cuOffsetC;
    142152  delete[] m_buOffsetY;
    143153  delete[] m_buOffsetC;
     154#if FIX_APPENCTOP_T_ONLY
     155  }
     156#endif
    144157}
    145158
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r296 r313  
    10661066    else
    10671067    {
     1068#if FIX_LGE_WP_FOR_3D_C0223
     1069      if ( ( pcCU->getSlice()->getPPS()->getUseWP()      && pcCU->getSlice()->getSliceType() == P_SLICE ) ||
     1070         ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() && pcCU->getSlice()->getSliceType() == B_SLICE ) )
     1071#else
    10681072      if ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() )
     1073#endif
    10691074      {
    10701075#if DEPTH_MAP_GENERATION
     
    11001105    }
    11011106  }
    1102 
     1107#if FIX_LGE_WP_FOR_3D_C0223
     1108  if ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() && pcCU->getSlice()->getSliceType() == B_SLICE  )
     1109#else
    11031110  if ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() )
     1111#endif
    11041112  {
    11051113#if MERL_VSP_C0152
     
    11101118    xWeightedPredictionBi( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred );
    11111119  }
     1120#if FIX_LGE_WP_FOR_3D_C0223
     1121  else if ( pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType() == P_SLICE )
     1122
     1123  {
     1124#if MERL_VSP_C0152
     1125    if(pcCU->getVSPIndex(uiPartAddr))
     1126      m_acYuvPred[0].copyPartToPartYuv( rpcYuvPred, uiPartAddr, iWidth, iHeight );
     1127    else
     1128#endif
     1129      xWeightedPredictionUni( pcCU, &m_acYuvPred[0], uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, rpcYuvPred, iPartIdx );
     1130  }
     1131#endif
    11121132  else
    11131133  {
     
    14341454  Int dstStride = dstPic->getStride();
    14351455  Int depStride =  pPicBaseDepth->getStride();
    1436 
     1456#if MTK_DVPREFINE_BVSP_BUG_FIX
     1457  Int depthPosX = Clip3(0,   widthLuma - size_x,  (posX/nTxtPerDepthX) + (mv->getHor()>>2));
     1458  Int depthPosY = Clip3(0,   heightLuma- size_y,  (posY/nTxtPerDepthY) + (mv->getVer()>>2));
     1459#else
    14371460  Int depthPosX = Clip3(0,   widthLuma - size_x - 1,  (posX/nTxtPerDepthX) + (mv->getHor()>>2));
    14381461  Int depthPosY = Clip3(0,   heightLuma- size_y - 1,  (posY/nTxtPerDepthY) + (mv->getVer()>>2));
    1439 
     1462#endif
    14401463  Pel *ref    = refPic->getLumaAddr() + posX + posY * refStride;
    14411464  Pel *dst    = dstPic->getLumaAddr(partAddr);
     
    15951618    depthPosX = posX * nDepthPerTxtX + (mv->getHor()>>2);        //mv denotes the disparity for VSP
    15961619  }
     1620#if MTK_DVPREFINE_BVSP_BUG_FIX
     1621  depthPosX = Clip3(0, widthDepth - (size_x<<1), depthPosX);
     1622#else
    15971623  depthPosX = Clip3(0, widthDepth - (size_x<<1) - 1, depthPosX);
    1598  
     1624#endif
    15991625  if ( heightChroma > heightDepth )
    16001626  {
     
    16091635    depthPosY = posY * nDepthPerTxtY + (mv->getVer()>>2);     //mv denotes the disparity for VSP
    16101636  }
     1637#if MTK_DVPREFINE_BVSP_BUG_FIX
     1638  depthPosY = Clip3(0, heightDepth - (size_y<<1), depthPosY);
     1639#else
    16111640  depthPosY = Clip3(0, heightDepth - (size_y<<1) - 1, depthPosY);
     1641#endif
    16121642
    16131643  Pel *refCb  = refPic->getCbAddr() + posX + posY * refStride;
  • trunk/source/Lib/TLibCommon/TComRdCostWeightPrediction.cpp

    r56 r313  
    8181  wpScalingParam  *wpCur    = &(pcDtParam->wpCur[uiComp]);
    8282  Int   w0      = wpCur->w,
    83         offset  = wpCur->offset,
    84         shift   = wpCur->shift,
    85         round   = wpCur->round;
    86  
     83    offset  = wpCur->offset,
     84    shift   = wpCur->shift,
     85    round   = wpCur->round;
     86
    8787  UInt uiSum = 0;
    88   #if HHI_INTERVIEW_SKIP
     88#if HHI_INTERVIEW_SKIP
    8989  if( pcDtParam->pUsed )
    9090  {
    9191    Pel*  piUsed      = pcDtParam->pUsed;
    9292    Int   iStrideUsed = pcDtParam->iStrideUsed;
    93   for( ; iRows != 0; iRows-- )
    94   {
    95     for (Int n = 0; n < iCols; n++ )
    96     {
     93    for( ; iRows != 0; iRows-- )
     94    {
     95      for (Int n = 0; n < iCols; n++ )
     96      {
    9797        if( piUsed[n])
    9898        {
    99       pred = ( (w0*piCur[n] + round) >> shift ) + offset ;
    100       //uiSum += abs( piOrg[n] - piCur[n] );
    101       uiSum += abs( piOrg[n] - pred );
    102     }
    103     }
    104     piOrg += iStrideOrg;
    105     piCur += iStrideCur;
     99          pred = ( (w0*piCur[n] + round) >> shift ) + offset ;
     100          uiSum += abs( piOrg[n] - pred );
     101        }
     102      }
     103      piOrg += iStrideOrg;
     104      piCur += iStrideCur;
    106105      piUsed += iStrideUsed;
    107   }
    108 #else
    109   for( ; iRows != 0; iRows-- )
    110   {
    111     for (Int n = 0; n < iCols; n++ )
    112     {
    113       pred = ( (w0*piCur[n] + round) >> shift ) + offset ;
    114  
    115       uiSum += abs( piOrg[n] - pred );
    116     }
    117     piOrg += iStrideOrg;
    118     piCur += iStrideCur;
    119   }
    120     #endif
    121     #if HHI_INTERVIEW_SKIP
     106    }
     107#if FIX_LGE_WP_FOR_3D_C0223
     108  }
     109  else
     110  {
     111#endif
     112#if FIX_LGE_WP_FOR_3D_C0223 //comment of #else
     113    //#else
     114#endif
     115#endif
     116    for( ; iRows != 0; iRows-- )
     117    {
     118      for (Int n = 0; n < iCols; n++ )
     119      {
     120        pred = ( (w0*piCur[n] + round) >> shift ) + offset ;
     121        uiSum += abs( piOrg[n] - pred );
    122122      }
    123     #endif
     123      piOrg += iStrideOrg;
     124      piCur += iStrideCur;
     125    }
     126#if FIX_LGE_WP_FOR_3D_C0223 //comment of #endif
     127    //#endif
     128#endif
     129#if HHI_INTERVIEW_SKIP
     130  }
     131#endif
    124132  pcDtParam->uiComp = 255;  // reset for DEBUG (assert test)
    125133
  • trunk/source/Lib/TLibCommon/TComResidualGenerator.cpp

    r296 r313  
    614614  Int           iDesStrideC = pcYuv    ->getCStride();
    615615#if MTK_RELEASE_DV_CONSTRAINT_C0129
     616#if FIX_CHROMA_RESIDUAL_C0129
     617  Pel*          pSrcSamplesU0= pcBaseRes->getCbAddr ( 0 ) + iCRefPosY0 * iSrcStrideC;
     618  Pel*          pSrcSamplesU1= pcBaseRes->getCbAddr ( 0 ) + iCRefPosY1 * iSrcStrideC;
     619  Pel*          pSrcSamplesV0= pcBaseRes->getCrAddr ( 0 ) + iCRefPosY0 * iSrcStrideC;
     620  Pel*          pSrcSamplesV1= pcBaseRes->getCrAddr ( 0 ) + iCRefPosY1 * iSrcStrideC;
     621#else
    616622  Pel*          pSrcSamplesU0= pcBaseRes->getCbAddr ( 0 ) + ( iCRefPosY0 >> 1 ) * iSrcStrideC;
    617623  Pel*          pSrcSamplesU1= pcBaseRes->getCbAddr ( 0 ) + ( iCRefPosY1 >> 1 ) * iSrcStrideC;
    618624  Pel*          pSrcSamplesV0= pcBaseRes->getCrAddr ( 0 ) + ( iCRefPosY0 >> 1 ) * iSrcStrideC;
    619625  Pel*          pSrcSamplesV1= pcBaseRes->getCrAddr ( 0 ) + ( iCRefPosY1 >> 1 ) * iSrcStrideC;
     626#endif
    620627#else
    621628  Pel*          pSrcSamplesU= pcBaseRes->getCbAddr ( 0 ) + ( uiYPos >> 1 ) * iSrcStrideC;
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r296 r313  
    17611761
    17621762Void
     1763#if FCO_FIX_SPS_CHANGE
     1764TComSPS::initMultiviewSPSDepth( UInt uiViewId, Int iViewOrderIdx, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset )
     1765#else
    17631766TComSPS::initMultiviewSPSDepth( UInt uiViewId, Int iViewOrderIdx )
     1767#endif
    17641768{
    17651769  AOT( uiViewId == 0 && iViewOrderIdx != 0 );
     
    17691773  m_iViewOrderIdx         = iViewOrderIdx;
    17701774  m_bDepth                = true;
     1775#if FCO_FIX_SPS_CHANGE
     1776  m_uiCamParPrecision     = ( m_uiViewId ? uiCamParPrecision : 0 );
     1777  m_bCamParInSliceHeader  = ( m_uiViewId ? bCamParSlice  : false );
     1778#else
    17711779  m_uiCamParPrecision     = 0;
    17721780  m_bCamParInSliceHeader  = false;
     1781#endif
    17731782  ::memset( m_aaiCodedScale,  0x00, sizeof( m_aaiCodedScale  ) );
    17741783  ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) );
     1784#if FCO_FIX_SPS_CHANGE
     1785#if !QC_MVHEVC_B0046
     1786  if( !m_bCamParInSliceHeader )
     1787  {
     1788    for( UInt uiBaseViewId = 0; uiBaseViewId < m_uiViewId; uiBaseViewId++ )
     1789    {
     1790      m_aaiCodedScale [ 0 ][ uiBaseViewId ] = aaiScale [ uiBaseViewId ][   m_uiViewId ];
     1791      m_aaiCodedScale [ 1 ][ uiBaseViewId ] = aaiScale [   m_uiViewId ][ uiBaseViewId ];
     1792      m_aaiCodedOffset[ 0 ][ uiBaseViewId ] = aaiOffset[ uiBaseViewId ][   m_uiViewId ];
     1793      m_aaiCodedOffset[ 1 ][ uiBaseViewId ] = aaiOffset[   m_uiViewId ][ uiBaseViewId ];
     1794    }
     1795  }
     1796#endif
     1797#endif
     1798
    17751799}
    17761800
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r296 r313  
    623623
    624624  Void initMultiviewSPS      ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
     625#if FCO_FIX_SPS_CHANGE
     626  Void initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
     627#else
    625628  Void initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx );
     629#endif
    626630
    627631  UInt getViewId             ()  { return m_uiViewId; }
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r296 r313  
    121121#define MTK_RELEASE_DV_CONSTRAINT_C0129   1   // JCT3V-C0129
    122122#define MTK_SIMPLIFY_DVTC_C0135           1   // JCT3V-C0135
     123#define FIX_CHROMA_RESIDUAL_C0129         1
    123124
    124125///// ***** MOTION PARAMETER INHERITANCE  *********
     
    166167#define HHI_DEPTH_INTRA_SEARCH_RAU_C0160  1   // JCT3V-C0160 change 1: full Intra search in depth random access units
    167168#define FIX_POZNAN_CABAC_INIT_FLAG        1
     169#define FIX_LGE_WP_FOR_3D_C0223           1   // JCT3V-C0223 Weighted Prediction Bug-fix for 3D-HEVC. Caution! There is still crush using WP with Residual Prediction.
     170#define FIX_APPENCTOP_T_ONLY              1   // For Texture-only coding
    168171
    169172///// ***** FCO  *********
     
    171174#if FLEX_CODING_ORDER_M23723
    172175#define DISABLE_FCO_FOR_VSO               0 // Optional compile settings to disable VSO with FCO.
     176#define FCO_DVP_REFINE_C0132_C0170        0 // depth oriented disparity vector prediction from JCT3V-C0132 and JCT3V-C0170
     177#define FCO_FIX                           0 // Bug fix for C0137 and C0152 on FCO
     178#define FCO_FIX_SPS_CHANGE                0 // Sending camera parameters in SPS of depth for depth to disparity conversion used by VSP and DoDVP
     179#else
     180#define DISABLE_FCO_FOR_VSO               0 // Optional compile settings to disable VSO with FCO.
     181#define FCO_DVP_REFINE_C0132_C0170        0 // depth oriented disparity vector prediction from JCT3V-C0132 and JCT3V-C0170
     182#define FCO_FIX                           0 // Fixing bugs from HTM 6.0 which
     183#define FCO_FIX_SPS_CHANGE                0 // Fixing bugs from HTM 6.0 which
    173184#endif
    174185
     
    176187#define MERL_VSP_C0152                    1 // JCT3V-C0152: 1: enable VSP-related tools; 0: disable VSP-related tools
    177188#if MERL_VSP_C0152
    178 
     189#define MERL_VSP_C0152_BugFix_ForNoDepthCase     1// MERL bugfix for test condition of no depth
    179190/*
    180191 * Two macros are used to configure combinations of JCT3V-C0152 and JCT3V-C0131
     
    199210#define VSP_MERGE_POS                        5 // JCT3V-C0152: fixed position of VSP candidate in merge list, supported values: 5.
    200211#define LGE_SIMP_DVP_REFINE_C0112            1 // JCT3V-C0112: 1: simplification of refining disparity vector using a warped depth block
     212#define MTK_DVPREFINE_BVSP_BUG_FIX               1
    201213
    202214#else // !MERL_VSP_C0152
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r296 r313  
    15011501      if( uiCode )
    15021502      {
     1503#if FCO_FIX_SPS_CHANGE
     1504        UInt  uiViewId, uiCamParPrecision;
     1505        Int   iVOI;
     1506        Bool  bCamParSlice;
     1507        READ_UVLC( uiCode, "view_id" );
     1508        READ_SVLC( iCode, "view_order_idx" );
     1509        uiViewId = uiCode;
     1510        iVOI = iCode;
     1511
     1512        if ( uiViewId == 0 )
     1513        {
     1514          pcSPS->initMultiviewSPSDepth    ( uiViewId, iVOI );
     1515        }
     1516        else
     1517        {
     1518          READ_UVLC( uiCamParPrecision, "camera_parameter_precision" );
     1519          READ_FLAG( uiCode, "camera_parameter_in_slice_header" );    bCamParSlice = ( uiCode == 1 );
     1520          if( !bCamParSlice )
     1521          {
     1522            for( UInt uiBaseId = 0; uiBaseId < uiViewId; uiBaseId++ )
     1523            {
     1524              READ_SVLC( iCode, "coded_scale" );   m_aaiTempScale [ uiBaseId ][ uiViewId ] = iCode;
     1525              READ_SVLC( iCode, "coded_offset" );   m_aaiTempOffset[ uiBaseId ][ uiViewId ] = iCode;
     1526              READ_SVLC( iCode, "inverse_coded_scale_plus_coded_scale" );   m_aaiTempScale [ uiViewId ][ uiBaseId ] = iCode - m_aaiTempScale [ uiBaseId ][ uiViewId ];
     1527              READ_SVLC( iCode, "inverse_coded_offset_plus_coded_offset" );   m_aaiTempOffset[ uiViewId ][ uiBaseId ] = iCode - m_aaiTempOffset[ uiBaseId ][ uiViewId ];
     1528            }
     1529          }
     1530          pcSPS->initMultiviewSPSDepth( uiViewId, iVOI, uiCamParPrecision, bCamParSlice, m_aaiTempScale, m_aaiTempOffset );
     1531
     1532        }
     1533#else
    15031534        READ_UVLC( uiCode, "view_id" );
    15041535        READ_SVLC(  iCode, "view_order_idx" );
    15051536        pcSPS->initMultiviewSPSDepth    ( uiCode, iCode );
     1537#endif
    15061538#if DEPTH_MAP_GENERATION
     1539#if FCO_FIX_SPS_CHANGE
     1540        pcSPS->setPredDepthMapGeneration( uiViewId, true );
     1541#else
    15071542        pcSPS->setPredDepthMapGeneration( uiCode, true );
     1543#endif
    15081544#endif
    15091545#if H3D_IVRP
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r296 r313  
    193193
    194194  AOF( pcSlice->getSPS()->getViewId() < MAX_VIEW_NUM );
     195#if !FCO_FIX  // Under flexible coding order, depth may need the camera parameters
    195196  if ( pcSlice->getSPS()->isDepth  () )
    196197  {
    197198    return;
    198199  }
     200#endif
    199201  Bool  bFirstAU          = ( pcSlice->getPOC()               == 0 );
    200202  Bool  bFirstSliceInAU   = ( pcSlice->getPOC()               != Int ( m_iLastPOC ) );
    201203  Bool  bFirstSliceInView = ( pcSlice->getSPS()->getViewId()  != UInt( m_iLastViewId ) || bFirstSliceInAU );
    202204  AOT(  bFirstSliceInAU  &&   pcSlice->getSPS()->getViewId()  != 0 );
     205#if FCO_FIX
     206#else
    203207  AOT( !bFirstSliceInAU  &&   pcSlice->getSPS()->getViewId()   < UInt( m_iLastViewId ) );
     208#endif
    204209  AOT( !bFirstSliceInAU  &&   pcSlice->getSPS()->getViewId()   > UInt( m_iLastViewId + 1 ) );
    205210  AOT( !bFirstAU         &&   pcSlice->getSPS()->getViewId()   > m_uiMaxViewId );
     
    11231128    }
    11241129
     1130#if !FIX_LGE_WP_FOR_3D_C0223
    11251131    if( pcSlice->getRefPicListCombinationFlag() && pcSlice->getPPS()->getWPBiPredIdc()==1 && pcSlice->getSliceType()==B_SLICE )
    11261132    {
    11271133      pcSlice->setWpParamforLC();
    11281134    }
     1135#endif
    11291136    pcSlice->setNoBackPredFlag( false );
    11301137    if ( pcSlice->getSliceType() == B_SLICE && !pcSlice->getRefPicListCombinationFlag())
     
    11711178  }
    11721179#endif
     1180
     1181#if FCO_DVP_REFINE_C0132_C0170
     1182  if(m_bFirstSliceInPicture)
     1183  {
     1184    pcPic->setDepthCoded(false);
     1185
     1186    if(m_viewId != 0)
     1187    {
     1188      if( m_isDepth == 0)
     1189      {
     1190        TComPic * recDepthMapBuffer;
     1191        recDepthMapBuffer = m_tAppDecTop->getPicFromView( m_viewId, pcSlice->getPOC(), true );
     1192        pcPic->setRecDepthMap(recDepthMapBuffer);
     1193
     1194        if(recDepthMapBuffer != NULL)
     1195        {
     1196          pcPic->setDepthCoded(true);
     1197        }
     1198      }
     1199    }
     1200  }
     1201#endif
     1202
    11731203
    11741204#if MERL_VSP_C0152 // set BW LUT
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r296 r313  
    663663      WRITE_UVLC( pcSPS->getViewId(), "view_id" );
    664664      WRITE_SVLC( pcSPS->getViewOrderIdx(), "view_order_idx" );
     665#if FCO_FIX_SPS_CHANGE
     666      if ( pcSPS->getViewId() )
     667      {
     668        WRITE_UVLC( pcSPS->getCamParPrecision(), "camera_parameter_precision" );
     669        WRITE_FLAG( pcSPS->hasCamParInSliceHeader() ? 1 : 0, "camera_parameter_in_slice_header" );
     670        if( !pcSPS->hasCamParInSliceHeader() )
     671        {
     672          for( UInt uiId = 0; uiId < pcSPS->getViewId(); uiId++ )
     673          {
     674            WRITE_SVLC( pcSPS->getCodedScale    ()[ uiId ], "coded_scale" );
     675            WRITE_SVLC( pcSPS->getCodedOffset   ()[ uiId ], "coded_offset" );
     676            WRITE_SVLC( pcSPS->getInvCodedScale ()[ uiId ] + pcSPS->getCodedScale ()[ uiId ], "inverse_coded_scale_plus_coded_scale" );
     677            WRITE_SVLC( pcSPS->getInvCodedOffset()[ uiId ] + pcSPS->getCodedOffset()[ uiId ], "inverse_coded_offset_plus_coded_offset" );
     678          }
     679        }     
     680      }
     681#endif
    665682    }
    666683    else
     
    10991116    }
    11001117#endif
    1101  
     1118
     1119#if FIX_LGE_WP_FOR_3D_C0223
     1120    if ( (pcSlice->getPPS()->getUseWP() && pcSlice->getSliceType()==P_SLICE) || (pcSlice->getPPS()->getWPBiPredIdc() && pcSlice->getSliceType()==B_SLICE) )
     1121#else
    11021122    if ( (pcSlice->getPPS()->getUseWP() && pcSlice->getSliceType()==P_SLICE) || (pcSlice->getPPS()->getWPBiPredIdc()==1 && pcSlice->getSliceType()==B_SLICE) )
     1123#endif   
    11031124    {
    11041125      xCodePredWeightTable( pcSlice );
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r296 r313  
    726726      m_uiStoredStartCUAddrForEncodingEntropySlice[uiStartCUAddrEntropySliceIdx++]  = uiNextCUAddr;
    727727
     728#if FCO_DVP_REFINE_C0132_C0170
     729      pcPic->setDepthCoded(false);
     730
     731      if(pcSlice->getViewId() != 0)
     732      {
     733        if(pcSlice->getSPS()->isDepth() == 0 )
     734        {
     735          TComPic * recDepthMapBuffer;
     736          recDepthMapBuffer = m_pcEncTop->getEncTop()->getPicFromView( pcSlice->getViewId(), pcSlice->getPOC(), true );
     737          pcSlice->getPic()->setRecDepthMap(recDepthMapBuffer);
     738          if(recDepthMapBuffer->getReconMark())
     739          {
     740            pcPic->setDepthCoded(true);
     741          }
     742        }
     743      }
     744#endif
     745
    728746#if DEPTH_MAP_GENERATION
    729747      // init view component and predict virtual depth map
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r296 r313  
    6060  m_pcBufferLowLatSbacCoders    = NULL;
    6161  m_pcBufferLowLatBinCoderCABACs  = NULL;
     62#if FCO_DVP_REFINE_C0132_C0170
     63  m_pPicBaseTxt = NULL;
     64  m_pPicBaseDepth = NULL;
     65#endif
    6266}
    6367
     
    673677    xCalcACDCParamSlice(pcSlice);
    674678  }
    675 
    676   Bool bWp_explicit = (pcSlice->getSliceType()==P_SLICE && pcSlice->getPPS()->getUseWP()) || (pcSlice->getSliceType()==B_SLICE && pcSlice->getPPS()->getWPBiPredIdc()==1);
    677   Bool bWp_implicit = (pcSlice->getSliceType()==B_SLICE && pcSlice->getPPS()->getWPBiPredIdc()==2);
    678 
    679   if ( bWp_explicit || bWp_implicit )
     679#if FIX_LGE_WP_FOR_3D_C0223
     680  Bool bWp_explicit = (pcSlice->getSliceType()==P_SLICE && pcSlice->getPPS()->getUseWP()) || (pcSlice->getSliceType()==B_SLICE && pcSlice->getPPS()->getWPBiPredIdc());
     681
     682  if ( bWp_explicit )
    680683  {
    681684    //------------------------------------------------------------------------------
     
    686689      printf("Weighted Prediction is not supported with slice mode determined by max number of bins.\n"); exit(0);
    687690    }
     691    xEstimateWPParamSlice( pcSlice );
     692    pcSlice->initWpScaling();
     693#if !FIX_LGE_WP_FOR_3D_C0223 // Interim fix for encoder/decoder mismatch of non-fade sequence
     694    // check WP on/off
     695    xCheckWPEnable( pcSlice );
     696#endif
     697  }
     698#else
     699
     700  Bool bWp_explicit = (pcSlice->getSliceType()==P_SLICE && pcSlice->getPPS()->getUseWP()) || (pcSlice->getSliceType()==B_SLICE && pcSlice->getPPS()->getWPBiPredIdc()==1);
     701  Bool bWp_implicit = (pcSlice->getSliceType()==B_SLICE && pcSlice->getPPS()->getWPBiPredIdc()==2);
     702
     703  if ( bWp_explicit || bWp_implicit )
     704  {
     705    //------------------------------------------------------------------------------
     706    //  Weighted Prediction implemented at Slice level. SliceMode=2 is not supported yet.
     707    //------------------------------------------------------------------------------
     708    if ( pcSlice->getSliceMode()==2 || pcSlice->getEntropySliceMode()==2 )
     709    {
     710      printf("Weighted Prediction is not supported with slice mode determined by max number of bins.\n"); exit(0);
     711    }
    688712
    689713    if( bWp_explicit )
     
    700724    }
    701725  }
    702 
     726#endif
    703727#if ADAPTIVE_QP_SELECTION
    704728  if( m_pcCfg->getUseAdaptQpSelect() )
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r296 r313  
    712712  if( m_isDepth )
    713713  {
     714#if FCO_FIX_SPS_CHANGE
     715    m_cSPS.initMultiviewSPSDepth    ( m_viewId, m_iViewOrderIdx, m_uiCamParPrecision, m_bCamParInSliceHeader, m_aaiCodedScale, m_aaiCodedOffset );
     716#else
    714717    m_cSPS.initMultiviewSPSDepth    ( m_viewId, m_iViewOrderIdx );
     718#endif
     719
    715720#if DEPTH_MAP_GENERATION
    716721    m_cSPS.setPredDepthMapGeneration( m_viewId, true );
Note: See TracChangeset for help on using the changeset viewer.