Changeset 55 in SHVCSoftware for trunk/source
- Timestamp:
- 4 Mar 2013, 22:43:28 (12 years ago)
- Location:
- trunk/source
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-1.1-dev/source (added) merged: 38-49,52-53
- Property svn:mergeinfo changed
-
trunk/source/App/TAppDecoder/TAppDecCfg.cpp
r2 r55 75 75 string cfg_ReconFile; 76 76 #endif 77 #if AVC_SYNTAX || SYNTAX_OUTPUT 78 string cfg_BLSyntaxFile; 79 #endif 77 80 #if TARGET_DECLAYERID_SET 78 81 string cfg_TargetDecLayerIdSetFile; … … 90 93 ("BLSourceWidth,-wdt", m_iBLSourceWidth, 0, "BL source picture width") 91 94 ("BLSourceHeight,-hgt", m_iBLSourceHeight, 0, "BL source picture height") 95 #if AVC_SYNTAX 96 ("BLSyntaxFile,-ibs", cfg_BLSyntaxFile, string(""), "BL syntax input file name") 97 #endif 92 98 #endif 93 99 #else 94 100 ("ReconFile,o", cfg_ReconFile, string(""), "reconstructed YUV output file name\n" 95 101 "YUV writing is skipped if omitted") 102 #endif 103 #if SYNTAX_OUTPUT 104 ("BLSyntaxFile,-ibs", cfg_BLSyntaxFile, string(""), "BL syntax input file name") 105 ("BLSourceWidth,-wdt", m_iBLSourceWidth, 0, "BL source picture width") 106 ("BLSourceHeight,-hgt", m_iBLSourceHeight, 0, "BL source picture height") 107 ("BLFrames,-fr", m_iBLFrames, 0, "BL number of frames") 96 108 #endif 97 109 ("SkipFrames,s", m_iSkipFrame, 0, "number of frames to skip before random access") … … 138 150 #else 139 151 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 152 #endif 153 #if AVC_SYNTAX || SYNTAX_OUTPUT 154 m_pchBLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str()); 140 155 #endif 141 156 -
trunk/source/App/TAppDecoder/TAppDecCfg.h
r2 r55 66 66 Int m_iBLSourceWidth; 67 67 Int m_iBLSourceHeight; 68 #if AVC_SYNTAX 69 char* m_pchBLSyntaxFile; ///< input BL syntax file name 70 #endif 68 71 #endif 69 72 #else 70 73 char* m_pchReconFile; ///< output reconstruction file name 74 #endif 75 #if SYNTAX_OUTPUT 76 char* m_pchBLSyntaxFile; ///< input BL syntax file name 77 Int m_iBLSourceWidth; 78 Int m_iBLSourceHeight; 79 Int m_iBLFrames; 71 80 #endif 72 81 Int m_iSkipFrame; ///< counter for frames prior to the random access point to skip -
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r6 r55 102 102 } 103 103 #endif 104 #if AVC_SYNTAX || SYNTAX_OUTPUT 105 if( m_pchBLSyntaxFile ) 106 { 107 free ( m_pchBLSyntaxFile ); 108 m_pchBLSyntaxFile = NULL; 109 } 110 #endif 104 111 } 105 112 … … 147 154 #if AVC_BASE 148 155 TComPic pcBLPic; 149 FILE* pFile = fopen( m_pchBLReconFile, "rb" ); 150 if( !pFile ) 151 { 152 printf( "BL input reading error\n" ); 153 exit(0); 156 if( !m_pchBLReconFile ) 157 { 158 printf( "Wrong base layer YUV input file\n" ); 159 exit(EXIT_FAILURE); 160 } 161 fstream streamYUV( m_pchBLReconFile, fstream::in | fstream::binary ); 162 if( !streamYUV.good() ) 163 { 164 printf( "Base layer YUV input reading error\n" ); 165 exit(EXIT_FAILURE); 154 166 } 155 167 TComList<TComPic*> *cListPic = m_acTDecTop[0].getListPic(); 156 168 m_acTDecTop[0].setBLsize( m_iBLSourceWidth, m_iBLSourceHeight ); 157 m_acTDecTop[0].setBLReconFile( pFile);169 m_acTDecTop[0].setBLReconFile( &streamYUV ); 158 170 pcBLPic.setLayerId( 0 ); 159 171 cListPic->pushBack( &pcBLPic ); 172 #if AVC_SYNTAX 173 if( !m_pchBLSyntaxFile ) 174 { 175 printf( "Wrong base layer syntax file\n" ); 176 exit(EXIT_FAILURE); 177 } 178 fstream streamSyntaxFile( m_pchBLSyntaxFile, fstream::in | fstream::binary ); 179 if( !streamSyntaxFile.good() ) 180 { 181 printf( "Base layer syntax input reading error\n" ); 182 exit(EXIT_FAILURE); 183 } 184 m_acTDecTop[0].setBLSyntaxFile( &streamSyntaxFile ); 185 #endif 160 186 #endif 161 187 … … 254 280 // delete buffers 255 281 #if AVC_BASE 256 if( pFile ) 257 { 258 fclose( pFile ); 259 } 282 if( streamYUV.is_open() ) 283 { 284 streamYUV.close(); 285 } 286 #if AVC_SYNTAX 287 if( streamSyntaxFile.is_open() ) 288 { 289 streamSyntaxFile.close(); 290 } 291 #endif 260 292 pcBLPic.destroy(); 261 293 … … 293 325 // main decoder loop 294 326 bool recon_opened = false; // reconstruction file not yet opened. (must be performed after SPS is seen) 327 328 #if SYNTAX_OUTPUT 329 if( !m_pchBLSyntaxFile ) 330 { 331 printf( "Wrong base layer syntax file\n" ); 332 exit(EXIT_FAILURE); 333 } 334 fstream streamSyntaxFile( m_pchBLSyntaxFile, fstream::out | fstream::binary ); 335 if( !streamSyntaxFile.good() ) 336 { 337 printf( "Base layer syntax input reading error\n" ); 338 exit(EXIT_FAILURE); 339 } 340 m_cTDecTop.setBLSyntaxFile( &streamSyntaxFile ); 341 342 for( Int i = m_iBLFrames * m_iBLSourceWidth * m_iBLSourceHeight * SYNTAX_BYTES / 16; i >= 0; i-- ) 343 { 344 streamSyntaxFile.put( 0 ); 345 } 346 streamSyntaxFile.seekp( 0 ); 347 #endif 295 348 296 349 while (!!bitstreamFile) … … 389 442 } 390 443 } 444 445 #if SYNTAX_OUTPUT 446 if( streamSyntaxFile.is_open() ) 447 { 448 streamSyntaxFile.close(); 449 } 450 #endif 391 451 392 452 xFlushOutput( pcListPic ); -
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r21 r55 229 229 cfg_CroppingMode[layer] = &m_acLayerCfg[layer].m_croppingMode; 230 230 } 231 #if AVC_SYNTAX 232 string cfg_BLSyntaxFile; 233 #endif 231 234 #else 232 235 string cfg_InputFile; … … 259 262 ("InternalBitDepth", m_uiInternalBitDepth, 0u, "Internal bit-depth (BitDepth+BitIncrement)") 260 263 #if AVC_BASE 261 ("InputBLFile,-ibl", *cfg_InputFile[0], string(""), "Original BL rec YUV input file name") 264 ("InputBLFile,-ibl", *cfg_InputFile[0], string(""), "Base layer rec YUV input file name") 265 #if AVC_SYNTAX 266 ("InputBLSyntaxFile,-ibs", cfg_BLSyntaxFile, string(""), "Base layer syntax input file name") 267 #endif 262 268 #endif 263 269 #if REF_IDX_FRAMEWORK … … 516 522 #if SVC_EXTENSION 517 523 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 524 #if AVC_SYNTAX 525 m_BLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str()); 526 #endif 518 527 #else 519 528 m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str()); … … 1308 1317 printf("RecalQP:%d ", m_recalculateQPAccordingToLambda ? 1 : 0 ); 1309 1318 #endif 1319 printf("AVC_BASE:%d ", AVC_BASE); 1310 1320 #if REF_IDX_FRAMEWORK 1311 1321 printf("REF_IDX_FRAMEWORK:%d ", REF_IDX_FRAMEWORK); … … 1313 1323 printf("REF_IDX_ME_AROUND_ZEROMV:%d ", REF_IDX_ME_AROUND_ZEROMV); 1314 1324 printf("REF_IDX_ME_ZEROMV: %d", REF_IDX_ME_ZEROMV); 1315 #el se1325 #elif INTRA_BL 1316 1326 printf("INTRA_BL:%d ", INTRA_BL); 1317 printf("AVC_BASE:%d ", AVC_BASE);1318 1327 #if !AVC_BASE 1319 1328 printf("SVC_MVP:%d ", SVC_MVP ); -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r2 r55 67 67 unsigned int m_FrameSkip; ///< number of skipped frames from the beginning 68 68 Int m_iFrameToBeEncoded; ///< number of encoded frames 69 #if AVC_SYNTAX 70 char* m_BLSyntaxFile; ///< input syntax file 71 #endif 69 72 #else 70 73 char* m_pchInputFile; ///< source file name … … 305 308 Void getDirFilename(string& filename, string& dir, const string path); 306 309 Int getWaveFrontSynchro() { return m_iWaveFrontSynchro; } 310 #if AVC_SYNTAX 311 Char* getBLSyntaxFile() { return m_BLSyntaxFile; } 312 #endif 307 313 #endif 308 314 };// END CLASS DEFINITION TAppEncCfg -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r2 r55 120 120 printf("Input File : %s\n", m_cInputFile.c_str() ); 121 121 printf("Reconstruction File : %s\n", m_cReconFile.c_str() ); 122 #if AVC_SYNTAX 123 printf("Base layer input file : %s\n", m_cAppEncCfg->getBLSyntaxFile() ); 124 #endif 122 125 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_cropLeft - m_cropRight, m_iSourceHeight - m_cropTop - m_cropBottom, m_iFrameRate ); 123 126 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r33 r55 706 706 } 707 707 708 #if AVC_SYNTAX 709 if( !m_BLSyntaxFile ) 710 { 711 printf( "Wrong base layer syntax input file\n" ); 712 exit(EXIT_FAILURE); 713 } 714 fstream streamSyntaxFile( m_BLSyntaxFile, fstream::in | fstream::binary ); 715 if( !streamSyntaxFile.good() ) 716 { 717 printf( "Base layer syntax input reading error\n" ); 718 exit(EXIT_FAILURE); 719 } 720 m_acTEncTop[0].setBLSyntaxFile( &streamSyntaxFile ); 721 #endif 722 708 723 Bool bFirstFrame = true; 709 724 while ( !bEos ) … … 791 806 } 792 807 808 #if AVC_SYNTAX 809 if( streamSyntaxFile.is_open() ) 810 { 811 streamSyntaxFile.close(); 812 } 813 #endif 814 793 815 // delete buffers & classes 794 816 xDeleteBuffer(); -
trunk/source/Lib/TLibCommon/CommonDef.h
r14 r55 56 56 // ==================================================================================================================== 57 57 58 #define NV_VERSION "1. 0" ///< Current software version58 #define NV_VERSION "1.1" ///< Current software version 59 59 60 60 // ==================================================================================================================== -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r33 r55 383 383 m_layerId = pcPic->getLayerId(); 384 384 #endif 385 386 385 for(int i=0; i<pcPic->getNumPartInCU(); i++) 387 386 { … … 2906 2905 if(m_layerId) 2907 2906 { 2907 #if MV_SCALING_POS_FIX 2908 pcColCU = getBaseColCU( xP + nPSW/2, yP + nPSH/2, uiCUAddrBase, uiAbsPartAddrBase ); 2909 #else 2908 2910 UInt uiPartIdxCenter; 2909 2911 xDeriveCenterIdx( cCurPS, uiPUIdx, uiPartIdxCenter ); 2910 2912 uiPartIdxCenter -= m_uiAbsIdxInLCU; 2911 2913 pcColCU = getBaseColCU( uiPartIdxCenter, uiCUAddrBase, uiAbsPartAddrBase ); 2914 #endif 2912 2915 2913 2916 #if INTRA_BL … … 4843 4846 } 4844 4847 4845 #if INTRA_BL 4848 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED 4846 4849 Void TComDataCU::getBaseLumaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride ) 4847 4850 { … … 4883 4886 TComDataCU* TComDataCU::getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) 4884 4887 { 4888 #if 1 // it should provide identical resutls 4889 UInt uiPelX = getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiCuAbsPartIdx] ]; 4890 UInt uiPelY = getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiCuAbsPartIdx] ]; 4891 4892 return getBaseColCU( uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase ); 4893 #else 4885 4894 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(); 4886 4895 … … 4927 4936 4928 4937 return cBaseColPic->getCU(uiCUAddrBase); 4938 #endif 4939 } 4940 4941 TComDataCU* TComDataCU::getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) 4942 { 4943 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(); 4944 4945 #if SVC_UPSAMPLING 4946 Int iBWidth = cBaseColPic->getPicYuvRec()->getWidth () - cBaseColPic->getPicYuvRec()->getPicCropLeftOffset() - cBaseColPic->getPicYuvRec()->getPicCropRightOffset(); 4947 Int iBHeight = cBaseColPic->getPicYuvRec()->getHeight() - cBaseColPic->getPicYuvRec()->getPicCropTopOffset() - cBaseColPic->getPicYuvRec()->getPicCropBottomOffset(); 4948 4949 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset(); 4950 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset(); 4951 #else 4952 Int iBWidth = cBaseColPic->getPicYuvRec()->getWidth(); 4953 Int iBHeight = cBaseColPic->getPicYuvRec()->getHeight(); 4954 4955 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth(); 4956 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight(); 4957 #endif 4958 4959 uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX); 4960 uiPelY = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getHeight() - 1, uiPelY); 4961 4962 UInt uiMinUnitSize = m_pcPic->getMinCUWidth(); 4963 4964 Int iBX = (uiPelX*iBWidth + iEWidth/2)/iEWidth; 4965 Int iBY = (uiPelY*iBHeight+ iEHeight/2)/iEHeight; 4966 4967 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight()) 4968 { 4969 return NULL; 4970 } 4971 4972 #if AVC_SYNTAX 4973 if( iBX >= iBWidth || iBY >= iBHeight ) //outside of the reference layer cropped picture 4974 { 4975 return NULL; 4976 } 4977 #endif 4978 4979 uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth); 4980 4981 assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame()); 4982 4983 UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*cBaseColPic->getNumPartInWidth() 4984 + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize; 4985 4986 uiAbsPartIdxBase = g_auiRasterToZscan[uiRasterAddrBase]; 4987 4988 return cBaseColPic->getCU(uiCUAddrBase); 4929 4989 } 4930 4990 4931 4991 Void TComDataCU::scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ) 4932 4992 { 4933 TComMvField cMvFieldBase; 4934 TComMv cMv; 4935 4936 Int iBWidth = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth(); 4937 Int iBHeight = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight(); 4938 4939 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth(); 4940 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight(); 4941 4942 Int iMvX = (rcMvFieldBase.getHor()*iEWidth + (iBWidth/2 -1) * (rcMvFieldBase.getHor() > 0 ? 1: -1) )/iBWidth; 4943 Int iMvY = (rcMvFieldBase.getVer()*iEHeight + (iBHeight/2 -1) * (rcMvFieldBase.getVer() > 0 ? 1: -1) )/iBHeight; 4944 4945 cMv.set(iMvX, iMvY); 4946 4947 rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() ); 4993 TComMvField cMvFieldBase; 4994 TComMv cMv; 4995 4996 #if MV_SCALING_FIX 4997 Int iBWidth = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropLeftOffset() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropRightOffset(); 4998 Int iBHeight = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropTopOffset() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropBottomOffset(); 4999 5000 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset(); 5001 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset(); 5002 #else 5003 Int iBWidth = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth(); 5004 Int iBHeight = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight(); 5005 5006 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth(); 5007 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight(); 5008 #endif 5009 5010 Int iMvX = (rcMvFieldBase.getHor()*iEWidth + (iBWidth/2 -1) * (rcMvFieldBase.getHor() > 0 ? 1: -1) )/iBWidth; 5011 Int iMvY = (rcMvFieldBase.getVer()*iEHeight + (iBHeight/2 -1) * (rcMvFieldBase.getVer() > 0 ? 1: -1) )/iBHeight; 5012 5013 cMv.set(iMvX, iMvY); 5014 5015 rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() ); 4948 5016 } 4949 5017 #endif -
trunk/source/Lib/TLibCommon/TComDataCU.h
r28 r55 526 526 // ------------------------------------------------------------------------------------------------------------------- 527 527 528 #if INTRA_BL 528 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED 529 529 Void getBaseLumaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride ); 530 530 Void getBaseChromaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, UInt uiChromaId ); … … 593 593 #if SVC_COL_BLK 594 594 TComDataCU* getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 595 TComDataCU* getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 595 596 Void scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ); 596 597 #endif -
trunk/source/Lib/TLibCommon/TComMotionInfo.h
r28 r55 141 141 Void setAllMvField( TComMvField const & mvField, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 ); 142 142 143 #if AVC_SYNTAX 144 Void setMv (TComMv cMv, Int iIdx ) { m_pcMv [iIdx] = cMv; } 145 Void setRefIdx(Int iRefIdx, Int iIdx ) { m_piRefIdx[iIdx] = iRefIdx; } 146 #endif 147 143 148 Void setNumPartition( Int iNumPart ) 144 149 { -
trunk/source/Lib/TLibCommon/TComPic.cpp
r33 r55 66 66 , m_SEIs (NULL) 67 67 #if SVC_EXTENSION 68 , m_layerId( 0 ) 68 69 , m_bSpatialEnhLayer( false ) 69 70 , m_pcFullPelBaseRec( NULL ) … … 96 97 m_pcFullPelBaseRec = new TComPicYuv; m_pcFullPelBaseRec->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 97 98 } 99 100 m_layerId = pcSps->getLayerId(); 98 101 99 102 /* there are no SEI messages associated with this picture initially */ … … 557 560 558 561 #if REF_IDX_MFM 562 #if !REUSE_BLKMAPPING 559 563 Void TComPic::deriveUnitIdxBase( UInt uiUpsamplePelX, UInt uiUpsamplePelY, UInt ratio, UInt& uiBaseCUAddr, UInt& uiBaseAbsPartIdx ) 560 564 { … … 565 569 UInt uiBaseWidth = getPicYuvRec()->getWidth(); 566 570 UInt uiBaseHeight = getPicYuvRec()->getHeight(); 567 571 568 572 UInt uiWidthInCU = ( uiBaseWidth % g_uiMaxCUWidth ) ? uiBaseWidth /g_uiMaxCUWidth + 1 : uiBaseWidth /g_uiMaxCUWidth; 573 574 #if MFM_CLIPPING_FIX 575 uiPelX = (UInt)Clip3<UInt>(0, getPicYuvRec()->getWidth() - 1, uiPelX); 576 uiPelY = (UInt)Clip3<UInt>(0, getPicYuvRec()->getHeight() - 1, uiPelY); 577 #else 569 578 UInt uiHeightInCU = ( uiBaseHeight% g_uiMaxCUHeight ) ? uiBaseHeight/ g_uiMaxCUHeight + 1 : uiBaseHeight/ g_uiMaxCUHeight; 570 579 571 580 uiPelX = (UInt)Clip3<UInt>(0, uiWidthInCU * g_uiMaxCUWidth - 1, uiPelX); 572 581 uiPelY = (UInt)Clip3<UInt>(0, uiHeightInCU * g_uiMaxCUHeight - 1, uiPelY); 582 #endif 573 583 574 584 uiBaseCUAddr = uiPelY / g_uiMaxCUHeight * uiWidthInCU + uiPelX / g_uiMaxCUWidth; … … 585 595 return; 586 596 } 597 #endif 587 598 588 599 Void TComPic::copyUpsampledMvField(TComPic* pcPicBase) 589 600 { 601 #if !REUSE_MVSCALE || !REUSE_BLKMAPPING || AVC_SYNTAX 590 602 Int iBWidth = pcPicBase->getPicYuvRec()->getWidth () - pcPicBase->getPicYuvRec()->getPicCropLeftOffset() - pcPicBase->getPicYuvRec()->getPicCropRightOffset(); 591 603 Int iBHeight = pcPicBase->getPicYuvRec()->getHeight() - pcPicBase->getPicYuvRec()->getPicCropTopOffset() - pcPicBase->getPicYuvRec()->getPicCropBottomOffset(); … … 593 605 Int iEWidth = getPicYuvRec()->getWidth() - getPicYuvRec()->getPicCropLeftOffset() - getPicYuvRec()->getPicCropRightOffset(); 594 606 Int iEHeight = getPicYuvRec()->getHeight() - getPicYuvRec()->getPicCropTopOffset() - getPicYuvRec()->getPicCropBottomOffset(); 607 #endif 595 608 609 #if !REUSE_MVSCALE || !REUSE_BLKMAPPING 596 610 UInt upSampleRatio = 0; 597 611 if(iEWidth == iBWidth && iEHeight == iBHeight) … … 611 625 assert(0); 612 626 } 627 #endif 628 629 UInt uiNumPartitions = 1<<(g_uiMaxCUDepth<<1); 630 UInt uiWidthMinPU = g_uiMaxCUWidth/(1<<g_uiMaxCUDepth); 631 UInt uiHeightMinPU = g_uiMaxCUHeight/(1<<g_uiMaxCUDepth); 632 Int unitNum = max (1, (Int)((16/uiWidthMinPU)*(16/uiHeightMinPU)) ); 613 633 614 634 for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCUsInFrame(); cuIdx++) //each LCU 615 635 { 616 UInt uiNumPartitions = 1<<(g_uiMaxCUDepth<<1);617 618 636 TComDataCU* pcCUDes = getCU(cuIdx); 619 620 UInt uiWidthMinPU = g_uiMaxCUWidth/(1<<g_uiMaxCUDepth);621 UInt uiHeightMinPU = g_uiMaxCUHeight/(1<<g_uiMaxCUDepth);622 Int unitNum = max (1, (Int)((16/uiWidthMinPU)*(16/uiHeightMinPU)) );623 637 624 638 for(UInt uiAbsPartIdx = 0; uiAbsPartIdx < uiNumPartitions; uiAbsPartIdx+=unitNum ) //each 16x16 unit … … 628 642 UInt uiPelY = pcCUDes->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 629 643 UInt uiBaseCUAddr, uiBaseAbsPartIdx; 630 pcPicBase->deriveUnitIdxBase(uiPelX + 8, uiPelY + 8, upSampleRatio, uiBaseCUAddr, uiBaseAbsPartIdx); 644 645 #if REUSE_BLKMAPPING 646 TComDataCU *pcColCU = 0; 647 pcColCU = pcCUDes->getBaseColCU(uiPelX + 8, uiPelY + 8, uiBaseCUAddr, uiBaseAbsPartIdx); 648 #else 649 pcPicBase->deriveUnitIdxBase(uiPelX + 8, uiPelY + 8, upSampleRatio, uiBaseCUAddr, uiBaseAbsPartIdx); 650 #endif 651 652 #if AVC_SYNTAX 653 Int iBX = ( (uiPelX + 8) * iBWidth + iEWidth/2 ) / iEWidth; 654 Int iBY = ( (uiPelY + 8) * iBHeight+ iEHeight/2 ) / iEHeight; 655 656 #if REUSE_BLKMAPPING 657 if( ( iBX < iBWidth && iBY < iBHeight ) && pcColCU && (pcColCU->getPredictionMode(uiBaseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(uiBaseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode 658 #else 659 if( ( iBX < iBWidth && iBY < iBHeight ) && (pcPicBase->getCU(uiBaseCUAddr)->getPredictionMode(uiBaseAbsPartIdx) != MODE_NONE) && (pcPicBase->getCU(uiBaseCUAddr)->getPredictionMode(uiBaseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode 660 #endif 661 #else 662 #if REUSE_BLKMAPPING 663 if( pcColCU && (pcColCU->getPredictionMode(uiBaseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(uiBaseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode 664 #else 631 665 if( (pcPicBase->getCU(uiBaseCUAddr)->getPredictionMode(uiBaseAbsPartIdx) != MODE_NONE) && (pcPicBase->getCU(uiBaseCUAddr)->getPredictionMode(uiBaseAbsPartIdx) != MODE_INTRA) ) //base layer unit not skip and invalid mode 632 { 633 for(UInt list = 0; list < 2; list++) //each list 634 { 635 TComMv cMv = pcPicBase->getCU(uiBaseCUAddr)->getCUMvField((RefPicList)list)->getMv(uiBaseAbsPartIdx); 636 Int refIdx = pcPicBase->getCU(uiBaseCUAddr)->getCUMvField((RefPicList)list)->getRefIdx(uiBaseAbsPartIdx); 666 #endif 667 #endif 668 { 669 for(UInt refPicList = 0; refPicList < 2; refPicList++) //for each reference list 670 { 671 #if REUSE_MVSCALE 672 TComMvField sMvFieldBase, sMvField; 673 #if REUSE_BLKMAPPING 674 pcColCU->getMvField( pcColCU, uiBaseAbsPartIdx, (RefPicList)refPicList, sMvFieldBase); 675 #else 676 pcPicBase->getCU(uiBaseCUAddr)->getMvField( pcPicBase->getCU(uiBaseCUAddr), uiBaseAbsPartIdx, (RefPicList)refPicList, sMvFieldBase); 677 #endif 678 pcCUDes->scaleBaseMV( sMvField, sMvFieldBase ); 679 #else 680 TComMv cMv = pcPicBase->getCU(uiBaseCUAddr)->getCUMvField((RefPicList)refPicList)->getMv(uiBaseAbsPartIdx); 681 Int refIdx = pcPicBase->getCU(uiBaseCUAddr)->getCUMvField((RefPicList)refPicList)->getRefIdx(uiBaseAbsPartIdx); 637 682 638 683 Int Hor = ((Int)upSampleRatio * cMv.getHor())/2 ; … … 642 687 TComMvField sMvField; 643 688 sMvField.setMvField(cScaledMv, refIdx); 644 645 pcCUDes->getCUMvField((RefPicList)list)->setMvField(sMvField, uiAbsPartIdx); 689 #endif 690 691 pcCUDes->getCUMvField((RefPicList)refPicList)->setMvField(sMvField, uiAbsPartIdx); 646 692 pcCUDes->setPredictionMode(uiAbsPartIdx, MODE_INTER); 647 693 } … … 669 715 #endif 670 716 717 #if AVC_SYNTAX 718 Void TComPic::readBLSyntax( fstream* filestream, UInt numBytes ) 719 { 720 if( !filestream->good() ) 721 { 722 return; 723 } 724 725 UInt uiWidth = this->getPicYuvRec()->getWidth() - this->getPicYuvRec()->getPicCropLeftOffset() - this->getPicYuvRec()->getPicCropRightOffset(); 726 UInt uiHeight = this->getPicYuvRec()->getHeight() - this->getPicYuvRec()->getPicCropTopOffset() - this->getPicYuvRec()->getPicCropBottomOffset(); 727 UInt64 uiPOC = (UInt64)this->getPOC(); 728 UInt uiPartWidth = uiWidth / 4; 729 UInt uiPartHeight = uiHeight / 4; 730 731 UInt uiNumPartInWidth = this->getNumPartInWidth(); 732 UInt uiNumPartInHeight = this->getNumPartInHeight(); 733 UInt uiNumPartLCUInWidth = this->getFrameWidthInCU(); 734 735 UInt64 uiPos = (UInt64)uiPOC * uiWidth * uiHeight * numBytes / 16; 736 737 filestream->seekg( uiPos, ios_base::beg ); 738 739 for( Int i = 0; i < uiPartHeight; i++ ) 740 { 741 for( Int j = 0; j < uiPartWidth; j++ ) 742 { 743 UInt uiX = ( j / uiNumPartInWidth ); 744 UInt uiY = ( i / uiNumPartInHeight ); 745 746 UInt uiLCUAddr = uiY * uiNumPartLCUInWidth + uiX; 747 UInt uiPartAddr = ( i - uiY * uiNumPartInHeight ) * uiNumPartInWidth + ( j - uiX * uiNumPartInWidth ); 748 uiPartAddr = g_auiRasterToZscan[uiPartAddr]; 749 750 TComDataCU* pcCU = this->getCU( uiLCUAddr ); 751 752 TComMv mv; 753 Short temp; 754 755 // RefIdxL0 756 Char refIdxL0 = -1; 757 filestream->read( &refIdxL0, 1 ); 758 assert( refIdxL0 >= -1 ); 759 pcCU->getCUMvField( REF_PIC_LIST_0 )->setRefIdx( (Int)refIdxL0, uiPartAddr ); 760 761 // RefIdxL1 762 Char refIdxL1 = -1; 763 filestream->read( &refIdxL1, 1 ); 764 assert( refIdxL1 >= -1 ); 765 pcCU->getCUMvField( REF_PIC_LIST_1 )->setRefIdx( (Int)refIdxL1, uiPartAddr ); 766 767 // MV L0 768 temp = 0; 769 filestream->read( reinterpret_cast<char*>(&temp), 2 ); 770 mv.setHor( (Short)temp ); 771 temp = 0; 772 filestream->read( reinterpret_cast<char*>(&temp), 2 ); 773 mv.setVer( (Short)temp ); 774 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMv( mv, uiPartAddr ); 775 776 // MV L1 777 temp = 0; 778 filestream->read( reinterpret_cast<char*>(&temp), 2 ); 779 mv.setHor( (Short)temp ); 780 temp = 0; 781 filestream->read( reinterpret_cast<char*>(&temp), 2 ); 782 mv.setVer( (Short)temp ); 783 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMv( mv, uiPartAddr ); 784 785 // set dependent information 786 pcCU->setPredictionMode( uiPartAddr, ( refIdxL0 == NOT_VALID && refIdxL1 == NOT_VALID ) ? MODE_INTRA : MODE_INTER ); 787 UInt uiInterDir = ( refIdxL0 != NOT_VALID ) + ( refIdxL1 != NOT_VALID && this->getSlice(0)->isInterB() ) * 2; 788 assert( uiInterDir >= 0 && uiInterDir <= 3 ); 789 pcCU->setInterDir( uiPartAddr, uiInterDir ); 790 } 791 } 792 } 793 #endif 794 795 #if SYNTAX_OUTPUT 796 Void TComPic::wrireBLSyntax( fstream* filestream, UInt numBytes ) 797 { 798 if( !filestream->good() ) 799 { 800 return; 801 } 802 803 UInt uiWidth = this->getPicYuvRec()->getWidth() - getSlice(0)->getSPS()->getPicCropLeftOffset() - getSlice(0)->getSPS()->getPicCropRightOffset(); 804 UInt uiHeight = this->getPicYuvRec()->getHeight() - getSlice(0)->getSPS()->getPicCropTopOffset() - getSlice(0)->getSPS()->getPicCropBottomOffset(); 805 UInt64 uiPOC = (UInt64)this->getPOC(); 806 UInt uiPartWidth = uiWidth / 4; 807 UInt uiPartHeight = uiHeight / 4; 808 809 UInt uiNumPartInWidth = this->getNumPartInWidth(); 810 UInt uiNumPartInHeight = this->getNumPartInHeight(); 811 UInt uiNumPartLCUInWidth = this->getFrameWidthInCU(); 812 813 filestream->seekg( uiPOC * uiWidth * uiHeight * numBytes / 16 ); 814 815 for( Int i = 0; i < uiPartHeight; i++ ) 816 { 817 for( Int j = 0; j < uiPartWidth; j++ ) 818 { 819 UInt uiX = ( j / uiNumPartInWidth ); 820 UInt uiY = ( i / uiNumPartInHeight ); 821 822 UInt uiLCUAddr = uiY * uiNumPartLCUInWidth + uiX; 823 UInt uiPartAddr = ( i - uiY * uiNumPartInHeight ) * uiNumPartInWidth + ( j - uiX * uiNumPartInWidth ); 824 uiPartAddr = g_auiRasterToZscan[uiPartAddr]; 825 826 TComDataCU* pcCU = this->getCU( uiLCUAddr ); 827 828 TComMv mv; 829 Short temp; 830 Char refIdxL0 = NOT_VALID, refIdxL1 = NOT_VALID; 831 832 // RefIdx 833 if( !pcCU->isIntra( uiPartAddr ) ) 834 { 835 refIdxL0 = (Char)pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ); 836 refIdxL1 = (Char)pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ); 837 } 838 assert( refIdxL0 >= - 1 && refIdxL1 >= - 1 ); 839 filestream->put( refIdxL0 ); 840 filestream->put( refIdxL1 ); 841 842 // MV L0 843 mv.setZero(); 844 if( refIdxL0 >= 0 ) 845 { 846 mv = pcCU->getCUMvField( REF_PIC_LIST_0 )->getMv( uiPartAddr ); 847 } 848 temp = (Short)mv.getHor(); 849 filestream->write( reinterpret_cast<char*>(&temp), 2 ); 850 temp = (Short)mv.getVer(); 851 filestream->write( reinterpret_cast<char*>(&temp), 2 ); 852 853 // MV L1 854 mv.setZero(); 855 if( refIdxL1 >= 0 ) 856 { 857 mv = pcCU->getCUMvField( REF_PIC_LIST_1 )->getMv( uiPartAddr ); 858 } 859 temp = (Short)mv.getHor(); 860 filestream->write( reinterpret_cast<char*>(&temp), 2 ); 861 temp = (Short)mv.getVer(); 862 filestream->write( reinterpret_cast<char*>(&temp), 2 ); 863 } 864 } 865 } 866 #endif 867 868 671 869 //! \} -
trunk/source/Lib/TLibCommon/TComPic.h
r28 r55 44 44 #include "TComPicYuv.h" 45 45 #include "TComBitStream.h" 46 #if AVC_BASE || SYNTAX_OUTPUT 47 #include <fstream> 48 #endif 49 46 50 47 51 //! \ingroup TLibCommon … … 125 129 #if REF_IDX_MFM 126 130 Void copyUpsampledMvField ( TComPic* pcPicBase ); 131 #if !REUSE_BLKMAPPING 127 132 Void deriveUnitIdxBase ( UInt uiUpsamplePelX, UInt uiUpsamplePelY, UInt ratio, UInt& uiBaseCUAddr, UInt& uiBaseAbsPartIdx ); 133 #endif 128 134 #endif 129 135 … … 209 215 Void copyUpsampledPictureYuv(TComPicYuv* pcPicYuvIn, TComPicYuv* pcPicYuvOut); 210 216 #endif 217 #if AVC_SYNTAX 218 Void readBLSyntax( fstream* filestream, UInt numBytes ); 219 #endif 220 #if SYNTAX_OUTPUT 221 Void wrireBLSyntax( fstream* filestream, UInt numBytes ); 222 #endif 223 211 224 };// END CLASS DEFINITION TComPic 212 225 … … 214 227 215 228 #endif // __TCOMPIC__ 229 -
trunk/source/Lib/TLibCommon/TComPicSym.h
r2 r55 125 125 UInt getNumberOfCUsInFrame() { return m_uiNumCUsInFrame; } 126 126 TComDataCU*& getCU( UInt uiCUAddr ) { return m_apcTComDataCU[uiCUAddr]; } 127 128 #if AVC_SYNTAX 129 UInt getMaxCUWidth() { return m_uiMaxCUWidth; } 130 UInt getMaxCUHeight() { return m_uiMaxCUHeight; } 131 UInt getMaxDepth() { return m_uhTotalDepth; } 132 #endif 127 133 128 134 Void setSlice(TComSlice* p, UInt i) { m_apcTComSlice[i] = p; } -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r2 r55 407 407 } 408 408 409 #if INTRA_BL 409 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED 410 410 Void TComPrediction::getBaseBlk( TComDataCU* pcCU, TComYuv* pcYuvPred, Int iPartAddr, Int iWidth, Int iHeight ) 411 411 { -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r33 r55 562 562 assert(thePoc == pcRefPicBL->getPOC()); 563 563 564 #if REUSE_MVSCALE || REUSE_BLKMAPPING 565 ilpPic[0]->getSlice(0)->setBaseColPic( pcRefPicBL ); 566 #endif 567 564 568 //initialize reference POC of ILP 565 569 for(Int refIdx = 0; refIdx < MAX_NUM_REF; refIdx++) … … 2191 2195 } 2192 2196 #endif 2197 2198 #if SVC_EXTENSION && AVC_SYNTAX 2199 Void TComSlice::initBaseLayerRPL( TComSlice *pcSlice ) 2200 { 2201 // Assumed that RPL of the base layer is same to the EL, otherwise this information should be also dumped and read from the metadata file 2202 setPOC( pcSlice->getPOC() ); 2203 if( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) 2204 { 2205 setSliceType( I_SLICE ); 2206 } 2207 else 2208 { 2209 setSliceType( pcSlice->getSliceType() ); 2210 } 2211 2212 if( this->isIntra() ) 2213 { 2214 return; 2215 } 2216 2217 //initialize reference POC of BL 2218 for( Int iRefPicList = 0; iRefPicList < 2; iRefPicList++ ) 2219 { 2220 RefPicList eRefPicList = RefPicList( iRefPicList ); 2221 2222 assert( pcSlice->getNumRefIdx( eRefPicList) > 0 ); 2223 setNumRefIdx( eRefPicList, pcSlice->getNumRefIdx( eRefPicList ) - 1 ); 2224 assert( getNumRefIdx( eRefPicList) <= MAX_NUM_REF); 2225 2226 for(Int refIdx = 0; refIdx < getNumRefIdx( eRefPicList ); refIdx++) 2227 { 2228 setRefPOC( pcSlice->getRefPic( eRefPicList, refIdx )->getPOC(), eRefPicList, refIdx ); 2229 setRefPic( pcSlice->getRefPic( eRefPicList, refIdx ), eRefPicList, refIdx ); 2230 /* 2231 // should be set if the base layer has its own instance of the reference picture lists, currently EL RPL is reused. 2232 getRefPic( eRefPicList, refIdx )->setLayerId( 0 ); 2233 getRefPic( eRefPicList, refIdx )->setIsLongTerm( pcSlice->getRefPic( eRefPicList, refIdx )->getIsLongTerm() ); 2234 getRefPic( eRefPicList, refIdx )->setIsUsedAsLongTerm( pcSlice->getRefPic( eRefPicList, refIdx )->getIsUsedAsLongTerm() ); 2235 */ 2236 2237 } 2238 } 2239 return; 2240 } 2241 #endif 2242 2193 2243 //! \} -
trunk/source/Lib/TLibCommon/TComSlice.h
r28 r55 1454 1454 Void setFullPelBaseRec ( TComPicYuv* p) { m_pcFullPelBaseRec = p; } 1455 1455 TComPicYuv* getFullPelBaseRec () { return m_pcFullPelBaseRec; } 1456 1457 #if AVC_SYNTAX 1458 Void initBaseLayerRPL( TComSlice *pcSlice ); 1459 #endif 1456 1460 #endif 1457 1461 -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r28 r55 227 227 #endif 228 228 229 230 231 229 assert ( iEWidth == 2*iBWidth || 2*iEWidth == 3*iBWidth ); 232 230 assert ( iEHeight == 2*iBHeight || 2*iEHeight == 3*iBHeight ); -
trunk/source/Lib/TLibCommon/TypeDef.h
r28 r55 40 40 41 41 #define SVC_EXTENSION 1 42 43 #define SYNTAX_BYTES 10 ///< number of bytes taken by syntaxes per 4x4 block [RefIdxL0(1byte), RefIdxL1(1byte), MVxL0(2bytes), MVyL0(2bytes), MVxL1(2bytes), MVyL1(2bytes)] 44 42 45 #if SVC_EXTENSION 43 46 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle … … 49 52 #define BUGFIX_925 1 ///< bug fix ticket #925 50 53 #define ENCODER_BUGFIX 1 ///< L0167: encoder bug fix for inter mode 51 52 54 #define CHROMA_UPSAMPLING 1 ///< L0335: Chroma upsampling with 5 bits coefficients 53 55 54 #define AVC_BASE 0 ///< YUV BL reading for AVC base SVC 55 56 #define MV_SCALING_FIX 1 ///< fixing the base layer MV scaling 57 #define MV_SCALING_POS_FIX 1 ///< use center pixels to get co-located base layer block 58 #define MFM_CLIPPING_FIX 1 ///< set the right picture size for the clipping 59 60 #define AVC_BASE 1 ///< YUV BL reading for AVC base SVC 56 61 #define REF_IDX_FRAMEWORK 0 ///< inter-layer reference framework 62 63 #if AVC_BASE 64 #define AVC_SYNTAX 1 ///< Syntax reading for AVC base 65 #endif 57 66 58 67 #if REF_IDX_FRAMEWORK … … 60 69 #define REF_IDX_ME_ZEROMV 1 ///< L0051: use zero motion for inter-layer reference picture (without fractional ME) 61 70 #define ENCODER_FAST_MODE 1 ///< L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1. 71 #if !AVC_BASE || AVC_SYNTAX 62 72 #define REF_IDX_MFM 1 ///< L0336: motion vector mapping of inter-layer reference picture 73 #endif 74 75 #if REF_IDX_MFM 76 #define REUSE_MVSCALE 1 ///< using the base layer MV scaling function 77 #define REUSE_BLKMAPPING 1 ///< using the base layer get co-located block function 78 #endif 79 63 80 #else 64 81 #define INTRA_BL 1 ///< inter-layer texture prediction … … 69 86 70 87 // Hooks 71 #if !AVC_BASE 88 #if !AVC_BASE || AVC_SYNTAX 72 89 #define SVC_MVP 1 ///< motion hook for merge mode as an example 90 #if !AVC_SYNTAX 73 91 #define SVC_BL_CAND_INTRA 0 ///< Intra Base Mode Prediction hook as an example 74 92 #endif … … 80 98 81 99 #endif 100 #endif 101 #else 102 #define SYNTAX_OUTPUT 1 82 103 #endif 83 104 -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r17 r55 546 546 547 547 //===== get prediction signal ===== 548 #if INTRA_BL 548 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED 549 549 if(pcCU->isIntraBL ( uiAbsPartIdx ) ) 550 550 { … … 651 651 652 652 //===== get prediction signal ===== 653 #if INTRA_BL 653 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED 654 654 if(pcCU->isIntraBL ( uiAbsPartIdx ) ) 655 655 { -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r30 r55 81 81 memset(m_cIlpPic, 0, sizeof(m_cIlpPic)); 82 82 #endif 83 #if AVC_SYNTAX || SYNTAX_OUTPUT 84 m_pBLSyntaxFile = NULL; 85 #endif 83 86 84 87 } … … 335 338 336 339 m_cGopDecoder.filterPicture(pcPic); 340 341 #if SYNTAX_OUTPUT 342 pcPic->wrireBLSyntax( getBLSyntaxFile(), SYNTAX_BYTES ); 343 #endif 337 344 338 345 TComSlice::sortPicList( m_cListPic ); // sorting for application output … … 554 561 if (m_bFirstSliceInPicture) 555 562 { 556 557 563 #if AVC_BASE 558 564 if( m_layerId == 1 ) 559 565 { 560 566 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 561 FILE* pFile= m_ppcTDecTop[0]->getBLReconFile();562 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth();563 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight();567 fstream* pFile = m_ppcTDecTop[0]->getBLReconFile(); 568 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth() - pBLPic->getPicYuvRec()->getPicCropLeftOffset() - pBLPic->getPicYuvRec()->getPicCropRightOffset();; 569 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight() - pBLPic->getPicYuvRec()->getPicCropTopOffset() - pBLPic->getPicYuvRec()->getPicCropBottomOffset(); 564 570 565 if( pFile ) 566 { 567 fseek( pFile, m_apcSlicePilot->getPOC() * uiWidth * uiHeight * 3 / 2, SEEK_SET ); 571 if( pFile->good() ) 572 { 573 UInt64 uiPos = (UInt64) m_apcSlicePilot->getPOC() * uiWidth * uiHeight * 3 / 2; 574 575 pFile->seekg((UInt)uiPos, ios::beg ); 568 576 569 577 Pel* pPel = pBLPic->getPicYuvRec()->getLumaAddr(); … … 573 581 for( Int j = 0; j < uiWidth; j++ ) 574 582 { 575 pPel[j] = fgetc( pFile);583 pPel[j] = pFile->get(); 576 584 } 577 585 pPel += uiStride; … … 584 592 for( Int j = 0; j < uiWidth/2; j++ ) 585 593 { 586 pPel[j] = fgetc( pFile);594 pPel[j] = pFile->get(); 587 595 } 588 596 pPel += uiStride; … … 595 603 for( Int j = 0; j < uiWidth/2; j++ ) 596 604 { 597 pPel[j] = fgetc( pFile);605 pPel[j] = pFile->get(); 598 606 } 599 607 pPel += uiStride; … … 737 745 { 738 746 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_prevRAPisBLA, m_cListPic); 739 #if !REF_IDX_FRAMEWORK 747 #if !REF_IDX_FRAMEWORK || AVC_SYNTAX 740 748 // Set reference list 741 749 pcSlice->setRefPicList( m_cListPic ); … … 747 755 #if AVC_BASE 748 756 pcSlice->setBaseColPic ( *m_ppcTDecTop[0]->getListPic()->begin() ); 757 #if AVC_SYNTAX 758 TComPic* pBLPic = pcSlice->getBaseColPic(); 759 if( pcSlice->getPOC() == 0 ) 760 { 761 // initialize partition order. 762 UInt* piTmp = &g_auiZscanToRaster[0]; 763 initZscanToRaster( pBLPic->getPicSym()->getMaxDepth() + 1, 1, 0, piTmp ); 764 initRasterToZscan( pBLPic->getPicSym()->getMaxCUWidth(), pBLPic->getPicSym()->getMaxCUHeight(), pBLPic->getPicSym()->getMaxDepth() + 1 ); 765 } 766 pBLPic->getSlice( 0 )->initBaseLayerRPL( pcSlice ); 767 pBLPic->readBLSyntax( m_ppcTDecTop[0]->getBLSyntaxFile(), SYNTAX_BYTES ); 768 #endif 769 749 770 #else 750 771 TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 ); … … 767 788 768 789 #if REF_IDX_FRAMEWORK 790 #if !AVC_SYNTAX 769 791 // Set reference list 770 792 pcSlice->setRefPicList( m_cListPic ); 793 #endif 771 794 if(m_layerId > 0) 772 795 { … … 979 1002 { 980 1003 #if SVC_UPSAMPLING 1004 #if AVC_SYNTAX 1005 TComSPS* sps = new TComSPS(); 1006 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, sps, true); 1007 #else 981 1008 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL, true); 1009 #endif 982 1010 #else 983 1011 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); -
trunk/source/Lib/TLibDecoder/TDecTop.h
r28 r55 127 127 TDecTop** m_ppcTDecTop; 128 128 #if AVC_BASE 129 FILE*m_pBLReconFile;129 fstream* m_pBLReconFile; 130 130 Int m_iBLSourceWidth; 131 131 Int m_iBLSourceHeight; 132 132 #endif 133 133 #endif 134 #if AVC_SYNTAX || SYNTAX_OUTPUT 135 fstream* m_pBLSyntaxFile; 136 #endif 134 137 #if REF_IDX_FRAMEWORK 135 138 TComPic* m_cIlpPic[MAX_NUM_REF]; ///< Inter layer Prediction picture = upsampled picture … … 165 168 TDecTop* getLayerDec(UInt layer) { return m_ppcTDecTop[layer]; } 166 169 #if AVC_BASE 167 Void setBLReconFile( FILE* pFile ) { m_pBLReconFile = pFile; }168 FILE*getBLReconFile() { return m_pBLReconFile; }170 Void setBLReconFile( fstream* pFile ) { m_pBLReconFile = pFile; } 171 fstream* getBLReconFile() { return m_pBLReconFile; } 169 172 Void setBLsize( Int iWidth, Int iHeight ) { m_iBLSourceWidth = iWidth; m_iBLSourceHeight = iHeight; } 170 173 Int getBLWidth() { return m_iBLSourceWidth; } 171 174 Int getBLHeight() { return m_iBLSourceHeight; } 172 175 #endif 176 #endif 177 #if AVC_SYNTAX || SYNTAX_OUTPUT 178 Void setBLSyntaxFile( fstream* pFile ) { m_pBLSyntaxFile = pFile; } 179 fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; } 173 180 #endif 174 181 #if REF_IDX_FRAMEWORK -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r28 r55 337 337 pcSlice->setNalUnitType(getNalUnitType(uiPOCCurr)); 338 338 #if REF_IDX_FRAMEWORK 339 if (m_layerId > 0 && (uiPOCCurr % m_pcCfg->getIntraPeriod() == 0)) 339 if( m_layerId > 0 && (uiPOCCurr % m_pcCfg->getIntraPeriod() == 0) ) 340 { 340 341 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA); 342 } 341 343 if( m_layerId > 0 && !m_pcEncTop->getElRapSliceTypeB() ) 342 344 { 343 345 if( (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA) && 344 346 (pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && 345 pcSlice->getSliceType() == B_SLICE ) 347 pcSlice->getSliceType() == B_SLICE ) 348 { 346 349 pcSlice->setSliceType(P_SLICE); 350 } 347 351 } 348 352 #endif … … 466 470 467 471 #if REF_IDX_FRAMEWORK 468 if (pcSlice->getSliceType() == B_SLICE) 472 if( pcSlice->getSliceType() == B_SLICE ) 473 { 469 474 pcSlice->setColFromL0Flag(1-uiColDir); 475 } 470 476 #endif 471 477 … … 774 780 { 775 781 pcPic->getPicYuvOrg()->copyToPic( pcPic->getPicYuvRec() ); 782 #if AVC_SYNTAX 783 pcPic->readBLSyntax( m_ppcTEncTop[0]->getBLSyntaxFile(), SYNTAX_BYTES ); 784 #endif 776 785 return; 777 786 } -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r33 r55 1057 1057 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 1058 1058 //===== get prediction signal ===== 1059 #if INTRA_BL 1059 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED 1060 1060 if(pcCU->isIntraBL ( uiAbsPartIdx ) ) 1061 1061 { … … 1259 1259 1260 1260 //===== get prediction signal ===== 1261 #if INTRA_BL 1261 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED 1262 1262 if(pcCU->isIntraBL ( uiAbsPartIdx ) ) 1263 1263 { -
trunk/source/Lib/TLibEncoder/TEncTop.h
r28 r55 77 77 static Int m_iSPSIdCnt; ///< next Id number for SPS 78 78 static Int m_iPPSIdCnt; ///< next Id number for PPS 79 #if AVC_SYNTAX 80 fstream* m_pBLSyntaxFile; 81 #endif 79 82 #endif 80 83 … … 223 226 224 227 Void encodePrep( bool bEos, TComPicYuv* pcPicYuvOrg ); 228 #if AVC_SYNTAX 229 Void setBLSyntaxFile( fstream* pFile ) { m_pBLSyntaxFile = pFile; } 230 fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; } 231 #endif 225 232 #else 226 233 Void encode( bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut,
Note: See TracChangeset for help on using the changeset viewer.