当前位置: 首页>>代码示例>>C++>>正文


C++ BitVector::getBits方法代码示例

本文整理汇总了C++中BitVector::getBits方法的典型用法代码示例。如果您正苦于以下问题:C++ BitVector::getBits方法的具体用法?C++ BitVector::getBits怎么用?C++ BitVector::getBits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BitVector的用法示例。


在下文中一共展示了BitVector::getBits方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void H264VideoStreamParser::analyze_hrd_parameters(BitVector& bv) {
  DEBUG_STR("BEGIN hrd_parameters");
  unsigned cpb_cnt_minus1 = bv.get_expGolomb();
  DEBUG_PRINT(cpb_cnt_minus1);
  unsigned bit_rate_scale = bv.getBits(4);
  DEBUG_PRINT(bit_rate_scale);
  unsigned cpb_size_scale = bv.getBits(4);
  DEBUG_PRINT(cpb_size_scale);
  for (unsigned SchedSelIdx = 0; SchedSelIdx <= cpb_cnt_minus1; ++SchedSelIdx) {
    DEBUG_TAB;
    unsigned bit_rate_value_minus1 = bv.get_expGolomb();
    DEBUG_PRINT(bit_rate_value_minus1);
    unsigned cpb_size_value_minus1 = bv.get_expGolomb();
    DEBUG_PRINT(cpb_size_value_minus1);
    unsigned cbr_flag = bv.get1Bit();
    DEBUG_PRINT(cbr_flag);
  }
  unsigned initial_cpb_removal_delay_length_minus1 = bv.getBits(5);
  DEBUG_PRINT(initial_cpb_removal_delay_length_minus1);
  unsigned cpb_removal_delay_length_minus1 = bv.getBits(5);
  DEBUG_PRINT(cpb_removal_delay_length_minus1);
  unsigned dpb_output_delay_length_minus1 = bv.getBits(5);
  DEBUG_PRINT(dpb_output_delay_length_minus1);
  unsigned time_offset_length = bv.getBits(5);
  DEBUG_PRINT(time_offset_length);
  DEBUG_STR("END hrd_parameters");
}
开发者ID:CastleSpace,项目名称:live555,代码行数:27,代码来源:H264VideoStreamFramer.cpp

示例2:

void H264or5VideoStreamParser
::analyze_vui_parameters(BitVector& bv,
			 unsigned& num_units_in_tick, unsigned& time_scale) {
  Boolean aspect_ratio_info_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(aspect_ratio_info_present_flag);
  if (aspect_ratio_info_present_flag) {
    DEBUG_TAB;
    unsigned aspect_ratio_idc = bv.getBits(8);
    DEBUG_PRINT(aspect_ratio_idc);
    if (aspect_ratio_idc == 255/*Extended_SAR*/) {
      bv.skipBits(32); // sar_width; sar_height
    }
  }
  Boolean overscan_info_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(overscan_info_present_flag);
  if (overscan_info_present_flag) {
    bv.skipBits(1); // overscan_appropriate_flag
  }
  Boolean video_signal_type_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(video_signal_type_present_flag);
  if (video_signal_type_present_flag) {
    DEBUG_TAB;
    bv.skipBits(4); // video_format; video_full_range_flag
    Boolean colour_description_present_flag = bv.get1BitBoolean();
    DEBUG_PRINT(colour_description_present_flag);
    if (colour_description_present_flag) {
      bv.skipBits(24); // colour_primaries; transfer_characteristics; matrix_coefficients
    }
  }
  Boolean chroma_loc_info_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(chroma_loc_info_present_flag);
  if (chroma_loc_info_present_flag) {
    (void)bv.get_expGolomb(); // chroma_sample_loc_type_top_field
    (void)bv.get_expGolomb(); // chroma_sample_loc_type_bottom_field
  }
  if (fHNumber == 265) {
    bv.skipBits(3); // neutral_chroma_indication_flag, field_seq_flag, frame_field_info_present_flag
    Boolean default_display_window_flag = bv.get1BitBoolean();
    DEBUG_PRINT(default_display_window_flag);
    if (default_display_window_flag) {
      (void)bv.get_expGolomb(); // def_disp_win_left_offset
      (void)bv.get_expGolomb(); // def_disp_win_right_offset
      (void)bv.get_expGolomb(); // def_disp_win_top_offset
      (void)bv.get_expGolomb(); // def_disp_win_bottom_offset
    }
  }
  Boolean timing_info_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(timing_info_present_flag);
  if (timing_info_present_flag) {
    DEBUG_TAB;
    num_units_in_tick = bv.getBits(32);
    DEBUG_PRINT(num_units_in_tick);
    time_scale = bv.getBits(32);
    DEBUG_PRINT(time_scale);
    if (fHNumber == 264) {
      Boolean fixed_frame_rate_flag = bv.get1BitBoolean();
      DEBUG_PRINT(fixed_frame_rate_flag);
    } else { // 265
      Boolean vui_poc_proportional_to_timing_flag = bv.get1BitBoolean();
      DEBUG_PRINT(vui_poc_proportional_to_timing_flag);
      if (vui_poc_proportional_to_timing_flag) {
	unsigned vui_num_ticks_poc_diff_one_minus1 = bv.get_expGolomb();
	DEBUG_PRINT(vui_num_ticks_poc_diff_one_minus1);
      }
    }
  }
}
开发者ID:AlphaPerfect,项目名称:live555,代码行数:67,代码来源:H264or5VideoStreamFramer.cpp

