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


Ignore:
Timestamp:
14 Aug 2014, 00:00:45 (11 years ago)
Author:
seregin
Message:

Move conformance window signalling to the rep_format (JCTVC-R0156), patch was provided by Danny Hong <danny@…>

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

Legend:

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

    r827 r869  
    8484  if (!bIsVirtual)
    8585  {
     86#if R0156_CONF_WINDOW_IN_REP_FORMAT
     87#if AUXILIARY_PICTURES
     88    m_apcPicYuv[0]  = new TComPicYuv;  m_apcPicYuv[0]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, &conformanceWindow );
     89#else
     90    m_apcPicYuv[0]  = new TComPicYuv;  m_apcPicYuv[0]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, &conformanceWindow );
     91#endif
     92#else
    8693#if AUXILIARY_PICTURES
    8794    m_apcPicYuv[0]  = new TComPicYuv;  m_apcPicYuv[0]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
     
    8996    m_apcPicYuv[0]  = new TComPicYuv;  m_apcPicYuv[0]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
    9097#endif
    91   }
     98#endif
     99  }
     100#if R0156_CONF_WINDOW_IN_REP_FORMAT
     101#if AUXILIARY_PICTURES
     102  m_apcPicYuv[1]  = new TComPicYuv;  m_apcPicYuv[1]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, &conformanceWindow );
     103#else
     104  m_apcPicYuv[1]  = new TComPicYuv;  m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, &conformanceWindow );
     105#endif
     106#else
    92107#if AUXILIARY_PICTURES
    93108  m_apcPicYuv[1]  = new TComPicYuv;  m_apcPicYuv[1]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
     
    95110  m_apcPicYuv[1]  = new TComPicYuv;  m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
    96111#endif
     112#endif
    97113
    98114  for( Int i = 0; i < MAX_LAYERS; i++ )
     
    100116    if( m_bSpatialEnhLayer[i] )
    101117    {
     118#if R0156_CONF_WINDOW_IN_REP_FORMAT
     119#if AUXILIARY_PICTURES
     120      m_pcFullPelBaseRec[i] = new TComPicYuv;  m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, &conformanceWindow );
     121#else
     122      m_pcFullPelBaseRec[i] = new TComPicYuv;  m_pcFullPelBaseRec[i]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, &conformanceWindow );
     123#endif
     124#else
    102125#if AUXILIARY_PICTURES
    103126      m_pcFullPelBaseRec[i] = new TComPicYuv;  m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
    104127#else
    105128      m_pcFullPelBaseRec[i] = new TComPicYuv;  m_pcFullPelBaseRec[i]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
     129#endif
    106130#endif
    107131    }
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.cpp

    r856 r869  
    6969
    7070#if SVC_EXTENSION
     71#if R0156_CONF_WINDOW_IN_REP_FORMAT
     72#if AUXILIARY_PICTURES
     73Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, Window* conformanceWindow )
     74#else
     75Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, Window* conformanceWindow )
     76#endif
     77#else // R0156_CONF_WINDOW_IN_REP_FORMAT
    7178#if AUXILIARY_PICTURES
    7279Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps )
     
    7481Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps )
    7582#endif
     83#endif
    7684#else
    7785Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth )
     
    8290 
    8391#if SVC_EXTENSION
     92#if R0156_CONF_WINDOW_IN_REP_FORMAT
     93  if(conformanceWindow != NULL)
     94  {
     95    m_conformanceWindow = *conformanceWindow;
     96  }
     97#else
    8498  if(pcSps != NULL)
    8599  {
    86100    m_conformanceWindow = pcSps->getConformanceWindow();
    87101  }
     102#endif
    88103#endif
    89104
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.h

    r856 r869  
    111111  // ------------------------------------------------------------------------------------------------
    112112#if SVC_EXTENSION
     113#if R0156_CONF_WINDOW_IN_REP_FORMAT
     114#if AUXILIARY_PICTURES
     115  Void  create      ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, Window* conformanceWindow = NULL);
     116#else
     117  Void  create      ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, Window* conformanceWindow = NULL);
     118#endif
     119#else
    113120#if AUXILIARY_PICTURES
    114121  Void  create      ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL);
    115122#else
    116123  Void  create      ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL);
     124#endif
    117125#endif
    118126#else
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r867 r869  
    23162316}
    23172317
     2318#if R0156_CONF_WINDOW_IN_REP_FORMAT
     2319Window& TComSlice::getConformanceWindow()
     2320{
     2321  TComSPS *sps = getSPS();
     2322  TComVPS *vps = getVPS();
     2323  UInt layerId = getLayerId();
     2324#if O0096_REP_FORMAT_INDEX
     2325#if R0279_REP_FORMAT_INBL
     2326  if ( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
     2327  {
     2328    if( layerId == 0 && vps->getAvcBaseLayerFlag() )
     2329#else
     2330  if ( layerId == 0 )
     2331  {
     2332    if( vps->getAvcBaseLayerFlag() )
     2333#endif
     2334    {
     2335      return vps->getVpsRepFormat(layerId)->getConformanceWindowVps();
     2336    }
     2337    else
     2338    {
     2339      return sps->getConformanceWindow();
     2340    }
     2341  }
     2342  else
     2343  {
     2344    return vps->getVpsRepFormat( vps->getVpsRepFormatIdx(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : layerId) )->getConformanceWindowVps();
     2345  }
     2346#else
     2347  if( ( layerId == 0 ) || sps->getUpdateRepFormatFlag() )
     2348  {
     2349    return sps->getConformanceWindow();
     2350  }
     2351  else
     2352  {
     2353    return vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerId) )->getConformanceWindowVps();
     2354  }
     2355#endif
     2356}
     2357#endif
     2358
    23182359RepFormat::RepFormat()
    23192360#if AUXILIARY_PICTURES
     
    23372378  m_bitDepthVpsLuma             = 0;
    23382379  m_bitDepthVpsChroma           = 0;
     2380#if R0156_CONF_WINDOW_IN_REP_FORMAT
     2381  m_conformanceWindowVps.resetWindow();
     2382#endif
    23392383}
    23402384#endif
     
    31023146    m_bitDepthVpsLuma                 = other.m_bitDepthVpsLuma;
    31033147    m_bitDepthVpsChroma               = other.m_bitDepthVpsChroma;
     3148#if R0156_CONF_WINDOW_IN_REP_FORMAT
     3149    m_conformanceWindowVps            = other.m_conformanceWindowVps;
     3150#endif
    31043151  }
    31053152  return *this;
     
    40774124      TComPic* pcRefPicBL = m_pcBaseColPic[refLayerIdc];
    40784125
    4079       // copy scalability ratio, it is needed to get the corect location for the motion field of the corresponding reference layer block
     4126      // copy scalability ratio, it is needed to get the correct location for the motion field of the corresponding reference layer block
    40804127      pcIlpPic[refLayerIdc]->setSpatialEnhLayerFlag( refLayerIdc, m_pcPic->isSpatialEnhLayer(refLayerIdc) );
    40814128
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r867 r869  
    403403};
    404404
     405class Window
     406{
     407private:
     408  Bool          m_enabledFlag;
     409  Int           m_winLeftOffset;
     410  Int           m_winRightOffset;
     411  Int           m_winTopOffset;
     412  Int           m_winBottomOffset;
     413#if P0312_VERT_PHASE_ADJ
     414  Bool          m_vertPhasePositionEnableFlag;
     415#endif
     416public:
     417  Window()
     418  : m_enabledFlag (false)
     419  , m_winLeftOffset     (0)
     420  , m_winRightOffset    (0)
     421  , m_winTopOffset      (0)
     422  , m_winBottomOffset   (0)
     423#if P0312_VERT_PHASE_ADJ
     424  , m_vertPhasePositionEnableFlag(false) 
     425#endif
     426  { }
     427
     428  Bool          getWindowEnabledFlag() const      { return m_enabledFlag; }
     429#if P0312_VERT_PHASE_ADJ
     430  Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; m_vertPhasePositionEnableFlag = false; }
     431#else
     432  Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0;}
     433#endif
     434  Int           getWindowLeftOffset() const       { return m_enabledFlag ? m_winLeftOffset : 0; }
     435  Void          setWindowLeftOffset(Int val)      { if(val) {m_winLeftOffset = val; m_enabledFlag = true;} }
     436  Int           getWindowRightOffset() const      { return m_enabledFlag ? m_winRightOffset : 0; }
     437  Void          setWindowRightOffset(Int val)     { if(val) {m_winRightOffset = val; m_enabledFlag = true;} }
     438  Int           getWindowTopOffset() const        { return m_enabledFlag ? m_winTopOffset : 0; }
     439  Void          setWindowTopOffset(Int val)       { if(val) {m_winTopOffset = val; m_enabledFlag = true;} }
     440  Int           getWindowBottomOffset() const     { return m_enabledFlag ? m_winBottomOffset: 0; }
     441  Void          setWindowBottomOffset(Int val)    { if(val) {m_winBottomOffset = val; m_enabledFlag = true;} }
     442#if P0312_VERT_PHASE_ADJ
     443  Bool          getVertPhasePositionEnableFlag() const     { return m_vertPhasePositionEnableFlag;  }
     444  Void          setVertPhasePositionEnableFlag(Bool val)    { m_vertPhasePositionEnableFlag = val;  }
     445#endif
     446
     447#if P0312_VERT_PHASE_ADJ
     448  Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom, Bool vertPhasePositionEnableFlag = 0)
     449#else
     450  Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)
     451#endif
     452  {
     453    if(offsetLeft || offsetLRight || offsetLTop || offsetLBottom)
     454    {
     455      m_enabledFlag       = true;
     456      m_winLeftOffset     = offsetLeft;
     457      m_winRightOffset    = offsetLRight;
     458      m_winTopOffset      = offsetLTop;
     459      m_winBottomOffset   = offsetLBottom;
     460    }
     461#if P0312_VERT_PHASE_ADJ
     462    m_vertPhasePositionEnableFlag = vertPhasePositionEnableFlag;   
     463#endif
     464  }
     465};
     466
    405467#if REPN_FORMAT_IN_VPS
    406468class RepFormat
     
    420482  Int  m_bitDepthVpsChroma;             // coded as minus8
    421483
     484#if R0156_CONF_WINDOW_IN_REP_FORMAT
     485  Window m_conformanceWindowVps;
     486#endif
     487
    422488public:
    423489  RepFormat();
     
    454520  Int  getBitDepthVpsChroma()           { return m_bitDepthVpsChroma;   }
    455521  Void setBitDepthVpsChroma(Int x)      { m_bitDepthVpsChroma = x;      }
     522
     523#if R0156_CONF_WINDOW_IN_REP_FORMAT
     524  Window& getConformanceWindowVps()                           { return  m_conformanceWindowVps;             }
     525  Void    setConformanceWindowVps(Window& conformanceWindow ) { m_conformanceWindowVps = conformanceWindow; }
     526#endif
    456527};
    457528#endif
     
    12461317};
    12471318
    1248 class Window
    1249 {
    1250 private:
    1251   Bool          m_enabledFlag;
    1252   Int           m_winLeftOffset;
    1253   Int           m_winRightOffset;
    1254   Int           m_winTopOffset;
    1255   Int           m_winBottomOffset;
    1256 #if P0312_VERT_PHASE_ADJ
    1257   Bool          m_vertPhasePositionEnableFlag;
    1258 #endif
    1259 public:
    1260   Window()
    1261   : m_enabledFlag (false)
    1262   , m_winLeftOffset     (0)
    1263   , m_winRightOffset    (0)
    1264   , m_winTopOffset      (0)
    1265   , m_winBottomOffset   (0)
    1266 #if P0312_VERT_PHASE_ADJ
    1267   , m_vertPhasePositionEnableFlag(false) 
    1268 #endif
    1269   { }
    1270 
    1271   Bool          getWindowEnabledFlag() const      { return m_enabledFlag; }
    1272 #if P0312_VERT_PHASE_ADJ
    1273   Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; m_vertPhasePositionEnableFlag = false; }
    1274 #else
    1275   Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0;}
    1276 #endif
    1277   Int           getWindowLeftOffset() const       { return m_enabledFlag ? m_winLeftOffset : 0; }
    1278   Void          setWindowLeftOffset(Int val)      { m_winLeftOffset = val; m_enabledFlag = true; }
    1279   Int           getWindowRightOffset() const      { return m_enabledFlag ? m_winRightOffset : 0; }
    1280   Void          setWindowRightOffset(Int val)     { m_winRightOffset = val; m_enabledFlag = true; }
    1281   Int           getWindowTopOffset() const        { return m_enabledFlag ? m_winTopOffset : 0; }
    1282   Void          setWindowTopOffset(Int val)       { m_winTopOffset = val; m_enabledFlag = true; }
    1283   Int           getWindowBottomOffset() const     { return m_enabledFlag ? m_winBottomOffset: 0; }
    1284   Void          setWindowBottomOffset(Int val)    { m_winBottomOffset = val; m_enabledFlag = true; }
    1285 #if P0312_VERT_PHASE_ADJ
    1286   Bool          getVertPhasePositionEnableFlag() const     { return m_vertPhasePositionEnableFlag;  }
    1287   Void          setVertPhasePositionEnableFlag(Bool val)    { m_vertPhasePositionEnableFlag = val;  }
    1288 #endif
    1289 
    1290 #if P0312_VERT_PHASE_ADJ
    1291   Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom, Bool vertPhasePositionEnableFlag = 0)
    1292 #else
    1293   Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)
    1294 #endif
    1295   {
    1296     m_enabledFlag       = true;
    1297     m_winLeftOffset     = offsetLeft;
    1298     m_winRightOffset    = offsetLRight;
    1299     m_winTopOffset      = offsetLTop;
    1300     m_winBottomOffset   = offsetLBottom;
    1301 #if P0312_VERT_PHASE_ADJ
    1302     m_vertPhasePositionEnableFlag = vertPhasePositionEnableFlag;   
    1303 #endif
    1304   }
    1305 };
    1306 
    1307 
    13081319class TComVUI
    13091320{
     
    25712582  Int  getQpBDOffsetY();
    25722583  Int  getQpBDOffsetC();
     2584
     2585#if R0156_CONF_WINDOW_IN_REP_FORMAT
     2586  Window& getConformanceWindow();
     2587#endif
    25732588#endif
    25742589
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r866 r869  
    209209#define Q0195_REP_FORMAT_CLEANUP         1      ///< JCTVC-Q0195: restructureing of rep_format() signaling
    210210#define REP_FORMAT_FIX                   1      ///< update_rep_format_flag should be inferred to be equal to 0
     211
     212#define R0156_CONF_WINDOW_IN_REP_FORMAT  O0096_REP_FORMAT_INDEX ///< JCTVC-R0156: add conformance window cropping offsets to rep_format()
    211213
    212214#define RESAMPLING_CONSTRAINT_BUG_FIX    1
Note: See TracChangeset for help on using the changeset viewer.