Changeset 302 in SHVCSoftware for branches/SHM-2.1-dev/source/Lib/TLibCommon/TComTrQuant.cpp
- Timestamp:
- 28 Jun 2013, 00:40:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/SHM-2.1-dev/source/Lib/TLibCommon/TComTrQuant.cpp ¶
r191 r302 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 … … 1364 1363 #else 1365 1364 Int j; 1366 { 1367 Short block[ 64 * 64 ]; 1368 Short coeff[ 64 * 64 ]; 1369 { 1370 for (j = 0; j < iHeight; j++) 1371 { 1372 memcpy( block + j * iWidth, piBlkResi + j * uiStride, iWidth * sizeof( Short ) ); 1373 } 1374 } 1375 xTrMxN(bitDepth, block, coeff, iWidth, iHeight, uiMode ); 1376 for ( j = 0; j < iHeight * iWidth; j++ ) 1377 { 1378 psCoeff[ j ] = coeff[ j ]; 1379 } 1380 return ; 1365 Short block[ 32 * 32 ]; 1366 Short coeff[ 32 * 32 ]; 1367 for (j = 0; j < iHeight; j++) 1368 { 1369 memcpy( block + j * iWidth, piBlkResi + j * uiStride, iWidth * sizeof( Short ) ); 1370 } 1371 xTrMxN(bitDepth, block, coeff, iWidth, iHeight, uiMode ); 1372 for ( j = 0; j < iHeight * iWidth; j++ ) 1373 { 1374 psCoeff[ j ] = coeff[ j ]; 1381 1375 } 1382 1376 #endif … … 1399 1393 Int j; 1400 1394 { 1401 Short block[ 64 * 64];1402 Short coeff[ 64 * 64];1395 Short block[ 32 * 32 ]; 1396 Short coeff[ 32 * 32 ]; 1403 1397 for ( j = 0; j < iHeight * iWidth; j++ ) 1404 1398 { … … 1522 1516 UInt uiAbsPartIdx ) 1523 1517 { 1524 Int iQBits = m_cQP.m_iBits;1525 Double dTemp = 0;1526 1518 UInt uiLog2TrSize = g_aucConvertToBit[ uiWidth ] + 2; 1527 Int uiQ = g_quantScales[m_cQP.rem()];1528 1519 1529 1520 UInt uiBitDepth = eTType == TEXT_LUMA ? g_bitDepthY : g_bitDepthC; … … 1536 1527 assert(scalingListType < 6); 1537 1528 1538 iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift; // Right shift of non-RDOQ quantizer; level = (coeff*uiQ + offset)>>q_bits 1539 Double dErrScale = 0; 1529 Int iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift; // Right shift of non-RDOQ quantizer; level = (coeff*uiQ + offset)>>q_bits 1540 1530 Double *pdErrScaleOrg = getErrScaleCoeff(scalingListType,uiLog2TrSize-2,m_cQP.m_iRem); 1541 1531 Int *piQCoefOrg = getQuantCoeff(scalingListType,m_cQP.m_iRem,uiLog2TrSize-2); … … 1589 1579 Double d64BaseCost = 0; 1590 1580 Int iLastScanPos = -1; 1591 dTemp = dErrScale;1592 1581 1593 1582 UInt c1Idx = 0; … … 1618 1607 UInt uiBlkPos = scan[iScanPos]; 1619 1608 // set coeff 1620 uiQ = piQCoef[uiBlkPos];1621 dTemp = pdErrScale[uiBlkPos];1609 Int uiQ = piQCoef[uiBlkPos]; 1610 Double dTemp = pdErrScale[uiBlkPos]; 1622 1611 Int lLevelDouble = plSrcCoeff[ uiBlkPos ]; 1623 1612 lLevelDouble = (Int)min<Int64>((Int64)abs((Int)lLevelDouble) * uiQ , MAX_INT - (1 << (iQBits - 1)));
Note: See TracChangeset for help on using the changeset viewer.