Changeset 210 in 3DVCSoftware for trunk/source/App/TAppEncoder/TAppEncTop.cpp


Ignore:
Timestamp:
11 Dec 2012, 18:52:43 (12 years ago)
Author:
tech
Message:

Reintegrated /branches/HTM-5.0-dev0 rev. 207.

File:
1 edited

Legend:

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

    r189 r210  
    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  {
     
    101107    m_acTEncTopList[iViewIdx]->setViewId                       ( iViewIdx );
    102108    m_acTEncTopList[iViewIdx]->setIsDepth                      ( false );
     109#if QC_MVHEVC_B0046
     110    m_acTEncTopList[iViewIdx]->setLayerId                      ( iViewIdx );
     111    m_cVPS.setViewId                                           ( m_aiVId[ iViewIdx ], iViewIdx );
     112#else
    103113    m_acTEncTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
    104114#if VIDYO_VPS_INTEGRATION
     
    117127    m_acTEncTopList[iViewIdx]->setCodedScale                   ( m_cCameraData.getCodedScale             () );
    118128    m_acTEncTopList[iViewIdx]->setCodedOffset                  ( m_cCameraData.getCodedOffset            () );
     129#endif   
    119130
    120131  //====== Coding Structure ========
     
    170181    m_acTEncTopList[iViewIdx]->setSearchRange                  ( m_iSearchRange );
    171182    m_acTEncTopList[iViewIdx]->setBipredSearchRange            ( m_bipredSearchRange );
    172 
     183#if DV_V_RESTRICTION_B0037
     184    m_acTEncTopList[iViewIdx]->setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction );
     185    m_acTEncTopList[iViewIdx]->setVerticalDisparitySearchRange( m_iVerticalDisparitySearchRange );
     186#endif
    173187  //====== Quality control ========
    174188    m_acTEncTopList[iViewIdx]->setMaxDeltaQP                   ( m_iMaxDeltaQP  );
     
    386400    for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
    387401    {
     402
     403#if FLEX_CODING_ORDER_M23723
     404      // Detect whether depth comes before than texture for this view
     405      Bool isDepthFirst = false;
     406      if ( m_b3DVFlexOrder )
     407      {
     408        for ( Int ii=1; ii<12; ii+=2 )
     409        {
     410          Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0');
     411          if ( iViewIdxCfg == iViewIdx )
     412          {
     413            if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view
     414            {
     415              isDepthFirst = true;
     416            }
     417            else
     418            {
     419              assert(m_pchMVCJointCodingOrder[ii-1]=='T');
     420            }
     421            break;
     422          }
     423        }
     424      }
     425#endif
     426
    388427      m_depthFrameRcvd.push_back(0);
    389428      m_acTEncDepthTopList.push_back(new TEncTop);
     
    406445      m_acTEncDepthTopList[iViewIdx]->setViewId                       ( iViewIdx );
    407446      m_acTEncDepthTopList[iViewIdx]->setIsDepth                      ( true );
     447#if QC_MVHEVC_B0046
     448      m_acTEncDepthTopList[iViewIdx]->setLayerId                      ( iViewIdx );
     449#else
    408450      m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
     451#endif
    409452#if VIDYO_VPS_INTEGRATION
    410453      layerId = iViewIdx * 2 + 1;
     
    473516      m_acTEncDepthTopList[iViewIdx]->setSearchRange                  ( m_iSearchRange );
    474517      m_acTEncDepthTopList[iViewIdx]->setBipredSearchRange            ( m_bipredSearchRange );
    475 
     518#if DV_V_RESTRICTION_B0037
     519      m_acTEncDepthTopList[iViewIdx]->setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction );
     520      m_acTEncDepthTopList[iViewIdx]->setVerticalDisparitySearchRange( m_iVerticalDisparitySearchRange );
     521#endif
    476522      //====== Quality control ========
    477523      m_acTEncDepthTopList[iViewIdx]->setMaxDeltaQP                   ( m_iMaxDeltaQP  );
     
    661707    m_acTEncDepthTopList[iViewIdx]->setUseDMM                     ( m_bUseDMM );
    662708#endif
     709#if FLEX_CODING_ORDER_M23723 && HHI_DMM_PRED_TEX
     710    m_acTEncDepthTopList[iViewIdx]->setUseDMM34( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseDMM );
     711#endif
     712
    663713#if OL_QTLIMIT_PREDCODING_B0068
    664714    m_acTEncDepthTopList[iViewIdx]->setUseQTLPC                   (m_bUseQTLPC);
    665715#endif
    666716#if HHI_MPI
     717#if FLEX_CODING_ORDER_M23723
     718    m_acTEncDepthTopList[iViewIdx]->setUseMVI( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseMVI );
     719#else
    667720     m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
     721#endif
    668722#endif
    669723#if RWTH_SDC_DLT_B0036
     
    821875  {
    822876    m_acTEncTopList[iViewIdx]->init( this );
     877#if QC_MVHEVC_B0046
     878  //set setNumDirectRefLayer
     879  Int iNumDirectRef = m_acTEncTopList[iViewIdx]->getSPS()->getNumberOfUsableInterViewRefs();
     880  m_acTEncTopList[iViewIdx]->getEncTop()->getVPS()->setNumDirectRefLayer(iNumDirectRef, iViewIdx);
     881  for(Int iNumIvRef = 0; iNumIvRef < iNumDirectRef; iNumIvRef ++)
     882  {
     883    Int iLayerId = m_acTEncTopList[iViewIdx]->getSPS()->getUsableInterViewRef(iNumIvRef);
     884    m_acTEncTopList[iViewIdx]->getEncTop()->getVPS()->setDirectRefLayerId( iLayerId + iViewIdx, iViewIdx, iNumIvRef);
     885  }
     886#endif
    823887  }
    824888  for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
     
    862926  TComPicYuv*       pcPicYuvOrg = new TComPicYuv;
    863927  TComPicYuv*       pcDepthPicYuvOrg = new TComPicYuv;
     928#if !QC_MVHEVC_B0046
    864929  TComPicYuv*       pcPdmDepthOrg    = new TComPicYuv;
     930#endif
    865931  TComPicYuv*       pcPicYuvRec = NULL;
    866932  TComPicYuv*       pcDepthPicYuvRec = NULL;
     
    9631029    {
    9641030      Int  iNumEncoded = 0;
     1031#if !QC_MVHEVC_B0046
    9651032      UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId );
    9661033      if ( iNextPoc < m_iFrameToBeEncoded )
     
    9681035      m_cCameraData.update( iNextPoc );
    9691036      }
     1037#endif
     1038
     1039#if FLEX_CODING_ORDER_M23723
     1040      if (m_b3DVFlexOrder)
     1041      {
     1042        Int  iNumDepthEncoded = 0;
     1043        iNumEncoded = 0;
     1044        Int i=0;
     1045        Int iViewIdx=0;
     1046        Int iNumberofDepthViews = m_bUsingDepthMaps?m_iNumberOfViews:0;
     1047        for (Int j=0; j < (m_iNumberOfViews+ iNumberofDepthViews); j++ )
     1048        {
     1049          if (m_pchMVCJointCodingOrder[i]=='T')
     1050          {
     1051
     1052            i++;
     1053            assert(isdigit(m_pchMVCJointCodingOrder[i]));
     1054            iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     1055
     1056            m_acTEncTopList[iViewIdx]->encode( eos[iViewIdx], pcPicYuvOrg, *m_picYuvRec[iViewIdx], outputAccessUnits, iNumEncoded, gopId );
     1057            xWriteOutput(bitstreamFile, iNumEncoded, outputAccessUnits, iViewIdx, false);
     1058            outputAccessUnits.clear();
     1059            i++;
     1060          }
     1061          else if ( m_pchMVCJointCodingOrder[i] == 'D')
     1062          {
     1063
     1064            i++;
     1065            if( m_bUsingDepthMaps )
     1066            {
     1067              assert(isdigit(m_pchMVCJointCodingOrder[i]));
     1068              iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     1069#if SAIT_VSO_EST_A0033
     1070              if( m_bUseVSO && iNextPoc < m_iFrameToBeEncoded )
     1071              {
     1072                m_cCameraData.xSetDispCoeff( iNextPoc, iViewIdx );
     1073                m_acTEncDepthTopList[iViewIdx]->setDispCoeff( m_cCameraData.getDispCoeff() );
     1074              }
     1075#endif
     1076              m_acTEncDepthTopList[iViewIdx]->encode( depthEos[iViewIdx], pcDepthPicYuvOrg, *m_picYuvDepthRec[iViewIdx], outputAccessUnits, iNumDepthEncoded, gopId );
     1077              xWriteOutput(bitstreamFile, iNumDepthEncoded, outputAccessUnits, iViewIdx, true);
     1078              outputAccessUnits.clear();
     1079              i++;
     1080            }
     1081          }
     1082        }
     1083      }
     1084      else
     1085      {
     1086
     1087#endif
    9701088      for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
    9711089      {
     
    9911109        }
    9921110      }
     1111 
     1112#if FLEX_CODING_ORDER_M23723
     1113      }
     1114#endif
     1115
    9931116#if HHI_INTERVIEW_SKIP || HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED
    9941117      for( Int iViewIdx = 0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
     
    10231146  pcDepthPicYuvOrg = NULL;
    10241147 
     1148#if !QC_MVHEVC_B0046
     1149#if FIX_DEL_NULLPTR
     1150  if ( pcPdmDepthOrg != NULL && m_uiMultiviewMvRegMode )
     1151#else
    10251152  if ( pcPdmDepthOrg != NULL )
     1153#endif
    10261154  {
    10271155    pcPdmDepthOrg->destroy();
     
    10291157    pcPdmDepthOrg = NULL;
    10301158  };
    1031 
     1159#endif
    10321160 
    10331161  for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
     
    12331361    case NAL_UNIT_CODED_SLICE:
    12341362#if H0566_TLA
     1363#if !QC_REM_IDV_B0046
    12351364    case NAL_UNIT_CODED_SLICE_IDV:
     1365#endif
    12361366    case NAL_UNIT_CODED_SLICE_TLA:
    12371367    case NAL_UNIT_CODED_SLICE_CRA:
Note: See TracChangeset for help on using the changeset viewer.