Changeset 27 in SHVCSoftware for branches/SHM-1.0-dev
- Timestamp:
- 6 Feb 2013, 03:30:58 (12 years ago)
- Location:
- branches/SHM-1.0-dev/source/Lib
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-1.0-dev/source/Lib/TLibCommon/TComDataCU.h
r25 r27 597 597 }; 598 598 599 #if REF_IDX_MFM 600 class TComUpsampledMvFieldCU 601 { 602 TComCUMvField m_acCUMvField[2]; //array of motion vector field 603 UInt m_uiCUAddr; 604 UInt m_uiCUPelX; 605 UInt m_uiCUPelY; 606 607 public: 608 Void createMvField(Int CUAddr, Int uiWidthInCU, UInt uiNumPartitions) 609 { 610 m_uiCUAddr = CUAddr; 611 m_uiCUPelX = (CUAddr % uiWidthInCU) * g_uiMaxCUWidth; 612 m_uiCUPelY = (CUAddr / uiWidthInCU) * g_uiMaxCUWidth; 613 614 m_acCUMvField[0].create( uiNumPartitions ); 615 m_acCUMvField[1].create( uiNumPartitions ); 616 return; 617 } 618 619 Void initMvField() 620 { 621 m_acCUMvField[0].clearMvField(); 622 m_acCUMvField[1].clearMvField(); 623 return; 624 } 625 Void destroy() 626 { 627 m_acCUMvField[0].destroy(); 628 m_acCUMvField[1].destroy(); 629 return; 630 } 631 TComCUMvField* getCUMvField ( RefPicList e ) { return &m_acCUMvField[e]; } 632 UInt getAddr () { return m_uiCUAddr;} 633 UInt getCUPelX () { return m_uiCUPelX; } 634 UInt getCUPelY () { return m_uiCUPelY; } 635 }; 636 #endif 599 637 600 638 601 namespace RasterAddress -
branches/SHM-1.0-dev/source/Lib/TLibCommon/TComMotionInfo.h
r25 r27 160 160 161 161 #if REF_IDX_MFM 162 UInt getNumPartition() { return m_uiNumPartition; }163 162 Void setMvField( TComMvField const & mvField, Int iIdx) 164 163 { -
branches/SHM-1.0-dev/source/Lib/TLibCommon/TComPic.cpp
r25 r27 71 71 , m_bIsILR (false) 72 72 #endif 73 #if REF_IDX_MFM 74 , m_bIsUpsampledMvField (false) 75 , m_apcTComUpsampledMvFieldCU (NULL) 76 , m_peUpsampledPredMode (NULL) 77 , m_iNumCUInUpsampledPic (-1) 78 #endif 73 79 74 #endif 80 75 { … … 562 557 563 558 #if REF_IDX_MFM 564 Void TComPic::createUpSampledMvField(Int upSampledHeight, Int upSampledWidth, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ) 565 { 566 UInt uiNumPartitions = 1<<(uiMaxDepth<<1); 567 UInt uiWidthInCU = ( upSampledWidth % uiMaxWidth ) ? upSampledWidth /uiMaxWidth + 1 : upSampledWidth /uiMaxWidth; 568 UInt uiHeightInCU = ( upSampledHeight% uiMaxHeight ) ? upSampledHeight/uiMaxHeight + 1 : upSampledHeight/uiMaxHeight; 569 UInt uiNumCUsInFrame = uiWidthInCU * uiHeightInCU; 570 m_iNumCUInUpsampledPic = uiNumCUsInFrame; 571 572 m_apcTComUpsampledMvFieldCU = new TComUpsampledMvFieldCU*[uiNumCUsInFrame]; 573 m_peUpsampledPredMode = new char*[uiNumCUsInFrame]; 574 575 for (Int i = 0; i < uiNumCUsInFrame; i++ ) 576 { 577 m_apcTComUpsampledMvFieldCU[i] = new TComUpsampledMvFieldCU; 578 m_apcTComUpsampledMvFieldCU[i]->createMvField(i, uiWidthInCU, uiNumPartitions); //create Mv field 579 m_apcTComUpsampledMvFieldCU[i]->initMvField(); //initialize Mv field 580 581 m_peUpsampledPredMode[i] = new char[uiNumPartitions]; 582 } 583 584 return; 585 } 586 587 Void TComPic::deriveUnitIdxBase(UInt uiUpsamplePelX, UInt uiUpsamplePelY, float ratio, UInt& uiBaseCUAddr, UInt& uiBaseAbsPartIdx) 559 Void TComPic::deriveUnitIdxBase( UInt uiUpsamplePelX, UInt uiUpsamplePelY, UInt ratio, UInt& uiBaseCUAddr, UInt& uiBaseAbsPartIdx ) 588 560 { 589 561 //pixel in the base layer 590 UInt uiPelX = (UInt)((float)uiUpsamplePelX/ratio); 591 UInt uiPelY = (UInt)((float)uiUpsamplePelY/ratio); 562 563 UInt uiPelX = (uiUpsamplePelX<<1)/ratio; 564 UInt uiPelY = (uiUpsamplePelY<<1)/ratio; 592 565 UInt uiBaseWidth = getPicYuvRec()->getWidth(); 593 566 UInt uiBaseHeight = getPicYuvRec()->getHeight(); … … 614 587 615 588 616 //MV field up-sampling 617 Void TComPic::doTheUpSampleMvField(UInt upSampleRatio) 618 { 619 UInt uiWidthMinPU = g_uiMaxCUWidth/(1<<g_uiMaxCUDepth); 620 UInt uiHeightMinPU = g_uiMaxCUHeight/(1<<g_uiMaxCUDepth); 621 UInt uiNumPartitions = 1<<(g_uiMaxCUDepth<<1); 622 UInt uiPelX, uiPelY; 623 UInt uiBaseCUAddr, uiBaseAbsPartIdx; 624 float ratio = 0; 625 626 //???????????????????????????? 627 if(upSampleRatio == 0) //ONE_TO_ONE 628 ratio = 1.0; 629 else if(upSampleRatio == 1) //ONE_TO_TWO 630 ratio = 2.0; 631 else if(upSampleRatio == 2) //TWO_TO_THREE 632 ratio = 1.5; 633 634 for(UInt uiCUAddr = 0; uiCUAddr < m_iNumCUInUpsampledPic; uiCUAddr++) //each LCU 635 { 636 TComUpsampledMvFieldCU*& pcMvFieldCU = getUpsampledMvFieldCU(uiCUAddr); 637 pcMvFieldCU->initMvField(); //MV field initialization 638 639 Int unitNum = max (1, (Int)((16/uiWidthMinPU)*(16/uiHeightMinPU)) ); 640 for(UInt uiAbsPartIdx = 0; uiAbsPartIdx < uiNumPartitions; uiAbsPartIdx+=unitNum ) //each 16x16 unit 641 { 642 //pixel position of each unit in up-sampled layer 643 uiPelX = pcMvFieldCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 644 uiPelY = pcMvFieldCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 645 646 //???????????????????????????? 647 deriveUnitIdxBase(uiPelX + 8, uiPelY + 8, ratio, uiBaseCUAddr, uiBaseAbsPartIdx); 648 if( (getCU(uiBaseCUAddr)->getPredictionMode(uiBaseAbsPartIdx) != MODE_NONE) && (getCU(uiBaseCUAddr)->getPredictionMode(uiBaseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode 649 { 650 for(UInt list = 0; list < 2; list++) //each list 651 { 652 TComMv cMv = getCU(uiBaseCUAddr)->getCUMvField((RefPicList)list)->getMv(uiBaseAbsPartIdx); 653 Int refIdx = getCU(uiBaseCUAddr)->getCUMvField((RefPicList)list)->getRefIdx(uiBaseAbsPartIdx); 654 //???????????????????????????? 655 Int Hor = (Short) (ratio * cMv.getHor()); 656 Int Ver = (Short) (ratio * cMv.getVer()); 657 658 TComMv cScaledMv(Hor, Ver); 659 TComMvField sMvField; 660 sMvField.setMvField(cScaledMv, refIdx); 661 662 pcMvFieldCU->getCUMvField((RefPicList)list)->setMvField(sMvField, uiAbsPartIdx); 663 m_peUpsampledPredMode[uiCUAddr][uiAbsPartIdx] = MODE_INTER; 664 } 665 } 666 else 667 { 668 TComMvField zeroMvField; //zero MV and invalid reference index 669 pcMvFieldCU->getCUMvField(REF_PIC_LIST_0)->setMvField(zeroMvField, uiAbsPartIdx); 670 pcMvFieldCU->getCUMvField(REF_PIC_LIST_1)->setMvField(zeroMvField, uiAbsPartIdx); 671 672 m_peUpsampledPredMode[uiCUAddr][uiAbsPartIdx] = MODE_INTRA; 673 } 674 675 //MV compression 676 for(UInt i = 1; i < unitNum; i++ ) 677 { 678 pcMvFieldCU->getCUMvField(REF_PIC_LIST_0)->setMvField(pcMvFieldCU->getCUMvField(REF_PIC_LIST_0)->getMv(uiAbsPartIdx), pcMvFieldCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(uiAbsPartIdx), uiAbsPartIdx + i); 679 pcMvFieldCU->getCUMvField(REF_PIC_LIST_1)->setMvField(pcMvFieldCU->getCUMvField(REF_PIC_LIST_1)->getMv(uiAbsPartIdx), pcMvFieldCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(uiAbsPartIdx), uiAbsPartIdx + i); 680 m_peUpsampledPredMode[uiCUAddr][uiAbsPartIdx+i] = m_peUpsampledPredMode[uiCUAddr][uiAbsPartIdx]; 681 } 682 683 } //ending for(UInt uiAbsPartIdx = 0; uiAbsPartIdx < uiNumPartitions; uiAbsPartIdx++) 684 } //ending for(UInt uiCUAddr = 0; uiCUAddr < m_iNumCUInUpsampledPic; uiCUAddr++) 685 return; 686 } 589 687 590 688 591 Void TComPic::copyUpsampledMvField(TComPic* pcPicBase) 689 592 { 690 assert( getPicSym()->getNumberOfCUsInFrame() == pcPicBase->getNumCUInUpsampledPic() ); 691 692 for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCUsInFrame(); cuIdx++) //each LCU 693 { 694 UInt uiNumPartitions = 1<<(g_uiMaxCUDepth<<1); 695 696 TComDataCU* pcCUDes = getCU(cuIdx); 697 TComUpsampledMvFieldCU* pcMvFieldCU = pcPicBase->getUpsampledMvFieldCU(cuIdx); 698 for(UInt list = 0; list < 2; list++) //each reference list 699 { 700 TComCUMvField* pcCUMvFieldDes = pcCUDes->getCUMvField((RefPicList)list); 701 TComCUMvField* pcCUMvFieldOrg = pcMvFieldCU->getCUMvField((RefPicList)list); 702 703 assert(pcCUMvFieldDes->getNumPartition() == pcCUMvFieldOrg->getNumPartition()); 704 assert(pcCUMvFieldDes->getNumPartition() == uiNumPartitions); 705 706 pcCUMvFieldDes->clearMvField(); 707 pcCUMvFieldDes->copyFrom(pcCUMvFieldOrg, pcCUMvFieldDes->getNumPartition(), 0); 708 } 709 710 char* pPredModeSrc = pcPicBase->getUpsampledPreModeCU(cuIdx); 711 char* pPredModeDst = pcCUDes->getPredictionMode(); 712 memcpy(pPredModeDst, pPredModeSrc, sizeof(char)*uiNumPartitions); 713 memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof(char)*uiNumPartitions); 714 } 593 594 595 596 Int iBWidth = pcPicBase->getPicYuvRec()->getWidth () - pcPicBase->getPicYuvRec()->getPicCropLeftOffset() - pcPicBase->getPicYuvRec()->getPicCropRightOffset(); 597 Int iBHeight = pcPicBase->getPicYuvRec()->getHeight() - pcPicBase->getPicYuvRec()->getPicCropTopOffset() - pcPicBase->getPicYuvRec()->getPicCropBottomOffset(); 598 599 Int iEWidth = getPicYuvRec()->getWidth() - getPicYuvRec()->getPicCropLeftOffset() - getPicYuvRec()->getPicCropRightOffset(); 600 Int iEHeight = getPicYuvRec()->getHeight() - getPicYuvRec()->getPicCropTopOffset() - getPicYuvRec()->getPicCropBottomOffset(); 601 602 603 UInt upSampleRatio = 0; 604 if(iEWidth == iBWidth && iEHeight == iBHeight) 605 { 606 upSampleRatio = 2; 607 } 608 else if(2*iEWidth == 3*iBWidth && 2*iEHeight == 3*iBHeight) 609 { 610 upSampleRatio = 3; 611 } 612 else if(iEWidth == 2*iBWidth && iEHeight == 2*iBHeight) 613 { 614 upSampleRatio = 4; 615 } 616 else 617 { 618 assert(0); 619 } 620 621 for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCUsInFrame(); cuIdx++) //each LCU 622 { 623 UInt uiNumPartitions = 1<<(g_uiMaxCUDepth<<1); 624 625 TComDataCU* pcCUDes = getCU(cuIdx); 626 627 UInt uiWidthMinPU = g_uiMaxCUWidth/(1<<g_uiMaxCUDepth); 628 UInt uiHeightMinPU = g_uiMaxCUHeight/(1<<g_uiMaxCUDepth); 629 Int unitNum = max (1, (Int)((16/uiWidthMinPU)*(16/uiHeightMinPU)) ); 630 631 for(UInt uiAbsPartIdx = 0; uiAbsPartIdx < uiNumPartitions; uiAbsPartIdx+=unitNum ) //each 16x16 unit 632 { 633 //pixel position of each unit in up-sampled layer 634 UInt uiPelX = pcCUDes->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 635 UInt uiPelY = pcCUDes->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 636 UInt uiBaseCUAddr, uiBaseAbsPartIdx; 637 pcPicBase->deriveUnitIdxBase(uiPelX + 8, uiPelY + 8, upSampleRatio, uiBaseCUAddr, uiBaseAbsPartIdx); 638 if( (pcPicBase->getCU(uiBaseCUAddr)->getPredictionMode(uiBaseAbsPartIdx) != MODE_NONE) && (pcPicBase->getCU(uiBaseCUAddr)->getPredictionMode(uiBaseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode 639 { 640 for(UInt list = 0; list < 2; list++) //each list 641 { 642 TComMv cMv = pcPicBase->getCU(uiBaseCUAddr)->getCUMvField((RefPicList)list)->getMv(uiBaseAbsPartIdx); 643 Int refIdx = pcPicBase->getCU(uiBaseCUAddr)->getCUMvField((RefPicList)list)->getRefIdx(uiBaseAbsPartIdx); 644 645 Int Hor = ((Int)upSampleRatio * cMv.getHor())/2 ; 646 Int Ver = ((Int)upSampleRatio * cMv.getVer())/2 ; 647 648 TComMv cScaledMv(Hor, Ver); 649 TComMvField sMvField; 650 sMvField.setMvField(cScaledMv, refIdx); 651 652 pcCUDes->getCUMvField((RefPicList)list)->setMvField(sMvField, uiAbsPartIdx); 653 pcCUDes->setPredictionMode(uiAbsPartIdx, MODE_INTER); 654 } 655 } 656 657 else 658 { 659 TComMvField zeroMvField; //zero MV and invalid reference index 660 pcCUDes->getCUMvField(REF_PIC_LIST_0)->setMvField(zeroMvField, uiAbsPartIdx); 661 pcCUDes->getCUMvField(REF_PIC_LIST_1)->setMvField(zeroMvField, uiAbsPartIdx); 662 pcCUDes->setPredictionMode(uiAbsPartIdx, MODE_INTRA); 663 } 664 665 for(UInt i = 1; i < unitNum; i++ ) 666 { 667 pcCUDes->getCUMvField(REF_PIC_LIST_0)->setMvField(pcCUDes->getCUMvField(REF_PIC_LIST_0)->getMv(uiAbsPartIdx), pcCUDes->getCUMvField(REF_PIC_LIST_0)->getRefIdx(uiAbsPartIdx), uiAbsPartIdx + i); 668 pcCUDes->getCUMvField(REF_PIC_LIST_1)->setMvField(pcCUDes->getCUMvField(REF_PIC_LIST_1)->getMv(uiAbsPartIdx), pcCUDes->getCUMvField(REF_PIC_LIST_1)->getRefIdx(uiAbsPartIdx), uiAbsPartIdx + i); 669 pcCUDes->setPredictionMode(uiAbsPartIdx+i, pcCUDes->getPredictionMode(uiAbsPartIdx)) ; 670 } 671 } 672 memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof(char)*uiNumPartitions); 673 } 715 674 } 716 675 #endif -
branches/SHM-1.0-dev/source/Lib/TLibCommon/TComPic.h
r25 r27 91 91 Bool m_bIsILR; // Is ILR picture 92 92 #endif 93 #if REF_IDX_MFM94 Bool m_bIsUpsampledMvField;95 TComUpsampledMvFieldCU** m_apcTComUpsampledMvFieldCU;96 Char** m_peUpsampledPredMode;97 Int m_iNumCUInUpsampledPic;98 #endif99 93 #endif 100 94 … … 128 122 Bool getIsILR() {return m_bIsILR;} 129 123 #endif 124 130 125 #if REF_IDX_MFM 131 Bool IsUpsampledMvField() { return m_bIsUpsampledMvField; }132 Void setUpsampledMvField(Bool isUpsampledMvField) { m_bIsUpsampledMvField = isUpsampledMvField; }133 Bool upsampledMvFieldIsNull()134 {135 if (m_apcTComUpsampledMvFieldCU == NULL)136 return true;137 else138 return false;139 }140 Void createUpSampledMvField( Int upSampledHeight, Int upSampledWidth, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth );141 Void doTheUpSampleMvField ( UInt upSampleRatio );142 126 Void copyUpsampledMvField ( TComPic* pcPicBase ); 143 Void deriveUnitIdxBase(UInt uiUpsamplePelX, UInt uiUpsamplePelY, float ratio, UInt& uiBaseCUAddr, UInt& uiBaseAbsPartIdx); 144 145 Int getNumCUInUpsampledPic() { return m_iNumCUInUpsampledPic; } 146 TComUpsampledMvFieldCU*& getUpsampledMvFieldCU( UInt uiCUAddr ) { return m_apcTComUpsampledMvFieldCU[uiCUAddr]; } 147 char* getUpsampledPreModeCU( UInt uiCUAddr ) { return m_peUpsampledPredMode[uiCUAddr]; } 148 149 127 Void deriveUnitIdxBase ( UInt uiUpsamplePelX, UInt uiUpsamplePelY, UInt ratio, UInt& uiBaseCUAddr, UInt& uiBaseAbsPartIdx ); 150 128 #endif 151 129 -
branches/SHM-1.0-dev/source/Lib/TLibCommon/TComSlice.cpp
r25 r27 521 521 #if REF_IDX_MFM 522 522 assert(iRefPicNum == 1); 523 if( getPOC() != 0)523 if( getPOC() != 0 ) 524 524 { 525 assert(getBaseColPic()->IsUpsampledMvField() == true);526 525 pIlpPicList[0]->copyUpsampledMvField(getBaseColPic()); 527 526 } … … 556 555 557 556 #if REF_IDX_MFM 558 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic *pcRefPicBL)557 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic *pcRefPicBL ) 559 558 { 560 559 //set reference picture POC of each ILP reference … … 578 577 ilpPic[0]->getSlice(0)->setNumRefIdx(REF_PIC_LIST_1, pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_1)); 579 578 assert(ilpPic[0]->getSlice(0)->getNumRefIdx(REF_PIC_LIST_1) <= MAX_NUM_REF); 580 579 581 580 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_0); refIdx++) 582 ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(REF_PIC_LIST_0, refIdx), REF_PIC_LIST_0, refIdx); 583 581 { 582 ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(REF_PIC_LIST_0, refIdx), REF_PIC_LIST_0, refIdx); 583 } 584 584 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_1); refIdx++) 585 ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(REF_PIC_LIST_1, refIdx), REF_PIC_LIST_1, refIdx); 586 585 { 586 ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(REF_PIC_LIST_1, refIdx), REF_PIC_LIST_1, refIdx); 587 } 587 588 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_0); refIdx++) 588 ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(REF_PIC_LIST_0, refIdx), REF_PIC_LIST_0, refIdx); 589 589 { 590 ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(REF_PIC_LIST_0, refIdx), REF_PIC_LIST_0, refIdx); 591 } 590 592 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_1); refIdx++) 591 ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(REF_PIC_LIST_1, refIdx), REF_PIC_LIST_1, refIdx); 592 return; 593 { 594 ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(REF_PIC_LIST_1, refIdx), REF_PIC_LIST_1, refIdx); 595 } 596 return; 593 597 } 594 598 #endif -
branches/SHM-1.0-dev/source/Lib/TLibDecoder/TDecGop.cpp
r25 r27 288 288 rpcPic->compressMotion(); 289 289 290 #if REF_IDX_MFM291 if( rpcPic->getLayerId() == 0 && rpcPic->upsampledMvFieldIsNull() )292 {293 TComSPS *spsEL = m_ppcTDecTop[1]->getSPS();294 295 rpcPic->createUpSampledMvField(spsEL->getPicHeightInLumaSamples(), spsEL->getPicWidthInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth); //create up-sampled mv field296 }297 298 if( rpcPic->getLayerId() == 0 && rpcPic->IsUpsampledMvField() == false )299 {300 TComSPS *spsBL = m_ppcTDecTop[0]->getSPS();301 TComSPS *spsEL = m_ppcTDecTop[1]->getSPS();302 303 Int iBWidth = spsBL->getPicWidthInLumaSamples() - spsBL->getPicCropLeftOffset() - spsBL->getPicCropRightOffset();304 Int iBHeight = spsBL->getPicHeightInLumaSamples() - spsBL->getPicCropTopOffset() - spsBL->getPicCropBottomOffset();305 306 Int iEWidth = spsEL->getPicWidthInLumaSamples() - spsEL->getPicCropLeftOffset() - spsEL->getPicCropRightOffset();307 Int iEHeight = spsEL->getPicHeightInLumaSamples() - spsEL->getPicCropTopOffset() - spsEL->getPicCropBottomOffset();308 309 UInt upSampleRatio;310 if(iEWidth == iBWidth && iEHeight == iBHeight)311 upSampleRatio = 0;312 else if(iEWidth == 2*iBWidth && iEHeight == 2*iBHeight)313 upSampleRatio = 1;314 else if(2*iEWidth == 3*iBWidth && 2*iEHeight == 3*iBHeight)315 upSampleRatio = 2;316 else317 assert(0);318 319 rpcPic->doTheUpSampleMvField(upSampleRatio);320 rpcPic->setUpsampledMvField(true);321 }322 #endif323 290 324 291 Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B'); -
branches/SHM-1.0-dev/source/Lib/TLibDecoder/TDecTop.cpp
r25 r27 271 271 #endif 272 272 273 #if REF_IDX_MFM 274 rpcPic->setUpsampledMvField(false); 275 #endif 273 276 274 m_cListPic.pushBack( rpcPic ); 277 275 … … 321 319 #endif 322 320 323 #if REF_IDX_MFM 324 rpcPic->setUpsampledMvField(false); 325 #endif 321 326 322 } 327 323 -
branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r25 r27 1561 1561 1562 1562 pcPic->compressMotion(); 1563 #if REF_IDX_MFM1564 if( m_layerId == 0 && pcPic->upsampledMvFieldIsNull() )1565 {1566 Int iEHeight = m_ppcTEncTop[m_layerId+1]->getSourceHeight();1567 Int iEWidth = m_ppcTEncTop[m_layerId+1]->getSourceWidth();1568 pcPic->createUpSampledMvField(iEHeight, iEWidth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth); //create up-sampled mv field1569 }1570 1571 if( m_layerId == 0 && pcPic->IsUpsampledMvField() == false )1572 {1573 Int iBWidth = m_ppcTEncTop[m_layerId]->getSourceWidth() - m_ppcTEncTop[m_layerId]->getCropLeft() - m_ppcTEncTop[m_layerId]->getCropRight();1574 Int iBHeight = m_ppcTEncTop[m_layerId]->getSourceHeight() - m_ppcTEncTop[m_layerId]->getCropTop() - m_ppcTEncTop[m_layerId]->getCropBottom();1575 1576 Int iEWidth = m_ppcTEncTop[m_layerId+1]->getSourceWidth() - m_ppcTEncTop[m_layerId+1]->getCropLeft() - m_ppcTEncTop[m_layerId+1]->getCropRight();1577 Int iEHeight = m_ppcTEncTop[m_layerId+1]->getSourceHeight() - m_ppcTEncTop[m_layerId+1]->getCropTop() - m_ppcTEncTop[m_layerId+1]->getCropBottom();1578 1579 UInt upSampleRatio;1580 if(iEWidth == iBWidth && iEHeight == iBHeight)1581 upSampleRatio = 0;1582 else if(iEWidth == 2*iBWidth && iEHeight == 2*iBHeight)1583 upSampleRatio = 1;1584 else if(2*iEWidth == 3*iBWidth && 2*iEHeight == 3*iBHeight)1585 upSampleRatio = 2;1586 else1587 assert(0);1588 1589 pcPic->doTheUpSampleMvField(upSampleRatio);1590 pcPic->setUpsampledMvField(true);1591 }1592 #endif1593 1563 1594 1564 //-- For time output for each slice -
branches/SHM-1.0-dev/source/Lib/TLibEncoder/TEncTop.cpp
r25 r27 602 602 // mark it should be extended 603 603 rpcPic->getPicYuvRec()->setBorderExtension(false); 604 #if REF_IDX_MFM 605 rpcPic->setUpsampledMvField(false); 606 #endif 604 607 605 } 608 606
Note: See TracChangeset for help on using the changeset viewer.