/** Create non-deblocked filter information for LCU * \param tileID tile index * \param sliceID slice index * \param pcCU CU data pointer * \param startSU start SU index in LCU * \param endSU end SU index in LCU * \param sliceGranularyDepth slice granularity * \param picWidth picture width * \param picHeight picture height */ Void TComPic::createNonDBFilterInfoLCU(Int tileID, Int sliceID, TComDataCU* pcCU, UInt startSU, UInt endSU, Int sliceGranularyDepth, UInt picWidth, UInt picHeight) { UInt LCUX = pcCU->getCUPelX(); UInt LCUY = pcCU->getCUPelY(); Int* pCUSliceMap = pcCU->getSliceSUMap(); UInt maxNumSUInLCU = getNumPartInCU(); UInt maxNumSUInSGU = maxNumSUInLCU >> (sliceGranularyDepth << 1); UInt maxNumSUInLCUWidth = getNumPartInWidth(); UInt LPelX, TPelY; UInt currSU; //get the number of valid NBFilterBLock currSU = startSU; while(currSU <= endSU) { LPelX = LCUX + g_auiRasterToPelX[ g_auiZscanToRaster[currSU] ]; TPelY = LCUY + g_auiRasterToPelY[ g_auiZscanToRaster[currSU] ]; while(!( LPelX < picWidth ) || !( TPelY < picHeight )) { currSU += maxNumSUInSGU; if(currSU >= maxNumSUInLCU || currSU > endSU) { break; } LPelX = LCUX + g_auiRasterToPelX[ g_auiZscanToRaster[currSU] ]; TPelY = LCUY + g_auiRasterToPelY[ g_auiZscanToRaster[currSU] ]; } if(currSU >= maxNumSUInLCU || currSU > endSU) { break; } NDBFBlockInfo NDBFBlock; NDBFBlock.tileID = tileID; NDBFBlock.sliceID = sliceID; NDBFBlock.posY = TPelY; NDBFBlock.posX = LPelX; NDBFBlock.startSU = currSU; UInt uiLastValidSU = currSU; UInt uiIdx, uiLPelX_su, uiTPelY_su; for(uiIdx = currSU; uiIdx < currSU + maxNumSUInSGU; uiIdx++) { if(uiIdx > endSU) { break; } uiLPelX_su = LCUX + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ]; uiTPelY_su = LCUY + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; if( !(uiLPelX_su < picWidth ) || !( uiTPelY_su < picHeight )) { continue; } pCUSliceMap[uiIdx] = sliceID; uiLastValidSU = uiIdx; } NDBFBlock.endSU = uiLastValidSU; UInt rTLSU = g_auiZscanToRaster[ NDBFBlock.startSU ]; UInt rBRSU = g_auiZscanToRaster[ NDBFBlock.endSU ]; NDBFBlock.widthSU = (rBRSU % maxNumSUInLCUWidth) - (rTLSU % maxNumSUInLCUWidth)+ 1; NDBFBlock.heightSU = (UInt)(rBRSU / maxNumSUInLCUWidth) - (UInt)(rTLSU / maxNumSUInLCUWidth)+ 1; NDBFBlock.width = NDBFBlock.widthSU * getMinCUWidth(); NDBFBlock.height = NDBFBlock.heightSU * getMinCUHeight(); pcCU->getNDBFilterBlocks()->push_back(NDBFBlock); currSU += maxNumSUInSGU; } }
Void TComPic::createNonDBFilterInfoLCU(Int iSliceID, TComDataCU* pcCU, UInt uiStartSU, UInt uiEndSU, Int iSliceGranularyDepth, UInt uiPicWidth, UInt uiPicHeight) #endif { UInt uiLCUX = pcCU->getCUPelX(); UInt uiLCUY = pcCU->getCUPelY(); Int* piCUSliceMap = pcCU->getSliceSUMap(); UInt uiMaxNumSUInLCU = getNumPartInCU(); UInt uiMaxNumSUInSGU = uiMaxNumSUInLCU >> (iSliceGranularyDepth << 1); UInt uiMaxNumSUInLCUWidth = getNumPartInWidth(); UInt uiLPelX, uiTPelY; UInt uiCurrSU; //get the number of valid NBFilterBLock uiCurrSU = uiStartSU; while(uiCurrSU <= uiEndSU) { uiLPelX = uiLCUX + g_auiRasterToPelX[ g_auiZscanToRaster[uiCurrSU] ]; uiTPelY = uiLCUY + g_auiRasterToPelY[ g_auiZscanToRaster[uiCurrSU] ]; while(!( uiLPelX < uiPicWidth ) || !( uiTPelY < uiPicHeight )) { uiCurrSU += uiMaxNumSUInSGU; if(uiCurrSU >= uiMaxNumSUInLCU || uiCurrSU > uiEndSU) { break; } uiLPelX = uiLCUX + g_auiRasterToPelX[ g_auiZscanToRaster[uiCurrSU] ]; uiTPelY = uiLCUY + g_auiRasterToPelY[ g_auiZscanToRaster[uiCurrSU] ]; } if(uiCurrSU >= uiMaxNumSUInLCU || uiCurrSU > uiEndSU) { break; } NDBFBlockInfo NDBFBlock; #if TILES NDBFBlock.tileID = iTileID; #endif NDBFBlock.sliceID = iSliceID; NDBFBlock.posY = uiTPelY; NDBFBlock.posX = uiLPelX; NDBFBlock.startSU = uiCurrSU; UInt uiLastValidSU = uiCurrSU; UInt uiIdx, uiLPelX_su, uiTPelY_su; for(uiIdx = uiCurrSU; uiIdx < uiCurrSU + uiMaxNumSUInSGU; uiIdx++) { if(uiIdx > uiEndSU) { break; } uiLPelX_su = uiLCUX + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ]; uiTPelY_su = uiLCUY + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; if( !(uiLPelX_su < uiPicWidth ) || !( uiTPelY_su < uiPicHeight )) { continue; } piCUSliceMap[uiIdx] = iSliceID; uiLastValidSU = uiIdx; } NDBFBlock.endSU = uiLastValidSU; UInt rTLSU = g_auiZscanToRaster[ NDBFBlock.startSU ]; UInt rBRSU = g_auiZscanToRaster[ NDBFBlock.endSU ]; NDBFBlock.widthSU = (rBRSU % uiMaxNumSUInLCUWidth) - (rTLSU % uiMaxNumSUInLCUWidth)+ 1; NDBFBlock.heightSU = (UInt)(rBRSU / uiMaxNumSUInLCUWidth) - (UInt)(rTLSU / uiMaxNumSUInLCUWidth)+ 1; NDBFBlock.width = NDBFBlock.widthSU * getMinCUWidth(); NDBFBlock.height = NDBFBlock.heightSU * getMinCUHeight(); pcCU->getNDBFilterBlocks()->push_back(NDBFBlock); uiCurrSU += uiMaxNumSUInSGU; } }