Changeset 1285 in SHVCSoftware


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

port rev 4320 (g_maxTrDynamicRange)

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

Legend:

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

    r1284 r1285  
    42804280  // compute actual CU depth with respect to config depth and max transform size
    42814281  g_uiAddCUDepth  = 0;
    4282   while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_uiAddCUDepth )  ) ) g_uiAddCUDepth++;
     4282  while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_uiAddCUDepth )  ) )
     4283  {
     4284    g_uiAddCUDepth++;
     4285  }
    42834286
    42844287  g_uiAddCUDepth+=getMaxCUDepthOffset(m_chromaFormatIDC, m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs.
     
    43134316    g_bitDepth   [channelType] = m_internalBitDepth[channelType];
    43144317#endif
    4315     g_maxTrDynamicRange[channelType] = m_useExtendedPrecision? std::max<Int>(15, (g_bitDepth[channelType] + 6)) : 15;
    4316   }
    4317 
     4318  }
    43184319}
    43194320#endif
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1284 r1285  
    910910//#endif
    911911    m_cTEncTop.setPCMBitDepth((ChannelType)channelType, m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[channelType] : m_internalBitDepth[channelType]);
    912     //g_maxTrDynamicRange[channelType] = m_useExtendedPrecision? std::max<Int>(15, (g_bitDepth[channelType] + 6)) : 15;
    913912  }
    914913
  • branches/SHM-dev/source/Lib/TLibCommon/TComChromaFormat.h

    r1259 r1285  
    163163//------------------------------------------------
    164164
    165 static inline Int getTransformShift(const ChannelType type, const UInt uiLog2TrSize)
     165static inline Int getTransformShift(const ChannelType type, const UInt uiLog2TrSize, const Int maxLog2TrDynamicRange)
    166166{
    167167#if O0043_BEST_EFFORT_DECODING
    168   return g_maxTrDynamicRange[type] - g_bitDepthInStream[type] - uiLog2TrSize;
     168  return maxLog2TrDynamicRange - g_bitDepthInStream[type] - uiLog2TrSize;
    169169#else
    170   return g_maxTrDynamicRange[type] - g_bitDepth[type] - uiLog2TrSize;
     170  return maxLog2TrDynamicRange - g_bitDepth[type] - uiLog2TrSize;
    171171#endif
    172172}
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp

    r1284 r1285  
    322322  }
    323323}
    324 
    325 Int g_maxTrDynamicRange[MAX_NUM_CHANNEL_TYPE];
    326324
    327325Int g_quantScales[SCALING_LIST_REM_NUM] =
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.h

    r1284 r1285  
    9797#define SCALE_BITS                 15 // Inherited from TMuC, pressumably for fractional bit estimates in RDOQ
    9898
    99 extern Int g_maxTrDynamicRange[MAX_NUM_CHANNEL_TYPE];
    100 
    10199#define SQRT2                      11585
    102100#define SQRT2_SHIFT                13
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1273 r1285  
    14801480  Int                    getBitDepth(ChannelType type) const                                             { return m_uiBitDepth[type];                                           }
    14811481  Void                   setBitDepth(ChannelType type, Int u )                                           { m_uiBitDepth[type] = u;                                              }
     1482  Int                    getMaxLog2TrDynamicRange(ChannelType channelType) const                         { return getUseExtendedPrecision() ? std::max<Int>(15, Int(m_uiBitDepth[channelType] + 6)) : 15; }
     1483
    14821484  Int                    getDifferentialLumaChromaBitDepth() const                                       { return Int(m_uiBitDepth[CHANNEL_TYPE_LUMA]) - Int(m_uiBitDepth[CHANNEL_TYPE_CHROMA]); }
    14831485  Int                    getQpBDOffset(ChannelType type) const                                           { return m_qpBDOffset[type];                                           }
  • branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp

    r1283 r1285  
    242242 *  \param uiMode is Intra Prediction mode used in Mode-Dependent DCT/DST only
    243243 */
    244 Void xTr(Int bitDepth, Pel *block, TCoeff *coeff, UInt uiStride, UInt uiTrSize, Bool useDST, const Int maxTrDynamicRange)
     244Void xTr(Int bitDepth, Pel *block, TCoeff *coeff, UInt uiStride, UInt uiTrSize, Bool useDST, const Int maxLog2TrDynamicRange)
    245245{
    246246  UInt i,j,k;
     
    273273  static const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_FORWARD];
    274274
    275   const Int shift_1st = (uiLog2TrSize +  bitDepth + TRANSFORM_MATRIX_SHIFT) - maxTrDynamicRange;
     275  const Int shift_1st = (uiLog2TrSize +  bitDepth + TRANSFORM_MATRIX_SHIFT) - maxLog2TrDynamicRange;
    276276  const Int shift_2nd = uiLog2TrSize + TRANSFORM_MATRIX_SHIFT;
    277277  const Int add_1st = (shift_1st>0) ? (1<<(shift_1st-1)) : 0;
     
    315315 *  \param uiMode is Intra Prediction mode used in Mode-Dependent DCT/DST only
    316316 */
    317 Void xITr(Int bitDepth, TCoeff *coeff, Pel *block, UInt uiStride, UInt uiTrSize, Bool useDST, const Int maxTrDynamicRange)
     317Void xITr(Int bitDepth, TCoeff *coeff, Pel *block, UInt uiStride, UInt uiTrSize, Bool useDST, const Int maxLog2TrDynamicRange)
    318318{
    319319  UInt i,j,k;
     
    346346
    347347  const Int shift_1st = TRANSFORM_MATRIX_SHIFT + 1; //1 has been added to shift_1st at the expense of shift_2nd
    348   const Int shift_2nd = (TRANSFORM_MATRIX_SHIFT + maxTrDynamicRange - 1) - bitDepth;
    349   const TCoeff clipMinimum = -(1 << maxTrDynamicRange);
    350   const TCoeff clipMaximum =  (1 << maxTrDynamicRange) - 1;
     348  const Int shift_2nd = (TRANSFORM_MATRIX_SHIFT + maxLog2TrDynamicRange - 1) - bitDepth;
     349  const TCoeff clipMinimum = -(1 << maxLog2TrDynamicRange);
     350  const TCoeff clipMaximum =  (1 << maxLog2TrDynamicRange) - 1;
    351351  assert(shift_2nd>=0);
    352352  const Int add_1st = 1<<(shift_1st-1);
     
    857857
    858858/** MxN forward transform (2D)
    859 *  \param bitDepth          [in]  bit depth
    860 *  \param block             [in]  residual block
    861 *  \param coeff             [out] transform coefficients
    862 *  \param iWidth            [in]  width of transform
    863 *  \param iHeight           [in]  height of transform
    864 *  \param useDST            [in]
    865 *  \param maxTrDynamicRange [in]
     859*  \param bitDepth              [in]  bit depth
     860*  \param block                 [in]  residual block
     861*  \param coeff                 [out] transform coefficients
     862*  \param iWidth                [in]  width of transform
     863*  \param iHeight               [in]  height of transform
     864*  \param useDST                [in]
     865*  \param maxLog2TrDynamicRange [in]
    866866
    867867*/
    868 Void xTrMxN(Int bitDepth, TCoeff *block, TCoeff *coeff, Int iWidth, Int iHeight, Bool useDST, const Int maxTrDynamicRange)
     868Void xTrMxN(Int bitDepth, TCoeff *block, TCoeff *coeff, Int iWidth, Int iHeight, Bool useDST, const Int maxLog2TrDynamicRange)
    869869{
    870870  static const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_FORWARD];
    871871
    872   const Int shift_1st = ((g_aucConvertToBit[iWidth] + 2) +  bitDepth + TRANSFORM_MATRIX_SHIFT) - maxTrDynamicRange;
     872  const Int shift_1st = ((g_aucConvertToBit[iWidth] + 2) +  bitDepth + TRANSFORM_MATRIX_SHIFT) - maxLog2TrDynamicRange;
    873873  const Int shift_2nd = (g_aucConvertToBit[iHeight] + 2) + TRANSFORM_MATRIX_SHIFT;
    874874
     
    925925
    926926/** MxN inverse transform (2D)
    927 *  \param bitDepth          [in]  bit depth
    928 *  \param coeff             [in]  transform coefficients
    929 *  \param block             [out] residual block
    930 *  \param iWidth            [in]  width of transform
    931 *  \param iHeight           [in]  height of transform
    932 *  \param useDST            [in]
    933 *  \param maxTrDynamicRange [in]
     927*  \param bitDepth              [in]  bit depth
     928*  \param coeff                 [in]  transform coefficients
     929*  \param block                 [out] residual block
     930*  \param iWidth                [in]  width of transform
     931*  \param iHeight               [in]  height of transform
     932*  \param useDST                [in]
     933*  \param maxLog2TrDynamicRange [in]
    934934*/
    935 Void xITrMxN(Int bitDepth, TCoeff *coeff, TCoeff *block, Int iWidth, Int iHeight, Bool useDST, const Int maxTrDynamicRange)
     935Void xITrMxN(Int bitDepth, TCoeff *coeff, TCoeff *block, Int iWidth, Int iHeight, Bool useDST, const Int maxLog2TrDynamicRange)
    936936{
    937937  static const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_INVERSE];
    938938
    939939  Int shift_1st = TRANSFORM_MATRIX_SHIFT + 1; //1 has been added to shift_1st at the expense of shift_2nd
    940   Int shift_2nd = (TRANSFORM_MATRIX_SHIFT + maxTrDynamicRange - 1) - bitDepth;
    941   const TCoeff clipMinimum = -(1 << maxTrDynamicRange);
    942   const TCoeff clipMaximum =  (1 << maxTrDynamicRange) - 1;
     940  Int shift_2nd = (TRANSFORM_MATRIX_SHIFT + maxLog2TrDynamicRange - 1) - bitDepth;
     941  const TCoeff clipMinimum = -(1 << maxLog2TrDynamicRange);
     942  const TCoeff clipMaximum =  (1 << maxLog2TrDynamicRange) - 1;
    943943
    944944  assert(shift_1st >= 0);
     
    997997
    998998// To minimize the distortion only. No rate is considered.
    999 Void TComTrQuant::signBitHidingHDQ( const ComponentID compID, TCoeff* pQCoef, TCoeff* pCoef, TCoeff* deltaU, const TUEntropyCodingParameters &codingParameters )
     999Void TComTrQuant::signBitHidingHDQ( const ComponentID compID, TCoeff* pQCoef, TCoeff* pCoef, TCoeff* deltaU, const TUEntropyCodingParameters &codingParameters, const Int maxLog2TrDynamicRange )
    10001000{
    10011001  const UInt width     = codingParameters.widthInGroups  << MLS_CG_LOG2_WIDTH;
     
    10031003  const UInt groupSize = 1 << MLS_CG_SIZE;
    10041004
    1005   const TCoeff entropyCodingMinimum = -(1 << g_maxTrDynamicRange[toChannelType(compID)]);
    1006   const TCoeff entropyCodingMaximum =  (1 << g_maxTrDynamicRange[toChannelType(compID)]) - 1;
     1005  const TCoeff entropyCodingMinimum = -(1 << maxLog2TrDynamicRange);
     1006  const TCoeff entropyCodingMaximum =  (1 << maxLog2TrDynamicRange) - 1;
    10071007
    10081008  Int lastCG = -1;
     
    11541154#endif
    11551155
    1156   const Bool useTransformSkip = pcCU->getTransformSkip(uiAbsPartIdx, compID);
     1156  const Bool useTransformSkip      = pcCU->getTransformSkip(uiAbsPartIdx, compID);
     1157  const Int  maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID));
    11571158
    11581159  Bool useRDOQ = useTransformSkip ? m_useRDOQTS : m_useRDOQ;
     
    11701171    getTUEntropyCodingParameters(codingParameters, rTu, compID);
    11711172
    1172     const TCoeff entropyCodingMinimum = -(1 << g_maxTrDynamicRange[toChannelType(compID)]);
    1173     const TCoeff entropyCodingMaximum =  (1 << g_maxTrDynamicRange[toChannelType(compID)]) - 1;
     1173    const TCoeff entropyCodingMinimum = -(1 << maxLog2TrDynamicRange);
     1174    const TCoeff entropyCodingMaximum =  (1 << maxLog2TrDynamicRange) - 1;
    11741175
    11751176    TCoeff deltaU[MAX_TU_SIZE * MAX_TU_SIZE];
     
    11911192
    11921193    // Represents scaling through forward transform
    1193     Int iTransformShift = getTransformShift(toChannelType(compID), uiLog2TrSize);
     1194    Int iTransformShift = getTransformShift(toChannelType(compID), uiLog2TrSize, maxLog2TrDynamicRange);
    11941195    if (useTransformSkip && pcCU->getSlice()->getSPS()->getUseExtendedPrecision())
    11951196    {
     
    12411242      if(uiAbsSum >= 2) //this prevents TUs with only one coefficient of value 1 from being tested
    12421243      {
    1243         signBitHidingHDQ( compID, piQCoef, piCoef, deltaU, codingParameters ) ;
     1244        signBitHidingHDQ( compID, piQCoef, piCoef, deltaU, codingParameters, maxLog2TrDynamicRange ) ;
    12441245      }
    12451246    }
     
    12651266  const UInt                 uiLog2TrSize       = rTu.GetEquivalentLog2TrSize(compID);
    12661267  const UInt                 numSamplesInBlock  = uiWidth*uiHeight;
    1267   const TCoeff               transformMinimum   = -(1 << g_maxTrDynamicRange[toChannelType(compID)]);
    1268   const TCoeff               transformMaximum   =  (1 << g_maxTrDynamicRange[toChannelType(compID)]) - 1;
     1268  const Int                  maxLog2TrDynamicRange  = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID));
     1269  const TCoeff               transformMinimum   = -(1 << maxLog2TrDynamicRange);
     1270  const TCoeff               transformMaximum   =  (1 << maxLog2TrDynamicRange) - 1;
    12691271  const Bool                 enableScalingLists = getUseScalingList(uiWidth, uiHeight, (pcCU->getTransformSkip(uiAbsPartIdx, compID) != 0));
    12701272  const Int                  scalingListType    = getScalingListType(pcCU->getPredictionMode(uiAbsPartIdx), compID);
     
    12751277  // Represents scaling through forward transform
    12761278  const Bool bClipTransformShiftTo0 = (pcCU->getTransformSkip(uiAbsPartIdx, compID) != 0) && pcCU->getSlice()->getSPS()->getUseExtendedPrecision();
    1277   const Int  originalTransformShift = getTransformShift(toChannelType(compID), uiLog2TrSize);
     1279  const Int  originalTransformShift = getTransformShift(toChannelType(compID), uiLog2TrSize, maxLog2TrDynamicRange);
    12781280  const Int  iTransformShift        = bClipTransformShiftTo0 ? std::max<Int>(0, originalTransformShift) : originalTransformShift;
    12791281
     
    12891291    //(sizeof(Intermediate_Int) * 8)  =              inputBitDepth    +    dequantCoefBits                   - rightShift
    12901292    const UInt             dequantCoefBits     = 1 + IQUANT_SHIFT + SCALING_LIST_BITS;
    1291     const UInt             targetInputBitDepth = std::min<UInt>((g_maxTrDynamicRange[toChannelType(compID)] + 1), (((sizeof(Intermediate_Int) * 8) + rightShift) - dequantCoefBits));
     1293    const UInt             targetInputBitDepth = std::min<UInt>((maxLog2TrDynamicRange + 1), (((sizeof(Intermediate_Int) * 8) + rightShift) - dequantCoefBits));
    12921294
    12931295    const Intermediate_Int inputMinimum        = -(1 << (targetInputBitDepth - 1));
     
    13291331    //iCoeffQ                         = Intermediate_Int((Int64(clipQCoef) * scale + iAdd) >> rightShift);
    13301332    //(sizeof(Intermediate_Int) * 8)  =                    inputBitDepth   + scaleBits      - rightShift
    1331     const UInt             targetInputBitDepth = std::min<UInt>((g_maxTrDynamicRange[toChannelType(compID)] + 1), (((sizeof(Intermediate_Int) * 8) + rightShift) - scaleBits));
     1333    const UInt             targetInputBitDepth = std::min<UInt>((maxLog2TrDynamicRange + 1), (((sizeof(Intermediate_Int) * 8) + rightShift) - scaleBits));
    13321334    const Intermediate_Int inputMinimum        = -(1 << (targetInputBitDepth - 1));
    13331335    const Intermediate_Int inputMaximum        =  (1 << (targetInputBitDepth - 1)) - 1;
     
    14411443      else
    14421444      {
    1443         xT( compID, rTu.useDST(compID), pcResidual, uiStride, m_plTempCoeff, uiWidth, uiHeight );
     1445        xT( compID, rTu.useDST(compID), pcResidual, uiStride, m_plTempCoeff, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)) );
    14441446      }
    14451447
     
    15711573    else
    15721574    {
    1573       xIT( compID, rTu.useDST(compID), m_plTempCoeff, pcResidual, uiStride, uiWidth, uiHeight );
     1575      xIT( compID, rTu.useDST(compID), m_plTempCoeff, pcResidual, uiStride, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)) );
    15741576
    15751577#if defined DEBUG_STRING
     
    18631865 *  \param iHeight transform height
    18641866 */
    1865 Void TComTrQuant::xT( const ComponentID compID, Bool useDST, Pel* piBlkResi, UInt uiStride, TCoeff* psCoeff, Int iWidth, Int iHeight )
     1867Void TComTrQuant::xT( const ComponentID compID, Bool useDST, Pel* piBlkResi, UInt uiStride, TCoeff* psCoeff, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange )
    18661868{
    18671869#if MATRIX_MULT
    18681870  if( iWidth == iHeight)
    18691871  {
    1870     xTr(g_bitDepth[toChannelType(compID)], piBlkResi, psCoeff, uiStride, (UInt)iWidth, useDST, g_maxTrDynamicRange[toChannelType(compID)]);
     1872    xTr(g_bitDepth[toChannelType(compID)], piBlkResi, psCoeff, uiStride, (UInt)iWidth, useDST, maxLog2TrDynamicRange);
    18711873    return;
    18721874  }
     
    18841886  }
    18851887
    1886   xTrMxN( g_bitDepth[toChannelType(compID)], block, coeff, iWidth, iHeight, useDST, g_maxTrDynamicRange[toChannelType(compID)] );
     1888  xTrMxN( g_bitDepth[toChannelType(compID)], block, coeff, iWidth, iHeight, useDST, maxLog2TrDynamicRange );
    18871889
    18881890  memcpy(psCoeff, coeff, (iWidth * iHeight * sizeof(TCoeff)));
     
    18981900 *  \param iHeight transform height
    18991901 */
    1900 Void TComTrQuant::xIT( const ComponentID compID, Bool useDST, TCoeff* plCoef, Pel* pResidual, UInt uiStride, Int iWidth, Int iHeight )
     1902Void TComTrQuant::xIT( const ComponentID compID, Bool useDST, TCoeff* plCoef, Pel* pResidual, UInt uiStride, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange )
    19011903{
    19021904#if MATRIX_MULT
     
    19041906  {
    19051907#if O0043_BEST_EFFORT_DECODING
    1906     xITr(g_bitDepthInStream[toChannelType(compID)], plCoef, pResidual, uiStride, (UInt)iWidth, useDST, g_maxTrDynamicRange[toChannelType(compID)]);
     1908    xITr(g_bitDepthInStream[toChannelType(compID)], plCoef, pResidual, uiStride, (UInt)iWidth, useDST, maxLog2TrDynamicRange);
    19071909#else
    1908     xITr(g_bitDepth[toChannelType(compID)], plCoef, pResidual, uiStride, (UInt)iWidth, useDST, g_maxTrDynamicRange[toChannelType(compID)]);
     1910    xITr(g_bitDepth[toChannelType(compID)], plCoef, pResidual, uiStride, (UInt)iWidth, useDST, maxLog2TrDynamicRange);
    19091911#endif
    19101912    return;
     
    19181920
    19191921#if O0043_BEST_EFFORT_DECODING
    1920   xITrMxN( g_bitDepthInStream[toChannelType(compID)], coeff, block, iWidth, iHeight, useDST, g_maxTrDynamicRange[toChannelType(compID)] );
     1922  xITrMxN( g_bitDepthInStream[toChannelType(compID)], coeff, block, iWidth, iHeight, useDST, maxLog2TrDynamicRange );
    19211923#else
    1922   xITrMxN( g_bitDepth[toChannelType(compID)], coeff, block, iWidth, iHeight, useDST, g_maxTrDynamicRange[toChannelType(compID)] );
     1924  xITrMxN( g_bitDepth[toChannelType(compID)], coeff, block, iWidth, iHeight, useDST, maxLog2TrDynamicRange );
    19231925#endif
    19241926
     
    19441946  const Int width           = rect.width;
    19451947  const Int height          = rect.height;
    1946 
    1947   Int iTransformShift = getTransformShift(toChannelType(component), rTu.GetEquivalentLog2TrSize(component));
     1948  const Int maxLog2TrDynamicRange = rTu.getCU()->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(component));
     1949
     1950  Int iTransformShift = getTransformShift(toChannelType(component), rTu.GetEquivalentLog2TrSize(component), maxLog2TrDynamicRange);
    19481951  if (rTu.getCU()->getSlice()->getSPS()->getUseExtendedPrecision())
    19491952  {
     
    19911994  const Int width           = rect.width;
    19921995  const Int height          = rect.height;
    1993 
    1994   Int iTransformShift = getTransformShift(toChannelType(component), rTu.GetEquivalentLog2TrSize(component));
     1996  const Int maxLog2TrDynamicRange = rTu.getCU()->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(component));
     1997
     1998  Int iTransformShift = getTransformShift(toChannelType(component), rTu.GetEquivalentLog2TrSize(component), maxLog2TrDynamicRange);
    19951999  if (rTu.getCU()->getSlice()->getSPS()->getUseExtendedPrecision())
    19962000  {
     
    20582062
    20592063  const Bool             extendedPrecision = pcCU->getSlice()->getSPS()->getUseExtendedPrecision();
     2064  const Int              maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID));
    20602065
    20612066  /* for 422 chroma blocks, the effective scaling applied during transformation is not a power of 2, hence it cannot be
     
    20662071
    20672072  // Represents scaling through forward transform
    2068   Int iTransformShift            = getTransformShift(channelType, uiLog2TrSize);
     2073  Int iTransformShift            = getTransformShift(channelType, uiLog2TrSize, maxLog2TrDynamicRange);
    20692074  if ((pcCU->getTransformSkip(uiAbsPartIdx, compID) != 0) && pcCU->getSlice()->getSPS()->getUseExtendedPrecision())
    20702075  {
     
    21102115  const Double defaultErrorScale              = getErrScaleCoeffNoScalingList(scalingListType, (uiLog2TrSize-2), cQP.rem);
    21112116
    2112   const TCoeff entropyCodingMinimum = -(1 << g_maxTrDynamicRange[toChannelType(compID)]);
    2113   const TCoeff entropyCodingMaximum =  (1 << g_maxTrDynamicRange[toChannelType(compID)]) - 1;
     2117  const TCoeff entropyCodingMinimum = -(1 << maxLog2TrDynamicRange);
     2118  const TCoeff entropyCodingMaximum =  (1 << maxLog2TrDynamicRange) - 1;
    21142119
    21152120#if ADAPTIVE_QP_SELECTION
     
    28132818 * \returns cost of given absolute transform level
    28142819 */
    2815 __inline Int TComTrQuant::xGetICRate         ( UInt                            uiAbsLevel,
    2816                                                UShort                          ui16CtxNumOne,
    2817                                                UShort                          ui16CtxNumAbs,
    2818                                                UShort                          ui16AbsGoRice,
    2819                                                UInt                            c1Idx,
    2820                                                UInt                            c2Idx,
    2821                                                Bool                            useLimitedPrefixLength,
    2822                                                ChannelType                     channelType
     2820__inline Int TComTrQuant::xGetICRate         ( const UInt    uiAbsLevel,
     2821                                               const UShort  ui16CtxNumOne,
     2822                                               const UShort  ui16CtxNumAbs,
     2823                                               const UShort  ui16AbsGoRice,
     2824                                               const UInt    c1Idx,
     2825                                               const UInt    c2Idx,
     2826                                               const Bool    useLimitedPrefixLength,
     2827                                               const Int     maxLog2TrDynamicRange
    28232828                                               ) const
    28242829{
     
    28372842    else if (useLimitedPrefixLength)
    28382843    {
    2839       const UInt maximumPrefixLength = (32 - (COEF_REMAIN_BIN_REDUCTION + g_maxTrDynamicRange[channelType]));
     2844      const UInt maximumPrefixLength = (32 - (COEF_REMAIN_BIN_REDUCTION + maxLog2TrDynamicRange));
    28402845
    28412846      UInt prefixLength = 0;
     
    28472852      }
    28482853
    2849       const UInt suffixLength = (prefixLength == maximumPrefixLength) ? (g_maxTrDynamicRange[channelType] - ui16AbsGoRice) : (prefixLength + 1/*separator*/);
     2854      const UInt suffixLength = (prefixLength == maximumPrefixLength) ? (maxLog2TrDynamicRange - ui16AbsGoRice) : (prefixLength + 1/*separator*/);
    28502855
    28512856      iRate += (COEF_REMAIN_BIN_REDUCTION + prefixLength + suffixLength + ui16AbsGoRice) << 15;
     
    29812986 * \param format      chroma format
    29822987 */
    2983 Void TComTrQuant::setScalingList(TComScalingList *scalingList, const ChromaFormat format)
     2988Void TComTrQuant::setScalingList(TComScalingList *scalingList, const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE])
    29842989{
    29852990  const Int minimumQp = 0;
     
    29942999        xSetScalingListEnc(scalingList,list,size,qp,format);
    29953000        xSetScalingListDec(*scalingList,list,size,qp,format);
    2996         setErrScaleCoeff(list,size,qp);
     3001        setErrScaleCoeff(list,size,qp,maxLog2TrDynamicRange);
    29973002      }
    29983003    }
     
    30243029 * \param qp   Quantization parameter
    30253030 */
    3026 Void TComTrQuant::setErrScaleCoeff(UInt list, UInt size, Int qp)
     3031Void TComTrQuant::setErrScaleCoeff(UInt list, UInt size, Int qp, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE])
    30273032{
    30283033  const UInt uiLog2TrSize = g_aucConvertToBit[ g_scalingListSizeX[size] ] + 2;
    30293034  const ChannelType channelType = ((list == 0) || (list == MAX_NUM_COMPONENT)) ? CHANNEL_TYPE_LUMA : CHANNEL_TYPE_CHROMA;
    30303035
    3031   const Int iTransformShift = getTransformShift(channelType, uiLog2TrSize);  // Represents scaling through forward transform
     3036  const Int iTransformShift = getTransformShift(channelType, uiLog2TrSize, maxLog2TrDynamicRange[channelType]);  // Represents scaling through forward transform
    30323037
    30333038  UInt i,uiMaxNumCoeff = g_scalingListSize[size];
     
    31033108/** set flat matrix value to quantized coefficient
    31043109 */
    3105 Void TComTrQuant::setFlatScalingList(const ChromaFormat format)
     3110Void TComTrQuant::setFlatScalingList(const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE])
    31063111{
    31073112  const Int minimumQp = 0;
     
    31153120      {
    31163121        xsetFlatScalingList(list,size,qp,format);
    3117         setErrScaleCoeff(list,size,qp);
     3122        setErrScaleCoeff(list,size,qp,maxLog2TrDynamicRange);
    31183123      }
    31193124    }
     
    32503255  const UInt           uiWidth                        = rect.width;
    32513256  const UInt           uiHeight                       = rect.height;
    3252   const Int            iTransformShift                = getTransformShift(toChannelType(compID), rTu.GetEquivalentLog2TrSize(compID));
     3257  const Int            maxLog2TrDynamicRange          = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID));
     3258  const Int            iTransformShift                = getTransformShift(toChannelType(compID), rTu.GetEquivalentLog2TrSize(compID), maxLog2TrDynamicRange);
    32533259  const Int            scalingListType                = getScalingListType(pcCU->getPredictionMode(uiAbsPartIdx), compID);
    32543260  const Bool           enableScalingLists             = getUseScalingList(uiWidth, uiHeight, true);
     
    32933299  const TCoeff quantisedCoefficient = (TCoeff((tmpLevel + iAdd ) >> iQBits)) * iSign;
    32943300
    3295   const TCoeff entropyCodingMinimum = -(1 << g_maxTrDynamicRange[toChannelType(compID)]);
    3296   const TCoeff entropyCodingMaximum =  (1 << g_maxTrDynamicRange[toChannelType(compID)]) - 1;
     3301  const TCoeff entropyCodingMinimum = -(1 << maxLog2TrDynamicRange);
     3302  const TCoeff entropyCodingMaximum =  (1 << maxLog2TrDynamicRange) - 1;
    32973303  pcCoeff[ uiPos ] = Clip3<TCoeff>( entropyCodingMinimum, entropyCodingMaximum, quantisedCoefficient );
    32983304}
     
    33083314  const Int            QP_per             = cQP.per;
    33093315  const Int            QP_rem             = cQP.rem;
    3310   const Int            iTransformShift    = getTransformShift(toChannelType(compID), rTu.GetEquivalentLog2TrSize(compID));
     3316  const Int            maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID));
     3317  const Int            iTransformShift    = getTransformShift(toChannelType(compID), rTu.GetEquivalentLog2TrSize(compID), maxLog2TrDynamicRange);
    33113318  const Int            scalingListType    = getScalingListType(pcCU->getPredictionMode(uiAbsPartIdx), compID);
    33123319  const Bool           enableScalingLists = getUseScalingList(uiWidth, uiHeight, true);
     
    33173324  const Int rightShift = (IQUANT_SHIFT - (iTransformShift + QP_per)) + (enableScalingLists ? LOG2_SCALING_LIST_NEUTRAL_VALUE : 0);
    33183325
    3319   const TCoeff transformMinimum = -(1 << g_maxTrDynamicRange[toChannelType(compID)]);
    3320   const TCoeff transformMaximum =  (1 << g_maxTrDynamicRange[toChannelType(compID)]) - 1;
     3326  const TCoeff transformMinimum = -(1 << maxLog2TrDynamicRange);
     3327  const TCoeff transformMaximum =  (1 << maxLog2TrDynamicRange) - 1;
    33213328
    33223329  // Dequantisation
     
    33273334  {
    33283335    const UInt             dequantCoefBits     = 1 + IQUANT_SHIFT + SCALING_LIST_BITS;
    3329     const UInt             targetInputBitDepth = std::min<UInt>((g_maxTrDynamicRange[toChannelType(compID)] + 1), (((sizeof(Intermediate_Int) * 8) + rightShift) - dequantCoefBits));
     3336    const UInt             targetInputBitDepth = std::min<UInt>((maxLog2TrDynamicRange + 1), (((sizeof(Intermediate_Int) * 8) + rightShift) - dequantCoefBits));
    33303337
    33313338    const Intermediate_Int inputMinimum        = -(1 << (targetInputBitDepth - 1));
     
    33563363    const Int scaleBits =     (IQUANT_SHIFT + 1)   ;
    33573364
    3358     const UInt             targetInputBitDepth = std::min<UInt>((g_maxTrDynamicRange[toChannelType(compID)] + 1), (((sizeof(Intermediate_Int) * 8) + rightShift) - scaleBits));
     3365    const UInt             targetInputBitDepth = std::min<UInt>((maxLog2TrDynamicRange + 1), (((sizeof(Intermediate_Int) * 8) + rightShift) - scaleBits));
    33593366    const Intermediate_Int inputMinimum        = -(1 << (targetInputBitDepth - 1));
    33603367    const Intermediate_Int inputMaximum        =  (1 << (targetInputBitDepth - 1)) - 1;
  • branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.h

    r1259 r1285  
    172172  Void initScalingList                      ();
    173173  Void destroyScalingList                   ();
    174   Void setErrScaleCoeff    ( UInt list, UInt size, Int qp );
     174  Void setErrScaleCoeff    ( UInt list, UInt size, Int qp, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE] );
    175175  Double* getErrScaleCoeff              ( UInt list, UInt size, Int qp ) { return m_errScale             [size][list][qp]; };  //!< get Error Scale Coefficent
    176176  Double& getErrScaleCoeffNoScalingList ( UInt list, UInt size, Int qp ) { return m_errScaleNoScalingList[size][list][qp]; };  //!< get Error Scale Coefficent
     
    179179  Void setUseScalingList   ( Bool bUseScalingList){ m_scalingListEnabledFlag = bUseScalingList; };
    180180  Bool getUseScalingList   (const UInt width, const UInt height, const Bool isTransformSkip){ return m_scalingListEnabledFlag && (!isTransformSkip || ((width == 4) && (height == 4))); };
    181   Void setFlatScalingList  (const ChromaFormat format);
     181  Void setFlatScalingList  (const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE]);
    182182  Void xsetFlatScalingList ( UInt list, UInt size, Int qp, const ChromaFormat format);
    183183  Void xSetScalingListEnc  ( TComScalingList *scalingList, UInt list, UInt size, Int qp, const ChromaFormat format);
    184184  Void xSetScalingListDec  ( const TComScalingList &scalingList, UInt list, UInt size, Int qp, const ChromaFormat format);
    185   Void setScalingList      ( TComScalingList *scalingList, const ChromaFormat format);
     185  Void setScalingList      ( TComScalingList *scalingList, const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE]);
    186186  Void setScalingListDec   ( const TComScalingList &scalingList, const ChromaFormat format);
    187187  Void processScalingListEnc( Int *coeff, Int *quantcoeff, Int quantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc);
     
    230230private:
    231231  // forward Transform
    232   Void xT   ( const ComponentID compID, Bool useDST, Pel* piBlkResi, UInt uiStride, TCoeff* psCoeff, Int iWidth, Int iHeight );
     232  Void xT   ( const ComponentID compID, Bool useDST, Pel* piBlkResi, UInt uiStride, TCoeff* psCoeff, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange );
    233233
    234234  // skipping Transform
    235235  Void xTransformSkip ( Pel* piBlkResi, UInt uiStride, TCoeff* psCoeff, TComTU &rTu, const ComponentID component );
    236236
    237   Void signBitHidingHDQ( const ComponentID compID, TCoeff* pQCoef, TCoeff* pCoef, TCoeff* deltaU, const TUEntropyCodingParameters &codingParameters );
     237  Void signBitHidingHDQ( const ComponentID compID, TCoeff* pQCoef, TCoeff* pCoef, TCoeff* deltaU, const TUEntropyCodingParameters &codingParameters, const Int maxLog2TrDynamicRange );
    238238
    239239  // quantization
     
    279279
    280280
    281   __inline Int xGetICRate  ( UInt   uiAbsLevel,
    282                              UShort ui16CtxNumOne,
    283                              UShort ui16CtxNumAbs,
    284                              UShort ui16AbsGoRice,
    285                              UInt   c1Idx,
    286                              UInt   c2Idx,
    287                              Bool   useLimitedPrefixLength,
    288                              ChannelType channelType
     281  __inline Int xGetICRate  ( const UInt   uiAbsLevel,
     282                             const UShort ui16CtxNumOne,
     283                             const UShort ui16CtxNumAbs,
     284                             const UShort ui16AbsGoRice,
     285                             const UInt   c1Idx,
     286                             const UInt   c2Idx,
     287                             const Bool   useLimitedPrefixLength,
     288                             const Int maxLog2TrDynamicRange
    289289                           ) const;
    290290
     
    304304
    305305  // inverse transform
    306   Void xIT    ( const ComponentID compID, Bool useDST, TCoeff* plCoef, Pel* pResidual, UInt uiStride, Int iWidth, Int iHeight );
     306  Void xIT    ( const ComponentID compID, Bool useDST, TCoeff* plCoef, Pel* pResidual, UInt uiStride, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange );
    307307
    308308  // inverse skipping transform
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp

    r1262 r1285  
    299299 */
    300300#if RExt__DECODER_DEBUG_BIT_STATISTICS
    301 Void TDecSbac::xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const ChannelType channelType, const class TComCodingStatisticsClassType &whichStat )
     301Void TDecSbac::xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange, const class TComCodingStatisticsClassType &whichStat )
    302302#else
    303 Void TDecSbac::xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const ChannelType channelType )
     303Void TDecSbac::xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange )
    304304#endif
    305305{
     
    309309  if (useLimitedPrefixLength)
    310310  {
    311     const UInt longestPossiblePrefix = (32 - (COEF_REMAIN_BIN_REDUCTION + g_maxTrDynamicRange[channelType])) + COEF_REMAIN_BIN_REDUCTION;
     311    const UInt longestPossiblePrefix = (32 - (COEF_REMAIN_BIN_REDUCTION + maxLog2TrDynamicRange)) + COEF_REMAIN_BIN_REDUCTION;
    312312
    313313    do
     
    337337  else if (useLimitedPrefixLength)
    338338  {
    339     const UInt maximumPrefixLength = (32 - (COEF_REMAIN_BIN_REDUCTION + g_maxTrDynamicRange[channelType]));
     339    const UInt maximumPrefixLength = (32 - (COEF_REMAIN_BIN_REDUCTION + maxLog2TrDynamicRange));
    340340
    341341    const UInt prefixLength = prefix - COEF_REMAIN_BIN_REDUCTION;
    342     const UInt suffixLength = (prefixLength == maximumPrefixLength) ? (g_maxTrDynamicRange[channelType] - rParam) : prefixLength;
     342    const UInt suffixLength = (prefixLength == maximumPrefixLength) ? (maxLog2TrDynamicRange - rParam) : prefixLength;
    343343
    344344    m_pcTDecBinIf->decodeBinsEP(codeWord, (suffixLength + rParam) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat));
     
    12831283
    12841284  const Bool         alignCABACBeforeBypass = pcCU->getSlice()->getSPS()->getAlignCABACBeforeBypass();
     1285  const Int          maxLog2TrDynamicRange  = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(channelType);
    12851286
    12861287#if RExt__DECODER_DEBUG_BIT_STATISTICS
     
    15461547          {
    15471548            UInt uiLevel;
    1548             xReadCoefRemainExGolomb( uiLevel, uiGoRiceParam, extendedPrecision, channelType RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype_escs) );
     1549            xReadCoefRemainExGolomb( uiLevel, uiGoRiceParam, extendedPrecision, maxLog2TrDynamicRange RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype_escs) );
    15491550
    15501551            absCoeff[ idx ] = uiLevel + baseLevel;
     
    17721773        for(Int i=0; i< 4; i++)
    17731774        {
    1774 #if SVC_EXTENSION
    1775           parseSaoMaxUvlc(uiSymbol,  saoMaxOffsetQVal[compIdx] ); //sao_offset_abs
    1776 #else
    17771775#if O0043_BEST_EFFORT_DECODING
    17781776          Int saoMaxOffsetQVal = (1<<(min(bitDepthOrig, MAX_SAO_TRUNCATED_BITDEPTH)-5))-1;
    17791777          parseSaoMaxUvlc(uiSymbol, saoMaxOffsetQVal); //sao_offset_abs
     1778#else
     1779#if SVC_EXTENSION
     1780          parseSaoMaxUvlc(uiSymbol,  saoMaxOffsetQVal[compIdx] ); //sao_offset_abs
    17801781#else
    17811782          parseSaoMaxUvlc(uiSymbol,  g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.h

    r1259 r1285  
    106106  Void  xReadUnaryMaxSymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset, UInt uiMaxSymbol, const class TComCodingStatisticsClassType &whichStat );
    107107  Void  xReadEpExGolomb     ( UInt& ruiSymbol, UInt uiCount, const class TComCodingStatisticsClassType &whichStat );
    108   Void  xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const ChannelType channelType, const class TComCodingStatisticsClassType &whichStat );
     108  Void  xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange, const class TComCodingStatisticsClassType &whichStat );
    109109#else
    110110  Void  xReadUnarySymbol    ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset );
    111111  Void  xReadUnaryMaxSymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset, UInt uiMaxSymbol );
    112112  Void  xReadEpExGolomb     ( UInt& ruiSymbol, UInt uiCount );
    113   Void  xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const ChannelType channelType );
     113  Void  xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange );
    114114#endif
    115115private:
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1282 r1285  
    583583#else
    584584      g_bitDepth[channel] = sps->getBitDepth(ChannelType(channel));
    585 #endif
    586       g_maxTrDynamicRange[channel] = (sps->getUseExtendedPrecision()) ? std::max<Int>(15, (g_bitDepth[channel] + 6)) : 15;
     585#endif     
    587586    }
    588587    g_uiMaxCUWidth  = sps->getMaxCUWidth();
     
    17991798  else
    18001799  {
    1801 #if SVC_EXTENSION
    1802     m_cTrQuant.setFlatScalingList(pcSlice->getChromaFormatIdc());
     1800    const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE] =
     1801    {
     1802        pcSlice->getSPS()->getMaxLog2TrDynamicRange(CHANNEL_TYPE_LUMA),
     1803        pcSlice->getSPS()->getMaxLog2TrDynamicRange(CHANNEL_TYPE_CHROMA)
     1804    };
     1805#if SVC_EXTENSION
     1806    m_cTrQuant.setFlatScalingList(pcSlice->getChromaFormatIdc(), maxLog2TrDynamicRange);
    18031807#else
    1804     m_cTrQuant.setFlatScalingList(pcSlice->getSPS()->getChromaFormatIdc());
     1808    m_cTrQuant.setFlatScalingList(pcSlice->getSPS()->getChromaFormatIdc(), maxLog2TrDynamicRange);
    18051809#endif
    18061810    m_cTrQuant.setUseScalingList(false);
  • 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.