- Timestamp:
- 8 Nov 2013, 06:30:38 (11 years ago)
- Location:
- branches/SHM-4.0-dev/source/Lib/TLibCommon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r448 r449 227 227 Int topStartL = scalEL.getWindowTopOffset(); 228 228 Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset(); 229 #if BUGFIX_RESAMPLE230 229 Int leftOffset = leftStartL > 0 ? leftStartL : 0; 231 #endif232 230 233 231 #if N0214_INTERMEDIATE_BUFFER_16BITS … … 281 279 282 280 piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL; 283 #if BUGFIX_RESAMPLE284 281 Pel* piDstY0 = piDstBufY + j * strideEL; 285 282 piDstY = piDstY0 + leftOffset; … … 305 302 piDstY++; 306 303 } 307 #else 308 #if 1 // it should provide identical result 309 Pel* piDstY0 = piDstBufY + j * strideEL; 310 piDstY = piDstY0 + ( leftStartL > 0 ? leftStartL : 0 ); 311 312 for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- ) 313 { 314 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 315 piSrcY++; 316 piDstY++; 317 } 318 319 for( i = rightEndL; i < pcTempPic->getWidth(); i++ ) 320 { 321 *piDstY = piDstY0[rightEndL-1]; 322 piDstY++; 323 } 324 325 piDstY = piDstY0; 326 for( i = 0; i < leftStartL; i++ ) 327 { 328 *piDstY = piDstY0[leftStartL]; 329 piDstY++; 330 } 331 #else 332 piDstY = piDstBufY + j * strideEL; 333 334 for( i = 0; i < pcTempPic->getWidth(); i++ ) 335 { 336 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 337 338 // Only increase the x position of reference upsample picture when within the window 339 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndL-1 340 if( (i >= leftStartL) && (i <= rightEndL-2) ) 341 { 342 piSrcY++; 343 } 344 piDstY++; 345 } 346 #endif 347 #endif 304 348 305 } 349 306 … … 369 326 Int topStartC = scalEL.getWindowTopOffset() >> 1; 370 327 Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1); 371 #if BUGFIX_RESAMPLE372 328 leftOffset = leftStartC > 0 ? leftStartC : 0; 373 #endif374 329 375 330 shiftX = 16; … … 452 407 refPos = refPos16 >> 4; 453 408 coeff = m_chromaFilter[phase]; 454 409 455 410 piSrcU = piTempBufU + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 456 411 piSrcV = piTempBufV + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL; 457 412 458 #if BUGFIX_RESAMPLE459 413 Pel* piDstU0 = piDstBufU + j*strideEL; 460 414 Pel* piDstV0 = piDstBufV + j*strideEL; … … 491 445 piDstV++; 492 446 } 493 #else 494 #if 1 // it should provide identical result 495 Pel* piDstU0 = piDstBufU + j*strideEL; 496 Pel* piDstV0 = piDstBufV + j*strideEL; 497 piDstU = piDstU0 + ( leftStartC > 0 ? leftStartC : 0 ); 498 piDstV = piDstV0 + ( leftStartC > 0 ? leftStartC : 0 ); 499 500 for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- ) 501 { 502 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 503 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 504 piSrcU++; 505 piSrcV++; 506 piDstU++; 507 piDstV++; 508 } 509 510 for( i = rightEndC; i < pcTempPic->getWidth() >> 1; i++ ) 511 { 512 *piDstU = piDstU0[rightEndC-1]; 513 *piDstV = piDstV0[rightEndC-1]; 514 piDstU++; 515 piDstV++; 516 } 517 518 piDstU = piDstU0; 519 piDstV = piDstV0; 520 for( i = 0; i < leftStartC; i++ ) 521 { 522 *piDstU = piDstU0[leftStartC]; 523 *piDstV = piDstV0[leftStartC]; 524 piDstU++; 525 piDstV++; 526 } 527 #else 528 piDstU = piDstBufU + j*strideEL; 529 piDstV = piDstBufV + j*strideEL; 530 531 for( i = 0; i < pcTempPic->getWidth() >> 1; i++ ) 532 { 533 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 534 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 535 536 // Only increase the x position of reference upsample picture when within the window 537 // "-2" to ensure that pointer doesn't go beyond the boundary rightEndC-1 538 if( (i >= leftStartC) && (i <= rightEndC-2) ) 539 { 540 piSrcU++; 541 piSrcV++; 542 } 543 544 piDstU++; 545 piDstV++; 546 } 547 #endif 548 #endif 447 549 448 } 550 449 } 551 552 553 554 555 556 557 450 pcUsPic->setBorderExtension(false); 451 pcUsPic->extendPicBorder (); // extend the border. 452 453 //Reset the Border extension flag 454 pcUsPic->setBorderExtension(false); 455 pcTempPic->setBorderExtension(false); 456 pcBasePic->setBorderExtension(false); 558 457 } 559 458 #endif //SVC_EXTENSION -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h
r448 r449 102 102 #define N0214_INTERMEDIATE_BUFFER_16BITS 1 ///< JCTVC-N0214: support base layer input more than 8 bits 103 103 #define ARBITRARY_SPATIAL_RATIO 0 ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio 104 #define BUGFIX_RESAMPLE 1 ///< JCTVC-N0055: resampling bug fix for positive left scalled offset105 104 106 105 #define JCTVC_M0259_LAMBDAREFINEMENT 1 ///< JCTVC-M0259: lambda refinement (encoder only optimization)
Note: See TracChangeset for help on using the changeset viewer.