Changeset 389 in SHVCSoftware for branches/SHM-3.1-dev/source/App


Ignore:
Timestamp:
10 Sep 2013, 17:27:55 (11 years ago)
Author:
qualcomm
Message:

Signaling representation format in VPS (MACRO: REPN_FORMAT_IN_VPS)

Includes signaling of representation format - including picture resolution, bit depth, chroma format - in the VPS, with the option of updating them in the SPS. The configuration file has "RepFormatIdx%d" added to indicate for each layer which representation format is used. The rep_format() structures are automatically created by the encoder. If the bit depth and the chroma format are also changed across layers, some more configuration support would be needed.

From: Adarsh K. Ramasubramonian <aramasub@…>

Location:
branches/SHM-3.1-dev/source/App
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-3.1-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r374 r389  
    551551        const Window &conf = pcPic->getConformanceWindow();
    552552        const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
     553#if REPN_FORMAT_IN_VPS
     554        UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc();
     555        Int xScal =  TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc );
     556        m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(),
     557                                       conf.getWindowLeftOffset()  * xScal + defDisp.getWindowLeftOffset(),
     558                                       conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(),
     559                                       conf.getWindowTopOffset()   * yScal + defDisp.getWindowTopOffset(),
     560                                       conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() );
     561
     562#else
    553563        m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(),
    554564                                       conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
     
    556566                                       conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
    557567                                       conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
     568#endif
    558569      }
    559570     
     
    630641        const Window &conf = pcPic->getConformanceWindow();
    631642        const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
     643#if REPN_FORMAT_IN_VPS
     644        UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc();
     645        Int xScal =  TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc );
     646        m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(),
     647                                       conf.getWindowLeftOffset()  *xScal + defDisp.getWindowLeftOffset(),
     648                                       conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(),
     649                                       conf.getWindowTopOffset()   *yScal + defDisp.getWindowTopOffset(),
     650                                       conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset() );
     651
     652#else
    632653        m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(),
    633654                                       conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
     
    635656                                       conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
    636657                                       conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
     658#endif
    637659      }
    638660     
  • branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r377 r389  
    351351  Double* cfg_fQP           [MAX_LAYERS];
    352352
     353#if REPN_FORMAT_IN_VPS
     354  Int*    cfg_repFormatIdx  [MAX_LAYERS];
     355#endif
    353356  Int*    cfg_SourceWidth   [MAX_LAYERS];
    354357  Int*    cfg_SourceHeight  [MAX_LAYERS];
     
    399402    cfg_ReconFile[layer]    = &m_acLayerCfg[layer].m_cReconFile;
    400403    cfg_fQP[layer]          = &m_acLayerCfg[layer].m_fQP;
     404#if REPN_FORMAT_IN_VPS
     405    cfg_repFormatIdx[layer] = &m_acLayerCfg[layer].m_repFormatIdx;
     406#endif
    401407    cfg_SourceWidth[layer]  = &m_acLayerCfg[layer].m_iSourceWidth;
    402408    cfg_SourceHeight[layer] = &m_acLayerCfg[layer].m_iSourceHeight;
     
    469475  ("FrameRate%d,-fr%d",       cfg_FrameRate,  0, MAX_LAYERS, "Frame rate for layer %d")
    470476  ("LambdaModifier%d,-LM%d",  m_adLambdaModifier, ( double )1.0, MAX_TLAYER, "Lambda modifier for temporal layer %d")
     477#if REPN_FORMAT_IN_VPS
     478  ("RepFormatIdx%d",          cfg_repFormatIdx, -1, MAX_LAYERS, "Index to the representation format structure used from the VPS")
     479#endif
    471480#if VPS_EXTN_DIRECT_REF_LAYERS
    472481#if M0457_PREDICTION_INDICATIONS
     
    11271136#endif
    11281137  m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str());
    1129  
     1138
     1139#if REPN_FORMAT_IN_VPS_123
     1140  for(Int layer = 0; layer < MAX_LAYERS; layer++)
     1141  {
     1142    m_acLayerCfg[layer].setSourceHeight( m_repFormatCfg[ m_acLayerCfg[layer].getRepFormatIdx() ].m_picHeightInLumaSamples);
     1143    m_acLayerCfg[layer].setSourceWidth ( m_repFormatCfg[ m_acLayerCfg[layer].getRepFormatIdx() ].m_picWidthInLumaSamples );
     1144  }
     1145#endif
    11301146  /* rules for input, output and internal bitdepths as per help text */
    11311147  if (!m_internalBitDepthY) { m_internalBitDepthY = m_inputBitDepthY; }
  • branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncCfg.h

    r377 r389  
    354354  Int       m_adaptiveResolutionChange;                       ///< Indicate adaptive resolution change frame
    355355#endif
     356#if REPN_FORMAT_IN_VPS
     357  RepFormatCfg m_repFormatCfg[16];                            ///< Rep_format structures
     358#endif
    356359public:
    357360  TAppEncCfg();
     
    381384  Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString);
    382385#endif
     386#if REPN_FORMAT_IN_VPS
     387  RepFormatCfg* getRepFormatCfg(Int i)  { return &m_repFormatCfg[i]; }
     388#endif
    383389#endif
    384390};// END CLASS DEFINITION TAppEncCfg
  • branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r313 r389  
    3232  m_conformanceMode( 0 ),
    3333  m_aidQP(NULL)
     34#if REPN_FORMAT_IN_VPS
     35, m_repFormatIdx (-1)
     36#endif
    3437{
    3538  m_confLeft = m_confRight = m_confTop = m_confBottom = 0;
  • branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.h

    r345 r389  
    8484  GOPEntry  m_GOPListLayer[MAX_GOP];                            ///< for layer
    8585#endif
     86#if REPN_FORMAT_IN_VPS
     87  Int       m_repFormatIdx;
     88#endif
    8689public:
    8790  TAppEncLayerCfg();
     
    147150  GOPEntry getGOPEntry(Int i )        {return m_GOPListLayer[i];  }
    148151#endif
     152#if REPN_FORMAT_IN_VPS
     153  Int     getRepFormatIdx()           { return m_repFormatIdx; }
     154  Void    setSourceWidth(Int x)            {m_iSourceWidth = x;     }
     155  Void    setSourceHeight(Int x)           {m_iSourceHeight = x;    }
     156#endif
    149157}; // END CLASS DEFINITION TAppEncLayerCfg
    150158
  • branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r377 r389  
    9090    vps->setMaxDecPicBuffering             ( m_maxDecPicBuffering[i], i );
    9191  }
    92 
     92#if REPN_FORMAT_IN_VPS
     93  vps->setRepFormatIdxPresentFlag( true );   // Could be disabled to optimize in some cases.
     94  Int maxRepFormatIdx = -1;
     95  for(UInt layer=0; layer < m_numLayers; layer++)
     96  {
     97    assert( m_acLayerCfg[layer].getRepFormatIdx() != -1, "RepFormatIdx not assigned for a layer" );   
     98    vps->setVpsRepFormatIdx( layer, m_acLayerCfg[layer].getRepFormatIdx() );
     99    maxRepFormatIdx = std::max( m_acLayerCfg[layer].getRepFormatIdx(), maxRepFormatIdx );
     100  }
     101  assert( vps->getVpsRepFormatIdx( 0 ) == 0 );  // Base layer should point to the first one.
     102  Int* mapIdxToLayer = new Int[maxRepFormatIdx + 1];
     103  // Check that all the indices from 0 to maxRepFormatIdx are used in the VPS
     104  for(Int i = 0; i <= maxRepFormatIdx; i++)
     105  {
     106    mapIdxToLayer[i] = -1;
     107    UInt layer;
     108    for(layer=0; layer < m_numLayers; layer++)
     109    {
     110      if( vps->getVpsRepFormatIdx(layer) == i )
     111      {
     112        mapIdxToLayer[i] = layer;
     113        break;
     114      }
     115    }
     116    assert( layer != m_numLayers );   // One of the VPS Rep format indices not set
     117  }
     118  vps->setVpsNumRepFormats( maxRepFormatIdx + 1 );
     119  for(UInt idx=0; idx < vps->getVpsNumRepFormats(); idx++)
     120  {
     121    RepFormat *repFormat = vps->getVpsRepFormat( idx );   
     122    repFormat->setPicWidthVpsInLumaSamples  ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceWidth()   );
     123    repFormat->setPicHeightVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceHeight()  );
     124    repFormat->setChromaFormatVpsIdc        ( 1                                             );  // Need modification to change for each layer - corresponds to 420
     125    repFormat->setSeparateColourPlaneVpsFlag( 0                                             );  // Need modification to change for each layer
     126    repFormat->setBitDepthVpsLuma           ( getInternalBitDepthY()                        );  // Need modification to change for each layer
     127    repFormat->setBitDepthVpsChroma         ( getInternalBitDepthC()                        );  // Need modification to change for each layer
     128  }
     129  delete [] mapIdxToLayer;
     130#endif
    93131  for(UInt layer=0; layer<m_numLayers; layer++)
    94132  {
Note: See TracChangeset for help on using the changeset viewer.