void CFixedHashCache<TConcreteObj>::ClearCache(time_t& stTime) { TConcreteObj* pObj = NULL; CIdx *pIdx = NULL; time_t* pstCreatedTime = NULL; int iNextIdx; int iObjID = m_pAllocator->GetUsedHead(); while (iObjID != -1) { pObj = (TConcreteObj*)m_pAllocator->GetObj(iObjID); ASSERT_AND_LOG_RTN_VOID(pObj); // TRACESVR("obj id: %d, uin: %u\n", iObjID, pObj->GetUin()); pIdx = m_pAllocator->GetIdx(iObjID); ASSERT_AND_LOG_RTN_VOID(pIdx); iNextIdx = pIdx->GetNextIdx(); pstCreatedTime = pObj->GetCreatedTime(); if (*pstCreatedTime <= stTime) { TRACESVR("clear obj cache, id: %d\n", iObjID); DeleteByKey(pObj->GetKey()); } iObjID = iNextIdx; } }
Void MbTransformCoeffs::add( MbTransformCoeffs* pcCoeffs, Bool bLuma, Bool bChroma ) { if( bLuma ) { for( B4x4Idx bIdx; bIdx.isLegal(); bIdx++ ) { TCoeff* piCoeff = get( bIdx ); TCoeff* piSrcCoeff = pcCoeffs->get( bIdx ); for( UInt ui=0; ui<16; ui++ ) { piCoeff[ui]+= piSrcCoeff[ui]; } } } if( bChroma ) { for( CIdx cIdx; cIdx.isLegal(); cIdx++ ) { TCoeff* piCoeff = get( cIdx ); TCoeff* piSrcCoeff = pcCoeffs->get( cIdx ); for( UInt ui=0; ui<16; ui++ ) { piCoeff[ui] += piSrcCoeff[ui]; } } } }
Void MbTransformCoeffs::switchLevelCoeffData() { TCoeff sTemp; for( B4x4Idx bIdx; bIdx.isLegal(); bIdx++ ) { //TCoeff* piCoeff = m_aaiLevel[bIdx]; TCoeff* piCoeff = get( bIdx ); for( UInt ui=0; ui<16; ui++ ) { sTemp = piCoeff[ui].getLevel(); piCoeff[ui].setLevel( piCoeff[ui].getCoeff() ); piCoeff[ui].setCoeff( sTemp ); } } for( CIdx cIdx; cIdx.isLegal(); cIdx++ ) { //TCoeff* piCoeff = m_aaiLevel[cIdx]; TCoeff* piCoeff = get( cIdx ); for( UInt ui=0; ui<16; ui++ ) { sTemp = piCoeff[ui].getLevel(); piCoeff[ui].setLevel( piCoeff[ui].getCoeff() ); piCoeff[ui].setCoeff( sTemp ); } } }
static int GetNextIdx(const int iIdx) { CIdx *pIdx = m_pAllocator->GetIdx(iIdx); if (pIdx) { return pIdx->GetNextIdx(); } return -1; }
// functions for SVC to AVC rewrite JVT-V035 Void MbTransformCoeffs::storeLevelData() { for( B4x4Idx bIdx; bIdx.isLegal(); bIdx++ ) { //TCoeff* piCoeff = m_aaiLevel[bIdx]; TCoeff* piCoeff = get( bIdx ); for( UInt ui=0; ui<16; ui++ ) piCoeff[ui].setLevel( piCoeff[ui].getCoeff() ); } for( CIdx cIdx; cIdx.isLegal(); cIdx++ ) { //TCoeff* piCoeff = m_aaiLevel[cIdx]; TCoeff* piCoeff = get( cIdx ); for( UInt ui=0; ui<16; ui++ ) piCoeff[ui].setLevel( piCoeff[ui].getCoeff() ); } }
ErrVal MbParser::xScanChromaBlocks( MbDataAccess& rcMbDataAccess, UInt uiChromCbp, UInt uiStart, UInt uiStop ) { ROTRS( 1 > uiChromCbp, Err::m_nOK ); if( uiStart == 0 ) { DECRNOK( m_pcMbSymbolReadIf->residualBlock( rcMbDataAccess, CIdx(0), CHROMA_DC, uiStart, uiStop ) ); DECRNOK( m_pcMbSymbolReadIf->residualBlock( rcMbDataAccess, CIdx(4), CHROMA_DC, uiStart, uiStop ) ); } ROTRS( 2 > uiChromCbp, Err::m_nOK ); for( CIdx cCIdx; cCIdx.isLegal(); cCIdx++ ) { if( uiStop > 1 ) { DECRNOK( m_pcMbSymbolReadIf->residualBlock( rcMbDataAccess, cCIdx, CHROMA_AC, uiStart, uiStop ) ); } } return Err::m_nOK; }