Changeset 139 in 3DVCSoftware for branches/HTM-4.0-Nokia/source/App


Ignore:
Timestamp:
24 Sep 2012, 14:08:01 (13 years ago)
Author:
nokia
Message:

3DV-HTM v4.0: FCO

Location:
branches/HTM-4.0-Nokia/source/App
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/HTM-4.0-Nokia/source/App/TAppDecoder/TAppDecTop.cpp

    r105 r139  
    8787  increaseNumberOfViews( 1 );
    8888#endif
    89  
     89#if FLEX_CODING_ORDER
     90  Int iDepthViewIdx = 0;
     91  Int iTextureViewIdx=0;
     92  Bool first_frame=1;
     93  Bool viewid_zero=true;
     94  Int FCO_index=0;  //when the current frame is not first frame,use FCO_index stand for viewDepth.
     95#endif
     96
    9097#if SONY_COLPIC_AVAILABILITY
    9198  m_tDecTop[0]->setViewOrderIdx(0);
    9299#endif
     100
    93101  Int                 viewDepthId = 0;
    94102  Int                 previousViewDepthId  = 0;
     
    102110    pcListPic[i] = NULL;
    103111    newPicture[i] = false;
     112#if FLEX_CODING_ORDER
     113    FCO_Order[i]=NULL;
     114#endif
    104115  }
    105116
     
    156167        depth = getVPSAccess()->getActiveVPS()->getDepthFlag(nalu.m_layerId);
    157168      }
    158       viewDepthId = nalu.m_layerId;   // coding order T0D0T1D1T2D2
     169#if FLEX_CODING_ORDER
     170      if (viewId>0)
     171      {
     172        viewid_zero=false;
     173      }
     174      if (viewid_zero==false&&viewId==0)
     175      {
     176        first_frame=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
     177      }
     178      if (first_frame)
     179      { // if the current view is first frame, we set the viewDepthId as texture plus depth and get the FCO order
     180        viewDepthId = iDepthViewIdx+iTextureViewIdx;
     181        FCO_viewDepthId=viewDepthId;
     182      }
     183      else
     184      {//if current view is not first frame, we set the viewDepthId depended on the FCO order
     185        viewDepthId=0;
     186        if (depth)
     187        {
     188          for (FCO_index=0;FCO_index<2*MAX_VIEW_NUM;FCO_index++ )
     189          {
     190            if (FCO_Order[FCO_index]=='D')
     191            {
     192              if (viewId==viewDepthId)
     193                break;
     194              else
     195                viewDepthId++;
     196            }
     197          }
     198        }
     199        else
     200        {
     201          for (FCO_index=0;FCO_index<2*MAX_VIEW_NUM;FCO_index++ )
     202          {
     203            if (FCO_Order[FCO_index]=='T')
     204            {
     205              if (viewId==viewDepthId)
     206                break;
     207              else
     208                viewDepthId++;
     209            }
     210          }
     211        }
     212
     213        viewDepthId=FCO_index;
     214
     215      }
     216
     217
     218#else
     219       viewDepthId = nalu.m_layerId;   // coding order T0D0T1D1T2D2
     220#endif
     221   
    159222#else
    160223      Int viewId = nalu.m_viewId;
    161224      Int depth = nalu.m_isDepth ? 1 : 0;
    162       viewDepthId = viewId * 2 + depth;   // coding order T0D0T1D1T2D2
     225#if FLEX_CODING_ORDER
     226      if (viewId>0)
     227      {
     228        viewid_zero=false;
     229      }
     230      if (viewid_zero==false&&viewId==0)
     231      {
     232        first_frame=0;
     233      }
     234      if (first_frame)
     235      {
     236        viewDepthId = iDepthViewIdx+iTextureViewIdx;
     237        FCO_viewDepthId=viewDepthId;
     238      }
     239      else
     240      {
     241        viewDepthId=0;
     242        if (depth)
     243        {
     244          for (FCO_index=0;FCO_index<2*MAX_VIEW_NUM;FCO_index++ )
     245          {
     246            if (FCO_Order[FCO_index]=='D')
     247            {
     248              if (viewId==viewDepthId)
     249                break;
     250              else
     251                viewDepthId++;
     252            }
     253          }
     254        }
     255        else
     256        {
     257          for (FCO_index=0;FCO_index<2*MAX_VIEW_NUM;FCO_index++ )
     258          {
     259            if (FCO_Order[FCO_index]=='T')
     260            {
     261              if (viewId==viewDepthId)
     262                break;
     263              else
     264                viewDepthId++;
     265            }
     266          }
     267        }
     268
     269        viewDepthId=FCO_index;
     270
     271      }
     272#else
     273  viewDepthId = viewId * 2 + depth;   // coding order T0D0T1D1T2D2
     274#endif
     275     
    163276#endif
    164277     
     
    190303        for( Int i = 0; i < m_tDecTop.size(); i++ )
    191304        {
     305//#if FLEX_CODING_ORDER
     306//        FCO_Order[i]=NULL;
     307//#endif
    192308          m_tDecTop[i]->compressMotion( uiPOC[i] );
    193309        }
     
    209325        {
    210326          previousPictureDecoded = true;
     327#if FLEX_CODING_ORDER
     328if (first_frame)
     329{
     330  if (depth)
     331  {
     332    iDepthViewIdx++;
     333    FCO_Order[viewDepthId]='D';
     334  }
     335  else
     336  {
     337    iTextureViewIdx++;
     338    FCO_Order[viewDepthId]='T';
     339  }
     340}
     341
     342
     343
     344#endif
    211345        }
    212346      }
     
    215349    {
    216350      m_tDecTop[viewDepthId]->executeDeblockAndAlf(uiPOC[viewDepthId], pcListPic[viewDepthId], m_iSkipFrame, m_pocLastDisplay[viewDepthId]);
     351
    217352    }
    218353    if( pcListPic[viewDepthId] )
     
    234369    previousViewDepthId = viewDepthId;
    235370  }
     371
     372
     373
     374
     375
    236376  if( m_cCamParsCollector.isInitialized() )
    237377  {
     
    502642TDecTop* TAppDecTop::getTDecTop( Int viewId, Bool isDepth )
    503643{
     644#if FLEX_CODING_ORDER
     645  Int viewnumber=0;
     646  Int i=0;
     647  Bool FCO_flag=0;
     648  if (viewId>FCO_viewDepthId)
     649  {
     650    return NULL;
     651  }
     652  else
     653  {
     654    if (isDepth)
     655   {
     656      for ( i=0; i<=FCO_viewDepthId;i++)
     657      {
     658         if (FCO_Order[i]=='D')
     659         {
     660           if (viewnumber==viewId)
     661           {
     662             FCO_flag=1;
     663             break;
     664           }
     665           else
     666             viewnumber++;
     667         }
     668      }
     669    }
     670    else
     671    {
     672      for ( i=0; i<=FCO_viewDepthId;i++)
     673      {
     674        if (FCO_Order[i]=='T')
     675        {
     676          if (viewnumber==viewId)
     677          {
     678            FCO_flag=1;
     679            break;
     680          }
     681          else
     682            viewnumber++;
     683        }
     684      }
     685    }
     686    if (FCO_flag)
     687    {
     688      return m_tDecTop[i];
     689    }
     690    else
     691      return NULL;
     692   
     693  }
     694
     695    // coding order T0D0T1D1T2D2
     696#else
    504697  return m_tDecTop[(isDepth ? 1 : 0) + viewId * 2];  // coding order T0D0T1D1T2D2
     698#endif
     699  /*
     700  //original code
     701  return m_tDecTop[(isDepth ? 1 : 0) + viewId * 2];  // coding order T0D0T1D1T2D2
     702  */
    505703}
    506704
     
    520718{
    521719  assert( ( viewId >= 0 ) );
    522 
     720#if FLEX_CODING_ORDER
     721if (getTDecTop(viewId,isDepth))
     722{
     723   TComList<TComPic*>* apcListPic = getTDecTop( viewId, isDepth )->getListPic();
     724   TComPic* pcPic = NULL;
     725   for( TComList<TComPic*>::iterator it=apcListPic->begin(); it!=apcListPic->end(); it++ )
     726   {
     727     if( (*it)->getPOC() == poc )
     728     {
     729       pcPic = *it;
     730       break;
     731     }
     732   }
     733   return pcPic;
     734}
     735else
     736  return NULL;
     737#else
    523738  TComList<TComPic*>* apcListPic = getTDecTop( viewId, isDepth )->getListPic();
    524739  TComPic* pcPic = NULL;
     
    532747  }
    533748  return pcPic;
     749#endif
     750
     751
    534752}
    535753//! \}
  • TabularUnified branches/HTM-4.0-Nokia/source/App/TAppDecoder/TAppDecTop.h

    r100 r139  
    7070  std::vector<Int>                m_pocLastDisplay;               ///< last POC in display order
    7171  Bool                            m_useDepth;
    72 
     72#if FLEX_CODING_ORDER
     73  Int  FCO_viewDepthId;
     74  Char FCO_Order[MAX_VIEW_NUM*2];
     75#endif
    7376  FILE*                           m_pScaleOffsetFile;
    7477  CamParsCollector                m_cCamParsCollector;
  • TabularUnified branches/HTM-4.0-Nokia/source/App/TAppEncoder/TAppEncCfg.h

    r102 r139  
    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
     96
     97
     98
    9099  // coding structure
    91100  Int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
  • TabularUnified branches/HTM-4.0-Nokia/source/App/TAppEncoder/TAppEncTop.cpp

    r102 r139  
    369369    for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
    370370    {
     371#if FLEX_CODING_ORDER
     372      // Detect whether depth comes before than texture for this view
     373      Bool isDepthFirst = false;
     374      if ( m_b3DVFlexOrder )
     375      {
     376        for ( Int ii=1; ii<12; ii+=2 )
     377        {
     378          Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0');
     379          if ( iViewIdxCfg == iViewIdx )
     380          {
     381            if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view
     382            {
     383              isDepthFirst = true;
     384            }
     385            else
     386            {
     387              assert(m_pchMVCJointCodingOrder[ii-1]=='T');
     388            }
     389            break;
     390          }
     391        }
     392      }
     393#endif
    371394      m_depthFrameRcvd.push_back(0);
    372395      m_acTEncDepthTopList.push_back(new TEncTop);
     
    634657    m_acTEncDepthTopList[iViewIdx]->setUseDMM                     ( m_bUseDMM );
    635658#endif
     659
     660#if FLEX_CODING_ORDER && HHI_DMM_PRED_TEX
     661    m_acTEncDepthTopList[iViewIdx]->setUseDMM34( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseDMM );
     662#endif
     663
     664
    636665#if HHI_MPI
    637      m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
     666#if FLEX_CODING_ORDER
     667    m_acTEncDepthTopList[iViewIdx]->setUseMVI( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseMVI );
     668#else
     669    m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
     670#endif
     671    // m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
    638672#endif
    639673    }
     
    920954      m_cCameraData.update( iNextPoc );
    921955      }
     956
     957
     958
     959#if FLEX_CODING_ORDER
     960      if (m_b3DVFlexOrder)
     961      {
     962        Int  iNumDepthEncoded = 0;
     963        iNumEncoded = 0;
     964        Int i=0;
     965        Int iViewIdx=0;
     966        Int iNumberofDepthViews = m_bUsingDepthMaps?m_iNumberOfViews:0;
     967        for (Int j=0; j < (m_iNumberOfViews+ iNumberofDepthViews); j++ )
     968        {
     969          if (m_pchMVCJointCodingOrder[i]=='T')
     970          {
     971
     972            i++;
     973            assert(isdigit(m_pchMVCJointCodingOrder[i]));
     974            iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     975
     976            m_acTEncTopList[iViewIdx]->encode( eos[iViewIdx], pcPicYuvOrg, *m_picYuvRec[iViewIdx], outputAccessUnits, iNumEncoded, gopId );
     977            xWriteOutput(bitstreamFile, iNumEncoded, outputAccessUnits, iViewIdx, false);
     978            outputAccessUnits.clear();
     979            i++;
     980          }
     981          else if ( m_pchMVCJointCodingOrder[i] == 'D')
     982          {
     983
     984            i++;
     985            if( m_bUsingDepthMaps )
     986            {
     987              assert(isdigit(m_pchMVCJointCodingOrder[i]));
     988              iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
     989#if SAIT_VSO_EST_A0033
     990              if( m_bUseVSO && iNextPoc < m_iFrameToBeEncoded )
     991              {
     992                m_cCameraData.xSetDispCoeff( iNextPoc, iViewIdx );
     993                m_acTEncDepthTopList[iViewIdx]->setDispCoeff( m_cCameraData.getDispCoeff() );
     994              }
     995#endif
     996              m_acTEncDepthTopList[iViewIdx]->encode( depthEos[iViewIdx], pcDepthPicYuvOrg, *m_picYuvDepthRec[iViewIdx], outputAccessUnits, iNumDepthEncoded, gopId );
     997              xWriteOutput(bitstreamFile, iNumDepthEncoded, outputAccessUnits, iViewIdx, true);
     998              outputAccessUnits.clear();
     999              i++;
     1000            }
     1001          }
     1002        }
     1003      }
     1004      else
     1005      {
     1006
     1007#endif
     1008
     1009//original code
     1010
    9221011      for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
    9231012      {
     
    9431032        }
    9441033      }
     1034
     1035#if FLEX_CODING_ORDER
     1036      }
     1037#endif
     1038
     1039
     1040
     1041
    9451042#if HHI_INTERVIEW_SKIP || HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED
    9461043      for( Int iViewIdx = 0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
Note: See TracChangeset for help on using the changeset viewer.