Changeset 1285 in SHVCSoftware
- Timestamp:
- 17 Jul 2015, 00:55:34 (10 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1284 r1285 4280 4280 // compute actual CU depth with respect to config depth and max transform size 4281 4281 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 } 4283 4286 4284 4287 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. … … 4313 4316 g_bitDepth [channelType] = m_internalBitDepth[channelType]; 4314 4317 #endif 4315 g_maxTrDynamicRange[channelType] = m_useExtendedPrecision? std::max<Int>(15, (g_bitDepth[channelType] + 6)) : 15; 4316 } 4317 4318 } 4318 4319 } 4319 4320 #endif -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1284 r1285 910 910 //#endif 911 911 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;913 912 } 914 913 -
branches/SHM-dev/source/Lib/TLibCommon/TComChromaFormat.h
r1259 r1285 163 163 //------------------------------------------------ 164 164 165 static inline Int getTransformShift(const ChannelType type, const UInt uiLog2TrSize )165 static inline Int getTransformShift(const ChannelType type, const UInt uiLog2TrSize, const Int maxLog2TrDynamicRange) 166 166 { 167 167 #if O0043_BEST_EFFORT_DECODING 168 return g_maxTrDynamicRange[type]- g_bitDepthInStream[type] - uiLog2TrSize;168 return maxLog2TrDynamicRange - g_bitDepthInStream[type] - uiLog2TrSize; 169 169 #else 170 return g_maxTrDynamicRange[type]- g_bitDepth[type] - uiLog2TrSize;170 return maxLog2TrDynamicRange - g_bitDepth[type] - uiLog2TrSize; 171 171 #endif 172 172 } -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp
r1284 r1285 322 322 } 323 323 } 324 325 Int g_maxTrDynamicRange[MAX_NUM_CHANNEL_TYPE];326 324 327 325 Int g_quantScales[SCALING_LIST_REM_NUM] = -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.h
r1284 r1285 97 97 #define SCALE_BITS 15 // Inherited from TMuC, pressumably for fractional bit estimates in RDOQ 98 98 99 extern Int g_maxTrDynamicRange[MAX_NUM_CHANNEL_TYPE];100 101 99 #define SQRT2 11585 102 100 #define SQRT2_SHIFT 13 -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1273 r1285 1480 1480 Int getBitDepth(ChannelType type) const { return m_uiBitDepth[type]; } 1481 1481 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 1482 1484 Int getDifferentialLumaChromaBitDepth() const { return Int(m_uiBitDepth[CHANNEL_TYPE_LUMA]) - Int(m_uiBitDepth[CHANNEL_TYPE_CHROMA]); } 1483 1485 Int getQpBDOffset(ChannelType type) const { return m_qpBDOffset[type]; } -
branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp
r1283 r1285 242 242 * \param uiMode is Intra Prediction mode used in Mode-Dependent DCT/DST only 243 243 */ 244 Void xTr(Int bitDepth, Pel *block, TCoeff *coeff, UInt uiStride, UInt uiTrSize, Bool useDST, const Int max TrDynamicRange)244 Void xTr(Int bitDepth, Pel *block, TCoeff *coeff, UInt uiStride, UInt uiTrSize, Bool useDST, const Int maxLog2TrDynamicRange) 245 245 { 246 246 UInt i,j,k; … … 273 273 static const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_FORWARD]; 274 274 275 const Int shift_1st = (uiLog2TrSize + bitDepth + TRANSFORM_MATRIX_SHIFT) - max TrDynamicRange;275 const Int shift_1st = (uiLog2TrSize + bitDepth + TRANSFORM_MATRIX_SHIFT) - maxLog2TrDynamicRange; 276 276 const Int shift_2nd = uiLog2TrSize + TRANSFORM_MATRIX_SHIFT; 277 277 const Int add_1st = (shift_1st>0) ? (1<<(shift_1st-1)) : 0; … … 315 315 * \param uiMode is Intra Prediction mode used in Mode-Dependent DCT/DST only 316 316 */ 317 Void xITr(Int bitDepth, TCoeff *coeff, Pel *block, UInt uiStride, UInt uiTrSize, Bool useDST, const Int max TrDynamicRange)317 Void xITr(Int bitDepth, TCoeff *coeff, Pel *block, UInt uiStride, UInt uiTrSize, Bool useDST, const Int maxLog2TrDynamicRange) 318 318 { 319 319 UInt i,j,k; … … 346 346 347 347 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 + max TrDynamicRange - 1) - bitDepth;349 const TCoeff clipMinimum = -(1 << max TrDynamicRange);350 const TCoeff clipMaximum = (1 << max TrDynamicRange) - 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; 351 351 assert(shift_2nd>=0); 352 352 const Int add_1st = 1<<(shift_1st-1); … … 857 857 858 858 /** MxN forward transform (2D) 859 * \param bitDepth [in] bit depth860 * \param block [in] residual block861 * \param coeff [out] transform coefficients862 * \param iWidth [in] width of transform863 * \param iHeight [in] height of transform864 * \param useDST [in]865 * \param max TrDynamicRange [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] 866 866 867 867 */ 868 Void xTrMxN(Int bitDepth, TCoeff *block, TCoeff *coeff, Int iWidth, Int iHeight, Bool useDST, const Int max TrDynamicRange)868 Void xTrMxN(Int bitDepth, TCoeff *block, TCoeff *coeff, Int iWidth, Int iHeight, Bool useDST, const Int maxLog2TrDynamicRange) 869 869 { 870 870 static const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_FORWARD]; 871 871 872 const Int shift_1st = ((g_aucConvertToBit[iWidth] + 2) + bitDepth + TRANSFORM_MATRIX_SHIFT) - max TrDynamicRange;872 const Int shift_1st = ((g_aucConvertToBit[iWidth] + 2) + bitDepth + TRANSFORM_MATRIX_SHIFT) - maxLog2TrDynamicRange; 873 873 const Int shift_2nd = (g_aucConvertToBit[iHeight] + 2) + TRANSFORM_MATRIX_SHIFT; 874 874 … … 925 925 926 926 /** MxN inverse transform (2D) 927 * \param bitDepth [in] bit depth928 * \param coeff [in] transform coefficients929 * \param block [out] residual block930 * \param iWidth [in] width of transform931 * \param iHeight [in] height of transform932 * \param useDST [in]933 * \param max TrDynamicRange [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] 934 934 */ 935 Void xITrMxN(Int bitDepth, TCoeff *coeff, TCoeff *block, Int iWidth, Int iHeight, Bool useDST, const Int max TrDynamicRange)935 Void xITrMxN(Int bitDepth, TCoeff *coeff, TCoeff *block, Int iWidth, Int iHeight, Bool useDST, const Int maxLog2TrDynamicRange) 936 936 { 937 937 static const Int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_INVERSE]; 938 938 939 939 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 + max TrDynamicRange - 1) - bitDepth;941 const TCoeff clipMinimum = -(1 << max TrDynamicRange);942 const TCoeff clipMaximum = (1 << max TrDynamicRange) - 1;940 Int shift_2nd = (TRANSFORM_MATRIX_SHIFT + maxLog2TrDynamicRange - 1) - bitDepth; 941 const TCoeff clipMinimum = -(1 << maxLog2TrDynamicRange); 942 const TCoeff clipMaximum = (1 << maxLog2TrDynamicRange) - 1; 943 943 944 944 assert(shift_1st >= 0); … … 997 997 998 998 // 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 )999 Void TComTrQuant::signBitHidingHDQ( const ComponentID compID, TCoeff* pQCoef, TCoeff* pCoef, TCoeff* deltaU, const TUEntropyCodingParameters &codingParameters, const Int maxLog2TrDynamicRange ) 1000 1000 { 1001 1001 const UInt width = codingParameters.widthInGroups << MLS_CG_LOG2_WIDTH; … … 1003 1003 const UInt groupSize = 1 << MLS_CG_SIZE; 1004 1004 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; 1007 1007 1008 1008 Int lastCG = -1; … … 1154 1154 #endif 1155 1155 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)); 1157 1158 1158 1159 Bool useRDOQ = useTransformSkip ? m_useRDOQTS : m_useRDOQ; … … 1170 1171 getTUEntropyCodingParameters(codingParameters, rTu, compID); 1171 1172 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; 1174 1175 1175 1176 TCoeff deltaU[MAX_TU_SIZE * MAX_TU_SIZE]; … … 1191 1192 1192 1193 // Represents scaling through forward transform 1193 Int iTransformShift = getTransformShift(toChannelType(compID), uiLog2TrSize );1194 Int iTransformShift = getTransformShift(toChannelType(compID), uiLog2TrSize, maxLog2TrDynamicRange); 1194 1195 if (useTransformSkip && pcCU->getSlice()->getSPS()->getUseExtendedPrecision()) 1195 1196 { … … 1241 1242 if(uiAbsSum >= 2) //this prevents TUs with only one coefficient of value 1 from being tested 1242 1243 { 1243 signBitHidingHDQ( compID, piQCoef, piCoef, deltaU, codingParameters ) ;1244 signBitHidingHDQ( compID, piQCoef, piCoef, deltaU, codingParameters, maxLog2TrDynamicRange ) ; 1244 1245 } 1245 1246 } … … 1265 1266 const UInt uiLog2TrSize = rTu.GetEquivalentLog2TrSize(compID); 1266 1267 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; 1269 1271 const Bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, (pcCU->getTransformSkip(uiAbsPartIdx, compID) != 0)); 1270 1272 const Int scalingListType = getScalingListType(pcCU->getPredictionMode(uiAbsPartIdx), compID); … … 1275 1277 // Represents scaling through forward transform 1276 1278 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); 1278 1280 const Int iTransformShift = bClipTransformShiftTo0 ? std::max<Int>(0, originalTransformShift) : originalTransformShift; 1279 1281 … … 1289 1291 //(sizeof(Intermediate_Int) * 8) = inputBitDepth + dequantCoefBits - rightShift 1290 1292 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)); 1292 1294 1293 1295 const Intermediate_Int inputMinimum = -(1 << (targetInputBitDepth - 1)); … … 1329 1331 //iCoeffQ = Intermediate_Int((Int64(clipQCoef) * scale + iAdd) >> rightShift); 1330 1332 //(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)); 1332 1334 const Intermediate_Int inputMinimum = -(1 << (targetInputBitDepth - 1)); 1333 1335 const Intermediate_Int inputMaximum = (1 << (targetInputBitDepth - 1)) - 1; … … 1441 1443 else 1442 1444 { 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)) ); 1444 1446 } 1445 1447 … … 1571 1573 else 1572 1574 { 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)) ); 1574 1576 1575 1577 #if defined DEBUG_STRING … … 1863 1865 * \param iHeight transform height 1864 1866 */ 1865 Void TComTrQuant::xT( const ComponentID compID, Bool useDST, Pel* piBlkResi, UInt uiStride, TCoeff* psCoeff, Int iWidth, Int iHeight )1867 Void TComTrQuant::xT( const ComponentID compID, Bool useDST, Pel* piBlkResi, UInt uiStride, TCoeff* psCoeff, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange ) 1866 1868 { 1867 1869 #if MATRIX_MULT 1868 1870 if( iWidth == iHeight) 1869 1871 { 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); 1871 1873 return; 1872 1874 } … … 1884 1886 } 1885 1887 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 ); 1887 1889 1888 1890 memcpy(psCoeff, coeff, (iWidth * iHeight * sizeof(TCoeff))); … … 1898 1900 * \param iHeight transform height 1899 1901 */ 1900 Void TComTrQuant::xIT( const ComponentID compID, Bool useDST, TCoeff* plCoef, Pel* pResidual, UInt uiStride, Int iWidth, Int iHeight )1902 Void TComTrQuant::xIT( const ComponentID compID, Bool useDST, TCoeff* plCoef, Pel* pResidual, UInt uiStride, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange ) 1901 1903 { 1902 1904 #if MATRIX_MULT … … 1904 1906 { 1905 1907 #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); 1907 1909 #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); 1909 1911 #endif 1910 1912 return; … … 1918 1920 1919 1921 #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 ); 1921 1923 #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 ); 1923 1925 #endif 1924 1926 … … 1944 1946 const Int width = rect.width; 1945 1947 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); 1948 1951 if (rTu.getCU()->getSlice()->getSPS()->getUseExtendedPrecision()) 1949 1952 { … … 1991 1994 const Int width = rect.width; 1992 1995 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); 1995 1999 if (rTu.getCU()->getSlice()->getSPS()->getUseExtendedPrecision()) 1996 2000 { … … 2058 2062 2059 2063 const Bool extendedPrecision = pcCU->getSlice()->getSPS()->getUseExtendedPrecision(); 2064 const Int maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)); 2060 2065 2061 2066 /* for 422 chroma blocks, the effective scaling applied during transformation is not a power of 2, hence it cannot be … … 2066 2071 2067 2072 // Represents scaling through forward transform 2068 Int iTransformShift = getTransformShift(channelType, uiLog2TrSize );2073 Int iTransformShift = getTransformShift(channelType, uiLog2TrSize, maxLog2TrDynamicRange); 2069 2074 if ((pcCU->getTransformSkip(uiAbsPartIdx, compID) != 0) && pcCU->getSlice()->getSPS()->getUseExtendedPrecision()) 2070 2075 { … … 2110 2115 const Double defaultErrorScale = getErrScaleCoeffNoScalingList(scalingListType, (uiLog2TrSize-2), cQP.rem); 2111 2116 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; 2114 2119 2115 2120 #if ADAPTIVE_QP_SELECTION … … 2813 2818 * \returns cost of given absolute transform level 2814 2819 */ 2815 __inline Int TComTrQuant::xGetICRate ( UIntuiAbsLevel,2816 UShortui16CtxNumOne,2817 UShortui16CtxNumAbs,2818 UShortui16AbsGoRice,2819 UIntc1Idx,2820 UIntc2Idx,2821 BooluseLimitedPrefixLength,2822 ChannelType channelType2820 __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 2823 2828 ) const 2824 2829 { … … 2837 2842 else if (useLimitedPrefixLength) 2838 2843 { 2839 const UInt maximumPrefixLength = (32 - (COEF_REMAIN_BIN_REDUCTION + g_maxTrDynamicRange[channelType]));2844 const UInt maximumPrefixLength = (32 - (COEF_REMAIN_BIN_REDUCTION + maxLog2TrDynamicRange)); 2840 2845 2841 2846 UInt prefixLength = 0; … … 2847 2852 } 2848 2853 2849 const UInt suffixLength = (prefixLength == maximumPrefixLength) ? ( g_maxTrDynamicRange[channelType]- ui16AbsGoRice) : (prefixLength + 1/*separator*/);2854 const UInt suffixLength = (prefixLength == maximumPrefixLength) ? (maxLog2TrDynamicRange - ui16AbsGoRice) : (prefixLength + 1/*separator*/); 2850 2855 2851 2856 iRate += (COEF_REMAIN_BIN_REDUCTION + prefixLength + suffixLength + ui16AbsGoRice) << 15; … … 2981 2986 * \param format chroma format 2982 2987 */ 2983 Void TComTrQuant::setScalingList(TComScalingList *scalingList, const ChromaFormat format )2988 Void TComTrQuant::setScalingList(TComScalingList *scalingList, const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE]) 2984 2989 { 2985 2990 const Int minimumQp = 0; … … 2994 2999 xSetScalingListEnc(scalingList,list,size,qp,format); 2995 3000 xSetScalingListDec(*scalingList,list,size,qp,format); 2996 setErrScaleCoeff(list,size,qp );3001 setErrScaleCoeff(list,size,qp,maxLog2TrDynamicRange); 2997 3002 } 2998 3003 } … … 3024 3029 * \param qp Quantization parameter 3025 3030 */ 3026 Void TComTrQuant::setErrScaleCoeff(UInt list, UInt size, Int qp )3031 Void TComTrQuant::setErrScaleCoeff(UInt list, UInt size, Int qp, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE]) 3027 3032 { 3028 3033 const UInt uiLog2TrSize = g_aucConvertToBit[ g_scalingListSizeX[size] ] + 2; 3029 3034 const ChannelType channelType = ((list == 0) || (list == MAX_NUM_COMPONENT)) ? CHANNEL_TYPE_LUMA : CHANNEL_TYPE_CHROMA; 3030 3035 3031 const Int iTransformShift = getTransformShift(channelType, uiLog2TrSize ); // Represents scaling through forward transform3036 const Int iTransformShift = getTransformShift(channelType, uiLog2TrSize, maxLog2TrDynamicRange[channelType]); // Represents scaling through forward transform 3032 3037 3033 3038 UInt i,uiMaxNumCoeff = g_scalingListSize[size]; … … 3103 3108 /** set flat matrix value to quantized coefficient 3104 3109 */ 3105 Void TComTrQuant::setFlatScalingList(const ChromaFormat format )3110 Void TComTrQuant::setFlatScalingList(const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE]) 3106 3111 { 3107 3112 const Int minimumQp = 0; … … 3115 3120 { 3116 3121 xsetFlatScalingList(list,size,qp,format); 3117 setErrScaleCoeff(list,size,qp );3122 setErrScaleCoeff(list,size,qp,maxLog2TrDynamicRange); 3118 3123 } 3119 3124 } … … 3250 3255 const UInt uiWidth = rect.width; 3251 3256 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); 3253 3259 const Int scalingListType = getScalingListType(pcCU->getPredictionMode(uiAbsPartIdx), compID); 3254 3260 const Bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, true); … … 3293 3299 const TCoeff quantisedCoefficient = (TCoeff((tmpLevel + iAdd ) >> iQBits)) * iSign; 3294 3300 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; 3297 3303 pcCoeff[ uiPos ] = Clip3<TCoeff>( entropyCodingMinimum, entropyCodingMaximum, quantisedCoefficient ); 3298 3304 } … … 3308 3314 const Int QP_per = cQP.per; 3309 3315 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); 3311 3318 const Int scalingListType = getScalingListType(pcCU->getPredictionMode(uiAbsPartIdx), compID); 3312 3319 const Bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, true); … … 3317 3324 const Int rightShift = (IQUANT_SHIFT - (iTransformShift + QP_per)) + (enableScalingLists ? LOG2_SCALING_LIST_NEUTRAL_VALUE : 0); 3318 3325 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; 3321 3328 3322 3329 // Dequantisation … … 3327 3334 { 3328 3335 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)); 3330 3337 3331 3338 const Intermediate_Int inputMinimum = -(1 << (targetInputBitDepth - 1)); … … 3356 3363 const Int scaleBits = (IQUANT_SHIFT + 1) ; 3357 3364 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)); 3359 3366 const Intermediate_Int inputMinimum = -(1 << (targetInputBitDepth - 1)); 3360 3367 const Intermediate_Int inputMaximum = (1 << (targetInputBitDepth - 1)) - 1; -
branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.h
r1259 r1285 172 172 Void initScalingList (); 173 173 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] ); 175 175 Double* getErrScaleCoeff ( UInt list, UInt size, Int qp ) { return m_errScale [size][list][qp]; }; //!< get Error Scale Coefficent 176 176 Double& getErrScaleCoeffNoScalingList ( UInt list, UInt size, Int qp ) { return m_errScaleNoScalingList[size][list][qp]; }; //!< get Error Scale Coefficent … … 179 179 Void setUseScalingList ( Bool bUseScalingList){ m_scalingListEnabledFlag = bUseScalingList; }; 180 180 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]); 182 182 Void xsetFlatScalingList ( UInt list, UInt size, Int qp, const ChromaFormat format); 183 183 Void xSetScalingListEnc ( TComScalingList *scalingList, UInt list, UInt size, Int qp, const ChromaFormat format); 184 184 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]); 186 186 Void setScalingListDec ( const TComScalingList &scalingList, const ChromaFormat format); 187 187 Void processScalingListEnc( Int *coeff, Int *quantcoeff, Int quantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc); … … 230 230 private: 231 231 // 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 ); 233 233 234 234 // skipping Transform 235 235 Void xTransformSkip ( Pel* piBlkResi, UInt uiStride, TCoeff* psCoeff, TComTU &rTu, const ComponentID component ); 236 236 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 ); 238 238 239 239 // quantization … … 279 279 280 280 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 channelType281 __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 289 289 ) const; 290 290 … … 304 304 305 305 // 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 ); 307 307 308 308 // inverse skipping transform -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r1262 r1285 299 299 */ 300 300 #if RExt__DECODER_DEBUG_BIT_STATISTICS 301 Void TDecSbac::xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const ChannelType channelType, const class TComCodingStatisticsClassType &whichStat )301 Void TDecSbac::xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange, const class TComCodingStatisticsClassType &whichStat ) 302 302 #else 303 Void TDecSbac::xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const ChannelType channelType )303 Void TDecSbac::xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange ) 304 304 #endif 305 305 { … … 309 309 if (useLimitedPrefixLength) 310 310 { 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; 312 312 313 313 do … … 337 337 else if (useLimitedPrefixLength) 338 338 { 339 const UInt maximumPrefixLength = (32 - (COEF_REMAIN_BIN_REDUCTION + g_maxTrDynamicRange[channelType]));339 const UInt maximumPrefixLength = (32 - (COEF_REMAIN_BIN_REDUCTION + maxLog2TrDynamicRange)); 340 340 341 341 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; 343 343 344 344 m_pcTDecBinIf->decodeBinsEP(codeWord, (suffixLength + rParam) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(whichStat)); … … 1283 1283 1284 1284 const Bool alignCABACBeforeBypass = pcCU->getSlice()->getSPS()->getAlignCABACBeforeBypass(); 1285 const Int maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(channelType); 1285 1286 1286 1287 #if RExt__DECODER_DEBUG_BIT_STATISTICS … … 1546 1547 { 1547 1548 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) ); 1549 1550 1550 1551 absCoeff[ idx ] = uiLevel + baseLevel; … … 1772 1773 for(Int i=0; i< 4; i++) 1773 1774 { 1774 #if SVC_EXTENSION1775 parseSaoMaxUvlc(uiSymbol, saoMaxOffsetQVal[compIdx] ); //sao_offset_abs1776 #else1777 1775 #if O0043_BEST_EFFORT_DECODING 1778 1776 Int saoMaxOffsetQVal = (1<<(min(bitDepthOrig, MAX_SAO_TRUNCATED_BITDEPTH)-5))-1; 1779 1777 parseSaoMaxUvlc(uiSymbol, saoMaxOffsetQVal); //sao_offset_abs 1778 #else 1779 #if SVC_EXTENSION 1780 parseSaoMaxUvlc(uiSymbol, saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1780 1781 #else 1781 1782 parseSaoMaxUvlc(uiSymbol, g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.h
r1259 r1285 106 106 Void xReadUnaryMaxSymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset, UInt uiMaxSymbol, const class TComCodingStatisticsClassType &whichStat ); 107 107 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 ); 109 109 #else 110 110 Void xReadUnarySymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset ); 111 111 Void xReadUnaryMaxSymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset, UInt uiMaxSymbol ); 112 112 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 ); 114 114 #endif 115 115 private: -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1282 r1285 583 583 #else 584 584 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 587 586 } 588 587 g_uiMaxCUWidth = sps->getMaxCUWidth(); … … 1799 1798 else 1800 1799 { 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); 1803 1807 #else 1804 m_cTrQuant.setFlatScalingList(pcSlice->getSPS()->getChromaFormatIdc() );1808 m_cTrQuant.setFlatScalingList(pcSlice->getSPS()->getChromaFormatIdc(), maxLog2TrDynamicRange); 1805 1809 #endif 1806 1810 m_cTrQuant.setUseScalingList(false); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.cpp
r1260 r1285 340 340 * \param channelType plane type (luma/chroma) 341 341 */ 342 Void TEncSbac::xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam, const Bool useLimitedPrefixLength, const ChannelType channelType )342 Void TEncSbac::xWriteCoefRemainExGolomb ( UInt symbol, UInt &rParam, const Bool useLimitedPrefixLength, const ChannelType channelType, const Int maxLog2TrDynamicRange ) 343 343 { 344 344 Int codeNumber = (Int)symbol; … … 353 353 else if (useLimitedPrefixLength) 354 354 { 355 const UInt maximumPrefixLength = (32 - (COEF_REMAIN_BIN_REDUCTION + g_maxTrDynamicRange[channelType]));355 const UInt maximumPrefixLength = (32 - (COEF_REMAIN_BIN_REDUCTION + maxLog2TrDynamicRange)); 356 356 357 357 UInt prefixLength = 0; … … 362 362 { 363 363 prefixLength = maximumPrefixLength; 364 suffixLength = g_maxTrDynamicRange[channelType]- rParam;364 suffixLength = maxLog2TrDynamicRange - rParam; 365 365 } 366 366 else … … 1254 1254 1255 1255 const Bool alignCABACBeforeBypass = pcCU->getSlice()->getSPS()->getAlignCABACBeforeBypass(); 1256 const Int maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(channelType); 1256 1257 1257 1258 Bool beValid; … … 1504 1505 const UInt escapeCodeValue = absCoeff[idx] - baseLevel; 1505 1506 1506 xWriteCoefRemainExGolomb( escapeCodeValue, uiGoRiceParam, extendedPrecision, channelType );1507 xWriteCoefRemainExGolomb( escapeCodeValue, uiGoRiceParam, extendedPrecision, channelType, maxLog2TrDynamicRange ); 1507 1508 1508 1509 if (absCoeff[idx] > (3 << uiGoRiceParam)) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.h
r1259 r1285 128 128 Void xWriteUnaryMaxSymbol ( UInt uiSymbol, ContextModel* pcSCModel, Int iOffset, UInt uiMaxSymbol ); 129 129 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 ); 131 131 132 132 Void xCopyFrom ( const TEncSbac* pSrc ); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1284 r1285 275 275 // Initialise scaling lists 276 276 // 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 }; 278 282 if(getUseScalingListId() == SCALING_LIST_OFF) 279 283 { 280 284 #if SVC_EXTENSION 281 getTrQuant()->setFlatScalingList(m_cVPS.getChromaFormatIdc(&m_cSPS, m_layerId) );285 getTrQuant()->setFlatScalingList(m_cVPS.getChromaFormatIdc(&m_cSPS, m_layerId), maxLog2TrDynamicRange); 282 286 #else 283 getTrQuant()->setFlatScalingList(m_cSPS.getChromaFormatIdc() );287 getTrQuant()->setFlatScalingList(m_cSPS.getChromaFormatIdc(), maxLog2TrDynamicRange); 284 288 #endif 285 289 getTrQuant()->setUseScalingList(false); … … 301 305 302 306 // 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 ); 304 308 } 305 309 else … … 309 313 m_cSPS.setScalingListPresentFlag(false); 310 314 m_cPPS.setScalingListPresentFlag(false); 311 getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc()); 315 316 getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc(), maxLog2TrDynamicRange); 312 317 #if SVC_EXTENSION 313 318 } … … 329 334 330 335 // 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 ); 332 337 } 333 338 else … … 344 349 m_cSPS.setScalingListPresentFlag(m_cSPS.getScalingList().checkDefaultScalingList()); 345 350 m_cPPS.setScalingListPresentFlag(false); 346 getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc() );351 getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc(), maxLog2TrDynamicRange); 347 352 #if SVC_EXTENSION 348 353 }
Note: See TracChangeset for help on using the changeset viewer.