Changeset 1090 in SHVCSoftware for branches/SHM-dev/source


Ignore:
Timestamp:
1 Jul 2015, 00:53:31 (9 years ago)
Author:
seregin
Message:

cleanup macros: Q0120_PHASE_CALCULATION, P0312_VERT_PHASE_ADJ, Q0200_CONFORMANCE_BL_SIZE, R0220_REMOVE_EL_CLIP, MOVE_SCALED_OFFSET_TO_PPS, R0209_GENERIC_PHASE, REF_REGION_OFFSET, O0215_PHASE_ALIGNMENT_REMOVAL, O0215_PHASE_ALIGNMENT, RESAMPLING_FIX

Location:
branches/SHM-dev/source
Files:
21 edited

Legend:

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

    r1089 r1090  
    793793  string    cfg_scaledRefLayerBottomOffset [MAX_LAYERS];
    794794  Int*      cfg_numRefLayerLocationOffsets[MAX_LAYERS];
    795 #if REF_REGION_OFFSET
    796795  string    cfg_scaledRefLayerOffsetPresentFlag [MAX_LAYERS];
    797796  string    cfg_refRegionOffsetPresentFlag      [MAX_LAYERS];
     
    800799  string    cfg_refRegionRightOffset  [MAX_LAYERS];
    801800  string    cfg_refRegionBottomOffset [MAX_LAYERS];
    802 #endif
    803 #if R0209_GENERIC_PHASE
    804801  string    cfg_resamplePhaseSetPresentFlag [MAX_LAYERS];
    805802  string    cfg_phaseHorLuma   [MAX_LAYERS];
     
    807804  string    cfg_phaseHorChroma [MAX_LAYERS];
    808805  string    cfg_phaseVerChroma [MAX_LAYERS];
    809 #else
    810 #if P0312_VERT_PHASE_ADJ
    811   string    cfg_vertPhasePositionEnableFlag[MAX_LAYERS];
    812 #endif
    813 #endif
    814806
    815807#if O0098_SCALED_REF_LAYER_ID
     
    820812  string*    cfg_scaledRefLayerRightOffsetPtr  [MAX_LAYERS];
    821813  string*    cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS];
    822 #if REF_REGION_OFFSET
    823814  string*    cfg_scaledRefLayerOffsetPresentFlagPtr [MAX_LAYERS];
    824815  string*    cfg_refRegionOffsetPresentFlagPtr      [MAX_LAYERS];
     
    827818  string*    cfg_refRegionRightOffsetPtr  [MAX_LAYERS];
    828819  string*    cfg_refRegionBottomOffsetPtr [MAX_LAYERS];
    829 #endif
    830 #if R0209_GENERIC_PHASE
    831820  string*    cfg_resamplePhaseSetPresentFlagPtr [MAX_LAYERS];
    832821  string*    cfg_phaseHorLumaPtr   [MAX_LAYERS];
     
    834823  string*    cfg_phaseHorChromaPtr [MAX_LAYERS];
    835824  string*    cfg_phaseVerChromaPtr [MAX_LAYERS];
    836 #endif
    837 #if P0312_VERT_PHASE_ADJ
    838   string*    cfg_vertPhasePositionEnableFlagPtr[MAX_LAYERS];
    839 #endif
    840825
    841826#if RC_SHVC_HARMONIZATION
     
    927912      cfg_scaledRefLayerRightOffsetPtr [layer] = &cfg_scaledRefLayerRightOffset[layer];
    928913      cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer];
    929 #if P0312_VERT_PHASE_ADJ
    930       cfg_vertPhasePositionEnableFlagPtr[layer] = &cfg_vertPhasePositionEnableFlag[layer];
    931 #endif
    932 #if REF_REGION_OFFSET
    933914      cfg_scaledRefLayerOffsetPresentFlagPtr [layer] = &cfg_scaledRefLayerOffsetPresentFlag [layer];
    934915      cfg_refRegionOffsetPresentFlagPtr      [layer] = &cfg_refRegionOffsetPresentFlag      [layer];
     
    937918      cfg_refRegionRightOffsetPtr [layer] = &cfg_refRegionRightOffset [layer];
    938919      cfg_refRegionBottomOffsetPtr[layer] = &cfg_refRegionBottomOffset[layer];
    939 #endif
    940 #if R0209_GENERIC_PHASE
    941920      cfg_resamplePhaseSetPresentFlagPtr [layer] = &cfg_resamplePhaseSetPresentFlag [layer];
    942921      cfg_phaseHorLumaPtr   [layer] = &cfg_phaseHorLuma   [layer];
     
    944923      cfg_phaseHorChromaPtr [layer] = &cfg_phaseHorChroma [layer];
    945924      cfg_phaseVerChromaPtr [layer] = &cfg_phaseVerChroma [layer];
    946 #endif
    947925    }
    948926#if RC_SHVC_HARMONIZATION
     
    10881066  ("FrameRate%d,-fr%d",                             cfg_FrameRate,                               0, MAX_LAYERS, "Frame rate for layer %d")
    10891067  ("LambdaModifier%d,-LM%d",                        m_adLambdaModifier,                Double(1.0), MAX_TLAYER, "Lambda modifier for temporal layer %d")
    1090 #if O0215_PHASE_ALIGNMENT
    1091   ("PhaseAlignment",                                m_phaseAlignFlag,                                    false, "indicate the sample location alignment between layers (0: zero position aligned, 1: central position aligned)")
    1092 #endif
    10931068#if REPN_FORMAT_IN_VPS
    10941069  ("RepFormatIdx%d",                                cfg_repFormatIdx,                           -1, MAX_LAYERS, "Index to the representation format structure used from the VPS")
     
    11651140  ("ScaledRefLayerBottomOffset%d",                  cfg_scaledRefLayerBottomOffsetPtr,  string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to"
    11661141                                                                                                                "  bottom-right luma sample of the EL picture, in units of two luma samples")
    1167 #if REF_REGION_OFFSET
     1142#if SVC_EXTENSION
    11681143  ("ScaledRefLayerOffsetPresentFlag%d",         cfg_scaledRefLayerOffsetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of scaled reference layer offsets")
    11691144  ("RefRegionOffsetPresentFlag%d",                  cfg_refRegionOffsetPresentFlagPtr,  string(""), MAX_LAYERS, "presense flag of reference region offsets")
     
    11761151  ("RefRegionBottomOffset%d",                       cfg_refRegionBottomOffsetPtr,       string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of ref region with respect to"
    11771152                                                                                                                "  bottom-right luma sample of the BL picture, in units of two luma samples")
    1178 #endif
    1179 #if R0209_GENERIC_PHASE
    11801153  ("ResamplePhaseSetPresentFlag%d",                 cfg_resamplePhaseSetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of resample phase set")
    11811154  ("PhaseHorLuma%d",                                cfg_phaseHorLumaPtr,                string(""), MAX_LAYERS, "luma shift in the horizontal direction used in resampling proces")
     
    11831156  ("PhaseHorChroma%d",                              cfg_phaseHorChromaPtr,              string(""), MAX_LAYERS, "chroma shift in the horizontal direction used in resampling proces")
    11841157  ("PhaseVerChroma%d",                              cfg_phaseVerChromaPtr,              string(""), MAX_LAYERS, "chroma shift in the vertical   direction used in resampling proces")
    1185 #endif
    1186 #if P0312_VERT_PHASE_ADJ
    1187   ("VertPhasePositionEnableFlag%d",                 cfg _vertPhasePositionEnableFlagPtr,string(""), MAX_LAYERS, "VertPhasePositionEnableFlag for layer %d")
    11881158#endif
    11891159#if Q0074_COLOUR_REMAPPING_SEI
     
    21562126      assert( strcmp(cfg_refLocationOffsetLayerId[layer].c_str(),  ""));
    21572127#endif
    2158 #if REF_REGION_OFFSET
    21592128      Bool srloFlag =
    21602129        strcmp(cfg_scaledRefLayerLeftOffset   [layer].c_str(), "") ||
     
    21622131        strcmp(cfg_scaledRefLayerTopOffset    [layer].c_str(), "") ||
    21632132        strcmp(cfg_scaledRefLayerBottomOffset [layer].c_str(), "");
     2133
    21642134      Bool rroFlag =
    21652135        strcmp(cfg_refRegionLeftOffset   [layer].c_str(), "") ||
     
    21672137        strcmp(cfg_refRegionTopOffset    [layer].c_str(), "") ||
    21682138        strcmp(cfg_refRegionBottomOffset [layer].c_str(), "");
    2169 #if R0209_GENERIC_PHASE
     2139
    21702140      Bool phaseSetFlag =
    21712141        strcmp(cfg_phaseHorLuma   [layer].c_str(), "") ||
     
    21742144        strcmp(cfg_phaseVerChroma [layer].c_str(), "");
    21752145      assert( srloFlag || rroFlag || phaseSetFlag);
    2176 #else
    2177       assert( srloFlag || rroFlag );
    2178 #endif
    2179 #else
    2180 #if P0312_VERT_PHASE_ADJ
    2181       assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(),  "") ||
    2182               strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") ||
    2183               strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(),   "") ||
    2184               strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") ||
    2185               strcmp(cfg_vertPhasePositionEnableFlag[layer].c_str(),"") );
    2186 #else
    2187       assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(),  "") ||
    2188               strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") ||
    2189               strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(),   "") ||
    2190               strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") );
    2191 #endif
    2192 #endif
    21932146    }
    21942147
     
    22112164#endif
    22122165
    2213 #if REF_REGION_OFFSET
    22142166    // Presense Flag //
    22152167    if(strcmp(cfg_scaledRefLayerOffsetPresentFlag[layer].c_str(),  ""))
     
    22252177      }
    22262178    }
    2227 #endif
    22282179
    22292180    // Left offset //
     
    22822233      }
    22832234    }
    2284 #if P0312_VERT_PHASE_ADJ
    2285    // VertPhasePositionEnableFlag //
    2286     if(strcmp(cfg_vertPhasePositionEnableFlag[layer].c_str(),  ""))
    2287     {
    2288       cfgStringToArray( &tempArray, cfg_vertPhasePositionEnableFlag[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "VertPhasePositionEnableFlag");
    2289       if(tempArray)
    2290       {
    2291         for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
    2292         {
    2293           m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] = tempArray[i];
    2294         }
    2295         delete [] tempArray; tempArray = NULL;
    2296       }
    2297     }
    2298 #endif
    2299 #if REF_REGION_OFFSET
     2235
    23002236    // Presense Flag //
    23012237    if(strcmp(cfg_refRegionOffsetPresentFlag[layer].c_str(),  ""))
     
    23672303      }
    23682304    }
    2369 #endif
    2370 #if R0209_GENERIC_PHASE
     2305
    23712306    Int numPhaseSet = m_acLayerCfg[layer].m_numRefLayerLocationOffsets;
    23722307
     
    24402375      }
    24412376    }
    2442 #endif
    24432377  }
    24442378
     
    46114545  printf("InterLayerWeightedPred            : %d\n", m_useInterLayerWeightedPred );
    46124546#endif
    4613 #if O0215_PHASE_ALIGNMENT 
    4614   printf("Cross-layer sample alignment      : %d\n", m_phaseAlignFlag);
    4615 #endif
    46164547  printf("\n");
    46174548  for(UInt layer=0; layer<m_numLayers; layer++)
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r1089 r1090  
    496496  UInt      m_ilcIdc[1024];
    497497#endif
    498 #if O0215_PHASE_ALIGNMENT
    499   Bool      m_phaseAlignFlag;
    500 #endif
    501498#if O0223_PICTURE_TYPES_ALIGN_FLAG
    502499  Bool      m_crossLayerPictureTypeAlignFlag;
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r1089 r1090  
    7272  ::memset(m_scaledRefLayerRightOffset,  0, sizeof(m_scaledRefLayerRightOffset));
    7373  ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset));
    74 #if REF_REGION_OFFSET
    7574  ::memset(m_scaledRefLayerOffsetPresentFlag, 0, sizeof(m_scaledRefLayerOffsetPresentFlag));
    7675  ::memset(m_refRegionOffsetPresentFlag, 0, sizeof(m_refRegionOffsetPresentFlag));
     
    7978  ::memset(m_refRegionRightOffset,  0, sizeof(m_refRegionRightOffset));
    8079  ::memset(m_refRegionBottomOffset, 0, sizeof(m_refRegionBottomOffset));
    81 #endif
    82 #if R0209_GENERIC_PHASE
    8380  ::memset(m_resamplePhaseSetPresentFlag, 0, sizeof(m_resamplePhaseSetPresentFlag));
    8481  ::memset(m_phaseHorLuma,   0, sizeof(m_phaseHorLuma));
     
    8683  ::memset(m_phaseHorChroma, 0, sizeof(m_phaseHorChroma));
    8784  ::memset(m_phaseVerChroma, 0, sizeof(m_phaseVerChroma));
    88 #else
    89 #if P0312_VERT_PHASE_ADJ
    90   ::memset(m_vertPhasePositionEnableFlag, 0, sizeof(m_vertPhasePositionEnableFlag));
    91 #endif
    92 #endif
    9385}
    9486
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h

    r1089 r1090  
    101101  Int       m_scaledRefLayerRightOffset [MAX_LAYERS];
    102102  Int       m_scaledRefLayerBottomOffset[MAX_LAYERS];
    103 #if REF_REGION_OFFSET
    104103  Bool      m_scaledRefLayerOffsetPresentFlag [MAX_LAYERS];
    105104  Bool      m_refRegionOffsetPresentFlag      [MAX_LAYERS];
     
    108107  Int       m_refRegionRightOffset [MAX_LAYERS];
    109108  Int       m_refRegionBottomOffset[MAX_LAYERS];
    110 #endif
    111 #if P0312_VERT_PHASE_ADJ
    112   Bool      m_vertPhasePositionEnableFlag[MAX_LAYERS];
    113 #endif
    114 #if R0209_GENERIC_PHASE
    115109  Int       m_phaseHorLuma  [MAX_LAYERS];
    116110  Int       m_phaseVerLuma  [MAX_LAYERS];
     
    118112  Int       m_phaseVerChroma[MAX_LAYERS];
    119113  Bool      m_resamplePhaseSetPresentFlag [MAX_LAYERS];
    120 #endif
    121114
    122115  Int       m_inputBitDepth   [MAX_NUM_CHANNEL_TYPE];         ///< bit-depth of input file
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1089 r1090  
    769769    if( layer > 0 )
    770770    {
    771 #if REF_REGION_OFFSET
    772771#if AUXILIARY_PICTURES
    773772      Int subWidthC  = ( m_acLayerCfg[layer].m_chromaFormatIDC == CHROMA_420 || m_acLayerCfg[layer].m_chromaFormatIDC == CHROMA_422 ) ? 2 : 1;
     
    777776      Int subHeightC = 2;
    778777#endif
    779 #endif
    780778      m_acTEncTop[layer].setNumRefLayerLocationOffsets          ( m_acLayerCfg[layer].m_numRefLayerLocationOffsets );
    781779      for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
     
    784782        m_acTEncTop[layer].setRefLocationOffsetLayerId          (i, m_acLayerCfg[layer].m_refLocationOffsetLayerId[i]);
    785783#endif
    786 #if REF_REGION_OFFSET
    787784        m_acTEncTop[layer].setScaledRefLayerOffsetPresentFlag   ( i, m_acLayerCfg[layer].m_scaledRefLayerOffsetPresentFlag[i] );
    788785        m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( subWidthC  * m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], subWidthC  * m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],
    789786                                                                  subHeightC * m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i],  subHeightC * m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]);
    790 #else
    791 #if P0312_VERT_PHASE_ADJ
    792         m_acTEncTop[layer].setVertPhasePositionEnableFlag       ( i, m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] );
    793         m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],
    794           2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i], m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] );
    795 #else
    796         m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],
    797           2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]);
    798 #endif
    799 #endif
     787
    800788        Int rlSubWidthC  = ( m_acLayerCfg[i].m_chromaFormatIDC == CHROMA_420 || m_acLayerCfg[i].m_chromaFormatIDC == CHROMA_422 ) ? 2 : 1;
    801789        Int rlSubHeightC = ( m_acLayerCfg[i].m_chromaFormatIDC == CHROMA_420 ) ? 2 : 1;
     
    804792        m_acTEncTop[layer].getRefLayerWindow(i).setWindow       ( rlSubWidthC  * m_acLayerCfg[layer].m_refRegionLeftOffset[i], rlSubWidthC  * m_acLayerCfg[layer].m_refRegionRightOffset[i],
    805793                                                                  rlSubHeightC * m_acLayerCfg[layer].m_refRegionTopOffset[i],  rlSubHeightC * m_acLayerCfg[layer].m_refRegionBottomOffset[i]);
    806 #if R0209_GENERIC_PHASE
    807794        m_acTEncTop[layer].setResamplePhaseSetPresentFlag       ( i, m_acLayerCfg[layer].m_resamplePhaseSetPresentFlag[i] );
    808795        m_acTEncTop[layer].setPhaseHorLuma                      ( i, m_acLayerCfg[layer].m_phaseHorLuma[i] );
     
    810797        m_acTEncTop[layer].setPhaseHorChroma                    ( i, m_acLayerCfg[layer].m_phaseHorChroma[i] );
    811798        m_acTEncTop[layer].setPhaseVerChroma                    ( i, m_acLayerCfg[layer].m_phaseVerChroma[i] );
    812 #endif
    813799      }
    814800    }
     
    18461832#endif
    18471833
    1848 #if O0215_PHASE_ALIGNMENT
    1849   vps->setPhaseAlignFlag( m_phaseAlignFlag );
    1850 #endif
    1851 
    18521834#if P0300_ALT_OUTPUT_LAYER_FLAG
    18531835  for (Int k = 0; k < MAX_VPS_LAYER_SETS_PLUS1; k++)
     
    18591841  vps->setAltOuputLayerFlag( m_altOutputLayerFlag );
    18601842#endif
    1861 #endif
    1862 
    1863 #if P0312_VERT_PHASE_ADJ
    1864   Bool vpsVuiVertPhaseInUseFlag = false;
    1865   for( UInt layerId = 1; layerId < m_numLayers; layerId++ )
    1866   {
    1867     for( i = 0; i < m_acLayerCfg[layerId].m_numScaledRefLayerOffsets; i++ )
    1868     {
    1869       if( m_acTEncTop[layerId].getVertPhasePositionEnableFlag(i) )
    1870       {
    1871         vpsVuiVertPhaseInUseFlag = true;
    1872         break;
    1873       }
    1874     }
    1875   }
    1876   vps->setVpsVuiVertPhaseInUseFlag( vpsVuiVertPhaseInUseFlag );
    18771843#endif
    18781844
  • branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r1074 r1090  
    34283428#endif
    34293429
    3430 #if MOVE_SCALED_OFFSET_TO_PPS
    34313430#if O0098_SCALED_REF_LAYER_ID
    34323431  Int leftStartL = m_pcSlice->getPPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset();
     
    34363435  Int topStartL  = baseColPic->getSlice(0)->getPPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset();
    34373436#endif
    3438 #else
    3439 #if O0098_SCALED_REF_LAYER_ID
    3440   Int leftStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset();
    3441   Int topStartL  = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset();
    3442 #else
    3443   Int leftStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset();
    3444   Int topStartL  = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset();
    3445 #endif
    3446 #endif
    3447 
    3448 #if REF_REGION_OFFSET
     3437
    34493438  const Window &windowRL = m_pcSlice->getPPS()->getRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc));
    34503439  Int iBX = (((iPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16) + windowRL.getWindowLeftOffset();
    34513440  Int iBY = (((iPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16) + windowRL.getWindowTopOffset();
    3452 #else
    3453 #if Q0200_CONFORMANCE_BL_SIZE
    3454   Int chromaFormatIdc = baseColPic->getSlice(0)->getChromaFormatIdc();
    3455   Int iBX = (((iPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16) + baseColPic->getConformanceWindow().getWindowLeftOffset() * TComSPS::getWinUnitX( chromaFormatIdc );
    3456   Int iBY = (((iPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16) + baseColPic->getConformanceWindow().getWindowTopOffset() * TComSPS::getWinUnitY( chromaFormatIdc );
    3457 #else
    3458   Int iBX = ((iPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16;
    3459   Int iBY = ((iPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;
    3460 #endif
    3461 #endif
    34623441
    34633442#if REF_IDX_MFM
  • branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp

    r1057 r1090  
    860860
    861861#if SVC_EXTENSION
    862 #if O0215_PHASE_ALIGNMENT_REMOVAL
    863862Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic )
    864863{
    865864  m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic );
    866865}
    867 #else
    868 #if O0215_PHASE_ALIGNMENT
    869 #if O0194_JOINT_US_BITSHIFT
    870 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag )
    871 {
    872   m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, phaseAlignFlag );
    873 }
    874 #else
    875 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag )
    876 {
    877   m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, phaseAlignFlag );
    878 }
    879 #endif
    880 #else
    881 #if O0194_JOINT_US_BITSHIFT
    882 #if REF_REGION_OFFSET
    883 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow )
    884 {
    885   m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, altRefWindow );
    886 }
    887 #else
    888 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window)
    889 {
    890   m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window);
    891 }
    892 #endif
    893 #else
    894 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window)
    895 {
    896   m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window);
    897 }
    898 #endif
    899 #endif
    900 #endif
    901866#endif //SVC_EXTENSION
    902867//! \}
  • branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.h

    r1029 r1090  
    146146
    147147#if SVC_EXTENSION
    148 #if O0215_PHASE_ALIGNMENT_REMOVAL
    149148Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );
    150 #else
    151 #if O0215_PHASE_ALIGNMENT
    152 #if O0194_JOINT_US_BITSHIFT
    153   Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag );
    154 #else
    155   Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );
    156 #endif
    157 #else
    158 #if O0194_JOINT_US_BITSHIFT
    159 #if REF_REGION_OFFSET
    160   Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow );
    161 #else
    162   Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
    163 #endif
    164 #else
    165   Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
    166 #endif
    167 #endif
    168 #endif
    169149#endif //SVC_EXTENSION
    170150};
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1086 r1090  
    159159  m_interLayerPredEnabledFlag = 0;
    160160  ::memset( m_interLayerPredLayerIdc, 0, sizeof(m_interLayerPredLayerIdc) );
    161 #if P0312_VERT_PHASE_ADJ
    162   ::memset( m_vertPhasePositionFlag, 0, sizeof(m_vertPhasePositionFlag) );
    163 #endif
    164161#endif //SVC_EXTENSION
    165162
     
    535532        UInt refLayerId = m_pcVPS->getRefLayerId( m_layerId, refLayerIdc );
    536533#if RESAMPLING_CONSTRAINT_BUG_FIX
    537 #if MOVE_SCALED_OFFSET_TO_PPS
    538534#if O0098_SCALED_REF_LAYER_ID
    539535        const Window &scalEL = getPPS()->getScaledRefLayerWindowForLayer(refLayerId);
    540536#else
    541537        const Window &scalEL = getPPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]);
    542 #endif
    543 #else
    544 #if O0098_SCALED_REF_LAYER_ID
    545         const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer(refLayerId);
    546 #else
    547         const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]);
    548 #endif
    549538#endif
    550539        Int scalingOffset = ((scalEL.getWindowLeftOffset()   == 0 ) &&
     
    10991088  m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
    11001089  memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) );
    1101 #if P0312_VERT_PHASE_ADJ
    1102   memcpy( m_vertPhasePositionFlag, pSrc->m_vertPhasePositionFlag, sizeof( m_vertPhasePositionFlag ) );
    1103 #endif
    11041090#endif
    11051091  m_pcSPS                = pSrc->m_pcSPS;
     
    22602246, m_layerId                   ( 0 )
    22612247, m_extensionFlag             ( false )
    2262 #if !MOVE_SCALED_OFFSET_TO_PPS
    2263 , m_numScaledRefLayerOffsets  ( 0 )
    2264 #endif
    22652248#if REPN_FORMAT_IN_VPS
    22662249, m_updateRepFormatFlag       (false)
     
    22972280  ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps));
    22982281  ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
    2299 
    2300 #if !MOVE_SCALED_OFFSET_TO_PPS
    2301 #if P0312_VERT_PHASE_ADJ
    2302   ::memset(m_vertPhasePositionEnableFlag, 0, sizeof(m_vertPhasePositionEnableFlag));
    2303 #endif
    2304 #endif
    23052282}
    23062283
     
    24342411const Int TComSPS::m_winUnitX[]={1,2,2,1};
    24352412const Int TComSPS::m_winUnitY[]={1,2,1,1};
    2436 
    2437 #if !MOVE_SCALED_OFFSET_TO_PPS
    2438 #if O0098_SCALED_REF_LAYER_ID
    2439 Window& TComSPS::getScaledRefLayerWindowForLayer(Int layerId)
    2440 {
    2441   static Window win;
    2442 
    2443   for (Int i = 0; i < m_numScaledRefLayerOffsets; i++)
    2444   {
    2445     if (layerId == m_scaledRefLayerId[i])
    2446     {
    2447       return m_scaledRefLayerWindow[i];
    2448     }
    2449   }
    2450 
    2451   win.resetWindow();  // scaled reference layer offsets are inferred to be zero when not present
    2452   return win;
    2453 }
    2454 #endif
    2455 #if REF_REGION_OFFSET
    2456 Window& TComSPS::getRefLayerWindowForLayer(Int layerId)
    2457 {
    2458   static Window win;
    2459 
    2460   for (Int i = 0; i < m_numRefLayerOffsets; i++)
    2461   {
    2462     if (layerId == m_refLayerId[i])
    2463     {
    2464       return m_refLayerWindow[i];
    2465     }
    2466   }
    2467 
    2468   win.resetWindow();  // reference region offsets are inferred to be zero when not present
    2469   return win;
    2470 }
    2471 #endif
    2472 #endif
    24732413
    24742414TComPPS::TComPPS()
     
    25192459, m_pocResetInfoPresentFlag   (false)
    25202460#endif
    2521 #if MOVE_SCALED_OFFSET_TO_PPS
    25222461, m_numRefLayerLocationOffsets  ( 0 )
    2523 #endif
    25242462#if Q0048_CGS_3D_ASYMLUT
    25252463, m_nCGSFlag(0)
     
    25382476
    25392477#if SVC_EXTENSION
    2540 #if REF_REGION_OFFSET
    25412478  ::memset(m_scaledRefLayerOffsetPresentFlag,   0, sizeof(m_scaledRefLayerOffsetPresentFlag));
    25422479  ::memset(m_refRegionOffsetPresentFlag,   0, sizeof(m_refRegionOffsetPresentFlag));
    2543 #endif
    2544 #if R0209_GENERIC_PHASE
    25452480  ::memset(m_resamplePhaseSetPresentFlag,   0, sizeof(m_resamplePhaseSetPresentFlag));
    25462481  ::memset(m_phaseHorLuma,   0, sizeof(m_phaseHorLuma));
     
    25482483  ::memset(m_phaseHorChroma, 0, sizeof(m_phaseHorChroma));
    25492484  ::memset(m_phaseVerChroma, 0, sizeof(m_phaseVerChroma));
    2550 #endif
    25512485#endif //SVC_EXTENSION
    25522486}
     
    32103144#endif
    32113145
    3212 #if MOVE_SCALED_OFFSET_TO_PPS
    32133146#if O0098_SCALED_REF_LAYER_ID
    32143147Window& TComPPS::getScaledRefLayerWindowForLayer(Int layerId)
     
    32283161}
    32293162#endif
    3230 #if REF_REGION_OFFSET
     3163
     3164#if SVC_EXTENSION
    32313165Window& TComPPS::getRefLayerWindowForLayer(Int layerId)
    32323166{
     
    32443178  return win;
    32453179}
    3246 #endif
    3247 
    3248 #if RESAMPLING_FIX
    3249 #if R0209_GENERIC_PHASE
     3180
    32503181Bool TComPPS::hasZeroResamplingPhase(Int refLayerId)
    32513182{
     
    32783209}
    32793210#endif
    3280 #endif
    3281 
    3282 #endif
    3283 
    32843211
    32853212#if DERIVE_LAYER_ID_LIST_VARIABLES
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1086 r1090  
    467467  Int           m_winTopOffset;
    468468  Int           m_winBottomOffset;
    469 #if P0312_VERT_PHASE_ADJ
    470   Bool          m_vertPhasePositionEnableFlag;
    471 #endif
     469
    472470public:
    473471  Window()
     
    477475  , m_winTopOffset      (0)
    478476  , m_winBottomOffset   (0)
    479 #if P0312_VERT_PHASE_ADJ
    480   , m_vertPhasePositionEnableFlag(false) 
    481 #endif
    482477  { }
    483478
    484479  Bool          getWindowEnabledFlag() const      { return m_enabledFlag; }
    485 #if P0312_VERT_PHASE_ADJ
    486   Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; m_vertPhasePositionEnableFlag = false; }
    487 #else
    488480  Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; }
    489 #endif
    490481  Int           getWindowLeftOffset() const       { return m_enabledFlag ? m_winLeftOffset : 0; }
    491482  Void          setWindowLeftOffset(Int val)      { m_winLeftOffset = val; m_enabledFlag = true; }
     
    497488  Void          setWindowBottomOffset(Int val)    { m_winBottomOffset = val; m_enabledFlag = true; }
    498489
    499 #if P0312_VERT_PHASE_ADJ
    500   Bool          getVertPhasePositionEnableFlag() const     { return m_vertPhasePositionEnableFlag;  }
    501   Void          setVertPhasePositionEnableFlag(Bool val)    { m_vertPhasePositionEnableFlag = val;  }
    502 #endif
    503 #if REF_REGION_OFFSET && RESAMPLING_FIX
     490#if SVC_EXTENSION
    504491  Bool          hasEqualOffset(const Window& ref) const
    505492  {
     
    511498#endif
    512499
    513 #if P0312_VERT_PHASE_ADJ
    514   Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom, Bool vertPhasePositionEnableFlag = 0)
    515 #else
    516500  Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)
    517 #endif
    518501  {
    519502    m_enabledFlag       = true;
     
    522505    m_winTopOffset      = offsetLTop;
    523506    m_winBottomOffset   = offsetLBottom;
    524 
    525 #if P0312_VERT_PHASE_ADJ
    526     m_vertPhasePositionEnableFlag = vertPhasePositionEnableFlag;   
    527 #endif
    528507  }
    529508};
     
    797776  Int        m_constPicRateIdc     [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    798777  Int        m_avgPicRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    799  
    800 #if P0312_VERT_PHASE_ADJ
    801   Bool       m_vpsVuiVertPhaseInUseFlag;
    802 #endif
    803778
    804779#if P0300_ALT_OUTPUT_LAYER_FLAG
     
    826801#endif
    827802  Int        m_viewIdVal                [MAX_LAYERS];
    828 #endif
    829 
    830 #if O0215_PHASE_ALIGNMENT
    831   Bool       m_phaseAlignFlag;
    832803#endif
    833804
     
    13481319#endif
    13491320
    1350 #if P0312_VERT_PHASE_ADJ
    1351   Bool   getVpsVuiVertPhaseInUseFlag()       { return m_vpsVuiVertPhaseInUseFlag; }
    1352   Void   setVpsVuiVertPhaseInUseFlag(Bool x) { m_vpsVuiVertPhaseInUseFlag = x;    }
    1353 #endif
    1354 
    13551321#if P0300_ALT_OUTPUT_LAYER_FLAG
    13561322  Bool   getAltOuputLayerFlag(Int idx)         { return m_altOutputLayerFlag[idx]; }
     
    13971363  Void   setExtensionOffset( UInt offset )    { m_extensionOffset = offset; }
    13981364#endif
    1399 #endif
    1400 #if O0215_PHASE_ALIGNMENT
    1401   Bool   getPhaseAlignFlag()                             { return m_phaseAlignFlag; }
    1402   Void   setPhaseAlignFlag(Bool x)                       { m_phaseAlignFlag = x;    }
    14031365#endif
    14041366#if VPS_DPB_SIZE_TABLE
     
    17271689  Int         m_NumDirectRefLayers;
    17281690#endif
    1729 #if P0312_VERT_PHASE_ADJ
    1730  Bool         m_vertPhasePositionEnableFlag[MAX_LAYERS];
    1731 #endif
    1732 #if !MOVE_SCALED_OFFSET_TO_PPS
    1733 #if O0098_SCALED_REF_LAYER_ID
    1734   UInt        m_scaledRefLayerId[MAX_LAYERS];
    1735 #endif
    1736   Window      m_scaledRefLayerWindow[MAX_LAYERS];
    1737 #endif
    17381691#if REPN_FORMAT_IN_VPS
    17391692  Bool m_updateRepFormatFlag;
     
    19121865  Void     setNumDirectRefLayers(Int n)             {  m_NumDirectRefLayers = n;     }
    19131866#endif
    1914 #if !MOVE_SCALED_OFFSET_TO_PPS
    1915   UInt     getNumScaledRefLayerOffsets()       { return m_numScaledRefLayerOffsets; }
    1916   Void     setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x;    }
    1917 #if P0312_VERT_PHASE_ADJ
    1918   Bool     getVertPhasePositionEnableFlag(Int x)          { return m_vertPhasePositionEnableFlag[x]; }
    1919   Void     setVertPhasePositionEnableFlag(Int x, Bool b)  { m_vertPhasePositionEnableFlag[x] = b;    }
    1920 #endif
    1921 #if O0098_SCALED_REF_LAYER_ID
    1922   UInt     getScaledRefLayerId(Int x)          { return m_scaledRefLayerId[x]; }
    1923   Void     setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id;   }
    1924   Window&  getScaledRefLayerWindowForLayer( Int layerId );
    1925 #endif
    1926   Window&  getScaledRefLayerWindow( Int x )   { return m_scaledRefLayerWindow[x]; }
    1927 #endif
    19281867#if REPN_FORMAT_IN_VPS
    19291868  Bool     getUpdateRepFormatFlag()       { return m_updateRepFormatFlag; }
     
    20471986  Bool     m_pocResetInfoPresentFlag;
    20481987#endif
    2049 #if MOVE_SCALED_OFFSET_TO_PPS
    20501988  UInt     m_numRefLayerLocationOffsets;
    20511989#if O0098_SCALED_REF_LAYER_ID
     
    20531991#endif
    20541992  Window   m_scaledRefLayerWindow[MAX_LAYERS];
    2055 #if REF_REGION_OFFSET
    20561993  Window   m_refLayerWindow[MAX_LAYERS];
    20571994  Bool     m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS];
    20581995  Bool     m_refRegionOffsetPresentFlag[MAX_LAYERS];
    2059 #endif
    2060 #if R0209_GENERIC_PHASE
    20611996  Int      m_phaseHorLuma[MAX_LAYERS];
    20621997  Int      m_phaseVerLuma[MAX_LAYERS];
     
    20641999  Int      m_phaseVerChroma[MAX_LAYERS];
    20652000  Bool     m_resamplePhaseSetPresentFlag[MAX_LAYERS];
    2066 #endif
    2067 #endif
    20682001#if Q0048_CGS_3D_ASYMLUT
    20692002  Int      m_nCGSFlag;
     
    22152148  Void setPocResetInfoPresentFlag   (const Bool val)      { m_pocResetInfoPresentFlag = val; }
    22162149#endif
    2217 #if MOVE_SCALED_OFFSET_TO_PPS
    22182150  UInt     getNumRefLayerLocationOffsets()       { return m_numRefLayerLocationOffsets; }
    22192151  Void     setNumRefLayerLocationOffsets(Int x)  { m_numRefLayerLocationOffsets = x;    }
     
    22242156#endif
    22252157  Window&  getScaledRefLayerWindow( Int x )   { return m_scaledRefLayerWindow[x]; }
    2226 #if REF_REGION_OFFSET
    22272158  Window&  getRefLayerWindowForLayer( Int layerId );
    22282159  Window&  getRefLayerWindow( Int x )   { return m_refLayerWindow[x]; }
     
    22312162  Bool getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; }
    22322163  Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; }
    2233 #endif
    2234 #if R0209_GENERIC_PHASE
    22352164  Int getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; }
    22362165  Int getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; }
     
    22432172  Bool getResamplePhaseSetPresentFlag(Int x) { return m_resamplePhaseSetPresentFlag[x]; }
    22442173  Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; }
    2245 #if RESAMPLING_FIX
    22462174  Bool hasZeroResamplingPhase(Int refLayerId);
    22472175  Void getResamplingPhase(Int refLayerId, Bool& phaseSetPresentFlag, Int& phaseHorLuma, Int& phaseVerLuma, Int& phaseHorChroma, Int& phaseVerChroma);
    2248 #endif
    2249 #endif
    2250 #endif
    22512176#if Q0048_CGS_3D_ASYMLUT
    22522177  Int     getCGSFlag()                { return m_nCGSFlag;  }
     
    24052330  Int         m_activeNumILRRefIdx;        //< Active inter-layer reference pictures
    24062331  Int         m_interLayerPredLayerIdc  [MAX_VPS_LAYER_IDX_PLUS1];
    2407 #if P0312_VERT_PHASE_ADJ
    2408   Bool        m_vertPhasePositionFlag[MAX_VPS_LAYER_IDX_PLUS1];
    2409 #endif
    24102332#if POC_RESET_FLAG
    24112333  Bool        m_bPocResetFlag;
     
    27232645  Bool      getInterLayerPredEnabledFlag     ()                { return m_interLayerPredEnabledFlag;}
    27242646
    2725 #if P0312_VERT_PHASE_ADJ
    2726   Int       getVertPhasePositionFlag (UInt layerIdx)              { return   m_vertPhasePositionFlag[layerIdx];}
    2727   Void      setVertPhasePositionFlag (Bool b, UInt layerIdx)      {  m_vertPhasePositionFlag[layerIdx] = b;  }
    2728 #endif
    2729 
    27302647  Void      setNumMotionPredRefLayers(int i)            { m_numMotionPredRefLayers = i; }
    27312648  Int       getNumMotionPredRefLayers()                 { return m_numMotionPredRefLayers; }
  • branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r1038 r1090  
    5151}
    5252
    53 #if O0215_PHASE_ALIGNMENT_REMOVAL
    5453Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic )
    55 #else
    56 #if O0215_PHASE_ALIGNMENT
    57 #if O0194_JOINT_US_BITSHIFT
    58 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag )
    59 #else
    60 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag )
    61 #endif
    62 #else
    63 #if O0194_JOINT_US_BITSHIFT
    64 #if REF_REGION_OFFSET
    65 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow )
    66 #else
    67 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window )
    68 #endif
    69 #else
    70 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window )
    71 #endif
    72 #endif
    73 #endif
    7454{
    7555  assert ( NTAPS_US_LUMA == 8 );
     
    8363#endif
    8464
    85 #if MOVE_SCALED_OFFSET_TO_PPS
    8665#if O0098_SCALED_REF_LAYER_ID
    8766  const Window &scalEL = currSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId);
     
    8968  const Window &scalEL = currSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc);
    9069#endif
    91 #if REF_REGION_OFFSET
    9270  const Window &windowRL = currSlice->getPPS()->getRefLayerWindowForLayer(refLayerId);
    93 #endif
    94 #else
    95 #if O0098_SCALED_REF_LAYER_ID
    96   const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId);
    97 #else
    98   const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
    99 #endif
    100 #endif
    10171
    10272  //========== Y component upsampling ===========
     
    10979  Int strideEL  = pcUsPic->getStride(COMPONENT_Y);
    11080
    111 #if Q0200_CONFORMANCE_BL_SIZE
    112   const Window &confBL = currSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();
    113 #endif
    114 #if Q0200_CONFORMANCE_BL_SIZE || REF_REGION_OFFSET
    11581  Int chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
    11682  Int xScal = TComSPS::getWinUnitX( chromaFormatIdc );
    11783  Int yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    118 #endif
    119 #if R0209_GENERIC_PHASE
    12084  Bool phaseSetPresentFlag;
    12185  Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma; 
     
    12791    phaseVerChroma = (4 * heightEL + (refRegionHeight >> 1)) / refRegionHeight - 4;
    12892  }
    129 #endif
    130 #if P0312_VERT_PHASE_ADJ
    131   Bool vertPhasePositionEnableFlag = scalEL.getVertPhasePositionEnableFlag();
    132   Bool vertPhasePositionFlag = currSlice->getVertPhasePositionFlag( refLayerIdc );
    133   if( vertPhasePositionFlag )
    134   {
    135     assert( vertPhasePositionEnableFlag );
    136   }
    137 #endif
    13893
    13994  Pel* piTempBufY = pcTempPic->getAddr(COMPONENT_Y);
     
    255210    Int   shiftY = 16;
    256211
    257 #if R0209_GENERIC_PHASE
    258212    Int phaseX = phaseHorLuma;
    259213    Int phaseY = phaseVerLuma;
    260214    Int addX = ( ( phaseX * scaleX + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
    261215    Int addY = ( ( phaseY * scaleY + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
    262 #if REF_REGION_OFFSET
    263216    Int refOffsetX = windowRL.getWindowLeftOffset() << 4;
    264217    Int refOffsetY = windowRL.getWindowTopOffset()  << 4;
    265 #else
    266 #if Q0200_CONFORMANCE_BL_SIZE
    267     Int refOffsetX = ( confBL.getWindowLeftOffset() * xScal ) << 4;
    268     Int refOffsetY = ( confBL.getWindowTopOffset()  * yScal ) << 4;
    269 #endif
    270 #endif
    271 #else
    272 #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
    273     Int   phaseX = 2*phaseAlignFlag;
    274 #if P0312_VERT_PHASE_ADJ
    275 #if Q0120_PHASE_CALCULATION
    276     Int   phaseY = 2*phaseAlignFlag;
    277 #else
    278     Int   phaseY = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( 2 * phaseAlignFlag );
    279 #endif
    280 #else
    281     Int   phaseY = 2*phaseAlignFlag;
    282 #endif
    283 #else
    284     Int   phaseX = 0;
    285 #if P0312_VERT_PHASE_ADJ
    286 #if Q0120_PHASE_CALCULATION
    287     Int   phaseY = 0;
    288 #else
    289     Int   phaseY = (vertPhasePositionEnableFlag?(vertPhasePositionFlag *4):(0));
    290 #endif
    291 #else
    292     Int   phaseY = 0;
    293 #endif
    294 #endif
    295  
    296     Int   addX = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
    297     Int   addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
    298 
    299 #if Q0120_PHASE_CALCULATION
    300     Int   deltaX = (Int)phaseAlignFlag <<3;
    301     Int   deltaY = (((Int)phaseAlignFlag <<3)>>(Int)vertPhasePositionEnableFlag) + ((Int)vertPhasePositionFlag<<3);
    302 #else
    303     Int   deltaX = 4 * phaseX;
    304     Int   deltaY = 4 * phaseY;
    305 #endif
    306 
    307 #if REF_REGION_OFFSET
    308     Int refOffsetX = windowRL.getWindowLeftOffset() << 4;
    309     Int refOffsetY = windowRL.getWindowTopOffset() << 4;
    310 #else
    311 #if Q0200_CONFORMANCE_BL_SIZE
    312     deltaX -= ( confBL.getWindowLeftOffset() * xScal ) << 4;
    313     deltaY -= ( confBL.getWindowTopOffset() * yScal ) << 4;
    314 #endif
    315 #endif
    316 #endif
    317218
    318219    Int shiftXM4 = shiftX - 4;
     
    325226    heightBL = min<Int>( pcBasePic->getHeight( COMPONENT_Y ), heightEL );
    326227
    327 #if R0220_REMOVE_EL_CLIP
    328228    Int phaseXL = scalEL.getWindowLeftOffset();
    329229    Int phaseYL = scalEL.getWindowTopOffset();
     
    332232    Int rlClipT = -(NTAPS_US_LUMA>>1);
    333233    Int rlClipB = heightBL - 1 + (NTAPS_US_LUMA>>1);
    334 #else
    335     Int leftStartL = scalEL.getWindowLeftOffset();
    336     Int rightEndL  = pcUsPic->getWidth() - scalEL.getWindowRightOffset();
    337     Int topStartL  = scalEL.getWindowTopOffset();
    338     Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset();
    339     Int leftOffset = leftStartL > 0 ? leftStartL : 0;
    340 #endif
     234
    341235#if O0194_JOINT_US_BITSHIFT
    342236    // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth
     
    355249    for( i = 0; i < widthEL; i++ )
    356250    {
    357 #if R0220_REMOVE_EL_CLIP
    358251      Int x = i;
    359 #if R0209_GENERIC_PHASE
    360252      refPos16 = (((x - phaseXL)*scaleX - addX) >> shiftXM4) + refOffsetX;
    361 #else
    362 #if REF_REGION_OFFSET
    363       refPos16 = (((x - phaseXL)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetX;
    364 #else
    365       refPos16 = (((x - phaseXL)*scaleX + addX) >> shiftXM4) - deltaX;
    366 #endif
    367 #endif
    368 #else
    369       Int x = Clip3( leftStartL, rightEndL - 1, i );
    370 #if REF_REGION_OFFSET
    371       refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetX;
    372 #else
    373       refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX;
    374 #endif
    375 #endif
    376253      phase    = refPos16 & 15;
    377254      refPos   = refPos16 >> 4;
    378 #if R0220_REMOVE_EL_CLIP
    379255      refPos   = Clip3( rlClipL, rlClipR, refPos );
    380 #endif
    381256      coeff = m_lumaFilter[phase];
    382257
     
    407282    for( j = 0; j < pcTempPic->getHeight(COMPONENT_Y); j++ )
    408283    {
    409 #if R0220_REMOVE_EL_CLIP
    410284      Int y = j;
    411 #if R0209_GENERIC_PHASE
    412285      refPos16 = ((( y - phaseYL )*scaleY - addY) >> shiftYM4) + refOffsetY;
    413 #else
    414 #if REF_REGION_OFFSET
    415       refPos16 = ((( y - phaseYL )*scaleY + addY) >> shiftYM4) - deltaY + refOffsetY;
    416 #else
    417       refPos16 = ((( y - pahseYL )*scaleY + addY) >> shiftYM4) - deltaY;
    418 #endif
    419 #endif
    420 #else
    421       Int y = Clip3(topStartL, bottomEndL - 1, j);
    422 #if REF_REGION_OFFSET
    423       refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY + refOffsetY;
    424 #else
    425       refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY;
    426 #endif
    427 #endif
    428286      phase    = refPos16 & 15;
    429287      refPos   = refPos16 >> 4;
    430 #if R0220_REMOVE_EL_CLIP
    431288      refPos = Clip3( rlClipT, rlClipB, refPos );
    432 #endif
    433289      coeff = m_lumaFilter[phase];
    434290
     
    436292      Pel* piDstY0 = piDstBufY + j * strideEL;
    437293
    438 #if R0220_REMOVE_EL_CLIP
    439294      piDstY = piDstY0;
    440295
     
    445300        piDstY++;
    446301      }
    447 #else
    448       piDstY = piDstY0 + leftOffset;
    449       piSrcY += leftOffset;
    450 
    451       for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- )
    452       {
    453         *piDstY = Clip( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift), CHANNEL_TYPE_LUMA );
    454         piSrcY++;
    455         piDstY++;
    456       }
    457 
    458       for( i = rightEndL; i < pcTempPic->getWidth(); i++ )
    459       {
    460         *piDstY = piDstY0[rightEndL-1];
    461         piDstY++;
    462       }
    463 
    464       piDstY = piDstY0;
    465       for( i = 0; i < leftStartL; i++ )
    466       {
    467         *piDstY = piDstY0[leftStartL];
    468         piDstY++;
    469       }
    470 #endif
    471302    }
    472303
     
    487318    strideEL  = pcUsPic->getStride( COMPONENT_Cb );
    488319
    489 #if R0220_REMOVE_EL_CLIP
    490320    Int srlLOffsetC = scalEL.getWindowLeftOffset() >> 1;
    491321    Int srlTOffsetC = scalEL.getWindowTopOffset() >> 1;
     
    494324    rlClipT = -(NTAPS_US_CHROMA>>1);
    495325    rlClipB = heightBL - 1 + (NTAPS_US_CHROMA>>1);
    496 #else
    497     Int leftStartC = scalEL.getWindowLeftOffset() >> 1;
    498     Int rightEndC  = (pcUsPic->getWidth() >> 1) - (scalEL.getWindowRightOffset() >> 1);
    499     Int topStartC  = scalEL.getWindowTopOffset() >> 1;
    500     Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1);
    501     leftOffset = leftStartC > 0 ? leftStartC : 0;
    502 #endif
    503326    shiftX = 16;
    504327    shiftY = 16;
    505328
    506 #if R0209_GENERIC_PHASE
    507329    addX = ( ( phaseHorChroma * scaleX + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
    508330    addY = ( ( phaseVerChroma * scaleY + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
    509331    Int refOffsetXC = (windowRL.getWindowLeftOffset() / xScal) << 4;
    510332    Int refOffsetYC = (windowRL.getWindowTopOffset()  / yScal) << 4;
    511 #else
    512 #if O0215_PHASE_ALIGNMENT
    513     Int phaseXC = phaseAlignFlag;
    514 #if P0312_VERT_PHASE_ADJ
    515 #if Q0120_PHASE_CALCULATION
    516     Int phaseYC = phaseAlignFlag + 1;
    517 #else
    518     Int phaseYC = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( phaseAlignFlag + 1 );
    519 #endif
    520 #else
    521     Int phaseYC = phaseAlignFlag + 1;
    522 #endif
    523 #else
    524     Int phaseXC = 0;
    525 #if P0312_VERT_PHASE_ADJ
    526 #if Q0120_PHASE_CALCULATION
    527     Int phaseYC = 1;
    528 #else
    529     Int phaseYC = vertPhasePositionEnableFlag ? (vertPhasePositionFlag * 4): 1;
    530 #endif
    531 #else
    532     Int phaseYC = 1;
    533 #endif
    534 #endif
    535    
    536     addX       = ( ( phaseXC * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
    537     addY       = ( ( phaseYC * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
    538 
    539 #if Q0120_PHASE_CALCULATION
    540     deltaX     = (Int)phaseAlignFlag << 2;
    541     deltaY     = ((( (Int)phaseAlignFlag +1)<<2)>>(Int)vertPhasePositionEnableFlag)+((Int)vertPhasePositionFlag<<3);
    542 #else
    543     deltaX     = 4 * phaseXC;
    544     deltaY     = 4 * phaseYC;
    545 #endif
    546 
    547 #if REF_REGION_OFFSET
    548     Int refOffsetXC = (windowRL.getWindowLeftOffset() / xScal) << 4;
    549     Int refOffsetYC  = (windowRL.getWindowTopOffset()  / yScal) << 4;
    550 #else
    551 #if Q0200_CONFORMANCE_BL_SIZE
    552     deltaX -= ( ( confBL.getWindowLeftOffset() * xScal ) >> 1 ) << 4;
    553     deltaY  -= ( ( confBL.getWindowTopOffset() * yScal ) >> 1 ) << 4;
    554 #endif
    555 #endif
    556 #endif
    557333
    558334    shiftXM4 = shiftX - 4;
     
    581357    for( i = 0; i < widthEL; i++ )
    582358    {
    583 #if R0220_REMOVE_EL_CLIP
    584359      Int x = i;
    585 #if R0209_GENERIC_PHASE
    586360      refPos16 = (((x - srlLOffsetC)*scaleX - addX) >> shiftXM4) + refOffsetXC;
    587 #else
    588 #if REF_REGION_OFFSET
    589       refPos16 = (((x - srlLOffsetC)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetXC;
    590 #else
    591       refPos16 = (((x - srlLOffsetC)*scaleX + addX) >> shiftXM4) - deltaX;
    592 #endif
    593 #endif
    594 #else
    595       Int x = Clip3(leftStartC, rightEndC - 1, i);
    596 #if REF_REGION_OFFSET
    597       refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetXC;
    598 #else
    599       refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX;
    600 #endif
    601 #endif
    602361      phase    = refPos16 & 15;
    603362      refPos   = refPos16 >> 4;
    604 #if R0220_REMOVE_EL_CLIP
    605363      refPos   = Clip3(rlClipL, rlClipR, refPos);
    606 #endif
    607364      coeff = m_chromaFilter[phase];
    608365
     
    639396    for( j = 0; j < pcTempPic->getHeight(COMPONENT_Y) >> 1; j++ )
    640397    {
    641 #if R0220_REMOVE_EL_CLIP
    642398      Int y = j;
    643 #if R0209_GENERIC_PHASE
    644399      refPos16 = (((y - srlTOffsetC)*scaleY - addY) >> shiftYM4) + refOffsetYC;
    645 #else
    646 #if REF_REGION_OFFSET
    647       refPos16 = (((y - srlTOffsetC)*scaleY + addY) >> shiftYM4) - deltaY + refOffsetYC;
    648 #else
    649       refPos16 = (((y - srlTOffsetC)*scaleY + addY) >> shiftYM4) - deltaY;
    650 #endif
    651 #endif
    652 #else
    653       Int y = Clip3(topStartC, bottomEndC - 1, j);
    654 #if REF_REGION_OFFSET
    655       refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY + refOffsetYC;
    656 #else
    657       refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY;
    658 #endif
    659 #endif
    660400      phase    = refPos16 & 15;
    661401      refPos   = refPos16 >> 4;
    662 #if R0220_REMOVE_EL_CLIP
    663402      refPos = Clip3(rlClipT, rlClipB, refPos);
    664 #endif
    665403      coeff = m_chromaFilter[phase];
    666404
     
    671409      Pel* piDstV0 = piDstBufV + j*strideEL;
    672410
    673 #if R0220_REMOVE_EL_CLIP
    674411      piDstU = piDstU0;
    675412      piDstV = piDstV0;
     
    684421        piDstV++;
    685422      }
    686 #else
    687       piDstU = piDstU0 + leftOffset;
    688       piDstV = piDstV0 + leftOffset;
    689       piSrcU += leftOffset;
    690       piSrcV += leftOffset;
    691 
    692       for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- )
    693       {
    694         *piDstU = Clip( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift), CHANNEL_TYPE_CHROMA );
    695         *piDstV = Clip( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift), CHANNEL_TYPE_CHROMA );
    696         piSrcU++;
    697         piSrcV++;
    698         piDstU++;
    699         piDstV++;
    700       }
    701 
    702       for( i = rightEndC; i < pcTempPic->getWidth(COMPONENT_Y) >> 1; i++ )
    703       {
    704         *piDstU = piDstU0[rightEndC-1];
    705         *piDstV = piDstV0[rightEndC-1];
    706         piDstU++;
    707         piDstV++;
    708       }
    709 
    710       piDstU = piDstU0;
    711       piDstV = piDstV0;
    712       for( i = 0; i < leftStartC; i++ )
    713       {
    714         *piDstU = piDstU0[leftStartC];
    715         *piDstV = piDstV0[leftStartC];
    716         piDstU++;
    717         piDstV++;
    718       }
    719 #endif
    720 
    721423    }
    722424  }
  • branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.h

    r944 r1090  
    4242  TComUpsampleFilter(void);
    4343  ~TComUpsampleFilter(void);
    44 #if O0215_PHASE_ALIGNMENT_REMOVAL
    4544  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );
    46 #else
    47 #if O0215_PHASE_ALIGNMENT
    48 #if O0194_JOINT_US_BITSHIFT
    49   Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag );
    50 #else
    51   Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );
    52 #endif
    53 #else
    54 #if O0194_JOINT_US_BITSHIFT
    55 #if REF_REGION_OFFSET
    56   Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow );
    57 #else
    58   Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
    59 #endif
    60 #else
    61   Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
    62 #endif
    63 #endif
    64 #endif
    6545
    6646};
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1085 r1090  
    4545#if SVC_EXTENSION
    4646#define MAX_LAYERS                       8      ///< max number of layers the codec is supposed to handle
    47 #define O0215_PHASE_ALIGNMENT_REMOVAL    1
    4847#define CONFORMANCE_BITSTREAM_MODE       1      ///< In order to generate the metadata related to conformance bitstreams
    4948#define FIX_CONF_MODE                    1
     
    217216#define VIEW_ID_RELATED_SIGNALING        1      ///< Introduce syntax elements view_id and view_id_val
    218217#define N0065_LAYER_POC_ALIGNMENT        1
    219 #if !O0215_PHASE_ALIGNMENT_REMOVAL
    220 #define O0215_PHASE_ALIGNMENT            1      ///< JCTVC_O0215: signal a flag to specify phase alignment case, 0: zero-position-aligned, 1: central-position-aligned,
    221 #endif
    222218#define AUXILIARY_PICTURES               1      ///< JCTVC-O0041: auxiliary picture layers
    223219#define R0062_AUX_PSEUDO_MONOCHROME      1      ///> JCVVC-R0063: pseudo monochrome for auxiliary pictures
     
    277273#define OLS_IDX_CHK                      1      ///< JCTVC-R0155: Proposal 2 valid range for output_layer_set_idx_to_vps[i]
    278274#define R0340_RESAMPLING_MODIFICATION    1      ///< JCTVC-R0340: set of changes regarding resampling (as listed below)
    279 #if R0340_RESAMPLING_MODIFICATION
    280 #define MOVE_SCALED_OFFSET_TO_PPS        1      ///< JCTVC-R0013: move scaled reference layer offset from SPS to PPS
    281 #if MOVE_SCALED_OFFSET_TO_PPS
    282 #define REF_REGION_OFFSET                1      ///< JCTVC-Q0159/R0220: reference region offset
    283 #define R0209_GENERIC_PHASE              1      ///< JCTVC-R0209: resampling with generic phase
    284 #define R0220_REMOVE_EL_CLIP             1      ///< JCTVC-R0220: remove clip to scaled ref window in resampling process
    285 #define RESAMPLING_FIX                   1      ///< Resampling fix -- equal offset check and conformance check
    286 #endif
    287 #else
    288 #define Q0200_CONFORMANCE_BL_SIZE        1      ///< JCTVC-Q0200; use conformance picture size in re-sampling processs
    289 #define P0312_VERT_PHASE_ADJ             1      ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report)
    290 #if P0312_VERT_PHASE_ADJ
    291 #define Q0120_PHASE_CALCULATION          1      ///< JCTVC-Q0120 phase offset derivation for combination of spatial scalibility and field coding.
    292 #endif
    293 #endif
    294275#define R0157_RESTRICT_PPSID_FOR_CGS_LUT 1      ///< JCTVC-R0157: when pps_pic_parameter_set_id greater than or equal to 8, colour_mapping_enabled_flag shall be equal to 0
    295276
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1086 r1090  
    411411#endif
    412412
    413 #if REF_REGION_OFFSET
    414413            READ_UVLC( uiCode,      "num_ref_loc_offsets" ); pcPPS->setNumRefLayerLocationOffsets(uiCode);
    415414            for(Int k = 0; k < pcPPS->getNumRefLayerLocationOffsets(); k++)
     
    424423                READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
    425424                READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
    426 #if P0312_VERT_PHASE_ADJ
    427                 READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode);  pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(i), uiCode);
    428 #endif
    429425              }
    430426              READ_FLAG( uiCode, "ref_region_offset_present_flag" );   pcPPS->setRefRegionOffsetPresentFlag( k, uiCode );
     
    437433                READ_SVLC( iCode, "ref_region_bottom_offset" );  refWindow.setWindowBottomOffset(iCode << 1);
    438434              }
    439 #if R0209_GENERIC_PHASE
    440435              READ_FLAG( uiCode, "resample_phase_set_present_flag" );   pcPPS->setResamplePhaseSetPresentFlag( k, uiCode );
    441436              if (uiCode)
     
    446441                READ_UVLC( uiCode, "phase_ver_chroma_plus8" );  pcPPS->setPhaseVerChroma (k, uiCode - 8);
    447442              }
    448 #endif
    449443            }
    450 #else
    451 #if MOVE_SCALED_OFFSET_TO_PPS
    452             READ_UVLC( uiCode,      "num_scaled_ref_layer_offsets" ); pcPPS->setNumScaledRefLayerOffsets(uiCode);
    453             for(Int k = 0; k < pcPPS->getNumScaledRefLayerOffsets(); k++)
    454             {
    455               Window& scaledWindow = pcPPS->getScaledRefLayerWindow(k);
    456 #if O0098_SCALED_REF_LAYER_ID
    457               READ_CODE( 6,  uiCode,  "scaled_ref_layer_id" );       pcPPS->setScaledRefLayerId( k, uiCode );
    458 #endif
    459               READ_SVLC( iCode, "scaled_ref_layer_left_offset" );    scaledWindow.setWindowLeftOffset  (iCode << 1);
    460               READ_SVLC( iCode, "scaled_ref_layer_top_offset" );     scaledWindow.setWindowTopOffset   (iCode << 1);
    461               READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
    462               READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
    463 #if P0312_VERT_PHASE_ADJ
    464               READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode);  pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(k), uiCode);
    465 #endif
    466             }
    467 #endif
    468 #endif
    469444#if Q0048_CGS_3D_ASYMLUT
    470445            READ_FLAG( uiCode , "colour_mapping_enabled_flag" );
     
    16981673#endif
    16991674    }
    1700 #if P0312_VERT_PHASE_ADJ
    1701     for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
    1702     {
    1703       UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
    1704 #if !MOVE_SCALED_OFFSET_TO_PPS
    1705       if( pcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) )
    1706 #else
    1707       if( pcSlice->getPPS()->getVertPhasePositionEnableFlag(refLayerIdc) )
    1708 #endif
    1709       {
    1710         READ_FLAG( uiCode, "vert_phase_position_flag" ); pcSlice->setVertPhasePositionFlag( uiCode? true : false, refLayerIdc );
    1711       }
    1712     }
    1713 #endif
    17141675#endif //SVC_EXTENSION
    17151676
     
    35393500  }
    35403501#endif
    3541 #if O0215_PHASE_ALIGNMENT
    3542   READ_FLAG( uiCode, "cross_layer_phase_alignment_flag"); vps->setPhaseAlignFlag( uiCode == 1 ? true : false );
    3543 #endif
    35443502
    35453503#if !IRAP_ALIGN_FLAG_IN_VPS_VUI
     
    42754233  }
    42764234#endif
    4277 #endif
    4278 #if P0312_VERT_PHASE_ADJ
    4279   READ_FLAG( uiCode, "vps_vui_vert_phase_in_use_flag" ); vps->setVpsVuiVertPhaseInUseFlag(uiCode);
    42804235#endif
    42814236#if N0160_VUI_EXT_ILP_REF
     
    44654420  // Vertical MV component restriction is not used in SHVC CTC
    44664421  assert( uiCode == 0 );
    4467 
    4468 #if !MOVE_SCALED_OFFSET_TO_PPS
    4469   if( pcSPS->getLayerId() > 0 )
    4470   {
    4471     Int iCode;
    4472     READ_UVLC( uiCode,      "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets(uiCode);
    4473     for(Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets(); i++)
    4474     {
    4475       Window& scaledWindow = pcSPS->getScaledRefLayerWindow(i);
    4476 #if O0098_SCALED_REF_LAYER_ID
    4477       READ_CODE( 6,  uiCode,  "scaled_ref_layer_id" );       pcSPS->setScaledRefLayerId( i, uiCode );
    4478 #endif
    4479       READ_SVLC( iCode, "scaled_ref_layer_left_offset" );    scaledWindow.setWindowLeftOffset  (iCode << 1);
    4480       READ_SVLC( iCode, "scaled_ref_layer_top_offset" );     scaledWindow.setWindowTopOffset   (iCode << 1);
    4481       READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
    4482       READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
    4483 #if P0312_VERT_PHASE_ADJ
    4484       READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode);  pcSPS->setVertPhasePositionEnableFlag( pcSPS->getScaledRefLayerId(i), uiCode);   
    4485 #endif
    4486     }
    4487   }
    4488 #endif
    44894422}
    44904423#endif
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1086 r1090  
    615615#endif
    616616
    617 #if P0312_VERT_PHASE_ADJ
    618 #if MOVE_SCALED_OFFSET_TO_PPS
    619   if( activeVPS->getVpsVuiVertPhaseInUseFlag() == 0 )
    620   {   
    621     for(Int i = 0; i < activePPS->getNumScaledRefLayerOffsets(); i++)
    622     {
    623       UInt scaledRefLayerId = activePPS->getScaledRefLayerId(i);
    624       if( activePPS->getVertPhasePositionEnableFlag( scaledRefLayerId ) )
    625       {
    626         printf("\nWarning: LayerId = %d: vert_phase_position_enable_flag[%d] = 1, however indication vert_phase_position_in_use_flag = 0\n", m_layerId, scaledRefLayerId );
    627         break;
    628       }
    629     }
    630   }
    631 #else
    632   if( activeVPS->getVpsVuiVertPhaseInUseFlag() == 0 )
    633   {   
    634     for(Int i = 0; i < activeSPS->getNumScaledRefLayerOffsets(); i++)
    635     {
    636       UInt scaledRefLayerId = activeSPS->getScaledRefLayerId(i);
    637       if( activeSPS->getVertPhasePositionEnableFlag( scaledRefLayerId ) )
    638       {
    639         printf("\nWarning: LayerId = %d: vert_phase_position_enable_flag[%d] = 1, however indication vert_phase_position_in_use_flag = 0\n", m_layerId, scaledRefLayerId );
    640         break;
    641       }
    642     }
    643   }
    644 #endif
    645 #endif
    646 
    647617#if SPS_DPB_PARAMS
    648618  if( m_layerId > 0 )
     
    19121882#endif
    19131883
    1914 #if MOVE_SCALED_OFFSET_TO_PPS
    19151884#if O0098_SCALED_REF_LAYER_ID
    19161885        const Window &scalEL = pcSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId);
     
    19181887        const Window &scalEL = pcSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc);
    19191888#endif
    1920 #else
    1921 #if O0098_SCALED_REF_LAYER_ID
    1922         const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId);
    1923 #else
    1924         const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
    1925 #endif
    1926 #endif
    1927 
    1928 #if REF_REGION_OFFSET
     1889
    19291890        const Window &windowRL = pcSlice->getPPS()->getRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
    19301891        Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y) - windowRL.getWindowLeftOffset() - windowRL.getWindowRightOffset();
    19311892        Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y) - windowRL.getWindowTopOffset() - windowRL.getWindowBottomOffset();
    1932 #else
    1933         Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y);
    1934         Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y);
    1935 #if Q0200_CONFORMANCE_BL_SIZE
    1936         Int chromaFormatIdc = pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
    1937         const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();
    1938         widthBL  -= ( confBL.getWindowLeftOffset() + confBL.getWindowRightOffset() ) * TComSPS::getWinUnitX( chromaFormatIdc );
    1939         heightBL -= ( confBL.getWindowTopOffset() + confBL.getWindowBottomOffset() ) * TComSPS::getWinUnitY( chromaFormatIdc );
    1940 #endif
    1941 #endif
    19421893        Int widthEL   = m_pcPic->getPicYuvRec()->getWidth(COMPONENT_Y)  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
    19431894        Int heightEL  = m_pcPic->getPicYuvRec()->getHeight(COMPONENT_Y) - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
    19441895
    1945 #if RESAMPLING_FIX
    1946 #if REF_REGION_OFFSET
    19471896        // conformance check: the values of RefLayerRegionWidthInSamplesY, RefLayerRegionHeightInSamplesY, ScaledRefRegionWidthInSamplesY and ScaledRefRegionHeightInSamplesY shall be greater than 0
    19481897        assert(widthEL > 0 && heightEL > 0 && widthBL > 0 && widthEL > 0);
     
    19511900        assert(widthEL >= widthBL && heightEL >= heightBL);
    19521901
    1953 #if R0209_GENERIC_PHASE
    19541902        // conformance check: when ScaledRefRegionWidthInSamplesY is equal to RefLayerRegionWidthInSamplesY, PhaseHorY shall be equal to 0, when ScaledRefRegionWidthInSamplesC is equal to RefLayerRegionWidthInSamplesC, PhaseHorC shall be equal to 0, when ScaledRefRegionHeightInSamplesY is equal to RefLayerRegionHeightInSamplesY, PhaseVerY shall be equal to 0, and when ScaledRefRegionHeightInSamplesC is equal to RefLayerRegionHeightInSamplesC, PhaseVerC shall be equal to 0.
    19551903        Bool phaseSetPresentFlag;
     
    19591907        assert( ( (widthEL  != widthBL)  || (phaseHorLuma == 0 && phaseHorChroma == 0) )
    19601908             && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) );
    1961 #endif
    1962 #endif
    1963 #endif
    19641909
    19651910        g_mvScalingFactor[refLayerIdc][0] = widthEL  == widthBL  ? 4096 : Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
     
    19911936        }
    19921937#endif
    1993 #if SVC_EXTENSION
    19941938        if( m_pcPic->isSpatialEnhLayer(refLayerIdc) )
    19951939        {
     
    19971941          if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) )
    19981942          {
    1999 #if O0215_PHASE_ALIGNMENT_REMOVAL
    20001943            m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec());
    2001 #else
    2002 #if O0215_PHASE_ALIGNMENT
    2003 #if O0194_JOINT_US_BITSHIFT
    2004 #if Q0048_CGS_3D_ASYMLUT
    2005             m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );
    2006 #else
    2007             m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );
    2008 #endif
    2009 #else
    2010 #if Q0048_CGS_3D_ASYMLUT
    2011 #if MOVE_SCALED_OFFSET_TO_PPS
    2012           m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
    2013 #else
    2014           m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
    2015 #endif
    2016 #else
    2017           m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );
    2018 #endif
    2019 #endif
    2020 #else
    2021 #if O0194_JOINT_US_BITSHIFT
    2022 #if Q0048_CGS_3D_ASYMLUT
    2023 #if REF_REGION_OFFSET
    2024           m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), scalEL, altRL );
    2025 #else
    2026           m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), scalEL );
    2027 #endif
    2028 #else
    2029           m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), scalEL );
    2030 #endif
    2031 #else
    2032 #if Q0048_CGS_3D_ASYMLUT
    2033             m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), scalEL );
    2034 #else
    2035             m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), scalEL );
    2036 #endif
    2037 #endif
    2038 #endif
    2039 #endif
    20401944          }
    20411945        }
     
    20451949        }
    20461950        pcSlice->setFullPelBaseRec ( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc) );
    2047 #endif //SVC_EXTENSION
    20481951      }
    20491952    }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp

    r1029 r1090  
    690690  TComSlice * pSlice = pCurPic->getSlice(pCurPic->getCurrSliceIdx());
    691691  UInt refLayerId = pSlice->getVPS()->getRefLayerId(pSlice->getLayerId(), refLayerIdc);
    692 #if MOVE_SCALED_OFFSET_TO_PPS
    693692  const Window &scalEL = pSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId);
    694 #else
    695   const Window &scalEL = pSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId);
    696 #endif
    697693  TComPicYuv *pcRecPicBL = pSlice->getBaseColPic(refLayerIdc)->getPicYuvRec();
    698694  // borders of down-sampled picture
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1085 r1090  
    316316#endif
    317317
    318 #if REF_REGION_OFFSET
    319318            WRITE_UVLC( pcPPS->getNumRefLayerLocationOffsets(),      "num_ref_loc_offsets" );
    320319            for(Int k = 0; k < pcPPS->getNumRefLayerLocationOffsets(); k++)
     
    339338                WRITE_SVLC( refWindow.getWindowBottomOffset() >> 1, "ref_region_bottom_offset" );
    340339              }
    341 #if R0209_GENERIC_PHASE
    342340              WRITE_FLAG( pcPPS->getResamplePhaseSetPresentFlag(k) ? 1 : 0, "resample_phase_set_present_flag" );
    343341              if (pcPPS->getResamplePhaseSetPresentFlag(k))
     
    348346                WRITE_UVLC( pcPPS->getPhaseVerChroma(k) + 8, "phase_ver_chroma_plus8" );
    349347              }
    350 #endif
    351348            }
    352 #else
    353 #if MOVE_SCALED_OFFSET_TO_PPS
    354             WRITE_UVLC( pcPPS->getNumScaledRefLayerOffsets(),      "num_scaled_ref_layer_offsets" );
    355             for(Int k = 0; k < pcPPS->getNumScaledRefLayerOffsets(); k++)
    356             {
    357               Window scaledWindow = pcPPS->getScaledRefLayerWindow(k);
    358 #if O0098_SCALED_REF_LAYER_ID
    359               WRITE_CODE( pcPPS->getScaledRefLayerId(k), 6,          "scaled_ref_layer_id" );
    360 #endif
    361               WRITE_SVLC( scaledWindow.getWindowLeftOffset()   >> 1, "scaled_ref_layer_left_offset" );
    362               WRITE_SVLC( scaledWindow.getWindowTopOffset()    >> 1, "scaled_ref_layer_top_offset" );
    363               WRITE_SVLC( scaledWindow.getWindowRightOffset()  >> 1, "scaled_ref_layer_right_offset" );
    364               WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" );
    365             }
    366 #endif
    367 #endif
    368349#if Q0048_CGS_3D_ASYMLUT
    369350            bits = getNumberOfWrittenBits();
     
    12681249      }
    12691250    }     
    1270 #if P0312_VERT_PHASE_ADJ
    1271     for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
    1272     {
    1273       UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
    1274       if( pcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) )
    1275       {
    1276         WRITE_FLAG( pcSlice->getVertPhasePositionFlag(refLayerIdc), "vert_phase_position_flag" );
    1277       }
    1278     }
    1279 #endif
    12801251#endif //SVC_EXTENSION
    12811252
     
    25492520  }
    25502521#endif
    2551 #if O0215_PHASE_ALIGNMENT
    2552   WRITE_FLAG(vps->getPhaseAlignFlag(), "cross_layer_phase_alignment_flag" );
    2553 #endif
    25542522#if !IRAP_ALIGN_FLAG_IN_VPS_VUI
    25552523  WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag");
     
    29932961  WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" );
    29942962#endif
    2995 #endif
    2996 #if P0312_VERT_PHASE_ADJ
    2997   WRITE_FLAG( vps->getVpsVuiVertPhaseInUseFlag(), "vps_vui_vert_phase_in_use_flag" );
    29982963#endif
    29992964#if N0160_VUI_EXT_ILP_REF
     
    31223087  // Vertical MV component restriction is not used in SHVC CTC
    31233088  WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" );
    3124 
    3125 #if !MOVE_SCALED_OFFSET_TO_PPS
    3126   if( pcSPS->getLayerId() > 0 )
    3127   {
    3128     WRITE_UVLC( pcSPS->getNumScaledRefLayerOffsets(),      "num_scaled_ref_layer_offsets" );
    3129     for(Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets(); i++)
    3130     {
    3131       Window scaledWindow = pcSPS->getScaledRefLayerWindow(i);
    3132 #if O0098_SCALED_REF_LAYER_ID
    3133       WRITE_CODE( pcSPS->getScaledRefLayerId(i), 6,          "scaled_ref_layer_id" );
    3134 #endif
    3135       WRITE_SVLC( scaledWindow.getWindowLeftOffset()   >> 1, "scaled_ref_layer_left_offset" );
    3136       WRITE_SVLC( scaledWindow.getWindowTopOffset()    >> 1, "scaled_ref_layer_top_offset" );
    3137       WRITE_SVLC( scaledWindow.getWindowRightOffset()  >> 1, "scaled_ref_layer_right_offset" );
    3138       WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" );
    3139 #if P0312_VERT_PHASE_ADJ
    3140       WRITE_FLAG( scaledWindow.getVertPhasePositionEnableFlag(), "vert_phase_position_enable_flag" );
    3141 #endif
    3142     }
    3143   }
    3144 #endif
    31453089}
    31463090#endif //SVC_EXTENSION
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1089 r1090  
    489489
    490490  Window   &getConformanceWindow()                           { return m_conformanceWindow; }
    491 #if P0312_VERT_PHASE_ADJ && !R0209_GENERIC_PHASE
    492   Void      setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom, false); }
    493 #else
    494491  Void      setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom); }
    495 #endif
    496492
    497493  Void      setFramesToBeEncoded            ( Int   i )      { m_framesToBeEncoded = i; }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1089 r1090  
    14771477#endif
    14781478
    1479 #if REF_REGION_OFFSET
    14801479        const Window &windowRL  = m_pcEncTop->getRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
    14811480        Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y) - windowRL.getWindowLeftOffset() - windowRL.getWindowRightOffset();
    14821481        Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y) - windowRL.getWindowTopOffset() - windowRL.getWindowBottomOffset();
    1483 #else
    1484         Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y);
    1485         Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y);
    1486 #if Q0200_CONFORMANCE_BL_SIZE
    1487         Int chromaFormatIdc = pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
    1488         const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();
    1489         widthBL  -= ( confBL.getWindowLeftOffset() + confBL.getWindowRightOffset() ) * TComSPS::getWinUnitX( chromaFormatIdc );
    1490         heightBL -= ( confBL.getWindowTopOffset() + confBL.getWindowBottomOffset() ) * TComSPS::getWinUnitY( chromaFormatIdc );
    1491 #endif
    1492 #endif
    14931482        Int widthEL   = pcPic->getPicYuvRec()->getWidth(COMPONENT_Y)  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
    14941483        Int heightEL  = pcPic->getPicYuvRec()->getHeight(COMPONENT_Y) - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
    14951484
    1496 #if RESAMPLING_FIX
    1497 #if REF_REGION_OFFSET
    14981485        // conformance check: the values of RefLayerRegionWidthInSamplesY, RefLayerRegionHeightInSamplesY, ScaledRefRegionWidthInSamplesY and ScaledRefRegionHeightInSamplesY shall be greater than 0
    14991486        assert(widthEL > 0 && heightEL > 0 && widthBL > 0 && widthEL > 0);
     
    15021489        assert(widthEL >= widthBL && heightEL >= heightBL);
    15031490
    1504 #if R0209_GENERIC_PHASE
    15051491        // conformance check: when ScaledRefRegionWidthInSamplesY is equal to RefLayerRegionWidthInSamplesY, PhaseHorY shall be equal to 0, when ScaledRefRegionWidthInSamplesC is equal to RefLayerRegionWidthInSamplesC, PhaseHorC shall be equal to 0, when ScaledRefRegionHeightInSamplesY is equal to RefLayerRegionHeightInSamplesY, PhaseVerY shall be equal to 0, and when ScaledRefRegionHeightInSamplesC is equal to RefLayerRegionHeightInSamplesC, PhaseVerC shall be equal to 0.
    15061492        Bool phaseSetPresentFlag;
     
    15101496        assert( ( (widthEL  != widthBL)  || (phaseHorLuma == 0 && phaseHorChroma == 0) )
    15111497             && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) );
    1512 #endif
    1513 #endif
    1514 #endif
    15151498
    15161499        g_mvScalingFactor[refLayerIdc][0] = widthEL  == widthBL  ? 4096 : Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
     
    15561539          if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) )
    15571540          {
    1558 #if P0312_VERT_PHASE_ADJ
    1559             //when PhasePositionEnableFlag is equal to 1, set vertPhasePositionFlag to 0 if BL is top field and 1 if bottom
    1560             if( scalEL.getVertPhasePositionEnableFlag() )
    1561             {
    1562               pcSlice->setVertPhasePositionFlag( pcSlice->getPOC()%2, refLayerIdc );
    1563             }
    1564 #endif
    1565 #if O0215_PHASE_ALIGNMENT_REMOVAL
    15661541            m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec() );
    1567 #else
    1568 #if O0215_PHASE_ALIGNMENT
    1569 #if O0194_JOINT_US_BITSHIFT
    1570 #if Q0048_CGS_3D_ASYMLUT
    1571             m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );
    1572 #else
    1573             m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );
    1574 #endif
    1575 #else
    1576 #if Q0048_CGS_3D_ASYMLUT
    1577             m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );
    1578 #else
    1579             m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );
    1580 #endif
    1581 #endif
    1582 #else
    1583 #if O0194_JOINT_US_BITSHIFT
    1584 #if Q0048_CGS_3D_ASYMLUT
    1585 #if REF_REGION_OFFSET
    1586           m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, altRL );
    1587 #else
    1588           m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL );
    1589 #endif
    1590 #else
    1591           m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );
    1592 #endif
    1593 #else
    1594 #if Q0048_CGS_3D_ASYMLUT
    1595             m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL );
    1596 #else
    1597             m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );
    1598 #endif
    1599 #endif
    1600 #endif
    1601 #endif
    16021542          }
    16031543        }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1068 r1090  
    619619        for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ )
    620620        {
    621 #if MOVE_SCALED_OFFSET_TO_PPS
    622621#if O0098_SCALED_REF_LAYER_ID
    623622          const Window scalEL = getPPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
     
    625624          const Window scalEL = getPPS()->getScaledRefLayerWindow(i);
    626625#endif
    627 #else
    628 #if O0098_SCALED_REF_LAYER_ID
    629           const Window scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
    630 #else
    631           const Window scalEL = getSPS()->getScaledRefLayerWindow(i);
    632 #endif
    633 #endif
    634 #if REF_REGION_OFFSET
    635626          const Window altRL  = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
    636 #if RESAMPLING_FIX
    637627          Bool equalOffsets = scalEL.hasEqualOffset(altRL);
    638 #if R0209_GENERIC_PHASE
    639628          Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i));
    640 #endif
    641 #else
    642           Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0
    643                                && altRL.getWindowLeftOffset() == 0 && altRL.getWindowRightOffset() == 0 && altRL.getWindowTopOffset() == 0 && altRL.getWindowBottomOffset() == 0);
    644 #endif
    645 #else
    646           Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
    647 #endif
    648629
    649630#if VPS_EXTN_DIRECT_REF_LAYERS
     
    665646#else
    666647          if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !sameBitDepths
    667 #if REF_REGION_OFFSET && RESAMPLING_FIX
    668648            || !equalOffsets
    669 #if R0209_GENERIC_PHASE
    670649            || !zeroPhase
    671 #endif
    672 #else
    673             || !zeroOffsets
    674 #endif
    675650#endif
    676651#if Q0048_CGS_3D_ASYMLUT
     
    683658#else
    684659          if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight()
    685 #if REF_REGION_OFFSET && RESAMPLING_FIX
    686660            || !equalOffsets
    687 #if R0209_GENERIC_PHASE
    688661            || !zeroPhase
    689 #endif
    690 #else
    691             || !zeroOffsets
    692 #endif
    693662          )
    694663#endif
     
    720689        for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ )
    721690        {
    722 #if MOVE_SCALED_OFFSET_TO_PPS
    723691#if O0098_SCALED_REF_LAYER_ID
    724692          const Window scalEL = getPPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
     
    726694          const Window scalEL = getPPS()->getScaledRefLayerWindow(i);
    727695#endif
    728 #else
    729 #if O0098_SCALED_REF_LAYER_ID
    730           const Window scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
    731 #else
    732           const Window scalEL = getSPS()->getScaledRefLayerWindow(i);
    733 #endif
    734 #endif
    735 #if REF_REGION_OFFSET
    736696          const Window altRL  = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
    737 #if RESAMPLING_FIX
    738697          Bool equalOffsets = scalEL.hasEqualOffset(altRL);
    739 #if R0209_GENERIC_PHASE
    740698          Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i));
    741 #endif
    742 #else
    743           Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0
    744                                && altRL.getWindowLeftOffset() == 0 && altRL.getWindowRightOffset() == 0 && altRL.getWindowTopOffset() == 0 && altRL.getWindowBottomOffset() == 0);
    745 #endif
    746 #else
    747           Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
    748 #endif
    749699
    750700#if VPS_EXTN_DIRECT_REF_LAYERS
     
    758708
    759709          if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !sameBitDepths
    760 #if REF_REGION_OFFSET && RESAMPLING_FIX
    761710            || !equalOffsets
    762 #if R0209_GENERIC_PHASE
    763711            || !zeroPhase
    764 #endif
    765 #else
    766             || !zeroOffsets
    767 #endif
    768712#if Q0048_CGS_3D_ASYMLUT
    769713            || m_cPPS.getCGSFlag() > 0
     
    775719#else
    776720          if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight()
    777 #if REF_REGION_OFFSET && RESAMPLING_FIX
    778721            || !equalOffsets
    779 #if R0209_GENERIC_PHASE
    780722            || !zeroPhase
    781 #endif
    782 #else
    783             || !zeroOffsets
    784 #endif
    785723          )
    786724#endif
     
    832770#else
    833771  m_cSPS.setLayerId(m_layerId);
    834 #endif
    835 #if !MOVE_SCALED_OFFSET_TO_PPS
    836   m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets);
    837   for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++)
    838   {
    839 #if O0098_SCALED_REF_LAYER_ID
    840     m_cSPS.setScaledRefLayerId(i, m_scaledRefLayerId[i]);
    841 #endif
    842     m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];
    843 #if P0312_VERT_PHASE_ADJ
    844     m_cSPS.setVertPhasePositionEnableFlag( m_scaledRefLayerId[i], m_scaledRefLayerWindow[i].getVertPhasePositionEnableFlag() );
    845 #endif
    846   }
    847772#endif
    848773#endif //SVC_EXTENSION
     
    11491074  }
    11501075#endif
    1151 #if MOVE_SCALED_OFFSET_TO_PPS
    11521076  m_cPPS.setNumRefLayerLocationOffsets(m_numRefLayerLocationOffsets);
    11531077  for(Int i = 0; i < m_cPPS.getNumRefLayerLocationOffsets(); i++)
     
    11571081#endif
    11581082    m_cPPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];
    1159 #if REF_REGION_OFFSET
    11601083    m_cPPS.getRefLayerWindow(i) = m_refLayerWindow[i];
    11611084    m_cPPS.setScaledRefLayerOffsetPresentFlag( i, m_scaledRefLayerOffsetPresentFlag[i] );
    11621085    m_cPPS.setRefRegionOffsetPresentFlag( i, m_refRegionOffsetPresentFlag[i] );
    1163 #endif
    1164 #if R0209_GENERIC_PHASE
    11651086    m_cPPS.setResamplePhaseSetPresentFlag( i, m_resamplePhaseSetPresentFlag[i] );
    11661087    m_cPPS.setPhaseHorLuma( m_refLocationOffsetLayerId[i], m_phaseHorLuma[i] );
     
    11681089    m_cPPS.setPhaseHorChroma( m_refLocationOffsetLayerId[i], m_phaseHorChroma[i] );
    11691090    m_cPPS.setPhaseVerChroma( m_refLocationOffsetLayerId[i], m_phaseVerChroma[i] );
    1170 #endif
    1171 #if P0312_VERT_PHASE_ADJ
    1172     m_cPPS.setVertPhasePositionEnableFlag( m_scaledRefLayerId[i], m_scaledRefLayerWindow[i].getVertPhasePositionEnableFlag() );
    1173 #endif
    1174   }
    1175 #endif
     1091  }
    11761092#if Q0048_CGS_3D_ASYMLUT
    11771093  m_cPPS.setCGSFlag( m_nCGSFlag );
     
    16881604  return win;
    16891605}
    1690 #if REF_REGION_OFFSET
     1606
    16911607Window& TEncTop::getRefLayerWindowForLayer(Int layerId)
    16921608{
     
    17051621}
    17061622#endif
    1707 #endif
    17081623#endif //SVC_EXTENSION
    17091624//! \}
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h

    r1057 r1090  
    127127#endif
    128128  Window                  m_scaledRefLayerWindow[MAX_LAYERS];
    129 #if REF_REGION_OFFSET
    130129  UInt                    m_numRefLayerOffsets;
    131130  UInt                    m_refLayerId[MAX_LAYERS];
     
    133132  Bool                    m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS];
    134133  Bool                    m_refRegionOffsetPresentFlag[MAX_LAYERS];
    135 #endif
    136 #if R0209_GENERIC_PHASE
    137134  Int                     m_phaseHorLuma  [MAX_LAYERS];
    138135  Int                     m_phaseVerLuma  [MAX_LAYERS];
     
    140137  Int                     m_phaseVerChroma[MAX_LAYERS];
    141138  Int                     m_resamplePhaseSetPresentFlag[MAX_LAYERS];
    142 #endif
    143 #if P0312_VERT_PHASE_ADJ
    144   Bool                    m_vertPhasePositionEnableFlag[MAX_LAYERS];
    145 #endif
    146139#if POC_RESET_FLAG || POC_RESET_IDC_ENCODER
    147140  Int                     m_pocAdjustmentValue;
     
    232225#endif
    233226  Window&   getScaledRefLayerWindow(Int x)                 { return m_scaledRefLayerWindow[x];        }
    234 #if REF_REGION_OFFSET
    235227  Void      setNumRefLayerOffsets(Int x) { m_numRefLayerOffsets = x; }
    236228  UInt      getNumRefLayerOffsets() { return m_numRefLayerOffsets; }
     
    243235  Bool      getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; }
    244236  Void      setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; }
    245 #endif
    246 #if P0312_VERT_PHASE_ADJ
    247   Void      setVertPhasePositionEnableFlag(Int x, Bool b)  { m_vertPhasePositionEnableFlag[x] = b;    }
    248   UInt      getVertPhasePositionEnableFlag(Int x)          { return m_vertPhasePositionEnableFlag[x]; }
    249 #endif
    250 #if R0209_GENERIC_PHASE
    251237  Int       getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; }
    252238  Int       getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; }
     
    259245  Bool      getResamplePhaseSetPresentFlag(Int x) { return m_resamplePhaseSetPresentFlag[x]; }
    260246  Void      setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; }
    261 #endif
    262247
    263248  TComPic** getIlpList() { return m_cIlpPic; }
Note: See TracChangeset for help on using the changeset viewer.