Changeset 1502 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
- Timestamp:
- 11 Dec 2015, 00:05:48 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r1500 r1502 64 64 const Window &windowRL = currSlice->getPPS()->getRefLayerWindowForLayer(refLayerId); 65 65 66 Int bitDepthLuma = currSlice->get BitDepth(CHANNEL_TYPE_LUMA);67 Int bitDepthChroma = currSlice->get BitDepth(CHANNEL_TYPE_CHROMA);66 Int bitDepthLuma = currSlice->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA); 67 Int bitDepthChroma = currSlice->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA); 68 68 69 69 //========== Y component upsampling =========== … … 76 76 Int strideEL = pcUsPic->getStride(COMPONENT_Y); 77 77 78 ChromaFormat chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc(); 78 ChromaFormat chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getSPS()->getChromaFormatIdc(); 79 #if SCALABLE_REXT 80 Int chromaHorScalingEL = TComSPS::getWinUnitX( currSlice->getSPS()->getChromaFormatIdc() ); 81 Int chromaVerScalingEL = TComSPS::getWinUnitY( currSlice->getSPS()->getChromaFormatIdc() ); 82 83 Int chromaHorScalingBL = TComSPS::getWinUnitX( chromaFormatIdc ); 84 Int chromaVerScalingBL = TComSPS::getWinUnitY( chromaFormatIdc ); 85 #else 79 86 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 80 87 Int yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 88 #endif 81 89 82 90 const ResamplingPhase &resamplingPhase = currSlice->getPPS()->getResamplingPhase( refLayerId ); … … 151 159 152 160 #if SCALABLE_REXT 153 if( chromaFormatIdc != 0)161 if( chromaFormatIdc != CHROMA_400 ) 154 162 { 155 #endif 163 widthEL /= chromaHorScalingEL; 164 heightEL /= chromaVerScalingEL; 165 widthBL /= chromaHorScalingBL; 166 heightBL /= chromaVerScalingBL; 167 #else 156 168 widthEL >>= 1; 157 169 heightEL >>= 1; … … 159 171 widthBL >>= 1; 160 172 heightBL >>= 1; 173 #endif 161 174 162 175 strideBL = pcBasePic->getStride( COMPONENT_Cb ); … … 166 179 piSrcV = piSrcBufV; 167 180 181 #if SCALABLE_REXT 182 piDstU = piDstBufU + ( scalEL.getWindowLeftOffset() / chromaHorScalingEL ) + ( scalEL.getWindowTopOffset() / chromaVerScalingEL ) * strideEL; 183 piDstV = piDstBufV + ( scalEL.getWindowLeftOffset() / chromaHorScalingEL ) + ( scalEL.getWindowTopOffset() / chromaVerScalingEL ) * strideEL; 184 #else 168 185 piDstU = piDstBufU + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL; 169 186 piDstV = piDstBufV + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL; 187 #endif 170 188 171 189 shift = bitDepthChroma - refBitDepthChroma; … … 309 327 310 328 #if SCALABLE_REXT 311 if( chromaFormatIdc != 0)329 if( chromaFormatIdc != CHROMA_400 ) 312 330 { 313 #endif 331 widthEL /= chromaHorScalingEL; 332 heightEL /= chromaVerScalingEL; 333 widthBL /= chromaHorScalingBL; 334 heightBL /= chromaVerScalingBL; 335 #else 314 336 widthEL >>= 1; 315 337 heightEL >>= 1; 316 338 widthBL >>= 1; 317 339 heightBL >>= 1; 340 #endif 318 341 319 342 strideBL = pcBasePic->getStride( COMPONENT_Cb ); 320 343 strideEL = pcUsPic->getStride( COMPONENT_Cb ); 321 344 345 #if SCALABLE_REXT 346 Int srlLOffsetC = scalEL.getWindowLeftOffset() / chromaHorScalingEL; 347 Int srlTOffsetC = scalEL.getWindowTopOffset() / chromaVerScalingEL; 348 #else 322 349 Int srlLOffsetC = scalEL.getWindowLeftOffset() >> 1; 323 350 Int srlTOffsetC = scalEL.getWindowTopOffset() >> 1; 351 #endif 352 324 353 rlClipL = -(NTAPS_US_CHROMA>>1); 325 354 rlClipR = widthBL -1 + (NTAPS_US_CHROMA>>1); … … 331 360 addX = ( ( resamplingPhase.phaseHorChroma * scaleX + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 332 361 addY = ( ( phaseVerChroma * scaleY + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 362 363 #if SCALABLE_REXT 364 Int refOffsetXC = (windowRL.getWindowLeftOffset() / chromaHorScalingBL) << 4; 365 Int refOffsetYC = (windowRL.getWindowTopOffset() / chromaVerScalingBL) << 4; 366 #else 333 367 Int refOffsetXC = (windowRL.getWindowLeftOffset() / xScal) << 4; 334 368 Int refOffsetYC = (windowRL.getWindowTopOffset() / yScal) << 4; 369 #endif 335 370 336 371 shiftXM4 = shiftX - 4; 337 372 shiftYM4 = shiftY - 4; 338 373 374 #if SCALABLE_REXT 375 widthEL = pcUsPic->getWidth (COMPONENT_Y) / chromaHorScalingEL; 376 heightEL = pcUsPic->getHeight(COMPONENT_Y) / chromaVerScalingEL; 377 378 widthBL = pcBasePic->getWidth (COMPONENT_Y) / chromaHorScalingBL; 379 heightBL = min<Int>( pcBasePic->getHeight(COMPONENT_Y) / chromaVerScalingBL, heightEL ); 380 #else 339 381 widthEL = pcUsPic->getWidth (COMPONENT_Y) >> 1; 340 382 heightEL = pcUsPic->getHeight(COMPONENT_Y) >> 1; … … 342 384 widthBL = pcBasePic->getWidth (COMPONENT_Y) >> 1; 343 385 heightBL = min<Int>( pcBasePic->getHeight(COMPONENT_Y) >> 1, heightEL ); 386 #endif 344 387 345 388 // shift1 should be calculated using BL bit-depth … … 382 425 //========== vertical upsampling =========== 383 426 pcTempPic->setBorderExtension(false); 427 #if SCALABLE_REXT 428 pcTempPic->setHeight(heightBL * chromaVerScalingBL); 429 #else 384 430 pcTempPic->setHeight(heightBL << 1); 431 #endif 385 432 pcTempPic->extendPicBorder (); // extend the border. 433 #if SCALABLE_REXT 434 pcTempPic->setHeight(heightEL * chromaVerScalingEL); 435 #else 386 436 pcTempPic->setHeight(heightEL << 1); 437 #endif 387 438 388 439 nShift = 20 - bitDepthChroma; … … 390 441 iOffset = 1 << (nShift - 1); 391 442 443 #if SCALABLE_REXT 444 for( j = 0; j < pcTempPic->getHeight(COMPONENT_Y) / chromaVerScalingEL; j++ ) 445 #else 392 446 for( j = 0; j < pcTempPic->getHeight(COMPONENT_Y) >> 1; j++ ) 447 #endif 393 448 { 394 449 Int y = j; … … 408 463 piDstV = piDstV0; 409 464 465 #if SCALABLE_REXT 466 for( i = pcTempPic->getWidth(COMPONENT_Y) / chromaHorScalingEL; i > 0; i-- ) 467 #else 410 468 for( i = pcTempPic->getWidth(COMPONENT_Y) >> 1; i > 0; i-- ) 469 #endif 411 470 { 412 471 *piDstU = ClipBD( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift), bitDepthChroma );
Note: See TracChangeset for help on using the changeset viewer.