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


Ignore:
Timestamp:
17 Jul 2015, 00:55:34 (10 years ago)
Author:
seregin
Message:

port rev 4320 (g_maxTrDynamicRange)

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

Legend:

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

    r1260 r1285  
    340340 * \param channelType             plane type (luma/chroma)
    341341 */
    342 Void TEncSbac::xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam, const Bool useLimitedPrefixLength, const ChannelType channelType )
     342Void TEncSbac::xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam, const Bool useLimitedPrefixLength, const ChannelType channelType, const Int maxLog2TrDynamicRange )
    343343{
    344344  Int codeNumber  = (Int)symbol;
     
    353353  else if (useLimitedPrefixLength)
    354354  {
    355     const UInt maximumPrefixLength = (32 - (COEF_REMAIN_BIN_REDUCTION + g_maxTrDynamicRange[channelType]));
     355    const UInt maximumPrefixLength = (32 - (COEF_REMAIN_BIN_REDUCTION + maxLog2TrDynamicRange));
    356356
    357357    UInt prefixLength = 0;
     
    362362    {
    363363      prefixLength = maximumPrefixLength;
    364       suffixLength = g_maxTrDynamicRange[channelType] - rParam;
     364      suffixLength = maxLog2TrDynamicRange - rParam;
    365365    }
    366366    else
     
    12541254
    12551255  const Bool         alignCABACBeforeBypass = pcCU->getSlice()->getSPS()->getAlignCABACBeforeBypass();
     1256  const Int          maxLog2TrDynamicRange  = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(channelType);
    12561257
    12571258  Bool beValid;
     
    15041505            const UInt escapeCodeValue = absCoeff[idx] - baseLevel;
    15051506
    1506             xWriteCoefRemainExGolomb( escapeCodeValue, uiGoRiceParam, extendedPrecision, channelType );
     1507            xWriteCoefRemainExGolomb( escapeCodeValue, uiGoRiceParam, extendedPrecision, channelType, maxLog2TrDynamicRange );
    15071508
    15081509            if (absCoeff[idx] > (3 << uiGoRiceParam))
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.h

    r1259 r1285  
    128128  Void  xWriteUnaryMaxSymbol ( UInt uiSymbol, ContextModel* pcSCModel, Int iOffset, UInt uiMaxSymbol );
    129129  Void  xWriteEpExGolomb     ( UInt uiSymbol, UInt uiCount );
    130   Void  xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam, const Bool useLimitedPrefixLength, const ChannelType channelType );
     130  Void  xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam, const Bool useLimitedPrefixLength, const ChannelType channelType, const Int maxLog2TrDynamicRange );
    131131
    132132  Void  xCopyFrom            ( const TEncSbac* pSrc );
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1284 r1285  
    275275  // Initialise scaling lists
    276276  // The encoder will only use the SPS scaling lists. The PPS will never be marked present.
    277 
     277  const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE] =
     278  {
     279      m_cSPS.getMaxLog2TrDynamicRange(CHANNEL_TYPE_LUMA),
     280      m_cSPS.getMaxLog2TrDynamicRange(CHANNEL_TYPE_CHROMA)
     281  };
    278282  if(getUseScalingListId() == SCALING_LIST_OFF)
    279283  {
    280284#if SVC_EXTENSION
    281     getTrQuant()->setFlatScalingList(m_cVPS.getChromaFormatIdc(&m_cSPS, m_layerId));
     285    getTrQuant()->setFlatScalingList(m_cVPS.getChromaFormatIdc(&m_cSPS, m_layerId), maxLog2TrDynamicRange);
    282286#else
    283     getTrQuant()->setFlatScalingList(m_cSPS.getChromaFormatIdc());
     287    getTrQuant()->setFlatScalingList(m_cSPS.getChromaFormatIdc(), maxLog2TrDynamicRange);
    284288#endif
    285289    getTrQuant()->setUseScalingList(false);
     
    301305
    302306      // infer the scaling list from the reference layer
    303       getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), m_cSPS.getChromaFormatIdc() );
     307      getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), m_cSPS.getChromaFormatIdc(), maxLog2TrDynamicRange );
    304308    }
    305309    else
     
    309313    m_cSPS.setScalingListPresentFlag(false);
    310314    m_cPPS.setScalingListPresentFlag(false);
    311     getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc());
     315
     316    getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc(), maxLog2TrDynamicRange);
    312317#if SVC_EXTENSION
    313318    }
     
    329334
    330335      // infer the scaling list from the reference layer
    331       getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), m_cSPS.getChromaFormatIdc() );
     336      getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), m_cSPS.getChromaFormatIdc(), maxLog2TrDynamicRange );
    332337    }
    333338    else
     
    344349    m_cSPS.setScalingListPresentFlag(m_cSPS.getScalingList().checkDefaultScalingList());
    345350    m_cPPS.setScalingListPresentFlag(false);
    346     getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc());
     351    getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc(), maxLog2TrDynamicRange);
    347352#if SVC_EXTENSION
    348353    }
Note: See TracChangeset for help on using the changeset viewer.