Changeset 287 in SHVCSoftware for branches/SHM-2.1-dev/source
- Timestamp:
- 12 Jun 2013, 00:02:03 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r286 r287 242 242 } 243 243 244 245 244 //========== vertical upsampling =========== 246 245 pcTempPic->setBorderExtension(false); … … 269 268 270 269 piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL; 271 piDstY = piDstBufY + j * strideEL; 272 #if SCALED_REF_LAYER_OFFSETS 273 for( i = 0; i < leftStartL; i++ ) 274 { 275 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 276 piDstY++; 277 } 278 279 for( i = leftStartL; i < rightEndL-1; i++ ) 270 #if SCALED_REF_LAYER_OFFSETS 271 #if 1 // it should provide identical result 272 Pel* piDstY0 = piDstBufY + j * strideEL; 273 piDstY = piDstY0 + ( leftStartL > 0 ? leftStartL : 0 ); 274 275 for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- ) 280 276 { 281 277 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); … … 284 280 } 285 281 286 for( i = rightEndL-1; i < pcTempPic->getWidth(); i++ ) 282 for( i = rightEndL; i < pcTempPic->getWidth(); i++ ) 283 { 284 *piDstY = piDstY0[rightEndL-1]; 285 piDstY++; 286 } 287 288 piDstY = piDstY0; 289 for( i = 0; i < leftStartL; i++ ) 290 { 291 *piDstY = piDstY0[leftStartL]; 292 piDstY++; 293 } 294 #else 295 piDstY = piDstBufY + j * strideEL; 296 297 for( i = 0; i < pcTempPic->getWidth(); i++ ) 287 298 { 288 299 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 300 301 // Only increase the x position of reference upsample picture when within the window 302 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndL-1 303 if( (i >= leftStartL) && (i <= rightEndL-2) ) 304 { 305 piSrcY++; 306 } 289 307 piDstY++; 290 308 } 291 #else 309 #endif 310 #else 311 piDstY = piDstBufY + j * strideEL; 312 292 313 for( i = 0; i < widthEL; i++ ) 293 314 { … … 411 432 refPos = refPos16 >> 4; 412 433 coeff = m_chromaFilter[phase]; 413 434 414 435 piSrcU = piTempBufU + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 415 436 piSrcV = piTempBufV + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 416 417 piDstU = piDstBufU + j*strideEL; 418 piDstV = piDstBufV + j*strideEL; 419 420 #if SCALED_REF_LAYER_OFFSETS 421 for( i = 0; i < leftStartC; i++ ) 422 { 423 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 424 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 425 piDstU++; 426 piDstV++; 427 } 428 429 for( i = leftStartC; i < rightEndC-1; i++ ) 437 #if SCALED_REF_LAYER_OFFSETS 438 #if 1 // it should provide identical result 439 Pel* piDstU0 = piDstBufU + j*strideEL; 440 Pel* piDstV0 = piDstBufV + j*strideEL; 441 piDstU = piDstU0 + ( leftStartC > 0 ? leftStartC : 0 ); 442 piDstV = piDstV0 + ( leftStartC > 0 ? leftStartC : 0 ); 443 444 for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- ) 430 445 { 431 446 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); … … 437 452 } 438 453 439 for( i = rightEndC-1; i < pcTempPic->getWidth() >> 1; i++ ) 454 for( i = rightEndC; i < pcTempPic->getWidth() >> 1; i++ ) 455 { 456 *piDstU = piDstU0[rightEndC-1]; 457 *piDstV = piDstV0[rightEndC-1]; 458 piDstU++; 459 piDstV++; 460 } 461 462 piDstU = piDstU0; 463 piDstV = piDstV0; 464 for( i = 0; i < leftStartC; i++ ) 465 { 466 *piDstU = piDstU0[leftStartC]; 467 *piDstV = piDstV0[leftStartC]; 468 piDstU++; 469 piDstV++; 470 } 471 #else 472 piDstU = piDstBufU + j*strideEL; 473 piDstV = piDstBufV + j*strideEL; 474 475 for( i = 0; i < pcTempPic->getWidth() >> 1; i++ ) 440 476 { 441 477 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 442 478 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 479 480 // Only increase the x position of reference upsample picture when within the window 481 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndC-1 482 if( (i >= leftStartC) && (i <= rightEndC-2) ) 483 { 484 piSrcU++; 485 piSrcV++; 486 } 487 443 488 piDstU++; 444 489 piDstV++; 445 490 } 446 #else 491 #endif 492 #else 493 piDstU = piDstBufU + j*strideEL; 494 piDstV = piDstBufV + j*strideEL; 495 447 496 for( i = 0; i < widthEL; i++ ) 448 497 {
Note: See TracChangeset for help on using the changeset viewer.