Changeset 583 in 3DVCSoftware


Ignore:
Timestamp:
17 Aug 2013, 15:12:24 (11 years ago)
Author:
tech
Message:

Clean ups related to SCU_HS_FAST_DEPTH_INTRA_E0238

Location:
branches/HTM-DEV-2.0-dev3-SCU-Hisilicon/source/Lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-2.0-dev3-SCU-Hisilicon/source/Lib/TLibCommon/TComPrediction.cpp

    r582 r583  
    21422142
    21432143#if SCU_HS_DMM4_REMOVE_DIV_E0242
    2144 Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2;
    2145 iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2;
     2144  Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2;
     2145  iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2;
    21462146#else
    21472147  iDC /= (uiWidth*uiHeight);
  • branches/HTM-DEV-2.0-dev3-SCU-Hisilicon/source/Lib/TLibCommon/TComRdCost.cpp

    r582 r583  
    486486#if SCU_HS_FAST_DEPTH_INTRA_E0238
    487487
    488 UInt TComRdCost::calcVAR (Pel* pi0, Int uiWidth, Int uiHeight, Int cuDepth)
     488UInt TComRdCost::calcVAR (Pel* pi0, Int width, Int height, Int stride, Int cuDepth)
    489489{
    490   Int x, y;
    491490  Int temp = 0;
    492491
    493   for (x = 0; x <  uiHeight; x++)
    494   {
    495      for (y = 0; y < uiWidth; y++)
    496       {
    497          temp += pi0[x*uiHeight+y];
    498       }
    499   }
     492  for (Int y = 0; y < height; y++)
     493  {
     494    for (Int x = 0; x < width; x++)
     495    {
     496      temp += pi0[ y * stride + x ];
     497    }
     498  }
     499
    500500  Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2;
    501   if (uiWidth == 4)
    502   {
    503      cuDepth = cuMaxLog2Size-2;
    504   }
    505 
    506   temp = temp >> (cuMaxLog2Size-cuDepth)*2;
    507 
    508   UInt uiSum = 0;
    509     for (x = 0; x <  uiHeight; x++)
    510   {
    511       for (y = 0; y < uiWidth; y++)
    512       {
    513         uiSum += (pi0[x*uiHeight+y]-temp)*(pi0[x*uiHeight+y]-temp);
    514       }
    515   }
    516      return (uiSum >> (cuMaxLog2Size-cuDepth)*2);
     501 
     502  if ( width == 4 ) // GT: What is the rational behind this?
     503  {
     504    cuDepth = cuMaxLog2Size - 2;
     505  }
     506
     507  temp = temp >> (cuMaxLog2Size-cuDepth) * 2;
     508
     509  UInt sum = 0;
     510  for (Int y = 0; y < height; y++)
     511  {
     512    for (Int x = 0; x <  width; x++)
     513    {
     514      sum += (pi0[ y * stride + x ] - temp ) * (pi0[ y * stride + x ] - temp );
     515    }
     516  }
     517  return (sum >> (cuMaxLog2Size-cuDepth)*2);
    517518
    518519}
  • branches/HTM-DEV-2.0-dev3-SCU-Hisilicon/source/Lib/TLibCommon/TComRdCost.h

    r582 r583  
    229229  UInt    calcHAD(Int bitDepth, Pel* pi0, Int iStride0, Pel* pi1, Int iStride1, Int iWidth, Int iHeight );
    230230#if SCU_HS_FAST_DEPTH_INTRA_E0238
    231   UInt    calcVAR(Pel* pi0, Int uiWidth, Int uiHeight, Int cuDepth);
     231  UInt    calcVAR(Pel* pi0, Int width, Int height, Int stride, Int cuDepth);
    232232#endif 
    233233  // for motion cost
  • branches/HTM-DEV-2.0-dev3-SCU-Hisilicon/source/Lib/TLibEncoder/TEncSearch.cpp

    r582 r583  
    28352835
    28362836#if SCU_HS_FAST_DEPTH_INTRA_E0238
    2837 Int threshold = max(((pcCU->getQP(0))>>3)-1,3);
    2838 Int varThreshold = (Int)(threshold*threshold - 8);
    2839 UInt uiVarCU=m_pcRdCost->calcVAR(piOrg, uiWidth,uiHeight,pcCU->getDepth(0));
     2837      Int  threshold    = max(((pcCU->getQP(0))>>3)-1,3);
     2838      Int  varThreshold = (Int)( threshold * threshold - 8 );
     2839      UInt varCU      = m_pcRdCost->calcVAR(piOrg, uiStride, uiWidth,uiHeight,pcCU->getDepth(0));
    28402840#endif
    28412841
     
    28442844      if( m_pcEncCfg->getUseDMM()
    28452845#if SCU_HS_FAST_DEPTH_INTRA_E0238
    2846          && (uiRdModeList[0] != 0 || uiVarCU >= varThreshold)
     2846         && (uiRdModeList[0] != 0 || varCU >= varThreshold)
    28472847#endif
    28482848        )
     
    29222922      if( m_pcEncCfg->getUseRBC()
    29232923#if SCU_HS_FAST_DEPTH_INTRA_E0238
    2924           && (uiRdModeList[0] != 0 || uiVarCU >= varThreshold)
     2924          && (uiRdModeList[0] != 0 || varCU >= varThreshold)
    29252925#endif
    29262926        )
Note: See TracChangeset for help on using the changeset viewer.