Changeset 627 in SHVCSoftware


Ignore:
Timestamp:
12 Mar 2014, 22:06:13 (11 years ago)
Author:
qualcomm
Message:

JCTVC-P312: vertical phase adjustment for interlace-to-progressive scalability, from Jianle Chen (cjianle@…)

Location:
branches/SHM-5.1-dev/source
Files:
16 edited

Legend:

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

    r626 r627  
    12451245{
    12461246  Int targetOutputLsIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx();
    1247   TComVPS *vps;
     1247  TComVPS *vps = NULL;
    12481248
    12491249  if( targetOutputLsIdx == 0 )   // Only base layer is output
  • branches/SHM-5.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r624 r627  
    385385  string    cfg_scaledRefLayerBottomOffset [MAX_LAYERS];
    386386  Int*      cfg_numScaledRefLayerOffsets[MAX_LAYERS];
     387#if P0312_VERT_PHASE_ADJ
     388  string    cfg_vertPhasePositionEnableFlag[MAX_LAYERS];
     389#endif
    387390
    388391#if O0098_SCALED_REF_LAYER_ID
     
    393396  string*    cfg_scaledRefLayerRightOffsetPtr  [MAX_LAYERS];
    394397  string*    cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS];
     398  #if P0312_VERT_PHASE_ADJ
     399  string*    cfg_vertPhasePositionEnableFlagPtr[MAX_LAYERS];
     400#endif
     401
    395402#if RC_SHVC_HARMONIZATION
    396403  Bool*   cfg_RCEnableRateControl  [MAX_LAYERS];
     
    457464      cfg_scaledRefLayerRightOffsetPtr [layer] = &cfg_scaledRefLayerRightOffset[layer] ;
    458465      cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer];
     466#if P0312_VERT_PHASE_ADJ
     467      cfg_vertPhasePositionEnableFlagPtr [layer]   = &cfg_vertPhasePositionEnableFlag[layer] ;
     468#endif
    459469    }
    460470#if RC_SHVC_HARMONIZATION
     
    569579                                                                 " bottom-right luma sample of the EL picture, in units of two luma samples")
    570580  ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr,string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to"
    571                                                                  " bottom-right luma sample of the EL picture, in units of two luma samples")
     581  " bottom-right luma sample of the EL picture, in units of two luma samples")
     582#if P0312_VERT_PHASE_ADJ
     583  ("VertPhasePositionEnableFlag%d", cfg_vertPhasePositionEnableFlagPtr,string(""), MAX_LAYERS, "VertPhasePositionEnableFlag for layer %d")
     584#endif
    572585#if O0194_DIFFERENT_BITDEPTH_EL_BL
    573586  ("InputBitDepth%d",       cfg_InputBitDepthY,    8, MAX_LAYERS, "Bit-depth of input file for layer %d")
     
    10721085      assert( strcmp(cfg_scaledRefLayerId[layer].c_str(),  ""));
    10731086#endif
     1087#if P0312_VERT_PHASE_ADJ
    10741088      assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(),  "") ||
    10751089              strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") ||
    10761090              strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(),   "") ||
    1077               strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"")
    1078             );
     1091              strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") ||
     1092              strcmp(cfg_vertPhasePositionEnableFlag[layer].c_str(),"") );
     1093#else
     1094      assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(),  "") ||
     1095              strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") ||
     1096              strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(),   "") ||
     1097              strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") );
     1098#endif
    10791099    }
    10801100
     
    11521172      }
    11531173    }
     1174#if P0312_VERT_PHASE_ADJ
     1175   // VertPhasePositionEnableFlag //
     1176    if(strcmp(cfg_vertPhasePositionEnableFlag[layer].c_str(),  ""))
     1177    {
     1178      cfgStringToArray( &tempArray, cfg_vertPhasePositionEnableFlag[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "VertPhasePositionEnableFlag");
     1179      if(tempArray)
     1180      {
     1181        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
     1182        {
     1183          m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] = tempArray[i];
     1184        }
     1185        delete [] tempArray; tempArray = NULL;
     1186      }
     1187    }
     1188#endif
    11541189  }
    11551190#if VPS_EXTN_DIRECT_REF_LAYERS
  • branches/SHM-5.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r540 r627  
    6060  ::memset(m_scaledRefLayerRightOffset,  0, sizeof(m_scaledRefLayerRightOffset));
    6161  ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset));
     62#if P0312_VERT_PHASE_ADJ
     63  ::memset(m_vertPhasePositionEnableFlag,    0, sizeof(m_vertPhasePositionEnableFlag));
     64#endif
    6265}
    6366
  • branches/SHM-5.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.h

    r588 r627  
    9797  Int       m_scaledRefLayerRightOffset [MAX_LAYERS];
    9898  Int       m_scaledRefLayerBottomOffset[MAX_LAYERS];
     99#if P0312_VERT_PHASE_ADJ
     100  Bool      m_vertPhasePositionEnableFlag[MAX_LAYERS];
     101#endif
     102
    99103#if O0194_DIFFERENT_BITDEPTH_EL_BL
    100104  Int       m_inputBitDepthY;                               ///< bit-depth of input file (luma component)
  • branches/SHM-5.1-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r624 r627  
    570570        m_acTEncTop[layer].setScaledRefLayerId(i, m_acLayerCfg[layer].m_scaledRefLayerId[i]);
    571571#endif
     572#if P0312_VERT_PHASE_ADJ
     573        m_acTEncTop[layer].setVertPhasePositionEnableFlag( i, m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i]);
     574        m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],
     575                                                  2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i], m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i], false);
     576#else
    572577        m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],
    573578                                                  2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]);
     579#endif
    574580      }
    575581    }
  • branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.cpp

    r625 r627  
    125125  m_interLayerPredEnabledFlag = 0;
    126126  ::memset( m_interLayerPredLayerIdc, 0, sizeof(m_interLayerPredLayerIdc) );
     127#if P0312_VERT_PHASE_ADJ
     128  ::memset( m_vertPhasePositionFlag, 0, sizeof(m_vertPhasePositionFlag) );
     129#endif
    127130#endif //SVC_EXTENSION
    128131
     
    11221125  m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
    11231126  memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) );
     1127#if P0312_VERT_PHASE_ADJ
     1128  memcpy( m_vertPhasePositionFlag, pSrc->m_vertPhasePositionFlag, sizeof( m_vertPhasePositionFlag ) );
     1129#endif
    11241130#endif
    11251131  m_pcSPS                = pSrc->m_pcSPS;
  • branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.h

    r625 r627  
    627627  Int         m_avgPicRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    628628#endif
     629 
     630#if P0312_VERT_PHASE_ADJ
     631  Bool        m_vpsVuiVertPhaseInUseFlag;
     632#endif
     633
    629634#if P0300_ALT_OUTPUT_LAYER_FLAG
    630635  Bool       m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1];
     
    10081013  Int     getBaseLayerPSCompatibilityFlag (Int layer)   { return m_baseLayerPSCompatibilityFlag[layer];}
    10091014#endif
     1015
     1016#if P0312_VERT_PHASE_ADJ
     1017  Bool getVpsVuiVertPhaseInUseFlag()       { return m_vpsVuiVertPhaseInUseFlag; }
     1018  Void setVpsVuiVertPhaseInUseFlag(Bool x) { m_vpsVuiVertPhaseInUseFlag = x;    }
     1019#endif
     1020
    10101021#if P0300_ALT_OUTPUT_LAYER_FLAG
    10111022  Bool   getAltOuputLayerFlag(Int idx)         { return m_altOutputLayerFlag[idx]; }
     
    11151126  Int           m_winTopOffset;
    11161127  Int           m_winBottomOffset;
     1128#if P0312_VERT_PHASE_ADJ
     1129  Bool          m_vertPhasePositionEnableFlag;
     1130  Bool          m_vertPhasePositionFlag;
     1131#endif
    11171132public:
    11181133  Window()
     
    11221137  , m_winTopOffset      (0)
    11231138  , m_winBottomOffset   (0)
     1139#if P0312_VERT_PHASE_ADJ
     1140  , m_vertPhasePositionEnableFlag(false)
     1141  , m_vertPhasePositionFlag(false)
     1142#endif
    11241143  { }
    11251144
    11261145  Bool          getWindowEnabledFlag() const      { return m_enabledFlag; }
    1127   Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; }
     1146#if P0312_VERT_PHASE_ADJ
     1147  Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; m_vertPhasePositionEnableFlag = m_vertPhasePositionFlag = false;}
     1148#else
     1149  Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0;}
     1150#endif
    11281151  Int           getWindowLeftOffset() const       { return m_enabledFlag ? m_winLeftOffset : 0; }
    11291152  Void          setWindowLeftOffset(Int val)      { m_winLeftOffset = val; m_enabledFlag = true; }
     
    11351158  Void          setWindowBottomOffset(Int val)    { m_winBottomOffset = val; m_enabledFlag = true; }
    11361159
     1160#if P0312_VERT_PHASE_ADJ
     1161  Bool          getVertPhasePositionEnableFlag() const     { return m_vertPhasePositionEnableFlag ; }
     1162  Void          setVertPhasePositionEnableFlag(Bool val)    { m_vertPhasePositionEnableFlag = val;  }
     1163
     1164  Bool          getVertPhasePositionFlag() const     { return m_vertPhasePositionEnableFlag ? m_vertPhasePositionFlag: 0; }
     1165  Void          setVertPhasePositionFlag(Bool val)    { m_vertPhasePositionFlag = val;  }
     1166
     1167  Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom  , Bool vertPhasePositionEnableFlag = 0, Bool phasePosFlag = 0)
     1168#else
    11371169  Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)
     1170#endif
    11381171  {
    11391172    m_enabledFlag       = true;
     
    11421175    m_winTopOffset      = offsetLTop;
    11431176    m_winBottomOffset   = offsetLBottom;
     1177#if P0312_VERT_PHASE_ADJ
     1178    m_vertPhasePositionEnableFlag = vertPhasePositionEnableFlag;
     1179    m_vertPhasePositionFlag = phasePosFlag;
     1180#endif
    11441181  }
    11451182};
     
    13931430  UInt m_layerId;
    13941431  UInt        m_numScaledRefLayerOffsets;
     1432#if P0312_VERT_PHASE_ADJ
     1433 Bool         m_vertPhasePositionEnableFlag[MAX_LAYERS];
     1434#endif
    13951435#if O0098_SCALED_REF_LAYER_ID
    13961436  UInt        m_scaledRefLayerId[MAX_LAYERS];
     
    15491589  UInt     getNumScaledRefLayerOffsets()  { return m_numScaledRefLayerOffsets; }
    15501590  Void     setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x; }
     1591#if P0312_VERT_PHASE_ADJ
     1592  Bool     getVertPhasePositionEnableFlag(Int x)  { return m_vertPhasePositionEnableFlag[x]; }
     1593  Void     setVertPhasePositionEnableFlag(Int x, Bool b)  { m_vertPhasePositionEnableFlag[x] = b; }
     1594#endif
    15511595#if O0098_SCALED_REF_LAYER_ID
    15521596  UInt     getScaledRefLayerId(Int x)          { return m_scaledRefLayerId[x]; }
     
    19441988  Int         m_activeNumILRRefIdx;        //< Active inter-layer reference pictures
    19451989  Int         m_interLayerPredLayerIdc  [MAX_VPS_LAYER_ID_PLUS1];
     1990#if P0312_VERT_PHASE_ADJ
     1991  Bool        m_vertPhasePositionFlag[MAX_VPS_LAYER_ID_PLUS1];
     1992#endif
    19461993#if POC_RESET_FLAG
    19471994  Bool        m_bPocResetFlag;
     
    22242271  Bool      getInterLayerPredEnabledFlag     ()                { return m_interLayerPredEnabledFlag;}
    22252272
     2273#if P0312_VERT_PHASE_ADJ
     2274  Int       getVertPhasePositionFlag (UInt layerIdx)              { return   m_vertPhasePositionFlag[layerIdx];}
     2275  Void      setVertPhasePositionFlag (Bool b, UInt layerIdx)      {  m_vertPhasePositionFlag[layerIdx] = b;  }
     2276#endif
     2277
    22262278  Void      setNumMotionPredRefLayers(int i)            { m_numMotionPredRefLayers = i; }
    22272279  Int       getNumMotionPredRefLayers()                 { return m_numMotionPredRefLayers; }
  • branches/SHM-5.1-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r498 r627  
    126126  Int heightEL  = pcUsPic->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
    127127  Int strideEL  = pcUsPic->getStride();
     128
     129#if P0312_VERT_PHASE_ADJ
     130  Bool vertPhasePositionEnableFlag = scalEL.getVertPhasePositionEnableFlag();
     131  Bool vertPhasePositionFlag = scalEL.getVertPhasePositionFlag();
     132  if (vertPhasePositionFlag)
     133  {
     134    assert (vertPhasePositionEnableFlag);
     135  }
     136#endif
    128137
    129138  Pel* piTempBufY = pcTempPic->getLumaAddr();
     
    219228#if O0215_PHASE_ALIGNMENT //for Luma, if Phase 0, then both PhaseX  and PhaseY should be 0. If symmetric: both PhaseX and PhaseY should be 2
    220229    Int   phaseX = 2*phaseAlignFlag;
     230#if P0312_VERT_PHASE_ADJ
     231    Int   phaseY = (vertPhasePositionEnableFlag?(vertPhasePositionFlag *4):(2*phaseAlignFlag));
     232#else
    221233    Int   phaseY = 2*phaseAlignFlag;
     234#endif
    222235#else
    223236    Int   phaseX = 0;
     237#if P0312_VERT_PHASE_ADJ
     238    Int   phaseY = (vertPhasePositionEnableFlag?(vertPhasePositionFlag *4):(0));
     239#else
    224240    Int   phaseY = 0;
     241#endif
    225242#endif
    226243
     
    363380
    364381#if O0215_PHASE_ALIGNMENT
     382    Int phaseXC = phaseAlignFlag;
     383#if P0312_VERT_PHASE_ADJ
     384    Int phaseYC = vertPhasePositionEnableFlag ? (vertPhasePositionFlag * 4):(phaseAlignFlag + 1);
     385#else
     386    Int phaseYC = phaseAlignFlag + 1;
     387#endif
     388#else
    365389    Int phaseXC = 0;
     390#if P0312_VERT_PHASE_ADJ
     391    Int phaseYC = vertPhasePositionEnableFlag ? (vertPhasePositionFlag * 4): 1;;
     392#else
    366393    Int phaseYC = 1;
    367 
     394#endif
     395#endif
     396   
    368397#if ROUNDING_OFFSET
    369     addX       = ( ( (phaseXC+phaseAlignFlag) * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
    370     addY       = ( ( (phaseYC+phaseAlignFlag) * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
    371 #else
    372     addX       = ( ( ( widthBL * (phaseXC+phaseAlignFlag) ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
    373     addY       = ( ( ( heightBL * (phaseYC+phaseAlignFlag) ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
    374 #endif
    375 
    376     deltaX     = 4 * (phaseXC+phaseAlignFlag);
    377     deltaY     = 4 * (phaseYC+phaseAlignFlag);
    378 #else
    379     phaseX = 0;
    380     phaseY = 1;
    381 
    382 #if ROUNDING_OFFSET
    383     addX       = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
    384     addY       = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
    385 #else
    386     addX       = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
    387     addY       = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
    388 #endif
    389 
    390     deltaX     = 4 * phaseX;
    391     deltaY     = 4 * phaseY;
    392 #endif
     398    addX       = ( ( phaseXC * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
     399    addY       = ( ( phaseYC * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
     400#else
     401    addX       = ( ( ( widthBL * (phaseXC) ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
     402    addY       = ( ( ( heightBL * (phaseYC) ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
     403#endif
     404
     405    deltaX     = 4 * phaseXC;
     406    deltaY     = 4 * phaseYC;
    393407
    394408    shiftXM4 = shiftX - 4;
  • branches/SHM-5.1-dev/source/Lib/TLibCommon/TypeDef.h

    r625 r627  
    5050#define O0137_MAX_LAYERID                1      ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1
    5151
     52#define P0312_VERT_PHASE_ADJ             1      ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report)
    5253#define P0130_EOB                        1      ///< JCTVC-P0130, set layer Id of EOB NALU to be fixed to 0
    5354#define P0307_REMOVE_VPS_VUI_OFFSET      1      ///< JCTVC-P0307, remove implementation related to VPS VUI offset signalling
  • branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r625 r627  
    859859      READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
    860860      READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
     861#if P0312_VERT_PHASE_ADJ
     862      READ_FLAG( uiCode, "vert_phase_pos_enable_flag" );scaledWindow.setVertPhasePositionEnableFlag  (uiCode);  pcSPS->setVertPhasePositionEnableFlag(i,uiCode);
     863#endif
    861864    }
    862865  }
     
    19381941    }
    19391942  }
     1943#endif
     1944
     1945#if P0312_VERT_PHASE_ADJ
     1946  READ_FLAG( uiCode, "vps_vui_vert_phase_in_use_flag" ); vps->setVpsVuiVertPhaseInUseFlag(uiCode);
    19401947#endif
    19411948
     
    24862493#endif
    24872494#endif
     2495#if P0312_VERT_PHASE_ADJ
     2496    for(Int i = 0; i < rpcSlice->getSPS()->getNumScaledRefLayerOffsets(); i++)
     2497    {
     2498      if (rpcSlice->getSPS()->getVertPhasePositionEnableFlag(rpcSlice->getInterLayerPredLayerIdc(i)))
     2499      {
     2500        READ_FLAG( uiCode, "phase_pos_flag" ); rpcSlice->setVertPhasePositionFlag( uiCode? true: false, i);
     2501      }
     2502    }
     2503#endif
    24882504
    24892505    if(sps->getUseSAO())
  • branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r625 r627  
    14671467#endif
    14681468
     1469#if P0312_VERT_PHASE_ADJ
     1470#if O0098_SCALED_REF_LAYER_ID
     1471        Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
     1472#else
     1473        Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
     1474#endif
     1475#else
    14691476#if O0098_SCALED_REF_LAYER_ID
    14701477        const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
    14711478#else
    14721479        const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
     1480#endif
    14731481#endif
    14741482
     
    14931501          Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
    14941502#endif*/
     1503#if P0312_VERT_PHASE_ADJ
     1504          scalEL.setVertPhasePositionFlag (pcSlice->getVertPhasePositionFlag(i));
     1505#endif
    14951506#if O0215_PHASE_ALIGNMENT
    14961507#if O0194_JOINT_US_BITSHIFT
  • branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r625 r627  
    663663      WRITE_SVLC( scaledWindow.getWindowRightOffset()  >> 1, "scaled_ref_layer_right_offset" );
    664664      WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" );
     665#if P0312_VERT_PHASE_ADJ
     666      WRITE_FLAG( scaledWindow.getVertPhasePositionEnableFlag(), "vert_phase_pos_enable_flag" );
     667#endif
    665668    }
    666669  }
     
    14581461    }
    14591462  }
     1463#endif
     1464
     1465#if P0312_VERT_PHASE_ADJ
     1466    WRITE_FLAG( vps->getVpsVuiVertPhaseInUseFlag(), "vps_vui_vert_phase_in_use_flag" );
    14601467#endif
    14611468
     
    18391846      }
    18401847    }     
     1848#if P0312_VERT_PHASE_ADJ
     1849    for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
     1850    {
     1851      if (pcSlice->getSPS()->getVertPhasePositionEnableFlag(pcSlice->getInterLayerPredLayerIdc(i)))
     1852      {
     1853        WRITE_FLAG( pcSlice->getVertPhasePositionFlag(i), "phase_pos_flag" );
     1854      }
     1855    }
     1856#endif
    18411857#endif //SVC_EXTENSION
    18421858
  • branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncCfg.h

    r595 r627  
    386386
    387387  Window   &getConformanceWindow()                           { return m_conformanceWindow; }
     388#if P0312_VERT_PHASE_ADJ
     389  Void      setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom, false, false); }
     390#else
    388391  Void      setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom); }
     392#endif
    389393
    390394  Void      setFramesToBeEncoded            ( Int   i )      { m_framesToBeEncoded = i; }
  • branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r620 r627  
    771771        }
    772772
     773#if P0312_VERT_PHASE_ADJ
     774#if O0098_SCALED_REF_LAYER_ID
     775        Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
     776#else
     777        Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
     778#endif
     779#else
    773780#if O0098_SCALED_REF_LAYER_ID
    774781        const Window &scalEL = m_pcEncTop->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
     
    776783        const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc);
    777784#endif
     785#endif
    778786
    779787        Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth();
     
    797805          Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
    798806#endif*/
     807#if P0312_VERT_PHASE_ADJ
     808          //when PhasePositionEnableFlag is equal to 1, set vertPhasePositionFlag to 0 if BL is top field and 1 if bottom
     809          if (scalEL.getVertPhasePositionEnableFlag())
     810          {
     811            pcSlice->setVertPhasePositionFlag(pcSlice->getPOC()%2, i);
     812            scalEL.setVertPhasePositionFlag (pcSlice->getVertPhasePositionFlag(i));
     813          }
     814#endif
    799815#if O0215_PHASE_ALIGNMENT
    800816#if O0194_JOINT_US_BITSHIFT
  • branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r595 r627  
    902902#endif
    903903    m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];
     904#if P0312_VERT_PHASE_ADJ
     905    m_cSPS.setVertPhasePositionEnableFlag(i,m_scaledRefLayerWindow[i].getVertPhasePositionEnableFlag());
     906#endif
    904907  }
    905908#endif //SVC_EXTENSION
  • branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncTop.h

    r595 r627  
    139139#endif
    140140  Window                  m_scaledRefLayerWindow[MAX_LAYERS];
     141#if P0312_VERT_PHASE_ADJ
     142  Bool                    m_vertPhasePositionEnableFlag[MAX_LAYERS];
     143#endif
    141144#if POC_RESET_FLAG
    142145  Int                     m_pocAdjustmentValue;
     
    226229#endif
    227230  Window&  getScaledRefLayerWindow(Int x)            { return m_scaledRefLayerWindow[x]; }
     231#if P0312_VERT_PHASE_ADJ
     232  Void                    setVertPhasePositionEnableFlag(Int x, Bool b) { m_vertPhasePositionEnableFlag[x] = b;   }
     233  UInt                    getVertPhasePositionEnableFlag(Int x)          { return m_vertPhasePositionEnableFlag[x]; }
     234#endif
     235
    228236  TComPic** getIlpList() { return m_cIlpPic; }
    229237#if REF_IDX_MFM
Note: See TracChangeset for help on using the changeset viewer.