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/App/TAppEncoder
Files:
3 edited

Legend:

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