Changeset 34 in 3DVCSoftware for branches/0.3-nokia/source/App/TAppEncoder


Ignore:
Timestamp:
18 Mar 2012, 10:42:07 (13 years ago)
Author:
nokia
Message:

FlexCO upload

Location:
branches/0.3-nokia/source/App/TAppEncoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/0.3-nokia/source/App/TAppEncoder/TAppEncCfg.cpp

    r21 r34  
    110110    free (m_pchBitstreamFile) ;
    111111
     112#if FLEX_CODING_ORDER
     113  if (m_pchMVCJointCodingOrder != NULL)
     114  {
     115          free(m_pchMVCJointCodingOrder) ;
     116  }
     117#endif
    112118  for(Int i = 0; i< m_pchDepthReconFileList.size(); i++ )
    113119  {
     
    153159  string cfg_ReconFile;
    154160  string cfg_dQPFile;
     161
     162#if FLEX_CODING_ORDER
     163  string cfg_JointCodingOrdering;
     164#endif
     165
    155166  po::Options opts;
    156167  opts.addOptions()
     
    191202  ("NumberOfViews",         m_iNumberOfViews,    0, "Number of views")
    192203
    193 
     204#if FLEX_CODING_ORDER
     205  ("3DVFlexOrder",          m_b3DVFlexOrder,   false, "flexible coding order flag" )
     206  ("3DVCodingOrder",            cfg_JointCodingOrdering,  string(""), "The coding order for joint texture-depth coding")
     207
     208#endif
    194209  /* Unit definition parameters */
    195210  ("MaxCUWidth",          m_uiMaxCUWidth,  64u)
     
    379394  m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
    380395
     396#if FLEX_CODING_ORDER && HHI_VSO
     397  m_pchMVCJointCodingOrder      = cfg_JointCodingOrdering.empty()?NULL:strdup(cfg_JointCodingOrdering.c_str());
     398  // If flexible order is enabled and if depth comes before the texture for a view, disable VSO
     399  Bool depthComesFirst = false;
     400  if ( m_b3DVFlexOrder )
     401  {
     402    for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
     403    {
     404      for ( Int ii=1; ii<12; ii+=2 )
     405      {
     406        Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0');
     407        if ( iViewIdxCfg == iViewIdx )
     408        {
     409          if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view
     410          {
     411            depthComesFirst = true;
     412            break;
     413          }
     414          else
     415          {
     416            assert(m_pchMVCJointCodingOrder[ii-1]=='T');
     417          }
     418        }
     419      }
     420    }
     421  }
     422  if (depthComesFirst)
     423  {
     424    m_bUseVSO = false;         
     425  }
     426#endif
     427
    381428
    382429// GT FIX
  • branches/0.3-nokia/source/App/TAppEncoder/TAppEncCfg.h

    r5 r34  
    8181  Bool      m_bUsingDepthMaps ;
    8282
     83#if FLEX_CODING_ORDER
     84  char*         m_pchMVCJointCodingOrder;               ///<  texture-depth coding order
     85  Bool          m_b3DVFlexOrder;                ///<  flexible coding order flag
     86#endif
     87
    8388
    8489  // coding structure
  • branches/0.3-nokia/source/App/TAppEncoder/TAppEncTop.cpp

    r21 r34  
    235235    for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
    236236    {
     237#if FLEX_CODING_ORDER
     238      // Detect whether depth comes before than texture for this view
     239      Bool isDepthFirst = false;
     240      if ( m_b3DVFlexOrder )
     241      {
     242        for ( Int ii=1; ii<12; ii+=2 )
     243        {
     244          Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0');
     245          if ( iViewIdxCfg == iViewIdx )
     246          {
     247            if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view
     248            {
     249              isDepthFirst = true;
     250            }
     251            else
     252            {
     253              assert(m_pchMVCJointCodingOrder[ii-1]=='T');
     254            }
     255            break;
     256          }
     257        }
     258      }
     259#endif
    237260      m_iDepthFrameRcvdVector.push_back(0) ;
    238261      m_acTEncDepthTopList.push_back(new TEncTop);
     
    354377      m_acTEncDepthTopList[iViewIdx]->setUseDMM( m_bUseDMM );
    355378#endif
     379#if FLEX_CODING_ORDER && HHI_DMM_PRED_TEX
     380      m_acTEncDepthTopList[iViewIdx]->setUseDMM34( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseDMM );
     381#endif
    356382#if CONSTRAINED_INTRA_PRED
    357383      m_acTEncDepthTopList[iViewIdx]->setUseConstrainedIntraPred      ( m_bUseConstrainedIntraPred );
     
    380406#endif
    381407#if HHI_MPI
     408#if FLEX_CODING_ORDER
     409      m_acTEncDepthTopList[iViewIdx]->setUseMVI( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseMVI );
     410#else
    382411      m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
    383412#endif
    384 
     413#endif
     414     
    385415      m_acTEncDepthTopList[iViewIdx]->setPictureDigestEnabled(m_pictureDigestEnabled);
    386416
     
    591621  std::vector<Bool>  bDepthEos ;
    592622  std::vector<Bool>  bContinueReadingDepthPics ;
    593 
    594623  for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
    595624  {
     
    689718#endif
    690719
     720#if FLEX_CODING_ORDER
     721    if (m_b3DVFlexOrder)
     722    {
     723      Int i=0;
     724      Int iViewIdx = 0;
     725      bool bThisViewContinueReadingPics = false;
     726      bool bThisViewContinueReadingDepthPics = false;
     727      Int iNumberofDepthViews = m_bUsingDepthMaps?m_iNumberOfViews:0;
     728      for(Int j=0; j < (m_iNumberOfViews+ iNumberofDepthViews); j++ )     // Start encoding
     729      {
     730        if (m_pchMVCJointCodingOrder[i]=='T')
     731        {
     732          i++;
     733          assert(isdigit(m_pchMVCJointCodingOrder[i]));
     734          iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     735          bThisViewContinueReadingPics = bContinueReadingPics[iViewIdx];
     736          m_acTEncTopList[iViewIdx]->encode( bEos[iViewIdx], m_cListPicYuvRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingPics );
     737          bContinueReadingPics[iViewIdx]=bThisViewContinueReadingPics;
     738          bAllContinueReadingPics = bAllContinueReadingPics||bContinueReadingPics[iViewIdx];
     739
     740          if(pcBitstream->getNumberOfWrittenBits()!=0)
     741          {
     742            m_cTVideoIOBitsFile.writeBits( pcBitstream );
     743          }
     744          pcBitstream->resetBits(); //GT: also done later in ....
     745          pcBitstream->rewindStreamPacket( );
     746          // write bistream to file if necessary
     747          xWriteOutput( iViewIdx ); //GT: Write Reconfiles (when gop is complete?)
     748          i++;
     749        }
     750        else if ( m_pchMVCJointCodingOrder[i] == 'D')
     751        {
     752          i++;
     753          if( m_bUsingDepthMaps )
     754          {
     755            assert(isdigit(m_pchMVCJointCodingOrder[i]));
     756            iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     757            bThisViewContinueReadingDepthPics = bContinueReadingDepthPics[iViewIdx];
     758            m_acTEncDepthTopList[iViewIdx]->encode( bDepthEos[iViewIdx], m_cListPicYuvDepthRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingDepthPics );
     759            bContinueReadingDepthPics[iViewIdx]=bThisViewContinueReadingDepthPics;
     760
     761            bAllContinueReadingDepthPics = bAllContinueReadingDepthPics||bContinueReadingDepthPics[iViewIdx];
     762            if(pcBitstream->getNumberOfWrittenBits()!=0)
     763            {
     764              m_cTVideoIOBitsFile.writeBits( pcBitstream );
     765            }
     766            pcBitstream->resetBits();
     767            pcBitstream->rewindStreamPacket( );
     768            // write bistream to file if necessary
     769            xWriteOutput( iViewIdx, true );
     770            i++;
     771          }
     772        }
     773      }
     774    }
     775    else
     776    {
     777#endif
    691778    //GT: Encode
    692779    for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )     // Start encoding
     
    723810      }
    724811    }
    725 
     812#if FLEX_CODING_ORDER
     813        }
     814#endif
    726815    // delete extra picture buffers
    727816    if( bCurrPocCoded )
Note: See TracChangeset for help on using the changeset viewer.