Ignore:
Timestamp:
18 Jun 2013, 05:16:27 (11 years ago)
Author:
mediatek-htm
Message:

Integration of 3D-HEVC merge related coding tools:
Inter-view motion merge candidate
HHI_INTER_VIEW_MOTION_PRED
SAIT_IMPROV_MOTION_PRED_M24829, improved inter-view motion vector prediction
QC_MRG_CANS_B0048 , JCT3V-B0048, B0086, B0069
OL_DISMV_POS_B0069 , different pos for disparity MV candidate, B0069
MTK_INTERVIEW_MERGE_A0049 , second part
QC_AMVP_MRG_UNIFY_IVCAN_C0051
TEXTURE MERGING CANDIDATE , JCT3V-C0137

Notes: Two configurations are added:
PredDepthMapGen : 1
MultiviewMvPred : 7

From: yiwen.chen@… (MediaTek)

Location:
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp

    r446 r476  
    581581  WRITE_FLAG( 0, "sps_extension_flag" );
    582582#endif
     583
     584#if H_3D_IV_MERGE
     585  if( pcSPS->getViewIndex() || pcSPS->isDepth() )
     586  {
     587    WRITE_FLAG( 0, "base_view_flag" );
     588    if( pcSPS->isDepth() )
     589    {
     590      WRITE_FLAG( 1, "depth_flag" );
     591      WRITE_UVLC( pcSPS->getViewIndex(), "view_idx" );
     592    }
     593    else
     594    {
     595      WRITE_FLAG( 0, "depth_flag" );
     596      WRITE_UVLC( pcSPS->getViewIndex() - 1, "view_idx_minus1" );
     597      WRITE_UVLC( pcSPS->getPredDepthMapGeneration(), "Pdm_generation" );
     598      if( pcSPS->getPredDepthMapGeneration() )
     599      {
     600        WRITE_UVLC( pcSPS->getMultiviewMvPredMode(), "multi_view_mv_pred_mode" );
     601      }
     602    }
     603  }
     604  else
     605  {
     606    WRITE_FLAG( 1, "base_view_flag" );   
     607  }
     608#endif
    583609}
    584610
     
    10711097      xCodePredWeightTable( pcSlice );
    10721098    }
     1099#if H_3D_IV_MERGE
     1100    assert(pcSlice->getMaxNumMergeCand()<=MRG_MAX_NUM_CANDS_MEM);
     1101#else
    10731102    assert(pcSlice->getMaxNumMergeCand()<=MRG_MAX_NUM_CANDS);
     1103#endif
    10741104    if (!pcSlice->isIntra())
    10751105    {
     1106#if H_3D_IV_MERGE
     1107      WRITE_UVLC(((pcSlice->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE) == PDM_USE_FOR_MERGE? MRG_MAX_NUM_CANDS_MEM: MRG_MAX_NUM_CANDS) - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand");
     1108#else
    10761109      WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand");
     1110#endif
    10771111    }
    10781112    Int iCode = pcSlice->getSliceQp() - ( pcSlice->getPPS()->getPicInitQPMinus26() + 26 );
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCfg.h

    r446 r476  
    375375  TAppComCamPara* m_cameraParameters;
    376376 
     377#if H_3D_IV_MERGE
     378  UInt      m_uiPredDepthMapGeneration;
     379  UInt      m_uiMultiviewMvPredMode;
     380#endif
    377381#if H_3D_VSO
    378382  //====== View Synthesis Optimization ======
     
    926930  Void      setDispCoeff                    ( Double  d )   { m_dDispCoeff  = d; }
    927931#endif // H_3D_VSO
     932#if H_3D_IV_MERGE
     933  Void      setMultiviewMvPredMode              (UInt ui)   { m_uiMultiviewMvPredMode = ui;}
     934  Void      setPredDepthMapGeneration       ( UInt  u )      { m_uiPredDepthMapGeneration   = u; } 
     935
     936  UInt      getMultiviewMvPredMode          ()              { return m_uiMultiviewMvPredMode;}
     937#endif
    928938#endif // H_3D
    929939};
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCu.cpp

    r455 r476  
    12591259{
    12601260  assert( rpcTempCU->getSlice()->getSliceType() != I_SLICE );
     1261#if H_3D_IV_MERGE
     1262  TComMvField  cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
     1263  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
     1264#else
    12611265  TComMvField  cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
    12621266  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
     1267#endif
    12631268  Int numValidMergeCand = 0;
    12641269
     
    12841289  rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
    12851290
     1291#if H_3D_IV_MERGE
     1292  Int mergeCandBuffer[MRG_MAX_NUM_CANDS_MEM];
     1293#else
    12861294  Int mergeCandBuffer[MRG_MAX_NUM_CANDS];
     1295#endif
    12871296  for( UInt ui = 0; ui < rpcTempCU->getSlice()->getMaxNumMergeCand(); ++ui )
    12881297  {
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp

    r455 r476  
    4949#include <time.h>
    5050#include <math.h>
    51 
     51#if H_3D_IV_MERGE
     52#include "../../App/TAppEncoder/TAppEncTop.h"
     53#endif
    5254using namespace std;
    5355//! \ingroup TLibEncoder
     
    107109  m_viewIndex  =   0;
    108110  m_isDepth = false;
     111#if H_3D_IV_MERGE
     112  m_pcDepthMapGenerator = NULL;
     113#endif
    109114#endif
    110115#endif
     
    155160  m_viewIndex            = pcTEncTop->getViewIndex();
    156161  m_isDepth              = pcTEncTop->getIsDepth();
     162#if H_3D_IV_MERGE
     163  m_pcDepthMapGenerator  = pcTEncTop->getDepthMapGenerator();
     164#endif
    157165#endif
    158166#endif
     
    674682#endif
    675683
     684#if H_3D_IV_MERGE
     685    TAppEncTop* tAppEncTop = m_pcEncTop->getEncTop();
     686    TComPic * const pcTexturePic = m_pcEncTop->getIsDepth() ? tAppEncTop->getPicFromView( getViewIndex(), pcSlice->getPOC(), false ) : NULL;
     687    assert( !m_pcEncTop->getIsDepth() || pcTexturePic != NULL );
     688    pcSlice->setTexturePic( pcTexturePic );
     689#endif
    676690    //  Slice info. refinement
    677691#if H_MV
     
    10281042    m_storedStartCUAddrForEncodingSliceSegment.push_back(nextCUAddr);
    10291043    startCUAddrSliceSegmentIdx++;
     1044
     1045#if H_3D_IV_MERGE
     1046    m_pcDepthMapGenerator->initViewComponent( pcPic );
     1047#endif
     1048
    10301049#if H_3D_NBDV
    10311050      if(pcSlice->getViewIndex() && !pcSlice->getIsDepth()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done.
     
    24782497#if ADAPTIVE_QP_SELECTION
    24792498#if H_MV
    2480   printf("Layer %3d   POC %4d TId: %1d ( %c-SLICE, nQP %d QP %d ) %10d bits",
     2499  printf("Layer %3d   POC %4d TId: %1d ( %c-SLICE, nQP %d QP %d ) %10d  bits",
    24812500    pcSlice->getLayerId(),
    24822501    pcSlice->getPOC(),
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.h

    r446 r476  
    5959#include <vector>
    6060
     61#if H_3D_IV_MERGE
     62#include "TLibCommon/TComDepthMapGenerator.h"
     63#endif
    6164//! \ingroup TLibEncoder
    6265//! \{
     
    107110  Int                     m_viewIndex;
    108111  Bool                    m_isDepth;
     112
     113#if H_3D_IV_MERGE
     114  TComDepthMapGenerator*  m_pcDepthMapGenerator;
     115#endif
     116
    109117#endif
    110118#endif
     
    166174 
    167175  TComList<TComPic*>*   getListPic()      { return m_pcListPic; }
    168  
     176#if H_3D_IV_MERGE
     177  TEncTop* getEncTop() { return m_pcEncTop; }
     178#endif
    169179#if !H_MV
    170180  Void  printOutSummary      ( UInt uiNumAllPicCoded );
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSearch.cpp

    r456 r476  
    33153315#endif
    33163316
     3317#if H_3D_IV_MERGE
     3318  TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
     3319  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
     3320#else
    33173321  TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
    33183322  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
     3323#endif
    33193324  Int numValidMergeCand = 0 ;
    33203325
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp

    r446 r476  
    529529  rpcSlice->setSliceSegmentMode     ( m_pcCfg->getSliceSegmentMode()     );
    530530  rpcSlice->setSliceSegmentArgument ( m_pcCfg->getSliceSegmentArgument() );
     531#if H_3D_IV_MERGE
     532  rpcSlice->setMaxNumMergeCand        ( m_pcCfg->getMaxNumMergeCand()   + ((rpcSlice->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE) ? 1:0)      );
     533#else
    531534  rpcSlice->setMaxNumMergeCand        ( m_pcCfg->getMaxNumMergeCand()        );
     535#endif
    532536  xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() );
    533537}
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.cpp

    r446 r476  
    119119#endif
    120120  m_cLoopFilter.        create( g_uiMaxCUDepth );
    121  
     121
     122#if H_3D_IV_MERGE
     123  m_cDepthMapGenerator. create( false, getSourceWidth(), getSourceHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_bitDepthY, PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) );
     124#endif
     125
    122126#if RATE_CONTROL_LAMBDA_DOMAIN
    123127  if ( m_RCEnableRateControl )
     
    225229  m_cLoopFilter.        destroy();
    226230  m_cRateCtrl.          destroy();
     231
     232#if H_3D_IV_MERGE
     233  m_cDepthMapGenerator. destroy();
     234#endif
    227235  // SBAC RD
    228236  if( m_bUseSBACRD )
     
    284292}
    285293
     294#if H_3D_IV_MERGE
     295Void TEncTop::init( TAppEncTop* pcTAppEncTop)
     296#else
    286297Void TEncTop::init()
     298#endif
    287299{
    288300  // initialize SPS
     
    306318  m_cCuEncoder.   init( this );
    307319 
     320#if H_3D_IV_MERGE
     321  m_pcTAppEncTop = pcTAppEncTop;
     322  m_cDepthMapGenerator.init( (TComPrediction*)this->getPredSearch(), m_pcTAppEncTop->getVPSAccess(), m_pcTAppEncTop->getSPSAccess(), m_pcTAppEncTop->getAUPicAccess() );
     323#endif
     324
    308325  // initialize transform & quantization class
    309326  m_pcCavlcCoder = getCavlcCoder();
     
    658675  {
    659676    m_cSPS.initCamParaSPS           ( m_viewIndex, m_uiCamParPrecision, m_bCamParInSliceHeader, m_aaiCodedScale, m_aaiCodedOffset );
    660   }
     677#if H_3D_IV_MERGE
     678    if( m_viewIndex )
     679    {
     680      m_cSPS.setPredDepthMapGeneration( m_viewIndex, false, m_uiPredDepthMapGeneration, m_uiMultiviewMvPredMode);
     681    }
     682    else
     683    {
     684      m_cSPS.setPredDepthMapGeneration( m_viewIndex, false );
     685    }
     686#endif
     687  }
     688#if H_3D_IV_MERGE
     689  else
     690  {
     691    m_cSPS.initCamParaSPSDepth           ( m_viewIndex);
     692    m_cSPS.setPredDepthMapGeneration( m_viewIndex, true );
     693  }
     694#endif
    661695#endif
    662696}
     
    13001334}
    13011335#endif
     1336
     1337
    13021338//! \}
  • branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.h

    r446 r476  
    5757#include "TEncPreanalyzer.h"
    5858#include "TEncRateCtrl.h"
     59
     60#if H_3D_IV_MERGE
     61#include "TLibCommon/TComDepthMapGenerator.h"
     62#endif
    5963//! \ingroup TLibEncoder
    6064//! \{
     
    6367// Class definition
    6468// ====================================================================================================================
     69
     70#if H_3D_IV_MERGE
     71class TAppEncTop;
     72#endif
    6573
    6674/// encoder class
     
    96104  TEncSlice               m_cSliceEncoder;                ///< slice encoder
    97105  TEncCu                  m_cCuEncoder;                   ///< CU encoder
     106
     107#if H_3D_IV_MERGE
     108  TComDepthMapGenerator   m_cDepthMapGenerator;           ///< depth map generator
     109#endif
     110
    98111  // SPS
    99112  TComSPS                 m_cSPS;                         ///< SPS
     
    119132  TEncBinCABAC*           m_pcRDGoOnBinCodersCABAC;        ///< going on bin coder CABAC for RD stage per substream
    120133
     134#if H_3D_IV_MERGE 
     135  TAppEncTop*             m_pcTAppEncTop;
     136#endif
    121137  // quality control
    122138  TEncPreanalyzer         m_cPreanalyzer;                 ///< image characteristics analyzer for TM5-step3-like adaptive QP
     
    145161  Void      create          ();
    146162  Void      destroy         ();
     163#if H_3D_IV_MERGE
     164  Void      init            ( TAppEncTop* pcTAppEncTop );
     165#else
    147166  Void      init            ();
     167#endif
    148168#if H_MV 
    149169  TComPicLists* getIvPicLists() { return m_ivPicLists; }
     
    185205  TEncSbac*               getRDGoOnSbacCoders   () { return  m_pcRDGoOnSbacCoders;   }
    186206  TEncRateCtrl*           getRateCtrl           () { return &m_cRateCtrl;             }
     207#if H_3D_IV_MERGE
     208  TAppEncTop*             getEncTop             () { return m_pcTAppEncTop; }
     209#endif
    187210  TComSPS*                getSPS                () { return  &m_cSPS;                 }
    188211  TComPPS*                getPPS                () { return  &m_cPPS;                 }
     
    205228  Void                    setIvPicLists         ( TComPicLists* picLists) { m_ivPicLists = picLists; }
    206229#endif
     230#if H_3D_IV_MERGE
     231  TComDepthMapGenerator*  getDepthMapGenerator  () { return  &m_cDepthMapGenerator;   }
     232#endif
    207233  // -------------------------------------------------------------------------------------------------------------------
    208234  // encoder function
Note: See TracChangeset for help on using the changeset viewer.