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


Ignore:
Timestamp:
31 Dec 2012, 18:33:14 (12 years ago)
Author:
mitsubishi-htm
Message:

A final release, as planned

  • Migrate to HTM 5.1
  • For VC project files, only VC9 file is updated
  • To be used as an additional anchor for CE1.h for 3rd JCTVC meeting at Geneva
Location:
branches/HTM-4.0.1-VSP-dev0/source/App
Files:
11 edited

Legend:

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

    r193 r213  
    8282Void TAppDecTop::decode()
    8383{
    84 #if VIDYO_VPS_INTEGRATION
     84#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    8585  increaseNumberOfViews( 0, 0, 0 );
    8686#else
     
    8888#endif
    8989 
     90#if FLEX_CODING_ORDER_M23723
     91  Int iDepthViewIdx = 0;
     92  Int iTextureViewIdx=0;
     93  Bool firstFrame=1;
     94  Bool viewIdZero=true;
     95  Int fcoIndex=0;  //when the current frame is not first frame,use FCO_index stand for viewDepth.
     96#endif
     97
    9098#if SONY_COLPIC_AVAILABILITY
    9199  m_tDecTop[0]->setViewOrderIdx(0);
     
    102110    pcListPic[i] = NULL;
    103111    newPicture[i] = false;
     112#if FLEX_CODING_ORDER_M23723
     113#if  FIX_FCO_COMP_WARNING
     114    m_fcoOrder[i] = ' ';
     115#else
     116    m_fcoOrder[i]=NULL;
     117#endif
     118#endif
     119
    104120  }
    105121
     
    145161    {
    146162      read(nalu, nalUnit);
     163#if QC_MVHEVC_B0046
     164    viewDepthId = nalu.m_layerId;
     165    Int depth = 0;
     166    Int viewId = viewDepthId;
     167#else
    147168#if VIDYO_VPS_INTEGRATION
    148169      Int viewId = 0;
     
    156177        depth = getVPSAccess()->getActiveVPS()->getDepthFlag(nalu.m_layerId);
    157178      }
     179#if FLEX_CODING_ORDER_M23723
     180      if (viewId>0)
     181      {
     182        viewIdZero=false;
     183      }
     184      if (viewIdZero==false&&viewId==0)
     185      {
     186        firstFrame=0; //if viewId has been more than zero and now it set to zero again, we can see that it is not the first view
     187      }
     188      if (firstFrame)
     189      { // if the current view is first frame, we set the viewDepthId as texture plus depth and get the FCO order
     190        viewDepthId = iDepthViewIdx+iTextureViewIdx;
     191        m_fcoViewDepthId=viewDepthId;
     192      }
     193      else
     194      {//if current view is not first frame, we set the viewDepthId depended on the FCO order
     195        viewDepthId=0;
     196        if (depth)
     197        {
     198          for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ )
     199          {
     200            if (m_fcoOrder[fcoIndex]=='D')
     201            {
     202              if (viewId==viewDepthId)
     203                break;
     204              else
     205                viewDepthId++;
     206            }
     207          }
     208        }
     209        else
     210        {
     211          for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ )
     212          {
     213            if (m_fcoOrder[fcoIndex]=='T')
     214            {
     215              if (viewId==viewDepthId)
     216                break;
     217              else
     218                viewDepthId++;
     219            }
     220          }
     221        }
     222
     223        viewDepthId=fcoIndex;
     224
     225      }
     226
     227
     228#else
    158229      viewDepthId = nalu.m_layerId;   // coding order T0D0T1D1T2D2
     230#endif
     231   
    159232#else
    160233      Int viewId = nalu.m_viewId;
    161234      Int depth = nalu.m_isDepth ? 1 : 0;
     235#if FLEX_CODING_ORDER_M23723
     236      if (viewId>0)
     237      {
     238        viewIdZero=false;
     239      }
     240      if (viewIdZero==false&&viewId==0)
     241      {
     242        firstFrame=0;
     243      }
     244      if (firstFrame)
     245      {
     246        viewDepthId = iDepthViewIdx+iTextureViewIdx;
     247        m_fcoViewDepthId=viewDepthId;
     248      }
     249      else
     250      {
     251        viewDepthId=0;
     252        if (depth)
     253        {
     254          for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ )
     255          {
     256            if (m_fcoOrder[fcoIndex]=='D')
     257            {
     258              if (viewId==viewDepthId)
     259                break;
     260              else
     261                viewDepthId++;
     262            }
     263          }
     264        }
     265        else
     266        {
     267          for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ )
     268          {
     269            if (m_fcoOrder[fcoIndex]=='T')
     270            {
     271              if (viewId==viewDepthId)
     272                break;
     273              else
     274                viewDepthId++;
     275            }
     276          }
     277        }
     278        viewDepthId=fcoIndex;
     279      }
     280#else
    162281      viewDepthId = viewId * 2 + depth;   // coding order T0D0T1D1T2D2
    163282#endif
    164      
     283#endif
     284#endif
    165285      newPicture[viewDepthId] = false;
    166286      if( viewDepthId >= m_tDecTop.size() )     
    167287      {
    168 #if VIDYO_VPS_INTEGRATION
     288#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    169289        increaseNumberOfViews( viewDepthId, viewId, depth );
    170290#else
     
    195315      if( !(m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) )
    196316      {
     317#if QC_MVHEVC_B0046
     318        if(viewDepthId && m_tDecTop[viewDepthId]->m_bFirstNal== false)
     319        {
     320          m_tDecTop[viewDepthId]->m_bFirstNal = true;
     321          ParameterSetManagerDecoder* pDecV0 = m_tDecTop[0]->xGetParaSetDec();
     322          m_tDecTop[viewDepthId]->xCopyVPS(pDecV0->getPrefetchedVPS(0));
     323          m_tDecTop[viewDepthId]->xCopySPS(pDecV0->getPrefetchedSPS(0));
     324          m_tDecTop[viewDepthId]->xCopyPPS(pDecV0->getPrefetchedPPS(0));
     325        }
     326#endif
    197327        newPicture[viewDepthId] = m_tDecTop[viewDepthId]->decode(nalu, m_iSkipFrame, m_pocLastDisplay[viewDepthId]);
    198328        if (newPicture[viewDepthId])
     
    209339        {
    210340          previousPictureDecoded = true;
     341#if FLEX_CODING_ORDER_M23723
     342        if (firstFrame)
     343        {
     344            if (depth)
     345            {
     346                iDepthViewIdx++;
     347                m_fcoOrder[viewDepthId]='D';
     348            }
     349            else
     350           {
     351                iTextureViewIdx++;
     352                m_fcoOrder[viewDepthId]='T';
     353           }
     354          }
     355
     356#endif
    211357        }
    212358      }
     
    218364    if( pcListPic[viewDepthId] )
    219365    {
     366#if QC_REM_IDV_B0046
     367      Int iviewId = m_tDecTop[viewDepthId]->getViewId();
     368      if( newPicture[viewDepthId] && (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || ((nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR && iviewId) && m_tDecTop[viewDepthId]->getNalUnitTypeBaseView() == NAL_UNIT_CODED_SLICE_IDR)) )
     369#else
    220370      if( newPicture[viewDepthId] && (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDV && m_tDecTop[viewDepthId]->getNalUnitTypeBaseView() == NAL_UNIT_CODED_SLICE_IDR)) )
     371#endif
    221372      {
    222373        xFlushOutput( pcListPic[viewDepthId], viewDepthId );
     
    275426        m_tDecTop[viewDepthIdx]->destroy() ;
    276427      }
     428#if QC_MVHEVC_B0046
     429      if(viewDepthIdx)
     430      {
     431         //Call clear function to remove the record, which has been freed during viewDepthIdx = 0 case.
     432        m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearSPS();
     433        m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearVPS();
     434        m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearPPS();
     435      }
     436#endif
    277437      delete m_tDecTop[viewDepthIdx] ;
    278438      m_tDecTop[viewDepthIdx] = NULL ;
     
    416576  m_pocLastDisplay[viewDepthId] = -MAX_INT;
    417577}
    418 #if VIDYO_VPS_INTEGRATION
     578#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    419579Void  TAppDecTop::increaseNumberOfViews  ( UInt layerId, UInt viewId, UInt isDepth )
    420580#else
     
    422582#endif
    423583{
    424 #if VIDYO_VPS_INTEGRATION
     584#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    425585  Int newNumberOfViewDepth = layerId + 1;
    426586#endif
     
    429589    m_outputBitDepth = g_uiBitDepth + g_uiBitIncrement;
    430590  }
    431 #if !VIDYO_VPS_INTEGRATION
     591#if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046
    432592  Int viewId = (newNumberOfViewDepth-1)>>1;   // coding order T0D0T1D1T2D2
    433593  Bool isDepth = ((newNumberOfViewDepth % 2) == 0);  // coding order T0D0T1D1T2D2
     
    436596    m_useDepth = true;
    437597
    438 #if FIX_DECODING_WO_WRITING
    439598  if ( m_pchReconFile )
    440599  {
    441 #endif
    442600    while( m_tVideoIOYuvReconFile.size() < newNumberOfViewDepth)
    443601    {
    444602      m_tVideoIOYuvReconFile.push_back(new TVideoIOYuv);
    445603      Char buffer[4];
    446 #if VIDYO_VPS_INTEGRATION
     604#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    447605      sprintf(buffer,"_%i", viewId );
    448606#else
     
    450608#endif
    451609      Char* nextFilename = NULL;
    452 #if VIDYO_VPS_INTEGRATION
     610#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    453611      if( isDepth)
    454612#else
     
    465623        xAppendToFileNameEnd( m_pchReconFile, buffer, nextFilename);
    466624      }
    467 #if !VIDYO_VPS_INTEGRATION
     625#if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046
    468626      if( isDepth || ( !isDepth && (m_tVideoIOYuvReconFile.size() % 2) == 1 ) )
    469627#endif
     
    473631      free ( nextFilename );
    474632    }
    475 #if FIX_DECODING_WO_WRITING
    476   }
    477 #endif
     633  }
    478634
    479635  while( m_pocLastDisplay.size() < newNumberOfViewDepth )
     
    484640  {
    485641    m_tDecTop.push_back(new TDecTop);
    486 #if !VIDYO_VPS_INTEGRATION
     642#if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046
    487643    if( isDepth || ( !isDepth && (m_tVideoIOYuvReconFile.size() % 2) == 1 ) )
    488644    {
     
    494650      m_tDecTop.back()->setPictureDigestEnabled(m_pictureDigestEnabled);
    495651      m_tDecTop.back()->setCamParsCollector( &m_cCamParsCollector );
    496 #if !VIDYO_VPS_INTEGRATION
     652#if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046
    497653    }
    498654#endif
     
    502658TDecTop* TAppDecTop::getTDecTop( Int viewId, Bool isDepth )
    503659{
     660#if FLEX_CODING_ORDER_M23723
     661  Int viewnumber=0;
     662  Int i=0;
     663  Bool fcoFlag=0;
     664  if (viewId>m_fcoViewDepthId)
     665  {
     666    return NULL;
     667  }
     668  else
     669  {
     670    if (isDepth)
     671   {
     672      for ( i=0; i<=m_fcoViewDepthId;i++)
     673      {
     674         if (m_fcoOrder[i]=='D')
     675         {
     676           if (viewnumber==viewId)
     677           {
     678             fcoFlag=1;
     679             break;
     680           }
     681           else
     682             viewnumber++;
     683         }
     684      }
     685    }
     686    else
     687    {
     688      for ( i=0; i<=m_fcoViewDepthId;i++)
     689      {
     690        if (m_fcoOrder[i]=='T')
     691        {
     692          if (viewnumber==viewId)
     693          {
     694            fcoFlag=1;
     695            break;
     696          }
     697          else
     698            viewnumber++;
     699        }
     700      }
     701    }
     702    if (fcoFlag)
     703    {
     704      return m_tDecTop[i];
     705    }
     706    else
     707      return NULL;
     708   
     709  }
     710
     711    // coding order T0D0T1D1T2D2
     712#else
    504713  return m_tDecTop[(isDepth ? 1 : 0) + viewId * 2];  // coding order T0D0T1D1T2D2
     714#endif
     715 
    505716}
    506717
     
    521732  assert( ( viewId >= 0 ) );
    522733
     734#if FLEX_CODING_ORDER_M23723
     735if (getTDecTop(viewId,isDepth))
     736{
    523737  TComList<TComPic*>* apcListPic = getTDecTop( viewId, isDepth )->getListPic();
    524738  TComPic* pcPic = NULL;
     
    532746  }
    533747  return pcPic;
     748}
     749else
     750  return NULL;
     751#else
     752
     753  TComList<TComPic*>* apcListPic = getTDecTop( viewId, isDepth )->getListPic();
     754  TComPic* pcPic = NULL;
     755  for( TComList<TComPic*>::iterator it=apcListPic->begin(); it!=apcListPic->end(); it++ )
     756  {
     757    if( (*it)->getPOC() == poc )
     758    {
     759      pcPic = *it;
     760      break;
     761    }
     762  }
     763  return pcPic;
     764#endif
    534765}
    535766
     
    557788  AOF(pcPicYuvAvail);
    558789
    559   TComPic* pcPic = getPicFromView( iCodedViewIdx, iCurPoc, bDepth );
     790  //TComPic* pcPic = getPicFromView( iCodedViewIdx, iCurPoc, bDepth );
     791  TComPic* pcPic = NULL;
     792  for( Int i=0; i<m_tDecTop.size() && pcPic==NULL; i++)
     793  {
     794    if( iCodedViewIdx == m_tDecTop[i]->getViewId() && bDepth == m_tDecTop[i]->getIsDepth() )
     795    {
     796
     797       TComList<TComPic*>* apcListPic = m_tDecTop[i]->getListPic();
     798       for( TComList<TComPic*>::iterator it=apcListPic->begin(); it!=apcListPic->end(); it++ )
     799       {
     800         if( (*it)->getPOC() == iCurPoc )
     801         {
     802           pcPic = *it;
     803           break;
     804         }
     805       }
     806
     807    }
     808  }
    560809  pcPic->setPicYuvSynth( pcPicYuvVSP );
    561810  pcPic->setPicYuvAvail( pcPicYuvAvail );
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppDecoder/TAppDecTop.h

    r193 r213  
    7474  Bool                            m_useDepth;
    7575
     76#if FLEX_CODING_ORDER_M23723
     77  Int  m_fcoViewDepthId;
     78  Char m_fcoOrder[MAX_VIEW_NUM*2];
     79#endif
     80
    7681  FILE*                           m_pScaleOffsetFile;
    7782  CamParsCollector                m_cCamParsCollector;
    7883#if DEPTH_MAP_GENERATION
    79 #if VIDYO_VPS_INTEGRATION
     84#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    8085  TComVPSAccess                   m_cVPSAccess;
    8186#endif
     
    95100  Void  destroy           (); ///< destroy internal members
    96101  Void  decode            (); ///< main decoding function
    97 #if VIDYO_VPS_INTEGRATION
     102#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    98103  Void  increaseNumberOfViews  (UInt layerId, UInt viewId, UInt isDepth);
    99104#else
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncCfg.cpp

    r193 r213  
    7474{
    7575  m_aidQP = NULL;
    76 #if FIXES
    7776  m_aidQPdepth = NULL;
    78 #endif
    7977}
    8078
     
    8684  }
    8785
    88 #if FIXES
    8986  if ( m_aidQPdepth )
    9087  {
    9188    delete[] m_aidQPdepth; m_aidQPdepth = NULL;
    9289  }
    93 #endif
    9490
    9591  for(Int i = 0; i< m_pchInputFileList.size(); i++ )
     
    115111  if (m_pchBitstreamFile != NULL)
    116112    free (m_pchBitstreamFile) ;
     113#if FLEX_CODING_ORDER_M23723
     114  if (m_pchMVCJointCodingOrder != NULL)
     115  {
     116    free(m_pchMVCJointCodingOrder) ;
     117  }
     118#endif
    117119#if HHI_VSO
    118120  if (  m_pchVSOConfig != NULL)
     
    120122#endif
    121123
    122 #if FIX_MEM_LEAKS
    123124 if ( m_pchCameraParameterFile != NULL )
    124125   free ( m_pchCameraParameterFile );
     
    139140   free ( m_scalingListFile );
    140141
    141 #endif   
    142142
    143143}
     
    225225  string cfg_RowHeight;
    226226  string cfg_ScalingListFile;
     227
     228 #if FLEX_CODING_ORDER_M23723
     229  string cfg_JointCodingOrdering;
     230#endif
     231
    227232  po::Options opts;
    228233  opts.addOptions()
     
    268273 
    269274  ("NumberOfViews",         m_iNumberOfViews,    0, "Number of views")
     275#if FLEX_CODING_ORDER_M23723
     276  ("FCO",               m_b3DVFlexOrder,   false, "flexible coding order flag" )
     277  ("FCOCodingOrder",   cfg_JointCodingOrdering,  string(""), "The coding order for joint texture-depth coding")
     278#endif
    270279  /* Unit definition parameters */
    271280  ("MaxCUWidth",          m_uiMaxCUWidth,  64u)
     
    298307  ("FastSearch", m_iFastSearch, 1, "0:Full search  1:Diamond  2:PMVFAST")
    299308  ("SearchRange,-sr",m_iSearchRange, 96, "motion search range")
     309#if DV_V_RESTRICTION_B0037
     310  ("DisparitySearchRangeRestriction",m_bUseDisparitySearchRangeRestriction, false, "restrict disparity search range")
     311  ("VerticalDisparitySearchRange",m_iVerticalDisparitySearchRange, 56, "vertical disparity search range")
     312#endif
    300313  ("BipredSearchRange", m_bipredSearchRange, 4, "motion search range for bipred refinement")
    301314  ("HadamardME", m_bUseHADME, true, "hadamard ME for fractional-pel")
     
    342355  ("LoopFilterBetaOffset_div2", m_loopFilterBetaOffsetDiv2, 0 )
    343356  ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0 )
     357#if LGE_ILLUCOMP_B0045
     358  ("IlluCompEnable",                  m_bUseIC                  , true         , "Use illumination compensation for inter-view prediction" )
     359#endif
    344360#if DBL_CONTROL
    345 #if FIX_DBL_CONTROL_DEFAULT
    346361  ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, true)
    347 #else
    348   ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false)
    349 #endif
    350362#endif
    351363
    352364  /* Camera Paremetes */
    353365  ("CameraParameterFile,cpf", m_pchCameraParameterFile,    (Char *) 0, "Camera Parameter File Name")
     366#if QC_MVHEVC_B0046
     367  ("BaseViewCameraNumbers" ,  m_aiVId,     std::vector<Int>(1, MAX_VIEW_NUM), "Numbers of base views")
     368#endif
    354369  ("BaseViewCameraNumbers" ,  m_pchBaseViewCameraNumbers,  (Char *) 0, "Numbers of base views")
    355370
     
    362377  ("LambdaScaleVSO",                  m_dLambdaScaleVSO         , (Double) 1    , "Lambda Scaling for VSO")
    363378
    364 #if HHI_VSO_LS_TABLE
     379#if HHI_VSO_LS_TABLE_M23714
    365380  ("VSOLSTable",                      m_bVSOLSTable             , true          , "Depth QP dependent video/depth rate allocation by Lagrange multiplier" )   
    366381#endif
     
    377392#endif
    378393#if LGE_WVSO_A0119
    379   ("WVSO",                            m_bUseWVSO                , false         , "Use depth fidelity term for VSO" )
     394  ("WVSO",                            m_bUseWVSO                , true          , "Use depth fidelity term for VSO" )
    380395  ("VSOWeight",                       m_iVSOWeight              , 10            , "Synthesized View Distortion Change weight" )
    381396  ("VSDWeight",                       m_iVSDWeight              , 1             , "View Synthesis Distortion estimate weight" )
     
    383398#endif
    384399
    385 #if OL_DEPTHLIMIT_A0044
    386   ("DPL",                             m_bDepthPartitionLimiting , false         , "Use DepthPartitionLimiting" )
    387 #endif
     400#if OL_QTLIMIT_PREDCODING_B0068
     401  ("QTLPC",                           m_bUseQTLPC               , true         , "Use depth Quadtree Limitation + Predictive Coding" )
     402#endif
     403
    388404#endif
    389405
     
    474490                                              "\t0: disable")
    475491
     492#if TMVP_DEPTH_SWITCH
     493  ("TMVP", m_enableTMVP, std::vector<Bool>(1,true), "Enable TMVP" )
     494#else
    476495  ("TMVP", m_enableTMVP, true, "Enable TMVP" )
     496#endif
    477497
    478498  ("FEN", m_bUseFastEnc, false, "fast encoder setting")
     
    493513#if HHI_MPI
    494514  ("MVI", m_bUseMVI, false, "use motion vector inheritance for depth map coding")
     515#endif
     516#if RWTH_SDC_DLT_B0036
     517  ("DLT", m_bUseDLT, true, "use depth lookup table for depth map coding")
     518  ("SDC", m_bUseSDC, true, "use simplified depth coding tree")
    495519#endif
    496520  ;
     
    545569  m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
    546570  m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
    547  
     571#if FLEX_CODING_ORDER_M23723
     572  m_pchMVCJointCodingOrder= cfg_JointCodingOrdering.empty()?NULL:strdup(cfg_JointCodingOrdering.c_str());
     573  // If flexible order is enabled and if depth comes before the texture for a view, disable VSO
     574#if HHI_VSO && DISABLE_FCO_FOR_VSO
     575  Bool depthComesFirst = false;
     576  int iter = 0;
     577  if ( m_b3DVFlexOrder )
     578  {
     579    for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
     580    {
     581      iter = 0;
     582      for ( Int ii=1; ii<12; ii+=2 )
     583      {
     584        Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0');
     585        if ( iViewIdxCfg == iViewIdx )
     586        {
     587          iter ++;
     588          if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view
     589          {
     590            if(iter == 1)
     591           {
     592            depthComesFirst = true;
     593            break;
     594           }
     595          }
     596          else
     597          {
     598            assert(m_pchMVCJointCodingOrder[ii-1]=='T');
     599          }
     600        }
     601      }
     602    }
     603  }
     604  if (depthComesFirst)
     605  {
     606    m_bUseVSO = false;
     607  }
     608#endif
     609#endif
    548610  m_pchColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str());
    549611  m_pchRowHeight = cfg_RowHeight.empty() ? NULL : strdup(cfg_RowHeight.c_str());
     
    704766  xCleanUpVectors();
    705767
     768
     769#if TMVP_DEPTH_SWITCH
     770  if ( m_enableTMVP.size() < 2)
     771  {
     772    m_enableTMVP.push_back( m_enableTMVP[0]  );
     773  }
     774#endif
     775 
     776
    706777#if HHI_VSO
    707778  if ( m_abUseALF .size() < 2)
     
    732803#if HHI_VSO
    733804
    734 #if HHI_VSO_LS_TABLE
     805#if HHI_VSO_LS_TABLE_M23714
    735806  // Q&D
    736807  Double adLambdaScaleTable[] =
     
    796867}
    797868#else
     869#if !QC_MVHEVC_B0046
    798870  m_cCameraData     .init     ( (UInt)m_iNumberOfViews,
    799871    m_uiInputBitDepth,
     
    807879    LOG2_DISP_PREC_LUT );
    808880#endif
     881#endif
    809882
    810883
    811884  // check validity of input parameters
    812885  xCheckParameter();
     886#if !QC_MVHEVC_B0046
    813887  m_cCameraData.check( false, true );
    814  
     888#endif
    815889  // print-out parameters
    816890  xPrintParameter();
     
    860934  xConfirmPara( m_iFastSearch < 0 || m_iFastSearch > 2,                                     "Fast Search Mode is not supported value (0:Full search  1:Diamond  2:PMVFAST)" );
    861935  xConfirmPara( m_iSearchRange < 0 ,                                                        "Search Range must be more than 0" );
     936#if DV_V_RESTRICTION_B0037
     937  xConfirmPara( m_iVerticalDisparitySearchRange <= 0 ,                                      "Vertical Disparity Search Range must be more than 0" );
     938#endif
    862939  xConfirmPara( m_bipredSearchRange < 0 ,                                                   "Search Range must be more than 0" );
    863940  xConfirmPara( m_iMaxDeltaQP > 7,                                                          "Absolute Delta QP exceeds supported range (0 to 7)" );
     
    16501727  printf("Min PCM size                 : %d\n", 1 << m_uiPCMLog2MinSize);
    16511728  printf("Motion search range          : %d\n", m_iSearchRange );
     1729#if DV_V_RESTRICTION_B0037
     1730  printf("Disp search range restriction: %d\n", m_bUseDisparitySearchRangeRestriction );
     1731  printf("Vertical disp search range   : %d\n", m_iVerticalDisparitySearchRange );
     1732#endif
    16521733  printf("Intra period                 : %d\n", m_iIntraPeriod );
    16531734  printf("Decoding refresh type        : %d\n", m_iDecodingRefreshType );
     
    16851766    printf("VSO Negative Distortion      : %d\n",    m_bAllowNegDist ? 1 : 0);
    16861767#endif
    1687 #if HHI_VSO_LS_TABLE
     1768#if HHI_VSO_LS_TABLE_M23714
    16881769    printf("VSO LS Table                 : %d\n",    m_bVSOLSTable ? 1 : 0);   
    16891770#endif
     
    17691850  printf(" ScalingList:%d ", m_useScalingListId );
    17701851
     1852#if !TMVP_DEPTH_SWITCH
    17711853  printf("TMVP:%d ", m_enableTMVP     );
     1854#endif
    17721855
    17731856#if ADAPTIVE_QP_SELECTION
     
    17831866  printf("SAO:%d ", (m_abUseSAO [0] ? 1 : 0));
    17841867  printf("RDQ:%d ", (m_abUseRDOQ[0] ? 1 : 0) );
     1868#if TMVP_DEPTH_SWITCH
     1869  printf("TMVP:%d ", (m_enableTMVP[0] ? 1 : 0) );
     1870#endif
     1871#if LGE_ILLUCOMP_B0045
     1872  printf("IlluCompEnable: %d ", m_bUseIC);
     1873#endif
     1874
    17851875  printf("\n");
    17861876
     
    17891879  printf("SAO:%d ", (m_abUseSAO [1] ? 1 : 0));
    17901880  printf("RDQ:%d ", (m_abUseRDOQ[1] ? 1 : 0));
     1881#if TMVP_DEPTH_SWITCH
     1882  printf("TMVP:%d ", (m_enableTMVP[1] ? 1 : 0) );
     1883#endif
     1884#if FLEX_CODING_ORDER_M23723
     1885  printf("FCO:%d ",   (m_b3DVFlexOrder ? 1: 0));
     1886
     1887  if(m_b3DVFlexOrder)
     1888  {
     1889    printf("CodingOrder: %s ", m_pchMVCJointCodingOrder);
     1890  }
     1891#endif
    17911892#if HHI_VSO
    17921893  printf("VSO:%d ", m_bUseVSO             );
     
    17951896  printf("WVSO:%d ", m_bUseWVSO );
    17961897#endif
    1797 #if OL_DEPTHLIMIT_A0044
    1798   printf("DPL:%d ", m_bDepthPartitionLimiting);
     1898#if OL_QTLIMIT_PREDCODING_B0068
     1899  printf("QTLPC:%d ", m_bUseQTLPC);
    17991900#endif
    18001901#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     
    18041905  printf("MVI:%d ", m_bUseMVI ? 1 : 0 );
    18051906#endif
     1907#if RWTH_SDC_DLT_B0036
     1908  printf("SDC:%d ", m_bUseSDC ? 1 : 0 );
     1909  printf("DLT:%d ", m_bUseDLT ? 1 : 0 );
     1910#endif
    18061911#if LGE_WVSO_A0119
    1807   printf("\nVSO : VSD : SAD weight = %d : %d : %d ", m_iVSOWeight, m_iVSDWeight, m_iDWeight );
     1912  if ( m_bUseWVSO )
     1913    printf("\nVSO : VSD : SAD weight = %d : %d : %d ", m_iVSOWeight, m_iVSDWeight, m_iDWeight );
    18081914#endif
    18091915  printf("\n\n");
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncCfg.h

    r193 r213  
    8888  Int       m_iNumberOfViews;                                 ///< number Views to Encode
    8989  Bool      m_bUsingDepthMaps;
     90 
     91#if FLEX_CODING_ORDER_M23723
     92  Char*  m_pchMVCJointCodingOrder;      ///<  texture-depth coding order
     93  Bool    m_b3DVFlexOrder;    ///<  flexible coding order flag
     94#endif
     95
    9096  // coding structure
    9197  Int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
     
    109115  std::vector<Double>  m_adQP;                                ///< QP value of key-picture (floating point) [0] video, [1] depth
    110116  std::vector<Int>     m_aiQP;                                ///< QP value of key-picture (integer) [0] video, [1] depth
     117#if QC_MVHEVC_B0046
     118  std::vector<Int>     m_aiVId;                                ///< view id
     119#endif
    111120  Int       m_aiTLayerQPOffset[MAX_TLAYER];                   ///< QP offset corresponding to temporal layer depth
    112121  char*     m_pchdQPFile;                                     ///< QP offset for each slice (initialized from external file)
     
    160169#endif
    161170  vector<Bool> m_abUseSAO;
     171#if LGE_ILLUCOMP_B0045
     172  Bool      m_bUseIC;                                     ///< flag for using illumination compensation for inter-view prediction
     173#endif
    162174#if SAO_UNIT_INTERLEAVING
    163175  Int       m_maxNumOffsetsPerPic;                            ///< SAO maximun number of offset per picture
     
    197209  Int       m_iFastSearch;                                    ///< ME mode, 0 = full, 1 = diamond, 2 = PMVFAST
    198210  Int       m_iSearchRange;                                   ///< ME search range
     211#if DV_V_RESTRICTION_B0037
     212  Bool      m_bUseDisparitySearchRangeRestriction;            ///< restrict vertical search range for inter-view prediction
     213  Int       m_iVerticalDisparitySearchRange;                  ///< ME vertical search range for inter-view prediction
     214#endif
    199215  Int       m_bipredSearchRange;                              ///< ME search range for bipred refinement
    200216  Bool      m_bUseFastEnc;                                    ///< flag for using fast encoder setting
     
    258274  UInt      m_uiBiPredIdc;                                    ///< Use of Bi-Directional Weighting Prediction (B_SLICE): explicit(1) or implicit(2)
    259275
     276#if TMVP_DEPTH_SWITCH
     277  vector<Bool> m_enableTMVP;                                  ///< Enable TMVP [0] video, [1] depth
     278#else
    260279  Bool      m_enableTMVP;
     280#endif
     281
    261282#if MULTIBITS_DATA_HIDING
    262283  Int       m_signHideFlag;
     
    266287  Bool      m_bUseMVI;  ///< flag for using Motion Vector Inheritance for depth map coding
    267288#endif
     289#if RWTH_SDC_DLT_B0036
     290  Bool      m_bUseDLT;
     291  Bool      m_bUseSDC;
     292#endif
    268293
    269294  Int       m_useScalingListId;                               ///< using quantization matrix
     
    273298  Char*     m_pchCameraParameterFile;                         ///< camera parameter file
    274299  Char*     m_pchBaseViewCameraNumbers;
     300#if !QC_MVHEVC_B0046
    275301  TAppComCamPara m_cCameraData;
    276 
     302#endif
    277303  Int       m_iCodedCamParPrecision;                          ///< precision for coding of camera parameters
    278304
     
    280306  Char*     m_pchVSOConfig;
    281307  Bool      m_bUseVSO;                                    ///< flag for using View Synthesis Optimization
    282 #if HHI_VSO_LS_TABLE
     308#if HHI_VSO_LS_TABLE_M23714
    283309  Bool      m_bVSOLSTable;                                ///< Depth QP dependent Lagrange parameter optimization (m23714)
    284310#endif
     
    313339#endif
    314340
    315 #if OL_DEPTHLIMIT_A0044
    316   Bool      m_bDepthPartitionLimiting;
     341#if OL_QTLIMIT_PREDCODING_B0068
     342  Bool      m_bUseQTLPC;                                      ///< flag for using depth QuadTree Limitation + Predictive Coding
    317343#endif
    318344
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncTop.cpp

    r193 r213  
    6767Void TAppEncTop::xInitLibCfg()
    6868{
    69 #if VIDYO_VPS_INTEGRATION
     69#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
     70#if !QC_MVHEVC_B0046
    7071  UInt layerId = 0;
     72#endif
    7173  // TODO: fix the assumption here that the temporal structures are all equal across all layers???
    7274  m_cVPS.setMaxTLayers( m_maxTempLayer[0] );
     75#if QC_MVHEVC_B0046
     76  m_cVPS.setMaxLayers( m_iNumberOfViews );
     77#else
    7378  m_cVPS.setMaxLayers( m_iNumberOfViews * (m_bUsingDepthMaps ? 2:1) );
     79#endif
    7480  for(Int i = 0; i < MAX_TLAYER; i++)
    7581  {
     
    8187  for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
    8288  {
     89#if VSP_N
     90#if FLEX_CODING_ORDER_M23723
     91      Bool isTextureFirst = false;
     92      if ( m_b3DVFlexOrder )
     93      {
     94        for ( Int ii=1; ii<12; ii+=2 )
     95        {
     96          Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0');
     97          if ( iViewIdxCfg == iViewIdx )
     98          {
     99            if ( m_pchMVCJointCodingOrder[ii-1]=='T' )
     100            {
     101              isTextureFirst = true;
     102            }
     103            else
     104            {
     105              assert(m_pchMVCJointCodingOrder[ii-1]=='D');
     106            }
     107            break;
     108          }
     109        }
     110      }
     111      else
     112      {
     113        isTextureFirst = true;
     114      }
     115#endif
     116#endif
    83117    m_frameRcvd.push_back(0);
    84118    m_acTEncTopList.push_back(new TEncTop);
     
    101135    m_acTEncTopList[iViewIdx]->setViewId                       ( iViewIdx );
    102136    m_acTEncTopList[iViewIdx]->setIsDepth                      ( false );
     137#if QC_MVHEVC_B0046
     138    m_acTEncTopList[iViewIdx]->setLayerId                      ( iViewIdx );
     139    m_cVPS.setViewId                                           ( m_aiVId[ iViewIdx ], iViewIdx );
     140#else
    103141    m_acTEncTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
    104142#if VIDYO_VPS_INTEGRATION
     
    113151#endif
    114152   
     153#if VSP_N
    115154    m_acTEncTopList[iViewIdx]->setCamParPrecision              ( m_cCameraData.getCamParsCodedPrecision  () );
    116155    m_acTEncTopList[iViewIdx]->setCamParInSliceHeader          ( m_cCameraData.getVaryingCameraParameters() );
    117156    m_acTEncTopList[iViewIdx]->setCodedScale                   ( m_cCameraData.getCodedScale             () );
    118157    m_acTEncTopList[iViewIdx]->setCodedOffset                  ( m_cCameraData.getCodedOffset            () );
     158#else
     159    m_acTEncTopList[iViewIdx]->setCamParPrecision              ( 0 );
     160    m_acTEncTopList[iViewIdx]->setCamParInSliceHeader          ( false );
     161    m_acTEncTopList[iViewIdx]->setCodedScale                   ( 0 );
     162    m_acTEncTopList[iViewIdx]->setCodedOffset                  ( 0 );
     163#endif
     164#endif   
    119165
    120166  //====== Coding Structure ========
     
    170216    m_acTEncTopList[iViewIdx]->setSearchRange                  ( m_iSearchRange );
    171217    m_acTEncTopList[iViewIdx]->setBipredSearchRange            ( m_bipredSearchRange );
    172 
     218#if DV_V_RESTRICTION_B0037
     219    m_acTEncTopList[iViewIdx]->setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction );
     220    m_acTEncTopList[iViewIdx]->setVerticalDisparitySearchRange( m_iVerticalDisparitySearchRange );
     221#endif
    173222  //====== Quality control ========
    174223    m_acTEncTopList[iViewIdx]->setMaxDeltaQP                   ( m_iMaxDeltaQP  );
     
    300349    m_acTEncTopList[iViewIdx]->setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag );
    301350    m_acTEncTopList[iViewIdx]->setUseSAO               ( m_abUseSAO[0]     );
     351#if LGE_ILLUCOMP_B0045
     352    m_acTEncTopList[iViewIdx]->setUseIC                ( m_bUseIC          );
     353#endif
    302354#if SAO_UNIT_INTERLEAVING
    303355    m_acTEncTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic);
     
    342394    m_acTEncTopList[iViewIdx]->setWaveFrontFlush             ( m_iWaveFrontFlush );
    343395    m_acTEncTopList[iViewIdx]->setWaveFrontSubstreams        ( m_iWaveFrontSubstreams );
     396#if TMVP_DEPTH_SWITCH
     397    m_acTEncTopList[iViewIdx]->setEnableTMVP                 ( m_enableTMVP[0] );
     398#else
    344399    m_acTEncTopList[iViewIdx]->setEnableTMVP ( m_enableTMVP );
     400#endif
    345401    m_acTEncTopList[iViewIdx]->setUseScalingListId           ( m_useScalingListId  );
    346402    m_acTEncTopList[iViewIdx]->setScalingListFile            ( m_scalingListFile   );
     
    364420    m_acTEncTopList[iViewIdx]->setUseDMM                     ( false );
    365421#endif
    366 #if OL_DEPTHLIMIT_A0044
    367     m_acTEncTopList[iViewIdx]->setUseDPL                     ( false );
     422#if OL_QTLIMIT_PREDCODING_B0068
     423    m_acTEncTopList[iViewIdx]->setUseQTLPC                   ( false );
    368424#endif
    369425#if HHI_MPI
    370426    m_acTEncTopList[iViewIdx]->setUseMVI( false );
     427#endif
     428#if RWTH_SDC_DLT_B0036
     429    m_acTEncTopList[iViewIdx]->setUseDLT                      ( false );
     430    m_acTEncTopList[iViewIdx]->setUseSDC                      ( false );
    371431#endif
    372432
     
    374434    m_acTEncTopList[iViewIdx]->setUseVSP( m_bUseVSP );
    375435    m_acTEncTopList[iViewIdx]->setVSPDepthDisable( m_bVSPDepthDisable );
     436#if FLEX_CODING_ORDER_M23723
     437    m_acTEncTopList[iViewIdx]->setIsFirstInView( isTextureFirst );
     438#else
     439    m_acTEncTopList[iViewIdx]->setIsFirstInView( true );
     440#endif
    376441#endif
    377442  }
     
    380445    for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
    381446    {
     447
     448#if FLEX_CODING_ORDER_M23723
     449      // Detect whether depth comes before than texture for this view
     450      Bool isDepthFirst = false;
     451      if ( m_b3DVFlexOrder )
     452      {
     453        for ( Int ii=1; ii<12; ii+=2 )
     454        {
     455          Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0');
     456          if ( iViewIdxCfg == iViewIdx )
     457          {
     458            if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view
     459            {
     460              isDepthFirst = true;
     461            }
     462            else
     463            {
     464              assert(m_pchMVCJointCodingOrder[ii-1]=='T');
     465            }
     466            break;
     467          }
     468        }
     469      }
     470#endif
     471
    382472      m_depthFrameRcvd.push_back(0);
    383473      m_acTEncDepthTopList.push_back(new TEncTop);
     
    400490      m_acTEncDepthTopList[iViewIdx]->setViewId                       ( iViewIdx );
    401491      m_acTEncDepthTopList[iViewIdx]->setIsDepth                      ( true );
     492#if QC_MVHEVC_B0046
     493      m_acTEncDepthTopList[iViewIdx]->setLayerId                      ( iViewIdx );
     494#else
    402495      m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
     496#endif
    403497#if VIDYO_VPS_INTEGRATION
    404498      layerId = iViewIdx * 2 + 1;
     
    410504      m_cVPS.setDependentLayer                                        ( layerId-1, layerId);
    411505#endif
     506
     507#if VSP_N
     508      m_acTEncDepthTopList[iViewIdx]->setCamParPrecision              ( m_cCameraData.getCamParsCodedPrecision  () );
     509      m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader          ( m_cCameraData.getVaryingCameraParameters() );
     510      m_acTEncDepthTopList[iViewIdx]->setCodedScale                   ( m_cCameraData.getCodedScale             () );
     511      m_acTEncDepthTopList[iViewIdx]->setCodedOffset                  ( m_cCameraData.getCodedOffset            () );
     512#else
    412513      m_acTEncDepthTopList[iViewIdx]->setCamParPrecision              ( 0 );
    413514      m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader          ( false );
    414515      m_acTEncDepthTopList[iViewIdx]->setCodedScale                   ( 0 );
    415516      m_acTEncDepthTopList[iViewIdx]->setCodedOffset                  ( 0 );
     517#endif
    416518
    417519      //====== Coding Structure ========
     
    467569      m_acTEncDepthTopList[iViewIdx]->setSearchRange                  ( m_iSearchRange );
    468570      m_acTEncDepthTopList[iViewIdx]->setBipredSearchRange            ( m_bipredSearchRange );
    469 
     571#if DV_V_RESTRICTION_B0037
     572      m_acTEncDepthTopList[iViewIdx]->setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction );
     573      m_acTEncDepthTopList[iViewIdx]->setVerticalDisparitySearchRange( m_iVerticalDisparitySearchRange );
     574#endif
    470575      //====== Quality control ========
    471576      m_acTEncDepthTopList[iViewIdx]->setMaxDeltaQP                   ( m_iMaxDeltaQP  );
     
    584689      m_acTEncDepthTopList[iViewIdx]->setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag );
    585690      m_acTEncDepthTopList[iViewIdx]->setUseSAO               ( m_abUseSAO[1]     );
     691#if LGE_ILLUCOMP_B0045
     692      m_acTEncDepthTopList[iViewIdx]->setUseIC                ( false     );
     693#endif
    586694#if SAO_UNIT_INTERLEAVING
    587695      m_acTEncDepthTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic);
     
    626734      m_acTEncDepthTopList[iViewIdx]->setWaveFrontFlush             ( m_iWaveFrontFlush );
    627735      m_acTEncDepthTopList[iViewIdx]->setWaveFrontSubstreams        ( m_iWaveFrontSubstreams );
     736#if TMVP_DEPTH_SWITCH
     737      m_acTEncDepthTopList[iViewIdx]->setEnableTMVP                 ( m_enableTMVP[1] );
     738#else
    628739      m_acTEncDepthTopList[iViewIdx]->setEnableTMVP ( m_enableTMVP );
     740#endif
    629741      m_acTEncDepthTopList[iViewIdx]->setUseScalingListId           ( m_useScalingListId  );
    630742      m_acTEncDepthTopList[iViewIdx]->setScalingListFile            ( m_scalingListFile   );
     
    648760    m_acTEncDepthTopList[iViewIdx]->setUseDMM                     ( m_bUseDMM );
    649761#endif
    650 #if OL_DEPTHLIMIT_A0044
    651     m_acTEncDepthTopList[iViewIdx]->setUseDPL                      (m_bDepthPartitionLimiting);
     762#if FLEX_CODING_ORDER_M23723 && HHI_DMM_PRED_TEX
     763    m_acTEncDepthTopList[iViewIdx]->setUseDMM34( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseDMM );
     764#endif
     765
     766#if OL_QTLIMIT_PREDCODING_B0068
     767    m_acTEncDepthTopList[iViewIdx]->setUseQTLPC                   (m_bUseQTLPC);
    652768#endif
    653769#if HHI_MPI
    654      m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
     770#if FLEX_CODING_ORDER_M23723
     771    m_acTEncDepthTopList[iViewIdx]->setUseMVI( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseMVI );
     772#else
     773    m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
     774#endif
     775#endif
     776#if RWTH_SDC_DLT_B0036
     777      m_acTEncDepthTopList[iViewIdx]->setUseDLT                   ( m_bUseDLT );
     778      m_acTEncDepthTopList[iViewIdx]->setUseSDC                   ( m_bUseSDC );
    655779#endif
    656780
     
    658782      m_acTEncDepthTopList[iViewIdx]->setUseVSP( m_bUseVSP );
    659783      m_acTEncDepthTopList[iViewIdx]->setVSPDepthDisable( m_bVSPDepthDisable );
     784#if FLEX_CODING_ORDER_M23723
     785      m_acTEncDepthTopList[iViewIdx]->setIsFirstInView( isDepthFirst );
     786#else
     787      m_acTEncDepthTopList[iViewIdx]->setIsFirstInView( false );
     788#endif
    660789#endif
    661790    }
     
    677806    if ( m_uiVSOMode == 4 )
    678807    {
    679 #if HHI_VSO_SPEEDUP_A0033
    680808#if LGE_VSO_EARLY_SKIP_A0093
    681809      m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0, m_bVSOEarlySkip );
    682810#else
    683811      m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0 );
    684 #endif
    685 #else
    686       m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_iSourceHeight, LOG2_DISP_PREC_LUT, 0 );
    687812#endif
    688813
     
    820945  {
    821946    m_acTEncTopList[iViewIdx]->init( this );
     947#if QC_MVHEVC_B0046
     948  //set setNumDirectRefLayer
     949  Int iNumDirectRef = m_acTEncTopList[iViewIdx]->getSPS()->getNumberOfUsableInterViewRefs();
     950  m_acTEncTopList[iViewIdx]->getEncTop()->getVPS()->setNumDirectRefLayer(iNumDirectRef, iViewIdx);
     951  for(Int iNumIvRef = 0; iNumIvRef < iNumDirectRef; iNumIvRef ++)
     952  {
     953    Int iLayerId = m_acTEncTopList[iViewIdx]->getSPS()->getUsableInterViewRef(iNumIvRef);
     954    m_acTEncTopList[iViewIdx]->getEncTop()->getVPS()->setDirectRefLayerId( iLayerId + iViewIdx, iViewIdx, iNumIvRef);
     955  }
     956#endif
    822957  }
    823958  for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
     
    861996  TComPicYuv*       pcPicYuvOrg = new TComPicYuv;
    862997  TComPicYuv*       pcDepthPicYuvOrg = new TComPicYuv;
     998#if !QC_MVHEVC_B0046
    863999  TComPicYuv*       pcPdmDepthOrg    = new TComPicYuv;
     1000#endif
    8641001  TComPicYuv*       pcPicYuvRec = NULL;
    8651002  TComPicYuv*       pcDepthPicYuvRec = NULL;
    866 
     1003 
    8671004  // initialize internal class & member variables
    8681005  xInitLibCfg();
     
    8841021    eos.push_back( false );
    8851022    depthEos.push_back( false );
     1023   
     1024#if RWTH_SDC_DLT_B0036
     1025    if( m_bUsingDepthMaps && m_bUseDLT )
     1026      xAnalyzeInputBaseDepth(iViewIdx, m_iIntraPeriod);
     1027#endif
    8861028  }
    8871029
     
    9571099    {
    9581100      Int  iNumEncoded = 0;
     1101#if !QC_MVHEVC_B0046
    9591102      UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId );
    9601103      if ( iNextPoc < m_iFrameToBeEncoded )
     
    9621105        m_cCameraData.update( iNextPoc );
    9631106      }
     1107#endif
     1108
     1109#if FLEX_CODING_ORDER_M23723
     1110      if (m_b3DVFlexOrder)
     1111      {
     1112        Int  iNumDepthEncoded = 0;
     1113        iNumEncoded = 0;
     1114        Int i=0;
     1115        Int iViewIdx=0;
     1116        Int iNumberofDepthViews = m_bUsingDepthMaps?m_iNumberOfViews:0;
     1117        for (Int j=0; j < (m_iNumberOfViews+ iNumberofDepthViews); j++ )
     1118        {
     1119          if (m_pchMVCJointCodingOrder[i]=='T')
     1120          {
     1121
     1122            i++;
     1123            assert(isdigit(m_pchMVCJointCodingOrder[i]));
     1124            iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     1125
     1126#if VSP_SLICE_HEADER && !VSP_CFG
     1127            if( m_acTEncTopList[iViewIdx]->getUseVSP() ) m_acTEncTopList[iViewIdx]->setUseVSP( (gopId%VSP_FRAME_INTERVAL==0) );
     1128#endif
     1129
     1130#if VSP_N
     1131#if VSP_SLICE_HEADER
     1132            if( m_acTEncTopList[iViewIdx]->getUseVSP() )
     1133#endif
     1134            if( m_bUsingDepthMaps )
     1135            {
     1136              // Forward Warping
     1137              xStoreVSPInBuffer( m_acTEncTopList[iViewIdx]->getVSPBuf(), m_acTEncTopList[iViewIdx]->getVSPAvailBuf(), iViewIdx, false, gopId );
     1138            }
     1139#endif
     1140
     1141            m_acTEncTopList[iViewIdx]->encode( eos[iViewIdx], pcPicYuvOrg, *m_picYuvRec[iViewIdx], outputAccessUnits, iNumEncoded, gopId );
     1142            xWriteOutput(bitstreamFile, iNumEncoded, outputAccessUnits, iViewIdx, false);
     1143            outputAccessUnits.clear();
     1144            i++;
     1145          }
     1146          else if ( m_pchMVCJointCodingOrder[i] == 'D')
     1147          {
     1148
     1149            i++;
     1150            if( m_bUsingDepthMaps )
     1151            {
     1152              assert(isdigit(m_pchMVCJointCodingOrder[i]));
     1153              iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     1154#if SAIT_VSO_EST_A0033
     1155              if( m_bUseVSO && iNextPoc < m_iFrameToBeEncoded )
     1156              {
     1157                m_cCameraData.xSetDispCoeff( iNextPoc, iViewIdx );
     1158                m_acTEncDepthTopList[iViewIdx]->setDispCoeff( m_cCameraData.getDispCoeff() );
     1159              }
     1160#endif
     1161
     1162#if VSP_SLICE_HEADER && !VSP_CFG
     1163              if( m_acTEncDepthTopList[iViewIdx]->getUseVSP() ) m_acTEncDepthTopList[iViewIdx]->setUseVSP( (gopId%VSP_FRAME_INTERVAL==0) );
     1164#endif
     1165
     1166#if VSP_N
     1167#if VSP_SLICE_HEADER
     1168              if( m_acTEncDepthTopList[iViewIdx]->getUseVSP() )
     1169              if( !m_acTEncDepthTopList[iViewIdx]->getVSPDepthDisable() )
     1170#endif
     1171                xStoreVSPInBuffer( m_acTEncDepthTopList[iViewIdx]->getVSPBuf(), m_acTEncDepthTopList[iViewIdx]->getVSPAvailBuf(), iViewIdx, true, gopId );
     1172#endif
     1173
     1174              m_acTEncDepthTopList[iViewIdx]->encode( depthEos[iViewIdx], pcDepthPicYuvOrg, *m_picYuvDepthRec[iViewIdx], outputAccessUnits, iNumDepthEncoded, gopId );
     1175              xWriteOutput(bitstreamFile, iNumDepthEncoded, outputAccessUnits, iViewIdx, true);
     1176              outputAccessUnits.clear();
     1177              i++;
     1178            }
     1179          }
     1180        }
     1181      }
     1182      else
     1183      {
     1184
     1185#endif
    9641186      for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
    9651187      {
     
    10081230        }
    10091231      }
     1232 
     1233#if FLEX_CODING_ORDER_M23723
     1234      }
     1235#endif
     1236
    10101237#if HHI_INTERVIEW_SKIP || HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED
    10111238      for( Int iViewIdx = 0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
     
    10401267  pcDepthPicYuvOrg = NULL;
    10411268 
    1042 #if FIX_MEM_LEAKS
     1269#if !QC_MVHEVC_B0046
     1270#if FIX_DEL_NULLPTR
     1271  if ( pcPdmDepthOrg != NULL && m_uiMultiviewMvRegMode )
     1272#else
    10431273  if ( pcPdmDepthOrg != NULL )
     1274#endif
    10441275  {
    10451276    pcPdmDepthOrg->destroy();
     
    10481279  };
    10491280#endif
    1050 
    10511281 
    10521282  for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
     
    12521482    case NAL_UNIT_CODED_SLICE:
    12531483#if H0566_TLA
     1484#if !QC_REM_IDV_B0046
    12541485    case NAL_UNIT_CODED_SLICE_IDV:
     1486#endif
    12551487    case NAL_UNIT_CODED_SLICE_TLA:
    12561488    case NAL_UNIT_CODED_SLICE_CRA:
     
    13061538#endif
    13071539#if HHI_VSO
    1308 #if HHI_VSO_SPEEDUP_A0033
    13091540Void TAppEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset )
    13101541{
    1311 #if FIX_VSO_SETUP
    13121542  m_cRendererModel.setupPart( iHorOffset, Min( g_uiMaxCUHeight, m_iSourceHeight - iHorOffset ) );
    1313 #else
    1314   m_cRendererModel.setHorOffset( iHorOffset );
    1315 #endif
    1316 #else
    1317 Void TAppEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent )
    1318 {
    1319 #endif
    13201543  Int iEncViewSIdx = m_cCameraData.getBaseId2SortedId()[ iEncViewIdx ];
    13211544
     
    14551678  return pcPic;
    14561679};
     1680 
     1681#if RWTH_SDC_DLT_B0036
     1682Void TAppEncTop::xAnalyzeInputBaseDepth(Int iViewIdx, UInt uiNumFrames)
     1683{
     1684  TComPicYuv*       pcDepthPicYuvOrg = new TComPicYuv;
     1685  // allocate original YUV buffer
     1686  pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
     1687 
     1688  TVideoIOYuv* depthVideoFile = new TVideoIOYuv;
     1689 
     1690  UInt uiMaxDepthValue = g_uiIBDI_MAX;
     1691 
     1692  Bool abValidDepths[256];
     1693 
     1694  depthVideoFile->open( m_pchDepthInputFileList[iViewIdx], false, m_uiInputBitDepth, m_uiInternalBitDepth );  // read  mode
     1695 
     1696  // initialize boolean array
     1697  for(Int p=0; p<=uiMaxDepthValue; p++)
     1698    abValidDepths[p] = false;
     1699 
     1700  Int iHeight   = pcDepthPicYuvOrg->getHeight();
     1701  Int iWidth    = pcDepthPicYuvOrg->getWidth();
     1702  Int iStride   = pcDepthPicYuvOrg->getStride();
     1703 
     1704  Pel* pInDM    = pcDepthPicYuvOrg->getLumaAddr();
     1705 
     1706  for(Int uiFrame=0; uiFrame < uiNumFrames; uiFrame++ )
     1707  {
     1708    depthVideoFile->read( pcDepthPicYuvOrg, m_aiPad, false );
     1709   
     1710    // check all pixel values
     1711    for (Int i=0; i<iHeight; i++)
     1712    {
     1713      Int rowOffset = i*iStride;
     1714     
     1715      for (Int j=0; j<iWidth; j++)
     1716      {
     1717        Pel depthValue = pInDM[rowOffset+j];
     1718        abValidDepths[depthValue] = true;
     1719      }
     1720    }
     1721  }
     1722 
     1723  depthVideoFile->close();
     1724 
     1725  pcDepthPicYuvOrg->destroy();
     1726  delete pcDepthPicYuvOrg;
     1727 
     1728  // convert boolean array to idx2Depth LUT
     1729  UInt* auiIdx2DepthValue = (UInt*) calloc(uiMaxDepthValue, sizeof(UInt));
     1730  UInt uiNumDepthValues = 0;
     1731  for(UInt p=0; p<=uiMaxDepthValue; p++)
     1732  {
     1733    if( abValidDepths[p] == true)
     1734    {
     1735      auiIdx2DepthValue[uiNumDepthValues++] = p;
     1736    }
     1737  }
     1738 
     1739  if( uiNumFrames == 0 || ceil(Log2(uiNumDepthValues)) == ceil(Log2(g_uiIBDI_MAX)) )
     1740  {
     1741    // don't use DLT
     1742    m_acTEncDepthTopList[iViewIdx]->setUseDLT(false);
     1743    m_acTEncDepthTopList[iViewIdx]->getSPS()->setUseDLT(false);
     1744  }
     1745 
     1746  // assign LUT
     1747  if( m_acTEncDepthTopList[iViewIdx]->getUseDLT() )
     1748    m_acTEncDepthTopList[iViewIdx]->getSPS()->setDepthLUTs(auiIdx2DepthValue, uiNumDepthValues);
     1749  else
     1750    m_acTEncDepthTopList[iViewIdx]->getSPS()->setDepthLUTs();
     1751 
     1752  // free temporary memory
     1753  free(auiIdx2DepthValue);
     1754}
     1755#endif
    14571756
    14581757#if VSP_N
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncTop.h

    r166 r213  
    8787#endif
    8888
    89 #if VIDYO_VPS_INTEGRATION
     89#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    9090  TComVPS                     m_cVPS;
    9191#endif
     
    141141#endif
    142142#if HHI_VSO
    143 #if HHI_VSO_SPEEDUP_A0033
    144143  Void                  setupRenModel    ( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset );
    145 #else
    146   Void                  setupRenModel    ( Int iPoc, Int iEncViewIdx, Int iEncContent );
    147 #endif
    148144#endif
    149145 
     146#if QC_MVHEVC_B0046
     147  TComVPS*          getVPS()  { return &m_cVPS; }
     148#endif
    150149#if VIDYO_VPS_INTEGRATION
    151150  TComVPS*          getVPS()  { return &m_cVPS; }
     
    166165  Void  xStoreVSORefPicsInBuffer();                                                   ///< read in External Ref pic from file and store in buffer
    167166#endif
     167 
     168#if RWTH_SDC_DLT_B0036
     169  Void  xAnalyzeInputBaseDepth(Int iViewIdx, UInt uiNumFrames);
     170#endif
    168171
    169172#if VSP_N
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/RendererMain.cpp

    r100 r213  
    4343int main(int argc, char* argv[])
    4444  {
     45#if !QC_MVHEVC_B0046
    4546  TAppRendererTop  cTAppRendererTop;
    4647
     
    7879
    7980  return 0;
     81#endif
    8082}
    8183
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/TAppRendererCfg.cpp

    r100 r213  
    5959// Constructor / destructor / initialization / destroy
    6060// ====================================================================================================================
    61 
     61#if !QC_MVHEVC_B0046
    6262TAppRendererCfg::TAppRendererCfg()
    6363{
     
    120120
    121121    /* File I/O */
    122     ("VideoInputFileBaseName",  m_pchVideoInputFileBaseName,  (Char*) 0, "Basename to generate video input file names")
    123     ("DepthInputFileBaseName",  m_pchDepthInputFileBaseName,  (Char*) 0, "Basename to generate depth input file names")
    124     ("SynthOutputFileBaseName", m_pchSynthOutputFileBaseName, (Char*) 0, "Basename to generate synthesized output file names")
     122    ("VideoInputFileBaseName,v",  m_pchVideoInputFileBaseName,  (Char*) 0, "Basename to generate video input file names")
     123    ("DepthInputFileBaseName,d",  m_pchDepthInputFileBaseName,  (Char*) 0, "Basename to generate depth input file names")
     124    ("SynthOutputFileBaseName,s", m_pchSynthOutputFileBaseName, (Char*) 0, "Basename to generate synthesized output file names")
    125125    ("ContOutputFileNumbering", m_bContOutputFileNumbering  ,  false   , "Continuous Output File Numbering")
    126126    ("Sweep"                  , m_bSweep                    ,  false   , "Store all views in first Output File")
     
    137137
    138138    /* Camera Specification */
    139     ("CameraParameterFile,cpf", m_pchCameraParameterFile,          (Char *) 0, "Camera Parameter File Name")
     139    ("CameraParameterFile,-cpf", m_pchCameraParameterFile,          (Char *) 0, "Camera Parameter File Name")
    140140    ("BaseViewCameraNumbers"  , m_pchBaseViewCameraNumbers,        (Char *) 0, "Numbers of base views")
    141141    ("SynthViewCameraNumbers" , m_pchSynthViewCameraNumbers,       (Char *) 0, "Numbers of views to synthesis")
     
    516516  g_uiIBDI_MAX     = ((1<<(g_uiBitDepth+g_uiBitIncrement))-1);
    517517}
     518#endif
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/TAppRendererCfg.h

    r100 r213  
    5050#include <string>
    5151#include <vector>
    52 
     52#if !QC_MVHEVC_B0046
    5353// ====================================================================================================================
    5454// Class definition
     
    134134
    135135
    136 
     136#endif
    137137#endif // __TAppRENDERERCFG__
    138138
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/TAppRendererTop.cpp

    r193 r213  
    4545// Constructor / destructor / initialization / destroy
    4646// ====================================================================================================================
    47 
     47#if !QC_MVHEVC_B0046
    4848TAppRendererTop::TAppRendererTop()
    4949{
     
    532532#endif
    533533
    534 #if HHI_VSO_SPEEDUP_A0033
    535 #if FIX_VSO_SETUP
    536534    cCurModel.setupPart( 0, m_iSourceHeight  );
    537 #else
    538     cCurModel.setHorOffset( 0 );
    539 #endif
    540 #endif
    541535
    542536    for ( Int iViewIdx = 0; iViewIdx < m_iNumberOfInputViews; iViewIdx++ )
     
    713707
    714708  AOT( m_iLog2SamplingFactor != 0 );
    715 #if HHI_VSO_SPEEDUP_A0033
    716 #if FIX_VSO_SETUP
    717709  cCurModel.setupPart( 0, m_iSourceHeight  );
    718 #else
    719   cCurModel.setHorOffset( 0 );
    720 #endif
    721 #endif
    722710#if LGE_VSO_EARLY_SKIP_A0093
    723711  cCurModel.create( m_iNumberOfInputViews, m_iNumberOfOutputViews, m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin, false );
     
    10461034
    10471035}
     1036#endif
  • branches/HTM-4.0.1-VSP-dev0/source/App/TAppRenderer/TAppRendererTop.h

    r100 r213  
    5050#include "../../Lib/TLibRenderer/TRenModel.h"
    5151
    52 
     52#if !QC_MVHEVC_B0046
    5353// ====================================================================================================================
    5454// Class definition
     
    8787};// END CLASS DEFINITION TAppRendererTop
    8888
    89 #endif // __TAppRendererTOP__
     89#endif
    9090
     91#endif
Note: See TracChangeset for help on using the changeset viewer.