Changeset 820 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon
- Timestamp:
- 7 Jul 2014, 11:08:41 (11 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibCommon
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.h
r713 r820 155 155 Void compress(Char* pePredMode, Int scale); 156 156 157 #if AVC_SYNTAX158 Void setMv (TComMv cMv, Int iIdx ) { m_pcMv [iIdx] = cMv; }159 Void setRefIdx(Int iRefIdx, Int iIdx ) { m_piRefIdx[iIdx] = iRefIdx; }160 #endif161 162 157 #if REF_IDX_MFM 163 158 Void setMvField( TComMvField const& mvField, Int iIdx ) -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp
r815 r820 334 334 #endif 335 335 336 #if AVC_SYNTAX337 Void TComPic::readBLSyntax( fstream* filestream, UInt numBytes )338 {339 if( !filestream->good() )340 {341 return;342 }343 344 UInt width = this->getPicYuvRec()->getWidth();345 UInt height = this->getPicYuvRec()->getHeight();346 347 UInt64 poc = (UInt64)this->getPOC();348 UInt partWidth = width / 4;349 UInt partHeight = height / 4;350 351 UInt numPartInWidth = this->getNumPartInWidth();352 UInt numPartInHeight = this->getNumPartInHeight();353 UInt numPartLCUInWidth = this->getFrameWidthInCU();354 355 UInt64 uiPos = (UInt64)poc * width * height * numBytes / 16;356 357 filestream->seekg( uiPos, ios_base::beg );358 359 for( Int i = 0; i < partHeight; i++ )360 {361 for( Int j = 0; j < partWidth; j++ )362 {363 UInt x = ( j / numPartInWidth );364 UInt y = ( i / numPartInHeight );365 366 UInt addrLCU = y * numPartLCUInWidth + x;367 UInt partAddr = ( i - y * numPartInHeight ) * numPartInWidth + ( j - x * numPartInWidth );368 partAddr = g_auiRasterToZscan[partAddr];369 370 TComDataCU* pcCU = this->getCU( addrLCU );371 372 TComMv mv;373 Short temp;374 375 // RefIdxL0376 Char refIdxL0 = -1;377 filestream->read( &refIdxL0, 1 );378 assert( refIdxL0 >= -1 );379 pcCU->getCUMvField( REF_PIC_LIST_0 )->setRefIdx( (Int)refIdxL0, partAddr );380 381 // RefIdxL1382 Char refIdxL1 = -1;383 filestream->read( &refIdxL1, 1 );384 assert( refIdxL1 >= -1 );385 pcCU->getCUMvField( REF_PIC_LIST_1 )->setRefIdx( (Int)refIdxL1, partAddr );386 387 // MV L0388 temp = 0;389 filestream->read( reinterpret_cast<char*>(&temp), 2 );390 mv.setHor( (Short)temp );391 temp = 0;392 filestream->read( reinterpret_cast<char*>(&temp), 2 );393 mv.setVer( (Short)temp );394 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMv( mv, partAddr );395 396 // MV L1397 temp = 0;398 filestream->read( reinterpret_cast<char*>(&temp), 2 );399 mv.setHor( (Short)temp );400 temp = 0;401 filestream->read( reinterpret_cast<char*>(&temp), 2 );402 mv.setVer( (Short)temp );403 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMv( mv, partAddr );404 405 // set dependent information406 pcCU->setPredictionMode( partAddr, ( refIdxL0 == NOT_VALID && refIdxL1 == NOT_VALID ) ? MODE_INTRA : MODE_INTER );407 UInt interDir = ( refIdxL0 != NOT_VALID ) + ( refIdxL1 != NOT_VALID && this->getSlice(0)->isInterB() ) * 2;408 assert( interDir <= 3 );409 pcCU->setInterDir( partAddr, interDir );410 }411 }412 }413 #endif414 415 #if SYNTAX_OUTPUT416 Void TComPic::wrireBLSyntax( fstream* filestream, UInt numBytes )417 {418 if( !filestream->good() )419 {420 return;421 }422 423 UInt width = this->getPicYuvRec()->getWidth();424 UInt height = this->getPicYuvRec()->getHeight();425 426 UInt64 poc = (UInt64)this->getPOC();427 UInt partWidth = width / 4;428 UInt partHeight = height / 4;429 430 UInt numPartInWidth = this->getNumPartInWidth();431 UInt numPartInHeight = this->getNumPartInHeight();432 UInt numPartLCUInWidth = this->getFrameWidthInCU();433 434 filestream->seekg( poc * width * height * numBytes / 16 );435 436 for( Int i = 0; i < partHeight; i++ )437 {438 for( Int j = 0; j < partWidth; j++ )439 {440 UInt x = ( j / numPartInWidth );441 UInt y = ( i / numPartInHeight );442 443 UInt addrLCU = y * numPartLCUInWidth + x;444 UInt partAddr = ( i - y * numPartInHeight ) * numPartInWidth + ( j - x * numPartInWidth );445 partAddr = g_auiRasterToZscan[partAddr];446 447 TComDataCU* pcCU = this->getCU( addrLCU );448 449 TComMv mv;450 Short temp;451 Char refIdxL0 = NOT_VALID, refIdxL1 = NOT_VALID;452 453 // RefIdx454 if( !pcCU->isIntra( partAddr ) )455 {456 refIdxL0 = (Char)pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( partAddr );457 refIdxL1 = (Char)pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( partAddr );458 }459 assert( refIdxL0 >= - 1 && refIdxL1 >= - 1 );460 filestream->put( refIdxL0 );461 filestream->put( refIdxL1 );462 463 // MV L0464 mv.setZero();465 if( refIdxL0 >= 0 )466 {467 mv = pcCU->getCUMvField( REF_PIC_LIST_0 )->getMv( partAddr );468 }469 temp = (Short)mv.getHor();470 filestream->write( reinterpret_cast<char*>(&temp), 2 );471 temp = (Short)mv.getVer();472 filestream->write( reinterpret_cast<char*>(&temp), 2 );473 474 // MV L1475 mv.setZero();476 if( refIdxL1 >= 0 )477 {478 mv = pcCU->getCUMvField( REF_PIC_LIST_1 )->getMv( partAddr );479 }480 temp = (Short)mv.getHor();481 filestream->write( reinterpret_cast<char*>(&temp), 2 );482 temp = (Short)mv.getVer();483 filestream->write( reinterpret_cast<char*>(&temp), 2 );484 }485 }486 }487 #endif488 489 336 #if MFM_ENCCONSTRAINT 490 337 Bool TComPic::checkSameRefInfo() -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.h
r815 r820 45 45 #include "TComBitStream.h" 46 46 #include "SEI.h" 47 #if AVC_BASE || SYNTAX_OUTPUT47 #if AVC_BASE 48 48 #include <fstream> 49 49 #endif … … 213 213 #endif 214 214 Void copyUpsampledPictureYuv(TComPicYuv* pcPicYuvIn, TComPicYuv* pcPicYuvOut); 215 #if AVC_SYNTAX216 Void readBLSyntax( fstream* filestream, UInt numBytes );217 #endif218 #endif219 #if SYNTAX_OUTPUT220 Void wrireBLSyntax( fstream* filestream, UInt numBytes );221 215 #endif 222 216 -
branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.h
r595 r820 161 161 UInt getMaxCUHeight() { return m_uiMaxCUHeight; } 162 162 #endif 163 #if AVC_SYNTAX164 UInt getMaxCUWidth() { return m_uiMaxCUWidth; }165 UInt getMaxCUHeight() { return m_uiMaxCUHeight; }166 UInt getMaxDepth() { return m_uhTotalDepth; }167 #endif168 163 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 169 164 Void setTileSetIdxMap( Int i, Int tileSetIdx, UChar setType, Bool skipFlag ) -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r815 r820 3854 3854 3855 3855 #if SVC_EXTENSION 3856 #if AVC_SYNTAX3857 Void TComSlice::initBaseLayerRPL( TComSlice *pcSlice )3858 {3859 // Assumed that RPL of the base layer is same to the EL, otherwise this information should be also dumped and read from the metadata file3860 setPOC( pcSlice->getPOC() );3861 if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA )3862 {3863 setSliceType( I_SLICE );3864 }3865 else3866 {3867 setSliceType( pcSlice->getSliceType() );3868 }3869 3870 if( this->isIntra() )3871 {3872 return;3873 }3874 3875 //initialize reference POC of BL3876 for( Int iRefPicList = 0; iRefPicList < 2; iRefPicList++ )3877 {3878 RefPicList eRefPicList = RefPicList( iRefPicList );3879 3880 assert( pcSlice->getNumRefIdx( eRefPicList) >= 0 );3881 setNumRefIdx( eRefPicList, pcSlice->getNumRefIdx( eRefPicList ) - 1 );3882 assert( getNumRefIdx( eRefPicList) <= MAX_NUM_REF);3883 3884 for(Int refIdx = 0; refIdx < getNumRefIdx( eRefPicList ); refIdx++)3885 {3886 setRefPOC( pcSlice->getRefPic( eRefPicList, refIdx )->getPOC(), eRefPicList, refIdx );3887 setRefPic( pcSlice->getRefPic( eRefPicList, refIdx ), eRefPicList, refIdx );3888 /*3889 // should be set if the base layer has its own instance of the reference picture lists, currently EL RPL is reused.3890 getRefPic( eRefPicList, refIdx )->setLayerId( 0 );3891 getRefPic( eRefPicList, refIdx )->setIsLongTerm( pcSlice->getRefPic( eRefPicList, refIdx )->getIsLongTerm() );3892 */3893 3894 }3895 }3896 return;3897 }3898 #endif3899 3900 3856 Bool TComSlice::setBaseColPic( TComList<TComPic*>& rcListPic, UInt refLayerIdc ) 3901 3857 { -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r819 r820 2407 2407 TComPicYuv* getFullPelBaseRec (UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } 2408 2408 2409 #if AVC_SYNTAX2410 Void initBaseLayerRPL( TComSlice *pcSlice );2411 #endif2412 2413 2409 Void setRefPicListModificationSvc(); 2414 2410 Int getNumILRRefIdx ( ) { return m_pcVPS->getNumDirectRefLayers( m_layerId ); } -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r818 r820 41 41 #define SVC_EXTENSION 1 42 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 43 #if SVC_EXTENSION 45 44 #define MAX_LAYERS 8 ///< max number of layers the codec is supposed to handle … … 152 151 153 152 #define AVC_BASE 1 ///< YUV BL reading for AVC base SVC 154 #if AVC_BASE155 #define AVC_SYNTAX 0 ///< Syntax reading for AVC base156 #endif157 153 158 154 #define REF_IDX_MFM 1 ///< JCTVC-L0336: motion vector mapping of inter-layer reference picture … … 262 258 263 259 264 #else265 #define SYNTAX_OUTPUT 0266 260 #endif // SVC_EXTENSION 267 261
Note: See TracChangeset for help on using the changeset viewer.