Ignore:
Timestamp:
26 Nov 2012, 18:35:20 (12 years ago)
Author:
qualcomm
Message:

JCT3V-B0046, MVHEVC codec;
Two bugs fixed for HTM:
1) encoder crash, see the macro 'BUG_FIX_HTM'
2) wrong place for '#endif' in TComPrediction.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-5.0-Qualcomm/source/Lib/TLibEncoder/TEncCavlc.cpp

    r189 r194  
    375375}
    376376
     377#if MVHEVC
     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 !MVHEVC
    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 MVHEVC
     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
     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
     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();
Note: See TracChangeset for help on using the changeset viewer.