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/TAppDecoder
Files:
2 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
Note: See TracChangeset for help on using the changeset viewer.