Ignore:
Timestamp:
28 Jun 2013, 00:40:00 (12 years ago)
Author:
seregin
Message:

update to HM11.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/SHM-2.1-dev/source/Lib/TLibCommon/TComTrQuant.cpp

    r191 r302  
    10751075    Int iTransformShift = MAX_TR_DYNAMIC_RANGE - uiBitDepth - uiLog2TrSize;  // Represents scaling through forward transform
    10761076
    1077     Int iQBits = QUANT_SHIFT + m_cQP.m_iPer + iTransformShift;                // Right shift of non-RDOQ quantizer;  level = (coeff*uiQ + offset)>>q_bits
    1078 
    1079     iAdd = (pcCU->getSlice()->getSliceType()==I_SLICE ? 171 : 85) << (iQBits-9);
    1080 
    10811077#if ADAPTIVE_QP_SELECTION
    1082     iQBits = QUANT_SHIFT + cQpBase.m_iPer + iTransformShift;
     1078    Int iQBits = QUANT_SHIFT + cQpBase.m_iPer + iTransformShift;
    10831079    iAdd = (pcCU->getSlice()->getSliceType()==I_SLICE ? 171 : 85) << (iQBits-9);
    10841080    Int iQBitsC = QUANT_SHIFT + cQpBase.m_iPer + iTransformShift - ARL_C_PRECISION; 
    10851081    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);
    10861085#endif
    10871086
     
    13641363#else
    13651364  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 ];
    13811375  }
    13821376#endif 
     
    13991393  Int j;
    14001394  {
    1401     Short block[ 64 * 64 ];
    1402     Short coeff[ 64 * 64 ];
     1395    Short block[ 32 * 32 ];
     1396    Short coeff[ 32 * 32 ];
    14031397    for ( j = 0; j < iHeight * iWidth; j++ )
    14041398    {   
     
    15221516                                                      UInt                            uiAbsPartIdx )
    15231517{
    1524   Int    iQBits      = m_cQP.m_iBits;
    1525   Double dTemp       = 0;
    15261518  UInt uiLog2TrSize = g_aucConvertToBit[ uiWidth ] + 2;
    1527   Int uiQ = g_quantScales[m_cQP.rem()];
    15281519 
    15291520  UInt uiBitDepth = eTType == TEXT_LUMA ? g_bitDepthY : g_bitDepthC;
     
    15361527  assert(scalingListType < 6);
    15371528 
    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
    15401530  Double *pdErrScaleOrg = getErrScaleCoeff(scalingListType,uiLog2TrSize-2,m_cQP.m_iRem);
    15411531  Int *piQCoefOrg = getQuantCoeff(scalingListType,m_cQP.m_iRem,uiLog2TrSize-2);
     
    15891579  Double  d64BaseCost         = 0;
    15901580  Int     iLastScanPos        = -1;
    1591   dTemp                       = dErrScale;
    15921581 
    15931582  UInt    c1Idx     = 0;
     
    16181607      UInt    uiBlkPos          = scan[iScanPos];
    16191608      // set coeff
    1620       uiQ  = piQCoef[uiBlkPos];
    1621       dTemp = pdErrScale[uiBlkPos];
     1609      Int uiQ  = piQCoef[uiBlkPos];
     1610      Double dTemp = pdErrScale[uiBlkPos];
    16221611      Int lLevelDouble          = plSrcCoeff[ uiBlkPos ];
    16231612      lLevelDouble              = (Int)min<Int64>((Int64)abs((Int)lLevelDouble) * uiQ , MAX_INT - (1 << (iQBits - 1)));
Note: See TracChangeset for help on using the changeset viewer.