Changeset 200 in 3DVCSoftware for branches/HTM-5.0-Nokia/source/App/TAppEncoder


Ignore:
Timestamp:
3 Dec 2012, 16:57:58 (12 years ago)
Author:
nokia
Message:

Reintegration of Flexible Coding Order to 3DV-HTM v5.1
To enable following params are required:
FCO : 1
FCOCodingOrder : T0D0D1D2T1T2
VSOConfig: [ox0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][ox2 B(cc1) I(s1.25 s1.5 s1.75)]

Location:
branches/HTM-5.0-Nokia/source/App/TAppEncoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-5.0-Nokia/source/App/TAppEncoder/TAppEncCfg.cpp

    r197 r200  
    111111  if (m_pchBitstreamFile != NULL)
    112112    free (m_pchBitstreamFile) ;
     113
     114#if FLEX_CODING_ORDER
     115  if (m_pchMVCJointCodingOrder != NULL)
     116  {
     117    free(m_pchMVCJointCodingOrder) ;
     118  }
     119#endif
     120
    113121#if HHI_VSO
    114122  if (  m_pchVSOConfig != NULL)
     
    203211  string cfg_RowHeight;
    204212  string cfg_ScalingListFile;
     213
     214 #if FLEX_CODING_ORDER
     215  string cfg_JointCodingOrdering;
     216#endif
     217
    205218  po::Options opts;
    206219  opts.addOptions()
     
    246259 
    247260  ("NumberOfViews",         m_iNumberOfViews,    0, "Number of views")
     261
     262#if FLEX_CODING_ORDER
     263  ("FCO",               m_b3DVFlexOrder,   false, "flexible coding order flag" )
     264  ("FCOCodingOrder",   cfg_JointCodingOrdering,  string(""), "The coding order for joint texture-depth coding")
     265#endif
     266
    248267  /* Unit definition parameters */
    249268  ("MaxCUWidth",          m_uiMaxCUWidth,  64u)
     
    533552  m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
    534553  m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
     554 
     555#if FLEX_CODING_ORDER
     556  m_pchMVCJointCodingOrder= cfg_JointCodingOrdering.empty()?NULL:strdup(cfg_JointCodingOrdering.c_str());
     557  // If flexible order is enabled and if depth comes before the texture for a view, disable VSO
     558#if HHI_VSO && DISABLE_FCO_FOR_VSO
     559  Bool depthComesFirst = false;
     560  int iter = 0;
     561  if ( m_b3DVFlexOrder )
     562  {
     563    for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
     564    {
     565      iter = 0;
     566      for ( Int ii=1; ii<12; ii+=2 )
     567      {
     568        Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0');
     569        if ( iViewIdxCfg == iViewIdx )
     570        {
     571          iter ++;
     572          if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view
     573          {
     574            if(iter == 1)
     575           {
     576            depthComesFirst = true;
     577            break;
     578           }
     579          }
     580          else
     581          {
     582            assert(m_pchMVCJointCodingOrder[ii-1]=='T');
     583          }
     584        }
     585      }
     586    }
     587  }
     588  if (depthComesFirst)
     589  {
     590    m_bUseVSO = false;
     591  }
     592#endif
     593#endif
     594
     595
     596
     597
    535598 
    536599  m_pchColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str());
  • branches/HTM-5.0-Nokia/source/App/TAppEncoder/TAppEncCfg.h

    r197 r200  
    8888  Int       m_iNumberOfViews;                                 ///< number Views to Encode
    8989  Bool      m_bUsingDepthMaps;
     90 
     91#if FLEX_CODING_ORDER
     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)
  • branches/HTM-5.0-Nokia/source/App/TAppEncoder/TAppEncTop.cpp

    r197 r200  
    400400    for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
    401401    {
     402
     403#if FLEX_CODING_ORDER
     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
    402427      m_depthFrameRcvd.push_back(0);
    403428      m_acTEncDepthTopList.push_back(new TEncTop);
     
    682707    m_acTEncDepthTopList[iViewIdx]->setUseDMM                     ( m_bUseDMM );
    683708#endif
     709
     710#if FLEX_CODING_ORDER && HHI_DMM_PRED_TEX
     711    m_acTEncDepthTopList[iViewIdx]->setUseDMM34( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseDMM );
     712#endif
     713
    684714#if OL_QTLIMIT_PREDCODING_B0068
    685715    m_acTEncDepthTopList[iViewIdx]->setUseQTLPC                   (m_bUseQTLPC);
    686716#endif
     717
    687718#if HHI_MPI
    688      m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
    689 #endif
     719#if FLEX_CODING_ORDER
     720    m_acTEncDepthTopList[iViewIdx]->setUseMVI( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseMVI );
     721#else
     722    m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
     723#endif
     724#endif
     725
     726
    690727#if RWTH_SDC_DLT_B0036
    691728      m_acTEncDepthTopList[iViewIdx]->setUseDLT                   ( m_bUseDLT );
     
    10031040      }
    10041041#endif
     1042
     1043#if FLEX_CODING_ORDER
     1044      if (m_b3DVFlexOrder)
     1045      {
     1046        Int  iNumDepthEncoded = 0;
     1047        iNumEncoded = 0;
     1048        Int i=0;
     1049        Int iViewIdx=0;
     1050        Int iNumberofDepthViews = m_bUsingDepthMaps?m_iNumberOfViews:0;
     1051        for (Int j=0; j < (m_iNumberOfViews+ iNumberofDepthViews); j++ )
     1052        {
     1053          if (m_pchMVCJointCodingOrder[i]=='T')
     1054          {
     1055
     1056            i++;
     1057            assert(isdigit(m_pchMVCJointCodingOrder[i]));
     1058            iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     1059
     1060            m_acTEncTopList[iViewIdx]->encode( eos[iViewIdx], pcPicYuvOrg, *m_picYuvRec[iViewIdx], outputAccessUnits, iNumEncoded, gopId );
     1061            xWriteOutput(bitstreamFile, iNumEncoded, outputAccessUnits, iViewIdx, false);
     1062            outputAccessUnits.clear();
     1063            i++;
     1064          }
     1065          else if ( m_pchMVCJointCodingOrder[i] == 'D')
     1066          {
     1067
     1068            i++;
     1069            if( m_bUsingDepthMaps )
     1070            {
     1071              assert(isdigit(m_pchMVCJointCodingOrder[i]));
     1072              iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     1073#if SAIT_VSO_EST_A0033
     1074              if( m_bUseVSO && iNextPoc < m_iFrameToBeEncoded )
     1075              {
     1076                m_cCameraData.xSetDispCoeff( iNextPoc, iViewIdx );
     1077                m_acTEncDepthTopList[iViewIdx]->setDispCoeff( m_cCameraData.getDispCoeff() );
     1078              }
     1079#endif
     1080              m_acTEncDepthTopList[iViewIdx]->encode( depthEos[iViewIdx], pcDepthPicYuvOrg, *m_picYuvDepthRec[iViewIdx], outputAccessUnits, iNumDepthEncoded, gopId );
     1081              xWriteOutput(bitstreamFile, iNumDepthEncoded, outputAccessUnits, iViewIdx, true);
     1082              outputAccessUnits.clear();
     1083              i++;
     1084            }
     1085          }
     1086        }
     1087      }
     1088      else
     1089      {
     1090
     1091#endif
     1092
     1093//original code
     1094
     1095
     1096
     1097
     1098
     1099
    10051100      for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
    10061101      {
     
    10261121        }
    10271122      }
     1123 
     1124#if FLEX_CODING_ORDER
     1125      }
     1126#endif
     1127
    10281128#if HHI_INTERVIEW_SKIP || HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED
    10291129      for( Int iViewIdx = 0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
Note: See TracChangeset for help on using the changeset viewer.