Changeset 869 in SHVCSoftware


Ignore:
Timestamp:
14 Aug 2014, 00:00:45 (10 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
Files:
11 edited

Legend:

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

    r868 r869  
    181181    repFormat->setBitDepthVpsChroma         ( getInternalBitDepthC()                        );  // Need modification to change for each layer
    182182#endif
     183
     184#if R0156_CONF_WINDOW_IN_REP_FORMAT
     185    repFormat->getConformanceWindowVps().setWindow(
     186      m_acLayerCfg[mapIdxToLayer[idx]].m_confWinLeft,
     187      m_acLayerCfg[mapIdxToLayer[idx]].m_confWinRight,
     188      m_acLayerCfg[mapIdxToLayer[idx]].m_confWinTop,
     189      m_acLayerCfg[mapIdxToLayer[idx]].m_confWinBottom );
     190#endif
     191
    183192#if HIGHER_LAYER_IRAP_SKIP_FLAG
    184193    m_acTEncTop[mapIdxToLayer[idx]].setSkipPictureAtArcSwitch( m_skipPictureAtArcSwitch );
  • 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
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r866 r869  
    729729#endif
    730730#endif
    731   READ_FLAG(     uiCode, "conformance_window_flag");
    732   if (uiCode != 0)
    733   {
    734     Window &conf = pcSPS->getConformanceWindow();
     731
     732#if R0156_CONF_WINDOW_IN_REP_FORMAT
    735733#if REPN_FORMAT_IN_VPS
    736     READ_UVLC(   uiCode, "conf_win_left_offset" );               conf.setWindowLeftOffset  ( uiCode );
    737     READ_UVLC(   uiCode, "conf_win_right_offset" );              conf.setWindowRightOffset ( uiCode );
    738     READ_UVLC(   uiCode, "conf_win_top_offset" );                conf.setWindowTopOffset   ( uiCode );
    739     READ_UVLC(   uiCode, "conf_win_bottom_offset" );             conf.setWindowBottomOffset( uiCode );
    740 #else
    741     READ_UVLC(   uiCode, "conf_win_left_offset" );               conf.setWindowLeftOffset  ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) );
    742     READ_UVLC(   uiCode, "conf_win_right_offset" );              conf.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) );
    743     READ_UVLC(   uiCode, "conf_win_top_offset" );                conf.setWindowTopOffset   ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) );
    744     READ_UVLC(   uiCode, "conf_win_bottom_offset" );             conf.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) );
    745 #endif
    746   }
     734#if O0096_REP_FORMAT_INDEX
     735  if( pcSPS->getLayerId() == 0 )
     736#else
     737  if(  pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() )
     738#endif
     739  {
     740#endif
     741#endif
     742    READ_FLAG(     uiCode, "conformance_window_flag");
     743    if (uiCode != 0)
     744    {
     745      Window &conf = pcSPS->getConformanceWindow();
     746#if REPN_FORMAT_IN_VPS
     747      READ_UVLC(   uiCode, "conf_win_left_offset" );               conf.setWindowLeftOffset  ( uiCode );
     748      READ_UVLC(   uiCode, "conf_win_right_offset" );              conf.setWindowRightOffset ( uiCode );
     749      READ_UVLC(   uiCode, "conf_win_top_offset" );                conf.setWindowTopOffset   ( uiCode );
     750      READ_UVLC(   uiCode, "conf_win_bottom_offset" );             conf.setWindowBottomOffset( uiCode );
     751#else
     752      READ_UVLC(   uiCode, "conf_win_left_offset" );               conf.setWindowLeftOffset  ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) );
     753      READ_UVLC(   uiCode, "conf_win_right_offset" );              conf.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) );
     754      READ_UVLC(   uiCode, "conf_win_top_offset" );                conf.setWindowTopOffset   ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) );
     755      READ_UVLC(   uiCode, "conf_win_bottom_offset" );             conf.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) );
     756#endif
     757    }
     758#if R0156_CONF_WINDOW_IN_REP_FORMAT
     759#if REPN_FORMAT_IN_VPS
     760  }
     761#endif
     762#endif
     763
    747764#if REPN_FORMAT_IN_VPS
    748765#if O0096_REP_FORMAT_INDEX
     
    20692086    repFormat->setBitDepthVpsChroma         ( repFormatPrev->getBitDepthVpsChroma() );
    20702087  }
     2088
    20712089#else
    20722090#if AUXILIARY_PICTURES
     
    20872105  READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" );         repFormat->setBitDepthVpsChroma( uiCode + 8 );
    20882106#endif
     2107
     2108#if R0156_CONF_WINDOW_IN_REP_FORMAT
     2109  READ_FLAG( uiCode, "conformance_window_vps_flag" );
     2110  if( uiCode != 0)
     2111  {
     2112    Window &conf = repFormat->getConformanceWindowVps();
     2113    READ_UVLC( uiCode, "conf_win_vps_left_offset" );         conf.setWindowLeftOffset  ( uiCode );
     2114    READ_UVLC( uiCode, "conf_win_vps_right_offset" );        conf.setWindowRightOffset ( uiCode );
     2115    READ_UVLC( uiCode, "conf_win_vps_top_offset" );          conf.setWindowTopOffset   ( uiCode );
     2116    READ_UVLC( uiCode, "conf_win_vps_bottom_offset" );       conf.setWindowBottomOffset( uiCode );
     2117  }
     2118#endif
    20892119}
    20902120#endif
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r858 r869  
    214214
    215215    Int  numReorderPics[MAX_TLAYER];
     216#if R0156_CONF_WINDOW_IN_REP_FORMAT
     217    Window &conformanceWindow = slice->getConformanceWindow();
     218#else
    216219    Window &conformanceWindow = pcSPS->getConformanceWindow();
     220#endif
    217221    Window defaultDisplayWindow = pcSPS->getVuiParametersPresentFlag() ? pcSPS->getVuiParameters()->getDefaultDisplayWindow() : Window();
    218222
     
    303307{
    304308  Int  numReorderPics[MAX_TLAYER];
     309#if R0156_CONF_WINDOW_IN_REP_FORMAT
     310  Window &conformanceWindow = pcSlice->getConformanceWindow();
     311#else
    305312  Window &conformanceWindow = pcSlice->getSPS()->getConformanceWindow();
     313#endif
    306314  Window defaultDisplayWindow = pcSlice->getSPS()->getVuiParametersPresentFlag() ? pcSlice->getSPS()->getVuiParameters()->getDefaultDisplayWindow() : Window();
    307315
     
    765773
    766774      Int  numReorderPics[MAX_TLAYER];
     775#if !R0156_CONF_WINDOW_IN_REP_FORMAT
    767776      Window conformanceWindow;
     777#endif
    768778      Window defaultDisplayWindow;
    769779
     780#if R0156_CONF_WINDOW_IN_REP_FORMAT
     781#if AUXILIARY_PICTURES
     782      pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), repFormat->getConformanceWindowVps(), defaultDisplayWindow, numReorderPics, NULL, true);
     783#else
     784      pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), repFormat->getConformanceWindowVps(), defaultDisplayWindow, numReorderPics, NULL, true);
     785#endif
     786#else
    770787#if AUXILIARY_PICTURES
    771788      pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true);
    772789#else
    773790      pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true);
     791#endif
    774792#endif
    775793      // it is needed where the VPS is accessed through the slice
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r866 r869  
    555555#endif
    556556#endif
    557   Window conf = pcSPS->getConformanceWindow();
    558 
    559   WRITE_FLAG( conf.getWindowEnabledFlag(),          "conformance_window_flag" );
    560   if (conf.getWindowEnabledFlag())
    561   {
     557
     558#if R0156_CONF_WINDOW_IN_REP_FORMAT
    562559#if REPN_FORMAT_IN_VPS
    563     WRITE_UVLC( conf.getWindowLeftOffset(),   "conf_win_left_offset"   );
    564     WRITE_UVLC( conf.getWindowRightOffset(),  "conf_win_right_offset"  );
    565     WRITE_UVLC( conf.getWindowTopOffset(),    "conf_win_top_offset"    );
    566     WRITE_UVLC( conf.getWindowBottomOffset(), "conf_win_bottom_offset" );
    567 #else
    568     WRITE_UVLC( conf.getWindowLeftOffset()   / TComSPS::getWinUnitX(pcSPS->getChromaFormatIdc() ), "conf_win_left_offset" );
    569     WRITE_UVLC( conf.getWindowRightOffset()  / TComSPS::getWinUnitX(pcSPS->getChromaFormatIdc() ), "conf_win_right_offset" );
    570     WRITE_UVLC( conf.getWindowTopOffset()    / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc() ), "conf_win_top_offset" );
    571     WRITE_UVLC( conf.getWindowBottomOffset() / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc() ), "conf_win_bottom_offset" );
    572 #endif
    573   }
     560#if O0096_REP_FORMAT_INDEX
     561  if( pcSPS->getLayerId() == 0 )
     562#else
     563  if( pcSPS->getLayerId() == 0 || pcSPS->getUpdateRepFormatFlag() )
     564#endif 
     565  {
     566#endif
     567#endif
     568    Window conf = pcSPS->getConformanceWindow();
     569
     570    WRITE_FLAG( conf.getWindowEnabledFlag(),          "conformance_window_flag" );
     571    if (conf.getWindowEnabledFlag())
     572    {
     573#if REPN_FORMAT_IN_VPS
     574      WRITE_UVLC( conf.getWindowLeftOffset(),   "conf_win_left_offset"   );
     575      WRITE_UVLC( conf.getWindowRightOffset(),  "conf_win_right_offset"  );
     576      WRITE_UVLC( conf.getWindowTopOffset(),    "conf_win_top_offset"    );
     577      WRITE_UVLC( conf.getWindowBottomOffset(), "conf_win_bottom_offset" );
     578#else
     579      WRITE_UVLC( conf.getWindowLeftOffset()   / TComSPS::getWinUnitX(pcSPS->getChromaFormatIdc() ), "conf_win_left_offset" );
     580      WRITE_UVLC( conf.getWindowRightOffset()  / TComSPS::getWinUnitX(pcSPS->getChromaFormatIdc() ), "conf_win_right_offset" );
     581      WRITE_UVLC( conf.getWindowTopOffset()    / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc() ), "conf_win_top_offset" );
     582      WRITE_UVLC( conf.getWindowBottomOffset() / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc() ), "conf_win_bottom_offset" );
     583#endif
     584    }
     585#if R0156_CONF_WINDOW_IN_REP_FORMAT
     586#if REPN_FORMAT_IN_VPS
     587  }
     588#endif
     589#endif
    574590
    575591#if REPN_FORMAT_IN_VPS
     
    14711487  WRITE_CODE( repFormat->getBitDepthVpsLuma() - 8,   4, "bit_depth_luma_minus8" );           
    14721488  WRITE_CODE( repFormat->getBitDepthVpsChroma() - 8, 4, "bit_depth_chroma_minus8" );
     1489#endif
     1490
     1491#if R0156_CONF_WINDOW_IN_REP_FORMAT
     1492  Window conf = repFormat->getConformanceWindowVps();
     1493
     1494  WRITE_FLAG( conf.getWindowEnabledFlag(),    "conformance_window_vps_flag" );
     1495  if (conf.getWindowEnabledFlag())
     1496  {
     1497    WRITE_UVLC( conf.getWindowLeftOffset(),   "conf_win_vps_left_offset"   );
     1498    WRITE_UVLC( conf.getWindowRightOffset(),  "conf_win_vps_right_offset"  );
     1499    WRITE_UVLC( conf.getWindowTopOffset(),    "conf_win_vps_top_offset"    );
     1500    WRITE_UVLC( conf.getWindowBottomOffset(), "conf_win_vps_bottom_offset" );
     1501  }
    14731502#endif
    14741503}
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r849 r869  
    16981698
    16991699    Int  numReorderPics[MAX_TLAYER];
     1700#if R0156_CONF_WINDOW_IN_REP_FORMAT
     1701    Window &conformanceWindow = repFormat->getConformanceWindowVps();
     1702#else
    17001703    Window &conformanceWindow = m_cSPS.getConformanceWindow();
     1704#endif
    17011705    Window defaultDisplayWindow = m_cSPS.getVuiParametersPresentFlag() ? m_cSPS.getVuiParameters()->getDefaultDisplayWindow() : Window();
    17021706
Note: See TracChangeset for help on using the changeset viewer.