Changeset 537 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComTrQuant.cpp
- Timestamp:
- 13 Jul 2013, 15:51:26 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComTrQuant.cpp
r446 r537 1075 1075 Int iTransformShift = MAX_TR_DYNAMIC_RANGE - uiBitDepth - uiLog2TrSize; // Represents scaling through forward transform 1076 1076 1077 Int iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift; // Right shift of non-RDOQ quantizer; level = (coeff*uiQ + offset)>>q_bits1078 1079 iAdd = (pcCU->getSlice()->getSliceType()==I_SLICE ? 171 : 85) << (iQBits-9);1080 1081 1077 #if ADAPTIVE_QP_SELECTION 1082 iQBits = QUANT_SHIFT + cQpBase.m_iPer + iTransformShift;1078 Int iQBits = QUANT_SHIFT + cQpBase.m_iPer + iTransformShift; 1083 1079 iAdd = (pcCU->getSlice()->getSliceType()==I_SLICE ? 171 : 85) << (iQBits-9); 1084 1080 Int iQBitsC = QUANT_SHIFT + cQpBase.m_iPer + iTransformShift - ARL_C_PRECISION; 1085 1081 Int iAddC = 1 << (iQBitsC-1); 1082 #else 1083 Int iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift; // Right shift of non-RDOQ quantizer; level = (coeff*uiQ + offset)>>q_bits 1084 iAdd = (pcCU->getSlice()->getSliceType()==I_SLICE ? 171 : 85) << (iQBits-9); 1086 1085 #endif 1087 1086 … … 1347 1346 #else 1348 1347 Int j; 1349 { 1350 Short block[ 64 * 64 ]; 1351 Short coeff[ 64 * 64 ]; 1352 { 1348 Short block[ 32 * 32 ]; 1349 Short coeff[ 32 * 32 ]; 1353 1350 for (j = 0; j < iHeight; j++) 1354 1351 { 1355 1352 memcpy( block + j * iWidth, piBlkResi + j * uiStride, iWidth * sizeof( Short ) ); 1356 1353 } 1357 }1358 1354 xTrMxN(bitDepth, block, coeff, iWidth, iHeight, uiMode ); 1359 1355 for ( j = 0; j < iHeight * iWidth; j++ ) … … 1361 1357 psCoeff[ j ] = coeff[ j ]; 1362 1358 } 1363 return ;1364 }1365 1359 #endif 1366 1360 } … … 1382 1376 Int j; 1383 1377 { 1384 Short block[ 64 * 64];1385 Short coeff[ 64 * 64];1378 Short block[ 32 * 32 ]; 1379 Short coeff[ 32 * 32 ]; 1386 1380 for ( j = 0; j < iHeight * iWidth; j++ ) 1387 1381 { … … 1505 1499 UInt uiAbsPartIdx ) 1506 1500 { 1507 Int iQBits = m_cQP.m_iBits;1508 Double dTemp = 0;1509 1501 UInt uiLog2TrSize = g_aucConvertToBit[ uiWidth ] + 2; 1510 Int uiQ = g_quantScales[m_cQP.rem()];1511 1502 1512 1503 UInt uiBitDepth = eTType == TEXT_LUMA ? g_bitDepthY : g_bitDepthC; … … 1519 1510 assert(scalingListType < 6); 1520 1511 1521 iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift; // Right shift of non-RDOQ quantizer; level = (coeff*uiQ + offset)>>q_bits 1522 Double dErrScale = 0; 1512 Int iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift; // Right shift of non-RDOQ quantizer; level = (coeff*uiQ + offset)>>q_bits 1523 1513 Double *pdErrScaleOrg = getErrScaleCoeff(scalingListType,uiLog2TrSize-2,m_cQP.m_iRem); 1524 1514 Int *piQCoefOrg = getQuantCoeff(scalingListType,m_cQP.m_iRem,uiLog2TrSize-2); … … 1572 1562 Double d64BaseCost = 0; 1573 1563 Int iLastScanPos = -1; 1574 dTemp = dErrScale;1575 1564 1576 1565 UInt c1Idx = 0; … … 1601 1590 UInt uiBlkPos = scan[iScanPos]; 1602 1591 // set coeff 1603 uiQ = piQCoef[uiBlkPos];1604 dTemp = pdErrScale[uiBlkPos];1592 Int uiQ = piQCoef[uiBlkPos]; 1593 Double dTemp = pdErrScale[uiBlkPos]; 1605 1594 Int lLevelDouble = plSrcCoeff[ uiBlkPos ]; 1606 1595 lLevelDouble = (Int)min<Int64>((Int64)abs((Int)lLevelDouble) * uiQ , MAX_INT - (1 << (iQBits - 1)));
Note: See TracChangeset for help on using the changeset viewer.