Changeset 48 in 3DVCSoftware


Ignore:
Timestamp:
30 Mar 2012, 18:57:41 (12 years ago)
Author:
poznan-univ
Message:

some bug fix on high level syntax
fixed some compiler warning issues under windows and linux

Location:
branches/0.3-poznan-univ
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • branches/0.3-poznan-univ/build/linux/common/makefile.base

    r28 r48  
    4747# default cpp flags for all configurations
    4848#CPPFLAGS          = -Wall -fPIC $(DEFS) -I$(CURDIR)/$(INC_DIR) $(USER_INC_DIRS)
    49 CPPFLAGS          = -fPIC $(DEFS) -I$(CURDIR)/$(INC_DIR) $(USER_INC_DIRS) -Wall -Wshadow -Wno-sign-compare
     49CPPFLAGS          = -fPIC $(DEFS) -I$(CURDIR)/$(INC_DIR) $(USER_INC_DIRS) -Wall -Wshadow -Wno-sign-compare -Werror
    5050
    5151##########
  • branches/0.3-poznan-univ/source/App/TAppDecoder/TAppDecTop.cpp

    r41 r48  
    739739Void TAppDecTop::storeSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc, Bool bDepth)
    740740{
    741   Int  iLeftViewIdx  = -1;
    742   Int  iRightViewIdx = -1;
    743741  Int  iNearestViewIdx = -1;
    744742  Bool bRenderFromLeft;
     
    830828Void TAppDecTop::storeDepthSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc)
    831829{
    832   Int  iLeftViewIdx  = -1;
    833   Int  iRightViewIdx = -1;
    834830  Int  iNearestViewIdx = -1;
    835831  Bool bRenderFromLeft;
  • branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncCfg.cpp

    r41 r48  
    523523      size = m_iSourceWidth*m_iSourceHeight;
    524524      depth_buf = (unsigned char *)malloc(size);
    525       fread(depth_buf, 1, size, base_depth_file);
     525      size_t read = fread(depth_buf, 1, size, base_depth_file);
    526526      fclose(base_depth_file);
    527       memset(histogram, 0, sizeof(histogram));
    528       for (i=0; i<size;++i) histogram[depth_buf[i]]++;
    529       weighted_avg = 0;
    530       for (i=0; i<256; ++i) weighted_avg += i*histogram[i];
    531       weighted_avg /= size;
    532 
    533       if (weighted_avg<m_iNonlinearDepthThreshold)
     527      if(read)
    534528      {
    535         m_bUseNonlinearDepth = 0;
    536         printf ("\nWeighted average of depth histogram:%f < %d, turning NonlinearDepthRepresentation OFF\n", weighted_avg, m_iNonlinearDepthThreshold);
     529        memset(histogram, 0, sizeof(histogram));
     530        for (i=0; i<size;++i) histogram[depth_buf[i]]++;
     531        weighted_avg = 0;
     532        for (i=0; i<256; ++i) weighted_avg += i*histogram[i];
     533        weighted_avg /= size;
     534
     535        if (weighted_avg<m_iNonlinearDepthThreshold)
     536        {
     537          m_bUseNonlinearDepth = 0;
     538          printf ("\nWeighted average of depth histogram:%f < %d, turning NonlinearDepthRepresentation OFF\n", weighted_avg, m_iNonlinearDepthThreshold);
     539        }
    537540      }
    538541    }
     
    542545  if(m_bUseNonlinearDepth)
    543546  {
     547     if((Int)m_aiNonlinearDepthModel.size()== 0)
     548     {
     549       m_aiNonlinearDepthModel.push_back(10);
     550       m_aiNonlinearDepthModel.push_back(19);
     551       m_aiNonlinearDepthModel.push_back(24);
     552       m_aiNonlinearDepthModel.push_back(27);
     553       m_aiNonlinearDepthModel.push_back(26);
     554       m_aiNonlinearDepthModel.push_back(22);
     555       m_aiNonlinearDepthModel.push_back(13);
     556     }
     557    //10,19,24,27,26,22,13
    544558    m_cNonlinearDepthModel.m_iNum = (Int)m_aiNonlinearDepthModel.size();
     559   
    545560    m_cNonlinearDepthModel.m_aiPoints[0]=0;
     561
    546562    for (int i=0; i<m_cNonlinearDepthModel.m_iNum; ++i)
    547563      m_cNonlinearDepthModel.m_aiPoints[i+1] = m_aiNonlinearDepthModel[i];
  • branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncTop.cpp

    r41 r48  
    150150#endif
    151151
     152#if BITSTREAM_EXTRACTION
     153    m_acTEncTopList[iViewIdx]->setLayerId                      ( ( (UInt)iViewIdx ) << 1 );
     154#endif
    152155    m_acTEncTopList[iViewIdx]->setViewId                       ( (UInt)iViewIdx );
    153156    m_acTEncTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
     
    359362#endif
    360363
     364#if BITSTREAM_EXTRACTION
     365      m_acTEncDepthTopList[iViewIdx]->setLayerId                      ( ( ( (UInt)iViewIdx ) << 1 ) + 1 );
     366#endif
    361367      m_acTEncDepthTopList[iViewIdx]->setViewId                       ( (UInt)iViewIdx );
    362368      m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx                 ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] );
    363369      m_acTEncDepthTopList[iViewIdx]->setIsDepth                      ( true );
     370#if FLEX_CODING_ORDER
     371      m_acTEncDepthTopList[iViewIdx]->setCamParPrecision              ( m_cCameraData.getCamParsCodedPrecision  () );
     372      m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader          ( m_cCameraData.getVaryingCameraParameters() );
     373      m_acTEncDepthTopList[iViewIdx]->setCodedScale                   ( m_cCameraData.getCodedScale             () );
     374      m_acTEncDepthTopList[iViewIdx]->setCodedOffset                  ( m_cCameraData.getCodedOffset            () );
     375#else
    364376      m_acTEncDepthTopList[iViewIdx]->setCamParPrecision              ( 0 );
    365377      m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader          ( false );
    366378      m_acTEncDepthTopList[iViewIdx]->setCodedScale                   ( 0 );
    367379      m_acTEncDepthTopList[iViewIdx]->setCodedOffset                  ( 0 );
     380#endif
    368381#if DEPTH_MAP_GENERATION
    369382      m_acTEncDepthTopList[iViewIdx]->setPredDepthMapGeneration       ( 0 );
     
    794807          iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
    795808          bThisViewContinueReadingPics = bContinueReadingPics[iViewIdx];
     809#if POZNAN_SYNTH
     810          if( m_uiUseCUSkip )
     811          {
     812            xStoreSynthPicsInBuffer(iViewIdx,false);
     813          }
     814#endif
    796815#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
    797816          // If no depth picture reconstruction for current view and current POC is available sythesize one
    798           Int   iCurrPoc         = m_acTEncTopList[ 0 ]->getNextFrameId();
     817          //Int   iCurrPoc2         = m_acTEncTopList[ 0 ]->getNextFrameId();
    799818          Bool  bCurrPicDepthRec = getPicFromView( iViewIdx, iCurrPoc, true ) != NULL && getPicFromView( iViewIdx, iCurrPoc, true )->getReconMark();
    800819          if(m_bUseTexDqpAccordingToDepth && !bCurrPicDepthRec)
     
    825844            iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0');
    826845            bThisViewContinueReadingDepthPics = bContinueReadingDepthPics[iViewIdx];
     846#if POZNAN_SYNTH
     847            if( m_uiUseCUSkip )
     848            {
     849              xStoreSynthPicsInBuffer(iViewIdx,true);
     850            }
     851#endif
    827852            m_acTEncDepthTopList[iViewIdx]->encode( bDepthEos[iViewIdx], m_cListPicYuvDepthRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingDepthPics );
    828853            bContinueReadingDepthPics[iViewIdx]=bThisViewContinueReadingDepthPics;
     
    858883#if FLEX_CODING_ORDER
    859884      // If no depth picture reconstruction for current view and current POC is available sythesize one
    860       Int   iCurrPoc         = m_acTEncTopList[ 0 ]->getNextFrameId();
     885      //Int   iCurrPoc         = m_acTEncTopList[ 0 ]->getNextFrameId();
    861886      Bool  bCurrPicDepthRec = getPicFromView( iViewIdx, iCurrPoc, true ) != NULL && getPicFromView( iViewIdx, iCurrPoc, true )->getReconMark();
    862887      if(m_bUseTexDqpAccordingToDepth && !bCurrPicDepthRec)
     
    13901415  }
    13911416 
    1392   Int iNumberOfReferenceViews = 0;
    13931417  Int  iNearestViewIdx = -1;
    13941418  Bool bRenderFromLeft;
     
    14771501Void TAppEncTop::xStoreDepthSynthPicsInBuffer(Int iCoddedViewIdx)
    14781502{
    1479   Int  iLeftViewIdx  = -1;
    1480   Int  iRightViewIdx = -1;
    14811503  Int  iNearestViewIdx = -1;
    14821504  Bool bRenderFromLeft;
  • branches/0.3-poznan-univ/source/App/TAppRenderer/TAppRendererTop.cpp

    r45 r48  
    308308            else
    309309            {
    310               Int iDistLeft  = abs( m_cCameraData.getBaseId2SortedId()[0] - m_cCameraData.getBaseId2SortedId() [iLeftBaseViewIdx ]  );
    311               Int iDistRight = abs( m_cCameraData.getBaseId2SortedId()[0] - m_cCameraData.getBaseId2SortedId() [iRightBaseViewIdx]  );
     310              //Int iDistLeft  = abs( m_cCameraData.getBaseId2SortedId()[0] - m_cCameraData.getBaseId2SortedId() [iLeftBaseViewIdx ]  );
     311              //Int iDistRight = abs( m_cCameraData.getBaseId2SortedId()[0] - m_cCameraData.getBaseId2SortedId() [iRightBaseViewIdx]  );
    312312
    313313              Int iFillViewIdx = (0!=iLeftBaseViewIdx)? iLeftBaseViewIdx: iRightBaseViewIdx;
  • branches/0.3-poznan-univ/source/Lib/TLibCommon/SEI.h

    r5 r48  
    4141class SEI
    4242{
     43#if BITSTREAM_EXTRACTION
     44protected:
     45  UInt m_uiLayerId;
     46#endif
     47
    4348public:
    4449  enum PayloadType {
     
    5156 
    5257  virtual PayloadType payloadType() const = 0;
     58
     59#if BITSTREAM_EXTRACTION
     60  Void      setLayerId              ( UInt u )       { m_uiLayerId = u; }
     61  UInt      getLayerId              ()         const { return m_uiLayerId; }
     62#endif
    5363};
    5464
  • branches/0.3-poznan-univ/source/Lib/TLibCommon/TComLoopFilter.cpp

    r28 r48  
    419419  UInt uiPartP;
    420420  TComDataCU* pcCUP;
    421   UInt uiBs;
     421  UInt uiBs = 0;
    422422 
    423423#if MTK_NONCROSS_INLOOP_FILTER
  • branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPic.cpp

    r28 r48  
    490490 
    491491  Int x, y;
    492   Bool bAvailable = true;
    493492  Pel* pAvail  = getPicYuvAvail()->getLumaAddr ( iCuAddr, uiAbsZorderIdx );
    494493  Int CUHeight = g_uiMaxCUHeight >> uiPartDepth; //rpcCU->getHeight(uiAbsZorderIdx);
  • branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPrediction.cpp

    r41 r48  
    16401640
    16411641#if DEPTH_MAP_GENERATION
    1642   Int             ref_frame0_idx_1st, ref_frame1_idx_1st;
     1642  Int             ref_frame0_idx_1st = 0, ref_frame1_idx_1st = 0;
    16431643  TComMv          mv0_1st,mv1_1st;
    16441644#endif
     
    16481648  Pel aiUTab[MAX_CU_SIZE];
    16491649  Pel aiVTab[MAX_CU_SIZE];
    1650   Pel iULast;
    1651   Pel iVLast;
     1650  Pel iULast = 0;
     1651  Pel iVLast = 0;
    16521652  Pel iTemp;
    16531653
  • branches/0.3-poznan-univ/source/Lib/TLibCommon/TComSlice.cpp

    r46 r48  
    737737}
    738738
     739#if FLEXCO_CAMPARAM_IN_DEPTH
     740Void
     741TComSPS::initMultiviewSPS( UInt uiViewId, Int iViewOrderIdx, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset , Bool bDepth)
     742#else
    739743Void
    740744TComSPS::initMultiviewSPS( UInt uiViewId, Int iViewOrderIdx, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset )
     745#endif
    741746{
    742747  AOT( uiViewId == 0 && iViewOrderIdx != 0 );
     
    746751  m_uiViewId              = uiViewId;
    747752  m_iViewOrderIdx         = iViewOrderIdx;
     753#if FLEXCO_CAMPARAM_IN_DEPTH
     754  m_bDepth                = bDepth;
     755#else
    748756  m_bDepth                = false;
     757#endif
    749758  m_uiCamParPrecision     = ( m_uiViewId ? uiCamParPrecision : 0 );
    750759  m_bCamParInSliceHeader  = ( m_uiViewId ? bCamParSlice  : false );
  • branches/0.3-poznan-univ/source/Lib/TLibCommon/TComSlice.h

    r46 r48  
    221221  Int* getPad         ( )        { return m_aiPad; }
    222222
     223#if FLEX_CODING_ORDER
     224  Void        initMultiviewSPS      ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0, Bool bDepth = false );
     225#else
    223226  Void        initMultiviewSPS      ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
     227#endif
    224228  Void        initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx );
    225229
  • branches/0.3-poznan-univ/source/Lib/TLibCommon/TypeDef.h

    r46 r48  
    4444#define FLEX_CODING_ORDER               1
    4545
     46#define FLEXCO_CAMPARAM_IN_DEPTH        FLEX_CODING_ORDER // encode pamera parameters in depth SPS
     47
    4648#define SONY_COLPIC_AVAILABILITY        1
    4749
  • branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r46 r48  
    255255  xReadFlag( uiCode ); pcSPS->setUseSAO       ( uiCode ? true : false );
    256256#endif
    257 #if POZNAN_DBMP
    258   xReadFlag( uiCode ); pcSPS->setDBMP  ( uiCode );
    259 #endif
    260 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
    261   xReadFlag( uiCode ); pcSPS->setUseCUSkip ( uiCode );
    262 #endif
    263257  xReadFlag( uiCode ); // SPS base view flag
    264258  if( uiCode )
     
    271265    pcSPS->setMultiviewResPredMode  ( 0 );
    272266#endif
     267#if POZNAN_DBMP
     268    pcSPS->setDBMP  ( false );
     269#endif
     270#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     271    pcSPS->setUseCUSkip ( false );
     272#endif
    273273  }
    274274  else
    275275  {
     276#if POZNAN_DBMP
     277    xReadFlag( uiCode ); pcSPS->setDBMP  ( uiCode );
     278#endif
     279#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     280    xReadFlag( uiCode ); pcSPS->setUseCUSkip ( uiCode );
     281#endif
    276282    xReadFlag  ( uiCode ); // depth flag
    277283    if( uiCode )
    278284    {
    279       xReadUvlc( uiCode ); // view id
     285      UInt  uiViewId;
     286#if FLEXCO_CAMPARAM_IN_DEPTH
     287      UInt  uiCamParPrecision;
     288      Int   iVOI;
     289      Bool  bCamParSlice;
     290      xReadUvlc( uiViewId );
     291      xReadSvlc( iVOI );
     292      if (uiViewId == 0)
     293      {
     294        pcSPS->initMultiviewSPSDepth    ( uiViewId, iVOI );
     295      }
     296      else
     297      {
     298        xReadUvlc( uiCamParPrecision );
     299        xReadFlag( uiCode );    bCamParSlice = ( uiCode == 1 );
     300        if( !bCamParSlice )
     301        {
     302          //uiViewId++;
     303          for( UInt uiBaseId = 0; uiBaseId < uiViewId; uiBaseId++ )
     304          {
     305            xReadSvlc( iCode );   m_aaiTempScale [ uiBaseId ][ uiViewId ] = iCode;
     306            xReadSvlc( iCode );   m_aaiTempOffset[ uiBaseId ][ uiViewId ] = iCode;
     307            xReadSvlc( iCode );   m_aaiTempScale [ uiViewId ][ uiBaseId ] = iCode - m_aaiTempScale [ uiBaseId ][ uiViewId ];
     308            xReadSvlc( iCode );   m_aaiTempOffset[ uiViewId ][ uiBaseId ] = iCode - m_aaiTempOffset[ uiBaseId ][ uiViewId ];
     309          }
     310        }
     311        pcSPS->initMultiviewSPS( uiViewId, iVOI, uiCamParPrecision, bCamParSlice, m_aaiTempScale, m_aaiTempOffset, true);
     312      }
     313#else
     314      xReadUvlc( uiViewId ); // view id
    280315      xReadSvlc(  iCode ); // view order index
    281       pcSPS->initMultiviewSPSDepth    ( uiCode, iCode );
     316      pcSPS->initMultiviewSPSDepth    ( uiViewId, iCode );
     317#endif
    282318#if DEPTH_MAP_GENERATION
    283       pcSPS->setPredDepthMapGeneration( uiCode, true );
     319      pcSPS->setPredDepthMapGeneration( uiViewId, true );
    284320#endif
    285321#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    27292765#endif
    27302766#if POZNAN_DBMP
    2731         if(bDBMPAvailable)
    2732         {
    2733           if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND;
    2734           else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--;
    2735           else uiModIdx = uiIdx;
    2736         }
    2737         else uiModIdx = uiIdx;
    2738         if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) != uiModIdx + 1 )
    2739         {
    2740           ruiMergeIndex++;
    2741         }
     2767    {
     2768      if(bDBMPAvailable)
     2769      {
     2770        if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND;
     2771        else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--;
     2772        else uiModIdx = uiIdx;
     2773      }
     2774      else uiModIdx = uiIdx;
     2775
     2776      if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) != uiModIdx + 1 )
     2777      {
     2778        ruiMergeIndex++;
     2779      }
     2780    }
    27422781#else
    27432782    if( pcCU->getNeighbourCandIdx( uiIdx, uiAbsPartIdx ) != uiIdx + 1 )
  • branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.cpp

    r46 r48  
    169169    Int64   iTempScale      = (Int64)uiDepthValue * iScale;
    170170#endif
    171     Int64   iTestScale      = ( iTempScale + iOffset       );   // for checking accuracy of camera parameters
    172171    Int64   iShiftLuma      = ( iTempScale + iOffsetLuma   ) >> iLog2DivLuma;
    173172    Int64   iShiftChroma    = ( iTempScale + iOffsetChroma ) >> iLog2DivChroma;
     
    232231
    233232  AOF( pcSlice->getSPS()->getViewId() < MAX_NUMBER_VIEWS );
     233
    234234  if ( pcSlice->getSPS()->isDepth  () )
    235235  {
     
    238238    m_cNonlinearDepthModel = pcSlice->getSPS()->getNonlinearDepthModel();   
    239239#endif
     240#if !FLEX_CODING_ORDER //Owieczka
    240241    return;
    241   }
     242#endif
     243  }
     244#if !FLEX_CODING_ORDER //Owieczka
    242245  else
     246#endif
    243247  {
    244248#if POZNAN_NONLINEAR_DEPTH
     
    251255  Bool  bFirstSliceInView = ( pcSlice->getSPS()->getViewId()  != UInt( m_iLastViewId ) || bFirstSliceInAU );
    252256  AOT(  bFirstSliceInAU  &&   pcSlice->getSPS()->getViewId()  != 0 );
     257#if !FLEX_CODING_ORDER //Owieczka 
    253258  AOT( !bFirstSliceInAU  &&   pcSlice->getSPS()->getViewId()   < UInt( m_iLastViewId ) );
    254259  AOT( !bFirstSliceInAU  &&   pcSlice->getSPS()->getViewId()   > UInt( m_iLastViewId + 1 ) );
     260#endif
    255261  AOT( !bFirstAU         &&   pcSlice->getSPS()->getViewId()   > m_uiMaxViewId );
    256262  if ( !bFirstSliceInView )
  • branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncCavlc.cpp

    r41 r48  
    3939
    4040#include "TEncCavlc.h"
     41#include "../TLibCommon/SEI.h"
    4142#include "SEIwrite.h"
    4243
     
    228229void TEncCavlc::codeSEI(const SEI& sei)
    229230{
     231#if BITSTREAM_EXTRACTION
     232  codeNALUnitHeader( NAL_UNIT_SEI, NAL_REF_IDC_PRIORITY_LOWEST, 0, sei.getLayerId() );
     233#else
    230234  codeNALUnitHeader(NAL_UNIT_SEI, NAL_REF_IDC_PRIORITY_LOWEST);
     235#endif
    231236  writeSEImessage(*m_pcBitIf, sei);
    232237}
     
    235240{
    236241  // uiFirstByte
     242#if BITSTREAM_EXTRACTION
     243  codeNALUnitHeader( NAL_UNIT_PPS, NAL_REF_IDC_PRIORITY_HIGHEST, 0, pcPPS->getLayerId() );
     244#else
    237245  codeNALUnitHeader( NAL_UNIT_PPS, NAL_REF_IDC_PRIORITY_HIGHEST );
     246#endif
    238247
    239248  xWriteUvlc( pcPPS->getPPSId() );
     
    249258}
    250259
     260#if BITSTREAM_EXTRACTION
     261Void TEncCavlc::codeNALUnitHeader( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId, UInt uiLayerId )
     262{
     263  // uiFirstByte
     264  xWriteCode( 0, 1);                    // forbidden_zero_flag
     265  xWriteCode( eNalRefIdc==0 ? 0:1, 1);  // nal_ref_flag
     266  xWriteCode( eNalUnitType, 6);         // nal_unit_type
     267
     268  xWriteCode( TemporalId, 3);           // temporal_id
     269  xWriteCode( uiLayerId+1, 5);          // layer_id_plus1
     270}
     271#else
    251272Void TEncCavlc::codeNALUnitHeader( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId, Bool bOutputFlag )
    252273{
     
    263284  }
    264285}
     286#endif
    265287
    266288Void TEncCavlc::codeSPS( TComSPS* pcSPS )
    267289{
    268290  // uiFirstByte
     291#if BITSTREAM_EXTRACTION
     292  codeNALUnitHeader( NAL_UNIT_SPS, NAL_REF_IDC_PRIORITY_HIGHEST, 0, pcSPS->getLayerId() );
     293#else
    269294  codeNALUnitHeader( NAL_UNIT_SPS, NAL_REF_IDC_PRIORITY_HIGHEST );
     295#endif
    270296
    271297  // Structure
     
    326352  xWriteFlag( pcSPS->getUseSAO() ? 1 : 0);
    327353#endif
     354  if( pcSPS->getViewId() || pcSPS->isDepth() )
     355  {
     356    xWriteFlag( 0 ); // inverse of RBSP stop bit (for backwards compatible extension)
    328357#if POZNAN_DBMP
    329358          xWriteFlag( pcSPS->getDBMP() );
     
    332361          xWriteFlag( pcSPS->getUseCUSkip() );
    333362#endif
    334 
    335   if( pcSPS->getViewId() || pcSPS->isDepth() )
    336   {
    337     xWriteFlag( 0 ); // inverse of RBSP stop bit (for backwards compatible extension)
    338363    if( pcSPS->isDepth() )
    339364    {
     
    341366      xWriteUvlc( pcSPS->getViewId() );
    342367      xWriteSvlc( pcSPS->getViewOrderIdx() );
     368#if FLEXCO_CAMPARAM_IN_DEPTH
     369      if ( pcSPS->getViewId() != 0)
     370      {
     371        xWriteUvlc( pcSPS->getCamParPrecision() );
     372        xWriteFlag( pcSPS->hasCamParInSliceHeader() ? 1 : 0 );
     373        if( !pcSPS->hasCamParInSliceHeader() )
     374        {
     375          for( UInt uiId = 0; uiId < pcSPS->getViewId(); uiId++ )
     376          {
     377            xWriteSvlc( pcSPS->getCodedScale    ()[ uiId ] );
     378            xWriteSvlc( pcSPS->getCodedOffset   ()[ uiId ] );
     379            xWriteSvlc( pcSPS->getInvCodedScale ()[ uiId ] + pcSPS->getCodedScale ()[ uiId ] );
     380            xWriteSvlc( pcSPS->getInvCodedOffset()[ uiId ] + pcSPS->getCodedOffset()[ uiId ] );
     381          }
     382        }
     383      }
     384#endif
    343385#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    344386      xWriteFlag( pcSPS->getUseDMM() ? 1 : 0 );
     
    408450  // here someone can add an appropriated NalRefIdc type
    409451#if DCM_DECODING_REFRESH
     452#if BITSTREAM_EXTRACTION
     453  codeNALUnitHeader (pcSlice->getNalUnitType(), NAL_REF_IDC_PRIORITY_HIGHEST, 1, pcSlice->getLayerId());
     454#else
    410455  codeNALUnitHeader (pcSlice->getNalUnitType(), NAL_REF_IDC_PRIORITY_HIGHEST, 1, true);
     456#endif
     457#else
     458#if BITSTREAM_EXTRACTION
     459  codeNALUnitHeader (NAL_UNIT_CODED_SLICE, NAL_REF_IDC_PRIORITY_HIGHEST, 0, pcSlice->getLayerId());
    411460#else
    412461  codeNALUnitHeader (NAL_UNIT_CODED_SLICE, NAL_REF_IDC_PRIORITY_HIGHEST);
     462#endif
    413463#endif
    414464
     
    784834    {
    785835#if POZNAN_DBMP
    786           if(bDBMPAvailable)
    787           {
    788                   if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND;
    789                   else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--;
    790                   else uiModIdx = uiIdx;
    791           }
    792           else uiModIdx = uiIdx;
    793           if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) == uiModIdx + 1 )
    794           {
     836            if(bDBMPAvailable)
     837            {
     838                    if(uiIdx==POZNAN_DBMP_MERGE_POS) uiModIdx = POZNAN_DBMP_MRG_CAND;
     839                    else if(uiIdx>POZNAN_DBMP_MERGE_POS) uiModIdx = uiIdx--;
     840                    else uiModIdx = uiIdx;
     841            }
     842            else uiModIdx = uiIdx;
     843            if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) == uiModIdx + 1 )
     844            {
    795845        uiNumCand++;
    796846      }
  • branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncCavlc.h

    r28 r48  
    206206  UInt  getCoeffCost          ()                { return  m_uiCoeffCost;  }
    207207 
     208#if BITSTREAM_EXTRACTION
     209  Void  codeNALUnitHeader       ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, UInt uiLayerId = 0 );
     210#else
    208211  Void  codeNALUnitHeader       ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, Bool bOutputFlag = true );
     212#endif
    209213 
    210214  Void  codeSPS                 ( TComSPS* pcSPS );
  • branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncCfg.h

    r41 r48  
    187187  //std::vector<int>  m_aiLayerQPOffset;
    188188
     189#if BITSTREAM_EXTRACTION
     190  UInt        m_uiLayerId;
     191#endif
    189192  UInt        m_uiViewId;
    190193  Int         m_iViewOrderIdx;
     
    257260  Void      setRateGOPSize                  ( Int   i )      { m_iRateGOPSize = i; }
    258261
     262#if BITSTREAM_EXTRACTION
     263  Void      setLayerId                      ( UInt  u )      { m_uiLayerId              = u; }
     264  UInt      getLayerId                      ( )              { return m_uiLayerId; }
     265#endif
    259266  Void      setViewId                       ( UInt  u )      { m_uiViewId               = u; }
    260267  Void      setViewOrderIdx                 ( Int   i )      { m_iViewOrderIdx          = i; }
  • branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncEntropy.h

    r5 r48  
    7272  virtual UInt  getCoeffCost          ()                = 0;
    7373 
     74#if BITSTREAM_EXTRACTION
     75  virtual Void  codeNALUnitHeader       ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, UInt uiLayerId = 0 ) = 0;
     76#else
    7477  virtual Void  codeNALUnitHeader       ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, Bool bOutputFlag = true ) = 0;
     78#endif
    7579
    7680  virtual Void  codeSPS                 ( TComSPS* pcSPS )                                      = 0;
  • branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncGOP.cpp

    r41 r48  
    658658        seiBs.create(1024);
    659659        /* write the SEI messages */
     660#if BITSTREAM_EXTRACTION
     661        sei_recon_picture_digest.setLayerId( pcSlice->getLayerId() );
     662#endif
    660663        m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice);
    661664        m_pcEntropyCoder->setBitstream(&seiBs);
  • branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncSbac.cpp

    r41 r48  
    177177}
    178178
     179#if BITSTREAM_EXTRACTION
     180Void TEncSbac::codeNALUnitHeader( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId, UInt uiLayerId )
     181#else
    179182Void TEncSbac::codeNALUnitHeader( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId, Bool bOutputFlag )
     183#endif
    180184{
    181185  assert (0);
  • branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncSbac.h

    r28 r48  
    8989  //--SBAC RD
    9090 
     91#if BITSTREAM_EXTRACTION
     92  Void  codeNALUnitHeader       ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, UInt uiLayerId = 0 );
     93#else
    9194  Void  codeNALUnitHeader       ( NalUnitType eNalUnitType, NalRefIdc eNalRefIdc, UInt TemporalId = 0, Bool bOutputFlag = true );
     95#endif
    9296
    9397  Void  codeSPS                 ( TComSPS* pcSPS     );
  • branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncSlice.cpp

    r21 r48  
    149149  rpcSlice->initSlice();
    150150  rpcSlice->setPOC( pcPic->getPOC() );
     151#if BITSTREAM_EXTRACTION
     152  rpcSlice->setLayerId( m_pcCfg->getLayerId() );
     153#endif
    151154#if SONY_COLPIC_AVAILABILITY
    152155  rpcSlice->setViewOrderIdx(m_pcCfg->getViewOrderIdx());
  • branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncTop.cpp

    r41 r48  
    576576  m_cSPS.setMaxTrSize   ( 1 << m_uiQuadtreeTULog2MaxSize );
    577577
     578#if BITSTREAM_EXTRACTION
     579  m_cSPS.setLayerId( m_uiLayerId );
     580#endif
     581
    578582  if( m_bIsDepth )
    579583  {
     584#if FLEXCO_CAMPARAM_IN_DEPTH
     585    //m_cSPS.initMultiviewSPSDepth    ( m_uiViewId, m_iViewOrderIdx );
     586    m_cSPS.initMultiviewSPS         ( m_uiViewId, m_iViewOrderIdx, m_uiCamParPrecision, m_bCamParInSliceHeader, m_aaiCodedScale, m_aaiCodedOffset, true );
     587#else
    580588    m_cSPS.initMultiviewSPSDepth    ( m_uiViewId, m_iViewOrderIdx );
     589#endif
    581590#if DEPTH_MAP_GENERATION
    582591    m_cSPS.setPredDepthMapGeneration( m_uiViewId, true );
     
    654663  m_cSPS.setUseDMM( m_bUseDMM );
    655664#endif
     665#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER
     666  m_cSPS.setUseDMM34( m_bUseDMM34 );
     667#endif
    656668#if HHI_MPI
    657669  m_cSPS.setUseMVI( m_bUseMVI );
     
    678690Void TEncTop::xInitPPS()
    679691{
     692#if BITSTREAM_EXTRACTION
     693  m_cPPS.setLayerId( m_uiLayerId );
     694#endif
     695
    680696  m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred );
    681697  m_cPPS.setPPSId( ( m_uiViewId << 1 ) + ( m_bIsDepth ? 1 : 0 ) );
Note: See TracChangeset for help on using the changeset viewer.