Changeset 166 in 3DVCSoftware for branches/HTM-4.0.1-VSP-dev0/source


Ignore:
Timestamp:
1 Nov 2012, 19:22:41 (12 years ago)
Author:
mitsubishi-htm
Message:

Initial integration of VSP into HTM 4.0.1. The version used for JCT3V-B0102 at Shanghai meeting.

  • VC9 project/solution files updated. Other Visual C++ project/solution files are not updated.
  • Linux make file updated.

TODO

  • A second release is expected to include some bug fix and improvements on the interface, e.g. to move switches from macro definition to the configuration file.
  • A third release is expected after being integrated within HTM 5.x, which is to be used for CE1.h anchor.
Location:
branches/HTM-4.0.1-VSP-dev0/source
Files:
2 added
55 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppDecoder/TAppDecTop.cpp

    r105 r166  
    262262    }
    263263  }
     264#if DEBUGIMGOUT
     265  for(Int viewDepthIdx=0; viewDepthIdx<m_tVideoIOYuvReconDbgFile.size() ; viewDepthIdx++)
     266  {
     267    if( m_tVideoIOYuvReconDbgFile[viewDepthIdx] )
     268    {
     269      m_tVideoIOYuvReconDbgFile[viewDepthIdx]->close();
     270      delete m_tVideoIOYuvReconDbgFile[viewDepthIdx];
     271      m_tVideoIOYuvReconDbgFile[viewDepthIdx] = NULL ;
     272    }
     273  }
     274#endif
    264275
    265276  for(Int viewDepthIdx=0; viewDepthIdx<m_tDecTop.size() ; viewDepthIdx++)
     
    330341#endif
    331342      }
     343#if DEBUGIMGOUT
     344#if PIC_CROPPING
     345      m_tVideoIOYuvReconDbgFile[viewDepthId]->write( pcPic->getPicYuvRecDbg(), sps->getPicCropLeftOffset(), sps->getPicCropRightOffset(), sps->getPicCropTopOffset(), sps->getPicCropBottomOffset() );
     346#else
     347      m_tVideoIOYuvReconDbgFile[viewDepthId]->write( pcPic->getPicYuvRecDbg(), pcPic->getSlice(0)->getSPS()->getPad() );
     348#endif
     349#endif   
    332350     
    333351      // update POC of display order
     
    388406#endif
    389407      }
     408#if DEBUGIMGOUT
     409#if PIC_CROPPING
     410      m_tVideoIOYuvReconDbgFile[viewDepthId]->write( pcPic->getPicYuvRecDbg(), sps->getPicCropLeftOffset(), sps->getPicCropRightOffset(), sps->getPicCropTopOffset(), sps->getPicCropBottomOffset() );
     411#else
     412      m_tVideoIOYuvReconDbgFile[viewDepthId]->write( pcPic->getPicYuvRecDbg(), pcPic->getSlice(0)->getSPS()->getPad() );
     413#endif
     414#endif
    390415     
    391416      // update POC of display order
     
    476501  }
    477502#endif
    478 
     503#if DEBUGIMGOUT
     504  while( m_tVideoIOYuvReconDbgFile.size() < newNumberOfViewDepth)
     505  {
     506    m_tVideoIOYuvReconDbgFile.push_back(new TVideoIOYuv);
     507    Char buffer[4];
     508    sprintf(buffer,"_%i", (Int)(m_tVideoIOYuvReconDbgFile.size()-1) / 2 );
     509    Char* nextFilename = NULL;
     510    if( (m_tVideoIOYuvReconDbgFile.size() % 2) == 0 )
     511    {
     512      Char* pchTempFilename = NULL;
     513      xAppendToFileNameEnd( "DebugImg.yuv", "_depth", pchTempFilename);
     514      xAppendToFileNameEnd( pchTempFilename, buffer, nextFilename);
     515      free ( pchTempFilename );
     516    }
     517    else
     518    {
     519      xAppendToFileNameEnd( "DebugImg.yuv", buffer, nextFilename);
     520    }
     521    if( isDepth || ( !isDepth && (m_tVideoIOYuvReconDbgFile.size() % 2) == 1 ) )
     522    {
     523      m_tVideoIOYuvReconDbgFile.back()->open( nextFilename, true, m_outputBitDepth, g_uiBitDepth + g_uiBitIncrement );
     524    }
     525    free ( nextFilename );
     526  }
     527#endif
    479528  while( m_pocLastDisplay.size() < newNumberOfViewDepth )
    480529  {
     
    533582  return pcPic;
    534583}
     584
     585#if VSP_N
     586Void TAppDecTop::storeVSPInBuffer(TComPic* pcPicVSP, TComPic* pcPicAvail, Int iCodedViewIdx, Int iCoddedViewOrderIdx, Int iCurPoc, Bool bDepth)
     587{
     588  //first view does not have VSP
     589#if VSP_TEXT_ONLY
     590  if((iCodedViewIdx == 0)||(bDepth))
     591#else
     592  if((iCodedViewIdx == 0))
     593#endif
     594    return;
     595  pcPicVSP->getSlice(0)->setPOC( iCurPoc );
     596  Int iNeighborViewId = 0;
     597  Bool bRenderFromLeft;
     598  //check if the neighboring view is situated to the left of the current view
     599  bRenderFromLeft = ((iCoddedViewOrderIdx)>0);
     600  //pointers to buffers   
     601  TComPicYuv* pcPicYuvVideo = getPicFromView(iNeighborViewId, iCurPoc, bDepth)->getPicYuvRec();
     602  TComPicYuv* pcPicYuvDepth = getPicFromView(iNeighborViewId, iCurPoc, true)->getPicYuvRec();
     603  TComPicYuv* pcPicYuvVSP   = pcPicVSP->getPicYuvRec();
     604  TComPicYuv* pcPicYuvAvail = pcPicAvail->getPicYuvRec();
     605  //verifying buffers
     606  AOF(pcPicYuvVideo);
     607  AOF(pcPicYuvDepth);
     608  AOF(pcPicYuvVSP);
     609  AOF(pcPicYuvAvail);
     610
     611  TComPic* pcPic = getPicFromView( iCodedViewIdx, iCurPoc, bDepth );
     612  pcPic->setPicYuvSynth( pcPicYuvVSP );
     613  pcPic->setPicYuvAvail( pcPicYuvAvail );
     614
     615  //setting look-up table
     616#if 0
     617  m_cVSPRendererTop.setShiftLUTs(
     618      m_cCamParsCollector.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx],
     619      m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx],
     620      m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx],
     621      m_cCamParsCollector.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx],
     622      m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx],
     623      m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx],
     624      -1
     625      );
     626#else
     627#if NTT_SUBPEL
     628  m_cVSPRendererTop.setShiftLUTs(
     629      m_cCamParsCollector.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx],
     630      m_cCamParsCollector.getBaseViewIPelLUT  ()[iNeighborViewId][iCodedViewIdx],
     631      NULL,
     632      m_cCamParsCollector.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx],
     633      m_cCamParsCollector.getBaseViewIPelLUT  ()[iNeighborViewId][iCodedViewIdx],
     634      NULL,
     635      -1
     636      );
     637  m_cVSPRendererTop.setFposLUTs(
     638      m_cCamParsCollector.getBaseViewFPosLUT()[iNeighborViewId][iCodedViewIdx],
     639      m_cCamParsCollector.getBaseViewFPosLUT()[iNeighborViewId][iCodedViewIdx]
     640      );
     641#else
     642  m_cVSPRendererTop.setShiftLUTs(
     643      m_cCamParsCollector.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx],
     644      m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx],
     645      NULL,
     646      m_cCamParsCollector.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx],
     647      m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx],
     648      NULL,
     649      -1
     650      );
     651#endif
     652#endif
     653
     654#if NTT_SUBPEL
     655  m_cVSPRendererTop.setInterpolationMode( (bDepth ? 0 : 5) );
     656#endif
     657
     658  //extrapolate from view iNeighborViewId to the current view, storing in the VSP buffer
     659  //m_cVSPRendererTop.extrapolateView(pcPicYuvVideo,pcPicYuvDepth, pcPicYuvVSP, bRenderFromLeft);
     660  m_cVSPRendererTop.extrapolateAvailabilityView(pcPicYuvVideo,pcPicYuvDepth, pcPicYuvVSP, pcPicYuvAvail, bRenderFromLeft);
     661
     662  // mark it should be extended
     663  pcPicVSP->getPicYuvRec()->setBorderExtension(false);
     664  pcPicVSP->getPicYuvRec()->extendPicBorder(); //will extend the border for prediction using pixels outside the frame
     665  pcPicAvail->getPicYuvRec()->setBorderExtension(false);
     666  pcPicAvail->getPicYuvRec()->extendPicBorder();
     667#if VSP_N_DUMP
     668  {
     669    Char acFilenameBase[1024];
     670    ::sprintf(acFilenameBase,"VSP_dec_%sv%d_%dx%d_%04d.yuv",(bDepth?"D":"T"),iCodedViewIdx,pcPicYuvVSP->getWidth(), pcPicYuvVSP->getHeight(), iCurPoc);
     671    pcPicYuvVSP->dump(acFilenameBase,0);
     672    //pcPicYuvAvail->dump(acFilenameBase,iCurPoc!=0);
     673  }
     674#endif
     675}
     676#endif
     677
    535678//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppDecoder/TAppDecTop.h

    r100 r166  
    4949#include "TLibDecoder/TDecTop.h"
    5050#include "TAppDecCfg.h"
     51#if VSP_N
     52#include "../../Lib/TLibRenderer/TRenTop.h"
     53#endif
    5154
    5255//! \ingroup TAppDecoder
     
    6568
    6669  std::vector<TVideoIOYuv*>       m_tVideoIOYuvReconFile;         ///< reconstruction YUV class
     70#if DEBUGIMGOUT
     71  std::vector<TVideoIOYuv*>       m_tVideoIOYuvReconDbgFile;      ///< debug YUV class
     72#endif
    6773
    6874  // for output control
     
    7985  TComSPSAccess                   m_cSPSAccess;
    8086  TComAUPicAccess                 m_cAUPicAccess;
     87#endif
     88
     89#if VSP_N
     90  TRenTop                         m_cVSPRendererTop;
    8191#endif
    8292
     
    107117#endif
    108118
     119#if VSP_N
     120  Bool              getUseDepth   () { return m_useDepth; }
     121  TRenTop*          getVSPRendererTop(){ return &m_cVSPRendererTop; }
     122  Void              storeVSPInBuffer(TComPic* pcPicVSP, TComPic* pcPicAvail, Int iCodedViewIdx, Int iCoddedViewOrderIdx, Int iCurPoc, Bool bDepth);
     123#endif
     124
    109125protected:
    110126//  Void  xCreateDecLib     (); ///< create internal classes
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncCfg.cpp

    r133 r166  
    194194 
    195195  /* File, I/O and source parameters */
    196   ("InputFile_%d,i_%d",       m_pchInputFileList,       (char *) 0 , MAX_VIEW_NUM , "original Yuv input file name %d")
    197   ("DepthInputFile_%d,di_%d", m_pchDepthInputFileList,  (char *) 0 , MAX_VIEW_NUM , "original Yuv depth input file name %d")
    198   ("ReconFile_%d,o_%d",       m_pchReconFileList,       (char *) 0 , MAX_VIEW_NUM , "reconstructed Yuv output file name %d")
    199   ("DepthReconFile_%d,do_%d", m_pchDepthReconFileList,  (char *) 0 , MAX_VIEW_NUM , "reconstructed Yuv depth output file name %d")
    200   ("BitstreamFile,b", cfg_BitstreamFile, string(""), "bitstream output file name")
    201   ("CodeDepthMaps",         m_bUsingDepthMaps, false, "Encode depth maps" )
    202   ("CodedCamParsPrecision", m_iCodedCamParPrecision, STD_CAM_PARAMETERS_PRECISION, "precision for coding of camera parameters (in units of 2^(-x) luma samples)" )
    203   ("LambdaModifier0,-LM0", m_adLambdaModifier[ 0 ], ( double )1.0, "Lambda modifier for temporal layer 0")
    204   ("LambdaModifier1,-LM1", m_adLambdaModifier[ 1 ], ( double )1.0, "Lambda modifier for temporal layer 1")
    205   ("LambdaModifier2,-LM2", m_adLambdaModifier[ 2 ], ( double )1.0, "Lambda modifier for temporal layer 2")
    206   ("LambdaModifier3,-LM3", m_adLambdaModifier[ 3 ], ( double )1.0, "Lambda modifier for temporal layer 3")
    207   ("SourceWidth,-wdt",      m_iSourceWidth,  0, "Source picture width")
    208   ("SourceHeight,-hgt",     m_iSourceHeight, 0, "Source picture height")
     196  ("InputFile_%d,i_%d",       m_pchInputFileList,       (char *) 0 , MAX_VIEW_NUM ,   "original Yuv input file name %d")
     197  ("DepthInputFile_%d,di_%d", m_pchDepthInputFileList,  (char *) 0 , MAX_VIEW_NUM ,   "original Yuv depth input file name %d")
     198  ("ReconFile_%d,o_%d",       m_pchReconFileList,       (char *) 0 , MAX_VIEW_NUM ,   "reconstructed Yuv output file name %d")
     199  ("DepthReconFile_%d,do_%d", m_pchDepthReconFileList,  (char *) 0 , MAX_VIEW_NUM ,   "reconstructed Yuv depth output file name %d")
     200  ("BitstreamFile,b",         cfg_BitstreamFile,        string(""),                  "bitstream output file name")
     201  ("CodeDepthMaps",           m_bUsingDepthMaps,        false,                        "Encode depth maps" )
     202  ("CodedCamParsPrecision",   m_iCodedCamParPrecision, STD_CAM_PARAMETERS_PRECISION, "precision for coding of camera parameters (in units of 2^(-x) luma samples)" )
     203  ("LambdaModifier0,-LM0",    m_adLambdaModifier[ 0 ],  ( double )1.0,                "Lambda modifier for temporal layer 0")
     204  ("LambdaModifier1,-LM1",    m_adLambdaModifier[ 1 ],  ( double )1.0,                "Lambda modifier for temporal layer 1")
     205  ("LambdaModifier2,-LM2",    m_adLambdaModifier[ 2 ],  ( double )1.0,                "Lambda modifier for temporal layer 2")
     206  ("LambdaModifier3,-LM3",    m_adLambdaModifier[ 3 ],  ( double )1.0,                "Lambda modifier for temporal layer 3")
     207  ("SourceWidth,-wdt",        m_iSourceWidth,           0,                            "Source picture width")
     208  ("SourceHeight,-hgt",       m_iSourceHeight,          0,                            "Source picture height")
    209209#if PIC_CROPPING
    210   ("CroppingMode",          m_croppingMode,  0, "Cropping mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping")
    211   ("CropLeft",              m_cropLeft,      0, "Left cropping/padding for cropping mode 3")
    212   ("CropRight",             m_cropRight,     0, "Right cropping/padding for cropping mode 3")
    213   ("CropTop",               m_cropTop,       0, "Top cropping/padding for cropping mode 3")
    214   ("CropBottom",            m_cropBottom,    0, "Bottom cropping/padding for cropping mode 3")
    215   ("HorizontalPadding,-pdx",m_aiPad[0],      0, "horizontal source padding for cropping mode 2")
    216   ("VerticalPadding,-pdy",  m_aiPad[1],      0, "vertical source padding for cropping mode 2")
     210  ("CroppingMode",            m_croppingMode,           0,                            "Cropping mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping")
     211  ("CropLeft",                m_cropLeft,               0,                            "Left cropping/padding for cropping mode 3")
     212  ("CropRight",               m_cropRight,              0,                            "Right cropping/padding for cropping mode 3")
     213  ("CropTop",                 m_cropTop,                0,                            "Top cropping/padding for cropping mode 3")
     214  ("CropBottom",              m_cropBottom,             0,                            "Bottom cropping/padding for cropping mode 3")
     215  ("HorizontalPadding,-pdx",  m_aiPad[0],               0,                            "horizontal source padding for cropping mode 2")
     216  ("VerticalPadding,-pdy",    m_aiPad[1],               0,                            "vertical source padding for cropping mode 2")
    217217#endif
    218218  ("InputBitDepth",         m_uiInputBitDepth, 8u, "bit-depth of input file")
     
    498498  m_pchRowHeight = cfg_RowHeight.empty() ? NULL : strdup(cfg_RowHeight.c_str());
    499499  m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str());
    500  
     500
    501501  if ( m_bUsingDepthMaps )
    502502  {
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncTop.cpp

    r102 r166  
    697697#endif
    698698
     699#if VSP_N
     700#if NTT_SUBPEL
     701  m_cVSPRendererTop.init(m_iSourceWidth, m_iSourceHeight, true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 5, 1, 0, 6 );
     702#else
     703  m_cVSPRendererTop.init(m_iSourceWidth, m_iSourceHeight, true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 4, 1, 0, 6 );
     704#endif
     705#endif
    699706}
    700707
     
    822829  TComPicYuv*       pcPicYuvRec = NULL;
    823830  TComPicYuv*       pcDepthPicYuvRec = NULL;
    824  
     831
    825832  // initialize internal class & member variables
    826833  xInitLibCfg();
     
    918925      if ( iNextPoc < m_iFrameToBeEncoded )
    919926      {
    920       m_cCameraData.update( iNextPoc );
     927        m_cCameraData.update( iNextPoc );
    921928      }
    922929      for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
     
    930937#endif
    931938        iNumEncoded = 0;
     939
     940#if VSP_SLICE_HEADER
     941        m_acTEncTopList     [iViewIdx]->setUseVSP( (gopId%VSP_FRAME_INTERVAL==0) );
     942        m_acTEncDepthTopList[iViewIdx]->setUseVSP( (gopId%VSP_FRAME_INTERVAL==0) );
     943#endif
     944
     945#if VSP_N
     946#if VSP_SLICE_HEADER
     947        if( m_acTEncTopList[iViewIdx]->getUseVSP() )
     948#endif
     949        if( m_bUsingDepthMaps )
     950        {
     951          // Forward Warping
     952          xStoreVSPInBuffer(m_acTEncTopList[iViewIdx]->getVSPBuf(), m_acTEncTopList[iViewIdx]->getVSPAvailBuf(), iViewIdx, false, gopId);
     953        }
     954#endif
    932955        // call encoding function for one frame
    933956        m_acTEncTopList[iViewIdx]->encode( eos[iViewIdx], pcPicYuvOrg, *m_picYuvRec[iViewIdx], outputAccessUnits, iNumEncoded, gopId );
     
    937960        {
    938961          Int  iNumDepthEncoded = 0;
     962#if VSP_N
     963#if VSP_SLICE_HEADER
     964          if( m_acTEncDepthTopList[iViewIdx]->getUseVSP() )
     965#endif
     966            xStoreVSPInBuffer(m_acTEncDepthTopList[iViewIdx]->getVSPBuf(), m_acTEncDepthTopList[iViewIdx]->getVSPAvailBuf(), iViewIdx, true, gopId);
     967#endif
    939968          // call encoding function for one depth frame
    940969          m_acTEncDepthTopList[iViewIdx]->encode( depthEos[iViewIdx], pcDepthPicYuvOrg, *m_picYuvDepthRec[iViewIdx], outputAccessUnits, iNumDepthEncoded, gopId );
     
    13771406};
    13781407
     1408#if VSP_N
     1409Void TAppEncTop::xStoreVSPInBuffer(TComPic* pcPicVSP, TComPic* pcPicAvail, Int iCodedViewIdx, Bool bDepth, Int gopId)
     1410{
     1411  //first view does not have VSP
     1412#if VSP_TEXT_ONLY
     1413  if((iCodedViewIdx == 0)||(bDepth))
     1414#else
     1415  if((iCodedViewIdx == 0))
     1416#endif
     1417    return;
     1418
     1419  AOT( iCodedViewIdx <= 0);
     1420  AOT( iCodedViewIdx >= m_iNumberOfViews );
     1421 
     1422  Int iCurPoc;
     1423  //getting currrent POC and checking if the frame will be coded
     1424  if(bDepth)
     1425  {
     1426    iCurPoc = m_acTEncDepthTopList[iCodedViewIdx]->getFrameId(gopId);
     1427    if(iCurPoc>=m_acTEncDepthTopList[iCodedViewIdx]->getFrameToBeEncoded())
     1428      return;
     1429    //if(!(m_acTEncDepthTopList[iCodedViewIdx]->currentPocWillBeCoded()))
     1430    //  return;
     1431  }
     1432  else
     1433  {
     1434    iCurPoc = m_acTEncTopList[iCodedViewIdx]->getFrameId(gopId);
     1435    if(iCurPoc>=m_acTEncTopList[iCodedViewIdx]->getFrameToBeEncoded())
     1436      return;
     1437    //if(!(m_acTEncTopList[iCodedViewIdx]->currentPocWillBeCoded()))
     1438    //  return;
     1439  }
     1440  pcPicVSP->getSlice(0)->setPOC( iCurPoc );
     1441
     1442  Int iNeighborViewId = 0;
     1443  Bool bRenderFromLeft;
     1444  //check if the neighboring view is situated to the left of the current view
     1445  bRenderFromLeft = ((m_cCameraData.getBaseSortedId2Id()[iCodedViewIdx]-m_cCameraData.getBaseSortedId2Id()[iNeighborViewId])>0);
     1446  //pointers to buffers   
     1447  TComPicYuv* pcPicYuvVideo = xGetPicYuvFromView(iNeighborViewId, iCurPoc, bDepth, true );
     1448  TComPicYuv* pcPicYuvDepth = xGetPicYuvFromView(iNeighborViewId, iCurPoc, true, true );
     1449  TComPicYuv* pcPicYuvVSP   = pcPicVSP->getPicYuvRec();
     1450  TComPicYuv* pcPicYuvAvail = pcPicAvail->getPicYuvRec();
     1451  //verifying buffers
     1452  AOF(pcPicYuvVideo);
     1453  AOF(pcPicYuvDepth);
     1454  AOF(pcPicYuvVSP);
     1455  AOF(pcPicYuvAvail);
     1456 
     1457  TComPic* pcPic = getPicFromView( iCodedViewIdx, iCurPoc, bDepth );
     1458  pcPic->setPicYuvSynth( pcPicYuvVSP );
     1459  pcPic->setPicYuvAvail( pcPicYuvAvail );
     1460
     1461  //setting look-up table
     1462#if 0
     1463  m_cVSPRendererTop.setShiftLUTs(
     1464      m_cCameraData.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx],
     1465      m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx],
     1466      m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx],
     1467      m_cCameraData.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx],
     1468      m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx],
     1469      m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx],
     1470      -1
     1471      );
     1472#else
     1473#if NTT_SUBPEL
     1474  m_cVSPRendererTop.setShiftLUTs(
     1475      m_cCameraData.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx],
     1476      m_cCameraData.getBaseViewIPelLUT  ()[iNeighborViewId][iCodedViewIdx],
     1477      NULL,
     1478      m_cCameraData.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx],
     1479      m_cCameraData.getBaseViewIPelLUT  ()[iNeighborViewId][iCodedViewIdx],
     1480      NULL,
     1481      -1
     1482      );
     1483  m_cVSPRendererTop.setFposLUTs(
     1484      m_cCameraData.getBaseViewFPosLUT()[iNeighborViewId][iCodedViewIdx],
     1485      m_cCameraData.getBaseViewFPosLUT()[iNeighborViewId][iCodedViewIdx]
     1486      );
     1487#else
     1488  m_cVSPRendererTop.setShiftLUTs(
     1489      m_cCameraData.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx],
     1490      m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx],
     1491      NULL,
     1492      m_cCameraData.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx],
     1493      m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx],
     1494      NULL,
     1495      -1
     1496      );
     1497#endif
     1498#endif
     1499
     1500#if NTT_SUBPEL
     1501  m_cVSPRendererTop.setInterpolationMode( (bDepth ? 0 : 5) );
     1502#endif
     1503
     1504  //extrapolate from view iNeighborViewId to the current view, storing in the VSP buffer
     1505  //m_cVSPRendererTop.extrapolateView(pcPicYuvVideo,pcPicYuvDepth, pcPicYuvVSP, bRenderFromLeft);
     1506  m_cVSPRendererTop.extrapolateAvailabilityView(pcPicYuvVideo,pcPicYuvDepth, pcPicYuvVSP, pcPicYuvAvail, bRenderFromLeft);
     1507
     1508
     1509  // mark it should be extended
     1510  pcPicVSP->getPicYuvRec()->setBorderExtension(false);
     1511  pcPicVSP->getPicYuvRec()->extendPicBorder();//will extend the border for prediction using pixels outside the frame (done at the slice level as well
     1512  pcPicAvail->getPicYuvRec()->setBorderExtension(false);
     1513  pcPicAvail->getPicYuvRec()->extendPicBorder();
     1514
     1515#if VSP_N_DUMP
     1516  {
     1517    Char acFilenameBase[1024];
     1518    ::sprintf(acFilenameBase,"VSP_enc_%sv%d_%dx%d.yuv",(bDepth?"D":"T"),iCodedViewIdx,m_iSourceWidth, m_iSourceHeight);
     1519    pcPicYuvVSP->dump(acFilenameBase,iCurPoc!=0);
     1520    //pcPicYuvAvail->dump(acFilenameBase,iCurPoc!=0);
     1521  }
     1522#endif
     1523
     1524}
     1525#endif
     1526
    13791527//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncTop.h

    r102 r166  
    9999  TRenTop  m_cUsedPelsRenderer;                               ///< renderer for used pels map
    100100#endif
     101
     102#if VSP_N
     103  TRenTop                     m_cVSPRendererTop;
     104#endif
     105
    101106protected:
    102107  // initialization
     
    162167#endif
    163168
     169#if VSP_N
     170  Void xStoreVSPInBuffer(TComPic* pcPicVSP, TComPic* pcPicAvail, Int iCodedViewIdx, Bool bDepth, Int gopId);
     171#endif
    164172};// END CLASS DEFINITION TAppEncTop
    165173
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TAppCommon/TAppComCamPara.cpp

    r165 r166  
    8989}
    9090
     91#if NTT_SUBPEL
     92Void
     93TAppComCamPara::xCreateLUTs_Subpel( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 )
     94{
     95  AOF( m_uiBitDepthForLUT == 8 );
     96  AOF( raiLUT0 == NULL && raiLUT1 == NULL );
     97
     98  uiNumberSourceViews = Max( 1, uiNumberSourceViews );
     99  uiNumberTargetViews = Max( 1, uiNumberTargetViews );
     100
     101  raiLUT0         = new Int   ***[ uiNumberSourceViews ];
     102  raiLUT1         = new Int   ***[ uiNumberSourceViews ];
     103
     104  for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ )
     105  {
     106    raiLUT0        [ uiSourceView ] = new Int   **[ uiNumberTargetViews ];
     107    raiLUT1        [ uiSourceView ] = new Int   **[ uiNumberTargetViews ];
     108
     109    for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ )
     110    {
     111      raiLUT0        [ uiSourceView ][ uiTargetView ]      = new Int*   [ 2 ];
     112      raiLUT0        [ uiSourceView ][ uiTargetView ][ 0 ] = new Int    [ 257 ];
     113      raiLUT0        [ uiSourceView ][ uiTargetView ][ 1 ] = new Int    [ 257 ];
     114      raiLUT1        [ uiSourceView ][ uiTargetView ]      = new Int*   [ 2 ];
     115      raiLUT1        [ uiSourceView ][ uiTargetView ][ 0 ] = new Int    [ 257 ];
     116      raiLUT1        [ uiSourceView ][ uiTargetView ][ 1 ] = new Int    [ 257 ];
     117    }
     118  }
     119}
     120#endif
    91121
    92122Void
     
    928958}
    929959
     960#if NTT_SUBPEL
     961Void
     962TAppComCamPara::xSetShiftParametersAndLUT( UInt uiNumberSourceViews, UInt uiNumberTargetViews, UInt uiFrame, Int****& raiLUT_Disp, Int****& raiLUT_Fracpos )
     963{
     964  if( uiNumberSourceViews <= 1 || uiNumberTargetViews == 0 )
     965  {
     966    return;
     967  }
     968  AOF( raiLUT_Disp != NULL && raiLUT_Fracpos != NULL );
     969  AOF( m_uiBitDepthForLUT == 8 );
     970
     971  Int     iLog2Div = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision;   AOF( iLog2Div > 0 );
     972  for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ )
     973  {
     974    for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ )
     975    {
     976      // integer-valued scale and offset
     977      Int64 iScale, iOffset;
     978      xGetShiftParameterInt ( uiSourceView, uiTargetView, uiFrame, false, true, iScale, iOffset );
     979
     980      // offsets including rounding offsets
     981      iOffset += ( 1 << iLog2Div ) >> 1;
     982
     983      for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ )
     984      {
     985        Int64   iTempScale      = (Int64)uiDepthValue * iScale;
     986        Int     iShiftSubpel    = (Int) (( iTempScale + iOffset ) >> iLog2Div);
     987        Int     iShiftPelLuma   = iShiftSubpel >> m_iLog2Precision; // better to have rounding ?
     988        Int     iShiftPelChroma = iShiftPelLuma >> 1;
     989
     990        raiLUT_Disp   [ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftPelLuma;
     991        raiLUT_Disp   [ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftPelChroma;
     992        raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelLuma << m_iLog2Precision );
     993        raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelChroma << (m_iLog2Precision+1) );
     994
     995#if 0 // NTT bugfix
     996        if ( raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] < 0 )
     997          raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = -4 - raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ];
     998        if ( raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] < 0 )
     999          raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = -4 - raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ];
     1000#endif
     1001
     1002#if _DEBUG
     1003        AOF( (raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ]>> m_iLog2Precision   ) == 0 );
     1004        AOF( (raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ]>>(m_iLog2Precision+1)) == 0 );
     1005#endif
     1006      }
     1007
     1008      raiLUT_Disp   [ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_Disp   [ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];
     1009      raiLUT_Disp   [ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_Disp   [ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];
     1010      raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];
     1011      raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];
     1012    }
     1013  }
     1014}
     1015#endif
    9301016
    9311017Void
     
    9361022  xSetShiftParametersAndLUT( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  uiFrame, false, m_adBaseViewShiftLUT,  m_aiBaseViewShiftLUT,  m_adBaseViewShiftParameter,  m_aiBaseViewShiftParameter  );
    9371023  xSetShiftParametersAndLUT( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfSynthViews, uiFrame, true,  m_adSynthViewShiftLUT, m_aiSynthViewShiftLUT, m_adSynthViewShiftParameter, m_aiSynthViewShiftParameter );
     1024#if NTT_SUBPEL
     1025  xSetShiftParametersAndLUT( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  uiFrame, m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos );
     1026#endif
    9381027};
    9391028
     
    10661155  m_aiSynthViewShiftLUT       = 0;
    10671156
     1157#if NTT_SUBPEL
     1158  m_aiBaseViewShiftLUT_ipel   = 0;
     1159  m_aiBaseViewShiftLUT_fpos   = 0;
     1160#endif
     1161
    10681162  m_bSetupFromCoded           = false;
    10691163  m_bCamParsCodedPrecSet      = false;
     
    10911185  xDeleteArray( m_aaiPdmScaleNomDelta,       m_iNumberOfBaseViews );
    10921186  xDeleteArray( m_aaiPdmOffset,              m_iNumberOfBaseViews );
     1187
     1188#if NTT_SUBPEL
     1189  xDeleteArray( m_aiBaseViewShiftLUT_ipel,   m_iNumberOfBaseViews, m_iNumberOfBaseViews,  2 );
     1190  xDeleteArray( m_aiBaseViewShiftLUT_fpos,   m_iNumberOfBaseViews, m_iNumberOfBaseViews,  2 );
     1191#endif
    10931192}
    10941193
     
    13371436  xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  m_aaiPdmOffset            );
    13381437
     1438#if NTT_SUBPEL
     1439  xCreateLUTs_Subpel( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  m_aiBaseViewShiftLUT_ipel,  m_aiBaseViewShiftLUT_fpos);
     1440#endif
     1441
    13391442  //===== init disparity to virtual depth conversion parameters =====
    13401443  xSetPdmConversionParams();
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TAppCommon/TAppComCamPara.h

    r165 r166  
    107107  Int****             m_aiSynthViewShiftLUT;                   ///< Disparity LUT
    108108
     109#if NTT_SUBPEL
     110  Int****             m_aiBaseViewShiftLUT_ipel;              ///< Disparity LUT
     111  Int****             m_aiBaseViewShiftLUT_fpos;              ///< Disparity LUT
     112#endif
    109113
    110114protected:
     
    117121  template<class T> Void  xDeleteArray  ( T*& rpt, UInt uiSize );
    118122
     123#if NTT_SUBPEL
     124  Void                    xCreateLUTs_Subpel  ( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 );
     125#endif
     126
    119127  // functions for reading, initialization, sorting, getting data, etc.
    120128  Void  xReadCameraParameterFile  ( Char* pchCfgFileName );
     
    143151  Void  xSetShiftParametersAndLUT ( UInt uiNumViewDim1, UInt uiNumViewDim2, UInt uiFrame, Bool bExternalReference, Double****& radLUT, Int****& raiLUT, Double***& radShiftParams, Int64***& raiShiftParams );
    144152  Void  xSetShiftParametersAndLUT ( UInt uiFrame );
    145 
     153#if NTT_SUBPEL
     154  Void  xSetShiftParametersAndLUT ( UInt uiNumViewDim1, UInt uiNumViewDim2, UInt uiFrame, Int****& raiLUT_Disp, Int****& raiLUT_Fracpos );
     155#endif
    146156
    147157  // getting conversion parameters for disparity to virtual depth conversion
     
    211221  Int****             getSynthViewShiftLUTI     ()  { return m_aiSynthViewShiftLUT;  }
    212222  Int****             getBaseViewShiftLUTI      ()  { return m_aiBaseViewShiftLUT;   }
     223
     224#if NTT_SUBPEL
     225  Int****             getBaseViewIPelLUT        ()  { return m_aiBaseViewShiftLUT_ipel;   }
     226  Int****             getBaseViewFPosLUT        ()  { return m_aiBaseViewShiftLUT_fpos;   }
     227#endif
    213228
    214229  Bool                getVaryingCameraParameters()  { return m_bCamParsVaryOverTime;    }
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/CommonDef.h

    r134 r166  
    110110#define MAX_GOP                     64          ///< max. value of hierarchical GOP size
    111111
     112#if VSP_N
     113#define MAX_NUM_REF                 5           ///< max. value of multiple reference frames
     114#define MAX_NUM_REF_LC              10          ///< max. value of combined reference frames
     115#else
    112116#define MAX_NUM_REF                 4           ///< max. value of multiple reference frames
    113117#define MAX_NUM_REF_LC              8           ///< max. value of combined reference frames
     118#endif
    114119
    115120#define MAX_UINT                    0xFFFFFFFFU ///< max. value of unsigned 32-bit integer
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r100 r166  
    4949Int * TComDataCU::m_pcGlbArlCoeffCb = NULL;
    5050Int * TComDataCU::m_pcGlbArlCoeffCr = NULL;
     51#endif
     52
     53#if FORCE_REF_VSP==1
     54#define CHECK_ADD_YET(pcCURef,uiIdx)
     55#define SET_AOUND_MVINFO(pcCURef,uiIdx)  \
     56{\
     57  if((pcCURef)->isVspMode((uiIdx))){\
     58    pcMvFieldNeighbours[iCount<<1].setRefIdx(getSlice()->getRefIdxVsp(REF_PIC_LIST_0));\
     59    if(getSlice()->isInterB()){\
     60      pcMvFieldNeighbours[(iCount<<1)+1].setRefIdx(getSlice()->getRefIdxVsp(REF_PIC_LIST_1));\
     61    }\
     62  }\
     63}
     64
     65#elif FORCE_REF_VSP==2
     66#define CHECK_ADD_YET(pcCURef,uiIdx)  &&!((pcCURef)->isVspMode((uiIdx),TComMv(0,0))&&bVspMvZeroDone)
     67#define SET_AOUND_MVINFO(pcCURef,uiIdx)   if((pcCURef)->isVspMode((uiIdx),TComMv(0,0))){bVspMvZeroDone=true;}
     68
     69inline bool TComDataCU::xAddVspSkip(UChar ucVspMergePos, Bool bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount,
     70                                    UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int mrgCandIdx)
     71{
     72#if VSP_SLICE_HEADER
     73  if( !getSlice()->getVspFlag() ) return true;
     74#endif
     75
     76  if( ucVspMergePos == VSP_MERGE_POS )
     77  {
     78#if VSP_TEXT_ONLY
     79    if( !getSlice()->getSPS()->isDepth() )
     80#endif
     81    if( getSlice()->getSPS()->getViewId()!=0 && !bVspMvZeroDone )
     82    {
     83      Bool bSubCUCanBeSynthesized[4];
     84      Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized;
     85      getPic()->checkSynthesisAvailability( getAddr(), getZorderIdxInCU(), uiDepth, pbSubCUCanBeSynthesized );
     86      if( bSubCUCanBeSynthesized[0] && bSubCUCanBeSynthesized[1] && bSubCUCanBeSynthesized[2] && bSubCUCanBeSynthesized[3] )
     87      {
     88        abCandIsInter[iCount] = true;
     89        // get Inter Dir
     90        Int iInterDir = ((getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 && getSlice()->getNumRefIdx(REF_PIC_LIST_1) > 0) ? 3 :
     91          (getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 ? 1 : 2));
     92        puhInterDirNeighbours[iCount] = iInterDir; //pcCUAboveLeft->getInterDir( uiAboveLeftPartIdx );
     93        // get Mv from Left
     94        pcMvFieldNeighbours[iCount<<1].setMvField( TComMv(0, 0), getSlice()->getRefIdxVsp(REF_PIC_LIST_0) ); //pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
     95        if ( getSlice()->isInterB() )
     96        {
     97          pcMvFieldNeighbours[(iCount<<1)+1].setMvField( TComMv(0, 0), getSlice()->getRefIdxVsp(REF_PIC_LIST_1) ); //pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     98        }
     99#if SIMP_MRG_PRUN
     100        if ( mrgCandIdx == iCount )
     101        {
     102          return false;
     103        }
     104#endif
     105        iCount ++;
     106      }
     107    }
     108  }
     109  return true;
     110}
    51111#endif
    52112
     
    34503510#endif
    34513511
     3512#if FORCE_REF_VSP==2
     3513  bool bVspMvZeroDone = false;
     3514#endif
     3515
    34523516  Int iCount = 0;
    34533517
     
    35133577#endif
    35143578
    3515   //left
     3579#if FORCE_REF_VSP==2
     3580  //===== vsp 0 =====
     3581  if ( !xAddVspSkip(0, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) )
     3582    return;
     3583#endif
     3584
     3585  //===== left =====
    35163586  UInt uiLeftPartIdx = 0;
    35173587  TComDataCU* pcCULeft = 0;
     
    35333603  if (!(uiPUIdx == 1 && (partSize == SIZE_Nx2N || partSize == SIZE_nLx2N || partSize == SIZE_nRx2N)))
    35343604  {
    3535   if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) )
     3605  if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx )
     3606#if FORCE_REF_VSP
     3607    CHECK_ADD_YET(pcCULeft, uiLeftPartIdx)
     3608#endif
     3609  )
    35363610  {
    35373611    abCandIsInter[iCount] = true;
     
    35483622    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    35493623#endif
     3624#if FORCE_REF_VSP
     3625    SET_AOUND_MVINFO(pcCULeft, uiLeftPartIdx)
     3626#endif
    35503627#if SIMP_MRG_PRUN
    35513628    if ( mrgCandIdx == iCount )
     
    35813658#endif
    35823659
    3583   // above
     3660#if FORCE_REF_VSP==2
     3661  //===== vsp 1 =====
     3662  if ( !xAddVspSkip(1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) )
     3663    return;
     3664#endif
     3665
     3666  //===== above =====
    35843667#if !SIMP_MRG_PRUN
    35853668  partSize = getPartitionSize( uiAbsPartIdx );
     
    36053688#if SIMP_MRG_PRUN
    36063689  if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx )
     3690#if FORCE_REF_VSP
     3691    CHECK_ADD_YET(pcCUAbove, uiAbovePartIdx)
     3692#endif
    36073693    && !(uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD))
    36083694    && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) )
     
    36243710    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    36253711#endif
     3712#if FORCE_REF_VSP
     3713    SET_AOUND_MVINFO(pcCUAbove, uiAbovePartIdx)
     3714#endif
    36263715#if SIMP_MRG_PRUN
    36273716    if ( mrgCandIdx == iCount )
     
    36593748#endif
    36603749
    3661   // above right
     3750#if FORCE_REF_VSP==2
     3751  //===== vsp 2 =====
     3752  if ( !xAddVspSkip(2, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) )
     3753    return;
     3754#endif
     3755
     3756  //===== above right =====
    36623757  UInt uiAboveRightPartIdx = 0;
    36633758  TComDataCU* pcCUAboveRight = 0;
     
    36773772#endif
    36783773#if SIMP_MRG_PRUN
    3679   if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) )
     3774  if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx )
     3775#if FORCE_REF_VSP
     3776    CHECK_ADD_YET(pcCUAboveRight, uiAboveRightPartIdx)
     3777#endif
     3778    && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) )
    36803779#else
    36813780  if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) )
     
    36953794    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    36963795#endif
     3796#if FORCE_REF_VSP
     3797    SET_AOUND_MVINFO(pcCUAboveRight, uiAboveRightPartIdx)
     3798#endif
    36973799#if SIMP_MRG_PRUN
    36983800    if ( mrgCandIdx == iCount )
     
    37273829#endif
    37283830
    3729   //left bottom
     3831#if FORCE_REF_VSP==2
     3832  //===== vsp 3 =====
     3833  if ( !xAddVspSkip(3, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) )
     3834    return;
     3835#endif
     3836
     3837  //===== left bottom =====
     3838#if VSP_MERGE_POS < 4
     3839#if HHI_INTER_VIEW_MOTION_PRED
     3840  if( iCount < 4 + extraMergeCand )
     3841#else
     3842  if( iCount < 4 )
     3843#endif
     3844  {
     3845#endif
    37303846  UInt uiLeftBottomPartIdx = 0;
    37313847  TComDataCU* pcCULeftBottom = 0;
     
    37453861#endif
    37463862#if SIMP_MRG_PRUN
    3747   if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) )
     3863  if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx )
     3864#if FORCE_REF_VSP
     3865    CHECK_ADD_YET(pcCULeftBottom, uiLeftBottomPartIdx)
     3866#endif
     3867    && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) )
    37483868#else
    37493869  if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) )
     
    37633883    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    37643884#endif
     3885#if FORCE_REF_VSP
     3886    SET_AOUND_MVINFO(pcCULeftBottom, uiLeftBottomPartIdx)
     3887#endif
    37653888#if SIMP_MRG_PRUN
    37663889    if ( mrgCandIdx == iCount )
     
    37713894    iCount ++;
    37723895  }
     3896#if VSP_MERGE_POS < 4
     3897  }
     3898#endif
    37733899
    37743900#if HHI_INTER_VIEW_MOTION_PRED
     
    37953921#endif
    37963922
    3797   // above left
     3923#if FORCE_REF_VSP==2
     3924  //===== vsp 4 =====
     3925  if( iCount < 4 + extraMergeCand )
     3926  {
     3927    if ( !xAddVspSkip(4, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) )
     3928      return;
     3929  }
     3930#endif
     3931
     3932  //===== above left =====
    37983933#if HHI_INTER_VIEW_MOTION_PRED
    37993934  if( iCount < 4 + extraMergeCand )
     
    38203955#if SIMP_MRG_PRUN
    38213956    if( pcCUAboveLeft && !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx )
     3957#if FORCE_REF_VSP
     3958     CHECK_ADD_YET(pcCUAboveLeft, uiAboveLeftPartIdx)
     3959#endif
    38223960     && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) )
    38233961     && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) )
     
    38403978      pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    38413979#endif
     3980#if FORCE_REF_VSP
     3981      SET_AOUND_MVINFO(pcCUAboveLeft, uiAboveLeftPartIdx)
     3982#endif
    38423983#if SIMP_MRG_PRUN
    38433984      if ( mrgCandIdx == iCount )
     
    38493990    }
    38503991  }
     3992
     3993#if FORCE_REF_VSP==2
     3994  //===== vsp 5 =====
     3995#if HHI_INTER_VIEW_MOTION_PRED
     3996  if( iCount < 4 + extraMergeCand )
     3997#else
     3998  if( iCount < 4 )
     3999#endif
     4000  {
     4001    if ( !xAddVspSkip(5, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) )
     4002      return;
     4003  }
     4004#endif
    38514005
    38524006  if ( getSlice()->getPPS()->getEnableTMVPFlag() )
     
    42684422  if( uiIter == 0 )
    42694423  {
    4270     if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) )
     4424    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx )
     4425#if FORCE_REF_VSP==1
     4426     && !pcCorner->isVspMode( uiCornerPUIdx )
     4427#endif
     4428    )
    42714429    {
    42724430      rbValidCand = true;
     
    43034461  else
    43044462  {
    4305     if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) )
     4463    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx )
     4464#if FORCE_REF_VSP==1
     4465     && !pcCorner->isVspMode( uiCornerPUIdx )
     4466#endif
     4467    )
    43064468    {
    43074469      rbValidCand = true;
     
    44524614#endif
    44534615  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
     4616#if VSP_N
     4617  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     4618#endif
    44544619  {
    44554620    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    44784643
    44794644  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     4645#if VSP_N
     4646  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     4647#endif
    44804648  {
    44814649    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    45044672#endif
    45054673  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
     4674#if VSP_N
     4675  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     4676#endif
    45064677  {
    45074678    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    45294700#endif
    45304701  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     4702#if VSP_N
     4703  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     4704#endif
    45314705  {
    45324706    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    45574731#endif
    45584732  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     4733#if VSP_N
     4734  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     4735#endif
    45594736  {
    45604737    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    47684945  UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();
    47694946
    4770   Int   aiDvMcpDvCand[2][7] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ ºí·°¿¡¼­ »ç¿ëµÈ DV¸¦ ÀúÀå
     4947  Int   aiDvMcpDvCand[2][7] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ ºúÓ°¿¡¼­ »ç¿EÈ DV¸¦ ÀúÀE
    47714948  Bool  abDvMcpFlag  [2][7] = {{false,},{false,}};
    47724949  //Int   aiRefPOC     [2][7] = {{-1,},{-1}}; // debug
     
    47884965  UInt uiLeftPartIdx = uiIdx;
    47894966  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
     4967#if VSP_N
     4968  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     4969#endif
    47904970  {
    47914971    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
     
    48265006
    48275007  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     5008#if VSP_N
     5009  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     5010#endif
    48285011  {
    48295012    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
     
    48635046#endif
    48645047  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
     5048#if VSP_N
     5049  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     5050#endif
    48655051  {
    48665052    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
     
    49005086#endif
    49015087  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     5088#if VSP_N
     5089  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     5090#endif
    49025091  {
    49035092    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
     
    49395128#endif
    49405129  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     5130#if VSP_N
     5131  if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP)
     5132#endif
    49415133  {
    49425134    bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
     
    55515743}
    55525744
     5745#if FORCE_REF_VSP==2
     5746Int TComDataCU::isVspMode ( UInt uiPartIdx )
     5747{
     5748  if( m_pePredMode[ uiPartIdx ] == MODE_SKIP  ) return 0;
     5749  if( m_pePredMode[ uiPartIdx ] == MODE_INTRA ) return 0;
     5750
     5751  Int aiRefIdx[2] = {NOT_VALID, NOT_VALID}, iRet = 0;
     5752  for( Int iList = 0; iList < 2; iList++ )
     5753  {
     5754    aiRefIdx[iList] = getCUMvField( RefPicList(iList) )->getRefIdx( uiPartIdx );
     5755    if( aiRefIdx[iList] >= 0 && getSlice()->getRefViewId( RefPicList(iList), aiRefIdx[iList] ) == NUM_VIEW_VSP )
     5756    {
     5757      iRet |= (iList ? 0x02 : 0x01); // L0=1, L1=2, BI=3
     5758      continue;
     5759    }
     5760  }
     5761
     5762  return iRet;
     5763}
     5764
     5765Int TComDataCU::isVspMode ( UInt uiPartIdx, TComMv cCompMv )
     5766{
     5767  TComMv cMv;
     5768  Int iRet = 0, iList = 0;
     5769
     5770  if( (iList = isVspMode( uiPartIdx )) )
     5771  {
     5772    switch( iList )
     5773    {
     5774    case 1:
     5775      cMv = getCUMvField( RefPicList(0) )->getMv( uiPartIdx );
     5776      if( cMv == cCompMv )
     5777      {
     5778        iRet = 1; // L0=1
     5779      }
     5780      break;
     5781    case 2:
     5782      cMv = getCUMvField( RefPicList(1) )->getMv( uiPartIdx );
     5783      if( cMv == cCompMv )
     5784      {
     5785        iRet = 2; // L1=2
     5786      }
     5787      break;
     5788    case 3:
     5789      cMv = getCUMvField( RefPicList(0) )->getMv( uiPartIdx );
     5790      if( cMv == cCompMv )
     5791      {
     5792        cMv = getCUMvField( RefPicList(1) )->getMv( uiPartIdx );
     5793        if( cMv == cCompMv )
     5794        {
     5795          iRet = 3; // BI=3
     5796        }
     5797      }
     5798      break;
     5799    }
     5800  }
     5801
     5802  return iRet;
     5803}
     5804#endif
     5805
    55535806// ====================================================================================================================
    55545807// Protected member functions
     
    56125865  }
    56135866 
     5867#if AMVP_VSP_UNAVAILABLE
     5868  if( pcTmpCU != NULL && pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0 && pcTmpCU->getSlice()->getRefViewId( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) == NUM_VIEW_VSP )
     5869  {
     5870    return false;
     5871  }
     5872#endif
     5873
    56145874  if ( pcTmpCU != NULL && m_pcSlice->isEqualRef(eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx), iRefIdx) )
    56155875  {
     
    57135973  TComDataCU* pcTmpCU = NULL;
    57145974  UInt uiIdx;
     5975#if VSP_N
     5976  Bool bRefVsp = false;
     5977#endif
    57155978  switch( eDir )
    57165979  {
     
    57706033    return false;
    57716034  }
     6035
     6036#if AMVP_VSP_UNAVAILABLE
     6037  if( pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0 && pcTmpCU->getSlice()->getRefViewId( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) == NUM_VIEW_VSP )
     6038  {
     6039    return false;
     6040  }
     6041#endif
    57726042 
    57736043  RefPicList eRefPicList2nd = REF_PIC_LIST_0;
     
    58156085    }
    58166086
     6087#if VSP_N
     6088    if( pcTmpCU->getSlice()->getRefViewId( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) == NUM_VIEW_VSP )
     6089    {
     6090      bRefVsp = true;
     6091    }
     6092    Int iScale = bRefVsp ? 4096 : xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
     6093#else
    58176094    Int iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
     6095#endif
    58186096    if ( iScale == 4096 )
    58196097    {
     
    58426120    }
    58436121
     6122#if VSP_N
     6123    if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) == NUM_VIEW_VSP )
     6124    {
     6125      bRefVsp = true;
     6126    }
     6127    Int iScale = bRefVsp ? 4096 : xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
     6128#else
    58446129    Int iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
     6130#endif
    58456131    if ( iScale == 4096 )
    58466132    {
     
    58756161  Int iColViewIdx, iColRefViewIdx;
    58766162  TComPic *pColPic = getSlice()->getRefPic( eRefPicList, refidx);
     6163#if VSP_MV_ZERO // shimizu
    58776164  TComDataCU *pColCU = pColPic->getCU( uiCUAddr );
    58786165  iColViewIdx = pColCU->getSlice()->getViewId();
    5879 
     6166#if VSP_N
     6167  if( iColViewIdx == NUM_VIEW_VSP )
     6168  {
     6169    return false;
     6170  }
     6171#endif
     6172#else 
     6173#if VSP_N
     6174  if( pColPic->getSlice(0)->getViewId() == NUM_VIEW_VSP )
     6175  {
     6176    return false;
     6177  }
     6178#endif
     6179  TComDataCU *pColCU = pColPic->getCU( uiCUAddr );
     6180  iColViewIdx = pColCU->getSlice()->getViewId();
     6181#endif
    58806182
    58816183  if (pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE||pColCU->isIntra(uiAbsPartAddr))
     
    59046206
    59056207    iColRefViewIdx = pColCU->getSlice()->getRefPic(eColRefPicList, iColRefIdx)->getViewId();
     6208#if VSP_N
     6209    if( iColRefViewIdx == NUM_VIEW_VSP )
     6210    {
     6211      continue;
     6212    }
     6213#endif
    59066214
    59076215    if ( iColViewIdx    == iColRefViewIdx ) // temporal vector
     
    60406348  iScale = 0;
    60416349  iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx();
     6350#if VSP_N
     6351//  UInt uiColRefViewId = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewId();
     6352  UInt uiCurRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewId();
     6353  if( uiCurRefViewId == NUM_VIEW_VSP )
     6354    iScale = 4096;
     6355  else
     6356#endif
    60426357  if((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC))
    60436358    iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC);
     
    60526367  if ( iScale == 4096 )
    60536368  {
     6369#if VSP_MV_ZERO
     6370    if( uiCurRefViewId == NUM_VIEW_VSP )
     6371      rcMv.setZero();
     6372    else
     6373#endif
    60546374    rcMv = cColMv;
    60556375  }
     
    61516471    return false;
    61526472  }
     6473
     6474#if VSP_N //??
     6475  if (pColCU->isSkipped(uiPartIdxCenter))
     6476    return false;
     6477#endif
    61536478 
    61546479  if( m_pcSlice->getRefPic( eRefPicList, iRefIdx )->getViewId() != m_pcSlice->getViewId() )
     
    77058030
    77068031//! \}
     8032
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDataCU.h

    r100 r166  
    265265  Bool          xAddMVPCand           ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
    266266  Bool          xAddMVPCandOrder      ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
     267#if FORCE_REF_VSP==2
     268  inline bool   xAddVspSkip(UChar ucVspMergePos, Bool bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount,
     269                            UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int mrgCandIdx);
     270#endif
    267271
    268272  Void          deriveRightBottomIdx        ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB );
     
    656660  Bool          isIntra   ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; }
    657661  Bool          isSkipped ( UInt uiPartIdx );                                                     ///< SKIP (no residual)
     662#if FORCE_REF_VSP==1
     663  Int           isVspMode ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_SYNTH; }
     664#elif FORCE_REF_VSP==2
     665  Int           isVspMode ( UInt uiPartIdx );
     666  Int           isVspMode ( UInt uiPartIdx, TComMv cCompMv );
     667#endif
    658668 
    659669  // -------------------------------------------------------------------------------------------------------------------
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.cpp

    r100 r166  
    562562  m_cTmpPic.dump( acFilename, ( pcPic->getPOC() != 0 )  );
    563563}
     564
     565#if VSP_N
     566Void
     567TComDepthMapGenerator::clearDepthMap( TComPic* pcPic, Int iVal/*=PDM_UNDEFINED_DEPTH*/ )
     568{
     569  xClearDepthMap( pcPic, iVal );
     570}
     571#endif
    564572#endif
    565573
     
    733741      Int         iNumRefPics       = pcSlice->getNumRefIdx( eRefPicList );
    734742      for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
    735 {
     743      {
     744#if VSP_N
     745        if( pcSlice->getRefViewId( eRefPicList, iPdmRefIdx ) != NUM_VIEW_VSP )
     746#endif
    736747        if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC())
    737748        {
     
    834845  Int           iRefPoc     = pcRefPic->getPOC();
    835846  Bool          bInterview  = ( uiRefViewId < m_uiCurrViewId );
     847#if VSP_N
     848  Bool          bVsp        = ( pcRefPic->getViewId() == NUM_VIEW_VSP );
     849  AOT(  bInterview &&  bVsp && iRefPoc != pcSlice->getPOC() );
     850  AOT( !bInterview && !bVsp && iRefPoc == pcSlice->getPOC() );
     851#else
    836852  AOT(  bInterview && iRefPoc != pcSlice->getPOC() );
    837853  AOT( !bInterview && iRefPoc == pcSlice->getPOC() );
     854#endif
     855
     856#if FORCE_REF_VSP
     857  if( bVsp ) return false;
     858#endif
     859
    838860  Bool          bPdmIView   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW );
    839861  Bool          bPdmInter   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_INTER ) == PDM_USE_FOR_INTER );
     
    924946  Int           iRefPoc     = pcRefPic->getPOC();
    925947  Bool          bInterview  = ( uiRefViewId < m_uiCurrViewId );
     948#if VSP_N
     949  Bool          bVsp        = ( pcRefPic->getViewId() == NUM_VIEW_VSP );
     950  AOT(  bInterview &&  bVsp && iRefPoc != pcSlice->getPOC() );
     951  AOT( !bInterview && !bVsp && iRefPoc == pcSlice->getPOC() );
     952#else
    926953  AOT(  bInterview && iRefPoc != pcSlice->getPOC() );
    927954  AOT( !bInterview && iRefPoc == pcSlice->getPOC() );
     955#endif
     956
     957#if FORCE_REF_VSP
     958  if( bVsp ) return false;
     959#endif
    928960
    929961  Bool          bPdmIView   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW );
     
    13511383    xInterPredictCUDepthMap( pcSubCU, pcSubDM );
    13521384    break;
     1385#if FORCE_REF_VSP==1
     1386  case MODE_SYNTH:
     1387    xIntraPredictCUDepthMap( pcSubCU, pcSubDM ); //What to do? Need Fix!
     1388    break;
     1389#endif
    13531390  default:
    13541391    AOT( true );
     
    14641501                                          aiCurrRefIdx[1] >= 0 && pcCU->getSlice()->getRefPic( REF_PIC_LIST_1, aiCurrRefIdx[1] )->getSPS()->getViewId() != m_uiCurrViewId };
    14651502    Bool            bUsesInterViewPrd = ( abCurrIntView[0] || abCurrIntView[1] );
     1503#if VSP_N
     1504    if(( aiCurrRefIdx[0] >= 0 && pcCU->getSlice()->getRefPic( REF_PIC_LIST_0, aiCurrRefIdx[0] )->getViewId() == NUM_VIEW_VSP ) ||
     1505       ( aiCurrRefIdx[1] >= 0 && pcCU->getSlice()->getRefPic( REF_PIC_LIST_1, aiCurrRefIdx[1] )->getViewId() == NUM_VIEW_VSP )) {
     1506      //if refpic is VSP, copy to Original cuurent PDM
     1507      TComPicYuv* pcPdm = pcCU->getPic()->getPredDepthMap();
     1508      UInt  uiZOrderIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     1509      assert( pcPdm );
     1510      pcCUDepthMap->copyFromPicYuv( pcPdm, pcCU->getAddr(), uiZOrderIdx );
     1511    }
     1512#endif
    14661513    if( bUsesInterViewPrd )
    14671514    {
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.h

    r100 r166  
    140140  Void  updateDepthMap        ( TComPic*      pcPic );
    141141  Void  dumpDepthMap          ( TComPic*      pcPic, char* pFilenameBase );
     142#if VSP_N
     143  Void  clearDepthMap         ( TComPic*      pcPic, Int   iVal  = PDM_UNDEFINED_DEPTH);
     144#endif
    142145#endif
    143146
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComLoopFilter.cpp

    r56 r166  
    439439 
    440440  //-- Set BS for Intra MB : BS = 4 or 3
    441   if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) )
     441  if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ)
     442#if FORCE_REF_VSP==1
     443    || pcCUP->isVspMode(uiPartP) || pcCUQ->isVspMode(uiPartQ)
     444#endif
     445  )
    442446  {
    443447    uiBs = 2;
     
    445449 
    446450  //-- Set BS for not Intra MB : BS = 2 or 1 or 0
    447   if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) )
     451  if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ)
     452#if FORCE_REF_VSP==1
     453    && !pcCUP->isVspMode(uiPartP) && !pcCUQ->isVspMode(uiPartQ)
     454#endif
     455  )
    448456  {
    449457#if NSQT_LFFIX
     
    542550  }   // enf of "if( not Intra )"
    543551 
     552#if FORCE_REF_VSP==1
     553  if ( pcCUP->isVspMode(uiPartP) || pcCUQ->isVspMode(uiPartQ))
     554  {
     555    uiBs = 0;
     556  }
     557#endif
     558
    544559  m_aapucBS[iDir][uiAbsPartIdx] = uiBs;
    545560}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPic.cpp

    r100 r166  
    5353  m_apcPicYuv[0]      = NULL;
    5454  m_apcPicYuv[1]      = NULL;
     55#if VSP_N
     56  m_apcPicYuvAvail     = NULL;
     57  m_apcPicYuvSynth     = NULL;
     58#endif
    5559#if DEPTH_MAP_GENERATION
    5660  m_pcPredDepthMap    = NULL;
     
    6468#if HHI_INTER_VIEW_RESIDUAL_PRED
    6569  m_pcResidual        = NULL;
     70#endif
     71#if DEBUGIMGOUT
     72  m_acPicYuvDebug     = NULL;
    6673#endif
    6774  m_pcPicYuvPred      = NULL;
     
    95102  }
    96103  m_apcPicYuv[1]  = new TComPicYuv;  m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth );
    97  
     104#if DEBUGIMGOUT
     105  m_acPicYuvDebug    = new TComPicYuv;  m_acPicYuvDebug->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth );
     106#endif
     107
    98108  /* there are no SEI messages associated with this picture initially */
    99109  m_SEIs = NULL;
     
    162172    delete m_pcResidual;
    163173    m_pcResidual = NULL;
     174  }
     175#endif
     176#if DEBUGIMGOUT
     177  if (m_acPicYuvDebug)
     178  {
     179    m_acPicYuvDebug->destroy();
     180    delete m_acPicYuvDebug;
     181    m_acPicYuvDebug = NULL;
    164182  }
    165183#endif
     
    623641}
    624642
     643#if VSP_N
     644Void TComPic::checkSynthesisAvailability( /*TComDataCU*& rpcCU, */UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied )
     645{
     646  rpbCUSynthesied[0] = true;
     647  rpbCUSynthesied[1] = true;
     648  rpbCUSynthesied[2] = true;
     649  rpbCUSynthesied[3] = true;
     650
     651  if (!getPicYuvAvail())
     652  {
     653    rpbCUSynthesied[0] = false;
     654    rpbCUSynthesied[1] = false;
     655    rpbCUSynthesied[2] = false;
     656    rpbCUSynthesied[3] = false;
     657    return;   
     658  }
     659 
     660  Int x, y;
     661  Pel* pAvail  = getPicYuvAvail()->getLumaAddr ( iCuAddr, uiAbsZorderIdx );
     662  Int CUHeight = g_uiMaxCUHeight >> uiPartDepth; //rpcCU->getHeight(uiAbsZorderIdx);
     663  Int CUWidth  = g_uiMaxCUWidth  >> uiPartDepth; //rpcCU->getWidth(uiAbsZorderIdx);
     664 
     665  Int  iStride  = getPicYuvAvail()->getStride();
     666  for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- )
     667  {
     668    for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- )
     669    {
     670      rpbCUSynthesied[0] &= (pAvail[x] != 0);
     671    }
     672    for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- )
     673    {
     674      rpbCUSynthesied[1] &= (pAvail[x] != 0);
     675    }
     676    pAvail += iStride;
     677  }
     678  //for ( y = CUHeight - 1; y >= ((CUHeight) >> 1); y-- )
     679  for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) //Owieczka
     680  {
     681    for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- )
     682    {
     683      rpbCUSynthesied[2] &= (pAvail[x] != 0);
     684    }
     685    for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- )
     686    {
     687      rpbCUSynthesied[3] &= (pAvail[x] != 0);
     688    }
     689    pAvail += iStride;
     690  }
     691
     692  //rpbCUSynthesied[0] = !rpbCUSynthesied[0];
     693  //rpbCUSynthesied[1] = !rpbCUSynthesied[1];
     694  //rpbCUSynthesied[2] = !rpbCUSynthesied[2];
     695  //rpbCUSynthesied[3] = !rpbCUSynthesied[3];
     696}
     697#endif
    625698
    626699//! \}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPic.h

    r100 r166  
    6565  TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
    6666 
     67#if VSP_N
     68  TComPicYuv*           m_apcPicYuvAvail;         //  Availability Map - Does the given pixel can be synthesised in receiver
     69  TComPicYuv*           m_apcPicYuvSynth;         //  Sythesied image
     70#endif
     71
    6772#if DEPTH_MAP_GENERATION
    6873  TComPicYuv*           m_pcPredDepthMap;         //  estimated depth map
     
    8590#if HHI_INTER_VIEW_RESIDUAL_PRED
    8691  TComPicYuv*           m_pcResidual;             //  residual buffer (coded or inter-view predicted residual)
     92#endif
     93#if DEBUGIMGOUT
     94  TComPicYuv*           m_acPicYuvDebug;          //  debug image
    8795#endif
    8896
     
    145153  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
    146154  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
     155#if VSP_N
     156  Void          setPicYuvAvail( TComPicYuv* pc ){ m_apcPicYuvAvail = pc; }
     157  Void          setPicYuvSynth( TComPicYuv* pc ){ m_apcPicYuvSynth = pc; }
     158  TComPicYuv*   getPicYuvAvail()      { return  m_apcPicYuvAvail; }
     159  TComPicYuv*   getPicYuvSynth()      { return  m_apcPicYuvSynth; }
     160  Void          checkSynthesisAvailability(  /*TComDataCU*& rpcBestCU, */UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied);
     161#endif
    147162#if HHI_INTERVIEW_SKIP
    148163  TComPicYuv*   getUsedPelsMap()      { return  m_pcUsedPelsMap; }
     
    168183#if HHI_INTER_VIEW_RESIDUAL_PRED
    169184  TComPicYuv*   getResidual()         { return  m_pcResidual; }
     185#endif
     186
     187#if DEBUGIMGOUT
     188  TComPicYuv*   getPicYuvRecDbg()     { return  m_acPicYuvDebug; }
    170189#endif
    171190
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPicSym.cpp

    r56 r166  
    9797    m_puiInverseCUOrderMap[i] = i;
    9898  }
     99
     100#if VSP_N
     101  m_apcTComTile = NULL;
     102#endif
    99103}
    100104
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPicYuv.h

    r56 r166  
    184184  Void  setChromaTo  ( Pel pVal ); 
    185185
     186#if DEBUGIMGOUT
     187  // Degub tools
     188public:
     189  Void colsetToPicYuv   ( const UChar ucColor[3],                 Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     190  Void colsetToPicLuma  ( const UChar ucLumaOffCol,               Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     191  Void colsetToPicChroma( const UChar ucUCol, const UChar ucVCol, Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     192  Void drawLineToPicYuv ( bool bHor, bool bVer, UInt uiSize,      TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     193#endif
     194
    186195};// END CLASS DEFINITION TComPicYuv
    187196
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPrediction.h

    r100 r166  
    9595  Void xPredInterPrdDepthMap    ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight,                         TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset );
    9696#endif
    97 
    9897#if DEPTH_MAP_GENERATION
    9998  Void xWeightedAveragePdm      ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY );
     
    103102  Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi );
    104103  Void xWeightedAverage         ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst );
    105  
     104
    106105  Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 );
    107106
     
    142141  Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 );
    143142#endif
    144  
     143
    145144  // motion vector prediction
    146145  Void getMvPredAMVP              ( TComDataCU* pcCU, UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMvPred );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComResidualGenerator.cpp

    r100 r166  
    390390    xSetRecResidualInterCU( pcSubCU, pcSubRes );
    391391    break;
     392#if FORCE_REF_VSP==1
     393  case MODE_SYNTH:
     394    xSetRecResidualIntraCU( pcSubCU, pcSubRes ); //MayBe it should be seperate function
     395    break;
     396#endif
    392397  default:
    393398    AOT( true );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r101 r166  
    114114{
    115115  m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0;
     116
     117#if FORCE_REF_VSP
     118  m_iRefIdxVsp[0] = m_iRefIdxVsp[1] = NOT_VALID;
     119#endif
    116120 
    117121  initEqualRef();
     
    139143  resetWpScalingLC(m_weightPredTableLC);
    140144  initWpAcDcParam();
     145
     146#if VSP_SLICE_HEADER
     147  m_bVspFlag = false;
     148#endif
    141149}
    142150
     
    185193  m_numEntryPointOffsets = 0;
    186194#endif
     195#if VSP_SLICE_HEADER
     196  m_bVspFlag = false;
     197#endif
     198
    187199}
    188200
     
    407419}
    408420
     421#if VSP_N
     422Void TComSlice::setRefPicListMvc( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics, TComPic* pcVspPic )
     423#else
    409424Void TComSlice::setRefPicListMvc( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics )
     425#endif
    410426{
    411427  if( m_eSliceType == I_SLICE )
     
    422438  TComPic*  RefPicSetLtCurr [16];
    423439  TComPic*  RefPicSetIvCurr [16];
     440#if VSP_N
     441  TComPic*  RefPicSetVspCurr [16] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; //for Linux comp
     442#endif
    424443
    425444  UInt NumPocStCurr0 = 0;
     
    427446  UInt NumPocLtCurr  = 0;
    428447  UInt NumPocIvCurr  = 0;
     448#if VSP_N
     449  UInt NumPocVspCurr  = 0;
     450#endif
    429451
    430452  Int i;
     
    474496    NumPocIvCurr++;
    475497  }
     498#if VSP_N
     499  if( pcVspPic )
     500  {
     501    pcRefPic = pcVspPic;
     502    pcRefPic->setIsLongTerm( 0 );
     503    pcRefPic->getPicYuvRec()->extendPicBorder();
     504    RefPicSetVspCurr[NumPocVspCurr] = pcRefPic;
     505    NumPocVspCurr++;
     506  }
     507#endif
    476508
    477509  // ref_pic_list_init
     
    481513
    482514  assert( (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr) == getNumPocTotalCurrMvc() );
     515#if VSP_N
     516  Int numRpsCurrTempList0 = max( (num_ref_idx_l0_active_minus1 + 1), (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr + NumPocVspCurr) );
     517  Int numRpsCurrTempList1 = max( (num_ref_idx_l1_active_minus1 + 1), (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr + NumPocVspCurr) );
     518#else
    483519  Int numRpsCurrTempList0 = max( (num_ref_idx_l0_active_minus1 + 1), (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr) );
    484520  Int numRpsCurrTempList1 = max( (num_ref_idx_l1_active_minus1 + 1), (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr) );
     521#endif
    485522
    486523  assert( numRpsCurrTempList0 <= 16 );
     
    509546  for( cIdx = 0; cIdx <= num_ref_idx_l0_active_minus1; cIdx ++ )
    510547  {
     548#if VSP_N
     549    if( pcVspPic && cIdx == num_ref_idx_l0_active_minus1 )
     550    {
     551      m_apcRefPicList[0][cIdx] = RefPicSetVspCurr[0];
     552#if FORCE_REF_VSP
     553      m_iRefIdxVsp[0] = cIdx;
     554#endif
     555    }
     556    else
     557      m_apcRefPicList[0][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? refPicListTemp0[ m_RefPicListModification.getRefPicSetIdxL0(cIdx) ] : refPicListTemp0[cIdx];
     558#else
    511559    m_apcRefPicList[0][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? refPicListTemp0[ m_RefPicListModification.getRefPicSetIdxL0(cIdx) ] : refPicListTemp0[cIdx];
     560#endif
    512561  }
    513562  if( m_eSliceType == P_SLICE )
     
    520569    for( cIdx = 0; cIdx <= num_ref_idx_l1_active_minus1; cIdx ++ )
    521570    {
     571#if VSP_N
     572      if( pcVspPic && cIdx == num_ref_idx_l1_active_minus1 )
     573      {
     574        m_apcRefPicList[1][cIdx] = RefPicSetVspCurr[0];
     575#if FORCE_REF_VSP
     576        m_iRefIdxVsp[1] = cIdx;
     577#endif
     578      }
     579      else
     580        m_apcRefPicList[1][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? refPicListTemp1[ m_RefPicListModification.getRefPicSetIdxL1(cIdx) ] : refPicListTemp1[cIdx];
     581#else
    522582      m_apcRefPicList[1][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? refPicListTemp1[ m_RefPicListModification.getRefPicSetIdxL1(cIdx) ] : refPicListTemp1[cIdx];
     583#endif
    523584    }
    524585  }
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComSlice.h

    r101 r166  
    4545#include "TComRom.h"
    4646#include "TComList.h"
    47 
    4847//! \ingroup TLibCommon
    4948//! \{
     
    12691268
    12701269#if SONY_COLPIC_AVAILABILITY
    1271   Int         m_iViewOrderIdx;
     1270  Int        m_iViewOrderIdx;
     1271#endif
     1272
     1273#if FORCE_REF_VSP
     1274  Int        m_iRefIdxVsp[2]; // L0/L1
     1275#endif
     1276
     1277#if VSP_SLICE_HEADER
     1278  Bool      m_bVspFlag;
    12721279#endif
    12731280
     
    14111418  Int       getNumPocTotalCurr();
    14121419  Int       getNumPocTotalCurrMvc();
     1420#if VSP_N
     1421  Void      setRefPicListMvc    ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics, TComPic* pcVspPic );
     1422#else
    14131423  Void      setRefPicListMvc    ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics );
     1424#endif
    14141425  Void      setRefPOCnViewListsMvc();
    14151426
     
    15651576  Int*      getInvCodedOffset     ()  { return m_aaiCodedOffset[1]; }
    15661577
     1578#if FORCE_REF_VSP
     1579  Void      setRefIdxVsp ( Int idx, Int refList ) { m_iRefIdxVsp[refList] = idx; }
     1580  Int       getRefIdxVsp ( Int refList )          { return m_iRefIdxVsp[refList]; }
     1581#endif
     1582
     1583#if VSP_SLICE_HEADER
     1584  Void      setVspFlag          ( Bool val )    { m_bVspFlag = val; }
     1585  Bool      getVspFlag          ()              { return m_bVspFlag; }
     1586#endif
     1587
    15671588protected:
    15681589  TComPic*  xGetRefPic        (TComList<TComPic*>& rcListPic, UInt uiPOC);
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComYuv.h

    r100 r166  
    213213
    214214  __inline Pel  xClip  (Pel x )      { return ( (x < 0) ? 0 : (x > (Pel)g_uiIBDI_MAX) ? (Pel)g_uiIBDI_MAX : x ); }
     215
     216#if DEBUGIMGOUT
     217public:
     218  Void colsetToPicYuv   ( const UChar ucColor[3],                 Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     219  Void colsetToPicLuma  ( const UChar ucLumaOffCol,               Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     220  Void colsetToPicChroma( const UChar ucUCol, const UChar ucVCol, Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     221  Void drawLineToPicYuv ( bool bHor, bool bVer, UInt uiSize,      TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 );
     222#endif
     223
    215224};// END CLASS DEFINITION TComYuv
    216225
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TypeDef.h

    r133 r166  
    4242//! \{
    4343
     44#define VSP_N                             1
     45#if VSP_N
     46#define VSP_TEXT_ONLY                     1
     47#define NUM_VIEW_VSP                      99
     48#define VSP_N_DUMP                        0
     49#define FORCE_REF_VSP                     2   // 0=NotUseVSPSKIP 1:VSPSKIPforFlag 2:VSPSKIPforMergeIdx
     50#define VSP_MV_ZERO                       0   // use zero vector for VSP
     51#if VSP_MV_ZERO
     52#define AMVP_VSP_UNAVAILABLE              1
     53#endif
     54#define VSP_MERGE_POS                     5   // position of vsp in merge list (0..5)
     55#define NTT_SUBPEL                        1
     56#endif
     57#define DEBUGIMGOUT                       0   //Debug YUVImage Out
     58#define DEBUGLOGOUT                       0   //Debug Log Out
     59
     60#define VSP_SLICE_HEADER                  1
     61#define VSP_FRAME_INTERVAL                2
     62
    4463#define FIXES                             1
    4564#define POZNAN_CABAC_INIT_FLAG_FIX        1
     
    115134#define HHI_FULL_PEL_DEPTH_MAP_MV_ACC     1   // full-pel mv accuracy for depth maps
    116135                                       
    117 #if HHI_INTER_VIEW_MOTION_PRED         
     136#if HHI_INTER_VIEW_MOTION_PRED
    118137#define SAIT_IMPROV_MOTION_PRED_M24829    1   // improved inter-view motion vector prediction
    119138#else                                 
     
    727746  MODE_INTER,           ///< inter-prediction mode
    728747  MODE_INTRA,           ///< intra-prediction mode
     748#if FORCE_REF_VSP==1
     749  MODE_SYNTH,           ///< synth-mode
     750#endif
    729751  MODE_NONE = 15
    730752};
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r100 r166  
    23482348#endif
    23492349
     2350#if VSP_SLICE_HEADER
     2351  if( rpcSlice->getSPS()->getViewId()!=0
     2352#if VSP_TEXT_ONLY
     2353      && !(rpcSlice->getSPS()->isDepth())
     2354#endif
     2355    )
     2356  {
     2357    READ_FLAG( uiCode, "vsp_flag" );
     2358    rpcSlice->setVspFlag( uiCode ? true : false );
     2359  }
     2360#endif
     2361
    23502362  if (!bEntropySlice)
    23512363  {
     
    26012613}
    26022614
     2615#if FORCE_REF_VSP==1
     2616Void TDecCavlc::parseVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2617{
     2618  assert(0);
     2619}
     2620#endif
     2621
    26032622#if HHI_INTER_VIEW_MOTION_PRED
    26042623Void TDecCavlc::parseMVPIdx( Int& riMVPIdx, Int iAMVPCands )
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCAVLC.h

    r77 r166  
    142142 
    143143  Void  parseSkipFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     144#if FORCE_REF_VSP==1
     145  Void  parseVspFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     146#endif
    144147  Void parseMergeFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
    145148  Void parseMergeIndex      ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCu.cpp

    r100 r166  
    5252  m_ppcYuvResPred = NULL;
    5353#endif
     54#if FORCE_REF_VSP
     55  m_ppcYuvAvail   = NULL;
     56  m_ppcYuvSynth   = NULL;
     57#endif
    5458  m_ppcCU      = NULL;
    5559}
     
    7983#if HHI_INTER_VIEW_RESIDUAL_PRED
    8084  m_ppcYuvResPred = new TComYuv*   [m_uiMaxDepth-1];
     85#endif
     86#if FORCE_REF_VSP
     87  m_ppcYuvAvail   = new TComYuv*    [m_uiMaxDepth-1];
     88  m_ppcYuvSynth   = new TComYuv*    [m_uiMaxDepth-1];
    8189#endif
    8290  m_ppcCU      = new TComDataCU*[m_uiMaxDepth-1];
     
    94102    m_ppcYuvResPred[ui] = new TComYuv;    m_ppcYuvResPred[ui]->create( uiWidth, uiHeight );
    95103#endif
     104#if FORCE_REF_VSP
     105    m_ppcYuvAvail  [ui] = new TComYuv;    m_ppcYuvAvail  [ui]->create( uiWidth, uiHeight );
     106    m_ppcYuvSynth  [ui] = new TComYuv;    m_ppcYuvSynth  [ui]->create( uiWidth, uiHeight );
     107#endif
    96108    m_ppcCU     [ui] = new TComDataCU; m_ppcCU     [ui]->create( uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) );
    97109  }
     
    118130    m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL;
    119131#endif
     132#if FORCE_REF_VSP
     133    m_ppcYuvAvail  [ui]->destroy(); delete m_ppcYuvAvail  [ui]; m_ppcYuvAvail  [ui] = NULL;
     134    m_ppcYuvSynth  [ui]->destroy(); delete m_ppcYuvSynth  [ui]; m_ppcYuvSynth  [ui] = NULL;
     135#endif
    120136    m_ppcCU     [ui]->destroy(); delete m_ppcCU     [ui]; m_ppcCU     [ui] = NULL;
    121137  }
     
    125141#if HHI_INTER_VIEW_RESIDUAL_PRED
    126142  delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL;
     143#endif
     144#if FORCE_REF_VSP
     145  delete [] m_ppcYuvAvail;   m_ppcYuvAvail   = NULL;
     146  delete [] m_ppcYuvSynth;   m_ppcYuvSynth   = NULL;
    127147#endif
    128148  delete [] m_ppcCU     ; m_ppcCU      = NULL;
     
    328348  {
    329349    m_pcEntropyDecoder->decodeSkipFlag( pcCU, uiAbsPartIdx, uiDepth );
     350
     351#if FORCE_REF_VSP==1
     352    if( pcCU->isSkipped(uiAbsPartIdx) && pcCU->getSlice()->getViewId() != 0 )
     353#if VSP_TEXT_ONLY
     354    if( !pcCU->getSlice()->getSPS()->isDepth() )
     355#endif
     356    {
     357      m_pcEntropyDecoder->decodeVspFlag( pcCU, uiAbsPartIdx, uiDepth );
     358    }
     359#endif
    330360  }
    331361 
    332362  if( pcCU->isSkipped(uiAbsPartIdx) )
     363#if FORCE_REF_VSP==1
     364  if( !pcCU->isVspMode(uiAbsPartIdx) )
     365#endif
    333366  {
    334367    m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
     
    352385    if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == uiDepth )
    353386    {
     387#if DEBUGLOGOUT
     388      PredMode   eOrgPred = pcCU->getPredictionMode( uiAbsPartIdx );
     389#endif
    354390      TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
    355391      pcCU->copyTextureMotionDataFrom( pcTextureCU, uiDepth, pcCU->getZorderIdxInCU() + uiAbsPartIdx, uiAbsPartIdx );
     392#if DEBUGLOGOUT
     393      if( eOrgPred == MODE_SKIP )
     394        pcCU->setPredModeSubParts( MODE_SKIP, uiAbsPartIdx, uiDepth );
     395      m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth );
     396#endif
    356397
    357398      UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
     
    396437#endif
    397438    xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
     439#if DEBUGLOGOUT
     440#if HHI_MPI
     441    if( pcCU->getTextureModeDepth( uiAbsPartIdx ) != uiDepth )
     442#endif
     443      m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth );
     444#endif
    398445    return;
    399446  }
     447
     448#if FORCE_REF_VSP==1
     449  if( pcCU->isVspMode( uiAbsPartIdx ) )
     450  {
     451    TComMv cMvZero;
     452
     453    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     454    pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
     455
     456    pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( TComMvField(), SIZE_2Nx2N, uiAbsPartIdx, uiDepth, 0 );
     457    pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( TComMvField(), SIZE_2Nx2N, uiAbsPartIdx, uiDepth, 0 );
     458    pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd    ( cMvZero,       SIZE_2Nx2N, uiAbsPartIdx, uiDepth, 0 );
     459    pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd    ( cMvZero,       SIZE_2Nx2N, uiAbsPartIdx, uiDepth, 0 );
     460
     461    //pcCU->getCUMvField(REF_PIC_LIST_0)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_0), SIZE_2Nx2N, 0, pcCU->getDepth(0), 0 );
     462    //pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_1), SIZE_2Nx2N, 0, pcCU->getDepth(0), 0 );
     463
     464    pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, uiAbsPartIdx, 0, uiDepth );
     465    pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, uiAbsPartIdx, 0, uiDepth );
     466    pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, uiAbsPartIdx, 0, uiDepth );
     467    pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, uiAbsPartIdx, 0, uiDepth );
     468
     469    pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth );
     470    pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth );
     471    pcCU->setNSQTIdxSubParts( uiAbsPartIdx, uiDepth );
     472
     473    xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
     474#if DEBUGLOGOUT
     475    m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth );
     476#endif
     477    return;
     478  }
     479#endif
    400480
    401481#if HHI_MPI
     
    428508    {
    429509      xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
     510#if DEBUGLOGOUT
     511      m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth );
     512#endif
    430513      return;
    431514    }
     
    527610  setdQPFlag( bCodeDQP );
    528611  xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
     612#if DEBUGLOGOUT
     613  m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth );
     614#endif
    529615}
    530616
     
    553639{
    554640  TComPic* pcPic = pcCU->getPic();
     641#if FORCE_REF_VSP
     642  if(pcPic->getPicYuvSynth())  m_ppcYuvSynth[uiDepth]->copyFromPicYuv( pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx );
     643  if(pcPic->getPicYuvAvail())  m_ppcYuvAvail[uiDepth]->copyFromPicYuv( pcPic->getPicYuvAvail(), pcCU->getAddr(), uiAbsPartIdx );
     644#endif
    555645 
    556646  Bool bBoundary = false;
     
    603693      xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
    604694      break;
     695#if FORCE_REF_VSP==1
     696    case MODE_SYNTH:
     697      m_ppcYuvReco[uiDepth]->copyFromPicYuv(pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx);
     698      break;
     699#endif
    605700    default:
    606701      assert(0);
     
    615710 
    616711  xCopyToPic( m_ppcCU[uiDepth], pcPic, uiAbsPartIdx, uiDepth );
     712#if DEBUGIMGOUT
     713  xColsetToPicMerge( m_ppcCU[uiDepth], pcPic->getPicYuvRecDbg(), uiAbsPartIdx, uiDepth );
     714#endif
    617715}
    618716
     
    626724  // inter prediction
    627725  m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] );
    628  
    629726#if HHI_MPI
    630727  if( pcCU->getTextureModeDepth( 0 ) != -1 )
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCu.h

    r56 r166  
    4646#include "TLibCommon/TComPrediction.h"
    4747#include "TDecEntropy.h"
     48#if DEBUGIMGOUT || DEBUGLOGOUT
     49#include "TLibCommon/DebugLog.h"
     50#endif
    4851
    4952//! \ingroup TLibDecoder
     
    6467  TComYuv**           m_ppcYuvResPred;    ///< residual prediction buffer
    6568#endif
     69#if VSP_N
     70  TComYuv**           m_ppcYuvAvail;      ///< array of available map buffer
     71  TComYuv**           m_ppcYuvSynth;      ///< array of synth buffer
     72#endif
    6673  TComDataCU**        m_ppcCU;            ///< CU data array
    6774 
     
    7784  virtual ~TDecCu();
    7885 
     86#if DEBUGLOGOUT
     87  DebugLog            m_cDebug;
     88#endif
     89
    7990  /// initialize access channels
    8091  Void  init                    ( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction );
     
    121132  Void xFillPCMBuffer           (TComDataCU* pCU, UInt absPartIdx, UInt depth);
    122133#endif
     134#if DEBUGIMGOUT
     135  Void xColsetToPic             ( TComDataCU* pcCU, TComPicYuv* pcPicYuv, UInt uiZorderIdx, UInt uiDepth );
     136  Void xColsetToPicMerge        ( TComDataCU* pcCU, TComPicYuv* pcPicYuv, UInt uiZorderIdx, UInt uiDepth );
     137#endif
    123138};
    124139
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp

    r100 r166  
    5454}
    5555
     56#if FORCE_REF_VSP==1
     57Void TDecEntropy::decodeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     58{
     59  m_pcEntropyDecoderIf->parseVspFlag( pcCU, uiAbsPartIdx, uiDepth );
     60}
     61#endif
     62
    5663/** decode merge flag
    5764 * \param pcSubCU
     
    301308        {
    302309          decodeRefFrmIdxPU( pcCU,    uiSubPartIdx,              uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
     310#if VSP_MV_ZERO
     311          Int iRefIdx = pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->getRefIdx(uiSubPartIdx);
     312          if( pcCU->getSlice()->getViewId() && iRefIdx >= 0 && (pcCU->getSlice()->getRefViewId( RefPicList( uiRefListIdx ), iRefIdx ) == NUM_VIEW_VSP) )
     313          {
     314            pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( TComMv(0, 0), pcCU->getPartitionSize( uiSubPartIdx ), uiSubPartIdx, uiDepth, uiPartIdx );
     315            pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMv ( TComMv(0, 0), pcCU->getPartitionSize( uiSubPartIdx ), uiSubPartIdx, uiDepth, uiPartIdx );
     316            pcCU->setMVPIdxSubParts( -1, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, pcCU->getDepth(uiSubPartIdx));
     317            pcCU->setMVPNumSubParts( -1, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, pcCU->getDepth(uiSubPartIdx));
     318          }
     319          else
     320          {
     321#endif
    303322          decodeMvdPU      ( pcCU,    uiSubPartIdx,              uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
    304323          decodeMVPIdxPU   ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) );
     324#if VSP_MV_ZERO
     325          }
     326#endif
    305327        }
    306328      }
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecEntropy.h

    r77 r166  
    103103public:
    104104  virtual Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     105#if FORCE_REF_VSP==1
     106  virtual Void parseVspFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     107#endif
    105108  virtual Void parseSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    106109  virtual Void parseMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0;
     
    196199  Void decodeSplitFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    197200  Void decodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     201#if FORCE_REF_VSP==1
     202  Void decodeVspFlag           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     203#endif
    198204  Void decodeMergeFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
    199205  Void decodeMergeIndex        ( TComDataCU* pcSubCU, UInt uiPartIdx, UInt uiPartAddr, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSbac.cpp

    r100 r166  
    578578}
    579579
     580#if FORCE_REF_VSP==1
     581Void TDecSbac::parseVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     582{
     583  if( pcCU->getSlice()->isIntra() || pcCU->getSlice()->getViewId()==0 )
     584  {
     585    return;
     586  }
     587 
     588  UInt uiSymbol = 0;
     589  UInt uiCtxSkip = pcCU->getCtxSkipFlag( uiAbsPartIdx );
     590  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSkipFlagSCModel.get( 0, 0, uiCtxSkip ) );
     591  DTRACE_CABAC_VL( g_nSymbolCounter++ );
     592  DTRACE_CABAC_T( "\tVspFlag" );
     593  DTRACE_CABAC_T( "\tuiCtxSkip: ");
     594  DTRACE_CABAC_V( uiCtxSkip );
     595  DTRACE_CABAC_T( "\tuiSymbol: ");
     596  DTRACE_CABAC_V( uiSymbol );
     597  DTRACE_CABAC_T( "\n");
     598 
     599  if( uiSymbol )
     600  {
     601    pcCU->setPredModeSubParts( MODE_SYNTH, uiAbsPartIdx, uiDepth );
     602  }
     603}
     604#endif
     605
    580606/** parse merge flag
    581607 * \param pcCU
     
    610636  uiNumCand = pcCU->getSlice()->getMaxNumMergeCand();
    611637#if HHI_MPI
     638#if VSP_TEXT_ONLY
     639  TComDataCU* pcTextCU = pcCU->getSlice()->getSPS()->getUseMVI() ? pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ) : NULL;
     640  Int aiRefIdxVsp[2] = { pcTextCU ? pcTextCU->getCUMvField( RefPicList(0) )->getRefIdx( uiAbsPartIdx ) : -1,
     641                         pcTextCU ? pcTextCU->getCUMvField( RefPicList(1) )->getRefIdx( uiAbsPartIdx ) : -1 };
     642  const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE
     643    && !( aiRefIdxVsp[0] >= 0 && pcTextCU->getSlice()->getRefViewId( RefPicList(0), aiRefIdxVsp[0] ) == NUM_VIEW_VSP )
     644    && !( aiRefIdxVsp[1] >= 0 && pcTextCU->getSlice()->getRefViewId( RefPicList(1), aiRefIdxVsp[1] ) == NUM_VIEW_VSP );
     645#else
    612646  const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE;
     647#endif
    613648  const UInt uiMviMergePos = bMVIAvailable ? HHI_MPI_MERGE_POS : uiNumCand;
    614649#endif
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSbac.h

    r100 r166  
    166166
    167167  Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     168#if FORCE_REF_VSP==1
     169  Void parseVspFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     170#endif
    168171  Void parseSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    169172  Void parseMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSlice.cpp

    r77 r166  
    102102  rpcPic->setPicYuvResi( 0 );
    103103 
     104#if DEBUGLOGOUT
     105  char fname[128];
     106  sprintf(fname, "%sV%02d_%05d%s.csv", "DecLog", rpcPic->getSlice(0)->getViewId(), rpcPic->getPOC(), rpcPic->getSlice(0)->getIsDepth() ? "depth":"text");
     107  m_pcCuDecoder->m_cDebug.DebugLogFileOpen( fname );
     108#endif
    104109#if ENC_DEC_TRACE
    105110  g_bJustDoIt = g_bEncDecTraceEnable;
     
    439444#endif
    440445  }
     446#if DEBUGLOGOUT
     447  m_pcCuDecoder->m_cDebug.DebugLogFileClose();
     448#endif
    441449
    442450}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecTop.cpp

    r77 r166  
    5656    m_aaiCodedScale       [ uiId ] = new Int [ MAX_VIEW_NUM ];
    5757  }
     58
     59#if VSP_N
     60  xCreateLUTs( (UInt)MAX_VIEW_NUM, (UInt)MAX_VIEW_NUM, m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
     61  m_iLog2Precision   = LOG2_DISP_PREC_LUT;
     62  m_uiBitDepthForLUT = 8; //fixed
     63#if NTT_SUBPEL
     64  xCreateLUTs_Subpel( (UInt)MAX_VIEW_NUM, (UInt)MAX_VIEW_NUM,  m_aiBaseViewShiftLUT_ipel,  m_aiBaseViewShiftLUT_fpos);
     65#endif
     66#endif
    5867}
    5968
     
    6978  delete [] m_aiViewOrderIndex;
    7079  delete [] m_aiViewReceived;
     80
     81#if VSP_N
     82  xDeleteArray( m_adBaseViewShiftLUT, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 );
     83  xDeleteArray( m_aiBaseViewShiftLUT, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 );
     84#if NTT_SUBPEL
     85  xDeleteArray( m_aiBaseViewShiftLUT_ipel, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 );
     86  xDeleteArray( m_aiBaseViewShiftLUT_fpos, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 );
     87#endif
     88#endif
    7189}
    7290
     
    82100  m_uiMaxViewId             = 0;
    83101}
     102
     103#if VSP_N
     104Void
     105CamParsCollector::xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT)
     106{
     107  //AOF( m_uiBitDepthForLUT == 8 );
     108  //AOF(radLUT == NULL && raiLUT == NULL );
     109
     110  uiNumberSourceViews = Max( 1, uiNumberSourceViews );
     111  uiNumberTargetViews = Max( 1, uiNumberTargetViews );
     112
     113  radLUT         = new Double***[ uiNumberSourceViews ];
     114  raiLUT         = new Int   ***[ uiNumberSourceViews ];
     115
     116  for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ )
     117  {
     118    radLUT        [ uiSourceView ] = new Double**[ uiNumberTargetViews ];
     119    raiLUT        [ uiSourceView ] = new Int   **[ uiNumberTargetViews ];
     120
     121    for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ )
     122    {
     123      radLUT        [ uiSourceView ][ uiTargetView ]      = new Double*[ 2 ];
     124      radLUT        [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ 257 ];
     125      radLUT        [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ 257 ];
     126
     127      raiLUT        [ uiSourceView ][ uiTargetView ]      = new Int*   [ 2 ];
     128      raiLUT        [ uiSourceView ][ uiTargetView ][ 0 ] = new Int    [ 257 ];
     129      raiLUT        [ uiSourceView ][ uiTargetView ][ 1 ] = new Int    [ 257 ];
     130    }
     131  }
     132}
     133
     134Void
     135CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT)
     136{
     137  Int     iLog2DivLuma   = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision;   AOF( iLog2DivLuma > 0 );
     138  Int     iLog2DivChroma = iLog2DivLuma + 1;
     139
     140  iOffset <<= m_uiBitDepthForLUT;
     141
     142  Double dScale  = (Double) iScale  / (( Double ) ( 1 << iLog2DivLuma ));
     143  Double dOffset = (Double) iOffset / (( Double ) ( 1 << iLog2DivLuma ));
     144
     145  // offsets including rounding offsets
     146  Int64 iOffsetLuma   = iOffset + ( ( 1 << iLog2DivLuma   ) >> 1 );
     147  Int64 iOffsetChroma = iOffset + ( ( 1 << iLog2DivChroma ) >> 1 );
     148
     149
     150  for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ )
     151  {
     152
     153    // real-valued look-up tables
     154#if POZNAN_NONLINEAR_DEPTH
     155    Double  dShiftLuma;
     156    if( m_bUseNonlinearDepth )
     157      dShiftLuma      = ( m_cNonlinearDepthModel.BackwardD( (Double)uiDepthValue, dScale) + dOffset ) * Double( 1 << m_iLog2Precision );
     158    else
     159      dShiftLuma      = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision );
     160#else
     161    Double  dShiftLuma      = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision );
     162#endif
     163    Double  dShiftChroma    = dShiftLuma / 2;
     164    radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma;
     165    radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = dShiftChroma;
     166
     167    // integer-valued look-up tables
     168#if POZNAN_NONLINEAR_DEPTH
     169    Int64   iTempScale;
     170    if( m_bUseNonlinearDepth )
     171      iTempScale      = (Int64)m_cNonlinearDepthModel.BackwardI(uiDepthValue, iScale);
     172    else
     173      iTempScale      = (Int64)uiDepthValue * iScale;
     174#else
     175    Int64   iTempScale      = (Int64)uiDepthValue * iScale;
     176#endif
     177    Int64   iShiftLuma      = ( iTempScale + iOffsetLuma   ) >> iLog2DivLuma;
     178    Int64   iShiftChroma    = ( iTempScale + iOffsetChroma ) >> iLog2DivChroma;
     179    raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = (Int)iShiftLuma;
     180    raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = (Int)iShiftChroma;
     181
     182    // maximum deviation
     183    //dMaxDispDev     = Max( dMaxDispDev,    fabs( Double( (Int) iTestScale   ) - dShiftLuma * Double( 1 << iLog2DivLuma ) ) / Double( 1 << iLog2DivLuma ) );
     184    //dMaxRndDispDvL  = Max( dMaxRndDispDvL, fabs( Double( (Int) iShiftLuma   ) - dShiftLuma   ) );
     185    //dMaxRndDispDvC  = Max( dMaxRndDispDvC, fabs( Double( (Int) iShiftChroma ) - dShiftChroma ) );
     186  }
     187
     188  radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];
     189  radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];
     190  raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];
     191  raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];
     192}
     193
     194Bool
     195CamParsCollector::getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft)
     196{
     197  /*
     198  riNearestViewIdx = 0;
     199
     200  Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] );
     201  Int  iFactor       = ( bDecencdingVN ? -1 : 1 );
     202
     203  if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[riNearestViewIdx] ) * iFactor  <= 0 )
     204  {
     205    rbRenderFromLeft = true;
     206  }
     207  else
     208  {
     209    rbRenderFromLeft = false;
     210  }
     211
     212  riRelDistToLeft = 128; //Not used for now;
     213//*/
     214  return true;
     215}
     216
     217#if NTT_SUBPEL
     218Void
     219CamParsCollector::xCreateLUTs_Subpel( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 )
     220{
     221  uiNumberSourceViews = Max( 1, uiNumberSourceViews );
     222  uiNumberTargetViews = Max( 1, uiNumberTargetViews );
     223
     224  raiLUT0         = new Int   ***[ uiNumberSourceViews ];
     225  raiLUT1         = new Int   ***[ uiNumberSourceViews ];
     226
     227  for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ )
     228  {
     229    raiLUT0        [ uiSourceView ] = new Int   **[ uiNumberTargetViews ];
     230    raiLUT1        [ uiSourceView ] = new Int   **[ uiNumberTargetViews ];
     231
     232    for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ )
     233    {
     234      raiLUT0        [ uiSourceView ][ uiTargetView ]      = new Int*   [ 2 ];
     235      raiLUT0        [ uiSourceView ][ uiTargetView ][ 0 ] = new Int    [ 257 ];
     236      raiLUT0        [ uiSourceView ][ uiTargetView ][ 1 ] = new Int    [ 257 ];
     237      raiLUT1        [ uiSourceView ][ uiTargetView ]      = new Int*   [ 2 ];
     238      raiLUT1        [ uiSourceView ][ uiTargetView ][ 0 ] = new Int    [ 257 ];
     239      raiLUT1        [ uiSourceView ][ uiTargetView ][ 1 ] = new Int    [ 257 ];
     240    }
     241  }
     242}
     243Void
     244CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Int****& raiLUT_ipel, Int****& raiLUT_fpos)
     245{
     246  Int   iLog2Div = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision;   AOF( iLog2Div > 0 );
     247  Int64 iOffset64   = ( Int64(iOffset) << m_uiBitDepthForLUT ) + ( ( 1 << iLog2Div ) >> 1 );
     248
     249  for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ )
     250  {
     251    Int64   iTempScale      = (Int64)uiDepthValue * iScale;
     252    Int     iShiftSubpel    = (Int) (( iTempScale + iOffset64 ) >> iLog2Div);
     253    Int     iShiftPelLuma   = iShiftSubpel >> m_iLog2Precision; // better to have rounding ?
     254    Int     iShiftPelChroma = iShiftPelLuma >> 1;
     255
     256    raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftPelLuma;
     257    raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftPelChroma;
     258    raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelLuma << m_iLog2Precision );
     259    raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelChroma << (m_iLog2Precision+1) );
     260
     261#if 0 // NTT bugfix
     262    if ( raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] < 0 )
     263      raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = -4 - raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ];
     264    if ( raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] < 0 )
     265      raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = -8 - raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ];
     266#endif
     267
     268#if _DEBUG
     269    AOF( (raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ]>> m_iLog2Precision   ) == 0 );
     270    AOF( (raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ]>>(m_iLog2Precision+1)) == 0 );
     271#endif
     272  }
     273
     274  raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];
     275  raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];
     276  raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];
     277  raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];
     278}
     279#endif
     280
     281#endif
    84282
    85283Void
     
    164362        m_aaiCodedScale [ uiViewId ][ uiBaseId ]  = pcSlice->getInvCodedScale () [ uiBaseId ];
    165363        m_aaiCodedOffset[ uiViewId ][ uiBaseId ]  = pcSlice->getInvCodedOffset() [ uiBaseId ];
     364#if VSP_N
     365        xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT);
     366        xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT);
     367#if NTT_SUBPEL
     368        xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos );
     369        xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos );
     370#endif
     371#endif 
    166372      }
    167373      else
     
    171377        m_aaiCodedScale [ uiViewId ][ uiBaseId ]  = pcSlice->getSPS()->getInvCodedScale () [ uiBaseId ];
    172378        m_aaiCodedOffset[ uiViewId ][ uiBaseId ]  = pcSlice->getSPS()->getInvCodedOffset() [ uiBaseId ];
     379#if VSP_N
     380        xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
     381        xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
     382#if NTT_SUBPEL
     383        xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos );
     384        xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos );
     385#endif
     386#endif
    173387      }
    174388    }
     
    185399        m_aaiCodedScale [ uiViewId ][ uiBaseId ]  = pcSlice->getInvCodedScale () [ uiBaseId ];
    186400        m_aaiCodedOffset[ uiViewId ][ uiBaseId ]  = pcSlice->getInvCodedOffset() [ uiBaseId ];
     401#if VSP_N
     402        xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
     403        xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
     404#if NTT_SUBPEL
     405        xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos );
     406        xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos );
     407#endif
     408#endif
    187409      }
    188410    }
     
    255477#endif
    256478#if ENC_DEC_TRACE
    257   g_hTrace = fopen( "TraceDec.txt", "wb" );
     479  if(!g_hTrace) g_hTrace = fopen( "TraceDec.txt", "wb" );
    258480  g_bJustDoIt = g_bEncDecTraceDisable;
    259481  g_nSymbolCounter = 0;
     
    266488  m_bFirstSliceInSequence   = true;
    267489  m_pcCamParsCollector = 0;
     490
     491#if VSP_N
     492  m_pcPicVSP = NULL;
     493  m_pcPicAvail = NULL;
     494#endif
    268495}
    269496
     
    271498{
    272499#if ENC_DEC_TRACE
    273   fclose( g_hTrace );
     500  if(g_hTrace) fclose( g_hTrace );
     501  g_hTrace=NULL;
    274502#endif
    275503}
     
    298526  m_cResidualGenerator.destroy();
    299527#endif
     528
     529#if VSP_N
     530  if( m_pcPicVSP )
     531  {
     532    m_pcPicVSP->destroy();
     533    delete m_pcPicVSP;
     534    m_pcPicVSP = NULL;
     535  }
     536  if( m_pcPicAvail )
     537  {
     538    m_pcPicAvail->destroy();
     539    delete m_pcPicAvail;
     540    m_pcPicAvail = NULL;
     541  }
     542#endif
     543
    300544}
    301545
     
    732976    //  Get a new picture buffer
    733977    xGetNewPicBuffer (m_apcSlicePilot, pcPic);
     978#if VSP_N
     979#if VSP_SLICE_HEADER
     980    if( m_apcSlicePilot->getVspFlag() )
     981#endif
     982    {
     983      if( m_pcPicVSP == NULL )
     984      {
     985        m_pcPicVSP = new TComPic;
     986        m_pcPicVSP->create( m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     987        m_pcPicVSP->setCurrSliceIdx(0);
     988        m_pcPicVSP->getCurrSlice()->setViewId( NUM_VIEW_VSP );
     989        m_pcPicVSP->getCurrSlice()->setViewOrderIdx( m_apcSlicePilot->getSPS()->getViewOrderIdx() );
     990        m_pcPicVSP->getCurrSlice()->setSPS( m_apcSlicePilot->getSPS() );
     991        m_pcPicVSP->getCurrSlice()->setPPS( m_apcSlicePilot->getPPS() );
     992        m_pcPicVSP->getCurrSlice()->setPPSId( m_apcSlicePilot->getPPS()->getPPSId() );
     993        m_pcPicVSP->getPicSym()->setNumColumnsMinus1( m_apcSlicePilot->getSPS()->getNumColumnsMinus1() );
     994        m_pcPicVSP->getPicSym()->setNumRowsMinus1( m_apcSlicePilot->getSPS()->getNumRowsMinus1() );
     995        m_pcPicVSP->getPicSym()->xCreateTComTileArray();
     996        for (int i=0;i<m_pcPicVSP->getPicSym()->getNumberOfCUsInFrame();i++)
     997        {
     998          m_pcPicVSP->getPicSym()->getCU(i)->getCUMvField(RefPicList(0))->clearMvField();
     999          m_pcPicVSP->getPicSym()->getCU(i)->getCUMvField(RefPicList(1))->clearMvField();
     1000        }
     1001#if DEPTH_MAP_GENERATION
     1002        UInt uiPdm                  = ( m_viewId ? m_apcSlicePilot->getSPS()->getPredDepthMapGeneration() : m_tAppDecTop->getSPSAccess()->getPdm() );
     1003        Bool bNeedPrdDepthMapBuffer = ( !m_isDepth && uiPdm > 0 );
     1004        if( bNeedPrdDepthMapBuffer )
     1005        {
     1006          m_pcPicVSP->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) );
     1007        }
     1008#endif
     1009      }
     1010      if( m_pcPicAvail == NULL )
     1011      {
     1012        m_pcPicAvail = new TComPic;
     1013        m_pcPicAvail->create( m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     1014        m_pcPicAvail->setCurrSliceIdx(0);
     1015        m_pcPicAvail->getCurrSlice()->setViewId( 99 );
     1016        m_pcPicAvail->getCurrSlice()->setViewOrderIdx( m_apcSlicePilot->getSPS()->getViewOrderIdx() );
     1017        m_pcPicAvail->getCurrSlice()->setSPS( m_apcSlicePilot->getSPS() );
     1018        m_pcPicAvail->getCurrSlice()->setPPS( m_apcSlicePilot->getPPS() );
     1019        m_pcPicAvail->getCurrSlice()->setPPSId( m_apcSlicePilot->getPPS()->getPPSId() );
     1020        m_pcPicAvail->getPicSym()->setNumColumnsMinus1( m_apcSlicePilot->getSPS()->getNumColumnsMinus1() );
     1021        m_pcPicAvail->getPicSym()->setNumRowsMinus1( m_apcSlicePilot->getSPS()->getNumRowsMinus1() );
     1022        m_pcPicAvail->getPicSym()->xCreateTComTileArray();
     1023        for (int i=0;i<m_pcPicAvail->getPicSym()->getNumberOfCUsInFrame();i++)
     1024        {
     1025          m_pcPicAvail->getPicSym()->getCU(i)->getCUMvField(RefPicList(0))->clearMvField();
     1026          m_pcPicAvail->getPicSym()->getCU(i)->getCUMvField(RefPicList(1))->clearMvField();
     1027        }
     1028#if DEPTH_MAP_GENERATION
     1029        UInt uiPdm                  = ( m_viewId ? m_apcSlicePilot->getSPS()->getPredDepthMapGeneration() : m_tAppDecTop->getSPSAccess()->getPdm() );
     1030        Bool bNeedPrdDepthMapBuffer = ( !m_isDepth && uiPdm > 0 );
     1031        if( bNeedPrdDepthMapBuffer )
     1032        {
     1033          m_pcPicAvail->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) );
     1034        }
     1035#endif
     1036      }
     1037    }
     1038#endif
    7341039
    7351040#if SONY_COLPIC_AVAILABILITY
     
    7591064    m_cResidualGenerator.create( true, m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement );
    7601065#endif
     1066#if !QC_MULTI_DIS_CAN
     1067#if VSP_N
     1068#if VSP_SLICE_HEADER
     1069    if( m_apcSlicePilot->getVspFlag() )
     1070#endif
     1071    {
     1072      UInt uiPdm                  = ( m_viewId ? m_apcSlicePilot->getSPS()->getPredDepthMapGeneration() : m_tAppDecTop->getSPSAccess()->getPdm() );
     1073      Bool bNeedPrdDepthMapBuffer = ( !m_isDepth && uiPdm > 0 );
     1074      if( bNeedPrdDepthMapBuffer )
     1075      {
     1076        if( m_pcPicVSP && m_pcPicVSP->getPredDepthMap() )
     1077        {
     1078          m_cDepthMapGenerator.clearDepthMap( m_pcPicVSP );
     1079        }
     1080        if( m_pcPicAvail && m_pcPicAvail->getPredDepthMap() )
     1081        {
     1082          m_cDepthMapGenerator.clearDepthMap( m_pcPicAvail );
     1083        }
     1084      }
     1085    }
     1086#endif
     1087#endif
    7611088  }
    7621089
     
    9731300
    9741301    std::vector<TComPic*> apcInterViewRefPics = m_tAppDecTop->getInterViewRefPics( m_viewId, pcSlice->getPOC(), m_isDepth, pcSlice->getSPS() );
     1302#if VSP_N
     1303    Bool bUseVsp = (m_viewId!=0);
     1304#if VSP_TEXT_ONLY
     1305    if( m_isDepth ) bUseVsp = false;
     1306#endif
     1307#if VSP_SLICE_HEADER
     1308    if( !pcSlice->getVspFlag() ) bUseVsp = false;
     1309#endif
     1310
     1311#if VSP_SLICE_HEADER
     1312    if( bUseVsp )
     1313#endif
     1314      m_pcPicVSP->getCurrSlice()->setPOC( pcPic->getPOC() );
     1315
     1316    pcSlice->setRefPicListMvc( m_cListPic, apcInterViewRefPics, bUseVsp ? m_pcPicVSP : NULL );
     1317
     1318#else
    9751319    pcSlice->setRefPicListMvc( m_cListPic, apcInterViewRefPics );
     1320#endif
    9761321
    9771322    // For generalized B
     
    10681413#endif
    10691414
     1415#if VSP_N
     1416  if( m_pcCamParsCollector )
     1417  {
     1418    m_pcCamParsCollector->setSlice( pcSlice );
     1419  }
     1420#if VSP_SLICE_HEADER
     1421  if( pcSlice->getVspFlag() )
     1422#endif
     1423  if( getTAppDecTop()->getUseDepth() )
     1424  {
     1425    getTAppDecTop()->storeVSPInBuffer( m_pcPicVSP, m_pcPicAvail, pcSlice->getViewId(), pcSlice->getSPS()->getViewOrderIdx(), pcSlice->getPOC(), m_isDepth );
     1426  }
     1427#endif
     1428
    10701429  //  Decode a picture
    10711430  m_cGopDecoder.decompressGop(nalu.m_Bitstream, pcPic, false);
     
    11081467#if LCU_SYNTAX_ALF
    11091468  m_cAdaptiveLoopFilter.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     1469#endif
     1470
     1471#if VSP_N
     1472  if( !sps->isDepth() && sps->getViewId() == 0 && getTAppDecTop()->getVSPRendererTop() )
     1473  {
     1474#if NTT_SUBPEL
     1475    getTAppDecTop()->getVSPRendererTop()->init( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 5, 1, 0, 6 );
     1476#else
     1477    getTAppDecTop()->getVSPRendererTop()->init( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 4, 1, 0, 6 );
     1478#endif
     1479  }
    11101480#endif
    11111481}
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecTop.h

    r100 r166  
    7777  Bool  isInitialized() const { return m_bInitialized; }
    7878
     79#if VSP_N
     80  Double****          getBaseViewShiftLUTD      ()  { return m_adBaseViewShiftLUT;   }
     81  Int****             getBaseViewShiftLUTI      ()  { return m_aiBaseViewShiftLUT;   }
     82  Int**               getBaseViewOffsetI        ()  { return m_aaiCodedOffset;   }
     83  Int**               getBaseViewScaleI         ()  { return m_aaiCodedScale;   }
     84  Bool                getNearestBaseView        ( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft);
     85#if NTT_SUBPEL
     86  Int****             getBaseViewIPelLUT        ()  { return m_aiBaseViewShiftLUT_ipel;   }
     87  Int****             getBaseViewFPosLUT        ()  { return m_aiBaseViewShiftLUT_fpos;   }
     88#endif
     89#endif
     90
    7991private:
    8092  Bool  xIsComplete ();
     
    94106  Int     m_iLastPOC;
    95107  UInt    m_uiMaxViewId;
     108
     109#if VSP_N
     110  UInt    m_uiBitDepthForLUT;
     111  UInt    m_iLog2Precision;
     112  UInt    m_uiInputBitDepth;
     113  // look-up tables
     114  Double****          m_adBaseViewShiftLUT;                    ///< Disparity LUT
     115  Int****             m_aiBaseViewShiftLUT;                    ///< Disparity LUT
     116  Void xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT);
     117  Void xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT);
     118  template<class T> Void  xDeleteArray  ( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 );
     119  template<class T> Void  xDeleteArray  ( T*& rpt, UInt uiSize1, UInt uiSize2 );
     120  template<class T> Void  xDeleteArray  ( T*& rpt, UInt uiSize );
     121
     122#if NTT_SUBPEL
     123  Int****             m_aiBaseViewShiftLUT_ipel;              ///< Disparity LUT
     124  Int****             m_aiBaseViewShiftLUT_fpos;              ///< Disparity LUT
     125  Void xCreateLUTs_Subpel ( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 );
     126  Void xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Int****& raiLUT_ipel, Int****& raiLUT_fpos);
     127#endif
     128#endif
    96129};
     130
     131#if VSP_N
     132template <class T>
     133Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 )
     134{
     135  if( rpt )
     136  {
     137    for( UInt uiK = 0; uiK < uiSize1; uiK++ )
     138    {
     139      for( UInt uiL = 0; uiL < uiSize2; uiL++ )
     140      {
     141        for( UInt uiM = 0; uiM < uiSize3; uiM++ )
     142        {
     143          delete[] rpt[ uiK ][ uiL ][ uiM ];
     144        }
     145        delete[] rpt[ uiK ][ uiL ];
     146      }
     147      delete[] rpt[ uiK ];
     148    }
     149    delete[] rpt;
     150  }
     151  rpt = NULL;
     152};
     153
     154
     155template <class T>
     156Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2 )
     157{
     158  if( rpt )
     159  {
     160    for( UInt uiK = 0; uiK < uiSize1; uiK++ )
     161    {
     162      for( UInt uiL = 0; uiL < uiSize2; uiL++ )
     163      {
     164        delete[] rpt[ uiK ][ uiL ];
     165      }
     166      delete[] rpt[ uiK ];
     167    }
     168    delete[] rpt;
     169  }
     170  rpt = NULL;
     171};
     172
     173
     174template <class T>
     175Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize )
     176{
     177  if( rpt )
     178  {
     179    for( UInt uiK = 0; uiK < uiSize; uiK++ )
     180    {
     181      delete[] rpt[ uiK ];
     182    }
     183    delete[] rpt;
     184  }
     185  rpt = NULL;
     186};
     187#endif
    97188
    98189/// decoder class
     
    155246  NalUnitType             m_nalUnitTypeBaseView; 
    156247
     248#if VSP_N
     249  TComPic*                m_pcPicVSP; //view synthesis prediction buffer for current POC to be coded
     250  TComPic*                m_pcPicAvail;
     251#endif
     252
    157253public:
    158254  TDecTop();
     
    195291  TAppDecTop*         getTAppDecTop()                           { return  m_tAppDecTop; }
    196292  NalUnitType         getNalUnitTypeBaseView()                  { return m_nalUnitTypeBaseView; }
     293
     294#if VSP_N
     295  TComPic*            getVSPBuf()                               { return m_pcPicVSP; }
     296#endif
    197297
    198298protected:
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp

    r100 r166  
    11791179  WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "maxNumMergeCand");
    11801180#endif
     1181
     1182#if VSP_SLICE_HEADER
     1183  if( pcSlice->getSPS()->getViewId()!=0
     1184#if VSP_TEXT_ONLY
     1185      && !(pcSlice->getSPS()->isDepth())
     1186#endif
     1187    )
     1188  {
     1189    WRITE_FLAG( pcSlice->getVspFlag()?1:0, "vsp_flag" );
     1190//    printf("[VSP: %d] ", pcSlice->getVspFlag()?1:0);
     1191  }
     1192#endif
     1193
    11811194}
    11821195
     
    14261439  assert(0);
    14271440}
     1441
     1442#if FORCE_REF_VSP==1
     1443Void TEncCavlc::codeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
     1444{
     1445  assert(0);
     1446}
     1447#endif
    14281448
    14291449Void TEncCavlc::codeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCavlc.h

    r77 r166  
    164164
    165165  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     166#if FORCE_REF_VSP==1
     167  Void codeVspFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     168#endif
    166169  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    167170  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCu.cpp

    r100 r166  
    453453  // get Original YUV data from picture
    454454  m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() );
     455#if FORCE_REF_VSP
     456  //Bool bWholeCUCanBeSynthesized = false;
     457  //Bool bOneSubCUCanNotBeSynthesied = false;
     458  Bool bSubCUCanBeSynthesized[4];
     459  if( rpcBestCU->getSlice()->getViewId() )
     460  {
     461    Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized;
     462    pcPic->checkSynthesisAvailability(/*rpcBestCU, */rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU(), uiDepth, pbSubCUCanBeSynthesized); //KUBA SYNTH
     463    //Int  iSubCUCanNotBeSynthesized = 0;  // Dong: Compiling error, set but not used. DONG_CHECK
     464    Int  iSubCUCanBeSynthesizedCnt = 0;
     465    for(Int i = 0; i < 4; i++)
     466    {
     467      if (!bSubCUCanBeSynthesized[i])
     468      {
     469        //iSubCUCanNotBeSynthesized = i;
     470      }
     471      else
     472      {
     473        iSubCUCanBeSynthesizedCnt ++;
     474      }
     475    }
     476    if(iSubCUCanBeSynthesizedCnt == 4)
     477    {
     478      //bWholeCUCanBeSynthesized = true;
     479    }
     480    //else if(iSubCUCanBeSynthesizedCnt == 3)
     481    //{
     482    //  bOneSubCUCanNotBeSynthesied = true;
     483    //}
     484    //bWholeCUCanBeSynthesized = true;
     485  }
     486#endif
    455487
    456488  // variables for fast encoder decision
     
    654686            doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0;
    655687          }
     688
     689#if FORCE_REF_VSP==1
     690#if VSP_TEXT_ONLY
     691          if( !rpcBestCU->getSlice()->getSPS()->isDepth() )
     692#endif
     693#if HHI_INTER_VIEW_RESIDUAL_PRED
     694            rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
     695#endif
     696#if HHI_INTERVIEW_SKIP
     697            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFullyRenderedSec, false, true ); // VSP
     698#else
     699            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
     700#endif
     701            rpcTempCU->initEstData( uiDepth, iQP );
     702#endif
    656703        }
    657704#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    15811628    {
    15821629      m_pcEntropyCoder->encodeSkipFlag( pcCU, uiAbsPartIdx );
     1630
     1631#if FORCE_REF_VSP==1
     1632      if( (pcCU->isSkipped( uiAbsPartIdx ) || pcCU->isVspMode( uiAbsPartIdx )) && pcCU->getSlice()->getViewId() != 0 )
     1633#if VSP_TEXT_ONLY
     1634      if( !pcCU->getSlice()->getSPS()->isDepth() )
     1635#endif
     1636      {
     1637        m_pcEntropyCoder->encodeVspFlag( pcCU, uiAbsPartIdx );
     1638      }
     1639#endif
    15831640    }
    15841641
    15851642    if( pcCU->isSkipped( uiAbsPartIdx ) )
     1643#if FORCE_REF_VSP==1
     1644    if( !pcCU->isVspMode( uiAbsPartIdx ) )
     1645#endif
    15861646    {
    15871647      m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx, 0 );
    15881648      finishCU(pcCU,uiAbsPartIdx,uiDepth);
     1649#if DEBUGLOGOUT
     1650      m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth );
     1651#endif
    15891652      xRestoreDepthWidthHeight( pcCU );
    15901653      return;
     
    16351698  {
    16361699    m_pcEntropyCoder->encodeSkipFlag( pcCU, uiAbsPartIdx );
     1700
     1701#if FORCE_REF_VSP==1
     1702    if( (pcCU->isSkipped( uiAbsPartIdx ) || pcCU->isVspMode( uiAbsPartIdx )) && pcCU->getSlice()->getViewId() != 0 )
     1703#if VSP_TEXT_ONLY
     1704    if( !pcCU->getSlice()->getSPS()->isDepth() )
     1705#endif
     1706    {
     1707      m_pcEntropyCoder->encodeVspFlag( pcCU, uiAbsPartIdx );
     1708    }
     1709#endif
    16371710  }
    16381711 
    16391712  if( pcCU->isSkipped( uiAbsPartIdx ) )
     1713#if FORCE_REF_VSP==1
     1714  if( !pcCU->isVspMode( uiAbsPartIdx ) )
     1715#endif
    16401716  {
    16411717    m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx, 0 );
     
    16441720#endif
    16451721    finishCU(pcCU,uiAbsPartIdx,uiDepth);
     1722#if DEBUGLOGOUT
     1723    m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth );
     1724#endif
    16461725    return;
    16471726  }
     1727
     1728#if FORCE_REF_VSP==1
     1729  if( pcCU->isVspMode( uiAbsPartIdx ) )
     1730  {
     1731    finishCU(pcCU,uiAbsPartIdx,uiDepth);
     1732#if DEBUGLOGOUT
     1733    m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth );
     1734#endif
     1735    return;
     1736  }
     1737#endif
     1738
    16481739#if HHI_MPI
    16491740  if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 )
     
    16621753      // Encode slice finish
    16631754      finishCU(pcCU,uiAbsPartIdx,uiDepth);
     1755#if DEBUGLOGOUT
     1756      m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth );
     1757#endif
    16641758      return;
    16651759    }
     
    16851779  // --- write terminating bit ---
    16861780  finishCU(pcCU,uiAbsPartIdx,uiDepth);
     1781#if DEBUGLOGOUT
     1782  m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth );
     1783#endif
    16871784}
    16881785
     
    18731970#if AMP_MRG
    18741971#if HHI_INTERVIEW_SKIP
    1875 Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bSkipRes, Bool bUseMRG)
     1972Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bSkipRes, Bool bUseMRG
     1973#if FORCE_REF_VSP==1
     1974                               , Bool bForceRefVsp
     1975#endif
     1976                               )
    18761977#else
    18771978Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bUseMRG)
     
    19102011  rpcTempCU->setResPredFlagSubParts ( bResPrdFlag,  0, 0, uhDepth );
    19112012#endif
     2013#if FORCE_REF_VSP==1
     2014  if( bForceRefVsp )
     2015    rpcTempCU->setPredModeSubParts  ( MODE_SYNTH, 0, uhDepth );
     2016  else
     2017#endif
    19122018  rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
    19132019 
     
    19252031  #if HHI_INTERVIEW_SKIP
    19262032#if LG_RESTRICTEDRESPRED_M24766
    1927   m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG  );
     2033  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG
     2034#if FORCE_REF_VSP==1
     2035    , bForceRefVsp
     2036#endif
     2037    );
    19282038#else
    19292039  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG  );
     
    24942604    for( UInt ui = 0; ui < rpcTempCU->getTotalNumPart(); ui++ )
    24952605    {
    2496       if( pcTextureCU->isIntra( rpcTempCU->getZorderIdxInCU() + ui ) )
     2606      if( pcTextureCU->isIntra( rpcTempCU->getZorderIdxInCU() + ui )
     2607#if FORCE_REF_VSP==1
     2608       || pcTextureCU->isVspMode( rpcTempCU->getZorderIdxInCU() + ui )
     2609#endif
     2610      )
    24972611      {
    24982612        return;
    24992613      }
     2614#if VSP_N
     2615#if !(!VSP_TEXT_ONLY && FORCE_REF_VSP==2)
     2616      else // inter
     2617      {
     2618        Int aiRefIdx[2] = {NOT_VALID, NOT_VALID};
     2619        for( Int iList = 0; iList < 2; iList++ )
     2620        {
     2621          aiRefIdx[iList] = pcTextureCU->getCUMvField( RefPicList(iList) )->getRefIdx( rpcTempCU->getZorderIdxInCU() + ui );
     2622          if( aiRefIdx[iList] >= 0 && pcTextureCU->getSlice()->getRefViewId( RefPicList(iList), aiRefIdx[iList] ) == NUM_VIEW_VSP )
     2623          {
     2624            return;
     2625          }
     2626        }
     2627        //if( aiRefIdx[0] == NOT_VALID && aiRefIdx[1] == NOT_VALID )
     2628        //{
     2629        //  return;
     2630        //}
     2631      }
     2632#endif
     2633#endif
    25002634    }
    25012635  }
     
    26942828  m_pcEntropyCoder->encodeSplitFlag( pcCU, 0, uhDepth, true );
    26952829  m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
     2830#if FORCE_REF_VSP==1
     2831  if( (pcCU->isSkipped( 0 ) || pcCU->isVspMode( 0 )) && pcCU->getSlice()->getViewId() != 0 )
     2832#if VSP_TEXT_ONLY
     2833  if( !pcCU->getSlice()->getSPS()->isDepth() )
     2834#endif
     2835    m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true );
     2836#endif
    26962837
    26972838  if( pcCU->isSkipped( 0 ) )
     2839#if FORCE_REF_VSP==1
     2840  if( !pcCU->isVspMode( 0 ) )
     2841#endif
    26982842  {
    26992843    m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, 0, true );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCu.h

    r56 r166  
    4646#include "TLibCommon/TComBitCounter.h"
    4747#include "TLibCommon/TComDataCU.h"
     48#if DEBUGLOGOUT
     49#include "TLibCommon/DebugLog.h"
     50#endif
    4851
    4952#include "TEncEntropy.h"
     
    113116
    114117public:
     118#if DEBUGLOGOUT
     119  DebugLog                m_cDebug;
     120#endif
     121
    115122  /// copy parameters from encoder class
    116123  Void  init                ( TEncTop* pcEncTop );
     
    148155#if AMP_MRG
    149156#if HHI_INTERVIEW_SKIP
    150   Void xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bFullyRendered, Bool bUseMRG = false  ) ;
     157  Void xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bFullyRendered, Bool bUseMRG = false
     158#if FORCE_REF_VSP==1
     159    , Bool bForceRefVsp = false
     160#endif
     161    ) ;
    151162#else
    152163  Void  xCheckRDCostInter   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bUseMRG = false  );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp

    r77 r166  
    169169}
    170170
     171
     172#if FORCE_REF_VSP==1
     173Void TEncEntropy::encodeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     174{
     175  if ( pcCU->getSlice()->isIntra() || pcCU->getSlice()->getViewId() == 0 )
     176  {
     177    return;
     178  }
     179  if( bRD )
     180  {
     181    uiAbsPartIdx = 0;
     182  }
     183  m_pcEntropyCoderIf->codeVspFlag( pcCU, uiAbsPartIdx );
     184}
     185#endif
     186
    171187Void TEncEntropy::codeFiltCountBit(ALFParam* pAlfParam, Int64* ruiRate)
    172188{
     
    12851301    uiAbsPartIdx = 0;
    12861302  }
     1303
     1304#if FORCE_REF_VSP==1
     1305  if( pcCU->isVspMode( uiAbsPartIdx ) )
     1306  {
     1307    return;
     1308  }
     1309#endif
    12871310 
    12881311  PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx );
     
    13451368        {
    13461369          encodeRefFrmIdxPU ( pcCU, uiSubPartIdx, RefPicList( uiRefListIdx ) );
     1370#if VSP_MV_ZERO
     1371          Int iRefIdx = pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->getRefIdx(uiSubPartIdx);
     1372          if( !(pcCU->getSlice()->getViewId() && iRefIdx >= 0 && pcCU->getSlice()->getRefViewId( RefPicList( uiRefListIdx ), iRefIdx ) == NUM_VIEW_VSP) )
     1373          {
     1374#endif
    13471375          encodeMvdPU       ( pcCU, uiSubPartIdx, RefPicList( uiRefListIdx ) );
    13481376          encodeMVPIdxPU    ( pcCU, uiSubPartIdx, RefPicList( uiRefListIdx ) );
     1377#if VSP_MV_ZERO
     1378          }
     1379#endif
    13491380        }
    13501381      }
     
    16321663  {
    16331664    {
     1665#if FORCE_REF_VSP==1
     1666      if( !pcCU->isVspMode( uiAbsPartIdx ) )
     1667#endif
    16341668#if HHI_MPI
    16351669      if( !(pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N &&
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncEntropy.h

    r100 r166  
    115115 
    116116  virtual Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     117#if FORCE_REF_VSP==1
     118  virtual Void codeVspFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     119#endif
    117120  virtual Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    118121  virtual Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     
    251254  Void encodeSplitFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false );
    252255  Void encodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     256#if FORCE_REF_VSP==1
     257  Void encodeVspFlag           ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     258#endif
    253259  Void encodePUWise       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    254260  Void encodeInterDirPU   ( TComDataCU* pcSubCU, UInt uiAbsPartIdx  );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncGOP.cpp

    r102 r166  
    332332#endif
    333333
     334#if VSP_N
     335      Int NumberOfVspRefs = ( ( pcPic->getViewId()==0
     336#if VSP_TEXT_ONLY
     337                                || m_pcEncTop->getIsDepth()
     338#endif
     339#if VSP_SLICE_HEADER
     340                                || !m_pcEncTop->getUseVSP()
     341#endif
     342                              ) ? 0 : 1 );
     343      pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefs, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefs) ) );
     344      pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefs, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefs) ) );
     345#else
    334346      pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
    335347      pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
     348#endif
    336349
    337350      TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
     
    358371
    359372      std::vector<TComPic*> apcInterViewRefPics = tAppEncTop->getInterViewRefPics( m_pcEncTop->getViewId(), pcSlice->getPOC(), m_pcEncTop->getIsDepth(), pcSlice->getSPS() );
     373#if VSP_N
     374      Bool bUseVsp = (pcPic->getViewId()!=0);
     375#if VSP_TEXT_ONLY
     376      if( m_pcEncTop->getIsDepth() ) bUseVsp = false;
     377#endif
     378#if VSP_SLICE_HEADER
     379      if( !m_pcEncTop->getUseVSP() ) bUseVsp = false;
     380#endif
     381      pcSlice->setRefPicListMvc( rcListPic, apcInterViewRefPics, bUseVsp ? m_pcEncTop->getVSPBuf() : NULL );
     382#else
    360383      pcSlice->setRefPicListMvc( rcListPic, apcInterViewRefPics );
     384#endif
     385#if VSP_SLICE_HEADER
     386      pcSlice->setVspFlag( bUseVsp );
     387#endif
    361388
    362389      //  Slice info. refinement
     
    11301157          m_pcSbacCoder->load( &pcSbacCoders[0] );
    11311158
     1159#if DEBUGLOGOUT
     1160        char fname[128];
     1161        sprintf(fname, "%sV%02d_%05d%s.csv", "Log", pcSlice->getViewId(), uiPOCCurr, pcSlice->getIsDepth() ? "depth":"text");
     1162        getSliceEncoder()->getCUEncoder()->m_cDebug.DebugLogFileOpen( fname );
     1163#endif
     1164
    11321165        pcSlice->setTileOffstForMultES( uiOneBitstreamPerSliceLength );
    11331166        if (!bEntropySlice)
     
    11401173          m_pcSliceEncoder->encodeSlice(pcPic, &nalu.m_Bitstream, pcSubstreamsOut); // nalu.m_Bitstream is only used for CAVLC tile position info.
    11411174        }
     1175
     1176#if DEBUGLOGOUT
     1177        getSliceEncoder()->getCUEncoder()->m_cDebug.DebugLogFileClose();
     1178#endif
    11421179
    11431180        {
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncGOP.h

    r101 r166  
    146146  Void freeAPS     (TComAPS* pAPS, TComSPS* pSPS);
    147147  Void allocAPS    (TComAPS* pAPS, TComSPS* pSPS);
     148
    148149protected:
    149150  Void encodeAPS   (TComAPS* pcAPS, TComOutputBitstream& APSbs, TComSlice* pcSlice);            //!< encode APS syntax elements
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSbac.cpp

    r101 r166  
    718718{
    719719  // get context function is here
     720#if FORCE_REF_VSP==1
     721  UInt uiSymbol = (pcCU->isSkipped( uiAbsPartIdx ) || pcCU->isVspMode( uiAbsPartIdx )) ? 1 : 0;
     722#else
    720723  UInt uiSymbol = pcCU->isSkipped( uiAbsPartIdx ) ? 1 : 0;
     724#endif
    721725  UInt uiCtxSkip = pcCU->getCtxSkipFlag( uiAbsPartIdx ) ;
    722726  m_pcBinIf->encodeBin( uiSymbol, m_cCUSkipFlagSCModel.get( 0, 0, uiCtxSkip ) );
     
    730734}
    731735
     736#if FORCE_REF_VSP==1
     737Void TEncSbac::codeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
     738{
     739  // get context function is here
     740  UInt uiSymbol = (UInt)pcCU->isVspMode( uiAbsPartIdx );
     741  UInt uiCtxSkip = pcCU->getCtxSkipFlag( uiAbsPartIdx ) ;
     742  m_pcBinIf->encodeBin( uiSymbol, m_cCUSkipFlagSCModel.get( 0, 0, uiCtxSkip ) );
     743  DTRACE_CABAC_VL( g_nSymbolCounter++ );
     744  DTRACE_CABAC_T( "\tVspFlag" );
     745  DTRACE_CABAC_T( "\tuiCtxSkip: ");
     746  DTRACE_CABAC_V( uiCtxSkip );
     747  DTRACE_CABAC_T( "\tuiSymbol: ");
     748  DTRACE_CABAC_V( uiSymbol );
     749  DTRACE_CABAC_T( "\n");
     750}
     751#endif
     752
    732753/** code merge flag
    733754 * \param pcCU
     
    764785  uiNumCand = pcCU->getSlice()->getMaxNumMergeCand();
    765786#if HHI_MPI
     787#if VSP_TEXT_ONLY
     788  TComDataCU* pcTextCU = pcCU->getSlice()->getSPS()->getUseMVI() ? pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ) : NULL;
     789  Int aiRefIdxVsp[2] = { pcTextCU ? pcTextCU->getCUMvField( RefPicList(0) )->getRefIdx( uiAbsPartIdx ) : -1,
     790                         pcTextCU ? pcTextCU->getCUMvField( RefPicList(1) )->getRefIdx( uiAbsPartIdx ) : -1 };
     791  const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE
     792    && !( aiRefIdxVsp[0] >= 0 && pcTextCU->getSlice()->getRefViewId( RefPicList(0), aiRefIdxVsp[0] ) == NUM_VIEW_VSP )
     793    && !( aiRefIdxVsp[1] >= 0 && pcTextCU->getSlice()->getRefViewId( RefPicList(1), aiRefIdxVsp[1] ) == NUM_VIEW_VSP );
     794#else
    766795  const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE;
     796#endif
    767797  if( bMVIAvailable )
    768798  {
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSbac.h

    r100 r166  
    202202  Void codeAlfCtrlFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    203203  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     204#if FORCE_REF_VSP==1
     205  Void codeVspFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     206#endif
    204207  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    205208  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSearch.cpp

    r133 r166  
    683683UInt TEncSearch::xPatternRefinement( TComPattern* pcPatternKey,
    684684                                    TComMv baseRefMv,
    685                                     Int iFrac, TComMv& rcMvFrac )
     685                                    Int iFrac, TComMv& rcMvFrac
     686#if VSP_MV_ZERO
     687                                   ,Bool bIsVsp
     688#endif
     689                                   )
    686690{
    687691  UInt  uiDist;
     
    699703  TComMv* pcMvRefine = (iFrac == 2 ? s_acMvRefineH : s_acMvRefineQ);
    700704 
     705#if VSP_MV_ZERO
     706  UInt iAround = ( bIsVsp )? 1:9;
     707  for (UInt i = 0; i < iAround; i++)
     708#else
    701709  for (UInt i = 0; i < 9; i++)
     710#endif
    702711  {
    703712    TComMv cMvTest = pcMvRefine[i];
     
    871880      {
    872881        m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
     882#if FORCE_REF_VSP==1
     883        if( pcCU->getSlice()->getViewId() != 0 )
     884#if VSP_TEXT_ONLY
     885        if( !pcCU->getSlice()->getSPS()->isDepth() )
     886#endif
     887          m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true );
     888#endif
    873889        m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
    874890      }
     
    27512767#if AMP_MRG
    27522768#if LG_RESTRICTEDRESPRED_M24766
    2753 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )
    2754 #else
    2755 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )
     2769Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG
     2770#if FORCE_REF_VSP==1
     2771                                 , Bool bForceRefVsp
     2772#endif
     2773                                 )
     2774#else
     2775Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG
     2776#if FORCE_REF_VSP==1
     2777                                 , Bool bForceRefVsp
     2778#endif
     2779                                 )
    27562780#endif
    27572781#else
     
    28132837#endif
    28142838
     2839#if FORCE_REF_VSP==1
     2840  if( bForceRefVsp )
     2841  {
     2842    assert( ePartSize == SIZE_2Nx2N );
     2843
     2844    //  Clear Motion Field
     2845    pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( TComMvField(), ePartSize, 0, pcCU->getDepth(0), 0 );
     2846    pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( TComMvField(), ePartSize, 0, pcCU->getDepth(0), 0 );
     2847    pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd    ( cMvZero,       ePartSize, 0, pcCU->getDepth(0), 0 );
     2848    pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd    ( cMvZero,       ePartSize, 0, pcCU->getDepth(0), 0 );
     2849
     2850    //pcCU->getCUMvField(REF_PIC_LIST_0)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_0), ePartSize, 0, pcCU->getDepth(0), 0 );
     2851    //pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_1), ePartSize, 0, pcCU->getDepth(0), 0 );
     2852
     2853    pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, 0, 0, pcCU->getDepth(0));
     2854    pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, 0, 0, pcCU->getDepth(0));
     2855    pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, 0, 0, pcCU->getDepth(0));
     2856    pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, 0, 0, pcCU->getDepth(0));
     2857
     2858    rpcPredYuv->copyFromPicYuv( pcCU->getPic()->getPicYuvSynth(), pcCU->getAddr(), pcCU->getZorderIdxInCU() );
     2859    setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X );
     2860
     2861    return;
     2862  }
     2863#endif
     2864
    28152865#if ZERO_MVD_EST
    28162866  Int           aiZeroMvdMvpIdx[2] = {-1, -1};
     
    28332883#if HHI_INTER_VIEW_MOTION_PRED
    28342884  Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     2885#endif
     2886
     2887#if VSP_MV_ZERO
     2888  bool bIsVsp = false;
     2889  //Bool bWholeCUCanBeSynthesized = false;
     2890  //Bool bSubCUCanBeSynthesized[4];
     2891  //if( pcCU->getSlice()->getViewId() )
     2892  //{
     2893  //  Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized;
     2894  //  pcCU->getPic()->checkSynthesisAvailability(/*rpcBestCU, */pcCU->getAddr(), pcCU->getZorderIdxInCU(), pcCU->getDepth(0), pbSubCUCanBeSynthesized); //KUBA SYNTH
     2895  //  Int  iSubCUCanBeSynthesizedCnt = 0;
     2896  //  for(Int i = 0; i < 4; i++)
     2897  //  {
     2898  //    if (bSubCUCanBeSynthesized[i])
     2899  //    {
     2900  //      iSubCUCanBeSynthesizedCnt ++;
     2901  //    }
     2902  //  }
     2903  //  if(iSubCUCanBeSynthesizedCnt == 4)
     2904  //  {
     2905  //    bWholeCUCanBeSynthesized = true;
     2906  //  }
     2907  //}
    28352908#endif
    28362909
     
    28572930    for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT;
    28582931    UInt          uiBitsTempL0[MAX_NUM_REF];
     2932
    28592933#if LG_RESTRICTEDRESPRED_M24766
    28602934    Int iPUResiPredShift[4] = {0, 0, 0, 0};
     
    28852959      for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ )
    28862960      {
     2961#if VSP_MV_ZERO
     2962        bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP);
     2963        //if( bIsVsp && !bWholeCUCanBeSynthesized )
     2964        //{
     2965        //  continue;
     2966        //}
     2967#endif
    28872968#if LG_RESTRICTEDRESPRED_M24766
    28882969        if( pcCU->getResPredFlag( 0 ))
     
    29082989          if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--;
    29092990        }
     2991#if VSP_MV_ZERO
     2992        if( bIsVsp )
     2993        {
     2994          aaiMvpIdx[iRefList][iRefIdxTemp] = -1;
     2995          aaiMvpNum[iRefList][iRefIdxTemp] = -1;
     2996          cMvPred[iRefList][iRefIdxTemp].setZero();
     2997        }
     2998        else
     2999        {
     3000#endif
    29103001#if H0111_MVD_L1_ZERO
    29113002#if ZERO_MVD_EST
     
    29373028#else
    29383029        uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS];
     3030#endif
     3031#if VSP_MV_ZERO
     3032        } // if( bIsVsp )
    29393033#endif
    29403034#if ZERO_MVD_EST
     
    29733067              else
    29743068              {
     3069#if VSP_MV_ZERO
     3070                if( pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP )
     3071                {
     3072                  cMvTemp[1][iRefIdxTemp].setZero();
     3073                  uiCostTemp = 0;
     3074                }
     3075                else
     3076                {
     3077#endif
    29753078                cMvTemp[1][iRefIdxTemp] = cMvTemp[0][pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)];
    29763079                uiCostTemp = uiCostTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)];
    29773080                /*first subtract the bit-rate part of the cost of the other list*/
    29783081                uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)] );
     3082#if VSP_MV_ZERO
     3083                }
     3084#endif
    29793085              }
    29803086              /*correct the bit-rate part of the current ref*/
     
    29863092            else
    29873093            {
     3094#if VSP_MV_ZERO
     3095              xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp );
     3096#else
    29883097              xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
     3098#endif
    29893099            }
    29903100        }
     
    29983108          else
    29993109          {
     3110#if VSP_MV_ZERO
     3111            xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp );
     3112#else
    30003113            xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
     3114#endif
    30013115          }       
    30023116        }
    30033117#else
    30043118        xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp );
     3119#endif
     3120#if VSP_MV_ZERO
     3121        if( bIsVsp )
     3122        {
     3123          cMvPred[iRefList][iRefIdxTemp].setZero();
     3124        }
     3125        else
     3126        {
    30053127#endif
    30063128        xCopyAMVPInfo(pcCU->getCUMvField(eRefPicList)->getAMVPInfo(), &aacAMVPInfo[iRefList][iRefIdxTemp]); // must always be done ( also when AMVP_MODE = AM_NONE )
     
    30093131          xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp);
    30103132        }
     3133#if VSP_MV_ZERO
     3134        }
     3135#endif
    30113136
    30123137        if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag())
     
    30883213      if(pcCU->getSlice()->getMvdL1ZeroFlag())
    30893214      {
     3215#if VSP_MV_ZERO
     3216        bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, bestBiPRefIdxL1) == NUM_VIEW_VSP);
     3217
     3218        if( bIsVsp )
     3219        {
     3220          cMvPredBi[1][bestBiPRefIdxL1].setZero();
     3221        }
     3222        else
     3223        {
     3224#endif
    30903225        xCopyAMVPInfo(&aacAMVPInfo[1][bestBiPRefIdxL1], pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo());
    30913226        pcCU->setMVPIdxSubParts( bestBiPMvpL1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
    30923227        aaiMvpIdxBi[1][bestBiPRefIdxL1] = bestBiPMvpL1;
    30933228        cMvPredBi[1][bestBiPRefIdxL1]   = pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo()->m_acMvCand[bestBiPMvpL1];
     3229#if VSP_MV_ZERO
     3230        }
     3231#endif
    30943232
    30953233        cMvBi[1] = cMvPredBi[1][bestBiPRefIdxL1];
     
    31093247        }
    31103248
     3249#if VSP_MV_ZERO
     3250        if( !bIsVsp )
     3251        {
     3252#endif
    31113253#if HHI_INTER_VIEW_MOTION_PRED
    31123254        uiMotBits[1] += m_auiMVPIdxCost[aaiMvpIdxBi[1][bestBiPRefIdxL1]][iNumAMVPCands];
    31133255#else
    31143256        uiMotBits[1] += m_auiMVPIdxCost[aaiMvpIdxBi[1][bestBiPRefIdxL1]][AMVP_MAX_NUM_CANDS];
     3257#endif
     3258#if VSP_MV_ZERO
     3259        }
    31153260#endif
    31163261
     
    31683313        for ( Int iRefIdxTemp = iRefStart; iRefIdxTemp <= iRefEnd; iRefIdxTemp++ )
    31693314        {
     3315#if VSP_MV_ZERO
     3316          bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP);
     3317          //if( bIsVsp && !bWholeCUCanBeSynthesized )
     3318          //{
     3319          //  continue;
     3320          //}
     3321#endif
    31703322          uiBitsTemp = uiMbBits[2] + uiMotBits[1-iRefList];
    31713323          if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 )
     
    31743326            if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--;
    31753327          }
     3328#if VSP_MV_ZERO
     3329          if( !bIsVsp )
     3330          {
     3331#endif
    31763332#if HHI_INTER_VIEW_MOTION_PRED
    31773333          uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][iNumAMVPCands];
    31783334#else
    31793335          uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS];
     3336#endif
     3337#if VSP_MV_ZERO
     3338          }
    31803339#endif
    31813340#if LG_RESTRICTEDRESPRED_M24766
     
    32113370#endif
    32123371          // call ME
     3372#if VSP_MV_ZERO
     3373          xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPredBi[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp, true );
     3374#else
    32133375          xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPredBi[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp, true );
     3376#endif
     3377#if VSP_MV_ZERO
     3378          if( !bIsVsp )
     3379          {
     3380#endif
    32143381          if ( pcCU->getAMVPMode(uiPartAddr) == AM_EXPL )
    32153382          {
     
    32173384            xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPredBi[iRefList][iRefIdxTemp], aaiMvpIdxBi[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp);
    32183385          }
    3219          
     3386#if VSP_MV_ZERO
     3387          }
     3388#endif
     3389
    32203390          if ( uiCostTemp < uiCostBi )
    32213391          {
     
    32493419          if ( uiCostBi <= uiCost[0] && uiCostBi <= uiCost[1] && pcCU->getAMVPMode(uiPartAddr) == AM_EXPL )
    32503420          {
     3421#if VSP_MV_ZERO
     3422            bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdxBi[0]) == NUM_VIEW_VSP);
     3423
     3424            if( !bIsVsp )
     3425            {
     3426#endif
    32513427            xCopyAMVPInfo(&aacAMVPInfo[0][iRefIdxBi[0]], pcCU->getCUMvField(REF_PIC_LIST_0)->getAMVPInfo());
    32523428            xCheckBestMVP(pcCU, REF_PIC_LIST_0, cMvBi[0], cMvPredBi[0][iRefIdxBi[0]], aaiMvpIdxBi[0][iRefIdxBi[0]], uiBits[2], uiCostBi);
     3429#if VSP_MV_ZERO
     3430            }
     3431#endif
    32533432#if H0111_MVD_L1_ZERO
    32543433            if(!pcCU->getSlice()->getMvdL1ZeroFlag())
    32553434            {
    32563435#endif
     3436#if VSP_MV_ZERO
     3437              bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdxBi[1]) == NUM_VIEW_VSP);
     3438
     3439              if( !bIsVsp )
     3440              {
     3441#endif
    32573442              xCopyAMVPInfo(&aacAMVPInfo[1][iRefIdxBi[1]], pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo());
    32583443              xCheckBestMVP(pcCU, REF_PIC_LIST_1, cMvBi[1], cMvPredBi[1][iRefIdxBi[1]], aaiMvpIdxBi[1][iRefIdxBi[1]], uiBits[2], uiCostBi);
     3444#if VSP_MV_ZERO
     3445              }
     3446#endif
    32593447#if H0111_MVD_L1_ZERO
    32603448            }
     
    34173605      pcCU->setInterDirSubParts( 3, uiPartAddr, iPartIdx, pcCU->getDepth(0) );
    34183606     
     3607#if VSP_MV_ZERO
     3608      bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdxBi[0]) == NUM_VIEW_VSP);
     3609      if( !bIsVsp )
     3610      {
     3611#endif
    34193612      pcCU->setMVPIdxSubParts( aaiMvpIdxBi[0][iRefIdxBi[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
    34203613      pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdxBi[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
     3614#if VSP_MV_ZERO
     3615      }
     3616      bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdxBi[1]) == NUM_VIEW_VSP);
     3617      if( !bIsVsp )
     3618      {
     3619#endif
    34213620      pcCU->setMVPIdxSubParts( aaiMvpIdxBi[1][iRefIdxBi[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
    34223621      pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdxBi[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
     3622#if VSP_MV_ZERO
     3623      }
     3624#endif
    34233625
    34243626      uiMEBits = uiBits[2];
     
    34353637      pcCU->setInterDirSubParts( 1, uiPartAddr, iPartIdx, pcCU->getDepth(0) );
    34363638     
     3639#if VSP_MV_ZERO
     3640      bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdx[0]) == NUM_VIEW_VSP);
     3641      if( !bIsVsp )
     3642      {
     3643#endif
    34373644      pcCU->setMVPIdxSubParts( aaiMvpIdx[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
    34383645      pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
     3646#if VSP_MV_ZERO
     3647      }
     3648#endif
    34393649
    34403650      uiMEBits = uiBits[0];
     
    34513661      pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) );
    34523662     
     3663#if VSP_MV_ZERO
     3664      bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdx[1]) == NUM_VIEW_VSP);
     3665      if( !bIsVsp )
     3666      {
     3667#endif
    34533668      pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
    34543669      pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
     3670#if VSP_MV_ZERO
     3671      }
     3672#endif
    34553673
    34563674      uiMEBits = uiBits[1];
     
    38884106}
    38894107
     4108#if VSP_MV_ZERO
     4109Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, Bool bIsVsp, UInt& ruiBits, UInt& ruiCost, Bool bBi  )
     4110#else
    38904111Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, UInt& ruiBits, UInt& ruiCost, Bool bBi  )
     4112#endif
    38914113{
    38924114  UInt          uiPartAddr;
     
    39014123  m_iSearchRange = m_aaiAdaptSR[eRefPicList][iRefIdxPred];
    39024124 
     4125#if VSP_MV_ZERO
     4126  Int           iSrchRng      = ( bIsVsp ? 0 : ( bBi ? m_bipredSearchRange : m_iSearchRange ) );
     4127#else
    39034128  Int           iSrchRng      = ( bBi ? m_bipredSearchRange : m_iSearchRange );
     4129#endif
    39044130  TComPattern*  pcPatternKey  = pcCU->getPattern        ();
    39054131 
     
    39474173  m_pcRdCost->setCostScale  ( 2 );
    39484174
     4175#if VSP_MV_ZERO
     4176  if( !bIsVsp )
     4177#endif
    39494178#if HHI_INTER_VIEW_MOTION_PRED
    39504179  { // init inter-view regularization
     
    39654194  }
    39664195#endif
     4196#if VSP_MV_ZERO
     4197  else { // bIsVsp
     4198    m_pcRdCost->setMultiviewReg( 0 );
     4199  }
     4200#endif
    39674201
    39684202  setWpScalingDistParam( pcCU, iRefIdxPred, eRefPicList );
    39694203  //  Do integer search
     4204#if VSP_MV_ZERO
     4205  if ( !m_iFastSearch || bBi || bIsVsp )
     4206#else
    39704207  if ( !m_iFastSearch || bBi )
     4208#endif
    39714209  {
    39724210    xPatternSearch      ( pcPatternKey, piRefY, iRefStride, &cMvSrchRngLT, &cMvSrchRngRB, rcMv, ruiCost );
     
    39794217 
    39804218  m_pcRdCost->getMotionCost( 1, 0 );
     4219
    39814220#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    39824221  if( ! pcCU->getSlice()->getIsDepth() )
     
    39884227    xPatternSearchFracDIF( pcCU, pcPatternKey, piRefY, iRefStride, &rcMv, cMvHalf, cMvQter, ruiCost
    39894228                          ,bBi
     4229#if VSP_MV_ZERO
     4230                          ,bIsVsp
     4231#endif
    39904232                          );
    39914233  }
     
    40064248    ruiCost += m_pcRdCost->getCost( uiMvBits );
    40074249#endif
    4008  
     4250
     4251#if VSP_MV_ZERO
     4252  if( bIsVsp ) {
     4253    uiMvBits = 0; // vector zero & not output
     4254    assert( rcMv.getHor()==0 && rcMv.getVer()==0 );
     4255  }
     4256#endif
     4257
    40094258  ruiBits      += uiMvBits;
    40104259  ruiCost       = (UInt)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) );
     
    43044553                                       UInt& ruiCost
    43054554                                       ,Bool biPred
     4555#if VSP_MV_ZERO
     4556                                       ,Bool bIsVsp
     4557#endif
    43064558                                       )
    43074559{
     
    43224574  rcMvHalf = *pcMvInt;   rcMvHalf <<= 1;    // for mv-cost
    43234575  TComMv baseRefMv(0, 0);
    4324   ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 2, rcMvHalf   );
     4576  ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 2, rcMvHalf
     4577#if VSP_MV_ZERO
     4578                                   ,bIsVsp
     4579#endif
     4580    );
    43254581 
    43264582  m_pcRdCost->setCostScale( 0 );
     
    43324588  rcMvQter = *pcMvInt;   rcMvQter <<= 1;    // for mv-cost
    43334589  rcMvQter += rcMvHalf;  rcMvQter <<= 1;
    4334   ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter );
     4590  ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter
     4591#if VSP_MV_ZERO
     4592                                   ,bIsVsp
     4593#endif
     4594    );
    43354595}
    43364596
     
    43674627#endif
    43684628  //  No residual coding : SKIP mode
    4369   if ( ePredMode == MODE_SKIP && bSkipRes )
     4629  if ( (ePredMode == MODE_SKIP && bSkipRes)
     4630#if FORCE_REF_VSP==1
     4631    || ePredMode == MODE_SYNTH
     4632#endif
     4633    )
    43704634  {
    43714635    rpcYuvResi->clear();
     
    57376001    m_pcEntropyCoder->resetBits();
    57386002    m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true);
     6003#if FORCE_REF_VSP==1
     6004    if( pcCU->getSlice()->getViewId() != 0 )
     6005#if VSP_TEXT_ONLY
     6006    if( !pcCU->getSlice()->getSPS()->isDepth() )
     6007#endif
     6008      m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true );
     6009#endif
    57396010    m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, 0, true);
    57406011#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    57436014    ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
    57446015  }
     6016#if FORCE_REF_VSP==1
     6017  else if( pcCU->isVspMode( 0 ) )
     6018  {
     6019    m_pcEntropyCoder->resetBits();
     6020    m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
     6021    m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true );
     6022    ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
     6023  }
     6024#endif
    57456025  else
    57466026  {
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSearch.h

    r100 r166  
    144144  UInt  xPatternRefinement( TComPattern* pcPatternKey,
    145145                           TComMv baseRefMv,
    146                            Int iFrac, TComMv& rcMvFrac );
     146                           Int iFrac, TComMv& rcMvFrac
     147#if VSP_MV_ZERO
     148                          ,Bool bIsVsp
     149#endif
     150                          );
    147151 
    148152  typedef struct
     
    197201#if AMP_MRG
    198202                                 ,Bool        bUseMRG = false
     203#endif
     204#if FORCE_REF_VSP==1
     205                                 ,Bool        bForceRefVsp = false
    199206#endif
    200207                                );
     
    486493                                    Int           iRefIdxPred,
    487494                                    TComMv&       rcMv,
     495#if VSP_MV_ZERO
     496                                    Bool          bIsVsp,
     497#endif
    488498                                    UInt&         ruiBits,
    489499                                    UInt&         ruiCost,
     
    531541                                    UInt&         ruiCost
    532542                                   ,Bool biPred
     543#if VSP_MV_ZERO
     544                                   ,Bool bIsVsp
     545#endif
    533546                                   );
    534547 
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncTop.cpp

    r105 r166  
    7979  m_pcBitCounters          = NULL;
    8080  m_pcRdCosts              = NULL;
     81
     82#if VSP_N
     83  m_pcPicVSP = NULL;
     84  m_pcPicAvail = NULL;
     85#endif
     86
     87#if VSP_SLICE_HEADER
     88  m_bUseVSP = false;
     89#endif
     90
    8191}
    8292
     
    184194  }
    185195#endif
     196
     197#if VSP_N
     198  m_pcPicVSP = new TComPic;
     199  m_pcPicVSP->create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     200  //m_pcPicVSP->getCurrSlice()->setViewId( this->getViewId() );
     201  m_pcPicVSP->getCurrSlice()->setViewId( NUM_VIEW_VSP );
     202  m_pcPicVSP->getCurrSlice()->setViewOrderIdx( m_iViewOrderIdx );
     203
     204  m_pcPicAvail = new TComPic;
     205  m_pcPicAvail->create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
     206  m_pcPicAvail->getCurrSlice()->setViewId( 99 );
     207  m_pcPicAvail->getCurrSlice()->setViewOrderIdx( m_iViewOrderIdx );
     208#endif
     209
    186210}
    187211
     
    325349  }
    326350 
     351#if VSP_N
     352  if( m_pcPicVSP )
     353  {
     354    m_pcPicVSP->destroy();
     355    delete m_pcPicVSP;
     356    m_pcPicVSP = NULL;
     357  }
     358  if( m_pcPicAvail )
     359  {
     360    m_pcPicAvail->destroy();
     361    delete m_pcPicAvail;
     362    m_pcPicAvail = NULL;
     363  }
     364#endif
     365
    327366  return;
    328367}
     
    391430
    392431  m_iMaxRefPicNum = 0;
     432
     433#if VSP_N
     434  m_pcPicVSP->setCurrSliceIdx( 0 );
     435  m_pcPicVSP->getCurrSlice()->setSPS( this->getSPS() );
     436  m_pcPicVSP->getCurrSlice()->setPPS( this->getPPS() );
     437  m_pcPicVSP->getCurrSlice()->setPPSId( this->getPPS()->getPPSId() );
     438  //initialize the motion vector field with zeros - How about the RefIdx ????
     439  //IS THIS REALLY NECESSARY ????
     440  for ( int i=0; i<m_pcPicVSP->getPicSym()->getNumberOfCUsInFrame(); i++ )
     441  {
     442    m_pcPicVSP->getPicSym()->getCU(i)->getCUMvField(RefPicList(0))->clearMvField();
     443    m_pcPicVSP->getPicSym()->getCU(i)->getCUMvField(RefPicList(1))->clearMvField();
     444  }
     445#if DEPTH_MAP_GENERATION
     446#if !QC_MULTI_DIS_CAN
     447  // add extra pic buffers
     448  Bool  bNeedPrdDepthMapBuf = ( m_uiPredDepthMapGeneration > 0 );
     449  if( bNeedPrdDepthMapBuf && !m_pcPicVSP->getPredDepthMap() )
     450  {
     451    m_pcPicVSP->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) );
     452    m_cDepthMapGenerator.clearDepthMap( m_pcPicVSP );
     453  }
     454#endif
     455#endif
     456  m_pcPicAvail->setCurrSliceIdx( 0 );
     457  m_pcPicAvail->getCurrSlice()->setSPS( this->getSPS() );
     458  m_pcPicAvail->getCurrSlice()->setPPS( this->getPPS() );
     459  m_pcPicAvail->getCurrSlice()->setPPSId( this->getPPS()->getPPSId() );
     460  //initialize the motion vector field with zeros - How about the RefIdx ????
     461  //IS THIS REALLY NECESSARY ????
     462  for ( int i=0; i<m_pcPicAvail->getPicSym()->getNumberOfCUsInFrame(); i++ )
     463  {
     464    m_pcPicAvail->getPicSym()->getCU(i)->getCUMvField(RefPicList(0))->clearMvField();
     465    m_pcPicAvail->getPicSym()->getCU(i)->getCUMvField(RefPicList(1))->clearMvField();
     466  }
     467#if DEPTH_MAP_GENERATION
     468#if !QC_MULTI_DIS_CAN
     469  // add extra pic buffers
     470  bNeedPrdDepthMapBuf = ( m_uiPredDepthMapGeneration > 0 );
     471  if( bNeedPrdDepthMapBuf && !m_pcPicVSP->getPredDepthMap() )
     472  {
     473    m_pcPicAvail->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) );
     474    m_cDepthMapGenerator.clearDepthMap( m_pcPicAvail );
     475  }
     476#endif
     477#endif
     478#endif
    393479}
    394480
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncTop.h

    r56 r166  
    145145  TEncAnalyze             m_cAnalyzeB;
    146146
     147#if VSP_N
     148  TComPic*                m_pcPicVSP;                     ///< view synthesis prediction buffer for current POC to be coded
     149  TComPic*                m_pcPicAvail;
     150#endif
     151
     152#if VSP_SLICE_HEADER
     153  Bool                    m_bUseVSP;
     154#endif
     155
    147156protected:
    148157  Void  xGetNewPicBuffer  ( TComPic*& rpcPic );           ///< get picture buffer which will be processed
     
    237246  TComResidualGenerator*  getResidualGenerator  () { return  &m_cResidualGenerator;   }
    238247#endif
     248#if VSP_N
     249  TComPic*                getVSPBuf             () { return m_pcPicVSP; }
     250  TComPic*                getVSPAvailBuf        () { return m_pcPicAvail; }
     251#endif
     252
     253#if VSP_SLICE_HEADER
     254  Void                    setUseVSP   ( Bool val ) { m_bUseVSP = val; }
     255  Bool                    getUseVSP             () { return m_bUseVSP; }
     256#endif
    239257
    240258  // -------------------------------------------------------------------------------------------------------------------
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenFilter.cpp

    r56 r166  
    11541154}
    11551155
     1156#if NTT_SUBPEL
     1157// Convert luma sample
     1158Void TRenFilter::sampleConv( Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride, Pel* pcDepthPlaneData, Int iDepthStride, Int** ppiFposLUT )
     1159{
     1160  TRenInterpFilter cFilter;
     1161
     1162  xDistributeArrayOnDepthCondition  ( pcInputPlaneData, iInputStride, 1 , 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 1, 1, pcDepthPlaneData, iDepthStride, 1, 1, ppiFposLUT);
     1163  cFilter.xCTI_FilterQuarter0Hor    ( pcInputPlaneData, iInputStride, 1, iInputWidth, iHeight, iOutputStride, 1, pcOutputPlaneData, pcDepthPlaneData, iDepthStride, 1, ppiFposLUT );
     1164  cFilter.xCTI_FilterHalfHor        ( pcInputPlaneData, iInputStride, 1, iInputWidth, iHeight, iOutputStride, 1, pcOutputPlaneData, pcDepthPlaneData, iDepthStride, 1, ppiFposLUT );
     1165  cFilter.xCTI_FilterQuarter1Hor    ( pcInputPlaneData, iInputStride, 1, iInputWidth, iHeight, iOutputStride, 1, pcOutputPlaneData, pcDepthPlaneData, iDepthStride, 1, ppiFposLUT );
     1166}
     1167
     1168Void TRenFilter::sampleCVerUp( Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride  )
     1169{
     1170  xDistributeArray( pcInputPlaneData-3, iInputStride, 1, 1, iInputWidth+6, iHeight, pcOutputPlaneData              -3, iOutputStride, 1, 2 );
     1171  xInterpVerChroma( pcInputPlaneData-3, iInputStride, 1, 1, iInputWidth+6, iHeight, pcOutputPlaneData+iOutputStride-3, iOutputStride, 1, 2, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
     1172}
     1173
     1174Void TRenFilter::sampleCConv( Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride, Pel* pcDepthPlaneData, Int iDepthStride, Int** ppiFposLUT )
     1175{
     1176  // assume quater resolution depth
     1177  xDistributeArrayOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 1, 1, pcDepthPlaneData, iDepthStride, 2, 2, ppiFposLUT);
     1178  xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 1, 1, pcDepthPlaneData, iDepthStride, 2, 2, ppiFposLUT, 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA0 );
     1179  xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 1, 1, pcDepthPlaneData, iDepthStride, 2, 2, ppiFposLUT, 2, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
     1180  xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 1, 1, pcDepthPlaneData, iDepthStride, 2, 2, ppiFposLUT, 3, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA1 );
     1181}
     1182
     1183Void TRenFilter::sampleCConvHorUp( Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride, Pel* pcDepthPlaneData, Int iDepthStride, Int** ppiFposLUT )
     1184{
     1185  xDistributeArrayOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT);
     1186  xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 1, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT0 );
     1187  xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 2, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA0 );
     1188  xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 3, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT1 );
     1189
     1190  pcOutputPlaneData++; pcDepthPlaneData++;
     1191  xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 0, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL );
     1192  xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 1, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT2 );
     1193  xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 2, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA1 );
     1194  xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 3, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT3 );
     1195}
     1196#endif
    11561197
    11571198// Down Sampling
     
    12241265  }
    12251266}
     1267
     1268#if NTT_SUBPEL
     1269Void TRenFilter::xDistributeArrayOnDepthCondition(Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY, Pel* pcDep, Int iDepStride, Int iDepStepX, Int iDepStepY, Int** ppiFposLUT)
     1270{
     1271  iDstStride *= iDstStepY;
     1272  iSrcStride *= iSrcStepY;
     1273  iDepStride *= iDepStepY;
     1274
     1275  for (Int iYPos = 0; iYPos < iHeight; iYPos++ )
     1276  {
     1277    Pel* pcCurDst = pcDst;
     1278    Pel* pcCurSrc = pcSrc;
     1279    Pel* pcCurDep = pcDep;
     1280
     1281    for (Int iXPos = 0; iXPos < iWidth; iXPos ++)
     1282    {
     1283      if( ppiFposLUT[0][ *pcCurDep ] == 0 )
     1284      {
     1285        *pcCurDst = *pcCurSrc;
     1286      }
     1287      pcCurDst += iDstStepX;
     1288      pcCurSrc += iSrcStepX;
     1289      pcCurDep += iDepStepX;
     1290    }
     1291    pcDst  += iDstStride;
     1292    pcSrc  += iSrcStride;
     1293    pcDep  += iDepStride;
     1294  }
     1295}
     1296
     1297Void TRenFilter::xInterpHorChromaOnDepthCondition( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, Pel* piDep, Int iDepStride, Int iDepStepX, Int iDepStepY, Int** ppiFposLUT, Int iTargetFpos, FpChromaIntFilt fpFilter )
     1298{
     1299  Int   iSum;
     1300  Pel*  piSrcTmpP;
     1301  Pel*  piSrcTmpN;
     1302  Pel*  piSrcTmp;
     1303
     1304  Int   iDepX;
     1305
     1306  TRenInterpFilter cFilter;
     1307  for ( Int y = 0; y < iHeight; y++ )
     1308  {
     1309    piSrcTmpP = piSrc - iSrcStepX;
     1310    piSrcTmpN = piSrc - iSrcStepX*2;
     1311    iDepX = 0;
     1312    for ( Int x = 0; x < iWidth; x++ )
     1313    {
     1314#if 0 // NTT bugfix
     1315      if( abs(ppiFposLUT[0][ piDep[iDepX] ]) == iTargetFpos )
     1316#else
     1317      if( ppiFposLUT[0][ piDep[iDepX] ] == iTargetFpos || ppiFposLUT[0][ piDep[iDepX] ]+4 == iTargetFpos )
     1318#endif
     1319      {
     1320        piSrcTmp = ppiFposLUT[0][ piDep[ iDepX ] ] >= 0 ? piSrcTmpP : piSrcTmpN;
     1321        iSum      = (cFilter.*fpFilter)( piSrcTmp,  iSrcStepX );
     1322        piDst[x * iDstStepX ] =  Clip ((iSum +  32) >>  6 );
     1323      }
     1324      piSrcTmpP += iSrcStepX;
     1325      piSrcTmpN += iSrcStepX;
     1326      iDepX += iDepStepX;
     1327    }
     1328    piSrc += iSrcStride * iSrcStepY;
     1329    piDst += iDstStride * iDstStepY;
     1330    piDep += iDepStride * iDepStepY;
     1331  }
     1332}
     1333#endif
    12261334
    12271335
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenFilter.h

    r56 r166  
    103103  static Void sampleCUpHorUp    (Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight,      Pel* pcOutputPlaneData, Int iOutputStride );
    104104
     105#if NTT_SUBPEL
     106  static Void sampleConv        (Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride, Pel* pcDepthPlaneData, Int iDepthStride, Int** ppiFposLUT );
     107  static Void sampleCVerUp      (Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride );
     108  static Void sampleCConv       (Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride, Pel* pcDepthPlaneData, Int iDepthStride, Int** ppiFposLUT );
     109  static Void sampleCConvHorUp  (Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride, Pel* pcDepthPlaneData, Int iDepthStride, Int** ppiFposLUT );
     110#endif
     111
    105112  //// Down sampling (13 tap)
    106113
     
    131138  static Void xDistributeArray(Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY );
    132139
     140#if NTT_SUBPEL
     141  static Void xDistributeArrayOnDepthCondition(Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY, Pel* pcDep, Int iDepStride, Int iDepStepX, Int iDepStepY, Int** ppiFposLUT);
     142  static Void xInterpHorChromaOnDepthCondition(Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, Pel* piDep, Int iDepStride, Int iDepStepX, Int iDepStepY, Int** ppiFposLUT, Int iTargetFpos, FpChromaIntFilt fpFilter );
     143#endif
     144
    133145  // Binominal Filtering
    134146  static Pel  xFiltBinom3     (Pel* pcInputData, Int iStride );
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenInterpFilter.h

    r165 r166  
    7272  __inline Void xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst);
    7373  __inline Void xCTI_FilterQuarter1Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst);
    74  
     74
     75#if NTT_SUBPEL
     76  __inline Void xCTI_FilterHalfHor    (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst, Pel* piDep, Int iDepStride, Int iDepStep, Int** ppiFposLUT);
     77  __inline Void xCTI_FilterQuarter0Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst, Pel* piDep, Int iDepStride, Int iDepStep, Int** ppiFposLUT);
     78  __inline Void xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst, Pel* piDep, Int iDepStride, Int iDepStep, Int** ppiFposLUT);
     79#endif
     80
    7581  __inline Void xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst, Int iDstStridePel, Pel*& rpiDstPel );
    7682  __inline Void xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst );
     
    683689}
    684690
     691#if NTT_SUBPEL
     692__inline Void TRenInterpFilter::xCTI_FilterHalfHor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst, Pel* piDep, Int iDepStride, Int iDepStep, Int** ppiFposLUT)
     693{
     694  Pel*  piDst    = rpiDst;
     695  Int   iSum;
     696  Pel*  piSrcTmp;
     697  Int iSrcStep2 = iSrcStep*2;
     698  Int iSrcStep3 = iSrcStep*3;
     699  Int iSrcStep4 = iSrcStep*4;
     700  Int iSrcStep5 = iSrcStep*5;
     701  Int iSrcStep6 = iSrcStep*6;
     702  Int iSrcStep7 = iSrcStep*7;
     703
     704  Int iTmp0, iTmp1, iTmp2, iTmp3, iTmpA;
     705
     706  Pel *piSrcTmpP, *piSrcTmpN;
     707  Int iDepX;
     708
     709  for ( Int y = iHeight; y != 0; y-- )
     710  {
     711    piSrcTmpP = &piSrc[ -3*iSrcStep ];
     712    piSrcTmpN = &piSrc[ -4*iSrcStep ];
     713    iDepX = 0;
     714    for ( Int x = 0; x < iWidth; x++ )
     715    {
     716      // { -1,4,-11,40,40,-11,4,-1   }
     717#if 0 // NTT bugfix
     718      if( abs(ppiFposLUT[0][ piDep[ iDepX ] ]) == 2 )
     719#else
     720      if( ppiFposLUT[0][ piDep[ iDepX ] ] == 2 ||  ppiFposLUT[0][ piDep[ iDepX ] ] == -2 )
     721#endif
     722      {
     723        piSrcTmp = ppiFposLUT[0][ piDep[ iDepX ] ] > 0 ? piSrcTmpP : piSrcTmpN;
     724
     725        iTmp0 = piSrcTmp[        0]+piSrcTmp[iSrcStep7];
     726        iTmp1 = piSrcTmp[iSrcStep]+piSrcTmp[iSrcStep6];
     727        iTmp2 = piSrcTmp[iSrcStep2]+piSrcTmp[iSrcStep5];
     728        iTmp3 = piSrcTmp[iSrcStep3]+piSrcTmp[iSrcStep4];
     729
     730        iTmpA = (iTmp3 << 2) - iTmp2;
     731
     732        iSum  = (   iTmp1          << 2 )
     733              + (   iTmpA          << 3 )
     734              + (   iTmpA          << 1 )
     735              -    iTmp0 -  iTmp2;
     736
     737        piDst   [x * iDstStep] = Clip( (iSum +  32) >>  6 );
     738      }
     739      piSrcTmpP += iSrcStep;
     740      piSrcTmpN += iSrcStep;
     741      iDepX += iDepStep;
     742    }
     743    piSrc += iSrcStride;
     744    piDst += iDstStride;
     745    piDep += iDepStride;
     746  }
     747  return;
     748}
     749
     750__inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst, Pel* piDep, Int iDepStride, Int iDepStep, Int** ppiFposLUT)
     751{
     752  Pel*  piDst    = rpiDst;
     753  Int   iSum;
     754  Pel*  piSrcTmp;
     755  Int iSrcStep2 = iSrcStep*2;
     756  Int iSrcStep3 = iSrcStep*3;
     757  Int iSrcStep4 = iSrcStep*4;
     758  Int iSrcStep5 = iSrcStep*5;
     759  Int iSrcStep6 = iSrcStep*6;
     760  Int iSrcStep7 = iSrcStep*7;
     761
     762  Int iTmp1, iTmp2;
     763
     764  Pel *piSrcTmpP, *piSrcTmpN;
     765  Int iDepX;
     766
     767  for ( Int y = iHeight; y != 0; y-- )
     768  {
     769    piSrcTmpP = &piSrc[ -3*iSrcStep ];
     770    piSrcTmpN = &piSrc[ -4*iSrcStep ];
     771    iDepX = 0;
     772    for ( Int x = 0; x < iWidth; x++ )
     773    {
     774      // {-1,   4,  -10,  57,   19,  -7,   3,   -1  },
     775#if 0 // NTT bugfix
     776      if( abs(ppiFposLUT[0][ piDep[ iDepX ] ]) == 1 )
     777#else
     778      if( ppiFposLUT[0][ piDep[ iDepX ] ] == 1 ||  ppiFposLUT[0][ piDep[ iDepX ] ] == -3 )
     779#endif
     780      {
     781        piSrcTmp = ppiFposLUT[0][ piDep[ iDepX ] ] > 0 ? piSrcTmpP : piSrcTmpN;
     782
     783        iTmp1 = piSrcTmp[iSrcStep3] + piSrcTmp[iSrcStep5];
     784        iTmp2 = piSrcTmp[iSrcStep6] + piSrcTmp[iSrcStep4];
     785
     786        iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
     787               - ( ( piSrcTmp[iSrcStep2] - iTmp2 ) << 1 )
     788               + (  piSrcTmp[iSrcStep]             << 2 )
     789               - ( ( piSrcTmp[iSrcStep2] + iTmp1 ) << 3 )
     790               + (   piSrcTmp[iSrcStep4]           << 4 );
     791
     792        piDst   [x * iDstStep] = Clip(( (iSum +  32) >>  6 )+ piSrcTmp[iSrcStep3]);
     793      }
     794      piSrcTmpP += iSrcStep;
     795      piSrcTmpN += iSrcStep;
     796      iDepX += iDepStep;
     797    }
     798    piSrc += iSrcStride;
     799    piDst += iDstStride;
     800    piDep += iDepStride;
     801  }
     802  return;
     803}
     804
     805__inline Void TRenInterpFilter::xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst, Pel* piDep, Int iDepStride, Int iDepStep, Int** ppiFposLUT)
     806{
     807  Pel*  piDst    = rpiDst;
     808  Int   iSum;
     809  Pel*  piSrcTmp;
     810  Int iSrcStep2 = iSrcStep*2;
     811  Int iSrcStep3 = iSrcStep*3;
     812  Int iSrcStep4 = iSrcStep*4;
     813  Int iSrcStep5 = iSrcStep*5;
     814  Int iSrcStep6 = iSrcStep*6;
     815  Int iSrcStep7 = iSrcStep*7;
     816
     817  Int  iTmp1, iTmp2;
     818
     819  Pel *piSrcTmpP, *piSrcTmpN;
     820  Int iDepX;
     821
     822  for ( Int y = iHeight; y != 0; y-- )
     823  {
     824    piSrcTmpP = &piSrc[ -3*iSrcStep ];
     825    piSrcTmpN = &piSrc[ -4*iSrcStep ];
     826    iDepX = 0;
     827    for ( Int x = 0; x < iWidth; x++ )
     828    {
     829      // {-1,   3,  -7,  19,   57,  -10,   4,   -1  },
     830#if 0 // NTT bugfix
     831      if( abs(ppiFposLUT[0][ piDep[ iDepX ] ]) == 3 )
     832#else
     833      if( ppiFposLUT[0][ piDep[ iDepX ] ] == 3 ||  ppiFposLUT[0][ piDep[ iDepX ] ] == -1 )
     834#endif
     835      {
     836        piSrcTmp = ppiFposLUT[0][ piDep[ iDepX ] ] > 0 ? piSrcTmpP : piSrcTmpN;
     837
     838        iTmp1 = piSrcTmp[iSrcStep4] + piSrcTmp[iSrcStep2];
     839        iTmp2 = piSrcTmp[iSrcStep ] + piSrcTmp[iSrcStep3];
     840
     841        iSum  =  iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7]
     842              - ( ( piSrcTmp[iSrcStep5] - iTmp2 ) << 1 )
     843              + (   piSrcTmp[iSrcStep6]           << 2 )
     844              - ( ( piSrcTmp[iSrcStep5] + iTmp1 ) << 3 )
     845              + (   piSrcTmp[iSrcStep3]           << 4 );
     846     
     847        piDst   [x * iDstStep] = Clip( ((iSum +  32) >>  6) + piSrcTmp[iSrcStep4] );
     848      }
     849      piSrcTmpP += iSrcStep;
     850      piSrcTmpN += iSrcStep;
     851      iDepX += iDepStep;
     852    }
     853    piSrc += iSrcStride;
     854    piDst += iDstStride;
     855    piDep += iDepStride;
     856  }
     857  return;
     858}
     859#endif
     860
    685861__inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst)
    686862{
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenModel.cpp

    r101 r166  
    700700  }
    701701}
     702
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenSingleModel.cpp

    r100 r166  
    19431943}
    19441944#endif
     1945
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenTop.cpp

    r100 r166  
    127127}
    128128
     129#if NTT_SUBPEL
     130Void TRenTop::xConvertInputVideoSubpel( PelImage* pcOrgInputImage, PelImage* pcConvInputImage, PelImage* pcInputDepth, Bool bMirror )
     131{
     132  PelImagePlane*  pcOrgPlane;
     133  PelImagePlane*  pcConvPlane;
     134  PelImagePlane*  pcDepthPlane;
     135  PelImagePlane*  pcTmpPlane;
     136
     137  Int    ** ppiFposLUT = bMirror ? m_ppiFposLUTRightMirror : m_ppiFposLUTLeft;
     138
     139  AOT( m_iLog2SamplingFactor );
     140  AOF( m_iInterpolationMode == eRenInt8Tap2 );
     141
     142  pcDepthPlane = pcInputDepth->getPlane( 0 );
     143  pcTmpPlane = pcConvInputImage->getPlane( 0 );
     144
     145  AOF( m_bUVUp ); // Currently only m_bUVUp=true is supported
     146  for (UInt uiPlane = 1; uiPlane < 3; uiPlane++)
     147  {
     148    pcOrgPlane  = pcOrgInputImage ->getPlane(uiPlane);
     149    pcConvPlane = pcConvInputImage->getPlane(uiPlane);
     150
     151    if ( m_bUVUp )
     152    {
     153      TRenFilter::sampleCVerUp    (pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight()  , pcTmpPlane ->getPlaneData(), pcTmpPlane ->getStride() );
     154      TRenFilter::sampleCConvHorUp(pcTmpPlane->getPlaneData(), pcTmpPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight()*2, pcConvPlane->getPlaneData(), pcConvPlane->getStride(), pcDepthPlane->getPlaneData(), pcDepthPlane->getStride(), ppiFposLUT );
     155    }
     156    else
     157    {
     158      TRenFilter::sampleCConv     (pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight()*2, pcConvPlane->getPlaneData(), pcConvPlane->getStride(), pcDepthPlane->getPlaneData(), pcDepthPlane->getStride(), ppiFposLUT );
     159    }
     160  }
     161
     162  pcOrgPlane  = pcOrgInputImage ->getPlane(0);
     163  pcConvPlane = pcConvInputImage->getPlane(0);
     164  TRenFilter::sampleConv(pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride(), pcDepthPlane->getPlaneData(), pcDepthPlane->getStride(), ppiFposLUT);
     165}
     166
     167Void TRenTop::xConvertInputDepthSubpel( PelImage* pcOrgInputImage, PelImage* pcConvInputImage)
     168{
     169  PelImagePlane*  pcOrgPlane ;
     170  PelImagePlane*  pcConvPlane;
     171
     172  // Full Plane
     173  pcOrgPlane  = pcOrgInputImage ->getPlane(0);
     174  pcConvPlane = pcConvInputImage->getPlane(0);
     175
     176  AOT( m_iLog2SamplingFactor );
     177  AOF( m_iInterpolationMode == eRenInt8Tap2 );
     178
     179  TRenFilter::sampleHorUp(m_iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     180
     181  AOF( m_bUVUp );
     182  if ( !m_bUVUp ) //GT: depth down
     183  {
     184    // Quarter Plane
     185    PelImagePlane* pcTempPlane = new PelImagePlane(pcOrgInputImage->getPlane(0)->getWidth(), ( pcOrgInputImage->getPlane(0)->getHeight() >> 1), REN_LUMA_MARGIN );
     186
     187    TRenFilter::sampleVerDown2Tap13(pcOrgInputImage->getPlane(0), pcTempPlane, PICYUV_PAD);
     188    pcConvPlane = pcConvInputImage->getPlane(1);
     189
     190    if ( m_iLog2SamplingFactor == 0 )
     191    {
     192      TRenFilter::sampleHorDown2Tap13(pcTempPlane, pcConvPlane, 0 );
     193    }
     194    else
     195    {
     196      TRenFilter::sampleHorUp    ( m_iLog2SamplingFactor - 1, pcTempPlane->getPlaneData(), pcTempPlane->getStride(), pcTempPlane->getWidth(), pcTempPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     197    }
     198    delete pcTempPlane;
     199  }
     200}
     201#endif
     202
    129203Void TRenTop::xConvertInputDepth( PelImage* pcOrgInputImage, PelImage* pcConvInputImage)
    130204{
     
    193267}
    194268
     269#if NTT_SUBPEL
     270Void TRenTop::xConvertInputDataSubpel( PelImage* pcOrgInputImage, PelImage* pcOrgInputDepth, PelImage* pcConvInputImage, PelImage* pcConvInputDepth, Bool bMirror )
     271{
     272  //ToDo: remove unnecessary copying
     273  if ( bMirror )
     274  {
     275    m_pcTempImage->getPlane(0)->assign( pcOrgInputDepth->getPlane(0) );
     276    TRenFilter::mirrorHor( m_pcTempImage->getPlane(0) );
     277    m_pcTempImage->getPlane(0)->extendMargin();
     278    xConvertInputDepthSubpel( m_pcTempImage, pcConvInputDepth );
     279
     280    m_pcTempImage->assign( pcOrgInputImage );
     281    TRenFilter::mirrorHor( m_pcTempImage );
     282    m_pcTempImage->extendMargin();
     283    xConvertInputVideoSubpel( m_pcTempImage, pcConvInputImage, pcConvInputDepth, bMirror );
     284  }
     285  else
     286  {
     287    m_pcTempImage->getPlane(0)->assign( pcOrgInputDepth->getPlane(0) );
     288    m_pcTempImage->getPlane(0)->extendMargin();
     289    xConvertInputDepthSubpel( m_pcTempImage, pcConvInputDepth );
     290
     291    m_pcTempImage->assign( pcOrgInputImage );
     292    m_pcTempImage->extendMargin();
     293    xConvertInputVideoSubpel( m_pcTempImage, pcConvInputImage, pcConvInputDepth, bMirror );
     294  }
     295}
     296#endif
    195297
    196298Void TRenTop::xConvertOutputData( PelImage* pcOrgOutputImage, PelImage* pcConvOutputImage, Bool bMirror )
     
    229331}
    230332
     333#if VSP_N
     334Void TRenTop::xConvertOutputDataPlane0( PelImage* pcOrgOutputImage, PelImage* pcConvOutputImage, Bool bMirror )
     335{
     336  Int iLog2SamplingFactor = m_iLog2SamplingFactor;
     337
     338  PelImagePlane* pcOrgPlane  = pcOrgOutputImage ->getPlane(0);
     339  PelImagePlane* pcConvPlane = pcConvOutputImage->getPlane(0);
     340
     341  pcOrgPlane->extendMargin();
     342
     343  TRenFilter::sampleHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());
     344
     345  if ( bMirror )
     346  {
     347    TRenFilter::mirrorHor( pcConvOutputImage );
     348  }
     349
     350}
     351#endif
     352
    231353Void TRenTop::setShiftLUTs( Double** ppdShiftLUTLeft, Int** ppiShiftLUTLeft, Int** ppiBaseShiftLUTLeft, Double** ppdShiftLUTRight, Int** ppiShiftLUTRight, Int** ppiBaseShiftLUTRight,  Int iRelDistToLeft )
    232354{
     
    254376  }
    255377}
     378
     379#if NTT_SUBPEL
     380Void TRenTop::setFposLUTs( Int** ppiFposLUTLeft, Int** ppiFposLUTRight )
     381{
     382  m_ppiFposLUTLeft  = ppiFposLUTLeft;
     383  m_ppiFposLUTRight = ppiFposLUTRight;
     384
     385  if (  m_ppiFposLUTRight != NULL )
     386  {
     387    for( UInt uiPlane = 0; uiPlane < 2; uiPlane++)
     388    {
     389      for (UInt uiDepthValue = 0; uiDepthValue <= 256; uiDepthValue++)
     390      {
     391        m_ppiFposLUTRightMirror[uiPlane][uiDepthValue] = - m_ppiFposLUTRight[uiPlane][uiDepthValue];
     392      }
     393    }
     394  }
     395}
     396#endif
    256397
    257398Void TRenTop::extrapolateView( TComPicYuv* pcPicYuvVideo, TComPicYuv* pcPicYuvDepth, TComPicYuv* pcPicYuvSynthOut, Bool bRenderFromLeft )
     
    278419  xCutMargin        ( &cOutputImage );
    279420};
     421
     422#if VSP_N
     423Void TRenTop::extrapolateAvailabilityView( TComPicYuv* pcPicYuvVideo, TComPicYuv* pcPicYuvDepth, TComPicYuv* pcPicYuvSynthOut, TComPicYuv* pcPicYuvAvailOut, Bool bRenderFromLeft )
     424{
     425  AOF( m_bExtrapolate );
     426  AOF( bRenderFromLeft ? m_ppiShiftLUTLeft || m_ppdShiftLUTLeft : m_ppiShiftLUTRight || m_ppdShiftLUTRight );
     427  AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ());
     428  AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight());
     429
     430  PelImage cInputImage ( pcPicYuvVideo    );
     431  PelImage cInputDepth ( pcPicYuvDepth    , true);
     432  PelImage cOutputImage( pcPicYuvSynthOut );
     433  PelImage cFillImage  ( pcPicYuvAvailOut );
     434
     435  m_pcOutputImage->init();
     436  m_pcFilled     ->assign(REN_IS_HOLE);
     437
     438  xPreProcessDepth ( &cInputDepth,  &cInputDepth);
     439#if NTT_SUBPEL
     440  if( m_iInterpolationMode == eRenInt8Tap2 )
     441    xConvertInputDataSubpel(&cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft );
     442  else
     443    xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft );
     444#else
     445  xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft );
     446#endif
     447  xShiftPixels(m_pcInputImage, m_pcInputDepth, m_pcOutputImage, m_pcFilled, bRenderFromLeft);
     448  xRemBoundaryNoise ( m_pcOutputImage, m_pcFilled, m_pcOutputImage, bRenderFromLeft); // Erode
     449  xFillHoles        ( m_pcOutputImage, m_pcFilled, m_pcOutputImage, bRenderFromLeft);
     450  xConvertOutputData( m_pcOutputImage, &cOutputImage, !bRenderFromLeft );
     451  //if (!bRenderFromLeft)  TRenFilter::mirrorHor( &cFillImage );
     452  xConvertOutputDataPlane0( m_pcFilled, &cFillImage, !bRenderFromLeft );
     453  xPostProcessImage (&cOutputImage, &cOutputImage);
     454  xCutMargin        ( &cOutputImage );
     455};
     456#endif
    280457
    281458Void TRenTop::getUsedSamplesMap( TComPicYuv* pcPicYuvDepth, TComPicYuv* pcUsedSampleMap, Bool bRenderFromLeft )
     
    751928  {
    752929  case eRenIntFullPel:
     930#if NTT_SUBPEL
     931  case eRenInt8Tap2:
     932#endif
    753933    xShiftPlanePixelsFullPel( apcInPlane, pcDepthPlane, apcOutPlane, pcPlaneFilled, uiNumberOfPlanes);
    754934    break;
     
    8261006          }
    8271007          pcFilledData[iShiftedPos] = REN_IS_FILLED;
     1008
     1009#if NTT_SUBPEL
     1010          if(m_bInstantHoleFilling && (iDiff > 0) )
     1011          {
     1012            Int iRefPos = (iPrevShiftedPos == -1) ? iShiftedPos : iPrevShiftedPos;
     1013           
     1014            for (Int iCurPos = iPrevShiftedPos+1; iCurPos < iShiftedPos; iCurPos++)
     1015            {
     1016              for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
     1017              {
     1018                apcOutputData[uiCurPlane][iCurPos] =  apcOutputData[uiCurPlane][iRefPos];
     1019              }
     1020              pcFilledData[iCurPos] = REN_IS_FILLED;
     1021            }
     1022          }
     1023#endif
    8281024        }
    8291025        iPrevShiftedPos = iShiftedPos;
    8301026      }
    8311027    }
     1028#if NTT_SUBPEL
     1029    if( (iPrevShiftedPos+1) != iWidth )
     1030    {
     1031      for (Int iCurPos = iPrevShiftedPos+1; iCurPos < iWidth; iCurPos++)
     1032      {
     1033        for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
     1034        {
     1035          apcOutputData[uiCurPlane][iCurPos] =  apcOutputData[uiCurPlane][iPrevShiftedPos];
     1036        }
     1037        pcFilledData[iCurPos] = REN_IS_FILLED;
     1038      }
     1039    }
     1040#endif
    8321041    for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
    8331042    {
     
    14501659
    14511660    for( Int iXPos = iSourcePos + 1; iXPos <  iWidth; iXPos++)
    1452         {
     1661    {
    14531662      for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++)
    1454           {
     1663      {
    14551664        apcOutputData[uiCurPlane][iXPos] = apcInputData[uiCurPlane][iSourcePos];
    14561665      }
    1457             }
     1666    }
    14581667
    14591668    // Fill Left Gap
     
    14691678      {
    14701679        apcOutputData[uiCurPlane][iXPos] = apcInputData[uiCurPlane][iSourcePos];
    1471           }
    1472         }
     1680      }
     1681    }
    14731682
    14741683    // Go to next line
     
    20322241  m_ppiShiftLUTRightMirror[0] = new Int[257];
    20332242  m_ppiShiftLUTRightMirror[1] = new Int[257];
     2243
     2244#if NTT_SUBPEL
     2245  m_ppiFposLUTLeft   = 0;
     2246  m_ppiFposLUTRight  = 0;
     2247  m_ppiFposLUTRightMirror    = new Int*[2];
     2248  m_ppiFposLUTRightMirror[0] = new Int[257];
     2249  m_ppiFposLUTRightMirror[1] = new Int[257];
     2250#endif
    20342251
    20352252  m_aiShiftLUTCur    = 0;
     
    21162333  m_iHoleFillingMode = iHoleFillingMode;
    21172334
     2335#if NTT_SUBPEL
     2336  m_bInstantHoleFilling   = (m_iInterpolationMode == eRenInt8Tap || m_iInterpolationMode == eRenInt8Tap2 ) && (m_iHoleFillingMode != 0 );
     2337#else
    21182338  m_bInstantHoleFilling   = (m_iInterpolationMode == eRenInt8Tap ) && (m_iHoleFillingMode != 0 );
     2339#endif
    21192340
    21202341  // PostProcessing
     
    21542375    {
    21552376      m_aaiSubPelShift[uiEntry] = new Int[ iNumEntries ];
    2156         }
     2377    }
    21572378
    21582379    TRenFilter::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1);
     
    21842405  };
    21852406
     2407#if NTT_SUBPEL
     2408  if ( m_ppiFposLUTRightMirror != NULL )
     2409  {
     2410    delete[] m_ppiFposLUTRightMirror[0];
     2411    delete[] m_ppiFposLUTRightMirror[1];
     2412    delete[] m_ppiFposLUTRightMirror;
     2413  };
     2414#endif
     2415
    21862416  if (m_piInvZLUTLeft      != NULL ) delete[] m_piInvZLUTLeft   ;
    21872417  if (m_piInvZLUTLeft      != NULL ) delete[] m_piInvZLUTRight  ;
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenTop.h

    r56 r166  
    5050  // Interpolation Modes
    5151
     52#if NTT_SUBPEL
     53  enum { eRenIntFullPel = 0, eRenIntLinInt = 1, eRenIntLinReal = 2, eRenIntFEM = 3, eRenInt8Tap = 4, eRenInt8Tap2 = 5 };
     54#else
    5255  enum { eRenIntFullPel = 0, eRenIntLinInt = 1, eRenIntLinReal = 2, eRenIntFEM = 3, eRenInt8Tap = 4 };
     56#endif
    5357
    5458  // HoleFilling
     
    9397                           Int**    ppiBaseShiftLUTRight,
    9498                           Int      iRelDistLeft );
     99#if NTT_SUBPEL
     100  Void setFposLUTs      ( Int**    ppiFposLUTLeft, Int**    ppiFposLUTRight );
     101  Void setInterpolationMode ( Int iMode ) { m_iInterpolationMode = iMode; }
     102#endif
    95103
    96104  // View Synthesis
     
    99107                           TComPicYuv* pcPicYuvSynthOut,
    100108                           Bool bRenderFromLeft );
     109
     110#if VSP_N
     111  Void extrapolateAvailabilityView   ( TComPicYuv* pcPicYuvVideo,
     112                                       TComPicYuv* pcPicYuvDepth,
     113                                       TComPicYuv* pcPicYuvSynthOut,
     114                                       TComPicYuv* pcPicYuvAvailOut,
     115                                       Bool bRenderFromLeft );
     116#endif
    101117
    102118  Void interpolateView   ( TComPicYuv* pcPicYuvVideoLeft,
     
    166182  Void xConvertInputData         ( PelImage* pcOrgInputImage, PelImage* pcOrgInputDepth, PelImage* pcConvInputImage, PelImage* pcConvInputDepth, Bool bMirror);
    167183  Void xConvertOutputData        ( PelImage* pOrgOutputImage, PelImage* pConvOutputImage, Bool bMirror);
     184#if VSP_N
     185  Void xConvertOutputDataPlane0  ( PelImage* pOrgOutputImage, PelImage* pConvOutputImage, Bool bMirror);
     186#endif
     187#if NTT_SUBPEL
     188  Void xConvertInputDataSubpel   ( PelImage* pcOrgInputImage, PelImage* pcOrgInputDepth, PelImage* pcConvInputImage, PelImage* pcConvInputDepth, Bool bMirror);
     189  Void xConvertInputVideoSubpel  ( PelImage* pcOrgInputImage, PelImage* pcConvInputImage, PelImage* pcInputDepth, Bool bMirror );
     190  Void xConvertInputDepthSubpel  ( PelImage* pcOrgInputImage, PelImage* pcConvInputImage);
     191#endif
    168192
    169193  Void xGetDataPointers          ( PelImage*& rpcInputImage,  PelImage*& rpcOutputImage, PelImage*& rpcInputDepth, PelImage*& rpcOutputDepth, PelImage*& rpcFilled, Bool bRenderDepth );
     
    229253  Int**    m_ppiShiftLUTRightMirror; // For rendering the mirrored view
    230254  Int*     m_aiShiftLUTCur;
     255#if NTT_SUBPEL
     256  Int**    m_ppiFposLUTLeft;
     257  Int**    m_ppiFposLUTRight;
     258  Int**    m_ppiFposLUTRightMirror; // For rendering the mirrored view
     259#endif
    231260
    232261  // Look up tables Z
Note: See TracChangeset for help on using the changeset viewer.