Changeset 210 in 3DVCSoftware for trunk/source/Lib/TLibEncoder


Ignore:
Timestamp:
11 Dec 2012, 18:52:43 (11 years ago)
Author:
tech
Message:

Reintegrated /branches/HTM-5.0-dev0 rev. 207.

Location:
trunk/source/Lib/TLibEncoder
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/NALwrite.cpp

    r77 r210  
    6464#endif
    6565
     66#if QC_MVHEVC_B0046
     67  bsNALUHeader.write(nalu.m_layerId,        5); // when nal_ref_flag is signalled, 5 bits here. otherwise, 6 bits
     68  bsNALUHeader.write(nalu.m_temporalId + 1, 3); // temporal_id
     69#else
    6670#if VIDYO_VPS_INTEGRATION
    6771  bsNALUHeader.write(nalu.m_temporalId, 3); // temporal_id
     
    7983  case NAL_UNIT_CODED_SLICE_IDR:
    8084#if H0566_TLA
     85#if !QC_REM_IDV_B0046
    8186  case NAL_UNIT_CODED_SLICE_IDV:
     87#endif
    8288  case NAL_UNIT_CODED_SLICE_CRA:
    8389  case NAL_UNIT_CODED_SLICE_TLA:
     
    95101#endif
    96102#endif
    97  
     103#endif
    98104  out.write(bsNALUHeader.getByteStream(), bsNALUHeader.getByteStreamLength());
    99105
     
    196202}
    197203
     204#if !QC_MVHEVC_B0046
    198205/**
    199206 * Copy NALU from naluSrc to naluDest
     
    222229  naluDest.m_Bitstream   = naluSrc.m_Bitstream;
    223230}
     231#endif
    224232
    225233//! \}
  • trunk/source/Lib/TLibEncoder/NALwrite.h

    r77 r210  
    6262    NalRefIdc nalRefIDC,
    6363#endif
    64 #if VIDYO_VPS_INTEGRATION
     64#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    6565    unsigned layerId,
    6666#else
     
    7070    unsigned temporalID = 0)
    7171#if NAL_REF_FLAG
    72 #if VIDYO_VPS_INTEGRATION
     72#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    7373  : NALUnit(nalUnitType, nalRefFlag, layerId, temporalID)
    7474#else
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r189 r210  
    375375}
    376376
     377#if QC_MVHEVC_B0046
     378Void TEncCavlc::codeVPS( TComVPS* pcVPS )
     379{
     380  WRITE_CODE( pcVPS->getVPSId(),               4,        "video_parameter_set_id"     );
     381  WRITE_FLAG( pcVPS->getTemporalNestingFlag() -1,        "temporal_id_nesting_flag"   );
     382  WRITE_CODE( 0,                 2,        "vps_reserved_zero_2bits"    );
     383  WRITE_CODE( pcVPS->getMaxLayers() - 1,       6,        "vps_max_layers_minus1"      );
     384  WRITE_CODE( pcVPS->getMaxTLayers() - 1,      3,        "vps_max_sub_layers_minus1"  );
     385  //to be determined
     386  //profile_tier_level( 1, vps_max_sub_layers_minus1 );
     387  //to be modified
     388  WRITE_CODE( 0,                              12,         "vps_extension_offset"      );
     389  for(UInt i=0; i <= pcVPS->getMaxTLayers()-1; i++)
     390  {
     391    WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i),           "max_dec_pic_buffering[i]" );
     392    WRITE_UVLC( pcVPS->getNumReorderPics(i),               "num_reorder_pics[i]"      );
     393    WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i),           "max_latency_increase[i]"  );
     394  }
     395  //!!!waste one bit: 3-view, 3; 2-view or more views: 1
     396  WRITE_UVLC(pcVPS->getNumHRDParameters(),                 "vps_num_hrd_parameters"   );
     397  assert(pcVPS->getNumHRDParameters()==0);
     398  for ( UInt i = 0; i < pcVPS->getNumHRDParameters(); i ++)
     399  {
     400   //   if( i > 0 ) 
     401    //{
     402    //  WRITE_UVLC (0, "op_num_layer_id_values_minus1[ opIdx ]");
     403    //  for( i = 0; i <= op_num_layer_id_values_minus1[ opIdx ]; i++ ) 
     404    //    WRITE_CODE(0, 6, "op_layer_id[ opIdx ][ i ]");
     405    //} 
     406    //hrd_parameters( i  = =  0, vps_max_sub_layers_minus1 ); 
     407  }
     408  WRITE_CODE( 1,      1,        "bit_equal_to_one" );
     409  //btye aligned
     410  m_pcBitIf->writeAlignOne();
     411
     412  if(pcVPS->getMaxLayers() == 3)
     413    pcVPS->setNumAddiLayerOperationPoints (pcVPS->getMaxLayers());    //may be configured
     414  else
     415    pcVPS->setNumAddiLayerOperationPoints (1);   
     416  pcVPS->setNumAddiProLevelSets         (1);
     417  WRITE_CODE( pcVPS->getNumAddiLayerOperationPoints(),         8,               "num_additional_layer_operation_points" );   
     418  WRITE_CODE( pcVPS->getNumAddiProLevelSets(),                 8,               "num_additional_profile_level_sets"     );   
     419  for(UInt i=0; i <= pcVPS->getMaxLayers()-1; i++)
     420  {
     421    WRITE_CODE( 0,         4,               "num_types_zero_4bits[i]" );   
     422    WRITE_CODE( 0,         4,               "type_zero_4bits[i]"      );   
     423    WRITE_CODE( pcVPS->getViewId(i),         8,               "view_id[i]" );   
     424    if(i)
     425    {
     426      WRITE_CODE( pcVPS->getNumDirectRefLayer(i), 6,  "num_direct_ref_layers[ i ]" );   
     427      for (UInt j = 0; j< pcVPS->getNumDirectRefLayer(i); j++)
     428      {
     429        WRITE_CODE( pcVPS->getDirectRefLayerId (i, j), 6,  "ref_layer_id[i][j]" );
     430      }
     431    }
     432  }
     433  for( UInt i=1; i<=pcVPS->getNumAddiProLevelSets(); i++)
     434  {
     435    //profile_tier_level
     436  }
     437  for( UInt i=1; i<= pcVPS->getNumAddiLayerOperationPoints(); i++)
     438  {   
     439    if(pcVPS->getMaxLayers() == 3)
     440    {
     441      pcVPS->setNumOpLayerIdMinus1((i < pcVPS->getNumAddiLayerOperationPoints() ? 1: 2), (i-1));
     442    }
     443    else if( i==1 )
     444    {
     445      assert(pcVPS->getNumAddiLayerOperationPoints()==1);
     446      pcVPS->setNumOpLayerIdMinus1(pcVPS->getMaxLayers()-1, (i-1));
     447    }
     448    WRITE_UVLC( pcVPS->getNumOpLayerIdMinus1(i-1),           "op_num_layer_id_values_minus1[ opIdx ]" );
     449    for(UInt j = 0; j <= pcVPS->getNumOpLayerIdMinus1(i-1); j++ )
     450    {
     451      if(pcVPS->getMaxLayers() == 3 && i== 2 && j==1)
     452        pcVPS->setNumOpLayerId (2, i-1, j);
     453      else
     454        pcVPS->setNumOpLayerId (j, i-1, j);
     455      WRITE_UVLC( pcVPS->getNumOpLayerId(i-1, j),           "op_layer_id[ opIdx ][ i ]" );
     456    }
     457    if (pcVPS->getNumAddiProLevelSets())
     458    {
     459      //profile_level_idx[ i ]
     460    }
     461  }
     462  return;
     463}
     464#else
    377465#if VIDYO_VPS_INTEGRATION
    378466Void TEncCavlc::codeVPS( TComVPS* pcVPS )
     
    419507}
    420508#endif
    421 
     509#endif
    422510#if HHI_MPI
    423511Void TEncCavlc::codeSPS( TComSPS* pcSPS, Bool bIsDepth )
     
    620708#endif
    621709  WRITE_FLAG( 1, "sps_extension_flag" );
    622 
     710#if !QC_MVHEVC_B0046
    623711  WRITE_FLAG( (pcSPS->getNumberOfUsableInterViewRefs() > 0) ? 1 : 0, "interview_refs_present_flag" );
    624712  if( pcSPS->getNumberOfUsableInterViewRefs() > 0 )
     
    719807  }
    720808  WRITE_FLAG( 0, "sps_extension2_flag" );
     809#endif
    721810}
    722811
     
    795884  if (!bEntropySlice)
    796885  {
     886#if QC_MVHEVC_B0046
     887    WRITE_UVLC( 0, "pic_parameter_set_id" );
     888#else
    797889    WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "pic_parameter_set_id" );
     890#endif
    798891#if H0388
    799892    if( pcSlice->getPPS()->getOutputFlagPresentFlag() )
     
    802895    }
    803896#endif
     897#if QC_REM_IDV_B0046
     898    if(pcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_IDR && pcSlice->getViewId() == 0)
     899#else
    804900    if(pcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_IDR)
     901#endif
    805902    {
    806903      WRITE_UVLC( 0, "idr_pic_id" );
     
    810907    {
    811908      WRITE_CODE( (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC()))%(1<<pcSlice->getSPS()->getBitsForPOC()), pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb");
     909#if QC_REM_IDV_B0046
     910      if( pcSlice->getPOC() == 0 && !(pcSlice->getSPS()->getViewId() && (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)))
     911#else
    812912      if( pcSlice->getPOC() == 0 && pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDV )
     913#endif
    813914      {
    814915        TComReferencePictureSet* rps = pcSlice->getRPS();
  • trunk/source/Lib/TLibEncoder/TEncCavlc.h

    r189 r210  
    114114  UInt  getCoeffCost          ()                { return  m_uiCoeffCost;  }
    115115 
    116 #if VIDYO_VPS_INTEGRATION
     116#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    117117  Void  codeVPS                 ( TComVPS* pcVPS );
    118118#endif
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r189 r210  
    183183  Int       m_iSearchRange;                     //  0:Full frame
    184184  Int       m_bipredSearchRange;
    185 
     185#if DV_V_RESTRICTION_B0037
     186  Bool      m_bUseDisparitySearchRangeRestriction;
     187  Int       m_iVerticalDisparitySearchRange;
     188#endif
    186189  //====== Quality control ========
    187190  Int       m_iMaxDeltaQP;                      //  Max. absolute delta QP (1:default)
     
    307310#endif
    308311
    309 #if VIDYO_VPS_INTEGRATION
     312#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    310313  UInt     m_layerId;
    311314#endif
     
    322325#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    323326  Bool     m_bUseDMM;
     327#endif
     328
     329#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
     330  Bool m_bUseDMM34;
    324331#endif
    325332
     
    468475  Void      setSearchRange                  ( Int   i )      { m_iSearchRange = i; }
    469476  Void      setBipredSearchRange            ( Int   i )      { m_bipredSearchRange = i; }
    470 
     477#if DV_V_RESTRICTION_B0037
     478  Void      setUseDisparitySearchRangeRestriction ( Bool   b )      { m_bUseDisparitySearchRangeRestriction = b; }
     479  Void      setVerticalDisparitySearchRange ( Int   i )      { m_iVerticalDisparitySearchRange = i; }
     480#endif
    471481#if HHI_INTER_VIEW_MOTION_PRED
    472482  UInt      getMultiviewMvRegMode           ()      { return  m_uiMultiviewMvRegMode; }
     
    559569  Int       getFastSearch                   ()      { return  m_iFastSearch; }
    560570  Int       getSearchRange                  ()      { return  m_iSearchRange; }
    561 
     571#if DV_V_RESTRICTION_B0037
     572  Bool      getUseDisparitySearchRangeRestriction ()      { return  m_bUseDisparitySearchRangeRestriction; }
     573  Int       getVerticalDisparitySearchRange ()      { return  m_iVerticalDisparitySearchRange; }
     574#endif
    562575#if HHI_VSO
    563576  //==== VSO  ==========
     
    820833  Int       getTSIG()                            { return m_signHidingThreshold; }
    821834#endif
    822 #if VIDYO_VPS_INTEGRATION
     835#if VIDYO_VPS_INTEGRATION |QC_MVHEVC_B0046
    823836  Void      setLayerId             ( UInt layerId )   { m_layerId = layerId; }
    824837  UInt      getLayerId             ()               { return m_layerId; }
     
    833846  Void      setUseDMM( Bool b) { m_bUseDMM = b;    }
    834847  Bool      getUseDMM()        { return m_bUseDMM; }
     848#endif
     849
     850#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
     851  Void setUseDMM34( Bool b) { m_bUseDMM34 = b;    }
     852  Bool getUseDMM34()        { return m_bUseDMM34; }
    835853#endif
    836854
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r189 r210  
    121121}
    122122
    123 #if VIDYO_VPS_INTEGRATION
     123#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    124124Void TEncEntropy::encodeVPS( TComVPS* pcVPS )
    125125{
     
    129129#endif
    130130
    131 #if VIDYO_VPS_INTEGRATION
     131#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    132132Void  codeVPS                 ( TComVPS* pcVPS );
    133133#endif
  • trunk/source/Lib/TLibEncoder/TEncEntropy.h

    r189 r210  
    7676  virtual UInt  getCoeffCost          ()                = 0;
    7777
    78 #if VIDYO_VPS_INTEGRATION
     78#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    7979  virtual Void  codeVPS                 ( TComVPS* pcVPS )                                      = 0;
    8080#endif
     
    242242 
    243243public:
    244 #if VIDYO_VPS_INTEGRATION
     244#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    245245  Void encodeVPS               ( TComVPS* pcVPS);
    246246#endif
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r189 r210  
    246246
    247247      std::vector<TComAPS>& vAPS = m_pcEncTop->getAPS();
    248 #if VIDYO_VPS_INTEGRATION
     248#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    249249    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, uiPOCCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getEncTop()->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS() );
    250250#else
     
    298298      if( pcSlice->getSliceType() == B_SLICE )
    299299      {
    300         if( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) { pcSlice->setSliceType( P_SLICE ); }
    301       }
     300#if QC_REM_IDV_B0046
     301      if( m_pcCfg->getGOPEntry(pcSlice->getSPS()->getViewId() && ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA))? MAX_GOP : iGOPid ).m_sliceType == 'P' ) { pcSlice->setSliceType( P_SLICE ); }
     302#else
     303      if( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) { pcSlice->setSliceType( P_SLICE ); }
     304#endif
     305    }
    302306
    303307      // Set the nal unit type
     
    332336#endif
    333337
     338#if !QC_REM_IDV_B0046
    334339      pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
    335340      pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
    336 
    337       TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
    338       refPicListModification->setRefPicListModificationFlagL0( false );
     341#else
     342
     343    Bool bNalRAP = ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR)) && (pcSlice->getSPS()->getViewId())  ? 1: 0;
     344    pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
     345    pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );
     346#endif
     347    TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
     348    refPicListModification->setRefPicListModificationFlagL0( false );
    339349#if !H0137_0138_LIST_MODIFICATION
    340350      refPicListModification->setNumberOfRefPicListModificationsL0(0);
     
    353363      assert( tAppEncTop != NULL );
    354364
     365
     366#if FLEX_CODING_ORDER_M23723
     367      TComPic * pcTexturePic;
     368      if(m_pcEncTop->getIsDepth() == 1)
     369      {
     370        TComPicYuv * recText;
     371        recText = tAppEncTop->getPicYuvFromView(m_pcEncTop->getViewId(), pcSlice->getPOC(), false ,true);
     372        if(recText == NULL)
     373        {
     374           pcSlice->setTexturePic(NULL);
     375        }
     376        else
     377        {
     378           pcTexturePic = m_pcEncTop->getIsDepth() ? tAppEncTop->getPicFromView( m_pcEncTop->getViewId(), pcSlice->getPOC(), false ) : NULL;
     379           pcSlice->setTexturePic( pcTexturePic );
     380        }
     381      }
     382      else
     383    {
     384        pcTexturePic = m_pcEncTop->getIsDepth() ? tAppEncTop->getPicFromView( m_pcEncTop->getViewId(), pcSlice->getPOC(), false ) : NULL;
     385        assert( !m_pcEncTop->getIsDepth() || pcTexturePic != NULL );
     386          pcSlice->setTexturePic( pcTexturePic );
     387      }
     388
     389#else
    355390      TComPic * const pcTexturePic = m_pcEncTop->getIsDepth() ? tAppEncTop->getPicFromView( m_pcEncTop->getViewId(), pcSlice->getPOC(), false ) : NULL;
    356391      assert( !m_pcEncTop->getIsDepth() || pcTexturePic != NULL );
    357392      pcSlice->setTexturePic( pcTexturePic );
    358393
     394#endif
    359395      std::vector<TComPic*> apcInterViewRefPics = tAppEncTop->getInterViewRefPics( m_pcEncTop->getViewId(), pcSlice->getPOC(), m_pcEncTop->getIsDepth(), pcSlice->getSPS() );
    360396      pcSlice->setRefPicListMvc( rcListPic, apcInterViewRefPics );
     
    363399      if( pcSlice->getSliceType() == B_SLICE )
    364400      {
     401#if !QC_REM_IDV_B0046
    365402        if( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) { pcSlice->setSliceType( P_SLICE ); }
     403#else
     404      Bool bRAP = ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR)) && (pcSlice->getSPS()->getViewId())  ? 1: 0;
     405      if( m_pcCfg->getGOPEntry( bRAP ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) { pcSlice->setSliceType( P_SLICE ); }
     406#endif
    366407      }
    367408     
     
    451492
    452493#if SAIT_VSO_EST_A0033
    453     m_pcRdCost->setVideoRecPicYuv( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), false, true ) );
    454     m_pcRdCost->setDepthPicYuv   ( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), true, false ) );
     494#ifdef FLEX_CODING_ORDER_M23723   
     495{
     496  Bool flagRec;
     497  flagRec =  ((m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), false, true) == NULL) ? false: true);
     498  m_pcRdCost->setVideoRecPicYuv( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), false, flagRec ) );
     499  m_pcRdCost->setDepthPicYuv   ( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), true, false ) );
     500}
     501#else
     502  m_pcRdCost->setVideoRecPicYuv( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), false, true ) );
     503  m_pcRdCost->setDepthPicYuv   ( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), true, false ) );
     504#endif
    455505#endif
    456506#if LGE_WVSO_A0119
     
    830880      if ( m_bSeqFirst )
    831881      {
    832 #if VIDYO_VPS_INTEGRATION
     882#if QC_MVHEVC_B0046
     883      if(!m_pcEncTop->getLayerId())
     884      {
     885#endif
     886#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    833887        {
    834888          OutputNALUnit nalu(NAL_UNIT_VPS, true, m_pcEncTop->getLayerId());
     
    840894#endif
    841895#if NAL_REF_FLAG
    842 #if VIDYO_VPS_INTEGRATION
     896#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    843897        OutputNALUnit nalu(NAL_UNIT_SPS, true, m_pcEncTop->getLayerId());
    844898#else
     
    861915
    862916#if NAL_REF_FLAG
    863 #if VIDYO_VPS_INTEGRATION
     917#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
     918#if QC_MVHEVC_B0046
    864919        nalu = NALUnit(NAL_UNIT_PPS, true, m_pcEncTop->getLayerId());
     920#else
     921        nalu = NALUnit(NAL_UNIT_PPS, true, m_pcEncTop->getLayerId());
     922#endif
    865923#else
    866924        nalu = NALUnit(NAL_UNIT_PPS, true, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth());
     
    873931        writeRBSPTrailingBits(nalu.m_Bitstream);
    874932        accessUnit.push_back(new NALUnitEBSP(nalu));
    875 
    876         m_bSeqFirst = false;
    877       }
     933#if QC_MVHEVC_B0046
     934      }
     935#endif
     936      m_bSeqFirst = false;
     937    }
    878938
    879939      /* use the main bitstream buffer for storing the marshalled picture */
     
    9931053#if NAL_REF_FLAG
    9941054        OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced(),
    995 #if !VIDYO_VPS_INTEGRATION
     1055#if !VIDYO_VPS_INTEGRATION &!QC_MVHEVC_B0046
    9961056                           m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() );
    9971057#else
     
    14691529          {
    14701530#if NAL_REF_FLAG
    1471 #if VIDYO_VPS_INTEGRATION
     1531#if VIDYO_VPS_INTEGRATION | QC_MVHEVC_B0046
    14721532            OutputNALUnit nalu(NAL_UNIT_APS, true, m_pcEncTop->getLayerId());
    14731533#else
     
    15351595
    15361596#if NAL_REF_FLAG
    1537 #if VIDYO_VPS_INTEGRATION
     1597#if VIDYO_VPS_INTEGRATION | QC_MVHEVC_B0046
    15381598        OutputNALUnit nalu(NAL_UNIT_SEI, false, m_pcEncTop->getLayerId());
    15391599#else
     
    19732033  case NAL_UNIT_CODED_SLICE: return "SLICE";
    19742034#if H0566_TLA
     2035#if !QC_REM_IDV_B0046
    19752036  case NAL_UNIT_CODED_SLICE_IDV: return "IDV";
     2037#endif
    19762038  case NAL_UNIT_CODED_SLICE_CRA: return "CRA";
    19772039  case NAL_UNIT_CODED_SLICE_TLA: return "TLA";
     
    21882250    if( bInterViewOnlySlice )
    21892251    {
     2252#if !QC_REM_IDV_B0046
    21902253      return NAL_UNIT_CODED_SLICE_IDV;
     2254#else
     2255      return NAL_UNIT_CODED_SLICE_IDR;
     2256#endif
    21912257    }
    21922258    else
     
    22012267      if( bInterViewOnlySlice )
    22022268      {
     2269#if !QC_REM_IDV_B0046
    22032270        return NAL_UNIT_CODED_SLICE_IDV;
     2271#else
     2272        return NAL_UNIT_CODED_SLICE_CRA;
     2273#endif
    22042274      }
    22052275      else
     
    22162286      if( bInterViewOnlySlice )
    22172287      {
     2288#if !QC_REM_IDV_B0046
    22182289        return NAL_UNIT_CODED_SLICE_IDV;
     2290#else
     2291        return NAL_UNIT_CODED_SLICE_IDR;
     2292#endif
    22192293      }
    22202294      else
     
    24542528
    24552529  // analyze inter-view modifications
     2530#if !QC_REM_IDV_B0046
    24562531  GOPEntryMvc gem = m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid );
     2532#else
     2533  Bool bRAP = ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA)) && (pcSlice->getSPS()->getViewId()) ? 1:0;
     2534  GOPEntryMvc gem = m_pcCfg->getGOPEntry( bRAP ? MAX_GOP : iGOPid );
     2535#endif
    24572536  Int numL0Modifications = 0;
    24582537  Int numL1Modifications = 0;
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r189 r210  
    396396}
    397397
    398 #if VIDYO_VPS_INTEGRATION
     398#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    399399Void TEncSbac::codeVPS( TComVPS* pcVPS )
    400400{
     
    10761076#endif
    10771077#if HHI_DMM_PRED_TEX
     1078
     1079#if FLEX_CODING_ORDER_M23723
     1080    if ( !pcCU->getSlice()->getSPS()->getUseDMM34() )
     1081    {
     1082      assert( uiDir != DMM_WEDGE_PREDTEX_D_IDX );
     1083      assert( uiDir != DMM_CONTOUR_PREDTEX_D_IDX );
     1084    }
     1085#endif
     1086
    10781087    if( uiDir == DMM_WEDGE_PREDTEX_D_IDX )     { xCodeWedgePredTexDeltaInfo  ( pcCU, uiAbsPartIdx ); }
    10791088    if( uiDir == DMM_CONTOUR_PREDTEX_D_IDX )   { xCodeContourPredTexDeltaInfo( pcCU, uiAbsPartIdx ); }
  • trunk/source/Lib/TLibEncoder/TEncSbac.h

    r189 r210  
    9898  //--SBAC RD
    9999
    100 #if VIDYO_VPS_INTEGRATION
     100#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    101101  Void  codeVPS                 ( TComVPS* pcVPS );
    102102#endif
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r189 r210  
    160160                      Int           iSearchRange,
    161161                      Int           bipredSearchRange,
     162#if DV_V_RESTRICTION_B0037
     163                      Bool          bUseDisparitySearchRangeRestriction,
     164                      Int           iVerticalDisparitySearchRange,
     165#endif
    162166                      Int           iFastSearch,
    163167                      Int           iMaxDeltaQP,
     
    172176  m_iSearchRange         = iSearchRange;
    173177  m_bipredSearchRange    = bipredSearchRange;
     178#if DV_V_RESTRICTION_B0037
     179  m_bUseDisparitySearchRangeRestriction = bUseDisparitySearchRangeRestriction;
     180  m_iVerticalDisparitySearchRange = iVerticalDisparitySearchRange;
     181#endif
    174182  m_iFastSearch          = iFastSearch;
    175183  m_iMaxDeltaQP          = iMaxDeltaQP;
     
    22362244#endif
    22372245#if HHI_DMM_PRED_TEX
     2246     
     2247#if FLEX_CODING_ORDER_M23723
     2248      if ( pcCU->getSlice()->getSPS()->getUseDMM34() )
     2249      {
     2250#endif
    22382251      UInt uiTexTabIdx  = 0;
    22392252      Int  iTexDeltaDC1 = 0;
     
    22592272        uiRdModeList[ numModesForFullRD++ ] = DMM_CONTOUR_PREDTEX_D_IDX;
    22602273      }
     2274#if FLEX_CODING_ORDER_M23723
     2275      }
     2276#endif
    22612277#endif
    22622278    }
     
    23032319
    23042320#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     2321#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
     2322      if( m_pcEncCfg->getIsDepth() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getUseDMM34() )
     2323#if LGE_EDGE_INTRA_A0070
     2324        && uiOrgMode < EDGE_INTRA_IDX
     2325#endif
     2326        )
     2327
     2328#else
     2329
    23052330      if( m_pcEncCfg->getIsDepth() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight )
    23062331#if LGE_EDGE_INTRA_A0070
     
    23082333#endif
    23092334        )
     2335#endif
    23102336      {
    23112337        continue;
     
    42144240  TComYuv*      pcYuv = pcYuvOrg;
    42154241  m_iSearchRange = m_aaiAdaptSR[eRefPicList][iRefIdxPred];
    4216  
     4242
    42174243  Int           iSrchRng      = ( bBi ? m_bipredSearchRange : m_iSearchRange );
     4244#if DV_V_RESTRICTION_B0037
     4245  Int           iVerDispSrchRng = m_iVerticalDisparitySearchRange; 
     4246#endif
    42184247  TComPattern*  pcPatternKey  = pcCU->getPattern        ();
    42194248 
     
    42524281 
    42534282  TComMv      cMvPred = *pcMvPred;
    4254  
     4283
     4284#if DV_V_RESTRICTION_B0037
     4285  Bool bMv_VRng_Restricted = false;
     4286  if( pcCU->getSlice()->getViewId() > 0
     4287      &&
     4288      pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getPOC() == pcCU->getSlice()->getPOC()
     4289      &&
     4290      m_bUseDisparitySearchRangeRestriction
     4291     )
     4292  {
     4293      bMv_VRng_Restricted = true;
     4294  }
     4295#endif
     4296
     4297#if DV_V_RESTRICTION_B0037
     4298  if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, iVerDispSrchRng );
     4299  else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, iVerDispSrchRng );
     4300#else
    42554301  if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
    42564302  else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
    4257  
     4303#endif
     4304
    42584305  m_pcRdCost->getMotionCost ( 1, 0 );
    42594306 
     
    42804327    if( bMultiviewReg && !bBi )
    42814328    {
     4329#if DV_V_RESTRICTION_B0037
     4330      xSetSearchRange( pcCU, cOrgDepthMapMv, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, iVerDispSrchRng  );
     4331#else
    42824332      xSetSearchRange( pcCU, cOrgDepthMapMv, iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
    4283     }
    4284   }
    4285 #endif
    4286 
     4333#endif
     4334    }
     4335  }
     4336#endif
     4337#if QC_MVHEVC_B0046
     4338  m_pcRdCost->setMultiviewReg( 0 );
     4339#endif
    42874340  setWpScalingDistParam( pcCU, iRefIdxPred, eRefPicList );
    42884341  //  Do integer search
     
    43304383}
    43314384
    4332 
     4385#if DV_V_RESTRICTION_B0037
     4386Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB, Bool bMv_VRng_Restricted, Int iVerDispSrchRng )
     4387#else
    43334388Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB )
     4389#endif
    43344390{
    43354391  Int  iMvShift = 2;
     
    43464402  rcMvSrchRngRB.setHor( cTmpMvPred.getHor() + (iSrchRng << iMvShift) );
    43474403  rcMvSrchRngRB.setVer( cTmpMvPred.getVer() + (iSrchRng << iMvShift) );
     4404
     4405#if DV_V_RESTRICTION_B0037
     4406  if ( bMv_VRng_Restricted ) {
     4407    Int iRestrictMvVrange = ( iVerDispSrchRng ) << iMvShift;   
     4408    if ( rcMvSrchRngRB.getVer() >= iRestrictMvVrange  ){
     4409      rcMvSrchRngRB.setVer( iRestrictMvVrange );
     4410    }
     4411    //restrict minus vector too
     4412    if ( rcMvSrchRngLT.getVer() <= -iRestrictMvVrange ){
     4413      rcMvSrchRngLT.setVer( -iRestrictMvVrange );
     4414    }
     4415  }
     4416#endif
    43484417  pcCU->clipMv        ( rcMvSrchRngLT );
    43494418  pcCU->clipMv        ( rcMvSrchRngRB );
     
    64156484
    64166485#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     6486#if ((HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX)&&FLEX_CODING_ORDER_M23723)
     6487Bool TEncSearch::predIntraLumaDMMAvailable( UInt uiMode, UInt uiWidth, UInt uiHeight, Bool bDMMAvailable34 )
     6488#else
    64176489Bool TEncSearch::predIntraLumaDMMAvailable( UInt uiMode, UInt uiWidth, UInt uiHeight )
     6490#endif
    64186491{
    64196492  if( uiMode < NUM_INTRA_MODE ) return true;
     
    64436516      bDMMAvailable = false;
    64446517    }
     6518
     6519#if FLEX_CODING_ORDER_M23723
     6520    if ( !bDMMAvailable34 )
     6521    {
     6522      bDMMAvailable = false;
     6523    }
     6524#endif
     6525
    64456526  }
    64466527#endif
  • trunk/source/Lib/TLibEncoder/TEncSearch.h

    r189 r210  
    9494  Int             m_iSearchRange;
    9595  Int             m_bipredSearchRange; // Search range for bi-prediction
     96#if DV_V_RESTRICTION_B0037
     97  Bool            m_bUseDisparitySearchRangeRestriction;
     98  Int             m_iVerticalDisparitySearchRange;
     99#endif
    96100  Int             m_iFastSearch;
    97101  Int             m_aaiAdaptSR[2][33];
     
    132136            Int           iSearchRange,
    133137            Int           bipredSearchRange,
     138#if DV_V_RESTRICTION_B0037
     139            Bool          bUseDisparitySearchRangeRestriction,
     140            Int           iVerticalDisparitySearchRange,
     141#endif
    134142            Int           iFastSearch,
    135143            Int           iMaxDeltaQP,
     
    325333
    326334#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     335
    327336  Bool predIntraLumaDMMAvailable  ( UInt           uiMode,
    328337                                    UInt           uiWidth,
    329                                     UInt           uiHeight );
     338#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
     339                                    UInt         uiHeight,
     340                                    Bool         bDMMAvailable34 );
     341#else
     342                                    UInt         uiHeight );
     343#endif
     344
    330345  Void xGetWedgeDeltaDCsMinDist   ( TComWedgelet*  pcWedgelet,
    331346                                    TComDataCU*    pcCU,
     
    523538                                    UInt&         ruiSAD );
    524539 
     540#if DV_V_RESTRICTION_B0037
     541  Void xSetSearchRange            ( TComDataCU*   pcCU,
     542                                    TComMv&       cMvPred,
     543                                    Int           iSrchRng,
     544                                    TComMv&       rcMvSrchRngLT,
     545                                    TComMv&       rcMvSrchRngRB,
     546                                    Bool          bDispSrchRngRst,
     547                                    Int           iDispVerSrchRng );
     548#else
    525549  Void xSetSearchRange            ( TComDataCU*   pcCU,
    526550                                    TComMv&       cMvPred,
     
    528552                                    TComMv&       rcMvSrchRngLT,
    529553                                    TComMv&       rcMvSrchRngRB );
     554#endif
    530555 
    531556  Void xPatternSearchFast         ( TComDataCU*   pcCU,
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r189 r210  
    162162 \param pPPS          PPS associated with the slice
    163163 */
    164 #if VIDYO_VPS_INTEGRATION
     164#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    165165Void TEncSlice::initEncSlice( TComPic* pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS * pVPS, TComSPS* pSPS, TComPPS *pPPS )
    166166#else
     
    172172 
    173173  rpcSlice = pcPic->getSlice(0);
    174 #if VIDYO_VPS_INTEGRATION
     174#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    175175  rpcSlice->setVPS( pVPS );
    176176#endif
     
    820820  UInt uiTileStartLCU = 0;
    821821  UInt uiTileLCUX     = 0;
    822 
     822#if !QC_MVHEVC_B0046
    823823  Int iLastPosY = -1;
    824 
     824#endif
    825825  // for every CU in slice
    826826  UInt uiEncCUOrder;
     
    833833    TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr );
    834834    pcCU->initCU( rpcPic, uiCUAddr );
    835 
     835#if !QC_MVHEVC_B0046
    836836    if ( m_pcRdCost->getUseRenModel() )
    837837    {
     
    847847      }
    848848    }   
    849 
     849#endif
    850850    // inherit from TR if necessary, select substream to use.
    851851    if( m_pcCfg->getUseSBACRD() )
  • trunk/source/Lib/TLibEncoder/TEncSlice.h

    r189 r210  
    110110 
    111111  /// preparation of slice encoding (reference marking, QP and lambda)
    112 #if VIDYO_VPS_INTEGRATION
     112#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
    113113  Void    initEncSlice        ( TComPic*  pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS );
    114114#else
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r189 r210  
    375375 
    376376  // initialize encoder search class
     377#if DV_V_RESTRICTION_B0037
     378  m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_bUseDisparitySearchRangeRestriction, m_iVerticalDisparitySearchRange, m_iFastSearch, 0, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );
     379#else
    377380  m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, 0, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );
    378 
     381#endif
    379382  if(m_bUseALF)
    380383  {
     
    766769  m_cSPS.setUseDMM( m_bUseDMM );
    767770#endif
     771
     772#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723
     773  m_cSPS.setUseDMM34( m_bUseDMM34 );
     774#endif
     775
    768776#if OL_QTLIMIT_PREDCODING_B0068
    769777  m_cSPS.setUseQTLPC( m_bUseQTLPC );
     
    785793  else
    786794  {
     795#if QC_MVHEVC_B0046
     796    m_cSPS.initMultiviewSPS   ( m_viewId);
     797#else
    787798    m_cSPS.initMultiviewSPS           ( m_viewId, m_iViewOrderIdx, m_uiCamParPrecision, m_bCamParInSliceHeader, m_aaiCodedScale, m_aaiCodedOffset );
     799#endif
    788800    if( m_viewId )
    789801    {
     
    9931005Void TEncTop::selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid,TComList<TComPic*>& listPic )
    9941006{
     1007#if QC_REM_IDV_B0046
     1008  if( (slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR ||slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) && slice->getSPS()->getViewId() && POCCurr == 0 )
     1009#else
    9951010  if( slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV && POCCurr == 0 )
     1011#endif
    9961012  {
    9971013    TComReferencePictureSet* rps = slice->getLocalRPS();
Note: See TracChangeset for help on using the changeset viewer.