Changeset 17 in SHVCSoftware


Ignore:
Timestamp:
29 Jan 2013, 03:06:57 (12 years ago)
Author:
seregin
Message:

NO_RESIDUAL_FLAG_FOR_BLPRED: Root cbf for Intra_BL (L0437)

Location:
trunk/source/Lib
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComTrQuant.cpp

    r16 r17  
    14961496    assert(scalingListType < 6);
    14971497#if INTER_TRANSFORMSKIP
     1498#if NO_RESIDUAL_FLAG_FOR_BLPRED
     1499    if(pcCU->isIntraBL(uiAbsPartIdx) && eTxt == TEXT_LUMA)
     1500      invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eTxt, DC_IDX, pResi, uiStride, rpcCoeff, uiWidth, uiHeight, scalingListType, pcCU->getTransformSkip(uiAbsPartIdx, eTxt) );
     1501    else
     1502      invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eTxt, REG_DCT, pResi, uiStride, rpcCoeff, uiWidth, uiHeight, scalingListType, pcCU->getTransformSkip(uiAbsPartIdx, eTxt) );
     1503#else
    14981504    invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eTxt, REG_DCT, pResi, uiStride, rpcCoeff, uiWidth, uiHeight, scalingListType, pcCU->getTransformSkip(uiAbsPartIdx, eTxt) );
     1505#endif
    14991506#else
    15001507    invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eTxt, REG_DCT, pResi, uiStride, rpcCoeff, uiWidth, uiHeight, scalingListType );
     
    21072114  Int     ui16CtxCbf          = 0;
    21082115  Int     iBestLastIdxP1      = 0;
     2116#if NO_RESIDUAL_FLAG_FOR_BLPRED
     2117  if( (!pcCU->isIntra( uiAbsPartIdx ) || pcCU->isIntraBL( uiAbsPartIdx )) && eTType == TEXT_LUMA && pcCU->getTransformIdx( uiAbsPartIdx ) == 0 )
     2118#else
    21092119  if( !pcCU->isIntra( uiAbsPartIdx ) && eTType == TEXT_LUMA && pcCU->getTransformIdx( uiAbsPartIdx ) == 0 )
     2120#endif
    21102121  {
    21112122    ui16CtxCbf   = 0;
  • trunk/source/Lib/TLibCommon/TComYuv.cpp

    r2 r17  
    184184}
    185185
     186#if NO_RESIDUAL_FLAG_FOR_BLPRED
     187Void TComYuv::copyFromPicLuma  ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiZorderIdxInCU, UInt uiAbsZorderIdx, UInt uiWidth, UInt uiHeight )
     188{
     189  Int  y;
     190
     191  Pel* pDst     = getLumaAddr(uiAbsZorderIdx);
     192  Pel* pSrc     = pcPicYuvSrc->getLumaAddr ( iCuAddr, uiZorderIdxInCU + uiAbsZorderIdx );
     193
     194  UInt  iDstStride  = getStride();
     195  UInt  iSrcStride  = pcPicYuvSrc->getStride();
     196  for ( y = uiHeight; y != 0; y-- )
     197  {
     198    ::memcpy( pDst, pSrc, sizeof(Pel)*uiWidth);
     199    pDst += iDstStride;
     200    pSrc += iSrcStride;
     201  }
     202}
     203
     204Void TComYuv::copyFromPicChroma( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiZorderIdxInCU, UInt uiAbsZorderIdx, UInt uiCWidth, UInt uiCHeight, UInt uiChromaId  )
     205{
     206  Int  y;
     207
     208  if (!uiChromaId)
     209  {
     210    Pel* pDstU      = getCbAddr(uiAbsZorderIdx);
     211    Pel* pSrcU      = pcPicYuvSrc->getCbAddr( iCuAddr, uiZorderIdxInCU + uiAbsZorderIdx );
     212
     213    UInt  iDstStride = getCStride();
     214    UInt  iSrcStride = pcPicYuvSrc->getCStride();
     215    for ( y = uiCHeight; y != 0; y-- )
     216    {
     217      ::memcpy( pDstU, pSrcU, sizeof(Pel)*(uiCWidth) );
     218      pSrcU += iSrcStride;
     219      pDstU += iDstStride;
     220    }
     221  }
     222  else
     223  {
     224    Pel* pDstV      = getCrAddr(uiAbsZorderIdx);
     225    Pel* pSrcV      = pcPicYuvSrc->getCrAddr( iCuAddr, uiZorderIdxInCU + uiAbsZorderIdx );
     226
     227    UInt  iDstStride = getCStride();
     228    UInt  iSrcStride = pcPicYuvSrc->getCStride();
     229    for ( y = uiCHeight; y != 0; y-- )
     230    {
     231      ::memcpy( pDstV, pSrcV, sizeof(Pel)*(uiCWidth) );
     232      pSrcV += iSrcStride;
     233      pDstV += iDstStride;
     234    }
     235  }
     236}
     237#endif
     238
    186239Void TComYuv::copyToPartYuv( TComYuv* pcYuvDst, UInt uiDstPartIdx )
    187240{
  • trunk/source/Lib/TLibCommon/TComYuv.h

    r2 r17  
    115115  Void    copyFromPicLuma      ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiAbsZorderIdx );
    116116  Void    copyFromPicChroma    ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiAbsZorderIdx );
     117#if NO_RESIDUAL_FLAG_FOR_BLPRED
     118  Void          copyFromPicLuma  ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiZorderIdxInCU, UInt uiAbsZorderIdx, UInt uiWidth, UInt uiHeight );
     119  Void    copyFromPicChroma( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiZorderIdxInCU, UInt uiAbsZorderIdx, UInt uiCWidth, UInt uiCHeight, UInt uiChromaId  );
     120#endif
    117121 
    118122  //  Copy Small YUV buffer to the part of other Big YUV buffer
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r15 r17  
    6060#if INTRA_BL
    6161#define INTRA_BL_DST4x4                  1      ///< L0067/L0204 DST4x4 for Intra BL
     62#define NO_RESIDUAL_FLAG_FOR_BLPRED      1      ///< L0437 Root cbf for Intra_BL
    6263
    6364// Hooks
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r2 r17  
    472472#if INTRA_BL
    473473    case MODE_INTRA_BL:
     474#if NO_RESIDUAL_FLAG_FOR_BLPRED
     475      xReconIntraBL( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
     476#else
    474477      xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
     478#endif
    475479      break;
    476480#endif
     
    741745}
    742746
     747#if NO_RESIDUAL_FLAG_FOR_BLPRED
     748Void
     749TDecCu::xReconIntraBL( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     750{
     751  m_ppcYuvReco[uiDepth]->copyFromPicLuma  ( pcCU->getSlice()->getFullPelBaseRec(),  pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, pcCU->getWidth(0), pcCU->getHeight(0));
     752  m_ppcYuvReco[uiDepth]->copyFromPicChroma( pcCU->getSlice()->getFullPelBaseRec(),  pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, (pcCU->getWidth(0)>>1), (pcCU->getHeight(0)>>1), 0);
     753  m_ppcYuvReco[uiDepth]->copyFromPicChroma( pcCU->getSlice()->getFullPelBaseRec(),  pcCU->getAddr(), pcCU->getZorderIdxInCU(), 0, (pcCU->getWidth(0)>>1), (pcCU->getHeight(0)>>1), 1);
     754
     755  // inter recon
     756  xDecodeInterTexture( pcCU, 0, uiDepth );
     757
     758  // clip for only non-zero cbp case
     759  if  ( ( pcCU->getCbf( 0, TEXT_LUMA ) ) || ( pcCU->getCbf( 0, TEXT_CHROMA_U ) ) || ( pcCU->getCbf(0, TEXT_CHROMA_V ) ) )
     760  {
     761    m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) );
     762  }
     763  else
     764  {
     765    m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 ));
     766  }
     767}
     768#endif
    743769
    744770/** Function for deriving recontructed PU/CU Luma sample with QTree structure
  • trunk/source/Lib/TLibDecoder/TDecCu.h

    r2 r17  
    122122  Void  xIntraRecLumaBlk        ( TComDataCU* pcCU, UInt uiTrDepth, UInt uiAbsPartIdx, TComYuv* pcRecoYuv, TComYuv* pcPredYuv, TComYuv* pcResiYuv );
    123123  Void  xIntraRecChromaBlk      ( TComDataCU* pcCU, UInt uiTrDepth, UInt uiAbsPartIdx, TComYuv* pcRecoYuv, TComYuv* pcPredYuv, TComYuv* pcResiYuv, UInt uiChromaId );
     124#if NO_RESIDUAL_FLAG_FOR_BLPRED
     125  Void  xReconIntraBL           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     126#endif
    124127 
    125128  Void  xReconPCM               ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r2 r17  
    487487    pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth );
    488488#if INTRA_BL
     489#if NO_RESIDUAL_FLAG_FOR_BLPRED
     490    if( ( !pcCU->isIntra(uiAbsPartIdx) || pcCU->isIntraBL(uiAbsPartIdx)) && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
     491#else
    489492    if( ( !pcCU->isIntra(uiAbsPartIdx) ) && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
     493#endif
    490494#else
    491495    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
     
    597601  UInt uiChromaOffset = uiLumaOffset>>2;
    598602 
     603#if NO_RESIDUAL_FLAG_FOR_BLPRED
     604  if( pcCU->isIntra(uiAbsPartIdx) && !pcCU->isIntraBL(uiAbsPartIdx) )
     605#else
    599606  if( pcCU->isIntra(uiAbsPartIdx) )
     607#endif
    600608  {
    601609  }
  • trunk/source/Lib/TLibEncoder/TEncCu.cpp

    r2 r17  
    15031503
    15041504  m_pcPredSearch->setBaseRecPic( m_pcPicYuvRecBase );
     1505#if NO_RESIDUAL_FLAG_FOR_BLPRED
     1506  rpcTempCU->setDepthSubParts( uiDepth, 0 );
     1507  //   rpcTempCU->setLumaIntraDirSubParts( DC_IDX, 0, uiDepth );
     1508  //   rpcTempCU->setChromIntraDirSubParts( DC_IDX, 0, uiDepth );
     1509  m_ppcPredYuvTemp[uiDepth]->copyFromPicLuma  ( rpcTempCU->getSlice()->getFullPelBaseRec(),  rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU(), 0, rpcTempCU->getWidth(0), rpcTempCU->getHeight(0));
     1510  m_ppcPredYuvTemp[uiDepth]->copyFromPicChroma( rpcTempCU->getSlice()->getFullPelBaseRec(),  rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU(), 0, (rpcTempCU->getWidth(0)>>1), (rpcTempCU->getHeight(0)>>1), 0);
     1511  m_ppcPredYuvTemp[uiDepth]->copyFromPicChroma( rpcTempCU->getSlice()->getFullPelBaseRec(),  rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU(), 0, (rpcTempCU->getWidth(0)>>1), (rpcTempCU->getHeight(0)>>1), 1);
     1512  m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcResiYuvBest[uiDepth], m_ppcRecoYuvTemp[uiDepth], false );
     1513  rpcTempCU->getTotalCost()  = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
     1514#else
     1515
    15051516  m_pcPredSearch->estIntraBLPredQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth] );
    15061517
     
    15261537  }
    15271538  rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
     1539#endif
    15281540 
    15291541  xCheckDQP( rpcTempCU );
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r6 r17  
    476476#endif
    477477#if INTRA_BL
     478#if NO_RESIDUAL_FLAG_FOR_BLPRED
     479    if( ( !pcCU->isIntra( uiAbsPartIdx ) || pcCU->isIntraBL(uiAbsPartIdx)) && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
     480#else
    478481    if( ( !pcCU->isIntra( uiAbsPartIdx ) ) && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
     482#endif
    479483#else   
    480484    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
     
    754758  pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode );
    755759 
     760#if NO_RESIDUAL_FLAG_FOR_BLPRED
     761  if( pcCU->isIntra(uiAbsPartIdx) && !pcCU->isIntraBL(uiAbsPartIdx) )
     762#else
    756763  if( pcCU->isIntra(uiAbsPartIdx) )
     764#endif
    757765  {
    758766    DTRACE_CABAC_VL( g_nSymbolCounter++ )
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r6 r17  
    47174717Void TEncSearch::encodeResAndCalcRdInterCU( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* pcYuvPred, TComYuv*& rpcYuvResi, TComYuv*& rpcYuvResiBest, TComYuv*& rpcYuvRec, Bool bSkipRes )
    47184718{
     4719#if NO_RESIDUAL_FLAG_FOR_BLPRED
     4720  if ( pcCU->isIntra(0) && !pcCU->isIntraBL(0))
     4721#else
    47194722  if ( pcCU->isIntra(0) )
     4723#endif
    47204724  {
    47214725    return;
     
    48404844#endif
    48414845    }
     4846#if NO_RESIDUAL_FLAG_FOR_BLPRED
     4847    else if(pcCU->getLayerId() > 0 && pcCU->isIntraBL(0) && uiZeroDistortion == uiDistortion) // all zeros
     4848    {
     4849      const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (pcCU->getDepth(0) << 1);
     4850      ::memset( pcCU->getTransformIdx()      , 0, uiQPartNum * sizeof(UChar) );
     4851      ::memset( pcCU->getCbf( TEXT_LUMA )    , 0, uiQPartNum * sizeof(UChar) );
     4852      ::memset( pcCU->getCbf( TEXT_CHROMA_U ), 0, uiQPartNum * sizeof(UChar) );
     4853      ::memset( pcCU->getCbf( TEXT_CHROMA_V ), 0, uiQPartNum * sizeof(UChar) );
     4854      ::memset( pcCU->getCoeffY()            , 0, uiWidth * uiHeight * sizeof( TCoeff )      );
     4855      ::memset( pcCU->getCoeffCb()           , 0, uiWidth * uiHeight * sizeof( TCoeff ) >> 2 );
     4856      ::memset( pcCU->getCoeffCr()           , 0, uiWidth * uiHeight * sizeof( TCoeff ) >> 2 );
     4857#if INTER_TRANSFORMSKIP
     4858      pcCU->setTransformSkipSubParts ( 0, 0, 0, 0, pcCU->getDepth(0) );
     4859#endif
     4860    }
     4861#endif
    48424862    else
    48434863    {
     
    51755195      Int scalingListType = 3 + g_eTTable[(Int)TEXT_LUMA];
    51765196      assert(scalingListType < 6);     
     5197#if NO_RESIDUAL_FLAG_FOR_BLPRED
     5198      if(pcCU->isIntraBL(uiAbsPartIdx) )
     5199        m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,DC_IDX, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType );//this is for inter mode only
     5200      else
     5201        m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType );//this is for inter mode only
     5202#else
    51775203      m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType );//this is for inter mode only
     5204#endif
    51785205     
    51795206      const UInt uiNonzeroDistY = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( absTUPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),
     
    55145541        assert(scalingListType < 6);     
    55155542
     5543#if NO_RESIDUAL_FLAG_FOR_BLPRED
     5544        if(pcCU->isIntraBL(uiAbsPartIdx) )
     5545          m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,DC_IDX, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType, true );
     5546        else
     5547          m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType, true );
     5548#else
    55165549        m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, trWidth, trHeight, scalingListType, true );
     5550#endif
    55175551
    55185552        uiNonzeroDistY = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( absTUPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),
     
    58825916  {
    58835917#if INTRA_BL
     5918#if NO_RESIDUAL_FLAG_FOR_BLPRED
     5919    assert( !pcCU->isIntra(uiAbsPartIdx) || pcCU->isIntraBL(uiAbsPartIdx));
     5920#else
    58845921    assert( !pcCU->isIntra(uiAbsPartIdx) );
     5922#endif
    58855923#else
    58865924    assert( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA );
     
    61596197    {
    61606198      m_pcEntropyCoder->encodeIntraBLFlag(pcCU, 0, true);
     6199#if !NO_RESIDUAL_FLAG_FOR_BLPRED
    61616200      assert( pcCU->isIntraBL( 0 ) == false );
    6162     }
     6201#endif
     6202    }
     6203#endif
     6204#if NO_RESIDUAL_FLAG_FOR_BLPRED
     6205    if( !pcCU->isIntraBL(0))
     6206    {
    61636207#endif
    61646208    m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
    61656209    m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
    61666210    m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
     6211#if NO_RESIDUAL_FLAG_FOR_BLPRED
     6212    }
     6213#endif
    61676214    Bool bDummy = false;
    61686215    m_pcEntropyCoder->encodeCoeff   ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy );
Note: See TracChangeset for help on using the changeset viewer.