Changeset 475 in SHVCSoftware for branches/SHM-4.0-dev/source/Lib/TLibCommon


Ignore:
Timestamp:
15 Nov 2013, 14:55:37 (11 years ago)
Author:
nokia
Message:

Integrate auxiliary picture layers (JCTVC-O0041)

Location:
branches/SHM-4.0-dev/source/Lib/TLibCommon
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPic.cpp

    r459 r475  
    7979}
    8080#if SVC_UPSAMPLING
     81#if AUXILIARY_PICTURES
     82Void TComPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
     83                      Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual)
     84#else
    8185Void TComPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
    8286                      Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual)
    83 
     87#endif
    8488{
    8589  m_apcPicSym     = new TComPicSym;  m_apcPicSym   ->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth );
    8690  if (!bIsVirtual)
    8791  {
     92#if AUXILIARY_PICTURES
     93    m_apcPicYuv[0]  = new TComPicYuv;  m_apcPicYuv[0]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
     94#else
    8895    m_apcPicYuv[0]  = new TComPicYuv;  m_apcPicYuv[0]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
    89   }
     96#endif
     97  }
     98#if AUXILIARY_PICTURES
     99  m_apcPicYuv[1]  = new TComPicYuv;  m_apcPicYuv[1]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
     100#else
    90101  m_apcPicYuv[1]  = new TComPicYuv;  m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
     102#endif
    91103
    92104  for( Int i = 0; i < MAX_LAYERS; i++ )
     
    94106    if( m_bSpatialEnhLayer[i] )
    95107    {
     108#if AUXILIARY_PICTURES
     109      m_pcFullPelBaseRec[i] = new TComPicYuv;  m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
     110#else
    96111      m_pcFullPelBaseRec[i] = new TComPicYuv;  m_pcFullPelBaseRec[i]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
     112#endif
    97113    }
    98114  }
     
    407423  {
    408424    m_pNDBFilterYuvTmp = new TComPicYuv();
     425#if AUXILIARY_PICTURES
     426    m_pNDBFilterYuvTmp->create(picWidth, picHeight, getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);
     427#else
    409428    m_pNDBFilterYuvTmp->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);
     429#endif
     430
    410431  }
    411432
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPic.h

    r459 r475  
    102102  virtual ~TComPic();
    103103 
     104#if AUXILIARY_PICTURES
     105#if SVC_UPSAMPLING
     106  Void          create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
     107                        Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false );
     108#else
     109  Void          create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
     110                        Int *numReorderPics, Bool bIsVirtual = false );                       
     111#endif
     112#else
    104113#if SVC_UPSAMPLING
    105114  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
     
    108117  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
    109118                        Int *numReorderPics, Bool bIsVirtual = false );                       
     119#endif
    110120#endif
    111121  virtual Void  destroy();
     
    166176 
    167177  Int           getStride()           { return m_apcPicYuv[1]->getStride(); }
     178#if AUXILIARY_PICTURES
     179  ChromaFormat  getChromaFormat() const { return m_apcPicYuv[1]->getChromaFormat(); }
     180#endif
    168181  Int           getCStride()          { return m_apcPicYuv[1]->getCStride(); }
    169182 
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPicYuv.cpp

    r467 r475  
    6767{
    6868}
     69#if AUXILIARY_PICTURES
     70#if SVC_UPSAMPLING
     71Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps )
     72#else
     73Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth )
     74#endif
     75#else
    6976#if SVC_UPSAMPLING
    7077Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps )
    7178#else
    7279Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth )
     80#endif
    7381#endif
    7482{
     
    8694  m_iCuWidth        = uiMaxCUWidth;
    8795  m_iCuHeight       = uiMaxCUHeight;
     96#if AUXILIARY_PICTURES
     97  m_chromaFormatIDC = chromaFormatIDC;
     98#endif
    8899
    89100  Int numCuInWidth  = m_iPicWidth  / m_iCuWidth  + (m_iPicWidth  % m_iCuWidth  != 0);
     
    239250}
    240251
     252#if AUXILIARY_PICTURES
     253Void TComPicYuv::convertToMonochrome()
     254{
     255  Int numPix = ((m_iPicWidth >> 1) + (m_iChromaMarginX << 1)) * ((m_iPicHeight >> 1) + (m_iChromaMarginY << 1));
     256  Pel grayVal = (1 << (g_bitDepthC - 1));
     257
     258  for (UInt i = 0; i < numPix; i++)
     259  {
     260    m_apiPicBufU[i] = grayVal;
     261    m_apiPicBufV[i] = grayVal;
     262  }
     263}
     264#endif
     265
    241266Void TComPicYuv::extendPicBorder ()
    242267{
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPicYuv.h

    r313 r475  
    7575  Int   m_iPicWidth;            ///< Width of picture
    7676  Int   m_iPicHeight;           ///< Height of picture
     77#if AUXILIARY_PICTURES
     78  ChromaFormat m_chromaFormatIDC; ////< Chroma Format
     79#endif
    7780 
    7881  Int   m_iCuWidth;             ///< Width of Coding Unit (CU)
     
    108111  //  Memory management
    109112  // ------------------------------------------------------------------------------------------------
     113#if AUXILIARY_PICTURES
     114#if SVC_UPSAMPLING
     115  Void  create      ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL);
     116#else
     117  Void  create      ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth );
     118#endif 
     119#else
    110120#if SVC_UPSAMPLING
    111121  Void  create      ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL);
     
    113123  Void  create      ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth );
    114124#endif 
     125#endif
    115126 
    116127  Void  destroy     ();
     
    125136  Int   getWidth    ()     { return  m_iPicWidth;    }
    126137  Int   getHeight   ()     { return  m_iPicHeight;   }
     138#if AUXILIARY_PICTURES
     139  ChromaFormat  getChromaFormat   ()                     const { return m_chromaFormatIDC; }
     140#endif
    127141 
    128142#if SVC_EXTENSION
     
    184198#endif
    185199
     200#if AUXILIARY_PICTURES
     201  Void convertToMonochrome();
     202#endif
     203
    186204  // Set border extension flag
    187205  Void  setBorderExtension(Bool b) { m_bIsBorderExtended = b; }
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.cpp

    r470 r475  
    18401840  return retVal;
    18411841}
     1842#if AUXILIARY_PICTURES
     1843ChromaFormat TComSlice::getChromaFormatIdc()
     1844#else
    18421845UInt TComSlice::getChromaFormatIdc()
     1846#endif
     1847{
     1848  TComSPS *sps = getSPS();
     1849  TComVPS *vps = getVPS();
     1850#if AUXILIARY_PICTURES
     1851  ChromaFormat retVal;
     1852  UInt layerId = getLayerId();
     1853#else
     1854  UInt retVal, layerId = getLayerId();
     1855#endif
     1856  if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )
     1857  {
     1858    retVal = sps->getChromaFormatIdc();
     1859  }
     1860  else
     1861  {
     1862    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getChromaFormatVpsIdc();
     1863  }
     1864  return retVal;
     1865}
     1866UInt TComSlice::getBitDepthY()
    18431867{
    18441868  TComSPS *sps = getSPS();
     
    18471871  if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )
    18481872  {
    1849     retVal = sps->getChromaFormatIdc();
     1873    retVal = sps->getBitDepthY();
    18501874  }
    18511875  else
    18521876  {
    1853     retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getChromaFormatVpsIdc();
     1877    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsLuma();
    18541878  }
    18551879  return retVal;
    18561880}
    1857 UInt TComSlice::getBitDepthY()
     1881UInt TComSlice::getBitDepthC()
    18581882{
    18591883  TComSPS *sps = getSPS();
     
    18621886  if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )
    18631887  {
    1864     retVal = sps->getBitDepthY();
     1888    retVal = sps->getBitDepthC();
    18651889  }
    18661890  else
    18671891  {
    1868     retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsLuma();
     1892    retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsChroma();
    18691893  }
    18701894  return retVal;
    18711895}
    1872 UInt TComSlice::getBitDepthC()
    1873 {
    1874   TComSPS *sps = getSPS();
    1875   TComVPS *vps = getVPS();
    1876   UInt retVal, layerId = getLayerId();
    1877   if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )
    1878   {
    1879     retVal = sps->getBitDepthC();
    1880   }
    1881   else
    1882   {
    1883     retVal = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getBitDepthVpsChroma();
    1884   }
    1885   return retVal;
    1886 }
    18871896Int TComSlice::getQpBDOffsetY()
    18881897{
     
    18951904
    18961905RepFormat::RepFormat()
     1906#if AUXILIARY_PICTURES
     1907: m_chromaFormatVpsIdc          (CHROMA_420)
     1908#else
    18971909: m_chromaFormatVpsIdc          (0)
     1910#endif
    18981911, m_separateColourPlaneVpsFlag  (false)
    18991912, m_picWidthVpsInLumaSamples    (0)
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.h

    r466 r475  
    436436class RepFormat
    437437{
     438#if AUXILIARY_PICTURES
     439  ChromaFormat m_chromaFormatVpsIdc;
     440#else
    438441  Int  m_chromaFormatVpsIdc;
     442#endif
    439443  Bool m_separateColourPlaneVpsFlag;
    440444  Int  m_picWidthVpsInLumaSamples;
     
    446450  RepFormat();
    447451
     452#if AUXILIARY_PICTURES
     453  ChromaFormat getChromaFormatVpsIdc()        { return m_chromaFormatVpsIdc; }
     454  Void setChromaFormatVpsIdc(ChromaFormat x)  { m_chromaFormatVpsIdc = x;    }
     455#else
    448456  Int  getChromaFormatVpsIdc()        { return m_chromaFormatVpsIdc; }
    449457  Void setChromaFormatVpsIdc(Int x)   { m_chromaFormatVpsIdc = x;    }
     458#endif
    450459
    451460  Bool getSeparateColourPlaneVpsFlag()        { return m_separateColourPlaneVpsFlag; }
     
    10721081  Int         m_SPSId;
    10731082  Int         m_VPSId;
     1083#if AUXILIARY_PICTURES
     1084  ChromaFormat m_chromaFormatIdc;
     1085#else
    10741086  Int         m_chromaFormatIdc;
     1087#endif
    10751088
    10761089  UInt        m_uiMaxTLayers;           // maximum number of temporal layers
     
    11821195  Int  getSPSId       ()         { return m_SPSId;          }
    11831196  Void setSPSId       (Int i)    { m_SPSId = i;             }
     1197#if AUXILIARY_PICTURES
     1198  ChromaFormat getChromaFormatIdc ()         { return m_chromaFormatIdc;       }
     1199#else
    11841200  Int  getChromaFormatIdc ()         { return m_chromaFormatIdc;       }
    1185   Void setChromaFormatIdc (Int i)    { m_chromaFormatIdc = i;          }
    1186 
     1201#endif
     1202  Void setChromaFormatIdc (ChromaFormat i)    { m_chromaFormatIdc = i;          }
     1203
     1204#if AUXILIARY_PICTURES
     1205  static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc];      }
     1206  static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc];      }
     1207#else
    11871208  static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc];      }
    11881209  static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc];      }
     1210#endif
    11891211 
    11901212  // structure
     
    20692091  UInt getPicWidthInLumaSamples();
    20702092  UInt getPicHeightInLumaSamples();
     2093#if AUXILIARY_PICTURES
     2094  ChromaFormat getChromaFormatIdc();
     2095#else
    20712096  UInt getChromaFormatIdc();
     2097#endif
    20722098  UInt getBitDepthY();
    20732099  UInt getBitDepthC();
  • branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h

    r470 r475  
    153153
    154154#define O0215_PHASE_ALIGNMENT            1     // JCTVC_O0215: signal a flag to specify phase alignment case, 0: zero-position-aligned, 1: central-position-aligned,
     155#define AUXILIARY_PICTURES               1
    155156
    156157#else
     
    464465  CHROMA_422  = 2,
    465466  CHROMA_444  = 3
     467#if AUXILIARY_PICTURES
     468  ,NUM_CHROMA_FORMAT = 4
     469#endif
    466470};
    467471
Note: See TracChangeset for help on using the changeset viewer.