Changeset 550 in SHVCSoftware for branches/SHM-5.0-dev/source/Lib/TLibEncoder


Ignore:
Timestamp:
21 Jan 2014, 18:47:46 (11 years ago)
Author:
seregin
Message:

merge from trunk

Location:
branches/SHM-5.0-dev/source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-5.0-dev/source

  • branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r540 r550  
    669669  UInt numBytesInVps = this->m_pcBitIf->getNumberOfWrittenBits();
    670670#endif
     671#if VPS_VUI_OFFSET
     672   m_vpsVuiCounter = this->m_pcBitIf->getNumberOfWrittenBits();
     673#endif
    671674  WRITE_CODE( pcVPS->getVPSId(),                    4,        "vps_video_parameter_set_id" );
    672675  WRITE_CODE( 3,                                    2,        "vps_reserved_three_2bits" );
     
    795798
    796799  WRITE_FLAG( vps->getAvcBaseLayerFlag(),              "avc_base_layer_flag" );
     800#if O0109_MOVE_VPS_VUI_FLAG
     801#if !VPS_VUI
     802  WRITE_FLAG( 0,                     "vps_vui_present_flag" );
     803  vps->setVpsVuiPresentFlag(false);
     804#else
     805  WRITE_FLAG( 1,                     "vps_vui_present_flag" );
     806  vps->setVpsVuiPresentFlag(true);
     807#endif
     808  if ( vps->getVpsVuiPresentFlag() )
     809  {
     810#if VPS_VUI_OFFSET
     811    WRITE_CODE( vps->getVpsVuiOffset(  ), 16,             "vps_vui_offset" );
     812#endif
     813    WRITE_FLAG( vps->getSplittingFlag(),                 "splitting_flag" );
     814  }
     815#else
     816#if VPS_VUI_OFFSET
     817  WRITE_CODE( vps->getVpsVuiOffset(  ), 16,             "vps_vui_offset" ); 
     818#endif
    797819  WRITE_FLAG( vps->getSplittingFlag(),                 "splitting_flag" );
     820#endif // O0109_MOVE_VPS_VUI_FLAG
    798821
    799822  for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
     
    841864  //   However, this is a bug in the text since, view_id_len_minus1 is needed to parse view_id_val.
    842865  {
     866#if O0109_VIEW_ID_LEN
     867    WRITE_CODE( vps->getViewIdLen( ), 4, "view_id_len" );
     868    assert ( vps->getNumViews() >= (1<<vps->getViewIdLen()) );
     869#else
    843870    WRITE_CODE( vps->getViewIdLenMinus1( ), 4, "view_id_len_minus1" );
    844   }
    845 
     871#endif
     872  }
     873
     874#if O0109_VIEW_ID_LEN
     875  if ( vps->getViewIdLen() > 0 )
     876  {
     877#endif
    846878  for(  i = 0; i < vps->getNumViews(); i++ )
    847879  {
     880#if O0109_VIEW_ID_LEN
     881    WRITE_CODE( vps->getViewIdVal( i ), vps->getViewIdLen( ), "view_id_val[i]" );
     882#else
    848883    WRITE_CODE( vps->getViewIdVal( i ), vps->getViewIdLenMinus1( ) + 1, "view_id_val[i]" );
    849   }
    850 #endif
     884#endif
     885  }
     886#if O0109_VIEW_ID_LEN
     887  }
     888#endif
     889#endif // VIEW_ID_RELATED_SIGNALING
     890
    851891#if VPS_EXTN_DIRECT_REF_LAYERS
    852892  for( Int layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
     
    931971  if( numOutputLayerSets > 1 )
    932972  {
     973#if O0109_DEFAULT_ONE_OUT_LAYER_IDC
     974    WRITE_CODE( vps->getDefaultOneTargetOutputLayerIdc(), 2, "default_one_target_output_layer_idc" );   
     975#else
    933976    WRITE_FLAG( vps->getDefaultOneTargetOutputLayerFlag(), "default_one_target_output_layer_flag" );   
     977#endif
    934978  }
    935979
     
    10721116#endif
    10731117#endif
     1118
     1119#if !O0109_O0199_FLAGS_TO_VUI
    10741120#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    10751121  WRITE_FLAG(vps->getSingleLayerForNonIrapFlag(), "single_layer_for_non_irap_flag" );
     
    10781124  WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" );
    10791125#endif
    1080 
     1126#endif
     1127
     1128#if !O0109_MOVE_VPS_VUI_FLAG
    10811129#if !VPS_VUI
    10821130  WRITE_FLAG( 0,                     "vps_vui_present_flag" );
     
    10891137      WRITE_FLAG(1,                  "vps_vui_alignment_bit_equal_to_one");
    10901138    }
     1139#if VPS_VUI_OFFSET
     1140    Int vpsVuiOffsetValeInBits = this->m_pcBitIf->getNumberOfWrittenBits() - m_vpsVuiCounter + 16; // 2 bytes for NUH
     1141    assert( vpsVuiOffsetValeInBits % 8 == 0 );
     1142    vps->setVpsVuiOffset( vpsVuiOffsetValeInBits >> 3 );
     1143#endif
    10911144    codeVPSVUI(vps); 
    10921145  }
    10931146#endif
     1147#else
     1148  if(vps->getVpsVuiPresentFlag())   // Should be conditioned on the value of vps_vui_present_flag
     1149  {
     1150    while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
     1151    {
     1152      WRITE_FLAG(1,                  "vps_vui_alignment_bit_equal_to_one");
     1153    }
     1154#if VPS_VUI_OFFSET
     1155    Int vpsVuiOffsetValeInBits = this->m_pcBitIf->getNumberOfWrittenBits() - m_vpsVuiCounter + 16; // 2 bytes for NUH
     1156    assert( vpsVuiOffsetValeInBits % 8 == 0 );
     1157    vps->setVpsVuiOffset( vpsVuiOffsetValeInBits >> 3 );
     1158#endif
     1159    codeVPSVUI(vps); 
     1160  }
     1161#endif // 0109_MOVE_VPS_FLAG
    10941162}
    10951163#endif
     
    12251293    }
    12261294  }
     1295#endif
     1296
     1297#if O0109_O0199_FLAGS_TO_VUI
     1298#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     1299  WRITE_FLAG(vps->getSingleLayerForNonIrapFlag(), "single_layer_for_non_irap_flag" );
     1300#endif
     1301#if HIGHER_LAYER_IRAP_SKIP_FLAG
     1302  WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" );
     1303#endif
    12271304#endif
    12281305#if N0160_VUI_EXT_ILP_REF
  • branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.h

    r540 r550  
    6868  TComSlice*    m_pcSlice;
    6969  UInt          m_uiCoeffCost;
    70 
     70#if VPS_VUI_OFFSET
     71  Int m_vpsVuiCounter;
     72#endif
    7173  Void codeShortTermRefPicSet              ( TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx );
    7274  Bool findMatchingLTRP ( TComSlice* pcSlice, UInt *ltrpsIndex, Int ltrpPOC, Bool usedFlag );
  • branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r549 r550  
    17531753      OutputNALUnit nalu(NAL_UNIT_VPS);
    17541754#endif
     1755#if VPS_VUI_OFFSET
     1756      // The following code also calculates the VPS VUI offset
     1757#endif
    17551758#if VPS_EXTN_OFFSET_CALC
    17561759      OutputNALUnit tempNalu(NAL_UNIT_VPS, 0, 0        ); // The value of nuh_layer_id of VPS NAL unit shall be equal to 0.
Note: See TracChangeset for help on using the changeset viewer.