Changeset 873 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder


Ignore:
Timestamp:
21 Aug 2014, 03:10:10 (11 years ago)
Author:
sharp
Message:

Resampling bugfix -- (1) fix resampling bypass flag, (2) conformance check on resampling params
(Macro: RESAMPLING_FIX)

From: Tomoyuki Yamamoto <yamamoto.tomoyuki@…>

Location:
branches/SHM-dev/source/Lib/TLibEncoder
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r868 r873  
    11241124        Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
    11251125        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
    11261146
    11271147        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  
    794794#if REF_REGION_OFFSET
    795795          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
    796802          Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0
    797803                               && altRL.getWindowLeftOffset() == 0 && altRL.getWindowRightOffset() == 0 && altRL.getWindowTopOffset() == 0 && altRL.getWindowBottomOffset() == 0);
     804#endif
    798805#else
    799806          Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
     
    809816          Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] );
    810817
    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
    812827#if Q0048_CGS_3D_ASYMLUT
    813828            || m_cPPS.getCGSFlag() > 0
     
    818833            )
    819834#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          )
    821845#endif
    822846          {
     
    868892#if REF_REGION_OFFSET
    869893          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
    870900          Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0
    871901                               && altRL.getWindowLeftOffset() == 0 && altRL.getWindowRightOffset() == 0 && altRL.getWindowTopOffset() == 0 && altRL.getWindowBottomOffset() == 0);
     902#endif
    872903#else
    873904          Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
     
    883914          Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] );
    884915
    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
    886925#if Q0048_CGS_3D_ASYMLUT
    887926            || m_cPPS.getCGSFlag() > 0
     
    892931)
    893932#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          )
    895943#endif
    896944          {
Note: See TracChangeset for help on using the changeset viewer.