- Timestamp:
- 29 Jan 2013, 03:06:57 (12 years ago)
- Location:
- trunk/source/Lib
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComTrQuant.cpp
r16 r17 1496 1496 assert(scalingListType < 6); 1497 1497 #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 1498 1504 invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eTxt, REG_DCT, pResi, uiStride, rpcCoeff, uiWidth, uiHeight, scalingListType, pcCU->getTransformSkip(uiAbsPartIdx, eTxt) ); 1505 #endif 1499 1506 #else 1500 1507 invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eTxt, REG_DCT, pResi, uiStride, rpcCoeff, uiWidth, uiHeight, scalingListType ); … … 2107 2114 Int ui16CtxCbf = 0; 2108 2115 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 2109 2119 if( !pcCU->isIntra( uiAbsPartIdx ) && eTType == TEXT_LUMA && pcCU->getTransformIdx( uiAbsPartIdx ) == 0 ) 2120 #endif 2110 2121 { 2111 2122 ui16CtxCbf = 0; -
trunk/source/Lib/TLibCommon/TComYuv.cpp
r2 r17 184 184 } 185 185 186 #if NO_RESIDUAL_FLAG_FOR_BLPRED 187 Void 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 204 Void 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 186 239 Void TComYuv::copyToPartYuv( TComYuv* pcYuvDst, UInt uiDstPartIdx ) 187 240 { -
trunk/source/Lib/TLibCommon/TComYuv.h
r2 r17 115 115 Void copyFromPicLuma ( TComPicYuv* pcPicYuvSrc, UInt iCuAddr, UInt uiAbsZorderIdx ); 116 116 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 117 121 118 122 // Copy Small YUV buffer to the part of other Big YUV buffer -
trunk/source/Lib/TLibCommon/TypeDef.h
r15 r17 60 60 #if INTRA_BL 61 61 #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 62 63 63 64 // Hooks -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r2 r17 472 472 #if INTRA_BL 473 473 case MODE_INTRA_BL: 474 #if NO_RESIDUAL_FLAG_FOR_BLPRED 475 xReconIntraBL( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 476 #else 474 477 xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 478 #endif 475 479 break; 476 480 #endif … … 741 745 } 742 746 747 #if NO_RESIDUAL_FLAG_FOR_BLPRED 748 Void 749 TDecCu::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 743 769 744 770 /** Function for deriving recontructed PU/CU Luma sample with QTree structure -
trunk/source/Lib/TLibDecoder/TDecCu.h
r2 r17 122 122 Void xIntraRecLumaBlk ( TComDataCU* pcCU, UInt uiTrDepth, UInt uiAbsPartIdx, TComYuv* pcRecoYuv, TComYuv* pcPredYuv, TComYuv* pcResiYuv ); 123 123 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 124 127 125 128 Void xReconPCM ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
r2 r17 487 487 pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth ); 488 488 #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 489 492 if( ( !pcCU->isIntra(uiAbsPartIdx) ) && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) 493 #endif 490 494 #else 491 495 if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) … … 597 601 UInt uiChromaOffset = uiLumaOffset>>2; 598 602 603 #if NO_RESIDUAL_FLAG_FOR_BLPRED 604 if( pcCU->isIntra(uiAbsPartIdx) && !pcCU->isIntraBL(uiAbsPartIdx) ) 605 #else 599 606 if( pcCU->isIntra(uiAbsPartIdx) ) 607 #endif 600 608 { 601 609 } -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r2 r17 1503 1503 1504 1504 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 1505 1516 m_pcPredSearch->estIntraBLPredQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth] ); 1506 1517 … … 1526 1537 } 1527 1538 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 1539 #endif 1528 1540 1529 1541 xCheckDQP( rpcTempCU ); -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r6 r17 476 476 #endif 477 477 #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 478 481 if( ( !pcCU->isIntra( uiAbsPartIdx ) ) && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) 482 #endif 479 483 #else 480 484 if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) … … 754 758 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode ); 755 759 760 #if NO_RESIDUAL_FLAG_FOR_BLPRED 761 if( pcCU->isIntra(uiAbsPartIdx) && !pcCU->isIntraBL(uiAbsPartIdx) ) 762 #else 756 763 if( pcCU->isIntra(uiAbsPartIdx) ) 764 #endif 757 765 { 758 766 DTRACE_CABAC_VL( g_nSymbolCounter++ ) -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r6 r17 4717 4717 Void TEncSearch::encodeResAndCalcRdInterCU( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* pcYuvPred, TComYuv*& rpcYuvResi, TComYuv*& rpcYuvResiBest, TComYuv*& rpcYuvRec, Bool bSkipRes ) 4718 4718 { 4719 #if NO_RESIDUAL_FLAG_FOR_BLPRED 4720 if ( pcCU->isIntra(0) && !pcCU->isIntraBL(0)) 4721 #else 4719 4722 if ( pcCU->isIntra(0) ) 4723 #endif 4720 4724 { 4721 4725 return; … … 4840 4844 #endif 4841 4845 } 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 4842 4862 else 4843 4863 { … … 5175 5195 Int scalingListType = 3 + g_eTTable[(Int)TEXT_LUMA]; 5176 5196 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 5177 5203 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 5178 5205 5179 5206 const UInt uiNonzeroDistY = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( absTUPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), … … 5514 5541 assert(scalingListType < 6); 5515 5542 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 5516 5549 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType, true ); 5550 #endif 5517 5551 5518 5552 uiNonzeroDistY = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( absTUPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), … … 5882 5916 { 5883 5917 #if INTRA_BL 5918 #if NO_RESIDUAL_FLAG_FOR_BLPRED 5919 assert( !pcCU->isIntra(uiAbsPartIdx) || pcCU->isIntraBL(uiAbsPartIdx)); 5920 #else 5884 5921 assert( !pcCU->isIntra(uiAbsPartIdx) ); 5922 #endif 5885 5923 #else 5886 5924 assert( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA ); … … 6159 6197 { 6160 6198 m_pcEntropyCoder->encodeIntraBLFlag(pcCU, 0, true); 6199 #if !NO_RESIDUAL_FLAG_FOR_BLPRED 6161 6200 assert( pcCU->isIntraBL( 0 ) == false ); 6162 } 6201 #endif 6202 } 6203 #endif 6204 #if NO_RESIDUAL_FLAG_FOR_BLPRED 6205 if( !pcCU->isIntraBL(0)) 6206 { 6163 6207 #endif 6164 6208 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 6165 6209 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 6166 6210 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 6211 #if NO_RESIDUAL_FLAG_FOR_BLPRED 6212 } 6213 #endif 6167 6214 Bool bDummy = false; 6168 6215 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.