Changeset 1211 in SHVCSoftware for branches/SHM-dev/source/App


Ignore:
Timestamp:
8 Jul 2015, 23:11:18 (10 years ago)
Author:
seregin
Message:

macro cleanup: Q0108_TSA_STSA

Location:
branches/SHM-dev/source/App/TAppEncoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r1203 r1211  
    16591659#endif
    16601660#endif
    1661 #if Q0108_TSA_STSA
    16621661  ("InheritCodingStruct%d",m_inheritCodingStruct, 0, MAX_LAYERS, "Predicts the GOP structure of one layer for another layer")
    1663 #endif
    16641662#endif //SVC_EXTENSION
    16651663  ;
     
    16711669  }
    16721670
    1673 #if Q0108_TSA_STSA
     1671#if SVC_EXTENSION
    16741672  for (Int i=1; i<MAX_LAYERS; i++)
    16751673  {
     
    16861684  const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv);
    16871685
    1688 #if Q0108_TSA_STSA
     1686#if SVC_EXTENSION
    16891687  for (Int i=1; i<MAX_LAYERS; i++)
    16901688  {
     
    32323230   * This permits the ability to omit a GOP structure specification */
    32333231#if SVC_EXTENSION
    3234 #if Q0108_TSA_STSA
    32353232  if( m_acLayerCfg[0].m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1 )
    32363233  {
     
    32603257  }
    32613258#else
    3262   for(UInt layer = 0; layer < MAX_LAYERS; layer++)
    3263   {
    3264     Int m_iIntraPeriod = m_acLayerCfg[layer].m_iIntraPeriod;
    3265     if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1) {
    3266       m_GOPList[0] = GOPEntry();
    3267       m_GOPList[0].m_QPFactor = 1;
    3268       m_GOPList[0].m_betaOffsetDiv2 = 0;
    3269       m_GOPList[0].m_tcOffsetDiv2 = 0;
    3270       m_GOPList[0].m_POC = 1;
    3271       m_GOPList[0].m_numRefPicsActive = 4;
    3272     }
    3273     else
    3274     {
    3275       xConfirmPara( m_intraConstraintFlag, "IntraConstraintFlag cannot be 1 for inter sequences");
    3276     }
    3277   }
    3278 #endif
    3279 #else
    32803259  if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1)
    32813260  {
     
    33523331  }
    33533332
    3354 #if !Q0108_TSA_STSA
     3333#if SVC_EXTENSION
     3334  memset( m_extraRPSs, 0, sizeof( m_extraRPSs ) );
     3335#else
    33553336  m_extraRPSs=0;                                     
    3356 #else
    3357   memset( m_extraRPSs, 0, sizeof( m_extraRPSs ) );
    3358 #endif
     3337#endif
     3338
    33593339  //start looping through frames in coding order until we can verify that the GOP structure is correct.
    33603340  while(!verifiedGOP&&!errorGOP)
     
    34223402      {
    34233403        //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0)
    3424 #if !Q0108_TSA_STSA
     3404#if SVC_EXTENSION
     3405        m_GOPList[m_iGOPSize+m_extraRPSs[0]]=m_GOPList[curGOP];
     3406#else
    34253407        m_GOPList[m_iGOPSize+m_extraRPSs]=m_GOPList[curGOP];
    3426 #else
    3427         m_GOPList[m_iGOPSize+m_extraRPSs[0]]=m_GOPList[curGOP];
    34283408#endif
    34293409        Int newRefs=0;
     
    34333413          if(absPOC>=0)
    34343414          {
    3435 #if !Q0108_TSA_STSA
     3415#if SVC_EXTENSION
     3416            m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i];
     3417            m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i];
     3418#else
    34363419            m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i];
    34373420            m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i];
    3438 #else
    3439             m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i];
    3440             m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i];
    34413421#endif
    34423422            newRefs++;
     
    34623442            for(Int i=0; i<newRefs; i++)
    34633443            {
    3464 #if !Q0108_TSA_STSA
     3444#if SVC_EXTENSION
     3445              if( m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[i] == offPOC-curPOC )
     3446#else
    34653447              if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[i]==offPOC-curPOC)
    3466 #else
    3467               if(m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[i]==offPOC-curPOC)
    34683448#endif
    34693449              {
     
    34813461              for(Int j=0; j<newRefs; j++)
    34823462              {
    3483 #if !Q0108_TSA_STSA
     3463#if SVC_EXTENSION
     3464                if( m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j] < offPOC-curPOC || m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j] > 0 )
     3465#else
    34843466                if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]<offPOC-curPOC||m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]>0)
    3485 #else
    3486                 if(m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]<offPOC-curPOC||m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]>0)
    34873467#endif
    34883468                {
     
    34953475              for(Int j=insertPoint; j<newRefs+1; j++)
    34963476              {
    3497 #if !Q0108_TSA_STSA
     3477#if SVC_EXTENSION
     3478                Int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j];
     3479                Int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j];
     3480                m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]=prev;
     3481                m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j]=prevUsed;
     3482#else
    34983483                Int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j];
    34993484                Int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j];
    35003485                m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]=prev;
    35013486                m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]=prevUsed;
    3502 #else
    3503                 Int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j];
    3504                 Int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j];
    3505                 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]=prev;
    3506                 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j]=prevUsed;
    35073487#endif
    35083488
     
    35183498          }
    35193499        }
    3520 #if !Q0108_TSA_STSA
    3521         m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics=newRefs;
    3522         m_GOPList[m_iGOPSize+m_extraRPSs].m_POC = curPOC;
    3523 #else
     3500
     3501#if SVC_EXTENSION
    35243502        m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefPics=newRefs;
    35253503        m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_POC = curPOC;
    3526 #endif
    3527 #if !Q0108_TSA_STSA
    3528         if (m_extraRPSs == 0)
    3529 #else
    3530         if (m_extraRPSs[0] == 0)
    3531 #endif
     3504
     3505        if( m_extraRPSs[0] == 0 )
    35323506        {
    3533 #if !Q0108_TSA_STSA
    3534           m_GOPList[m_iGOPSize+m_extraRPSs].m_interRPSPrediction = 0;
    3535           m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefIdc = 0;
    3536 #else
    35373507          m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_interRPSPrediction = 0;
    35383508          m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefIdc = 0;
    3539 #endif
    35403509        }
    35413510        else
    35423511        {
    3543 #if !Q0108_TSA_STSA
     3512          Int rIdx =  m_iGOPSize + m_extraRPSs[0] - 1;
     3513#else
     3514        m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics=newRefs;
     3515        m_GOPList[m_iGOPSize+m_extraRPSs].m_POC = curPOC;
     3516
     3517        if (m_extraRPSs == 0)
     3518        {
     3519          m_GOPList[m_iGOPSize+m_extraRPSs].m_interRPSPrediction = 0;
     3520          m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefIdc = 0;
     3521        }
     3522        else
     3523        {
    35443524          Int rIdx =  m_iGOPSize + m_extraRPSs - 1;
    3545 #else
    3546           Int rIdx =  m_iGOPSize + m_extraRPSs[0] - 1;
    35473525#endif
    35483526          Int refPOC = m_GOPList[rIdx].m_POC;
     
    35543532            Int absPOCref = refPOC+deltaPOC;
    35553533            Int refIdc = 0;
    3556 #if !Q0108_TSA_STSA
     3534
     3535#if SVC_EXTENSION
     3536            for (Int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefPics; j++)
     3537            {
     3538              if ( (absPOCref - curPOC) == m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j])
     3539              {
     3540                if (m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j])
     3541                {
     3542                  refIdc = 1;
     3543                }
     3544                else
     3545                {
     3546                  refIdc = 2;
     3547                }
     3548              }
     3549            }
     3550            m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_refIdc[newIdc]=refIdc;
     3551            newIdc++;
     3552          }
     3553          m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_interRPSPrediction = 1; 
     3554          m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefIdc = newIdc;
     3555          m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_deltaRPS = refPOC - m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_POC;
     3556        }
     3557        curGOP=m_iGOPSize+m_extraRPSs[0];
     3558        m_extraRPSs[0]++;
     3559      }
     3560#else
    35573561            for (Int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics; j++)
    35583562            {
     
    35793583        m_extraRPSs++;
    35803584      }
    3581 #else
    3582             for (Int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefPics; j++)
    3583             {
    3584               if ( (absPOCref - curPOC) == m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j])
    3585               {
    3586                 if (m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j])
    3587                 {
    3588                   refIdc = 1;
    3589                 }
    3590                 else
    3591                 {
    3592                   refIdc = 2;
    3593                 }
    3594               }
    3595             }
    3596             m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_refIdc[newIdc]=refIdc;
    3597             newIdc++;
    3598           }
    3599           m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_interRPSPrediction = 1; 
    3600           m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefIdc = newIdc;
    3601           m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_deltaRPS = refPOC - m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_POC;
    3602         }
    3603         curGOP=m_iGOPSize+m_extraRPSs[0];
    3604         m_extraRPSs[0]++;
    3605       }
    36063585#endif
    36073586
     
    36233602  xConfirmPara(errorGOP,"Invalid GOP structure given");
    36243603
    3625 #if SVC_EXTENSION && Q0108_TSA_STSA
     3604#if SVC_EXTENSION
    36263605  if( layerIdx > 0 )
    36273606  {
     
    38723851  }
    38733852
    3874 #if Q0108_TSA_STSA
     3853#if SVC_EXTENSION
    38753854  if( layerIdx > 0 )
    38763855  {
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r1203 r1211  
    158158  Int       m_iGOPSize;                                       ///< GOP size of hierarchical structure
    159159
    160 #if !Q0108_TSA_STSA
    161   Int       m_extraRPSs;                                      ///< extra RPSs added to handle CRA
    162 #else
     160#if SVC_EXTENSION
    163161  Int       m_extraRPSs[MAX_LAYERS];                          ///< extra RPSs added to handle CRA
    164 #endif
    165 
    166   GOPEntry  m_GOPList[MAX_GOP];                               ///< the coding structure entries from the config file
    167 #if Q0108_TSA_STSA
    168162  GOPEntry  m_EhGOPList[MAX_LAYERS][MAX_GOP];                 ///< the enhancement layer coding structure entries from the config file
    169163  Int       m_inheritCodingStruct[MAX_LAYERS];
    170 #endif
     164  Int       m_EhMaxTempLayer[MAX_LAYERS];                    ///< Max temporal layer
     165#else
     166  Int       m_extraRPSs;                                      ///< extra RPSs added to handle CRA
     167#endif
     168
     169  GOPEntry  m_GOPList[MAX_GOP];                               ///< the coding structure entries from the config file
    171170
    172171  Int       m_numReorderPics[MAX_TLAYER];                     ///< total number of reorder pictures
     
    209208
    210209  Int       m_maxTempLayer;                                  ///< Max temporal layer
    211 #if Q0108_TSA_STSA
    212   Int       m_EhMaxTempLayer[MAX_LAYERS];                    ///< Max temporal layer
    213 #endif
    214210
    215211#if !LAYER_CTB
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1203 r1211  
    269269    m_acTEncTop[layer].setDecodingRefreshType                             ( m_iDecodingRefreshType );
    270270    m_acTEncTop[layer].setGOPSize                                         ( m_iGOPSize );
    271 #if Q0108_TSA_STSA
     271
    272272    m_acTEncTop[layer].setGopList                                         ( layer ? m_EhGOPList[layer] : m_GOPList );
    273 #else
    274     m_acTEncTop[layer].setGopList                                         ( m_GOPList );
    275 #endif
    276 
    277 #if !Q0108_TSA_STSA
    278     m_acTEncTop[layer].setExtraRPSs                                       ( m_extraRPSs );
    279 #else
    280273    m_acTEncTop[layer].setExtraRPSs                                       ( m_extraRPSs[layer] );
    281 #endif
     274
    282275    for(Int i = 0; i < MAX_TLAYER; i++)
    283276    {
     
    292285
    293286    m_acTEncTop[layer].setPad                                             ( m_acLayerCfg[layer].getPad() );
    294 #if !Q0108_TSA_STSA
    295     m_acTEncTop[layer].setMaxTempLayer                                    ( m_maxTempLayer );
    296 #else
     287
    297288    if (layer== 0)
    298289    {
     
    303294      m_acTEncTop[layer].setMaxTempLayer                                  ( m_EhMaxTempLayer[layer] );
    304295    }
    305 #endif
     296
    306297    m_acTEncTop[layer].setUseAMP( m_enableAMP );
    307298
Note: See TracChangeset for help on using the changeset viewer.