Changeset 140 in SHVCSoftware for branches/SHM-2.0-dev/source
- Timestamp:
- 2 May 2013, 19:26:04 (12 years ago)
- Location:
- branches/SHM-2.0-dev/source/Lib/TLibCommon
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.cpp
r133 r140 585 585 586 586 #if REF_IDX_MFM 587 #if !REUSE_BLKMAPPING588 Void TComPic::deriveUnitIdxBase( UInt upsamplePelX, UInt upsamplePelY, UInt ratio, UInt& baseCUAddr, UInt& baseAbsPartIdx )589 {590 //pixel in the base layer591 592 UInt pelX = (upsamplePelX<<1)/ratio;593 UInt pelY = (upsamplePelY<<1)/ratio;594 UInt baseWidth = getPicYuvRec()->getWidth();595 UInt baseHeight = getPicYuvRec()->getHeight();596 597 UInt widthInCU = ( baseWidth % g_uiMaxCUWidth ) ? baseWidth /g_uiMaxCUWidth + 1 : baseWidth /g_uiMaxCUWidth;598 599 #if MFM_CLIPPING_FIX600 pelX = (UInt)Clip3<UInt>(0, getPicYuvRec()->getWidth() - 1, pelX);601 pelY = (UInt)Clip3<UInt>(0, getPicYuvRec()->getHeight() - 1, pelY);602 #else603 UInt heightInCU = ( baseHeight% g_uiMaxCUHeight ) ? baseHeight/ g_uiMaxCUHeight + 1 : baseHeight/ g_uiMaxCUHeight;604 605 pelX = (UInt)Clip3<UInt>(0, widthInCU * g_uiMaxCUWidth - 1, pelX);606 pelY = (UInt)Clip3<UInt>(0, heightInCU * g_uiMaxCUHeight - 1, pelY);607 #endif608 609 baseCUAddr = pelY / g_uiMaxCUHeight * widthInCU + pelX / g_uiMaxCUWidth;610 611 UInt widthMinPU = g_uiMaxCUWidth / (1<<g_uiMaxCUDepth);612 UInt heightMinPU = g_uiMaxCUHeight/(1<<g_uiMaxCUDepth);613 614 UInt absPelX = pelX - (pelX / g_uiMaxCUWidth) * g_uiMaxCUWidth;615 UInt absPelY = pelY - (pelY / g_uiMaxCUHeight) * g_uiMaxCUHeight;616 617 UInt rasterIdx = absPelY / heightMinPU * (g_uiMaxCUWidth/widthMinPU) + absPelX / widthMinPU;618 baseAbsPartIdx = g_auiRasterToZscan[rasterIdx];619 620 return;621 }622 #endif623 624 587 Void TComPic::copyUpsampledMvField(TComPic* pcPicBase) 625 588 { 626 #if !REUSE_MVSCALE || !REUSE_BLKMAPPING ||AVC_SYNTAX589 #if AVC_SYNTAX 627 590 const Window &confBL = pcPicBase->getConformanceWindow(); 628 591 const Window &confEL = getPicYuvRec()->getConformanceWindow(); … … 633 596 Int widthEL = getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 634 597 Int heightEL = getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 635 #endif636 637 #if !REUSE_MVSCALE || !REUSE_BLKMAPPING638 UInt upSampleRatio = 0;639 if(widthEL == widthBL && heightEL == heightBL)640 {641 upSampleRatio = 2;642 }643 else if(2*widthEL == 3*widthBL && 2*heightEL == 3*heightBL)644 {645 upSampleRatio = 3;646 }647 else if(widthEL == 2*widthBL && heightEL == 2*heightBL)648 {649 upSampleRatio = 4;650 }651 else652 {653 assert(0);654 }655 598 #endif 656 599 … … 671 614 UInt baseCUAddr, baseAbsPartIdx; 672 615 673 #if REUSE_BLKMAPPING674 616 TComDataCU *pcColCU = 0; 675 617 pcColCU = pcCUDes->getBaseColCU(pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx); 676 #else677 pcPicBase->deriveUnitIdxBase(pelX + 8, pelY + 8, upSampleRatio, baseCUAddr, baseAbsPartIdx);678 #endif679 618 680 619 #if AVC_SYNTAX … … 682 621 Int yBL = ( (pelY + 8) * heightBL+ heightEL/2 ) / heightEL; 683 622 684 #if REUSE_BLKMAPPING685 623 if( ( xBL < widthBL && yBL < heightBL ) && pcColCU && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode 686 624 #else 687 if( ( xBL < widthBL && yBL < heightBL ) && (pcPicBase->getCU(baseCUAddr)->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcPicBase->getCU(baseCUAddr)->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode688 #endif689 #else690 #if REUSE_BLKMAPPING691 625 if( pcColCU && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode 692 #else693 if( (pcPicBase->getCU(baseCUAddr)->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcPicBase->getCU(baseCUAddr)->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode694 #endif695 626 #endif 696 627 { 697 628 for(UInt refPicList = 0; refPicList < 2; refPicList++) //for each reference list 698 629 { 699 #if REUSE_MVSCALE700 630 TComMvField sMvFieldBase, sMvField; 701 #if REUSE_BLKMAPPING702 631 pcColCU->getMvField( pcColCU, baseAbsPartIdx, (RefPicList)refPicList, sMvFieldBase); 703 #else704 pcPicBase->getCU(baseCUAddr)->getMvField( pcPicBase->getCU(baseCUAddr), baseAbsPartIdx, (RefPicList)refPicList, sMvFieldBase);705 #endif706 632 pcCUDes->scaleBaseMV( sMvField, sMvFieldBase ); 707 #else708 TComMv cMv = pcPicBase->getCU(baseCUAddr)->getCUMvField((RefPicList)refPicList)->getMv(baseAbsPartIdx);709 Int refIdx = pcPicBase->getCU(baseCUAddr)->getCUMvField((RefPicList)refPicList)->getRefIdx(baseAbsPartIdx);710 711 Int hor = ((Int)upSampleRatio * cMv.getHor())/2 ;712 Int ver = ((Int)upSampleRatio * cMv.getVer())/2 ;713 714 TComMv cScaledMv(hor, ver);715 TComMvField sMvField;716 sMvField.setMvField(cScaledMv, refIdx);717 #endif718 633 719 634 pcCUDes->getCUMvField((RefPicList)refPicList)->setMvField(sMvField, absPartIdx); -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.h
r134 r140 129 129 #if REF_IDX_MFM 130 130 Void copyUpsampledMvField ( TComPic* pcPicBase ); 131 #if !REUSE_BLKMAPPING132 Void deriveUnitIdxBase ( UInt upsamplePelX, UInt upsamplePelY, UInt ratio, UInt& baseCUAddr, UInt& baseAbsPartIdx );133 #endif134 131 #if RAP_MFM_INIT 135 132 Void initUpsampledMvField (); -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.cpp
r133 r140 2607 2607 assert(thePoc == pcRefPicBL->getPOC()); 2608 2608 2609 #if REUSE_MVSCALE || REUSE_BLKMAPPING2610 2609 ilpPic[0]->getSlice(0)->setBaseColPic( pcRefPicBL ); 2611 #endif2612 2610 2613 2611 //copy reference pictures marking from the reference layer -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TypeDef.h
r139 r140 88 88 89 89 #if REF_IDX_MFM 90 #define REUSE_MVSCALE 1 ///< using the base layer MV scaling function91 #define REUSE_BLKMAPPING 1 ///< using the base layer get co-located block function92 90 #define RAP_MFM_INIT 1 ///< initilizing MFM when base layer is RAP picture 93 91 #define REF_LIST_BUGFIX 1
Note: See TracChangeset for help on using the changeset viewer.