Changeset 11 in 3DVCSoftware for branches/0.2-poznan-univ/source/Lib/TLibEncoder
- Timestamp:
- 5 Feb 2012, 22:00:22 (13 years ago)
- Location:
- branches/0.2-poznan-univ/source/Lib/TLibEncoder
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncCavlc.cpp
r5 r11 353 353 for( UInt uiId = 0; uiId < pcSPS->getViewId(); uiId++ ) 354 354 { 355 xWriteSvlc( pcSPS->getCodedScale ()[ uiId ] ); 356 xWriteSvlc( pcSPS->getCodedOffset ()[ uiId ] ); 355 //printf("From ViewID %d To ViewID: %d\n",pcSPS->getViewId(),uiId); 356 xWriteSvlc( pcSPS->getCodedScale ()[ uiId ] ); //printf("SPS Scale: %d\n",pcSPS->getCodedScale ()[ uiId ]); 357 xWriteSvlc( pcSPS->getCodedOffset ()[ uiId ] ); //printf("SPS Offset: %d\n", pcSPS->getCodedOffset ()[ uiId ]); 357 358 xWriteSvlc( pcSPS->getInvCodedScale ()[ uiId ] + pcSPS->getCodedScale ()[ uiId ] ); 358 359 xWriteSvlc( pcSPS->getInvCodedOffset()[ uiId ] + pcSPS->getCodedOffset()[ uiId ] ); … … 531 532 for( UInt uiId = 0; uiId < pcSlice->getSPS()->getViewId(); uiId++ ) 532 533 { 533 xWriteSvlc( pcSlice->getCodedScale ()[ uiId ] ); 534 xWriteSvlc( pcSlice->getCodedOffset ()[ uiId ] ); 534 printf("From ViewID %d To ViewID: %d\n",pcSlice->getSPS()->getViewId(),uiId); 535 xWriteSvlc( pcSlice->getCodedScale ()[ uiId ] ); printf("Slice Scale: %d\n",pcSlice->getCodedScale ()[ uiId ]); 536 xWriteSvlc( pcSlice->getCodedOffset ()[ uiId ] ); printf("Slice Offset: %d\n", pcSlice->getCodedOffset ()[ uiId ]); 535 537 xWriteSvlc( pcSlice->getInvCodedScale ()[ uiId ] + pcSlice->getCodedScale ()[ uiId ] ); 536 538 xWriteSvlc( pcSlice->getInvCodedOffset()[ uiId ] + pcSlice->getCodedOffset()[ uiId ] ); -
branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncCu.cpp
r5 r11 67 67 m_ppcOrigYuv = new TComYuv*[m_uhTotalDepth-1]; 68 68 m_ppcResPredTmp = new TComYuv*[m_uhTotalDepth-1]; 69 #if POZNAN_AVAIL_MAP 70 m_ppcAvailYuv = new TComYuv*[m_uhTotalDepth-1]; 71 #endif 72 #if POZNAN_SYNTH_VIEW 73 m_ppcSynthYuv = new TComYuv*[m_uhTotalDepth-1]; 74 #endif 75 69 76 70 77 #if HHI_MPI … … 93 100 m_ppcOrigYuv [i] = new TComYuv; m_ppcOrigYuv [i]->create(uiWidth, uiHeight); 94 101 102 #if POZNAN_AVAIL_MAP 103 m_ppcAvailYuv [i] = new TComYuv; m_ppcAvailYuv [i]->create(uiWidth, uiHeight); 104 #endif 105 #if POZNAN_SYNTH_VIEW 106 m_ppcSynthYuv [i] = new TComYuv; m_ppcSynthYuv [i]->create(uiWidth, uiHeight); 107 #endif 108 109 95 110 m_ppcResPredTmp [i] = new TComYuv; m_ppcResPredTmp [i]->create(uiWidth, uiHeight); 96 111 } … … 150 165 if(m_ppcOrigYuv[i]) 151 166 { 152 m_ppcOrigYuv[i]->destroy(); delete m_ppcOrigYuv[i]; m_ppcOrigYuv[i] = NULL; 153 } 167 m_ppcOrigYuv[i]->destroy(); delete m_ppcOrigYuv[i]; m_ppcOrigYuv[i] = NULL; 168 } 169 #if POZNAN_AVAIL_MAP 170 if(m_ppcAvailYuv[i]) 171 { 172 m_ppcAvailYuv[i]->destroy(); delete m_ppcAvailYuv[i]; m_ppcAvailYuv[i] = NULL; 173 } 174 #endif 175 #if POZNAN_SYNTH_VIEW 176 if(m_ppcSynthYuv[i]) 177 { 178 m_ppcSynthYuv[i]->destroy(); delete m_ppcSynthYuv[i]; m_ppcSynthYuv[i] = NULL; 179 } 180 #endif 154 181 if(m_ppcResPredTmp[i]) 155 182 { … … 203 230 m_ppcOrigYuv = NULL; 204 231 } 232 #if POZNAN_AVAIL_MAP 233 if(m_ppcAvailYuv) 234 { 235 delete [] m_ppcAvailYuv; 236 m_ppcAvailYuv = NULL; 237 } 238 #endif 239 #if POZNAN_SYNTH_VIEW 240 if(m_ppcSynthYuv) 241 { 242 delete [] m_ppcSynthYuv; 243 m_ppcSynthYuv = NULL; 244 } 245 #endif 205 246 if(m_ppcResPredTmp) 206 247 { … … 426 467 // get Original YUV data from picture 427 468 m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() ); 428 469 #if POZNAN_AVAIL_MAP 470 if (pcPic->getPicYuvAvail()) m_ppcAvailYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvAvail(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() ); 471 #endif 472 #if POZNAN_SYNTH_VIEW 473 if (pcPic->getPicYuvSynth()) m_ppcSynthYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvSynth(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() ); 474 #endif 475 476 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 477 Bool bWholeCUCanBeSynthesized = false; 478 Bool bOneSubCUCanNotBeSynthesied = false; 479 Bool bSubCUCanBeSynthesized[4]; 480 Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized; 481 pcPic->checkSynthesisAvailability(rpcBestCU, rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU(), uiDepth, pbSubCUCanBeSynthesized); //KUBA SYNTH 482 Int iSubCUCanNotBeSynthesized = 0; 483 Int iSubCUCanBeSynthesizedCnt = 0; 484 for(Int i = 0; i < 4; i++) 485 { 486 if (!bSubCUCanBeSynthesized[i]) 487 { 488 iSubCUCanNotBeSynthesized = i; 489 } 490 else 491 { 492 iSubCUCanBeSynthesizedCnt ++; 493 } 494 } 495 if(iSubCUCanBeSynthesizedCnt == 4) 496 { 497 bWholeCUCanBeSynthesized = true; 498 } 499 else if(iSubCUCanBeSynthesizedCnt == 3) 500 { 501 bOneSubCUCanNotBeSynthesied = true; 502 } 503 #endif 429 504 // variables for fast encoder decision 430 505 TComDataCU* pcTempCU; … … 493 568 if( ( uiRPelX < rpcBestCU->getSlice()->getSPS()->getWidth() ) && ( uiBPelY < rpcBestCU->getSlice()->getSPS()->getHeight() ) ) 494 569 { 570 // do CU Skip 571 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 572 if(bWholeCUCanBeSynthesized) 573 { 574 rpcBestCU->getTotalCost() = 0; // Cost of synthesised CU is zero 575 rpcBestCU->getTotalBits() = 0; // Cost of synthesised CU is zero 576 rpcBestCU->getTotalDistortion() = 0; // Distortion of synthesised CU is zero 577 rpcBestCU->setPredModeSubParts( MODE_SYNTH, 0, uiDepth ); 578 rpcBestCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 579 #if POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS 580 m_ppcRecoYuvBest[uiDepth]->copyFromPicYuv(pcPic->getPicYuvSynth(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU()); // First copy synthesis YUV part to CU encoder reconstruction YUV structure 581 #else 582 m_ppcRecoYuvBest[uiDepth]->copyFromPicYuv(pcPic->getPicYuvAvail(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU()); // First copy synthesis YUV part to CU encoder reconstruction YUV structure 583 #endif 584 UInt uiInitTrDepth = rpcBestCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1; 585 rpcBestCU->copyToPic(uiDepth, 0, uiInitTrDepth); 586 xCopyYuv2Pic( rpcBestCU->getPic(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU(), uiDepth ); // Next copy it to reconstruction YUV buffer in coded picture 587 assert( rpcBestCU->getPartitionSize ( 0 ) != SIZE_NONE ); //Not needed any more ?? 588 assert( rpcBestCU->getPredictionMode( 0 ) != MODE_NONE ); 589 assert( rpcBestCU->getTotalCost ( ) != MAX_DOUBLE ); 590 591 #if HHI_VSO//?? 592 if( m_pcRdCost->getUseRenModel() ) 593 { 594 UInt uiWidth = rpcBestCU->getWidth ( 0 ); 595 UInt uiHeight = rpcBestCU->getHeight( 0 ); 596 Pel* piSrc = m_ppcRecoYuvBest[uiDepth]->getLumaAddr( 0 ); 597 UInt uiSrcStride = m_ppcRecoYuvBest[uiDepth]->getStride(); 598 m_pcRdCost->setRenModelData( rpcBestCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 599 } 600 #endif 601 return; 602 } 603 else if (bOneSubCUCanNotBeSynthesied && (uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth )) // If only one from subCU can not be synthesised than force NxN split but donot signal it in the stream 604 { 605 //printf("CUSkip - OneCanNotBe %d %d %d\n",rpcBestCU->getCUPelX(),rpcBestCU->getCUPelY(),rpcBestCU->getWidth()); 606 // further split !!!!go to line 866!!! 607 #if HHI_VSO 608 // reset Model 609 if( m_pcRdCost->getUseRenModel() ) 610 { 611 UInt uiWidth = m_ppcBestCU[uiDepth]->getWidth ( 0 ); 612 UInt uiHeight = m_ppcBestCU[uiDepth]->getHeight( 0 ); 613 Pel* piSrc = m_ppcOrigYuv[uiDepth]->getLumaAddr( 0 ); 614 UInt uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride(); 615 m_pcRdCost->setRenModelData( m_ppcBestCU[uiDepth], 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 616 } 617 #endif 618 619 UChar uhNextDepth = uiDepth + 1; 620 TComDataCU* pcSubBestPartCU = m_ppcBestCU[uhNextDepth]; 621 TComDataCU* pcSubTempPartCU = m_ppcTempCU[uhNextDepth]; 622 623 for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ ) //UInt uiPartUnitIdx = iSubCUNotSynthesied; 624 { 625 pcSubBestPartCU->initSubCU( rpcBestCU, uiPartUnitIdx, uhNextDepth ); // clear sub partition datas or init. 626 pcSubTempPartCU->initSubCU( rpcBestCU, uiPartUnitIdx, uhNextDepth ); // clear sub partition datas or init. 627 // pcSubBestPartCU->setLastCodedQP( rpcBestCU->getLastCodedQP() ); 628 // pcSubTempPartCU->setLastCodedQP( rpcBestCU->getLastCodedQP() ); 629 630 if( ( pcSubBestPartCU->getCUPelX() < pcSubBestPartCU->getSlice()->getSPS()->getWidth() ) && ( pcSubBestPartCU->getCUPelY() < pcSubBestPartCU->getSlice()->getSPS()->getHeight() ) ) 631 { 632 if( m_bUseSBACRD ) 633 { 634 if ( 0 == uiPartUnitIdx) //initialize RD with previous depth buffer 635 { 636 m_pppcRDSbacCoder[uhNextDepth][CI_CURR_BEST]->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]); 637 } 638 else 639 { 640 m_pppcRDSbacCoder[uhNextDepth][CI_CURR_BEST]->load(m_pppcRDSbacCoder[uhNextDepth][CI_NEXT_BEST]); 641 } 642 } 643 644 xCompressCU( pcSubBestPartCU, pcSubTempPartCU, uhNextDepth ); //Compress SubCU's 645 646 #if HHI_VSO 647 if( m_pcRdCost->getUseRenModel() ) 648 { 649 UInt uiWidth = pcSubBestPartCU->getWidth ( 0 ); 650 UInt uiHeight = pcSubBestPartCU->getHeight( 0 ); 651 Pel* piSrc = m_ppcRecoYuvBest[pcSubBestPartCU->getDepth(0)]->getLumaAddr( 0 ); 652 UInt uiSrcStride = m_ppcRecoYuvBest[pcSubBestPartCU->getDepth(0)]->getStride(); 653 m_pcRdCost->setRenModelData( pcSubBestPartCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 654 } 655 #endif 656 rpcTempCU->copyPartFrom( pcSubBestPartCU, uiPartUnitIdx, uhNextDepth ); // Keep best part data to current temporary data. 657 xCopyYuv2Tmp( pcSubBestPartCU->getTotalNumPart()*uiPartUnitIdx, uhNextDepth ); 658 } 659 } 660 661 if( !bBoundary ) 662 { 663 m_pcEntropyCoder->resetBits(); 664 m_pcEntropyCoder->encodeSplitFlag( rpcTempCU, 0, uiDepth, true ); 665 666 rpcTempCU->getTotalBits() += m_pcEntropyCoder->getNumberOfWrittenBits(); // split bits 667 } 668 669 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE 670 if( bFullyRenderedSec ) 671 { 672 m_pcRdCost->setLambdaScale( m_pcEncCfg->getInterViewSkipLambdaScale() ); 673 } 674 else 675 { 676 m_pcRdCost->setLambdaScale( 1 ); 677 } 678 #endif 679 #if HHI_VSO 680 if ( m_pcRdCost->getUseLambdaScaleVSO()) 681 { 682 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 683 } 684 else 685 #endif 686 { 687 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 688 } 689 690 if( m_bUseSBACRD ) 691 { 692 m_pppcRDSbacCoder[uhNextDepth][CI_NEXT_BEST]->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 693 } 694 //Copy Tmp to Best 695 xCheckBestMode( rpcBestCU, rpcTempCU, uiDepth ); //Roznica z naszym koder // RD compare current larger prediction 696 697 #if HHI_VSO 698 if( m_pcRdCost->getUseRenModel() ) 699 { 700 UInt uiWidth = rpcBestCU->getWidth ( 0 ); 701 UInt uiHeight = rpcBestCU->getHeight( 0 ); 702 Pel* piSrc = m_ppcRecoYuvBest[uiDepth]->getLumaAddr( 0 ); 703 UInt uiSrcStride = m_ppcRecoYuvBest[uiDepth]->getStride(); 704 m_pcRdCost->setRenModelData( rpcBestCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 705 } 706 #endif 707 //Copy result to pic 708 rpcBestCU->copyToPic(uiDepth); // Copy Best data to Picture for next partition prediction. 709 710 if( bBoundary ) 711 return; 712 713 xCopyYuv2Pic( rpcBestCU->getPic(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU(), uiDepth ); // Copy Yuv data to picture Yuv 714 715 // Assert if Best prediction mode is NONE 716 // Selected mode's RD-cost must be not MAX_DOUBLE. 717 assert( rpcBestCU->getPartitionSize ( 0 ) != SIZE_NONE ); //Not needed any more? 718 assert( rpcBestCU->getPredictionMode( 0 ) != MODE_NONE ); 719 assert( rpcBestCU->getTotalCost ( ) != MAX_DOUBLE ); 720 return; 721 } 722 #endif 723 495 724 // do inter modes 496 725 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE ) … … 836 1065 TComPic* pcPic = pcCU->getPic(); 837 1066 1067 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 1068 if( pcCU->isCUSkiped( uiAbsPartIdx ) && uiDepth == pcCU->getDepth( uiAbsPartIdx )) //If CU Skiped no information is coded into stream 1069 return; 1070 #endif 1071 838 1072 Bool bBoundary = false; 839 1073 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; … … 842 1076 UInt uiBPelY = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1; 843 1077 1078 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 1079 Bool bDontSendSplitFlag = false; 1080 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < (g_uiMaxCUDepth-g_uiAddCUDepth) ) ) || bBoundary ) //check if CU has 3 synthesied subCU - no split flag is send in that case 1081 { 1082 UInt uiQNumParts = ( pcPic->getNumPartInCU() >> (uiDepth<<1) )>>2; 1083 Int iCUSkipCounter = 0; 1084 UInt uiAbsPartIdxTmp = uiAbsPartIdx; 1085 for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++, uiAbsPartIdxTmp+=uiQNumParts ) 1086 { 1087 if(pcCU->isCUSkiped(uiAbsPartIdxTmp) && (pcCU->getDepth( uiAbsPartIdxTmp ) == uiDepth + 1) ) 1088 { 1089 iCUSkipCounter++; 1090 } 1091 } 1092 if(iCUSkipCounter == 3) 1093 { 1094 bDontSendSplitFlag = true; 1095 } 1096 } 1097 #endif 1098 844 1099 if( ( uiRPelX < pcCU->getSlice()->getSPS()->getWidth() ) && ( uiBPelY < pcCU->getSlice()->getSPS()->getHeight() ) ) 845 1100 { 1101 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 1102 if(!bDontSendSplitFlag) 1103 #endif 846 1104 #if HHI_MPI 847 1105 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth < pcCU->getTextureModeDepth( uiAbsPartIdx ) ) … … 1412 1670 for( UInt ui = 0; ui < rpcTempCU->getTotalNumPart(); ui++ ) 1413 1671 { 1414 if( pcTextureCU->isIntra( rpcTempCU->getZorderIdxInCU() + ui ) ) 1672 if( pcTextureCU->isIntra( rpcTempCU->getZorderIdxInCU() + ui ) 1673 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 1674 || pcTextureCU->isCUSkiped( rpcTempCU->getZorderIdxInCU() + ui ) 1675 #endif 1676 ) 1415 1677 { 1416 1678 return; -
branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncCu.h
r5 r11 78 78 TComYuv** m_ppcOrigYuv; ///< Original Yuv for each depth 79 79 TComYuv** m_ppcResPredTmp; ///< Temporary residual prediction for each depth 80 80 #if POZNAN_AVAIL_MAP 81 TComYuv** m_ppcAvailYuv; ///< Avaiability map for each depth 82 #endif 83 #if POZNAN_SYNTH_VIEW 84 TComYuv** m_ppcSynthYuv; ///< Synthetized Yuv for each depth 85 #endif 86 81 87 // Data : encoder control 82 88 Int m_iQp; ///< Last QP -
branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncGOP.cpp
r5 r11 799 799 Pel* pOrg = pcPic ->getPicYuvOrg()->getLumaAddr(); 800 800 Pel* pRec = pcPicD->getLumaAddr(); 801 #if POZNAN_CU_SKIP_PSNR 802 Pel* pAvail = NULL; 803 if(pcPic ->getPicYuvAvail()) 804 pAvail = pcPic ->getPicYuvAvail()->getLumaAddr(); 805 UInt64 iPixelsCnt = 0; 806 #endif 801 807 Int iStride = pcPicD->getStride(); 802 808 … … 813 819 Double fRefValueC = fRefValueY / 4.0; 814 820 815 for( y = 0; y < iHeight; y++ ) 816 { 817 for( x = 0; x < iWidth; x++ ) 818 { 819 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 820 uiSSDY += iDiff * iDiff; 821 } 822 pOrg += iStride; 823 pRec += iStride; 821 #if POZNAN_CU_SKIP_PSNR 822 if(pAvail) 823 { 824 for( y = 0; y < iHeight; y++ ) 825 { 826 for( x = 0; x < iWidth; x++ ) 827 { 828 if(pAvail[x]==0) //If pixel was codded 829 { 830 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 831 uiSSDY += iDiff * iDiff; 832 iPixelsCnt++; 833 } 834 } 835 pOrg += iStride; 836 pRec += iStride; 837 pAvail+=iStride; 838 } 839 840 fRefValueY = (double) maxval * maxval * iPixelsCnt; 841 } 842 else 843 #endif 844 { 845 for( y = 0; y < iHeight; y++ ) 846 { 847 for( x = 0; x < iWidth; x++ ) 848 { 849 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 850 uiSSDY += iDiff * iDiff; 851 } 852 pOrg += iStride; 853 pRec += iStride; 854 } 824 855 } 825 856 … … 837 868 #endif 838 869 { 839 iHeight >>= 1; 840 iWidth >>= 1; 841 iStride >>= 1; 842 pOrg = pcPic ->getPicYuvOrg()->getCbAddr(); 843 pRec = pcPicD->getCbAddr(); 844 845 for( y = 0; y < iHeight; y++ ) 846 { 847 for( x = 0; x < iWidth; x++ ) 848 { 849 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 850 uiSSDU += iDiff * iDiff; 851 } 852 pOrg += iStride; 853 pRec += iStride; 854 } 855 856 pOrg = pcPic ->getPicYuvOrg()->getCrAddr(); 857 pRec = pcPicD->getCrAddr(); 858 859 for( y = 0; y < iHeight; y++ ) 860 { 861 for( x = 0; x < iWidth; x++ ) 862 { 863 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 864 uiSSDV += iDiff * iDiff; 865 } 866 pOrg += iStride; 867 pRec += iStride; 868 } 869 dYPSNR = ( uiSSDY ? 10.0 * log10( fRefValueY / (Double)uiSSDY ) : 99.99 ); 870 dUPSNR = ( uiSSDU ? 10.0 * log10( fRefValueC / (Double)uiSSDU ) : 99.99 ); 871 dVPSNR = ( uiSSDV ? 10.0 * log10( fRefValueC / (Double)uiSSDV ) : 99.99 ); 870 #if POZNAN_CU_SKIP_PSNR 871 if(pAvail) 872 { 873 iHeight >>= 1; 874 iWidth >>= 1; 875 iStride >>= 1; 876 877 pOrg = pcPic ->getPicYuvOrg()->getCbAddr(); 878 pRec = pcPicD->getCbAddr(); 879 pAvail = pcPic ->getPicYuvAvail()->getLumaAddr(); 880 iPixelsCnt = 0; 881 882 for( y = 0; y < iHeight; y++ ) 883 { 884 for( x = 0; x < iWidth; x++ ) 885 { 886 if(pAvail[x<<1]==0||pAvail[(x<<1)+1]==0|| 887 pAvail[(x+iStride)<<1]==0||pAvail[((x+iStride)<<1)+1]==0) //If pixel was codded 888 { 889 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 890 uiSSDU += iDiff * iDiff; 891 iPixelsCnt++; 892 } 893 } 894 pOrg += iStride; 895 pRec += iStride; 896 pAvail+= (iStride<<2); 897 } 898 899 fRefValueC = (double) maxval * maxval * iPixelsCnt; 900 901 pOrg = pcPic ->getPicYuvOrg()->getCrAddr(); 902 pRec = pcPicD->getCrAddr(); 903 pAvail = pcPic ->getPicYuvAvail()->getLumaAddr(); 904 for( y = 0; y < iHeight; y++ ) 905 { 906 for( x = 0; x < iWidth; x++ ) 907 { 908 if(pAvail[x<<1]==0||pAvail[(x<<1)+1]==0|| 909 pAvail[(x+iStride)<<1]==0||pAvail[((x+iStride)<<1)+1]==0) //If pixel was codded 910 { 911 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 912 uiSSDV += iDiff * iDiff; 913 } 914 } 915 pOrg += iStride; 916 pRec += iStride; 917 pAvail+= iStride<<2; 918 } 919 } 920 else 921 #endif 922 { 923 iHeight >>= 1; 924 iWidth >>= 1; 925 iStride >>= 1; 926 927 pOrg = pcPic ->getPicYuvOrg()->getCbAddr(); 928 pRec = pcPicD->getCbAddr(); 929 930 for( y = 0; y < iHeight; y++ ) 931 { 932 for( x = 0; x < iWidth; x++ ) 933 { 934 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 935 uiSSDU += iDiff * iDiff; 936 } 937 pOrg += iStride; 938 pRec += iStride; 939 } 940 941 pOrg = pcPic ->getPicYuvOrg()->getCrAddr(); 942 pRec = pcPicD->getCrAddr(); 943 944 for( y = 0; y < iHeight; y++ ) 945 { 946 for( x = 0; x < iWidth; x++ ) 947 { 948 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 949 uiSSDV += iDiff * iDiff; 950 } 951 pOrg += iStride; 952 pRec += iStride; 953 } 954 } 955 956 dYPSNR = ( uiSSDY ? 10.0 * log10( fRefValueY / (Double)uiSSDY ) : 99.99 ); 957 dUPSNR = ( uiSSDU ? 10.0 * log10( fRefValueC / (Double)uiSSDU ) : 99.99 ); 958 dVPSNR = ( uiSSDV ? 10.0 * log10( fRefValueC / (Double)uiSSDV ) : 99.99 ); 872 959 } 873 960 // fix: total bits should consider slice size bits (32bit) -
branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncTop.cpp
r5 r11 416 416 { 417 417 pcPic->removeOriginalBuffer (); 418 #if POZNAN_AVAIL_MAP 419 pcPic->removeAvailabilityBuffer(); 420 #endif 421 #if POZNAN_SYNTH_VIEW 422 pcPic->removeSynthesisBuffer(); 423 #endif 418 424 #if HHI_INTER_VIEW_MOTION_PRED 419 425 pcPic->removeOrgDepthMapBuffer();
Note: See TracChangeset for help on using the changeset viewer.