Changeset 26 in SHVCSoftware for branches/SHM-1.0-dev
- Timestamp:
- 5 Feb 2013, 16:22:22 (12 years ago)
- Location:
- branches/SHM-1.0-dev/source/Lib/TLibCommon
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-1.0-dev/source/Lib/TLibCommon/TComPicYuv.h
r2 r26 129 129 #endif 130 130 131 #if JCTVC_L0178 132 Void setWidth ( Int iPicWidth ) { m_iPicWidth = iPicWidth; } 133 #endif 131 134 Int getStride () { return (m_iPicWidth ) + (m_iLumaMarginX <<1); } 132 135 Int getCStride () { return (m_iPicWidth >> 1) + (m_iChromaMarginX<<1); } -
branches/SHM-1.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r18 r26 143 143 Int iEHeight = pcUsPic->getHeight() - pcUsPic->getPicCropTopOffset() - pcUsPic->getPicCropBottomOffset(); 144 144 Int iEStride = pcUsPic->getStride(); 145 145 146 Pel* piTempBufY = pcTempPic->getLumaAddr(); 147 Pel* piSrcBufY = pcBasePic->getLumaAddr(); 148 Pel* piDstBufY = pcUsPic->getLumaAddr(); 149 150 Pel* piSrcY; 151 Pel* piDstY; 152 153 Pel* piTempBufU = pcTempPic->getCbAddr(); 154 Pel* piSrcBufU = pcBasePic->getCbAddr(); 155 Pel* piDstBufU = pcUsPic->getCbAddr(); 156 157 Pel* piTempBufV = pcTempPic->getCrAddr(); 158 Pel* piSrcBufV = pcBasePic->getCrAddr(); 159 Pel* piDstBufV = pcUsPic->getCrAddr(); 160 161 Pel* piSrcU; 162 Pel* piDstU; 163 Pel* piSrcV; 164 Pel* piDstV; 165 166 #if JCTVC_L0178 167 Pel *tempBufRight = NULL, *tempBufBottom = NULL; 168 Int tempBufSizeRight = 0, tempBufSizeBottom = 0; 169 170 if ( pcBasePic->getPicCropRightOffset() ) 171 { 172 tempBufSizeRight = pcBasePic->getPicCropRightOffset() * pcBasePic->getHeight(); 173 } 174 175 if( pcBasePic->getPicCropBottomOffset() ) 176 { 177 tempBufSizeBottom = pcBasePic->getPicCropBottomOffset() * pcBasePic->getWidth (); 178 } 179 180 if( tempBufSizeRight ) 181 { 182 tempBufRight = (Pel *) xMalloc(Pel, tempBufSizeRight + (tempBufSizeRight>>1) ); 183 assert( tempBufRight ); 184 } 185 186 if( tempBufSizeBottom ) 187 { 188 tempBufBottom = (Pel *) xMalloc(Pel, tempBufSizeBottom + (tempBufSizeBottom>>1) ); 189 assert( tempBufBottom ); 190 } 191 192 #endif 193 146 194 #if PHASE_DERIVATION_IN_INTEGER 147 195 Int iRefPos16 = 0; … … 179 227 #endif 180 228 181 Pel* piTempBufY = pcTempPic->getLumaAddr(); 182 Pel* piSrcBufY = pcBasePic->getLumaAddr(); 183 Pel* piDstBufY = pcUsPic->getLumaAddr(); 184 185 Pel* piSrcY; 186 Pel* piDstY; 229 187 230 188 231 assert ( iEWidth == 2*iBWidth || 2*iEWidth == 3*iBWidth ); 189 232 assert ( iEHeight == 2*iBHeight || 2*iEHeight == 3*iBHeight ); 190 233 234 #if JCTVC_L0178 235 // save the cropped region to copy back to the base picture since the base picture might be used as a reference picture 236 if( tempBufSizeRight ) 237 { 238 piSrcY = piSrcBufY + iBWidth; 239 piDstY = tempBufRight; 240 for( i = 0; i < pcBasePic->getHeight(); i++ ) 241 { 242 memcpy(piDstY, piSrcY, sizeof(Pel) * pcBasePic->getPicCropRightOffset()); 243 piSrcY += iBStride; 244 piDstY += pcBasePic->getPicCropRightOffset(); 245 } 246 247 if(pcBasePic->getPicCropRightOffset()>>1) 248 { 249 Int iBStrideChroma = (iBStride>>1); 250 piSrcU = piSrcBufU + (iBWidth>>1); 251 piDstU = tempBufRight + pcBasePic->getPicCropRightOffset() * pcBasePic->getHeight(); 252 piSrcV = piSrcBufV + (iBWidth>>1); 253 piDstV = piDstU + (pcBasePic->getPicCropRightOffset()>>1) * (pcBasePic->getHeight()>>1); 254 255 for( i = 0; i < pcBasePic->getHeight()>>1; i++ ) 256 { 257 memcpy(piDstU, piSrcU, sizeof(Pel) * (pcBasePic->getPicCropRightOffset()>>1)); 258 piSrcU += iBStrideChroma; 259 piDstU += (pcBasePic->getPicCropRightOffset()>>1); 260 261 memcpy(piDstV, piSrcV, sizeof(Pel) * (pcBasePic->getPicCropRightOffset()>>1)); 262 piSrcV += iBStrideChroma; 263 piDstV += (pcBasePic->getPicCropRightOffset()>>1); 264 } 265 } 266 267 pcBasePic->setWidth(iBWidth); 268 } 269 270 if( tempBufSizeBottom ) 271 { 272 piSrcY = piSrcBufY + iBHeight * iBStride; 273 piDstY = tempBufBottom; 274 for( i = 0; i < pcBasePic->getPicCropBottomOffset(); i++ ) 275 { 276 memcpy(piDstY, piSrcY, sizeof(Pel) * pcBasePic->getWidth()); 277 piSrcY += iBStride; 278 piDstY += pcBasePic->getWidth(); 279 } 280 281 if(pcBasePic->getPicCropBottomOffset()>>1) 282 { 283 Int iBStrideChroma = (iBStride>>1); 284 piSrcU = piSrcBufU + (iBHeight>>1) * iBStrideChroma; 285 piDstU = tempBufBottom + pcBasePic->getPicCropBottomOffset() * pcBasePic->getWidth(); 286 piSrcV = piSrcBufV + (iBHeight>>1) * iBStrideChroma; 287 piDstV = piDstU + (pcBasePic->getPicCropBottomOffset()>>1) * (pcBasePic->getWidth()>>1); 288 289 for( i = 0; i < pcBasePic->getPicCropBottomOffset()>>1; i++ ) 290 { 291 memcpy(piDstU, piSrcU, sizeof(Pel) * (pcBasePic->getWidth()>>1)); 292 piSrcU += iBStrideChroma; 293 piDstU += (pcBasePic->getWidth()>>1); 294 295 memcpy(piDstV, piSrcV, sizeof(Pel) * (pcBasePic->getWidth()>>1)); 296 piSrcV += iBStrideChroma; 297 piDstV += (pcBasePic->getWidth()>>1); 298 } 299 } 300 301 pcBasePic->setHeight(iBHeight); 302 } 303 #endif 304 191 305 pcBasePic->setBorderExtension(false); 192 306 pcBasePic->extendPicBorder (); // extend the border. … … 278 392 279 393 //========== UV component upsampling =========== 280 Pel* piTempBufU = pcTempPic->getCbAddr();281 Pel* piSrcBufU = pcBasePic->getCbAddr();282 Pel* piDstBufU = pcUsPic->getCbAddr();283 284 Pel* piTempBufV = pcTempPic->getCrAddr();285 Pel* piSrcBufV = pcBasePic->getCrAddr();286 Pel* piDstBufV = pcUsPic->getCrAddr();287 288 Pel* piSrcU;289 Pel* piDstU;290 Pel* piSrcV;291 Pel* piDstV;292 394 293 395 iEWidth >>= 1; … … 405 507 pcTempPic->setBorderExtension(false); 406 508 pcBasePic->setBorderExtension(false); 509 510 #if JCTVC_L0178 511 // copy back the saved cropped region 512 if( tempBufSizeRight ) 513 { 514 // put the correct width back 515 pcBasePic->setWidth(pcBasePic->getWidth()+pcBasePic->getPicCropRightOffset()); 516 } 517 if( tempBufSizeBottom ) 518 { 519 pcBasePic->setHeight(pcBasePic->getHeight()+pcBasePic->getPicCropBottomOffset()); 520 } 521 522 iBWidth = pcBasePic->getWidth () - pcBasePic->getPicCropLeftOffset() - pcBasePic->getPicCropRightOffset(); 523 iBHeight = pcBasePic->getHeight() - pcBasePic->getPicCropTopOffset() - pcBasePic->getPicCropBottomOffset(); 524 525 iBStride = pcBasePic->getStride(); 526 527 if( tempBufSizeRight ) 528 { 529 piSrcY = tempBufRight; 530 piDstY = piSrcBufY + iBWidth; 531 532 for( i = 0; i < pcBasePic->getHeight(); i++ ) 533 { 534 memcpy(piDstY, piSrcY, sizeof(Pel) * pcBasePic->getPicCropRightOffset()); 535 piSrcY += pcBasePic->getPicCropRightOffset(); 536 piDstY += iBStride; 537 } 538 539 if(pcBasePic->getPicCropRightOffset()>>1) 540 { 541 Int iBStrideChroma = (iBStride>>1); 542 piSrcU = tempBufRight + pcBasePic->getPicCropRightOffset() * pcBasePic->getHeight(); 543 piDstU = piSrcBufU + (iBWidth>>1); 544 piSrcV = piSrcU + (pcBasePic->getPicCropRightOffset()>>1) * (pcBasePic->getHeight()>>1); 545 piDstV = piSrcBufV + (iBWidth>>1); 546 547 for( i = 0; i < pcBasePic->getHeight()>>1; i++ ) 548 { 549 memcpy(piDstU, piSrcU, sizeof(Pel) * (pcBasePic->getPicCropRightOffset()>>1)); 550 piSrcU += (pcBasePic->getPicCropRightOffset()>>1); 551 piDstU += iBStrideChroma; 552 553 memcpy(piDstV, piSrcV, sizeof(Pel) * (pcBasePic->getPicCropRightOffset()>>1)); 554 piSrcV += (pcBasePic->getPicCropRightOffset()>>1); 555 piDstV += iBStrideChroma; 556 } 557 } 558 } 559 560 if( tempBufSizeBottom ) 561 { 562 piDstY = piSrcBufY + iBHeight * iBStride; 563 piSrcY = tempBufBottom; 564 for( i = 0; i < pcBasePic->getPicCropBottomOffset(); i++ ) 565 { 566 memcpy(piDstY, piSrcY, sizeof(Pel) * pcBasePic->getWidth()); 567 piDstY += iBStride; 568 piSrcY += pcBasePic->getWidth(); 569 } 570 571 if(pcBasePic->getPicCropBottomOffset()>>1) 572 { 573 Int iBStrideChroma = (iBStride>>1); 574 piSrcU = tempBufBottom + pcBasePic->getPicCropBottomOffset() * pcBasePic->getWidth(); 575 piDstU = piSrcBufU + (iBHeight>>1) * iBStrideChroma; 576 piSrcV = piSrcU + (pcBasePic->getPicCropBottomOffset()>>1) * (pcBasePic->getWidth()>>1); 577 piDstV = piSrcBufV + (iBHeight>>1) * iBStrideChroma; 578 579 for( i = 0; i < pcBasePic->getPicCropBottomOffset()>>1; i++ ) 580 { 581 memcpy(piDstU, piSrcU, sizeof(Pel) * (pcBasePic->getWidth()>>1)); 582 piSrcU += (pcBasePic->getWidth()>>1); 583 piDstU += iBStrideChroma; 584 585 memcpy(piDstV, piSrcV, sizeof(Pel) * (pcBasePic->getWidth()>>1)); 586 piSrcV += (pcBasePic->getWidth()>>1); 587 piDstV += iBStrideChroma; 588 } 589 } 590 591 } 592 593 if( tempBufSizeRight ) 594 { 595 xFree( tempBufRight ); 596 } 597 if( tempBufSizeBottom ) 598 { 599 xFree( tempBufBottom ); 600 } 601 #endif 407 602 } 408 603 #endif //SVC_EXTENSION -
branches/SHM-1.0-dev/source/Lib/TLibCommon/TypeDef.h
r25 r26 73 73 #define SVC_BL_CAND_INTRA 0 ///< Intra Base Mode Prediction hook as an example 74 74 #endif 75 #endif 76 77 #if SVC_UPSAMPLING 78 #define JCTVC_L0178 1 ///< implementation of JCTVC-L0178 (code only supports right and bottom croppping offsets) 75 79 #endif 76 80
Note: See TracChangeset for help on using the changeset viewer.