Changeset 560 in SHVCSoftware for branches/SHM-5.0-dev/source/App


Ignore:
Timestamp:
27 Jan 2014, 17:25:26 (11 years ago)
Author:
seregin
Message:

remove M0457_PREDICTION_INDICATIONS macro

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

Legend:

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

    r559 r560  
    143143{
    144144#if VPS_EXTN_DIRECT_REF_LAYERS
    145 #if M0457_PREDICTION_INDICATIONS
    146145  for(Int layer = 0; layer < MAX_LAYERS; layer++)
    147146  {
     
    149148    {
    150149      delete [] m_acLayerCfg[layer].m_samplePredRefLayerIds;
    151     }
    152   }
    153   for(Int layer = 0; layer < MAX_LAYERS; layer++)
    154   {
     150      m_acLayerCfg[layer].m_samplePredRefLayerIds = NULL;
     151    }
    155152    if( m_acLayerCfg[layer].m_numMotionPredRefLayers > 0 )
    156153    {
    157154      delete [] m_acLayerCfg[layer].m_motionPredRefLayerIds;
    158     }
    159   }
    160 #else
    161   for(Int layer = 0; layer < MAX_LAYERS; layer++)
    162   {
    163     if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 )
    164     {
    165       delete [] m_acLayerCfg[layer].m_refLayerIds;
    166     }
    167   }
    168 #endif
    169   for(Int layer = 0; layer < MAX_LAYERS; layer++)
    170   {
     155      m_acLayerCfg[layer].m_motionPredRefLayerIds = NULL;
     156    }
    171157    if( m_acLayerCfg[layer].m_numActiveRefLayers > 0 )
    172158    {
    173159      delete [] m_acLayerCfg[layer].m_predLayerIds;
     160      m_acLayerCfg[layer].m_predLayerIds = NULL;
    174161    }
    175162  }
     
    380367#endif
    381368#if VPS_EXTN_DIRECT_REF_LAYERS
    382 #if M0457_PREDICTION_INDICATIONS
    383369  Int*    cfg_numSamplePredRefLayers  [MAX_LAYERS];
    384370  string  cfg_samplePredRefLayerIds   [MAX_LAYERS];
     
    387373  string  cfg_motionPredRefLayerIds   [MAX_LAYERS];
    388374  string* cfg_motionPredRefLayerIdsPtr[MAX_LAYERS];
    389 #else
    390   Int*    cfg_numDirectRefLayers [MAX_LAYERS];
    391   string  cfg_refLayerIds        [MAX_LAYERS];
    392   string* cfg_refLayerIdsPtr     [MAX_LAYERS];
    393 #endif
    394375  Int*    cfg_numActiveRefLayers [MAX_LAYERS];
    395376  string  cfg_predLayerIds       [MAX_LAYERS];
     
    459440#endif
    460441#if VPS_EXTN_DIRECT_REF_LAYERS
    461 #if M0457_PREDICTION_INDICATIONS
    462442    cfg_numSamplePredRefLayers  [layer] = &m_acLayerCfg[layer].m_numSamplePredRefLayers;
    463443    cfg_samplePredRefLayerIdsPtr[layer] = &cfg_samplePredRefLayerIds[layer];
    464444    cfg_numMotionPredRefLayers  [layer] = &m_acLayerCfg[layer].m_numMotionPredRefLayers;
    465445    cfg_motionPredRefLayerIdsPtr[layer] = &cfg_motionPredRefLayerIds[layer];
    466 #else
    467     cfg_numDirectRefLayers  [layer] = &m_acLayerCfg[layer].m_numDirectRefLayers;
    468     cfg_refLayerIdsPtr      [layer]  = &cfg_refLayerIds[layer];
    469 #endif
    470446    cfg_numActiveRefLayers  [layer] = &m_acLayerCfg[layer].m_numActiveRefLayers;
    471447    cfg_predLayerIdsPtr     [layer]  = &cfg_predLayerIds[layer];
     
    548524#endif
    549525#if VPS_EXTN_DIRECT_REF_LAYERS
    550 #if M0457_PREDICTION_INDICATIONS
    551526  ("NumSamplePredRefLayers%d",cfg_numSamplePredRefLayers, -1, MAX_LAYERS, "Number of sample prediction reference layers")
    552527  ("SamplePredRefLayerIds%d", cfg_samplePredRefLayerIdsPtr, string(""), MAX_LAYERS, "sample pred reference layer IDs")
    553528  ("NumMotionPredRefLayers%d",cfg_numMotionPredRefLayers, -1, MAX_LAYERS, "Number of motion prediction reference layers")
    554529  ("MotionPredRefLayerIds%d", cfg_motionPredRefLayerIdsPtr, string(""), MAX_LAYERS, "motion pred reference layer IDs")
    555 #else
    556   ("NumDirectRefLayers%d",    cfg_numDirectRefLayers, -1, MAX_LAYERS, "Number of direct reference layers")
    557   ("RefLayerIds%d",           cfg_refLayerIdsPtr, string(""), MAX_LAYERS, "direct reference layer IDs")
    558 #endif
    559530  ("NumActiveRefLayers%d",    cfg_numActiveRefLayers, -1, MAX_LAYERS, "Number of active reference layers")
    560531  ("PredLayerIds%d",          cfg_predLayerIdsPtr, string(""), MAX_LAYERS, "inter-layer prediction layer IDs")
     
    11841155  }
    11851156#if VPS_EXTN_DIRECT_REF_LAYERS
    1186 #if M0457_PREDICTION_INDICATIONS
    11871157  for(Int layer = 0; layer < MAX_LAYERS; layer++)
    11881158  {
     
    12471217    }
    12481218  }
    1249 #else
    1250   for(Int layer = 0; layer < MAX_LAYERS; layer++)
    1251   {
    1252     Char* pRefLayerIds = cfg_refLayerIds[layer].empty() ? NULL: strdup(cfg_refLayerIds[layer].c_str());
    1253     if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 )
    1254     {
    1255       char *refLayerId;
    1256       int  i=0;
    1257       m_acLayerCfg[layer].m_refLayerIds = new Int[m_acLayerCfg[layer].m_numDirectRefLayers];
    1258       refLayerId = strtok(pRefLayerIds, " ,-");
    1259       while(refLayerId != NULL)
    1260       {
    1261         if( i >= m_acLayerCfg[layer].m_numDirectRefLayers )
    1262         {
    1263           printf( "NumDirectRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" );
    1264           exit( EXIT_FAILURE );
    1265         }
    1266         *( m_acLayerCfg[layer].m_refLayerIds + i ) = atoi( refLayerId );
    1267         refLayerId = strtok(NULL, " ,-");
    1268         i++;
    1269       }
    1270       if( i < m_acLayerCfg[layer].m_numDirectRefLayers )
    1271       {
    1272         printf( "NumDirectRefLayers: The width of some columns is not defined.\n" );
    1273         exit( EXIT_FAILURE );
    1274       }
    1275     }
    1276     else
    1277     {
    1278       m_acLayerCfg[layer].m_refLayerIds = NULL;
    1279     }
    1280   }
    1281 #endif
     1219
    12821220#if AUXILIARY_PICTURES
    12831221  for(UInt layer = 0; layer < MAX_LAYERS; layer++)
     
    22252163  }
    22262164#if VPS_EXTN_DIRECT_REF_LAYERS
    2227 #if M0457_PREDICTION_INDICATIONS
    22282165  xConfirmPara( (m_acLayerCfg[0].m_numSamplePredRefLayers != 0) && (m_acLayerCfg[0].m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" );
    22292166  // NOTE: m_numSamplePredRefLayers  (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference
     
    22482185    }
    22492186  }
    2250 #else
    2251   xConfirmPara( (m_acLayerCfg[0].m_numDirectRefLayers != 0) && (m_acLayerCfg[0].m_numDirectRefLayers != -1), "Layer 0 cannot have any reference layers" );
    2252   // NOTE: m_numDirectRefLayers  (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference
    2253   for(Int layer = 1; layer < MAX_LAYERS; layer++)
    2254   {
    2255     xConfirmPara(m_acLayerCfg[layer].m_numDirectRefLayers > layer, "Cannot reference more layers than before current layer");
    2256     for(Int i = 0; i < m_acLayerCfg[layer].m_numDirectRefLayers; i++)
    2257     {
    2258       xConfirmPara(m_acLayerCfg[layer].m_refLayerIds[i] > layer, "Cannot reference higher layers");
    2259       xConfirmPara(m_acLayerCfg[layer].m_refLayerIds[i] == layer, "Cannot reference the current layer itself");
    2260     }
    2261   }
    2262 #endif
     2187
    22632188  xConfirmPara( (m_acLayerCfg[0].m_numActiveRefLayers != 0) && (m_acLayerCfg[0].m_numActiveRefLayers != -1), "Layer 0 cannot have any active reference layers" );
    22642189  // NOTE: m_numActiveRefLayers  (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference
    22652190  for(Int layer = 1; layer < MAX_LAYERS; layer++)
    22662191  {
    2267 #if M0457_PREDICTION_INDICATIONS
    22682192    Bool predEnabledFlag[MAX_LAYERS];
    22692193    for (Int refLayer = 0; refLayer < layer; refLayer++)
     
    22892213      xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] >= numDirectRefLayers, "Cannot reference higher layers");
    22902214    }
    2291 #else
    2292     xConfirmPara(m_acLayerCfg[layer].m_numActiveRefLayers > m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers");
    2293     for(Int i = 0; i < m_acLayerCfg[layer].m_numActiveRefLayers; i++)
    2294     {
    2295       xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] >= m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference higher layers");
    2296     }
    2297 #endif
    2298   }
    2299 #endif
     2215  }
     2216#endif //VPS_EXTN_DIRECT_REF_LAYERS
    23002217#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    23012218  if (m_adaptiveResolutionChange > 0)
  • branches/SHM-5.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.h

    r540 r560  
    4848#endif
    4949#if VPS_EXTN_DIRECT_REF_LAYERS
    50 #if M0457_PREDICTION_INDICATIONS
    5150  Int       *m_samplePredRefLayerIds;
    5251  Int       m_numSamplePredRefLayers;
    5352  Int       *m_motionPredRefLayerIds;
    5453  Int       m_numMotionPredRefLayers;
    55 #else
    56   Int       *m_refLayerIds;
    57   Int       m_numDirectRefLayers;
    58 #endif
    5954  Int       *m_predLayerIds;
    6055  Int       m_numActiveRefLayers;
     
    153148  Int*    getdQPs()                   {return m_aidQP;            }
    154149#if VPS_EXTN_DIRECT_REF_LAYERS
    155 #if M0457_PREDICTION_INDICATIONS
    156150  Int     getNumSamplePredRefLayers()    {return m_numSamplePredRefLayers;   }
    157151  Int*    getSamplePredRefLayerIds()     {return m_samplePredRefLayerIds;    }
     
    160154  Int*    getMotionPredRefLayerIds()     {return m_motionPredRefLayerIds;    }
    161155  Int     getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; }
    162 #else
    163   Int     getNumDirectRefLayers()     {return m_numDirectRefLayers;}
    164   Int*    getRefLayerIds()            {return m_refLayerIds;      }
    165   Int     getRefLayerId(Int i)        {return m_refLayerIds[i];   }
    166 #endif
    167156
    168157  Int     getNumActiveRefLayers()     {return m_numActiveRefLayers;}
  • branches/SHM-5.0-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r559 r560  
    209209#if REF_IDX_MFM
    210210#if AVC_BASE
    211 #if M0457_PREDICTION_INDICATIONS
    212211    m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_avcBaseLayerFlag ? AVC_SYNTAX : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers());
    213212#else
    214     m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_avcBaseLayerFlag ? AVC_SYNTAX : true ));
    215 #endif
    216 #else
    217 #if M0457_PREDICTION_INDICATIONS
    218213    m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_acLayerCfg[layer].getNumMotionPredRefLayers() > 0 ) );
    219 #else
    220     m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : true);
    221 #endif
    222214#endif
    223215#endif
     
    258250    if(layer)
    259251    {
    260 #if M0457_PREDICTION_INDICATIONS
    261252      for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++)
    262253      {
     
    306297      }
    307298      m_acTEncTop[layer].setNumDirectRefLayers(numDirectRefLayers);
    308 #else
    309       if(m_acLayerCfg[layer].getNumDirectRefLayers() == -1)
    310       {
    311         // Not included in the configuration file; assume that each layer depends on previous layer
    312         m_acTEncTop[layer].setNumDirectRefLayers       (1);      // One ref. layer
    313         m_acTEncTop[layer].setRefLayerId               (0, layer - 1);   // Previous layer
    314       }
    315       else
    316       {
    317         m_acTEncTop[layer].setNumDirectRefLayers       ( m_acLayerCfg[layer].getNumDirectRefLayers() );
    318         for(Int i = 0; i < m_acTEncTop[layer].getNumDirectRefLayers(); i++)
    319         {
    320           m_acTEncTop[layer].setRefLayerId             ( i, m_acLayerCfg[layer].getRefLayerId(i));
    321         }
    322       }
    323 #endif
     299
    324300      if(m_acLayerCfg[layer].getNumActiveRefLayers() == -1)
    325301      {
    326 #if M0457_PREDICTION_INDICATIONS
    327302        m_acTEncTop[layer].setNumActiveRefLayers( m_acTEncTop[layer].getNumDirectRefLayers() );
    328 #else
    329         m_acTEncTop[layer].setNumActiveRefLayers( m_acLayerCfg[layer].getNumDirectRefLayers() );
    330 #endif
    331303        for( Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++ )
    332304        {
     
    343315      }
    344316    }
    345 #endif
     317#endif //VPS_EXTN_DIRECT_REF_LAYERS
    346318    //===== Slice ========
    347319
     
    12711243      vps->setDirectDependencyFlag( layerCtr, vps->getLayerIdInVps(m_acTEncTop[layerCtr].getRefLayerId(i)), true);
    12721244    }
    1273 #if M0457_PREDICTION_INDICATIONS
     1245#if SVC_EXTENSION
     1246    // prediction indications
    12741247    vps->setDirectDepTypeLen(2); // sample and motion types are encoded
    12751248    for(Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)
Note: See TracChangeset for help on using the changeset viewer.