Changeset 1368 in SHVCSoftware


Ignore:
Timestamp:
22 Jul 2015, 04:43:32 (9 years ago)
Author:
seregin
Message:

port rev 4486

Location:
branches/SHM-dev/source/Lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp

    r1335 r1368  
    113113
    114114// TODO: move this function to TComPrediction.cpp.
    115 Void TComPrediction::initIntraPatternChType( TComTU &rTu, Bool& bAbove, Bool& bLeft, const ComponentID compID, const Bool bFilterRefSamples DEBUG_STRING_FN_DECLARE(sDebug))
     115Void TComPrediction::initIntraPatternChType( TComTU &rTu, const ComponentID compID, const Bool bFilterRefSamples DEBUG_STRING_FN_DECLARE(sDebug))
    116116{
    117117  const ChannelType chType    = toChannelType(compID);
     
    156156  iNumIntraNeighbor  += isBelowLeftAvailable ( pcCU, uiPartIdxLT, uiPartIdxLB, (bNeighborFlags + iLeftUnits - 1 - iTUHeightInUnits) );
    157157
    158   bAbove = true;
    159   bLeft  = true;
    160 
    161158  const UInt         uiROIWidth  = uiTuWidth2+1;
    162159  const UInt         uiROIHeight = uiTuHeight2+1;
  • branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp

    r1307 r1368  
    181181// Function for calculating DC value of the reference samples used in Intra prediction
    182182//NOTE: Bit-Limit - 25-bit source
    183 Pel TComPrediction::predIntraGetPredValDC( const Pel* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight, Bool bAbove, Bool bLeft )
     183Pel TComPrediction::predIntraGetPredValDC( const Pel* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight)
    184184{
    185185  assert(iWidth > 0 && iHeight > 0);
     
    187187  Pel pDcVal;
    188188
    189   if (bAbove)
    190   {
    191     for (iInd = 0;iInd < iWidth;iInd++)
    192     {
    193       iSum += pSrc[iInd-iSrcStride];
    194     }
    195   }
    196   if (bLeft)
    197   {
    198     for (iInd = 0;iInd < iHeight;iInd++)
    199     {
    200       iSum += pSrc[iInd*iSrcStride-1];
    201     }
    202   }
    203 
    204   if (bAbove && bLeft)
    205   {
    206     pDcVal = (iSum + iWidth) / (iWidth + iHeight);
    207   }
    208   else if (bAbove)
    209   {
    210     pDcVal = (iSum + iWidth/2) / iWidth;
    211   }
    212   else if (bLeft)
    213   {
    214     pDcVal = (iSum + iHeight/2) / iHeight;
    215   }
    216   else
    217   {
    218     pDcVal = pSrc[-1]; // Default DC value already calculated and placed in the prediction array if no neighbors are available
    219   }
     189  for (iInd = 0;iInd < iWidth;iInd++)
     190  {
     191    iSum += pSrc[iInd-iSrcStride];
     192  }
     193  for (iInd = 0;iInd < iHeight;iInd++)
     194  {
     195    iSum += pSrc[iInd*iSrcStride-1];
     196  }
     197
     198  pDcVal = (iSum + iWidth) / (iWidth + iHeight);
    220199
    221200  return pDcVal;
     
    252231                                          Pel* pTrueDst, Int dstStrideTrue,
    253232                                          UInt uiWidth, UInt uiHeight, ChannelType channelType,
    254                                           UInt dirMode, Bool blkAboveAvailable, Bool blkLeftAvailable
    255                                   , const Bool bEnableEdgeFilters
     233                                          UInt dirMode, const Bool bEnableEdgeFilters
    256234                                  )
    257235{
     
    266244  if (modeDC)
    267245  {
    268     const Pel dcval = predIntraGetPredValDC(pSrc, srcStride, width, height, blkAboveAvailable, blkLeftAvailable);
     246    const Pel dcval = predIntraGetPredValDC(pSrc, srcStride, width, height);
    269247
    270248    for (Int y=height;y>0;y--, pTrueDst+=dstStrideTrue)
     
    297275    Pel  refLeft[2*MAX_CU_SIZE+1];
    298276
    299     // Initialise the Main and Left reference array.
     277    // Initialize the Main and Left reference array.
    300278    if (intraPredAngle < 0)
    301279    {
     
    410388}
    411389
    412 Void TComPrediction::predIntraAng( const ComponentID compID, UInt uiDirMode, Pel* piOrg /* Will be null for decoding */, UInt uiOrgStride, Pel* piPred, UInt uiStride, TComTU &rTu, Bool bAbove, Bool bLeft, const Bool bUseFilteredPredSamples, const Bool bUseLosslessDPCM )
     390Void TComPrediction::predIntraAng( const ComponentID compID, UInt uiDirMode, Pel* piOrg /* Will be null for decoding */, UInt uiOrgStride, Pel* piPred, UInt uiStride, TComTU &rTu, const Bool bUseFilteredPredSamples, const Bool bUseLosslessDPCM )
    413391{
    414392  const ChannelType    channelType = toChannelType(compID);
     
    488466#endif
    489467#endif
    490       xPredIntraAng( channelsBitDepthForPrediction, ptrSrc+sw+1, sw, pDst, uiStride, iWidth, iHeight, channelType, uiDirMode, bAbove, bLeft, enableEdgeFilters );
    491 
    492       if(( uiDirMode == DC_IDX ) && bAbove && bLeft )
     468      xPredIntraAng( channelsBitDepthForPrediction, ptrSrc+sw+1, sw, pDst, uiStride, iWidth, iHeight, channelType, uiDirMode, enableEdgeFilters );
     469
     470      if( uiDirMode == DC_IDX )
    493471      {
    494472        xDCPredFiltering( ptrSrc+sw+1, sw, pDst, uiStride, iWidth, iHeight, channelType );
  • branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.h

    r1315 r1368  
    8888  Int    m_iLumaRecStride;       ///< stride of #m_pLumaRecBuffer array
    8989
    90   Void xPredIntraAng            ( Int bitDepth, const Pel* pSrc, Int srcStride, Pel* pDst, Int dstStride, UInt width, UInt height, ChannelType channelType, UInt dirMode, Bool blkAboveAvailable, Bool blkLeftAvailable, const Bool bEnableEdgeFilters );
     90  Void xPredIntraAng            ( Int bitDepth, const Pel* pSrc, Int srcStride, Pel* pDst, Int dstStride, UInt width, UInt height, ChannelType channelType, UInt dirMode, const Bool bEnableEdgeFilters );
    9191  Void xPredIntraPlanar         ( const Pel* pSrc, Int srcStride, Pel* rpDst, Int dstStride, UInt width, UInt height );
    9292
     
    122122
    123123  // Angular Intra
    124   Void predIntraAng               ( const ComponentID compID, UInt uiDirMode, Pel *piOrg /* Will be null for decoding */, UInt uiOrgStride, Pel* piPred, UInt uiStride, TComTU &rTu, Bool bAbove, Bool bLeft, const Bool bUseFilteredPredSamples, const Bool bUseLosslessDPCM = false );
     124  Void predIntraAng               ( const ComponentID compID, UInt uiDirMode, Pel *piOrg /* Will be null for decoding */, UInt uiOrgStride, Pel* piPred, UInt uiStride, TComTU &rTu, const Bool bUseFilteredPredSamples, const Bool bUseLosslessDPCM = false );
    125125
    126   Pel  predIntraGetPredValDC      ( const Pel* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight, Bool bAbove, Bool bLeft );
     126  Pel  predIntraGetPredValDC      ( const Pel* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight);
    127127
    128128  Pel*  getPredictorPtr           ( const ComponentID compID, const Bool bUseFilteredPredictions )
     
    134134  /// set parameters from CU data for accessing intra data
    135135  Void initIntraPatternChType ( TComTU &rTu,
    136                               Bool&       bAbove,
    137                               Bool&       bLeft,
    138136                              const ComponentID compID, const Bool bFilterRefSamples
    139137                              DEBUG_STRING_FN_DECLARE(sDebug)
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp

    r1361 r1368  
    580580
    581581  //===== init availability pattern =====
    582   Bool  bAboveAvail = false;
    583   Bool  bLeftAvail  = false;
    584 
    585582  const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag());
    586583
     
    590587
    591588  DEBUG_STRING_NEW(sTemp)
    592   m_pcPrediction->initIntraPatternChType( rTu, bAboveAvail, bLeftAvail, compID, bUseFilteredPredictions  DEBUG_STRING_PASS_INTO(sTemp) );
     589  m_pcPrediction->initIntraPatternChType( rTu, compID, bUseFilteredPredictions  DEBUG_STRING_PASS_INTO(sTemp) );
    593590
    594591
    595592  //===== get prediction signal =====
    596593
    597   m_pcPrediction->predIntraAng( compID,   uiChFinalMode, 0 /* Decoder does not have an original image */, 0, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions );
     594  m_pcPrediction->predIntraAng( compID,   uiChFinalMode, 0 /* Decoder does not have an original image */, 0, piPred, uiStride, rTu, bUseFilteredPredictions );
    598595
    599596#if DEBUG_STRING
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r1363 r1368  
    11581158
    11591159  //===== init availability pattern =====
    1160   Bool  bAboveAvail = false;
    1161   Bool  bLeftAvail  = false;
    1162 
    11631160  DEBUG_STRING_NEW(sTemp)
    11641161
     
    11691166    const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag());
    11701167
    1171     initIntraPatternChType( rTu, bAboveAvail, bLeftAvail, compID, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sDebug) );
     1168    initIntraPatternChType( rTu, compID, bUseFilteredPredictions DEBUG_STRING_PASS_INTO(sDebug) );
    11721169
    11731170    //===== get prediction signal =====
    1174     predIntraAng( compID, uiChFinalMode, piOrg, uiStride, piPred, uiStride, rTu, bAboveAvail, bLeftAvail, bUseFilteredPredictions );
     1171    predIntraAng( compID, uiChFinalMode, piOrg, uiStride, piPred, uiStride, rTu, bUseFilteredPredictions );
    11751172
    11761173    // save prediction
     
    14621459  checkTransformSkip           &= (!pcCU->getCUTransquantBypass(0));
    14631460
     1461  assert (rTu.ProcessComponentSection(COMPONENT_Y));
     1462  const UInt totalAdjustedDepthChan   = rTu.GetTransformDepthTotalAdj(COMPONENT_Y);
     1463
    14641464  if ( m_pcEncCfg->getUseTransformSkipFast() )
    14651465  {
     
    14931493        }
    14941494
    1495         if (rTu.ProcessComponentSection(COMPONENT_Y))
    1496         {
    1497           const UInt totalAdjustedDepthChan = rTu.GetTransformDepthTotalAdj(COMPONENT_Y);
    1498           pcCU->setTransformSkipSubParts ( modeId, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
    1499 
    1500           xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, singleDistTmpLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sModeString), default0Save1Load2 );
    1501         }
     1495
     1496        pcCU->setTransformSkipSubParts ( modeId, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
     1497        xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, singleDistTmpLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sModeString), default0Save1Load2 );
     1498
    15021499        singleCbfTmpLuma = pcCU->getCbf( uiAbsPartIdx, COMPONENT_Y, uiTrDepth );
    15031500
     
    15461543      }
    15471544
    1548       if (rTu.ProcessComponentSection(COMPONENT_Y))
    1549       {
    1550         const UInt totalAdjustedDepthChan   = rTu.GetTransformDepthTotalAdj(COMPONENT_Y);
    1551         pcCU ->setTransformSkipSubParts ( bestModeId[COMPONENT_Y], COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
    1552       }
     1545      pcCU ->setTransformSkipSubParts ( bestModeId[COMPONENT_Y], COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
    15531546
    15541547      if(bestModeId[COMPONENT_Y] == firstCheckId)
    15551548      {
    15561549        xLoadIntraResultQT(COMPONENT_Y, rTu );
    1557         if (rTu.ProcessComponentSection(COMPONENT_Y))
    1558         {
    1559           pcCU->setCbfSubParts  ( uiSingleCbfLuma << uiTrDepth, COMPONENT_Y, uiAbsPartIdx, rTu.GetTransformDepthTotalAdj(COMPONENT_Y) );
    1560         }
     1550        pcCU->setCbfSubParts  ( uiSingleCbfLuma << uiTrDepth, COMPONENT_Y, uiAbsPartIdx, rTu.GetTransformDepthTotalAdj(COMPONENT_Y) );
    15611551
    15621552        m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiFullDepth ][ CI_TEMP_BEST ] );
     
    15721562      //----- code luma/chroma block with given intra prediction mode and store Cbf-----
    15731563      dSingleCost   = 0.0;
    1574       if (rTu.ProcessComponentSection(COMPONENT_Y))
    1575       {
    1576         const UInt totalAdjustedDepthChan   = rTu.GetTransformDepthTotalAdj(COMPONENT_Y);
    1577         pcCU ->setTransformSkipSubParts ( 0, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
    1578       }
    1579 
     1564
     1565      pcCU ->setTransformSkipSubParts ( 0, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
    15801566      xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug));
    15811567
     
    16891675    pcCU->setTrIdxSubParts( uiTrDepth, uiAbsPartIdx, uiFullDepth );
    16901676    const TComRectangle &tuRect=rTu.getRect(COMPONENT_Y);
    1691     const UInt totalAdjustedDepthChan   = rTu.GetTransformDepthTotalAdj(COMPONENT_Y);
    16921677    pcCU->setCbfSubParts  ( uiSingleCbfLuma << uiTrDepth, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
    16931678    pcCU ->setTransformSkipSubParts  ( bestModeId[COMPONENT_Y], COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
     
    22432228  //{
    22442229    //===== init pattern for luma prediction =====
    2245     Bool bAboveAvail = false;
    2246     Bool bLeftAvail  = false;
    22472230    DEBUG_STRING_NEW(sTemp2)
    22482231
     
    22522235    Int numModesForFullRD = m_pcEncCfg->getFastUDIUseMPMEnabled()?g_aucIntraModeNumFast_UseMPM[ uiWidthBit ] : g_aucIntraModeNumFast_NotUseMPM[ uiWidthBit ];
    22532236
    2254     if (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y))
    2255     {
    2256       initIntraPatternChType( tuRecurseWithPU, bAboveAvail, bLeftAvail, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) );
    2257     }
     2237    // this should always be true
     2238    assert (tuRecurseWithPU.ProcessComponentSection(COMPONENT_Y));
     2239    initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, true DEBUG_STRING_PASS_INTO(sTemp2) );
    22582240
    22592241    Bool doFastSearch = (numModesForFullRD != numModesAvailable);
     
    23192301        const Bool bUseFilter=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag());
    23202302
    2321         predIntraAng( COMPONENT_Y, uiMode, piOrg, uiStride, piPred, uiStride, tuRecurseWithPU, bAboveAvail, bLeftAvail, bUseFilter, TComPrediction::UseDPCMForFirstPassIntraEstimation(tuRecurseWithPU, uiMode) );
     2303        predIntraAng( COMPONENT_Y, uiMode, piOrg, uiStride, piPred, uiStride, tuRecurseWithPU, bUseFilter, TComPrediction::UseDPCMForFirstPassIntraEstimation(tuRecurseWithPU, uiMode) );
    23222304
    23232305        // use hadamard transform here
Note: See TracChangeset for help on using the changeset viewer.