示例3:

void H264or5VideoStreamParser
::analyze_vui_parameters(BitVector& bv,
			 unsigned& num_units_in_tick, unsigned& time_scale) {
  Boolean aspect_ratio_info_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(aspect_ratio_info_present_flag);
  if (aspect_ratio_info_present_flag) {
    DEBUG_TAB;
    unsigned aspect_ratio_idc = bv.getBits(8);
    DEBUG_PRINT(aspect_ratio_idc);
    if (aspect_ratio_idc == 255/*Extended_SAR*/) {
      bv.skipBits(32); // sar_width; sar_height
    }
  }
  Boolean overscan_info_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(overscan_info_present_flag);
  if (overscan_info_present_flag) {
    bv.skipBits(1); // overscan_appropriate_flag
  }
  Boolean video_signal_type_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(video_signal_type_present_flag);
  if (video_signal_type_present_flag) {
    DEBUG_TAB;
    bv.skipBits(4); // video_format; video_full_range_flag
    Boolean colour_description_present_flag = bv.get1BitBoolean();
    DEBUG_PRINT(colour_description_present_flag);
    if (colour_description_present_flag) {
      bv.skipBits(24); // colour_primaries; transfer_characteristics; matrix_coefficients
    }
  }
  Boolean chroma_loc_info_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(chroma_loc_info_present_flag);
  if (chroma_loc_info_present_flag) {
    (void)bv.get_expGolomb(); // chroma_sample_loc_type_top_field
    (void)bv.get_expGolomb(); // chroma_sample_loc_type_bottom_field
  }
  if (fHNumber == 265) {
    bv.skipBits(2); // neutral_chroma_indication_flag, field_seq_flag
    Boolean frame_field_info_present_flag = bv.get1BitBoolean();
    DEBUG_PRINT(frame_field_info_present_flag);
    pic_struct_present_flag = frame_field_info_present_flag; // hack to make H.265 like H.264
    Boolean default_display_window_flag = bv.get1BitBoolean();
    DEBUG_PRINT(default_display_window_flag);
    if (default_display_window_flag) {
      (void)bv.get_expGolomb(); // def_disp_win_left_offset
      (void)bv.get_expGolomb(); // def_disp_win_right_offset
      (void)bv.get_expGolomb(); // def_disp_win_top_offset
      (void)bv.get_expGolomb(); // def_disp_win_bottom_offset
    }
  }
  Boolean timing_info_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(timing_info_present_flag);
  if (timing_info_present_flag) {
    DEBUG_TAB;
    num_units_in_tick = bv.getBits(32);
    DEBUG_PRINT(num_units_in_tick);
    time_scale = bv.getBits(32);
    DEBUG_PRINT(time_scale);
    if (fHNumber == 264) {
      Boolean fixed_frame_rate_flag = bv.get1BitBoolean();
      DEBUG_PRINT(fixed_frame_rate_flag);
    } else { // 265
      Boolean vui_poc_proportional_to_timing_flag = bv.get1BitBoolean();
      DEBUG_PRINT(vui_poc_proportional_to_timing_flag);
      if (vui_poc_proportional_to_timing_flag) {
	unsigned vui_num_ticks_poc_diff_one_minus1 = bv.get_expGolomb();
	DEBUG_PRINT(vui_num_ticks_poc_diff_one_minus1);
      }
      return; // For H.265, don't bother parsing any more of this #####
    }
  }
  // The following is H.264 only: #####
  Boolean nal_hrd_parameters_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(nal_hrd_parameters_present_flag);
  if (nal_hrd_parameters_present_flag) analyze_hrd_parameters(bv);
  Boolean vcl_hrd_parameters_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(vcl_hrd_parameters_present_flag);
  if (vcl_hrd_parameters_present_flag) analyze_hrd_parameters(bv);
  CpbDpbDelaysPresentFlag = nal_hrd_parameters_present_flag || vcl_hrd_parameters_present_flag;
  if (CpbDpbDelaysPresentFlag) {
    bv.skipBits(1); // low_delay_hrd_flag
  }
  pic_struct_present_flag = bv.get1BitBoolean();
  DEBUG_PRINT(pic_struct_present_flag);
}
开发者ID:CrazyXStudio,项目名称:live555,代码行数:84,代码来源:H264or5VideoStreamFramer.cpp


注:本文中的BitVector::getBits方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。