Changeset 70 in 3DVCSoftware for branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder


Ignore:
Timestamp:
3 Jun 2012, 21:48:11 (13 years ago)
Author:
vidyo
Message:
 
Location:
branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/NALwrite.cpp

    r56 r70  
    6464#endif
    6565
     66#if VIDYO_VPS_INTEGRATION
     67  bsNALUHeader.write(nalu.m_temporalId, 3); // temporal_id
     68  bsNALUHeader.write(nalu.m_layerId + 1, 5); // layer_id_plus1
     69#else
    6670#if H0388
    6771  bsNALUHeader.write(nalu.m_temporalId, 3); // temporal_id
     
    9094  }
    9195#endif
     96#endif
     97 
    9298  out.write(bsNALUHeader.getByteStream(), bsNALUHeader.getByteStreamLength());
    9399
     
    201207  naluDest.m_nalRefIDC   = naluSrc.m_nalRefIDC;
    202208#endif
     209#if !VIDYO_VPS_INTEGRATION
    203210  naluDest.m_viewId      = naluSrc.m_viewId;
    204211  naluDest.m_isDepth     = naluSrc.m_isDepth;
     212#endif
    205213  naluDest.m_temporalId  = naluSrc.m_temporalId;
     214#if VIDYO_VPS_INTEGRATION
     215  naluDest.m_layerId = naluSrc.m_layerId;
     216#else
     217 
    206218#if !H0388
    207219  naluDest.m_OutputFlag  = naluSrc.m_OutputFlag;
    208220#endif
     221#endif
    209222  naluDest.m_Bitstream   = naluSrc.m_Bitstream;
    210223}
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/NALwrite.h

    r56 r70  
    6262    NalRefIdc nalRefIDC,
    6363#endif
     64#if VIDYO_VPS_INTEGRATION
     65    unsigned layerId,
     66#else
    6467    Int viewId,
    6568    Bool isDepth,
     69#endif
    6670    unsigned temporalID = 0)
    6771#if NAL_REF_FLAG
     72#if VIDYO_VPS_INTEGRATION
     73  : NALUnit(nalUnitType, nalRefFlag, layerId, temporalID)
     74#else
    6875  : NALUnit(nalUnitType, nalRefFlag, viewId, isDepth, temporalID)
     76#endif
     77#else
     78#if VIDYO_VPS_INTEGRATION
     79  : NALUnit(nalUnitType, nalRefIDC, layerId, temporalID)
    6980#else
    7081  : NALUnit(nalUnitType, nalRefIDC, viewId, isDepth, temporalID)
     82#endif
    7183#endif
    7284  , m_Bitstream()
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncCavlc.cpp

    r56 r70  
    375375}
    376376
     377#if VIDYO_VPS_INTEGRATION
     378Void TEncCavlc::codeVPS( TComVPS* pcVPS )
     379{
     380        WRITE_CODE( pcVPS->getMaxTLayers() - 1,     3,        "max_temporal_layers_minus1" );
     381  WRITE_CODE( pcVPS->getMaxLayers() - 1,      5,        "max_layers_minus1" );
     382  WRITE_FLAG( pcVPS->getTemporalNestingFlag() - 1,      "temporal_id_nesting_flag" );
     383  WRITE_UVLC( pcVPS->getVPSId(),                        "video_parameter_set_id" );
     384  for(UInt i=0; i <= pcVPS->getMaxTLayers()-1; i++)
     385  {
     386    WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i),           "max_dec_pic_buffering[i]" );
     387    WRITE_UVLC( pcVPS->getNumReorderPics(i),               "num_reorder_pics[i]" );
     388    WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i),           "max_latency_increase[i]" );
     389  }
     390 
     391  WRITE_CODE( 1,      1,        "bit_equal_to_one" );
     392 
     393  if( pcVPS->getMaxLayers() - 1 > 0 )
     394  {
     395    WRITE_UVLC( pcVPS->getExtensionType(),                        "extension_type" );
     396   
     397    if( pcVPS->getExtensionType() == 0)
     398      WRITE_SVLC( pcVPS->getViewOrderIdx(0),                      "view_order_idx[0]" );
     399   
     400    for(UInt i=0; i <= pcVPS->getMaxLayers()-1; i++)
     401    {
     402      WRITE_FLAG( pcVPS->getDependentFlag(i),                     "dependent_flag[i]" );
     403      if( pcVPS->getDependentFlag(i) )
     404      {
     405        WRITE_UVLC( i - pcVPS->getDependentLayer(i) - 1,          "delta_reference_layer_id_minus1[i]" );
     406        if( pcVPS->getExtensionType() == VPS_EXTENSION_TYPE_MULTI_VIEW )
     407        {
     408          WRITE_UVLC( pcVPS->getViewId(i),                        "view_id[i]" );
     409          WRITE_FLAG( pcVPS->getDepthFlag(i),                     "depth_flag[i]" );
     410          WRITE_SVLC( pcVPS->getViewOrderIdx(i),                  "view_order_idx[i]" );
     411        }
     412       
     413      }
     414    }
     415  }
     416 
     417  WRITE_FLAG( 0,                     "vps_extension_flag" );
     418 
     419  //future extensions here..
     420 
     421  return;
     422}
     423#endif
     424
    377425#if HHI_MPI
    378426Void TEncCavlc::codeSPS( TComSPS* pcSPS, Bool bIsDepth )
     
    388436  WRITE_CODE( pcSPS->getLevelIdc (),       8,       "level_idc" );
    389437  WRITE_UVLC( pcSPS->getSPSId (),                   "seq_parameter_set_id" );
     438#if VIDYO_VPS_INTEGRATION
     439  WRITE_UVLC( pcSPS->getVPSId (),                   "video_parameter_set_id" );
     440#endif
    390441  WRITE_UVLC( pcSPS->getChromaFormatIdc (),         "chroma_format_idc" );
    391442  WRITE_CODE( pcSPS->getMaxTLayers() - 1,  3,       "max_temporal_layers_minus1" );
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncCavlc.h

    r56 r70  
    113113  UInt  getNumberOfWrittenBits()                { return  m_pcBitIf->getNumberOfWrittenBits();  }
    114114  UInt  getCoeffCost          ()                { return  m_uiCoeffCost;  }
    115  
     115
     116#if VIDYO_VPS_INTEGRATION
     117  Void  codeVPS                 ( TComVPS* pcVPS );
     118#endif
     119
    116120#if HHI_MPI
    117121  Void  codeSPS                 ( TComSPS* pcSPS, Bool bIsDepth );
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncCfg.h

    r56 r70  
    290290#endif
    291291
     292#if VIDYO_VPS_INTEGRATION
     293  UInt     m_layerId;
     294#endif
     295 
    292296  Int      m_viewId;
    293297  Bool     m_isDepth;
     
    765769  Int       getTSIG()                            { return m_signHidingThreshold; }
    766770#endif
    767 
     771#if VIDYO_VPS_INTEGRATION
     772  Void      setLayerId             ( UInt layerId )   { m_layerId = layerId; }
     773  UInt      getLayerId             ()               { return m_layerId; }
     774#endif
     775 
    768776  Void      setViewId             ( Int viewId )   { m_viewId = viewId; }
    769777  Int       getViewId             ()               { return m_viewId; }
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncEntropy.cpp

    r62 r70  
    121121}
    122122
     123#if VIDYO_VPS_INTEGRATION
     124Void TEncEntropy::encodeVPS( TComVPS* pcVPS )
     125{
     126  m_pcEntropyCoderIf->codeVPS( pcVPS );
     127  return;
     128}
     129#endif
     130
     131#if VIDYO_VPS_INTEGRATION
     132Void  codeVPS                 ( TComVPS* pcVPS );
     133#endif
     134
    123135#if HHI_MPI
    124136Void TEncEntropy::encodeSPS( TComSPS* pcSPS, Bool bIsDepth )
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncEntropy.h

    r56 r70  
    7676  virtual UInt  getCoeffCost          ()                = 0;
    7777
     78#if VIDYO_VPS_INTEGRATION
     79        virtual Void  codeVPS                 ( TComVPS* pcVPS )                                      = 0;
     80#endif
     81       
    7882#if HHI_MPI
    7983  virtual Void  codeSPS                 ( TComSPS* pcSPS, Bool bIsDepth )                       = 0;
     
    229233 
    230234public:
     235#if VIDYO_VPS_INTEGRATION
     236        Void encodeVPS               ( TComVPS* pcVPS);
     237#endif
    231238  // SPS
    232239#if HHI_MPI
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncGOP.cpp

    r69 r70  
    809809      if ( m_bSeqFirst )
    810810      {
     811#if VIDYO_VPS_INTEGRATION
     812        {
     813          OutputNALUnit nalu(NAL_UNIT_VPS, true, m_pcEncTop->getLayerId());
     814          m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     815          m_pcEntropyCoder->encodeVPS(m_pcEncTop->getEncTop()->getVPS());
     816          writeRBSPTrailingBits(nalu.m_Bitstream);
     817          accessUnit.push_back(new NALUnitEBSP(nalu));
     818        }
     819#endif
    811820#if NAL_REF_FLAG
     821#if VIDYO_VPS_INTEGRATION
     822        OutputNALUnit nalu(NAL_UNIT_SPS, true, m_pcEncTop->getLayerId());
     823#else
    812824        OutputNALUnit nalu(NAL_UNIT_SPS, true, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth());
     825#endif
    813826#else
    814827        OutputNALUnit nalu(NAL_UNIT_SPS, NAL_REF_IDC_PRIORITY_HIGHEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth());
     
    827840
    828841#if NAL_REF_FLAG
     842#if VIDYO_VPS_INTEGRATION
     843        nalu = NALUnit(NAL_UNIT_PPS, true, m_pcEncTop->getLayerId());
     844#else
    829845        nalu = NALUnit(NAL_UNIT_PPS, true, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth());
     846#endif
    830847#else
    831848        nalu = NALUnit(NAL_UNIT_PPS, NAL_REF_IDC_PRIORITY_HIGHEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth());
     
    954971#if H0388
    955972#if NAL_REF_FLAG
    956         OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced(), m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() );
    957 #else
    958         OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced() ? NAL_REF_IDC_PRIORITY_HIGHEST: NAL_REF_IDC_PRIORITY_LOWEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() );
    959 #endif
    960 #else
    961         OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced() ? NAL_REF_IDC_PRIORITY_HIGHEST: NAL_REF_IDC_PRIORITY_LOWEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer(), true);
    962 #endif
     973        OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced(),
     974#if !VIDYO_VPS_INTEGRATION
     975                           m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() );
     976#else
     977                           m_pcEncTop->getLayerId(), pcSlice->getTLayer() );
     978#endif
     979#else
     980        OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced() ? NAL_REF_IDC_PRIORITY_HIGHEST: NAL_REF_IDC_PRIORITY_LOWEST,
     981#if !VIDYO_VPS_INTEGRATION
     982                           m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() );
     983#else
     984                           m_pcEncTop->getLayerId(), pcSlice->getTLayer() );
     985#endif
     986#endif
     987#else
     988        OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced() ? NAL_REF_IDC_PRIORITY_HIGHEST: NAL_REF_IDC_PRIORITY_LOWEST,
     989#if !VIDYO_VPS_INTEGRATION
     990                           m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer(), true );
     991#else
     992                           m_pcEncTop->getLayerId(), pcSlice->getTLayer(), true );
     993#endif
     994
     995#endif
     996           
    963997        Bool bEntropySlice = (!pcSlice->isNextSlice());
    964998        if (!bEntropySlice)
     
    14141448          {
    14151449#if NAL_REF_FLAG
     1450#if VIDYO_VPS_INTEGRATION
     1451            OutputNALUnit nalu(NAL_UNIT_APS, true, m_pcEncTop->getLayerId());
     1452#else
    14161453            OutputNALUnit nalu(NAL_UNIT_APS, true, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth());
     1454#endif
    14171455#else
    14181456            OutputNALUnit nalu(NAL_UNIT_APS, NAL_REF_IDC_PRIORITY_HIGHEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth());
     
    14761514
    14771515#if NAL_REF_FLAG
     1516#if VIDYO_VPS_INTEGRATION
     1517        OutputNALUnit nalu(NAL_UNIT_SEI, false, m_pcEncTop->getLayerId());
     1518#else
    14781519        OutputNALUnit nalu(NAL_UNIT_SEI, false, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth());
     1520#endif
    14791521#else
    14801522        OutputNALUnit nalu(NAL_UNIT_SEI, NAL_REF_IDC_PRIORITY_LOWEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth());
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncSbac.cpp

    r58 r70  
    342342}
    343343
     344#if VIDYO_VPS_INTEGRATION
     345Void TEncSbac::codeVPS( TComVPS* pcVPS )
     346{
     347        assert (0);
     348  return;
     349}
     350#endif
     351
    344352#if HHI_MPI
    345353Void TEncSbac::codeSPS( TComSPS* pcSPS, Bool bIsDepth )
  • branches/HTM-3.0-Vidyo/source/Lib/TLibEncoder/TEncSbac.h

    r56 r70  
    9898  //--SBAC RD
    9999
     100#if VIDYO_VPS_INTEGRATION
     101  Void  codeVPS                 ( TComVPS* pcVPS );
     102#endif
     103       
    100104#if HHI_MPI
    101105  Void  codeSPS                 ( TComSPS* pcSPS, Bool bIsDepth );
Note: See TracChangeset for help on using the changeset viewer.