Changeset 820 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon


Ignore:
Timestamp:
7 Jul 2014, 11:08:41 (11 years ago)
Author:
seregin
Message:

remove macros SYNTAX_BYTES, SYNTAX_OUTPUT, and AVC_SYNTAX

Location:
branches/SHM-dev/source/Lib/TLibCommon
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.h

    r713 r820  
    155155  Void compress(Char* pePredMode, Int scale);
    156156
    157 #if AVC_SYNTAX
    158   Void           setMv    (TComMv cMv,  Int iIdx )         { m_pcMv    [iIdx] = cMv; }
    159   Void           setRefIdx(Int iRefIdx, Int iIdx   )       { m_piRefIdx[iIdx] =  iRefIdx; }
    160 #endif
    161 
    162157#if REF_IDX_MFM
    163158  Void setMvField( TComMvField const& mvField, Int iIdx )
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp

    r815 r820  
    334334#endif
    335335
    336 #if AVC_SYNTAX
    337 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       // RefIdxL0
    376       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       // RefIdxL1
    382       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 L0
    388       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 L1
    397       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 information
    406       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 #endif
    414 
    415 #if SYNTAX_OUTPUT
    416 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       // RefIdx
    454       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 L0
    464       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 L1
    475       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 #endif
    488 
    489336#if MFM_ENCCONSTRAINT
    490337Bool TComPic::checkSameRefInfo()
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.h

    r815 r820  
    4545#include "TComBitStream.h"
    4646#include "SEI.h"
    47 #if AVC_BASE || SYNTAX_OUTPUT
     47#if AVC_BASE
    4848#include <fstream>
    4949#endif
     
    213213#endif
    214214  Void  copyUpsampledPictureYuv(TComPicYuv*   pcPicYuvIn, TComPicYuv*   pcPicYuvOut);
    215 #if AVC_SYNTAX
    216   Void readBLSyntax( fstream* filestream, UInt numBytes );
    217 #endif
    218 #endif
    219 #if SYNTAX_OUTPUT
    220   Void wrireBLSyntax( fstream* filestream, UInt numBytes );
    221215#endif
    222216
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.h

    r595 r820  
    161161  UInt        getMaxCUHeight()          { return m_uiMaxCUHeight;               }
    162162#endif
    163 #if AVC_SYNTAX
    164   UInt        getMaxCUWidth()           { return m_uiMaxCUWidth;                }
    165   UInt        getMaxCUHeight()          { return m_uiMaxCUHeight;               }
    166   UInt        getMaxDepth()             { return m_uhTotalDepth;               }
    167 #endif
    168163#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
    169164  Void         setTileSetIdxMap( Int i, Int tileSetIdx, UChar setType, Bool skipFlag )
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r815 r820  
    38543854
    38553855#if SVC_EXTENSION
    3856 #if AVC_SYNTAX
    3857 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 file
    3860   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   else
    3866   {
    3867     setSliceType( pcSlice->getSliceType() );
    3868   }
    3869 
    3870   if( this->isIntra() )
    3871   {
    3872     return;
    3873   }
    3874 
    3875   //initialize reference POC of BL
    3876   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 #endif
    3899 
    39003856Bool TComSlice::setBaseColPic(  TComList<TComPic*>& rcListPic, UInt refLayerIdc )
    39013857
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r819 r820  
    24072407  TComPicYuv* getFullPelBaseRec   (UInt refLayerIdc)               { return  m_pcFullPelBaseRec[refLayerIdc];  }
    24082408
    2409 #if AVC_SYNTAX
    2410   Void      initBaseLayerRPL( TComSlice *pcSlice );
    2411 #endif
    2412 
    24132409  Void      setRefPicListModificationSvc();
    24142410  Int       getNumILRRefIdx     ( )                     { return  m_pcVPS->getNumDirectRefLayers( m_layerId ); }
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r818 r820  
    4141#define SVC_EXTENSION                    1
    4242
    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)]
    4443#if SVC_EXTENSION
    4544#define MAX_LAYERS                       8      ///< max number of layers the codec is supposed to handle
     
    152151
    153152#define AVC_BASE                         1      ///< YUV BL reading for AVC base SVC
    154 #if AVC_BASE
    155 #define AVC_SYNTAX                       0      ///< Syntax reading for AVC base
    156 #endif
    157153
    158154#define REF_IDX_MFM                      1      ///< JCTVC-L0336: motion vector mapping of inter-layer reference picture
     
    262258
    263259
    264 #else
    265 #define SYNTAX_OUTPUT                    0
    266260#endif // SVC_EXTENSION
    267261
Note: See TracChangeset for help on using the changeset viewer.