Changeset 873 in SHVCSoftware
- Timestamp:
- 21 Aug 2014, 03:10:10 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r872 r873 287 287 } 288 288 #endif 289 289 290 /** 290 291 - allocate table to contain substream sizes to be written to the slice header. … … 3540 3541 } 3541 3542 #endif 3543 3544 #if RESAMPLING_FIX 3545 #if R0209_GENERIC_PHASE 3546 Bool TComPPS::hasZeroResamplingPhase(Int refLayerIdc) 3547 { 3548 Int phaseHorLuma = this->getPhaseHorLuma(refLayerIdc); 3549 Int phaseVerLuma = this->getPhaseVerLuma(refLayerIdc); 3550 Int phaseHorChroma = this->getPhaseHorChroma(refLayerIdc); 3551 Int phaseVerChroma = this->getPhaseVerChroma(refLayerIdc); 3552 return ( phaseHorLuma == 0 && phaseHorChroma == 0 && phaseVerLuma == 0 && phaseVerChroma == 0); 3553 } 3554 #endif 3555 #endif 3556 3542 3557 #endif 3543 3558 -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r872 r873 443 443 Bool getVertPhasePositionEnableFlag() const { return m_vertPhasePositionEnableFlag; } 444 444 Void setVertPhasePositionEnableFlag(Bool val) { m_vertPhasePositionEnableFlag = val; } 445 #endif 446 #if REF_REGION_OFFSET && RESAMPLING_FIX 447 Bool hasEqualOffset(const Window& ref) const 448 { 449 return ( this->getWindowLeftOffset() == ref.getWindowLeftOffset() 450 && this->getWindowTopOffset() == ref.getWindowTopOffset() 451 && this->getWindowRightOffset() == ref.getWindowRightOffset() 452 && this->getWindowBottomOffset() == ref.getWindowBottomOffset() ); 453 } 445 454 #endif 446 455 … … 2040 2049 Bool getResamplePhaseSetPresentFlag(Int x) { return m_resamplePhaseSetPresentFlag[x]; } 2041 2050 Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; } 2051 #if RESAMPLING_FIX 2052 Bool hasZeroResamplingPhase(Int layerId); 2053 #endif 2042 2054 #endif 2043 2055 #endif … … 2629 2641 #endif 2630 2642 2631 2632 2643 #endif //SVC_EXTENSION 2633 2644 protected: -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r872 r873 255 255 #define R0209_GENERIC_PHASE 1 ///< JCTVC-R0209: resampling with generic phase 256 256 #define R0220_REMOVE_EL_CLIP 1 ///< JCTVC-R0220: remove clip to scaled ref window in resampling process 257 #define RESAMPLING_FIX 1 ///< Resampling fix -- equal offset check and conformance check 257 258 #endif 258 259 #else -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r869 r873 381 381 #if REF_REGION_OFFSET 382 382 const Window refEL = pcSlice->getPPS()->getRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, i)); 383 #if RESAMPLING_FIX 384 Bool equalOffsets = scalEL.hasEqualOffset(refEL); 385 #if R0209_GENERIC_PHASE 386 Bool zeroPhase = pcSlice->getPPS()->hasZeroResamplingPhase(pcSlice->getVPS()->getRefLayerId(m_layerId, i)); 387 #endif 388 #else 383 389 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 384 390 && refEL.getWindowLeftOffset() == 0 && refEL.getWindowRightOffset() == 0 && refEL.getWindowTopOffset() == 0 && refEL.getWindowBottomOffset() == 0 ); 391 #endif 385 392 #else 386 393 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 ); … … 399 406 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 400 407 401 if( pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets || !sameBitDepths 408 if( pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !sameBitDepths 409 #if REF_REGION_OFFSET && RESAMPLING_FIX 410 || !equalOffsets 411 #if R0209_GENERIC_PHASE 412 || !zeroPhase 413 #endif 414 #else 415 || !zeroOffsets 416 #endif 402 417 #if Q0048_CGS_3D_ASYMLUT 403 418 || pcSlice->getPPS()->getCGSFlag() > 0 … … 408 423 ) 409 424 #else 410 if(pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets ) 411 #endif 412 #else 413 if(pcPicYuvRecBase->getWidth() != pcSlice->getSPS()->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getSPS()->getPicHeightInLumaSamples() || !zeroOffsets ) 425 if(pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() 426 #if REF_REGION_OFFSET && RESAMPLING_FIX 427 || !equalOffsets 428 #if R0209_GENERIC_PHASE 429 || !zeroPhase 430 #endif 431 #else 432 || !zeroOffsets 433 #endif 434 ) 435 #endif 436 #else 437 if(pcPicYuvRecBase->getWidth() != pcSlice->getSPS()->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getSPS()->getPicHeightInLumaSamples() 438 #if REF_REGION_OFFSET && RESAMPLING_FIX 439 || !equalOffsets 440 #if R0209_GENERIC_PHASE 441 || !zeroPhase 442 #endif 443 #else 444 || !zeroOffsets 445 #endif 446 ) 414 447 #endif 415 448 { … … 1974 2007 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 1975 2008 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 2009 2010 #if RESAMPLING_FIX 2011 #if REF_REGION_OFFSET 2012 // conformance check: the values of RefLayerRegionWidthInSamplesY, RefLayerRegionHeightInSamplesY, ScaledRefRegionWidthInSamplesY and ScaledRefRegionHeightInSamplesY shall be greater than 0 2013 assert(widthEL > 0 && heightEL > 0 && widthBL > 0 && widthEL > 0); 2014 2015 // conformance check: ScaledRefRegionWidthInSamplesY shall be greater or equal to RefLayerRegionWidthInSamplesY and ScaledRefRegionHeightInSamplesY shall be greater or equal to RefLayerRegionHeightInSamplesY 2016 assert(widthEL >= widthBL && heightEL >= heightBL); 2017 2018 #if R0209_GENERIC_PHASE 2019 // 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. 2020 Int phaseHorLuma = pcSlice->getPPS()->getPhaseHorLuma(refLayerIdc); 2021 Int phaseVerLuma = pcSlice->getPPS()->getPhaseVerLuma(refLayerIdc); 2022 Int phaseHorChroma = pcSlice->getPPS()->getPhaseHorChroma(refLayerIdc); 2023 Int phaseVerChroma = pcSlice->getPPS()->getPhaseVerChroma(refLayerIdc); 2024 assert( ( (widthEL != widthBL) || (phaseHorLuma == 0 && phaseHorChroma == 0) ) 2025 && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) ); 2026 #endif 2027 #endif 2028 #endif 1976 2029 1977 2030 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r868 r873 1124 1124 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 1125 1125 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 1126 1127 #if RESAMPLING_FIX 1128 #if REF_REGION_OFFSET 1129 // conformance check: the values of RefLayerRegionWidthInSamplesY, RefLayerRegionHeightInSamplesY, ScaledRefRegionWidthInSamplesY and ScaledRefRegionHeightInSamplesY shall be greater than 0 1130 assert(widthEL > 0 && heightEL > 0 && widthBL > 0 && widthEL > 0); 1131 1132 // conformance check: ScaledRefRegionWidthInSamplesY shall be greater or equal to RefLayerRegionWidthInSamplesY and ScaledRefRegionHeightInSamplesY shall be greater or equal to RefLayerRegionHeightInSamplesY 1133 assert(widthEL >= widthBL && heightEL >= heightBL); 1134 1135 #if R0209_GENERIC_PHASE 1136 // 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. 1137 Int phaseHorLuma = pcSlice->getPPS()->getPhaseHorLuma(refLayerIdc); 1138 Int phaseVerLuma = pcSlice->getPPS()->getPhaseVerLuma(refLayerIdc); 1139 Int phaseHorChroma = pcSlice->getPPS()->getPhaseHorChroma(refLayerIdc); 1140 Int phaseVerChroma = pcSlice->getPPS()->getPhaseVerChroma(refLayerIdc); 1141 assert( ( (widthEL != widthBL) || (phaseHorLuma == 0 && phaseHorChroma == 0) ) 1142 && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) ); 1143 #endif 1144 #endif 1145 #endif 1126 1146 1127 1147 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r869 r873 794 794 #if REF_REGION_OFFSET 795 795 const Window altRL = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 796 #if RESAMPLING_FIX 797 Bool equalOffsets = scalEL.hasEqualOffset(altRL); 798 #if R0209_GENERIC_PHASE 799 Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i)); 800 #endif 801 #else 796 802 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 797 803 && altRL.getWindowLeftOffset() == 0 && altRL.getWindowRightOffset() == 0 && altRL.getWindowTopOffset() == 0 && altRL.getWindowBottomOffset() == 0); 804 #endif 798 805 #else 799 806 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 ); … … 809 816 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 810 817 811 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets || !sameBitDepths 818 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !sameBitDepths 819 #if REF_REGION_OFFSET && RESAMPLING_FIX 820 || !equalOffsets 821 #if R0209_GENERIC_PHASE 822 || !zeroPhase 823 #endif 824 #else 825 || !zeroOffsets 826 #endif 812 827 #if Q0048_CGS_3D_ASYMLUT 813 828 || m_cPPS.getCGSFlag() > 0 … … 818 833 ) 819 834 #else 820 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets ) 835 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() 836 #if REF_REGION_OFFSET && RESAMPLING_FIX 837 || !equalOffsets 838 #if R0209_GENERIC_PHASE 839 || !zeroPhase 840 #endif 841 #else 842 || !zeroOffsets 843 #endif 844 ) 821 845 #endif 822 846 { … … 868 892 #if REF_REGION_OFFSET 869 893 const Window altRL = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 894 #if RESAMPLING_FIX 895 Bool equalOffsets = scalEL.hasEqualOffset(altRL); 896 #if R0209_GENERIC_PHASE 897 Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i)); 898 #endif 899 #else 870 900 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 871 901 && altRL.getWindowLeftOffset() == 0 && altRL.getWindowRightOffset() == 0 && altRL.getWindowTopOffset() == 0 && altRL.getWindowBottomOffset() == 0); 902 #endif 872 903 #else 873 904 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 ); … … 883 914 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 884 915 885 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets || !sameBitDepths 916 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !sameBitDepths 917 #if REF_REGION_OFFSET && RESAMPLING_FIX 918 || !equalOffsets 919 #if R0209_GENERIC_PHASE 920 || !zeroPhase 921 #endif 922 #else 923 || !zeroOffsets 924 #endif 886 925 #if Q0048_CGS_3D_ASYMLUT 887 926 || m_cPPS.getCGSFlag() > 0 … … 892 931 ) 893 932 #else 894 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets ) 933 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() 934 #if REF_REGION_OFFSET && RESAMPLING_FIX 935 || !equalOffsets 936 #if R0209_GENERIC_PHASE 937 || !zeroPhase 938 #endif 939 #else 940 || !zeroOffsets 941 #endif 942 ) 895 943 #endif 896 944 {
Note: See TracChangeset for help on using the changeset viewer.