Changeset 1090 in SHVCSoftware for branches/SHM-dev/source
- Timestamp:
- 1 Jul 2015, 00:53:31 (9 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1089 r1090 793 793 string cfg_scaledRefLayerBottomOffset [MAX_LAYERS]; 794 794 Int* cfg_numRefLayerLocationOffsets[MAX_LAYERS]; 795 #if REF_REGION_OFFSET796 795 string cfg_scaledRefLayerOffsetPresentFlag [MAX_LAYERS]; 797 796 string cfg_refRegionOffsetPresentFlag [MAX_LAYERS]; … … 800 799 string cfg_refRegionRightOffset [MAX_LAYERS]; 801 800 string cfg_refRegionBottomOffset [MAX_LAYERS]; 802 #endif803 #if R0209_GENERIC_PHASE804 801 string cfg_resamplePhaseSetPresentFlag [MAX_LAYERS]; 805 802 string cfg_phaseHorLuma [MAX_LAYERS]; … … 807 804 string cfg_phaseHorChroma [MAX_LAYERS]; 808 805 string cfg_phaseVerChroma [MAX_LAYERS]; 809 #else810 #if P0312_VERT_PHASE_ADJ811 string cfg_vertPhasePositionEnableFlag[MAX_LAYERS];812 #endif813 #endif814 806 815 807 #if O0098_SCALED_REF_LAYER_ID … … 820 812 string* cfg_scaledRefLayerRightOffsetPtr [MAX_LAYERS]; 821 813 string* cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS]; 822 #if REF_REGION_OFFSET823 814 string* cfg_scaledRefLayerOffsetPresentFlagPtr [MAX_LAYERS]; 824 815 string* cfg_refRegionOffsetPresentFlagPtr [MAX_LAYERS]; … … 827 818 string* cfg_refRegionRightOffsetPtr [MAX_LAYERS]; 828 819 string* cfg_refRegionBottomOffsetPtr [MAX_LAYERS]; 829 #endif830 #if R0209_GENERIC_PHASE831 820 string* cfg_resamplePhaseSetPresentFlagPtr [MAX_LAYERS]; 832 821 string* cfg_phaseHorLumaPtr [MAX_LAYERS]; … … 834 823 string* cfg_phaseHorChromaPtr [MAX_LAYERS]; 835 824 string* cfg_phaseVerChromaPtr [MAX_LAYERS]; 836 #endif837 #if P0312_VERT_PHASE_ADJ838 string* cfg_vertPhasePositionEnableFlagPtr[MAX_LAYERS];839 #endif840 825 841 826 #if RC_SHVC_HARMONIZATION … … 927 912 cfg_scaledRefLayerRightOffsetPtr [layer] = &cfg_scaledRefLayerRightOffset[layer]; 928 913 cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer]; 929 #if P0312_VERT_PHASE_ADJ930 cfg_vertPhasePositionEnableFlagPtr[layer] = &cfg_vertPhasePositionEnableFlag[layer];931 #endif932 #if REF_REGION_OFFSET933 914 cfg_scaledRefLayerOffsetPresentFlagPtr [layer] = &cfg_scaledRefLayerOffsetPresentFlag [layer]; 934 915 cfg_refRegionOffsetPresentFlagPtr [layer] = &cfg_refRegionOffsetPresentFlag [layer]; … … 937 918 cfg_refRegionRightOffsetPtr [layer] = &cfg_refRegionRightOffset [layer]; 938 919 cfg_refRegionBottomOffsetPtr[layer] = &cfg_refRegionBottomOffset[layer]; 939 #endif940 #if R0209_GENERIC_PHASE941 920 cfg_resamplePhaseSetPresentFlagPtr [layer] = &cfg_resamplePhaseSetPresentFlag [layer]; 942 921 cfg_phaseHorLumaPtr [layer] = &cfg_phaseHorLuma [layer]; … … 944 923 cfg_phaseHorChromaPtr [layer] = &cfg_phaseHorChroma [layer]; 945 924 cfg_phaseVerChromaPtr [layer] = &cfg_phaseVerChroma [layer]; 946 #endif947 925 } 948 926 #if RC_SHVC_HARMONIZATION … … 1088 1066 ("FrameRate%d,-fr%d", cfg_FrameRate, 0, MAX_LAYERS, "Frame rate for layer %d") 1089 1067 ("LambdaModifier%d,-LM%d", m_adLambdaModifier, Double(1.0), MAX_TLAYER, "Lambda modifier for temporal layer %d") 1090 #if O0215_PHASE_ALIGNMENT1091 ("PhaseAlignment", m_phaseAlignFlag, false, "indicate the sample location alignment between layers (0: zero position aligned, 1: central position aligned)")1092 #endif1093 1068 #if REPN_FORMAT_IN_VPS 1094 1069 ("RepFormatIdx%d", cfg_repFormatIdx, -1, MAX_LAYERS, "Index to the representation format structure used from the VPS") … … 1165 1140 ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr, string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to" 1166 1141 " bottom-right luma sample of the EL picture, in units of two luma samples") 1167 #if REF_REGION_OFFSET1142 #if SVC_EXTENSION 1168 1143 ("ScaledRefLayerOffsetPresentFlag%d", cfg_scaledRefLayerOffsetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of scaled reference layer offsets") 1169 1144 ("RefRegionOffsetPresentFlag%d", cfg_refRegionOffsetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of reference region offsets") … … 1176 1151 ("RefRegionBottomOffset%d", cfg_refRegionBottomOffsetPtr, string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of ref region with respect to" 1177 1152 " bottom-right luma sample of the BL picture, in units of two luma samples") 1178 #endif1179 #if R0209_GENERIC_PHASE1180 1153 ("ResamplePhaseSetPresentFlag%d", cfg_resamplePhaseSetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of resample phase set") 1181 1154 ("PhaseHorLuma%d", cfg_phaseHorLumaPtr, string(""), MAX_LAYERS, "luma shift in the horizontal direction used in resampling proces") … … 1183 1156 ("PhaseHorChroma%d", cfg_phaseHorChromaPtr, string(""), MAX_LAYERS, "chroma shift in the horizontal direction used in resampling proces") 1184 1157 ("PhaseVerChroma%d", cfg_phaseVerChromaPtr, string(""), MAX_LAYERS, "chroma shift in the vertical direction used in resampling proces") 1185 #endif1186 #if P0312_VERT_PHASE_ADJ1187 ("VertPhasePositionEnableFlag%d", cfg _vertPhasePositionEnableFlagPtr,string(""), MAX_LAYERS, "VertPhasePositionEnableFlag for layer %d")1188 1158 #endif 1189 1159 #if Q0074_COLOUR_REMAPPING_SEI … … 2156 2126 assert( strcmp(cfg_refLocationOffsetLayerId[layer].c_str(), "")); 2157 2127 #endif 2158 #if REF_REGION_OFFSET2159 2128 Bool srloFlag = 2160 2129 strcmp(cfg_scaledRefLayerLeftOffset [layer].c_str(), "") || … … 2162 2131 strcmp(cfg_scaledRefLayerTopOffset [layer].c_str(), "") || 2163 2132 strcmp(cfg_scaledRefLayerBottomOffset [layer].c_str(), ""); 2133 2164 2134 Bool rroFlag = 2165 2135 strcmp(cfg_refRegionLeftOffset [layer].c_str(), "") || … … 2167 2137 strcmp(cfg_refRegionTopOffset [layer].c_str(), "") || 2168 2138 strcmp(cfg_refRegionBottomOffset [layer].c_str(), ""); 2169 #if R0209_GENERIC_PHASE 2139 2170 2140 Bool phaseSetFlag = 2171 2141 strcmp(cfg_phaseHorLuma [layer].c_str(), "") || … … 2174 2144 strcmp(cfg_phaseVerChroma [layer].c_str(), ""); 2175 2145 assert( srloFlag || rroFlag || phaseSetFlag); 2176 #else2177 assert( srloFlag || rroFlag );2178 #endif2179 #else2180 #if P0312_VERT_PHASE_ADJ2181 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 #else2187 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 #endif2192 #endif2193 2146 } 2194 2147 … … 2211 2164 #endif 2212 2165 2213 #if REF_REGION_OFFSET2214 2166 // Presense Flag // 2215 2167 if(strcmp(cfg_scaledRefLayerOffsetPresentFlag[layer].c_str(), "")) … … 2225 2177 } 2226 2178 } 2227 #endif2228 2179 2229 2180 // Left offset // … … 2282 2233 } 2283 2234 } 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 2300 2236 // Presense Flag // 2301 2237 if(strcmp(cfg_refRegionOffsetPresentFlag[layer].c_str(), "")) … … 2367 2303 } 2368 2304 } 2369 #endif 2370 #if R0209_GENERIC_PHASE 2305 2371 2306 Int numPhaseSet = m_acLayerCfg[layer].m_numRefLayerLocationOffsets; 2372 2307 … … 2440 2375 } 2441 2376 } 2442 #endif2443 2377 } 2444 2378 … … 4611 4545 printf("InterLayerWeightedPred : %d\n", m_useInterLayerWeightedPred ); 4612 4546 #endif 4613 #if O0215_PHASE_ALIGNMENT4614 printf("Cross-layer sample alignment : %d\n", m_phaseAlignFlag);4615 #endif4616 4547 printf("\n"); 4617 4548 for(UInt layer=0; layer<m_numLayers; layer++) -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1089 r1090 496 496 UInt m_ilcIdc[1024]; 497 497 #endif 498 #if O0215_PHASE_ALIGNMENT499 Bool m_phaseAlignFlag;500 #endif501 498 #if O0223_PICTURE_TYPES_ALIGN_FLAG 502 499 Bool m_crossLayerPictureTypeAlignFlag; -
branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r1089 r1090 72 72 ::memset(m_scaledRefLayerRightOffset, 0, sizeof(m_scaledRefLayerRightOffset)); 73 73 ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset)); 74 #if REF_REGION_OFFSET75 74 ::memset(m_scaledRefLayerOffsetPresentFlag, 0, sizeof(m_scaledRefLayerOffsetPresentFlag)); 76 75 ::memset(m_refRegionOffsetPresentFlag, 0, sizeof(m_refRegionOffsetPresentFlag)); … … 79 78 ::memset(m_refRegionRightOffset, 0, sizeof(m_refRegionRightOffset)); 80 79 ::memset(m_refRegionBottomOffset, 0, sizeof(m_refRegionBottomOffset)); 81 #endif82 #if R0209_GENERIC_PHASE83 80 ::memset(m_resamplePhaseSetPresentFlag, 0, sizeof(m_resamplePhaseSetPresentFlag)); 84 81 ::memset(m_phaseHorLuma, 0, sizeof(m_phaseHorLuma)); … … 86 83 ::memset(m_phaseHorChroma, 0, sizeof(m_phaseHorChroma)); 87 84 ::memset(m_phaseVerChroma, 0, sizeof(m_phaseVerChroma)); 88 #else89 #if P0312_VERT_PHASE_ADJ90 ::memset(m_vertPhasePositionEnableFlag, 0, sizeof(m_vertPhasePositionEnableFlag));91 #endif92 #endif93 85 } 94 86 -
branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r1089 r1090 101 101 Int m_scaledRefLayerRightOffset [MAX_LAYERS]; 102 102 Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; 103 #if REF_REGION_OFFSET104 103 Bool m_scaledRefLayerOffsetPresentFlag [MAX_LAYERS]; 105 104 Bool m_refRegionOffsetPresentFlag [MAX_LAYERS]; … … 108 107 Int m_refRegionRightOffset [MAX_LAYERS]; 109 108 Int m_refRegionBottomOffset[MAX_LAYERS]; 110 #endif111 #if P0312_VERT_PHASE_ADJ112 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS];113 #endif114 #if R0209_GENERIC_PHASE115 109 Int m_phaseHorLuma [MAX_LAYERS]; 116 110 Int m_phaseVerLuma [MAX_LAYERS]; … … 118 112 Int m_phaseVerChroma[MAX_LAYERS]; 119 113 Bool m_resamplePhaseSetPresentFlag [MAX_LAYERS]; 120 #endif121 114 122 115 Int m_inputBitDepth [MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input file -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1089 r1090 769 769 if( layer > 0 ) 770 770 { 771 #if REF_REGION_OFFSET772 771 #if AUXILIARY_PICTURES 773 772 Int subWidthC = ( m_acLayerCfg[layer].m_chromaFormatIDC == CHROMA_420 || m_acLayerCfg[layer].m_chromaFormatIDC == CHROMA_422 ) ? 2 : 1; … … 777 776 Int subHeightC = 2; 778 777 #endif 779 #endif780 778 m_acTEncTop[layer].setNumRefLayerLocationOffsets ( m_acLayerCfg[layer].m_numRefLayerLocationOffsets ); 781 779 for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++) … … 784 782 m_acTEncTop[layer].setRefLocationOffsetLayerId (i, m_acLayerCfg[layer].m_refLocationOffsetLayerId[i]); 785 783 #endif 786 #if REF_REGION_OFFSET787 784 m_acTEncTop[layer].setScaledRefLayerOffsetPresentFlag ( i, m_acLayerCfg[layer].m_scaledRefLayerOffsetPresentFlag[i] ); 788 785 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( subWidthC * m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], subWidthC * m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 789 786 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 800 788 Int rlSubWidthC = ( m_acLayerCfg[i].m_chromaFormatIDC == CHROMA_420 || m_acLayerCfg[i].m_chromaFormatIDC == CHROMA_422 ) ? 2 : 1; 801 789 Int rlSubHeightC = ( m_acLayerCfg[i].m_chromaFormatIDC == CHROMA_420 ) ? 2 : 1; … … 804 792 m_acTEncTop[layer].getRefLayerWindow(i).setWindow ( rlSubWidthC * m_acLayerCfg[layer].m_refRegionLeftOffset[i], rlSubWidthC * m_acLayerCfg[layer].m_refRegionRightOffset[i], 805 793 rlSubHeightC * m_acLayerCfg[layer].m_refRegionTopOffset[i], rlSubHeightC * m_acLayerCfg[layer].m_refRegionBottomOffset[i]); 806 #if R0209_GENERIC_PHASE807 794 m_acTEncTop[layer].setResamplePhaseSetPresentFlag ( i, m_acLayerCfg[layer].m_resamplePhaseSetPresentFlag[i] ); 808 795 m_acTEncTop[layer].setPhaseHorLuma ( i, m_acLayerCfg[layer].m_phaseHorLuma[i] ); … … 810 797 m_acTEncTop[layer].setPhaseHorChroma ( i, m_acLayerCfg[layer].m_phaseHorChroma[i] ); 811 798 m_acTEncTop[layer].setPhaseVerChroma ( i, m_acLayerCfg[layer].m_phaseVerChroma[i] ); 812 #endif813 799 } 814 800 } … … 1846 1832 #endif 1847 1833 1848 #if O0215_PHASE_ALIGNMENT1849 vps->setPhaseAlignFlag( m_phaseAlignFlag );1850 #endif1851 1852 1834 #if P0300_ALT_OUTPUT_LAYER_FLAG 1853 1835 for (Int k = 0; k < MAX_VPS_LAYER_SETS_PLUS1; k++) … … 1859 1841 vps->setAltOuputLayerFlag( m_altOutputLayerFlag ); 1860 1842 #endif 1861 #endif1862 1863 #if P0312_VERT_PHASE_ADJ1864 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 );1877 1843 #endif 1878 1844 -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
r1074 r1090 3428 3428 #endif 3429 3429 3430 #if MOVE_SCALED_OFFSET_TO_PPS3431 3430 #if O0098_SCALED_REF_LAYER_ID 3432 3431 Int leftStartL = m_pcSlice->getPPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset(); … … 3436 3435 Int topStartL = baseColPic->getSlice(0)->getPPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset(); 3437 3436 #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 3449 3438 const Window &windowRL = m_pcSlice->getPPS()->getRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)); 3450 3439 Int iBX = (((iPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16) + windowRL.getWindowLeftOffset(); 3451 3440 Int iBY = (((iPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16) + windowRL.getWindowTopOffset(); 3452 #else3453 #if Q0200_CONFORMANCE_BL_SIZE3454 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 #else3458 Int iBX = ((iPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16;3459 Int iBY = ((iPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;3460 #endif3461 #endif3462 3441 3463 3442 #if REF_IDX_MFM -
branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp
r1057 r1090 860 860 861 861 #if SVC_EXTENSION 862 #if O0215_PHASE_ALIGNMENT_REMOVAL863 862 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ) 864 863 { 865 864 m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic ); 866 865 } 867 #else868 #if O0215_PHASE_ALIGNMENT869 #if O0194_JOINT_US_BITSHIFT870 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 #else875 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 #endif880 #else881 #if O0194_JOINT_US_BITSHIFT882 #if REF_REGION_OFFSET883 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 #else888 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 #endif893 #else894 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 #endif899 #endif900 #endif901 866 #endif //SVC_EXTENSION 902 867 //! \} -
branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.h
r1029 r1090 146 146 147 147 #if SVC_EXTENSION 148 #if O0215_PHASE_ALIGNMENT_REMOVAL149 148 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ); 150 #else151 #if O0215_PHASE_ALIGNMENT152 #if O0194_JOINT_US_BITSHIFT153 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag );154 #else155 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );156 #endif157 #else158 #if O0194_JOINT_US_BITSHIFT159 #if REF_REGION_OFFSET160 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow );161 #else162 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );163 #endif164 #else165 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );166 #endif167 #endif168 #endif169 149 #endif //SVC_EXTENSION 170 150 }; -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1086 r1090 159 159 m_interLayerPredEnabledFlag = 0; 160 160 ::memset( m_interLayerPredLayerIdc, 0, sizeof(m_interLayerPredLayerIdc) ); 161 #if P0312_VERT_PHASE_ADJ162 ::memset( m_vertPhasePositionFlag, 0, sizeof(m_vertPhasePositionFlag) );163 #endif164 161 #endif //SVC_EXTENSION 165 162 … … 535 532 UInt refLayerId = m_pcVPS->getRefLayerId( m_layerId, refLayerIdc ); 536 533 #if RESAMPLING_CONSTRAINT_BUG_FIX 537 #if MOVE_SCALED_OFFSET_TO_PPS538 534 #if O0098_SCALED_REF_LAYER_ID 539 535 const Window &scalEL = getPPS()->getScaledRefLayerWindowForLayer(refLayerId); 540 536 #else 541 537 const Window &scalEL = getPPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]); 542 #endif543 #else544 #if O0098_SCALED_REF_LAYER_ID545 const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer(refLayerId);546 #else547 const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]);548 #endif549 538 #endif 550 539 Int scalingOffset = ((scalEL.getWindowLeftOffset() == 0 ) && … … 1099 1088 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; 1100 1089 memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) ); 1101 #if P0312_VERT_PHASE_ADJ1102 memcpy( m_vertPhasePositionFlag, pSrc->m_vertPhasePositionFlag, sizeof( m_vertPhasePositionFlag ) );1103 #endif1104 1090 #endif 1105 1091 m_pcSPS = pSrc->m_pcSPS; … … 2260 2246 , m_layerId ( 0 ) 2261 2247 , m_extensionFlag ( false ) 2262 #if !MOVE_SCALED_OFFSET_TO_PPS2263 , m_numScaledRefLayerOffsets ( 0 )2264 #endif2265 2248 #if REPN_FORMAT_IN_VPS 2266 2249 , m_updateRepFormatFlag (false) … … 2297 2280 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); 2298 2281 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 2299 2300 #if !MOVE_SCALED_OFFSET_TO_PPS2301 #if P0312_VERT_PHASE_ADJ2302 ::memset(m_vertPhasePositionEnableFlag, 0, sizeof(m_vertPhasePositionEnableFlag));2303 #endif2304 #endif2305 2282 } 2306 2283 … … 2434 2411 const Int TComSPS::m_winUnitX[]={1,2,2,1}; 2435 2412 const Int TComSPS::m_winUnitY[]={1,2,1,1}; 2436 2437 #if !MOVE_SCALED_OFFSET_TO_PPS2438 #if O0098_SCALED_REF_LAYER_ID2439 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 present2452 return win;2453 }2454 #endif2455 #if REF_REGION_OFFSET2456 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 present2469 return win;2470 }2471 #endif2472 #endif2473 2413 2474 2414 TComPPS::TComPPS() … … 2519 2459 , m_pocResetInfoPresentFlag (false) 2520 2460 #endif 2521 #if MOVE_SCALED_OFFSET_TO_PPS2522 2461 , m_numRefLayerLocationOffsets ( 0 ) 2523 #endif2524 2462 #if Q0048_CGS_3D_ASYMLUT 2525 2463 , m_nCGSFlag(0) … … 2538 2476 2539 2477 #if SVC_EXTENSION 2540 #if REF_REGION_OFFSET2541 2478 ::memset(m_scaledRefLayerOffsetPresentFlag, 0, sizeof(m_scaledRefLayerOffsetPresentFlag)); 2542 2479 ::memset(m_refRegionOffsetPresentFlag, 0, sizeof(m_refRegionOffsetPresentFlag)); 2543 #endif2544 #if R0209_GENERIC_PHASE2545 2480 ::memset(m_resamplePhaseSetPresentFlag, 0, sizeof(m_resamplePhaseSetPresentFlag)); 2546 2481 ::memset(m_phaseHorLuma, 0, sizeof(m_phaseHorLuma)); … … 2548 2483 ::memset(m_phaseHorChroma, 0, sizeof(m_phaseHorChroma)); 2549 2484 ::memset(m_phaseVerChroma, 0, sizeof(m_phaseVerChroma)); 2550 #endif2551 2485 #endif //SVC_EXTENSION 2552 2486 } … … 3210 3144 #endif 3211 3145 3212 #if MOVE_SCALED_OFFSET_TO_PPS3213 3146 #if O0098_SCALED_REF_LAYER_ID 3214 3147 Window& TComPPS::getScaledRefLayerWindowForLayer(Int layerId) … … 3228 3161 } 3229 3162 #endif 3230 #if REF_REGION_OFFSET 3163 3164 #if SVC_EXTENSION 3231 3165 Window& TComPPS::getRefLayerWindowForLayer(Int layerId) 3232 3166 { … … 3244 3178 return win; 3245 3179 } 3246 #endif 3247 3248 #if RESAMPLING_FIX 3249 #if R0209_GENERIC_PHASE 3180 3250 3181 Bool TComPPS::hasZeroResamplingPhase(Int refLayerId) 3251 3182 { … … 3278 3209 } 3279 3210 #endif 3280 #endif3281 3282 #endif3283 3284 3211 3285 3212 #if DERIVE_LAYER_ID_LIST_VARIABLES -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1086 r1090 467 467 Int m_winTopOffset; 468 468 Int m_winBottomOffset; 469 #if P0312_VERT_PHASE_ADJ 470 Bool m_vertPhasePositionEnableFlag; 471 #endif 469 472 470 public: 473 471 Window() … … 477 475 , m_winTopOffset (0) 478 476 , m_winBottomOffset (0) 479 #if P0312_VERT_PHASE_ADJ480 , m_vertPhasePositionEnableFlag(false)481 #endif482 477 { } 483 478 484 479 Bool getWindowEnabledFlag() const { return m_enabledFlag; } 485 #if P0312_VERT_PHASE_ADJ486 Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; m_vertPhasePositionEnableFlag = false; }487 #else488 480 Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } 489 #endif490 481 Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } 491 482 Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } … … 497 488 Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } 498 489 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 504 491 Bool hasEqualOffset(const Window& ref) const 505 492 { … … 511 498 #endif 512 499 513 #if P0312_VERT_PHASE_ADJ514 Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom, Bool vertPhasePositionEnableFlag = 0)515 #else516 500 Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) 517 #endif518 501 { 519 502 m_enabledFlag = true; … … 522 505 m_winTopOffset = offsetLTop; 523 506 m_winBottomOffset = offsetLBottom; 524 525 #if P0312_VERT_PHASE_ADJ526 m_vertPhasePositionEnableFlag = vertPhasePositionEnableFlag;527 #endif528 507 } 529 508 }; … … 797 776 Int m_constPicRateIdc [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 798 777 Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 799 800 #if P0312_VERT_PHASE_ADJ801 Bool m_vpsVuiVertPhaseInUseFlag;802 #endif803 778 804 779 #if P0300_ALT_OUTPUT_LAYER_FLAG … … 826 801 #endif 827 802 Int m_viewIdVal [MAX_LAYERS]; 828 #endif829 830 #if O0215_PHASE_ALIGNMENT831 Bool m_phaseAlignFlag;832 803 #endif 833 804 … … 1348 1319 #endif 1349 1320 1350 #if P0312_VERT_PHASE_ADJ1351 Bool getVpsVuiVertPhaseInUseFlag() { return m_vpsVuiVertPhaseInUseFlag; }1352 Void setVpsVuiVertPhaseInUseFlag(Bool x) { m_vpsVuiVertPhaseInUseFlag = x; }1353 #endif1354 1355 1321 #if P0300_ALT_OUTPUT_LAYER_FLAG 1356 1322 Bool getAltOuputLayerFlag(Int idx) { return m_altOutputLayerFlag[idx]; } … … 1397 1363 Void setExtensionOffset( UInt offset ) { m_extensionOffset = offset; } 1398 1364 #endif 1399 #endif1400 #if O0215_PHASE_ALIGNMENT1401 Bool getPhaseAlignFlag() { return m_phaseAlignFlag; }1402 Void setPhaseAlignFlag(Bool x) { m_phaseAlignFlag = x; }1403 1365 #endif 1404 1366 #if VPS_DPB_SIZE_TABLE … … 1727 1689 Int m_NumDirectRefLayers; 1728 1690 #endif 1729 #if P0312_VERT_PHASE_ADJ1730 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS];1731 #endif1732 #if !MOVE_SCALED_OFFSET_TO_PPS1733 #if O0098_SCALED_REF_LAYER_ID1734 UInt m_scaledRefLayerId[MAX_LAYERS];1735 #endif1736 Window m_scaledRefLayerWindow[MAX_LAYERS];1737 #endif1738 1691 #if REPN_FORMAT_IN_VPS 1739 1692 Bool m_updateRepFormatFlag; … … 1912 1865 Void setNumDirectRefLayers(Int n) { m_NumDirectRefLayers = n; } 1913 1866 #endif 1914 #if !MOVE_SCALED_OFFSET_TO_PPS1915 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; }1916 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; }1917 #if P0312_VERT_PHASE_ADJ1918 Bool getVertPhasePositionEnableFlag(Int x) { return m_vertPhasePositionEnableFlag[x]; }1919 Void setVertPhasePositionEnableFlag(Int x, Bool b) { m_vertPhasePositionEnableFlag[x] = b; }1920 #endif1921 #if O0098_SCALED_REF_LAYER_ID1922 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 #endif1926 Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; }1927 #endif1928 1867 #if REPN_FORMAT_IN_VPS 1929 1868 Bool getUpdateRepFormatFlag() { return m_updateRepFormatFlag; } … … 2047 1986 Bool m_pocResetInfoPresentFlag; 2048 1987 #endif 2049 #if MOVE_SCALED_OFFSET_TO_PPS2050 1988 UInt m_numRefLayerLocationOffsets; 2051 1989 #if O0098_SCALED_REF_LAYER_ID … … 2053 1991 #endif 2054 1992 Window m_scaledRefLayerWindow[MAX_LAYERS]; 2055 #if REF_REGION_OFFSET2056 1993 Window m_refLayerWindow[MAX_LAYERS]; 2057 1994 Bool m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS]; 2058 1995 Bool m_refRegionOffsetPresentFlag[MAX_LAYERS]; 2059 #endif2060 #if R0209_GENERIC_PHASE2061 1996 Int m_phaseHorLuma[MAX_LAYERS]; 2062 1997 Int m_phaseVerLuma[MAX_LAYERS]; … … 2064 1999 Int m_phaseVerChroma[MAX_LAYERS]; 2065 2000 Bool m_resamplePhaseSetPresentFlag[MAX_LAYERS]; 2066 #endif2067 #endif2068 2001 #if Q0048_CGS_3D_ASYMLUT 2069 2002 Int m_nCGSFlag; … … 2215 2148 Void setPocResetInfoPresentFlag (const Bool val) { m_pocResetInfoPresentFlag = val; } 2216 2149 #endif 2217 #if MOVE_SCALED_OFFSET_TO_PPS2218 2150 UInt getNumRefLayerLocationOffsets() { return m_numRefLayerLocationOffsets; } 2219 2151 Void setNumRefLayerLocationOffsets(Int x) { m_numRefLayerLocationOffsets = x; } … … 2224 2156 #endif 2225 2157 Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } 2226 #if REF_REGION_OFFSET2227 2158 Window& getRefLayerWindowForLayer( Int layerId ); 2228 2159 Window& getRefLayerWindow( Int x ) { return m_refLayerWindow[x]; } … … 2231 2162 Bool getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; } 2232 2163 Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; } 2233 #endif2234 #if R0209_GENERIC_PHASE2235 2164 Int getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; } 2236 2165 Int getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; } … … 2243 2172 Bool getResamplePhaseSetPresentFlag(Int x) { return m_resamplePhaseSetPresentFlag[x]; } 2244 2173 Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; } 2245 #if RESAMPLING_FIX2246 2174 Bool hasZeroResamplingPhase(Int refLayerId); 2247 2175 Void getResamplingPhase(Int refLayerId, Bool& phaseSetPresentFlag, Int& phaseHorLuma, Int& phaseVerLuma, Int& phaseHorChroma, Int& phaseVerChroma); 2248 #endif2249 #endif2250 #endif2251 2176 #if Q0048_CGS_3D_ASYMLUT 2252 2177 Int getCGSFlag() { return m_nCGSFlag; } … … 2405 2330 Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures 2406 2331 Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_IDX_PLUS1]; 2407 #if P0312_VERT_PHASE_ADJ2408 Bool m_vertPhasePositionFlag[MAX_VPS_LAYER_IDX_PLUS1];2409 #endif2410 2332 #if POC_RESET_FLAG 2411 2333 Bool m_bPocResetFlag; … … 2723 2645 Bool getInterLayerPredEnabledFlag () { return m_interLayerPredEnabledFlag;} 2724 2646 2725 #if P0312_VERT_PHASE_ADJ2726 Int getVertPhasePositionFlag (UInt layerIdx) { return m_vertPhasePositionFlag[layerIdx];}2727 Void setVertPhasePositionFlag (Bool b, UInt layerIdx) { m_vertPhasePositionFlag[layerIdx] = b; }2728 #endif2729 2730 2647 Void setNumMotionPredRefLayers(int i) { m_numMotionPredRefLayers = i; } 2731 2648 Int getNumMotionPredRefLayers() { return m_numMotionPredRefLayers; } -
branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r1038 r1090 51 51 } 52 52 53 #if O0215_PHASE_ALIGNMENT_REMOVAL54 53 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ) 55 #else56 #if O0215_PHASE_ALIGNMENT57 #if O0194_JOINT_US_BITSHIFT58 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag )59 #else60 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag )61 #endif62 #else63 #if O0194_JOINT_US_BITSHIFT64 #if REF_REGION_OFFSET65 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow )66 #else67 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window )68 #endif69 #else70 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window )71 #endif72 #endif73 #endif74 54 { 75 55 assert ( NTAPS_US_LUMA == 8 ); … … 83 63 #endif 84 64 85 #if MOVE_SCALED_OFFSET_TO_PPS86 65 #if O0098_SCALED_REF_LAYER_ID 87 66 const Window &scalEL = currSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId); … … 89 68 const Window &scalEL = currSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc); 90 69 #endif 91 #if REF_REGION_OFFSET92 70 const Window &windowRL = currSlice->getPPS()->getRefLayerWindowForLayer(refLayerId); 93 #endif94 #else95 #if O0098_SCALED_REF_LAYER_ID96 const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId);97 #else98 const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);99 #endif100 #endif101 71 102 72 //========== Y component upsampling =========== … … 109 79 Int strideEL = pcUsPic->getStride(COMPONENT_Y); 110 80 111 #if Q0200_CONFORMANCE_BL_SIZE112 const Window &confBL = currSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();113 #endif114 #if Q0200_CONFORMANCE_BL_SIZE || REF_REGION_OFFSET115 81 Int chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc(); 116 82 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 117 83 Int yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 118 #endif119 #if R0209_GENERIC_PHASE120 84 Bool phaseSetPresentFlag; 121 85 Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma; … … 127 91 phaseVerChroma = (4 * heightEL + (refRegionHeight >> 1)) / refRegionHeight - 4; 128 92 } 129 #endif130 #if P0312_VERT_PHASE_ADJ131 Bool vertPhasePositionEnableFlag = scalEL.getVertPhasePositionEnableFlag();132 Bool vertPhasePositionFlag = currSlice->getVertPhasePositionFlag( refLayerIdc );133 if( vertPhasePositionFlag )134 {135 assert( vertPhasePositionEnableFlag );136 }137 #endif138 93 139 94 Pel* piTempBufY = pcTempPic->getAddr(COMPONENT_Y); … … 255 210 Int shiftY = 16; 256 211 257 #if R0209_GENERIC_PHASE258 212 Int phaseX = phaseHorLuma; 259 213 Int phaseY = phaseVerLuma; 260 214 Int addX = ( ( phaseX * scaleX + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 261 215 Int addY = ( ( phaseY * scaleY + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 262 #if REF_REGION_OFFSET263 216 Int refOffsetX = windowRL.getWindowLeftOffset() << 4; 264 217 Int refOffsetY = windowRL.getWindowTopOffset() << 4; 265 #else266 #if Q0200_CONFORMANCE_BL_SIZE267 Int refOffsetX = ( confBL.getWindowLeftOffset() * xScal ) << 4;268 Int refOffsetY = ( confBL.getWindowTopOffset() * yScal ) << 4;269 #endif270 #endif271 #else272 #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 2273 Int phaseX = 2*phaseAlignFlag;274 #if P0312_VERT_PHASE_ADJ275 #if Q0120_PHASE_CALCULATION276 Int phaseY = 2*phaseAlignFlag;277 #else278 Int phaseY = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( 2 * phaseAlignFlag );279 #endif280 #else281 Int phaseY = 2*phaseAlignFlag;282 #endif283 #else284 Int phaseX = 0;285 #if P0312_VERT_PHASE_ADJ286 #if Q0120_PHASE_CALCULATION287 Int phaseY = 0;288 #else289 Int phaseY = (vertPhasePositionEnableFlag?(vertPhasePositionFlag *4):(0));290 #endif291 #else292 Int phaseY = 0;293 #endif294 #endif295 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_CALCULATION300 Int deltaX = (Int)phaseAlignFlag <<3;301 Int deltaY = (((Int)phaseAlignFlag <<3)>>(Int)vertPhasePositionEnableFlag) + ((Int)vertPhasePositionFlag<<3);302 #else303 Int deltaX = 4 * phaseX;304 Int deltaY = 4 * phaseY;305 #endif306 307 #if REF_REGION_OFFSET308 Int refOffsetX = windowRL.getWindowLeftOffset() << 4;309 Int refOffsetY = windowRL.getWindowTopOffset() << 4;310 #else311 #if Q0200_CONFORMANCE_BL_SIZE312 deltaX -= ( confBL.getWindowLeftOffset() * xScal ) << 4;313 deltaY -= ( confBL.getWindowTopOffset() * yScal ) << 4;314 #endif315 #endif316 #endif317 218 318 219 Int shiftXM4 = shiftX - 4; … … 325 226 heightBL = min<Int>( pcBasePic->getHeight( COMPONENT_Y ), heightEL ); 326 227 327 #if R0220_REMOVE_EL_CLIP328 228 Int phaseXL = scalEL.getWindowLeftOffset(); 329 229 Int phaseYL = scalEL.getWindowTopOffset(); … … 332 232 Int rlClipT = -(NTAPS_US_LUMA>>1); 333 233 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 341 235 #if O0194_JOINT_US_BITSHIFT 342 236 // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth … … 355 249 for( i = 0; i < widthEL; i++ ) 356 250 { 357 #if R0220_REMOVE_EL_CLIP358 251 Int x = i; 359 #if R0209_GENERIC_PHASE360 252 refPos16 = (((x - phaseXL)*scaleX - addX) >> shiftXM4) + refOffsetX; 361 #else362 #if REF_REGION_OFFSET363 refPos16 = (((x - phaseXL)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetX;364 #else365 refPos16 = (((x - phaseXL)*scaleX + addX) >> shiftXM4) - deltaX;366 #endif367 #endif368 #else369 Int x = Clip3( leftStartL, rightEndL - 1, i );370 #if REF_REGION_OFFSET371 refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetX;372 #else373 refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX;374 #endif375 #endif376 253 phase = refPos16 & 15; 377 254 refPos = refPos16 >> 4; 378 #if R0220_REMOVE_EL_CLIP379 255 refPos = Clip3( rlClipL, rlClipR, refPos ); 380 #endif381 256 coeff = m_lumaFilter[phase]; 382 257 … … 407 282 for( j = 0; j < pcTempPic->getHeight(COMPONENT_Y); j++ ) 408 283 { 409 #if R0220_REMOVE_EL_CLIP410 284 Int y = j; 411 #if R0209_GENERIC_PHASE412 285 refPos16 = ((( y - phaseYL )*scaleY - addY) >> shiftYM4) + refOffsetY; 413 #else414 #if REF_REGION_OFFSET415 refPos16 = ((( y - phaseYL )*scaleY + addY) >> shiftYM4) - deltaY + refOffsetY;416 #else417 refPos16 = ((( y - pahseYL )*scaleY + addY) >> shiftYM4) - deltaY;418 #endif419 #endif420 #else421 Int y = Clip3(topStartL, bottomEndL - 1, j);422 #if REF_REGION_OFFSET423 refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY + refOffsetY;424 #else425 refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY;426 #endif427 #endif428 286 phase = refPos16 & 15; 429 287 refPos = refPos16 >> 4; 430 #if R0220_REMOVE_EL_CLIP431 288 refPos = Clip3( rlClipT, rlClipB, refPos ); 432 #endif433 289 coeff = m_lumaFilter[phase]; 434 290 … … 436 292 Pel* piDstY0 = piDstBufY + j * strideEL; 437 293 438 #if R0220_REMOVE_EL_CLIP439 294 piDstY = piDstY0; 440 295 … … 445 300 piDstY++; 446 301 } 447 #else448 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 #endif471 302 } 472 303 … … 487 318 strideEL = pcUsPic->getStride( COMPONENT_Cb ); 488 319 489 #if R0220_REMOVE_EL_CLIP490 320 Int srlLOffsetC = scalEL.getWindowLeftOffset() >> 1; 491 321 Int srlTOffsetC = scalEL.getWindowTopOffset() >> 1; … … 494 324 rlClipT = -(NTAPS_US_CHROMA>>1); 495 325 rlClipB = heightBL - 1 + (NTAPS_US_CHROMA>>1); 496 #else497 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 #endif503 326 shiftX = 16; 504 327 shiftY = 16; 505 328 506 #if R0209_GENERIC_PHASE507 329 addX = ( ( phaseHorChroma * scaleX + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 508 330 addY = ( ( phaseVerChroma * scaleY + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 509 331 Int refOffsetXC = (windowRL.getWindowLeftOffset() / xScal) << 4; 510 332 Int refOffsetYC = (windowRL.getWindowTopOffset() / yScal) << 4; 511 #else512 #if O0215_PHASE_ALIGNMENT513 Int phaseXC = phaseAlignFlag;514 #if P0312_VERT_PHASE_ADJ515 #if Q0120_PHASE_CALCULATION516 Int phaseYC = phaseAlignFlag + 1;517 #else518 Int phaseYC = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( phaseAlignFlag + 1 );519 #endif520 #else521 Int phaseYC = phaseAlignFlag + 1;522 #endif523 #else524 Int phaseXC = 0;525 #if P0312_VERT_PHASE_ADJ526 #if Q0120_PHASE_CALCULATION527 Int phaseYC = 1;528 #else529 Int phaseYC = vertPhasePositionEnableFlag ? (vertPhasePositionFlag * 4): 1;530 #endif531 #else532 Int phaseYC = 1;533 #endif534 #endif535 536 addX = ( ( phaseXC * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );537 addY = ( ( phaseYC * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );538 539 #if Q0120_PHASE_CALCULATION540 deltaX = (Int)phaseAlignFlag << 2;541 deltaY = ((( (Int)phaseAlignFlag +1)<<2)>>(Int)vertPhasePositionEnableFlag)+((Int)vertPhasePositionFlag<<3);542 #else543 deltaX = 4 * phaseXC;544 deltaY = 4 * phaseYC;545 #endif546 547 #if REF_REGION_OFFSET548 Int refOffsetXC = (windowRL.getWindowLeftOffset() / xScal) << 4;549 Int refOffsetYC = (windowRL.getWindowTopOffset() / yScal) << 4;550 #else551 #if Q0200_CONFORMANCE_BL_SIZE552 deltaX -= ( ( confBL.getWindowLeftOffset() * xScal ) >> 1 ) << 4;553 deltaY -= ( ( confBL.getWindowTopOffset() * yScal ) >> 1 ) << 4;554 #endif555 #endif556 #endif557 333 558 334 shiftXM4 = shiftX - 4; … … 581 357 for( i = 0; i < widthEL; i++ ) 582 358 { 583 #if R0220_REMOVE_EL_CLIP584 359 Int x = i; 585 #if R0209_GENERIC_PHASE586 360 refPos16 = (((x - srlLOffsetC)*scaleX - addX) >> shiftXM4) + refOffsetXC; 587 #else588 #if REF_REGION_OFFSET589 refPos16 = (((x - srlLOffsetC)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetXC;590 #else591 refPos16 = (((x - srlLOffsetC)*scaleX + addX) >> shiftXM4) - deltaX;592 #endif593 #endif594 #else595 Int x = Clip3(leftStartC, rightEndC - 1, i);596 #if REF_REGION_OFFSET597 refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetXC;598 #else599 refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX;600 #endif601 #endif602 361 phase = refPos16 & 15; 603 362 refPos = refPos16 >> 4; 604 #if R0220_REMOVE_EL_CLIP605 363 refPos = Clip3(rlClipL, rlClipR, refPos); 606 #endif607 364 coeff = m_chromaFilter[phase]; 608 365 … … 639 396 for( j = 0; j < pcTempPic->getHeight(COMPONENT_Y) >> 1; j++ ) 640 397 { 641 #if R0220_REMOVE_EL_CLIP642 398 Int y = j; 643 #if R0209_GENERIC_PHASE644 399 refPos16 = (((y - srlTOffsetC)*scaleY - addY) >> shiftYM4) + refOffsetYC; 645 #else646 #if REF_REGION_OFFSET647 refPos16 = (((y - srlTOffsetC)*scaleY + addY) >> shiftYM4) - deltaY + refOffsetYC;648 #else649 refPos16 = (((y - srlTOffsetC)*scaleY + addY) >> shiftYM4) - deltaY;650 #endif651 #endif652 #else653 Int y = Clip3(topStartC, bottomEndC - 1, j);654 #if REF_REGION_OFFSET655 refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY + refOffsetYC;656 #else657 refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY;658 #endif659 #endif660 400 phase = refPos16 & 15; 661 401 refPos = refPos16 >> 4; 662 #if R0220_REMOVE_EL_CLIP663 402 refPos = Clip3(rlClipT, rlClipB, refPos); 664 #endif665 403 coeff = m_chromaFilter[phase]; 666 404 … … 671 409 Pel* piDstV0 = piDstBufV + j*strideEL; 672 410 673 #if R0220_REMOVE_EL_CLIP674 411 piDstU = piDstU0; 675 412 piDstV = piDstV0; … … 684 421 piDstV++; 685 422 } 686 #else687 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 #endif720 721 423 } 722 424 } -
branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.h
r944 r1090 42 42 TComUpsampleFilter(void); 43 43 ~TComUpsampleFilter(void); 44 #if O0215_PHASE_ALIGNMENT_REMOVAL45 44 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ); 46 #else47 #if O0215_PHASE_ALIGNMENT48 #if O0194_JOINT_US_BITSHIFT49 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag );50 #else51 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );52 #endif53 #else54 #if O0194_JOINT_US_BITSHIFT55 #if REF_REGION_OFFSET56 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow );57 #else58 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );59 #endif60 #else61 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );62 #endif63 #endif64 #endif65 45 66 46 }; -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1085 r1090 45 45 #if SVC_EXTENSION 46 46 #define MAX_LAYERS 8 ///< max number of layers the codec is supposed to handle 47 #define O0215_PHASE_ALIGNMENT_REMOVAL 148 47 #define CONFORMANCE_BITSTREAM_MODE 1 ///< In order to generate the metadata related to conformance bitstreams 49 48 #define FIX_CONF_MODE 1 … … 217 216 #define VIEW_ID_RELATED_SIGNALING 1 ///< Introduce syntax elements view_id and view_id_val 218 217 #define N0065_LAYER_POC_ALIGNMENT 1 219 #if !O0215_PHASE_ALIGNMENT_REMOVAL220 #define O0215_PHASE_ALIGNMENT 1 ///< JCTVC_O0215: signal a flag to specify phase alignment case, 0: zero-position-aligned, 1: central-position-aligned,221 #endif222 218 #define AUXILIARY_PICTURES 1 ///< JCTVC-O0041: auxiliary picture layers 223 219 #define R0062_AUX_PSEUDO_MONOCHROME 1 ///> JCVVC-R0063: pseudo monochrome for auxiliary pictures … … 277 273 #define OLS_IDX_CHK 1 ///< JCTVC-R0155: Proposal 2 valid range for output_layer_set_idx_to_vps[i] 278 274 #define R0340_RESAMPLING_MODIFICATION 1 ///< JCTVC-R0340: set of changes regarding resampling (as listed below) 279 #if R0340_RESAMPLING_MODIFICATION280 #define MOVE_SCALED_OFFSET_TO_PPS 1 ///< JCTVC-R0013: move scaled reference layer offset from SPS to PPS281 #if MOVE_SCALED_OFFSET_TO_PPS282 #define REF_REGION_OFFSET 1 ///< JCTVC-Q0159/R0220: reference region offset283 #define R0209_GENERIC_PHASE 1 ///< JCTVC-R0209: resampling with generic phase284 #define R0220_REMOVE_EL_CLIP 1 ///< JCTVC-R0220: remove clip to scaled ref window in resampling process285 #define RESAMPLING_FIX 1 ///< Resampling fix -- equal offset check and conformance check286 #endif287 #else288 #define Q0200_CONFORMANCE_BL_SIZE 1 ///< JCTVC-Q0200; use conformance picture size in re-sampling processs289 #define P0312_VERT_PHASE_ADJ 1 ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report)290 #if P0312_VERT_PHASE_ADJ291 #define Q0120_PHASE_CALCULATION 1 ///< JCTVC-Q0120 phase offset derivation for combination of spatial scalibility and field coding.292 #endif293 #endif294 275 #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 295 276 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1086 r1090 411 411 #endif 412 412 413 #if REF_REGION_OFFSET414 413 READ_UVLC( uiCode, "num_ref_loc_offsets" ); pcPPS->setNumRefLayerLocationOffsets(uiCode); 415 414 for(Int k = 0; k < pcPPS->getNumRefLayerLocationOffsets(); k++) … … 424 423 READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); scaledWindow.setWindowRightOffset (iCode << 1); 425 424 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); scaledWindow.setWindowBottomOffset(iCode << 1); 426 #if P0312_VERT_PHASE_ADJ427 READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode); pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(i), uiCode);428 #endif429 425 } 430 426 READ_FLAG( uiCode, "ref_region_offset_present_flag" ); pcPPS->setRefRegionOffsetPresentFlag( k, uiCode ); … … 437 433 READ_SVLC( iCode, "ref_region_bottom_offset" ); refWindow.setWindowBottomOffset(iCode << 1); 438 434 } 439 #if R0209_GENERIC_PHASE440 435 READ_FLAG( uiCode, "resample_phase_set_present_flag" ); pcPPS->setResamplePhaseSetPresentFlag( k, uiCode ); 441 436 if (uiCode) … … 446 441 READ_UVLC( uiCode, "phase_ver_chroma_plus8" ); pcPPS->setPhaseVerChroma (k, uiCode - 8); 447 442 } 448 #endif449 443 } 450 #else451 #if MOVE_SCALED_OFFSET_TO_PPS452 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_ID457 READ_CODE( 6, uiCode, "scaled_ref_layer_id" ); pcPPS->setScaledRefLayerId( k, uiCode );458 #endif459 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_ADJ464 READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode); pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(k), uiCode);465 #endif466 }467 #endif468 #endif469 444 #if Q0048_CGS_3D_ASYMLUT 470 445 READ_FLAG( uiCode , "colour_mapping_enabled_flag" ); … … 1698 1673 #endif 1699 1674 } 1700 #if P0312_VERT_PHASE_ADJ1701 for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )1702 {1703 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);1704 #if !MOVE_SCALED_OFFSET_TO_PPS1705 if( pcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) )1706 #else1707 if( pcSlice->getPPS()->getVertPhasePositionEnableFlag(refLayerIdc) )1708 #endif1709 {1710 READ_FLAG( uiCode, "vert_phase_position_flag" ); pcSlice->setVertPhasePositionFlag( uiCode? true : false, refLayerIdc );1711 }1712 }1713 #endif1714 1675 #endif //SVC_EXTENSION 1715 1676 … … 3539 3500 } 3540 3501 #endif 3541 #if O0215_PHASE_ALIGNMENT3542 READ_FLAG( uiCode, "cross_layer_phase_alignment_flag"); vps->setPhaseAlignFlag( uiCode == 1 ? true : false );3543 #endif3544 3502 3545 3503 #if !IRAP_ALIGN_FLAG_IN_VPS_VUI … … 4275 4233 } 4276 4234 #endif 4277 #endif4278 #if P0312_VERT_PHASE_ADJ4279 READ_FLAG( uiCode, "vps_vui_vert_phase_in_use_flag" ); vps->setVpsVuiVertPhaseInUseFlag(uiCode);4280 4235 #endif 4281 4236 #if N0160_VUI_EXT_ILP_REF … … 4465 4420 // Vertical MV component restriction is not used in SHVC CTC 4466 4421 assert( uiCode == 0 ); 4467 4468 #if !MOVE_SCALED_OFFSET_TO_PPS4469 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_ID4477 READ_CODE( 6, uiCode, "scaled_ref_layer_id" ); pcSPS->setScaledRefLayerId( i, uiCode );4478 #endif4479 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_ADJ4484 READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode); pcSPS->setVertPhasePositionEnableFlag( pcSPS->getScaledRefLayerId(i), uiCode);4485 #endif4486 }4487 }4488 #endif4489 4422 } 4490 4423 #endif -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1086 r1090 615 615 #endif 616 616 617 #if P0312_VERT_PHASE_ADJ618 #if MOVE_SCALED_OFFSET_TO_PPS619 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 #else632 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 #endif645 #endif646 647 617 #if SPS_DPB_PARAMS 648 618 if( m_layerId > 0 ) … … 1912 1882 #endif 1913 1883 1914 #if MOVE_SCALED_OFFSET_TO_PPS1915 1884 #if O0098_SCALED_REF_LAYER_ID 1916 1885 const Window &scalEL = pcSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId); … … 1918 1887 const Window &scalEL = pcSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc); 1919 1888 #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 1929 1890 const Window &windowRL = pcSlice->getPPS()->getRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc)); 1930 1891 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y) - windowRL.getWindowLeftOffset() - windowRL.getWindowRightOffset(); 1931 1892 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y) - windowRL.getWindowTopOffset() - windowRL.getWindowBottomOffset(); 1932 #else1933 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y);1934 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y);1935 #if Q0200_CONFORMANCE_BL_SIZE1936 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 #endif1941 #endif1942 1893 Int widthEL = m_pcPic->getPicYuvRec()->getWidth(COMPONENT_Y) - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 1943 1894 Int heightEL = m_pcPic->getPicYuvRec()->getHeight(COMPONENT_Y) - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 1944 1895 1945 #if RESAMPLING_FIX1946 #if REF_REGION_OFFSET1947 1896 // conformance check: the values of RefLayerRegionWidthInSamplesY, RefLayerRegionHeightInSamplesY, ScaledRefRegionWidthInSamplesY and ScaledRefRegionHeightInSamplesY shall be greater than 0 1948 1897 assert(widthEL > 0 && heightEL > 0 && widthBL > 0 && widthEL > 0); … … 1951 1900 assert(widthEL >= widthBL && heightEL >= heightBL); 1952 1901 1953 #if R0209_GENERIC_PHASE1954 1902 // 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. 1955 1903 Bool phaseSetPresentFlag; … … 1959 1907 assert( ( (widthEL != widthBL) || (phaseHorLuma == 0 && phaseHorChroma == 0) ) 1960 1908 && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) ); 1961 #endif1962 #endif1963 #endif1964 1909 1965 1910 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); … … 1991 1936 } 1992 1937 #endif 1993 #if SVC_EXTENSION1994 1938 if( m_pcPic->isSpatialEnhLayer(refLayerIdc) ) 1995 1939 { … … 1997 1941 if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) ) 1998 1942 { 1999 #if O0215_PHASE_ALIGNMENT_REMOVAL2000 1943 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec()); 2001 #else2002 #if O0215_PHASE_ALIGNMENT2003 #if O0194_JOINT_US_BITSHIFT2004 #if Q0048_CGS_3D_ASYMLUT2005 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );2006 #else2007 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );2008 #endif2009 #else2010 #if Q0048_CGS_3D_ASYMLUT2011 #if MOVE_SCALED_OFFSET_TO_PPS2012 m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );2013 #else2014 m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );2015 #endif2016 #else2017 m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );2018 #endif2019 #endif2020 #else2021 #if O0194_JOINT_US_BITSHIFT2022 #if Q0048_CGS_3D_ASYMLUT2023 #if REF_REGION_OFFSET2024 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), scalEL, altRL );2025 #else2026 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), scalEL );2027 #endif2028 #else2029 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), scalEL );2030 #endif2031 #else2032 #if Q0048_CGS_3D_ASYMLUT2033 m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), scalEL );2034 #else2035 m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), scalEL );2036 #endif2037 #endif2038 #endif2039 #endif2040 1944 } 2041 1945 } … … 2045 1949 } 2046 1950 pcSlice->setFullPelBaseRec ( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc) ); 2047 #endif //SVC_EXTENSION2048 1951 } 2049 1952 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp
r1029 r1090 690 690 TComSlice * pSlice = pCurPic->getSlice(pCurPic->getCurrSliceIdx()); 691 691 UInt refLayerId = pSlice->getVPS()->getRefLayerId(pSlice->getLayerId(), refLayerIdc); 692 #if MOVE_SCALED_OFFSET_TO_PPS693 692 const Window &scalEL = pSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId); 694 #else695 const Window &scalEL = pSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId);696 #endif697 693 TComPicYuv *pcRecPicBL = pSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(); 698 694 // borders of down-sampled picture -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1085 r1090 316 316 #endif 317 317 318 #if REF_REGION_OFFSET319 318 WRITE_UVLC( pcPPS->getNumRefLayerLocationOffsets(), "num_ref_loc_offsets" ); 320 319 for(Int k = 0; k < pcPPS->getNumRefLayerLocationOffsets(); k++) … … 339 338 WRITE_SVLC( refWindow.getWindowBottomOffset() >> 1, "ref_region_bottom_offset" ); 340 339 } 341 #if R0209_GENERIC_PHASE342 340 WRITE_FLAG( pcPPS->getResamplePhaseSetPresentFlag(k) ? 1 : 0, "resample_phase_set_present_flag" ); 343 341 if (pcPPS->getResamplePhaseSetPresentFlag(k)) … … 348 346 WRITE_UVLC( pcPPS->getPhaseVerChroma(k) + 8, "phase_ver_chroma_plus8" ); 349 347 } 350 #endif351 348 } 352 #else353 #if MOVE_SCALED_OFFSET_TO_PPS354 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_ID359 WRITE_CODE( pcPPS->getScaledRefLayerId(k), 6, "scaled_ref_layer_id" );360 #endif361 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 #endif367 #endif368 349 #if Q0048_CGS_3D_ASYMLUT 369 350 bits = getNumberOfWrittenBits(); … … 1268 1249 } 1269 1250 } 1270 #if P0312_VERT_PHASE_ADJ1271 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 #endif1280 1251 #endif //SVC_EXTENSION 1281 1252 … … 2549 2520 } 2550 2521 #endif 2551 #if O0215_PHASE_ALIGNMENT2552 WRITE_FLAG(vps->getPhaseAlignFlag(), "cross_layer_phase_alignment_flag" );2553 #endif2554 2522 #if !IRAP_ALIGN_FLAG_IN_VPS_VUI 2555 2523 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); … … 2993 2961 WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" ); 2994 2962 #endif 2995 #endif2996 #if P0312_VERT_PHASE_ADJ2997 WRITE_FLAG( vps->getVpsVuiVertPhaseInUseFlag(), "vps_vui_vert_phase_in_use_flag" );2998 2963 #endif 2999 2964 #if N0160_VUI_EXT_ILP_REF … … 3122 3087 // Vertical MV component restriction is not used in SHVC CTC 3123 3088 WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" ); 3124 3125 #if !MOVE_SCALED_OFFSET_TO_PPS3126 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_ID3133 WRITE_CODE( pcSPS->getScaledRefLayerId(i), 6, "scaled_ref_layer_id" );3134 #endif3135 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_ADJ3140 WRITE_FLAG( scaledWindow.getVertPhasePositionEnableFlag(), "vert_phase_position_enable_flag" );3141 #endif3142 }3143 }3144 #endif3145 3089 } 3146 3090 #endif //SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1089 r1090 489 489 490 490 Window &getConformanceWindow() { return m_conformanceWindow; } 491 #if P0312_VERT_PHASE_ADJ && !R0209_GENERIC_PHASE492 Void setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom, false); }493 #else494 491 Void setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom); } 495 #endif496 492 497 493 Void setFramesToBeEncoded ( Int i ) { m_framesToBeEncoded = i; } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1089 r1090 1477 1477 #endif 1478 1478 1479 #if REF_REGION_OFFSET1480 1479 const Window &windowRL = m_pcEncTop->getRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc)); 1481 1480 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y) - windowRL.getWindowLeftOffset() - windowRL.getWindowRightOffset(); 1482 1481 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y) - windowRL.getWindowTopOffset() - windowRL.getWindowBottomOffset(); 1483 #else1484 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y);1485 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y);1486 #if Q0200_CONFORMANCE_BL_SIZE1487 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 #endif1492 #endif1493 1482 Int widthEL = pcPic->getPicYuvRec()->getWidth(COMPONENT_Y) - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 1494 1483 Int heightEL = pcPic->getPicYuvRec()->getHeight(COMPONENT_Y) - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 1495 1484 1496 #if RESAMPLING_FIX1497 #if REF_REGION_OFFSET1498 1485 // conformance check: the values of RefLayerRegionWidthInSamplesY, RefLayerRegionHeightInSamplesY, ScaledRefRegionWidthInSamplesY and ScaledRefRegionHeightInSamplesY shall be greater than 0 1499 1486 assert(widthEL > 0 && heightEL > 0 && widthBL > 0 && widthEL > 0); … … 1502 1489 assert(widthEL >= widthBL && heightEL >= heightBL); 1503 1490 1504 #if R0209_GENERIC_PHASE1505 1491 // 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. 1506 1492 Bool phaseSetPresentFlag; … … 1510 1496 assert( ( (widthEL != widthBL) || (phaseHorLuma == 0 && phaseHorChroma == 0) ) 1511 1497 && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) ); 1512 #endif1513 #endif1514 #endif1515 1498 1516 1499 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); … … 1556 1539 if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) ) 1557 1540 { 1558 #if P0312_VERT_PHASE_ADJ1559 //when PhasePositionEnableFlag is equal to 1, set vertPhasePositionFlag to 0 if BL is top field and 1 if bottom1560 if( scalEL.getVertPhasePositionEnableFlag() )1561 {1562 pcSlice->setVertPhasePositionFlag( pcSlice->getPOC()%2, refLayerIdc );1563 }1564 #endif1565 #if O0215_PHASE_ALIGNMENT_REMOVAL1566 1541 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec() ); 1567 #else1568 #if O0215_PHASE_ALIGNMENT1569 #if O0194_JOINT_US_BITSHIFT1570 #if Q0048_CGS_3D_ASYMLUT1571 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );1572 #else1573 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );1574 #endif1575 #else1576 #if Q0048_CGS_3D_ASYMLUT1577 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );1578 #else1579 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );1580 #endif1581 #endif1582 #else1583 #if O0194_JOINT_US_BITSHIFT1584 #if Q0048_CGS_3D_ASYMLUT1585 #if REF_REGION_OFFSET1586 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, altRL );1587 #else1588 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL );1589 #endif1590 #else1591 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );1592 #endif1593 #else1594 #if Q0048_CGS_3D_ASYMLUT1595 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL );1596 #else1597 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );1598 #endif1599 #endif1600 #endif1601 #endif1602 1542 } 1603 1543 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1068 r1090 619 619 for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ ) 620 620 { 621 #if MOVE_SCALED_OFFSET_TO_PPS622 621 #if O0098_SCALED_REF_LAYER_ID 623 622 const Window scalEL = getPPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); … … 625 624 const Window scalEL = getPPS()->getScaledRefLayerWindow(i); 626 625 #endif 627 #else628 #if O0098_SCALED_REF_LAYER_ID629 const Window scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));630 #else631 const Window scalEL = getSPS()->getScaledRefLayerWindow(i);632 #endif633 #endif634 #if REF_REGION_OFFSET635 626 const Window altRL = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 636 #if RESAMPLING_FIX637 627 Bool equalOffsets = scalEL.hasEqualOffset(altRL); 638 #if R0209_GENERIC_PHASE639 628 Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i)); 640 #endif641 #else642 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0643 && altRL.getWindowLeftOffset() == 0 && altRL.getWindowRightOffset() == 0 && altRL.getWindowTopOffset() == 0 && altRL.getWindowBottomOffset() == 0);644 #endif645 #else646 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );647 #endif648 629 649 630 #if VPS_EXTN_DIRECT_REF_LAYERS … … 665 646 #else 666 647 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !sameBitDepths 667 #if REF_REGION_OFFSET && RESAMPLING_FIX668 648 || !equalOffsets 669 #if R0209_GENERIC_PHASE670 649 || !zeroPhase 671 #endif672 #else673 || !zeroOffsets674 #endif675 650 #endif 676 651 #if Q0048_CGS_3D_ASYMLUT … … 683 658 #else 684 659 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() 685 #if REF_REGION_OFFSET && RESAMPLING_FIX686 660 || !equalOffsets 687 #if R0209_GENERIC_PHASE688 661 || !zeroPhase 689 #endif690 #else691 || !zeroOffsets692 #endif693 662 ) 694 663 #endif … … 720 689 for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ ) 721 690 { 722 #if MOVE_SCALED_OFFSET_TO_PPS723 691 #if O0098_SCALED_REF_LAYER_ID 724 692 const Window scalEL = getPPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); … … 726 694 const Window scalEL = getPPS()->getScaledRefLayerWindow(i); 727 695 #endif 728 #else729 #if O0098_SCALED_REF_LAYER_ID730 const Window scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));731 #else732 const Window scalEL = getSPS()->getScaledRefLayerWindow(i);733 #endif734 #endif735 #if REF_REGION_OFFSET736 696 const Window altRL = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 737 #if RESAMPLING_FIX738 697 Bool equalOffsets = scalEL.hasEqualOffset(altRL); 739 #if R0209_GENERIC_PHASE740 698 Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i)); 741 #endif742 #else743 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0744 && altRL.getWindowLeftOffset() == 0 && altRL.getWindowRightOffset() == 0 && altRL.getWindowTopOffset() == 0 && altRL.getWindowBottomOffset() == 0);745 #endif746 #else747 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );748 #endif749 699 750 700 #if VPS_EXTN_DIRECT_REF_LAYERS … … 758 708 759 709 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !sameBitDepths 760 #if REF_REGION_OFFSET && RESAMPLING_FIX761 710 || !equalOffsets 762 #if R0209_GENERIC_PHASE763 711 || !zeroPhase 764 #endif765 #else766 || !zeroOffsets767 #endif768 712 #if Q0048_CGS_3D_ASYMLUT 769 713 || m_cPPS.getCGSFlag() > 0 … … 775 719 #else 776 720 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() 777 #if REF_REGION_OFFSET && RESAMPLING_FIX778 721 || !equalOffsets 779 #if R0209_GENERIC_PHASE780 722 || !zeroPhase 781 #endif782 #else783 || !zeroOffsets784 #endif785 723 ) 786 724 #endif … … 832 770 #else 833 771 m_cSPS.setLayerId(m_layerId); 834 #endif835 #if !MOVE_SCALED_OFFSET_TO_PPS836 m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets);837 for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++)838 {839 #if O0098_SCALED_REF_LAYER_ID840 m_cSPS.setScaledRefLayerId(i, m_scaledRefLayerId[i]);841 #endif842 m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];843 #if P0312_VERT_PHASE_ADJ844 m_cSPS.setVertPhasePositionEnableFlag( m_scaledRefLayerId[i], m_scaledRefLayerWindow[i].getVertPhasePositionEnableFlag() );845 #endif846 }847 772 #endif 848 773 #endif //SVC_EXTENSION … … 1149 1074 } 1150 1075 #endif 1151 #if MOVE_SCALED_OFFSET_TO_PPS1152 1076 m_cPPS.setNumRefLayerLocationOffsets(m_numRefLayerLocationOffsets); 1153 1077 for(Int i = 0; i < m_cPPS.getNumRefLayerLocationOffsets(); i++) … … 1157 1081 #endif 1158 1082 m_cPPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i]; 1159 #if REF_REGION_OFFSET1160 1083 m_cPPS.getRefLayerWindow(i) = m_refLayerWindow[i]; 1161 1084 m_cPPS.setScaledRefLayerOffsetPresentFlag( i, m_scaledRefLayerOffsetPresentFlag[i] ); 1162 1085 m_cPPS.setRefRegionOffsetPresentFlag( i, m_refRegionOffsetPresentFlag[i] ); 1163 #endif1164 #if R0209_GENERIC_PHASE1165 1086 m_cPPS.setResamplePhaseSetPresentFlag( i, m_resamplePhaseSetPresentFlag[i] ); 1166 1087 m_cPPS.setPhaseHorLuma( m_refLocationOffsetLayerId[i], m_phaseHorLuma[i] ); … … 1168 1089 m_cPPS.setPhaseHorChroma( m_refLocationOffsetLayerId[i], m_phaseHorChroma[i] ); 1169 1090 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 } 1176 1092 #if Q0048_CGS_3D_ASYMLUT 1177 1093 m_cPPS.setCGSFlag( m_nCGSFlag ); … … 1688 1604 return win; 1689 1605 } 1690 #if REF_REGION_OFFSET 1606 1691 1607 Window& TEncTop::getRefLayerWindowForLayer(Int layerId) 1692 1608 { … … 1705 1621 } 1706 1622 #endif 1707 #endif1708 1623 #endif //SVC_EXTENSION 1709 1624 //! \} -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h
r1057 r1090 127 127 #endif 128 128 Window m_scaledRefLayerWindow[MAX_LAYERS]; 129 #if REF_REGION_OFFSET130 129 UInt m_numRefLayerOffsets; 131 130 UInt m_refLayerId[MAX_LAYERS]; … … 133 132 Bool m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS]; 134 133 Bool m_refRegionOffsetPresentFlag[MAX_LAYERS]; 135 #endif136 #if R0209_GENERIC_PHASE137 134 Int m_phaseHorLuma [MAX_LAYERS]; 138 135 Int m_phaseVerLuma [MAX_LAYERS]; … … 140 137 Int m_phaseVerChroma[MAX_LAYERS]; 141 138 Int m_resamplePhaseSetPresentFlag[MAX_LAYERS]; 142 #endif143 #if P0312_VERT_PHASE_ADJ144 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS];145 #endif146 139 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 147 140 Int m_pocAdjustmentValue; … … 232 225 #endif 233 226 Window& getScaledRefLayerWindow(Int x) { return m_scaledRefLayerWindow[x]; } 234 #if REF_REGION_OFFSET235 227 Void setNumRefLayerOffsets(Int x) { m_numRefLayerOffsets = x; } 236 228 UInt getNumRefLayerOffsets() { return m_numRefLayerOffsets; } … … 243 235 Bool getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; } 244 236 Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; } 245 #endif246 #if P0312_VERT_PHASE_ADJ247 Void setVertPhasePositionEnableFlag(Int x, Bool b) { m_vertPhasePositionEnableFlag[x] = b; }248 UInt getVertPhasePositionEnableFlag(Int x) { return m_vertPhasePositionEnableFlag[x]; }249 #endif250 #if R0209_GENERIC_PHASE251 237 Int getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; } 252 238 Int getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; } … … 259 245 Bool getResamplePhaseSetPresentFlag(Int x) { return m_resamplePhaseSetPresentFlag[x]; } 260 246 Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; } 261 #endif262 247 263 248 TComPic** getIlpList() { return m_cIlpPic; }
Note: See TracChangeset for help on using the changeset viewer.