Changeset 38 in SHVCSoftware
- Timestamp:
- 20 Feb 2013, 21:24:20 (12 years ago)
- Location:
- branches/SHM-1.1-dev/source
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-1.1-dev/source/App/TAppDecoder/TAppDecCfg.cpp
r2 r38 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 -
branches/SHM-1.1-dev/source/App/TAppDecoder/TAppDecCfg.h
r2 r38 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 -
branches/SHM-1.1-dev/source/App/TAppDecoder/TAppDecTop.cpp
r6 r38 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 ); -
branches/SHM-1.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r21 r38 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 ); -
branches/SHM-1.1-dev/source/App/TAppEncoder/TAppEncCfg.h
r2 r38 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 -
branches/SHM-1.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r2 r38 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 ); -
branches/SHM-1.1-dev/source/App/TAppEncoder/TAppEncTop.cpp
r33 r38 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(); -
branches/SHM-1.1-dev/source/Lib/TLibCommon/CommonDef.h
r14 r38 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 // ==================================================================================================================== -
branches/SHM-1.1-dev/source/Lib/TLibCommon/TComDataCU.cpp
r33 r38 383 383 m_layerId = pcPic->getLayerId(); 384 384 #endif 385 386 385 for(int i=0; i<pcPic->getNumPartInCU(); i++) 387 386 { -
branches/SHM-1.1-dev/source/Lib/TLibCommon/TComMotionInfo.h
r28 r38 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 { -
branches/SHM-1.1-dev/source/Lib/TLibCommon/TComPic.cpp
r33 r38 669 669 #endif 670 670 671 #if AVC_SYNTAX 672 Void TComPic::readBLSyntax( fstream* filestream, UInt numBytes ) 673 { 674 if( !filestream->good() ) 675 { 676 return; 677 } 678 679 UInt uiWidth = this->getPicYuvRec()->getWidth() - this->getPicYuvRec()->getPicCropLeftOffset() - this->getPicYuvRec()->getPicCropRightOffset(); 680 UInt uiHeight = this->getPicYuvRec()->getHeight() - this->getPicYuvRec()->getPicCropTopOffset() - this->getPicYuvRec()->getPicCropBottomOffset(); 681 UInt64 uiPOC = (UInt64)this->getPOC(); 682 UInt uiPartWidth = uiWidth / 4; 683 UInt uiPartHeight = uiHeight / 4; 684 685 UInt uiNumPartInWidth = this->getNumPartInWidth(); 686 UInt uiNumPartInHeight = this->getNumPartInHeight(); 687 UInt uiNumPartLCUInWidth = this->getFrameWidthInCU(); 688 689 UInt64 uiPos = (UInt64)uiPOC * uiWidth * uiHeight * numBytes / 16; 690 691 filestream->seekg( uiPos, ios_base::beg ); 692 693 for( Int i = 0; i < this->getNumCUsInFrame(); i++ ) 694 { 695 TComDataCU* pcCU = this->getCU( i ); 696 pcCU->initCU( this, i ); 697 } 698 699 for( Int i = 0; i < uiPartHeight; i++ ) 700 { 701 for( Int j = 0; j < uiPartWidth; j++ ) 702 { 703 UInt uiX = ( j / uiNumPartInWidth ); 704 UInt uiY = ( i / uiNumPartInHeight ); 705 706 UInt uiLCUAddr = uiY * uiNumPartLCUInWidth + uiX; 707 UInt uiPartAddr = ( i - uiY * uiNumPartInHeight ) * uiNumPartInWidth + ( j - uiX * uiNumPartInWidth ); 708 uiPartAddr = g_auiRasterToZscan[uiPartAddr]; 709 710 TComDataCU* pcCU = this->getCU( uiLCUAddr ); 711 712 TComMv mv; 713 Short temp; 714 715 // RefIdxL0 716 Char refIdxL0 = -1; 717 filestream->read( &refIdxL0, 1 ); 718 assert( refIdxL0 >= -1 ); 719 pcCU->getCUMvField( REF_PIC_LIST_0 )->setRefIdx( (Int)refIdxL0, uiPartAddr ); 720 721 // RefIdxL1 722 Char refIdxL1 = -1; 723 filestream->read( &refIdxL1, 1 ); 724 assert( refIdxL1 >= -1 ); 725 pcCU->getCUMvField( REF_PIC_LIST_1 )->setRefIdx( (Int)refIdxL1, uiPartAddr ); 726 727 // MV L0 728 temp = 0; 729 filestream->read( reinterpret_cast<char*>(&temp), 2 ); 730 mv.setHor( (Short)temp ); 731 temp = 0; 732 filestream->read( reinterpret_cast<char*>(&temp), 2 ); 733 mv.setVer( (Short)temp ); 734 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMv( mv, uiPartAddr ); 735 736 // MV L1 737 temp = 0; 738 filestream->read( reinterpret_cast<char*>(&temp), 2 ); 739 mv.setHor( (Short)temp ); 740 temp = 0; 741 filestream->read( reinterpret_cast<char*>(&temp), 2 ); 742 mv.setVer( (Short)temp ); 743 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMv( mv, uiPartAddr ); 744 745 // set dependent information 746 pcCU->setPredictionMode( uiPartAddr, ( refIdxL0 == NOT_VALID && refIdxL1 == NOT_VALID ) ? MODE_INTRA : MODE_INTER ); 747 UInt uiInterDir = ( refIdxL0 != NOT_VALID ) + ( refIdxL1 != NOT_VALID && pcCU->getSlice()->isInterB() ) * 2; 748 assert( uiInterDir >= 0 && uiInterDir <= 3 ); 749 pcCU->setInterDir( uiPartAddr, uiInterDir ); 750 } 751 } 752 } 753 #endif 754 755 #if SYNTAX_OUTPUT 756 Void TComPic::wrireBLSyntax( fstream* filestream, UInt numBytes ) 757 { 758 if( !filestream->good() ) 759 { 760 return; 761 } 762 763 UInt uiWidth = this->getPicYuvRec()->getWidth() - getSlice(0)->getSPS()->getPicCropLeftOffset() - getSlice(0)->getSPS()->getPicCropRightOffset(); 764 UInt uiHeight = this->getPicYuvRec()->getHeight() - getSlice(0)->getSPS()->getPicCropTopOffset() - getSlice(0)->getSPS()->getPicCropBottomOffset(); 765 UInt64 uiPOC = (UInt64)this->getPOC(); 766 UInt uiPartWidth = uiWidth / 4; 767 UInt uiPartHeight = uiHeight / 4; 768 769 UInt uiNumPartInWidth = this->getNumPartInWidth(); 770 UInt uiNumPartInHeight = this->getNumPartInHeight(); 771 UInt uiNumPartLCUInWidth = this->getFrameWidthInCU(); 772 773 filestream->seekg( uiPOC * uiWidth * uiHeight * numBytes / 16 ); 774 775 for( Int i = 0; i < uiPartHeight; i++ ) 776 { 777 for( Int j = 0; j < uiPartWidth; j++ ) 778 { 779 UInt uiX = ( j / uiNumPartInWidth ); 780 UInt uiY = ( i / uiNumPartInHeight ); 781 782 UInt uiLCUAddr = uiY * uiNumPartLCUInWidth + uiX; 783 UInt uiPartAddr = ( i - uiY * uiNumPartInHeight ) * uiNumPartInWidth + ( j - uiX * uiNumPartInWidth ); 784 uiPartAddr = g_auiRasterToZscan[uiPartAddr]; 785 786 TComDataCU* pcCU = this->getCU( uiLCUAddr ); 787 788 TComMv mv; 789 Short temp; 790 Char refIdxL0 = NOT_VALID, refIdxL1 = NOT_VALID; 791 792 // RefIdx 793 if( !pcCU->isIntra( uiPartAddr ) ) 794 { 795 refIdxL0 = (Char)pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ); 796 refIdxL1 = (Char)pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ); 797 } 798 assert( refIdxL0 >= - 1 && refIdxL1 >= - 1 ); 799 filestream->put( refIdxL0 ); 800 filestream->put( refIdxL1 ); 801 802 // MV L0 803 mv.setZero(); 804 if( refIdxL0 >= 0 ) 805 { 806 mv = pcCU->getCUMvField( REF_PIC_LIST_0 )->getMv( uiPartAddr ); 807 } 808 temp = (Short)mv.getHor(); 809 filestream->write( reinterpret_cast<char*>(&temp), 2 ); 810 temp = (Short)mv.getVer(); 811 filestream->write( reinterpret_cast<char*>(&temp), 2 ); 812 813 // MV L1 814 mv.setZero(); 815 if( refIdxL1 >= 0 ) 816 { 817 mv = pcCU->getCUMvField( REF_PIC_LIST_1 )->getMv( uiPartAddr ); 818 } 819 temp = (Short)mv.getHor(); 820 filestream->write( reinterpret_cast<char*>(&temp), 2 ); 821 temp = (Short)mv.getVer(); 822 filestream->write( reinterpret_cast<char*>(&temp), 2 ); 823 } 824 } 825 } 826 #endif 827 828 671 829 //! \} -
branches/SHM-1.1-dev/source/Lib/TLibCommon/TComPic.h
r28 r38 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 … … 209 213 Void copyUpsampledPictureYuv(TComPicYuv* pcPicYuvIn, TComPicYuv* pcPicYuvOut); 210 214 #endif 215 #if AVC_SYNTAX 216 Void readBLSyntax( fstream* filestream, UInt numBytes ); 217 #endif 218 #if SYNTAX_OUTPUT 219 Void wrireBLSyntax( fstream* filestream, UInt numBytes ); 220 #endif 221 211 222 };// END CLASS DEFINITION TComPic 212 223 … … 214 225 215 226 #endif // __TCOMPIC__ 227 -
branches/SHM-1.1-dev/source/Lib/TLibCommon/TComPicSym.h
r2 r38 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; } -
branches/SHM-1.1-dev/source/Lib/TLibCommon/TypeDef.h
r28 r38 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 AVC_BASE 1 ///< YUV BL reading for AVC base SVC 56 57 #define REF_IDX_FRAMEWORK 0 ///< inter-layer reference framework 58 59 #if AVC_BASE 60 #define AVC_SYNTAX 1 ///< Syntax reading for AVC base 61 #endif 57 62 58 63 #if REF_IDX_FRAMEWORK … … 60 65 #define REF_IDX_ME_ZEROMV 1 ///< L0051: use zero motion for inter-layer reference picture (without fractional ME) 61 66 #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. 67 #if !AVC_BASE || AVC_SYNTAX 62 68 #define REF_IDX_MFM 1 ///< L0336: motion vector mapping of inter-layer reference picture 69 #endif 63 70 #else 64 71 #define INTRA_BL 1 ///< inter-layer texture prediction … … 69 76 70 77 // Hooks 71 #if !AVC_BASE 78 #if !AVC_BASE || AVC_SYNTAX 72 79 #define SVC_MVP 1 ///< motion hook for merge mode as an example 80 #if !AVC_SYNTAX 73 81 #define SVC_BL_CAND_INTRA 0 ///< Intra Base Mode Prediction hook as an example 74 82 #endif … … 80 88 81 89 #endif 90 #endif 91 #else 92 #define SYNTAX_OUTPUT 1 82 93 #endif 83 94 -
branches/SHM-1.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
r30 r38 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 … … 559 566 { 560 567 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();568 fstream* pFile = m_ppcTDecTop[0]->getBLReconFile(); 569 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth() - pBLPic->getPicYuvRec()->getPicCropLeftOffset() - pBLPic->getPicYuvRec()->getPicCropRightOffset();; 570 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight() - pBLPic->getPicYuvRec()->getPicCropTopOffset() - pBLPic->getPicYuvRec()->getPicCropBottomOffset(); 564 571 565 if( pFile ) 566 { 567 fseek( pFile, m_apcSlicePilot->getPOC() * uiWidth * uiHeight * 3 / 2, SEEK_SET ); 572 if( pFile->good() ) 573 { 574 UInt64 uiPos = (UInt64) m_apcSlicePilot->getPOC() * uiWidth * uiHeight * 3 / 2; 575 576 pFile->seekg((UInt)uiPos, ios::beg ); 568 577 569 578 Pel* pPel = pBLPic->getPicYuvRec()->getLumaAddr(); … … 573 582 for( Int j = 0; j < uiWidth; j++ ) 574 583 { 575 pPel[j] = fgetc( pFile);584 pPel[j] = pFile->get(); 576 585 } 577 586 pPel += uiStride; … … 584 593 for( Int j = 0; j < uiWidth/2; j++ ) 585 594 { 586 pPel[j] = fgetc( pFile);595 pPel[j] = pFile->get(); 587 596 } 588 597 pPel += uiStride; … … 595 604 for( Int j = 0; j < uiWidth/2; j++ ) 596 605 { 597 pPel[j] = fgetc( pFile);606 pPel[j] = pFile->get(); 598 607 } 599 608 pPel += uiStride; 600 609 } 601 610 } 611 #if AVC_SYNTAX 612 if( m_apcSlicePilot->getPOC() == 0 ) 613 { 614 // initialize partition order. 615 UInt* piTmp = &g_auiZscanToRaster[0]; 616 initZscanToRaster( pBLPic->getPicSym()->getMaxDepth() + 1, 1, 0, piTmp ); 617 initRasterToZscan( pBLPic->getPicSym()->getMaxCUWidth(), pBLPic->getPicSym()->getMaxCUHeight(), pBLPic->getPicSym()->getMaxDepth() + 1 ); 618 } 619 pBLPic->getSlice( 0 )->setPOC( m_apcSlicePilot->getPOC() ); 620 pBLPic->getSlice( 0 )->setSliceType( m_apcSlicePilot->getSliceType() ); 621 pBLPic->readBLSyntax( m_ppcTDecTop[0]->getBLSyntaxFile(), SYNTAX_BYTES ); 622 #endif 602 623 } 603 624 #endif … … 979 1000 { 980 1001 #if SVC_UPSAMPLING 1002 #if AVC_SYNTAX 1003 TComSPS* sps = new TComSPS(); 1004 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, sps, true); 1005 #else 981 1006 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL, true); 1007 #endif 982 1008 #else 983 1009 pBLPic->create( m_ppcTDecTop[0]->getBLWidth(), m_ppcTDecTop[0]->getBLHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); -
branches/SHM-1.1-dev/source/Lib/TLibDecoder/TDecTop.h
r28 r38 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 -
branches/SHM-1.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r28 r38 774 774 { 775 775 pcPic->getPicYuvOrg()->copyToPic( pcPic->getPicYuvRec() ); 776 #if AVC_SYNTAX 777 pcPic->readBLSyntax( m_ppcTEncTop[0]->getBLSyntaxFile(), SYNTAX_BYTES ); 778 #endif 776 779 return; 777 780 } -
branches/SHM-1.1-dev/source/Lib/TLibEncoder/TEncTop.h
r28 r38 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.