Main Page | Data Structures | File List | Data Fields | Globals

h264_stream.c File Reference

#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "bs.h"
#include "h264_stream.h"

Include dependency graph for h264_stream.c:

Go to the source code of this file.

Defines

#define log2(x)   ( (1/log(2)) * log( (x) ) )
#define DBG_START
#define DBG_END
#define DBG

Functions

h264_stream_th264_new ()
void h264_free (h264_stream_t *h)
int find_nal_unit (uint8_t *buf, int size, int *nal_start, int *nal_end)
int more_rbsp_data (h264_stream_t *h, bs_t *b)
uint32_t next_bits (bs_t *b, int n)
int read_nal_unit (h264_stream_t *h, uint8_t *buf, int size)
void read_seq_parameter_set_rbsp (h264_stream_t *h, bs_t *b)
void read_scaling_list (bs_t *b, int *scalingList, int sizeOfScalingList, int useDefaultScalingMatrixFlag)
void read_vui_parameters (h264_stream_t *h, bs_t *b)
void read_hrd_parameters (h264_stream_t *h, bs_t *b)
void read_pic_parameter_set_rbsp (h264_stream_t *h, bs_t *b)
void read_access_unit_delimiter_rbsp (h264_stream_t *h, bs_t *b)
void read_end_of_seq_rbsp (h264_stream_t *h, bs_t *b)
void read_end_of_stream_rbsp (h264_stream_t *h, bs_t *b)
void read_filler_data_rbsp (h264_stream_t *h, bs_t *b)
void read_slice_layer_rbsp (h264_stream_t *h, bs_t *b)
int more_rbsp_trailing_data (h264_stream_t *h, bs_t *b)
void read_rbsp_slice_trailing_bits (h264_stream_t *h, bs_t *b)
void read_rbsp_trailing_bits (h264_stream_t *h, bs_t *b)
void read_slice_header (h264_stream_t *h, bs_t *b)
void read_ref_pic_list_reordering (h264_stream_t *h, bs_t *b)
void read_pred_weight_table (h264_stream_t *h, bs_t *b)
void read_dec_ref_pic_marking (h264_stream_t *h, bs_t *b)
int write_nal_unit (h264_stream_t *h, uint8_t *buf, int size)
void write_seq_parameter_set_rbsp (h264_stream_t *h, bs_t *b)
void write_scaling_list (bs_t *b, int *scalingList, int sizeOfScalingList, int useDefaultScalingMatrixFlag)
void write_vui_parameters (h264_stream_t *h, bs_t *b)
void write_hrd_parameters (h264_stream_t *h, bs_t *b)
void write_pic_parameter_set_rbsp (h264_stream_t *h, bs_t *b)
void write_access_unit_delimiter_rbsp (h264_stream_t *h, bs_t *b)
void write_end_of_seq_rbsp (h264_stream_t *h, bs_t *b)
void write_end_of_stream_rbsp (h264_stream_t *h, bs_t *b)
void write_filler_data_rbsp (h264_stream_t *h, bs_t *b)
void write_slice_layer_rbsp (h264_stream_t *h, bs_t *b)
void write_rbsp_slice_trailing_bits (h264_stream_t *h, bs_t *b)
void write_rbsp_trailing_bits (h264_stream_t *h, bs_t *b)
void write_slice_header (h264_stream_t *h, bs_t *b)
void write_ref_pic_list_reordering (h264_stream_t *h, bs_t *b)
void write_pred_weight_table (h264_stream_t *h, bs_t *b)
void write_dec_ref_pic_marking (h264_stream_t *h, bs_t *b)
void debug_sps (sps_t *sps)
void debug_pps (pps_t *pps)
void debug_slice_header (slice_header_t *sh)
void debug_nal (h264_stream_t *h, nal_t *nal)
void debug_bytes (uint8_t *buf, int len)
void debug_bs (bs_t *b)


Define Documentation

#define DBG
 

Value:

printf("line %d:",  __LINE__ ); \
  debug_bs(b); \
  b2->p = b2->start; b2->bits_left = 8; \
  /* read_slice_header(h2, b2); */\
  /* if (h2->sh->drpm.adaptive_ref_pic_marking_mode_flag) { printf(" X"); }; */ \
  printf("\n"); \

Definition at line 959 of file h264_stream.c.

#define DBG_END
 

Value:

free(h2); \
    free(b2); \

Definition at line 955 of file h264_stream.c.

#define DBG_START
 

Value:

bs_t* b2 = (bs_t*)malloc(sizeof(bs_t)); \
    bs_init(b2, b->p, b->end - b->p); \
    h264_stream_t* h2 = (h264_stream_t*)malloc(sizeof(h264_stream_t));\
    h2->sps=h->sps; h2->pps=h->pps; h2->nal=h->nal; h2->sh=h->sh;  \

Definition at line 949 of file h264_stream.c.

#define log2  )     ( (1/log(2)) * log( (x) ) )
 

Definition at line 31 of file h264_stream.c.

Referenced by read_pic_parameter_set_rbsp(), read_slice_header(), write_pic_parameter_set_rbsp(), and write_slice_header().


Function Documentation

void debug_bs bs_t b  ) 
 

Definition at line 2027 of file h264_stream.c.

References bs_t::bits_left, bs_init(), bs_read_u1(), bs_t::end, bs_t::p, and bs_t::start.

Here is the call graph for this function:

void debug_bytes uint8_t *  buf,
int  len
 

Definition at line 2016 of file h264_stream.c.

void debug_nal h264_stream_t h,
nal_t nal
 

Print the contents of a NAL unit to standard output. The NAL which is printed out has a type determined by nal and data which comes from other fields within h depending on its type.

Parameters:
[in] h the stream object
[in] nal the nal unit

Definition at line 2000 of file h264_stream.c.

References debug_pps(), debug_slice_header(), debug_sps(), nal_t::forbidden_zero_bit, nal_t::nal_ref_idc, nal_t::nal_unit_type, h264_stream_t::pps, h264_stream_t::sh, and h264_stream_t::sps.

Referenced by main().

Here is the call graph for this function:

void debug_pps pps_t pps  ) 
 

Definition at line 1891 of file h264_stream.c.

References pps_t::chroma_qp_index_offset, pps_t::constrained_intra_pred_flag, pps_t::deblocking_filter_control_present_flag, pps_t::entropy_coding_mode_flag, pps_t::num_ref_idx_l0_active_minus1, pps_t::num_ref_idx_l1_active_minus1, pps_t::num_slice_groups_minus1, pps_t::pic_init_qp_minus26, pps_t::pic_init_qs_minus26, pps_t::pic_order_present_flag, pps_t::pic_parameter_set_id, pps_t::pic_scaling_matrix_present_flag, pps_t::redundant_pic_cnt_present_flag, pps_t::second_chroma_qp_index_offset, pps_t::seq_parameter_set_id, pps_t::slice_group_map_type, pps_t::transform_8x8_mode_flag, pps_t::weighted_bipred_idc, and pps_t::weighted_pred_flag.

Referenced by debug_nal().

void debug_slice_header slice_header_t sh  ) 
 

Definition at line 1927 of file h264_stream.c.

References slice_header_t::bottom_field_flag, slice_header_t::cabac_init_idc, slice_header_t::delta_pic_order_cnt_bottom, slice_header_t::direct_spatial_mv_pred_flag, slice_header_t::disable_deblocking_filter_idc, slice_header_t::drpm, slice_header_t::field_pic_flag, slice_header_t::first_mb_in_slice, slice_header_t::frame_num, slice_header_t::idr_pic_id, slice_header_t::num_ref_idx_active_override_flag, slice_header_t::num_ref_idx_l0_active_minus1, slice_header_t::num_ref_idx_l1_active_minus1, slice_header_t::pic_order_cnt_lsb, slice_header_t::pic_parameter_set_id, slice_header_t::pwt, slice_header_t::redundant_pic_cnt, slice_header_t::rplr, SH_SLICE_TYPE_B, SH_SLICE_TYPE_I, SH_SLICE_TYPE_P, slice_header_t::slice_alpha_c0_offset_div2, slice_header_t::slice_beta_offset_div2, slice_header_t::slice_group_change_cycle, slice_header_t::slice_qp_delta, slice_header_t::slice_qs_delta, slice_header_t::slice_type, and slice_header_t::sp_for_switch_flag.

Referenced by debug_nal().

void debug_sps sps_t sps  ) 
 

Definition at line 1799 of file h264_stream.c.

References sps_t::bit_depth_chroma_minus8, sps_t::bit_depth_luma_minus8, sps_t::chroma_format_idc, sps_t::constraint_set0_flag, sps_t::constraint_set1_flag, sps_t::constraint_set2_flag, sps_t::constraint_set3_flag, sps_t::delta_pic_order_always_zero_flag, sps_t::direct_8x8_inference_flag, sps_t::frame_crop_bottom_offset, sps_t::frame_crop_left_offset, sps_t::frame_crop_right_offset, sps_t::frame_crop_top_offset, sps_t::frame_cropping_flag, sps_t::frame_mbs_only_flag, sps_t::gaps_in_frame_num_value_allowed_flag, sps_t::hrd, sps_t::level_idc, sps_t::log2_max_frame_num_minus4, sps_t::log2_max_pic_order_cnt_lsb_minus4, sps_t::mb_adaptive_frame_field_flag, sps_t::num_ref_frames, sps_t::num_ref_frames_in_pic_order_cnt_cycle, sps_t::offset_for_non_ref_pic, sps_t::offset_for_top_to_bottom_field, sps_t::pic_height_in_map_units_minus1, sps_t::pic_order_cnt_type, sps_t::pic_width_in_mbs_minus1, sps_t::profile_idc, sps_t::qpprime_y_zero_transform_bypass_flag, sps_t::reserved_zero_4bits, sps_t::residual_colour_transform_flag, sps_t::seq_parameter_set_id, sps_t::seq_scaling_matrix_present_flag, sps_t::vui, and sps_t::vui_parameters_present_flag.

Referenced by debug_nal().

int find_nal_unit uint8_t *  buf,
int  size,
int *  nal_start,
int *  nal_end
 

Find the beginning and end of a NAL (Network Abstraction Layer) unit in a byte buffer containing H264 bitstream data.

Parameters:
[in] buf the buffer
[in] size the size of the buffer
[out] nal_start the beginning offset of the nal
[out] nal_end the end offset of the nal
Returns:
the length of the nal, or 0 if did not find start of nal, or -1 if did not find end of nal

Definition at line 73 of file h264_stream.c.

Referenced by main().

void h264_free h264_stream_t h  ) 
 

Free an existing H264 stream object. Frees all contained structures.

Parameters:
[in,out] h the stream object

Definition at line 55 of file h264_stream.c.

References h264_stream_t::nal, h264_stream_t::pps, h264_stream_t::sh, and h264_stream_t::sps.

h264_stream_t* h264_new  ) 
 

Create a new H264 stream object. Allocates all structures contained within it.

Returns:
the stream object

Definition at line 40 of file h264_stream.c.

References h264_stream_t::nal, h264_stream_t::pps, h264_stream_t::sh, and h264_stream_t::sps.

int more_rbsp_data h264_stream_t h,
bs_t b
 

Definition at line 114 of file h264_stream.c.

References bs_eof().

Referenced by read_pic_parameter_set_rbsp(), and write_pic_parameter_set_rbsp().

Here is the call graph for this function:

int more_rbsp_trailing_data h264_stream_t h,
bs_t b
 

Definition at line 618 of file h264_stream.c.

References bs_eof().

Referenced by read_rbsp_slice_trailing_bits(), and write_rbsp_slice_trailing_bits().

Here is the call graph for this function:

uint32_t next_bits bs_t b,
int  n
 

Definition at line 116 of file h264_stream.c.

Referenced by read_filler_data_rbsp(), and write_filler_data_rbsp().

void read_access_unit_delimiter_rbsp h264_stream_t h,
bs_t b
 

Definition at line 546 of file h264_stream.c.

References bs_read_u(), and read_rbsp_trailing_bits().

Referenced by read_nal_unit().

Here is the call graph for this function:

void read_dec_ref_pic_marking h264_stream_t h,
bs_t b
 

Definition at line 860 of file h264_stream.c.

References bs_eof(), bs_read_u1(), bs_read_ue(), slice_header_t::drpm, h264_stream_t::nal, nal_t::nal_unit_type, and h264_stream_t::sh.

Referenced by read_slice_header().

Here is the call graph for this function:

void read_end_of_seq_rbsp h264_stream_t h,
bs_t b
 

Definition at line 553 of file h264_stream.c.

Referenced by read_nal_unit().

void read_end_of_stream_rbsp h264_stream_t h,
bs_t b
 

Definition at line 558 of file h264_stream.c.

Referenced by read_nal_unit().

void read_filler_data_rbsp h264_stream_t h,
bs_t b
 

Definition at line 563 of file h264_stream.c.

References bs_read_f(), next_bits(), and read_rbsp_trailing_bits().

Here is the call graph for this function:

void read_hrd_parameters h264_stream_t h,
bs_t b
 

Definition at line 391 of file h264_stream.c.

References bs_read_u(), bs_read_u1(), bs_read_ue(), sps_t::hrd, and h264_stream_t::sps.

Referenced by read_vui_parameters().

Here is the call graph for this function:

int read_nal_unit h264_stream_t h,
uint8_t *  buf,
int  size
 

Read a NAL unit from a byte buffer. The buffer must start exactly at the beginning of the nal (after the start prefix). The NAL is read into h->nal and into other fields within h depending on its type (check h->nal->nal_unit_type after reading).

Parameters:
[in,out] h the stream object
[in] buf the buffer
[in] size the size of the buffer
Returns:
the length of data actually read

Definition at line 129 of file h264_stream.c.

References bs_init(), bs_read_f(), bs_read_u(), nal_t::forbidden_zero_bit, h264_stream_t::nal, nal_t::nal_ref_idc, nal_t::nal_unit_type, read_access_unit_delimiter_rbsp(), read_end_of_seq_rbsp(), read_end_of_stream_rbsp(), read_pic_parameter_set_rbsp(), read_seq_parameter_set_rbsp(), and read_slice_layer_rbsp().

Referenced by main().

Here is the call graph for this function:

void read_pic_parameter_set_rbsp h264_stream_t h,
bs_t b
 

Definition at line 430 of file h264_stream.c.

References pps_t::bottom_right, bs_read_se(), bs_read_u(), bs_read_u1(), bs_read_ue(), pps_t::chroma_qp_index_offset, pps_t::constrained_intra_pred_flag, pps_t::deblocking_filter_control_present_flag, pps_t::entropy_coding_mode_flag, log2, more_rbsp_data(), pps_t::num_ref_idx_l0_active_minus1, pps_t::num_ref_idx_l1_active_minus1, pps_t::num_slice_groups_minus1, pps_t::pic_init_qp_minus26, pps_t::pic_init_qs_minus26, pps_t::pic_order_present_flag, pps_t::pic_parameter_set_id, pps_t::pic_scaling_list_present_flag, pps_t::pic_scaling_matrix_present_flag, pps_t::pic_size_in_map_units_minus1, h264_stream_t::pps, read_rbsp_trailing_bits(), read_scaling_list(), pps_t::redundant_pic_cnt_present_flag, pps_t::run_length_minus1, pps_t::ScalingList4x4, pps_t::ScalingList8x8, pps_t::second_chroma_qp_index_offset, pps_t::seq_parameter_set_id, pps_t::slice_group_change_direction_flag, pps_t::slice_group_change_rate_minus1, pps_t::slice_group_id, pps_t::slice_group_map_type, pps_t::top_left, pps_t::transform_8x8_mode_flag, pps_t::UseDefaultScalingMatrix4x4Flag, pps_t::UseDefaultScalingMatrix8x8Flag, pps_t::weighted_bipred_idc, and pps_t::weighted_pred_flag.

Referenced by read_nal_unit().

Here is the call graph for this function:

void read_pred_weight_table h264_stream_t h,
bs_t b
 

Definition at line 799 of file h264_stream.c.

References bs_read_se(), bs_read_u1(), bs_read_ue(), sps_t::chroma_format_idc, pps_t::num_ref_idx_l0_active_minus1, pps_t::num_ref_idx_l1_active_minus1, h264_stream_t::pps, slice_header_t::pwt, h264_stream_t::sh, SH_SLICE_TYPE_B, slice_header_t::slice_type, and h264_stream_t::sps.

Referenced by read_slice_header().

Here is the call graph for this function:

void read_rbsp_slice_trailing_bits h264_stream_t h,
bs_t b
 

Definition at line 621 of file h264_stream.c.

References bs_read_f(), pps_t::entropy_coding_mode_flag, more_rbsp_trailing_data(), h264_stream_t::pps, and read_rbsp_trailing_bits().

Here is the call graph for this function:

void read_rbsp_trailing_bits h264_stream_t h,
bs_t b
 

Definition at line 635 of file h264_stream.c.

References bs_byte_aligned(), and bs_read_f().

Referenced by read_access_unit_delimiter_rbsp(), read_filler_data_rbsp(), read_pic_parameter_set_rbsp(), read_rbsp_slice_trailing_bits(), and read_seq_parameter_set_rbsp().

Here is the call graph for this function:

void read_ref_pic_list_reordering h264_stream_t h,
bs_t b
 

Definition at line 752 of file h264_stream.c.

References bs_eof(), bs_read_u1(), bs_read_ue(), slice_header_t::rplr, h264_stream_t::sh, SH_SLICE_TYPE_B, SH_SLICE_TYPE_I, SH_SLICE_TYPE_SI, and slice_header_t::slice_type.

Referenced by read_slice_header().

Here is the call graph for this function:

void read_scaling_list bs_t b,
int *  scalingList,
int  sizeOfScalingList,
int  useDefaultScalingMatrixFlag
 

Definition at line 296 of file h264_stream.c.

References bs_read_se().

Referenced by read_pic_parameter_set_rbsp(), and read_seq_parameter_set_rbsp().

Here is the call graph for this function:

void read_seq_parameter_set_rbsp h264_stream_t h,
bs_t b
 

Definition at line 204 of file h264_stream.c.

References sps_t::bit_depth_chroma_minus8, sps_t::bit_depth_luma_minus8, bs_read_se(), bs_read_u(), bs_read_u1(), bs_read_u8(), bs_read_ue(), sps_t::chroma_format_idc, sps_t::constraint_set0_flag, sps_t::constraint_set1_flag, sps_t::constraint_set2_flag, sps_t::constraint_set3_flag, sps_t::delta_pic_order_always_zero_flag, sps_t::direct_8x8_inference_flag, sps_t::frame_crop_bottom_offset, sps_t::frame_crop_left_offset, sps_t::frame_crop_right_offset, sps_t::frame_crop_top_offset, sps_t::frame_cropping_flag, sps_t::frame_mbs_only_flag, sps_t::gaps_in_frame_num_value_allowed_flag, sps_t::level_idc, sps_t::log2_max_frame_num_minus4, sps_t::log2_max_pic_order_cnt_lsb_minus4, sps_t::mb_adaptive_frame_field_flag, sps_t::num_ref_frames, sps_t::num_ref_frames_in_pic_order_cnt_cycle, sps_t::offset_for_non_ref_pic, sps_t::offset_for_ref_frame, sps_t::offset_for_top_to_bottom_field, sps_t::pic_height_in_map_units_minus1, sps_t::pic_order_cnt_type, sps_t::pic_width_in_mbs_minus1, sps_t::profile_idc, sps_t::qpprime_y_zero_transform_bypass_flag, read_rbsp_trailing_bits(), read_scaling_list(), read_vui_parameters(), sps_t::reserved_zero_4bits, sps_t::residual_colour_transform_flag, sps_t::ScalingList4x4, sps_t::ScalingList8x8, sps_t::seq_parameter_set_id, sps_t::seq_scaling_list_present_flag, sps_t::seq_scaling_matrix_present_flag, h264_stream_t::sps, sps_t::UseDefaultScalingMatrix4x4Flag, sps_t::UseDefaultScalingMatrix8x8Flag, and sps_t::vui_parameters_present_flag.

Referenced by read_nal_unit().

Here is the call graph for this function:

void read_slice_header h264_stream_t h,
bs_t b
 

Definition at line 650 of file h264_stream.c.

References slice_header_t::bottom_field_flag, bs_read_se(), bs_read_u(), bs_read_u1(), bs_read_ue(), slice_header_t::cabac_init_idc, pps_t::deblocking_filter_control_present_flag, sps_t::delta_pic_order_always_zero_flag, slice_header_t::delta_pic_order_cnt, slice_header_t::delta_pic_order_cnt_bottom, slice_header_t::direct_spatial_mv_pred_flag, slice_header_t::disable_deblocking_filter_idc, pps_t::entropy_coding_mode_flag, slice_header_t::field_pic_flag, slice_header_t::first_mb_in_slice, sps_t::frame_mbs_only_flag, slice_header_t::frame_num, slice_header_t::idr_pic_id, log2, sps_t::log2_max_frame_num_minus4, sps_t::log2_max_pic_order_cnt_lsb_minus4, h264_stream_t::nal, nal_t::nal_ref_idc, nal_t::nal_unit_type, slice_header_t::num_ref_idx_active_override_flag, slice_header_t::num_ref_idx_l0_active_minus1, slice_header_t::num_ref_idx_l1_active_minus1, pps_t::num_slice_groups_minus1, slice_header_t::pic_order_cnt_lsb, sps_t::pic_order_cnt_type, pps_t::pic_order_present_flag, slice_header_t::pic_parameter_set_id, pps_t::pic_size_in_map_units_minus1, h264_stream_t::pps, read_dec_ref_pic_marking(), read_pred_weight_table(), read_ref_pic_list_reordering(), slice_header_t::redundant_pic_cnt, pps_t::redundant_pic_cnt_present_flag, h264_stream_t::sh, SH_SLICE_TYPE_B, SH_SLICE_TYPE_I, SH_SLICE_TYPE_P, SH_SLICE_TYPE_SI, SH_SLICE_TYPE_SP, slice_header_t::slice_alpha_c0_offset_div2, slice_header_t::slice_beta_offset_div2, slice_header_t::slice_group_change_cycle, pps_t::slice_group_change_rate_minus1, pps_t::slice_group_map_type, slice_header_t::slice_qp_delta, slice_header_t::slice_qs_delta, slice_header_t::slice_type, slice_header_t::sp_for_switch_flag, h264_stream_t::sps, pps_t::weighted_bipred_idc, and pps_t::weighted_pred_flag.

Referenced by read_slice_layer_rbsp().

Here is the call graph for this function:

void read_slice_layer_rbsp h264_stream_t h,
bs_t b
 

Definition at line 574 of file h264_stream.c.

References read_slice_header().

Referenced by read_nal_unit().

Here is the call graph for this function:

void read_vui_parameters h264_stream_t h,
bs_t b
 

Definition at line 316 of file h264_stream.c.

References bs_read_u(), bs_read_u1(), bs_read_u8(), bs_read_ue(), read_hrd_parameters(), SAR_Extended, h264_stream_t::sps, and sps_t::vui.

Referenced by read_seq_parameter_set_rbsp().

Here is the call graph for this function:

void write_access_unit_delimiter_rbsp h264_stream_t h,
bs_t b
 

Definition at line 1399 of file h264_stream.c.

References bs_write_u(), and write_rbsp_trailing_bits().

Referenced by write_nal_unit().

Here is the call graph for this function:

void write_dec_ref_pic_marking h264_stream_t h,
bs_t b
 

Definition at line 1708 of file h264_stream.c.

References bs_write_u1(), bs_write_ue(), slice_header_t::drpm, h264_stream_t::nal, nal_t::nal_unit_type, and h264_stream_t::sh.

Referenced by write_slice_header().

Here is the call graph for this function:

void write_end_of_seq_rbsp h264_stream_t h,
bs_t b
 

Definition at line 1407 of file h264_stream.c.

Referenced by write_nal_unit().

void write_end_of_stream_rbsp h264_stream_t h,
bs_t b
 

Definition at line 1412 of file h264_stream.c.

Referenced by write_nal_unit().

void write_filler_data_rbsp h264_stream_t h,
bs_t b
 

Definition at line 1417 of file h264_stream.c.

References bs_write_f(), next_bits(), and write_rbsp_trailing_bits().

Here is the call graph for this function:

void write_hrd_parameters h264_stream_t h,
bs_t b
 

Definition at line 1246 of file h264_stream.c.

References bs_write_u(), bs_write_u1(), bs_write_ue(), sps_t::hrd, and h264_stream_t::sps.

Referenced by write_vui_parameters().

Here is the call graph for this function:

int write_nal_unit h264_stream_t h,
uint8_t *  buf,
int  size
 

Write a NAL unit to a byte buffer. The NAL which is written out has a type determined by h->nal and data which comes from other fields within h depending on its type.

Parameters:
[in,out] h the stream object
[out] buf the buffer
[in] size the size of the buffer
Returns:
the length of data actually written

Definition at line 976 of file h264_stream.c.

References bs_init(), bs_pos(), bs_write_f(), bs_write_u(), nal_t::forbidden_zero_bit, h264_stream_t::nal, nal_t::nal_ref_idc, nal_t::nal_unit_type, write_access_unit_delimiter_rbsp(), write_end_of_seq_rbsp(), write_end_of_stream_rbsp(), write_pic_parameter_set_rbsp(), write_seq_parameter_set_rbsp(), and write_slice_layer_rbsp().

Here is the call graph for this function:

void write_pic_parameter_set_rbsp h264_stream_t h,
bs_t b
 

Definition at line 1284 of file h264_stream.c.

References pps_t::bottom_right, bs_write_se(), bs_write_u(), bs_write_u1(), bs_write_ue(), pps_t::chroma_qp_index_offset, pps_t::constrained_intra_pred_flag, pps_t::deblocking_filter_control_present_flag, pps_t::entropy_coding_mode_flag, log2, more_rbsp_data(), pps_t::num_ref_idx_l0_active_minus1, pps_t::num_ref_idx_l1_active_minus1, pps_t::num_slice_groups_minus1, pps_t::pic_init_qp_minus26, pps_t::pic_init_qs_minus26, pps_t::pic_order_present_flag, pps_t::pic_parameter_set_id, pps_t::pic_scaling_list_present_flag, pps_t::pic_scaling_matrix_present_flag, pps_t::pic_size_in_map_units_minus1, h264_stream_t::pps, pps_t::redundant_pic_cnt_present_flag, pps_t::run_length_minus1, pps_t::ScalingList4x4, pps_t::ScalingList8x8, pps_t::second_chroma_qp_index_offset, pps_t::seq_parameter_set_id, pps_t::slice_group_change_direction_flag, pps_t::slice_group_change_rate_minus1, pps_t::slice_group_id, pps_t::slice_group_map_type, pps_t::top_left, pps_t::transform_8x8_mode_flag, pps_t::UseDefaultScalingMatrix4x4Flag, pps_t::UseDefaultScalingMatrix8x8Flag, pps_t::weighted_bipred_idc, pps_t::weighted_pred_flag, write_rbsp_trailing_bits(), and write_scaling_list().

Referenced by write_nal_unit().

Here is the call graph for this function:

void write_pred_weight_table h264_stream_t h,
bs_t b
 

Definition at line 1647 of file h264_stream.c.

References bs_write_se(), bs_write_u1(), bs_write_ue(), sps_t::chroma_format_idc, pps_t::num_ref_idx_l0_active_minus1, pps_t::num_ref_idx_l1_active_minus1, h264_stream_t::pps, slice_header_t::pwt, h264_stream_t::sh, SH_SLICE_TYPE_B, slice_header_t::slice_type, and h264_stream_t::sps.

Referenced by write_slice_header().

Here is the call graph for this function:

void write_rbsp_slice_trailing_bits h264_stream_t h,
bs_t b
 

Definition at line 1468 of file h264_stream.c.

References bs_write_f(), pps_t::entropy_coding_mode_flag, more_rbsp_trailing_data(), h264_stream_t::pps, and write_rbsp_trailing_bits().

Referenced by write_slice_layer_rbsp().

Here is the call graph for this function:

void write_rbsp_trailing_bits h264_stream_t h,
bs_t b
 

Definition at line 1482 of file h264_stream.c.

References bs_byte_aligned(), and bs_write_f().

Referenced by write_access_unit_delimiter_rbsp(), write_filler_data_rbsp(), write_pic_parameter_set_rbsp(), write_rbsp_slice_trailing_bits(), and write_seq_parameter_set_rbsp().

Here is the call graph for this function:

void write_ref_pic_list_reordering h264_stream_t h,
bs_t b
 

Definition at line 1604 of file h264_stream.c.

References bs_write_u1(), bs_write_ue(), slice_header_t::rplr, h264_stream_t::sh, SH_SLICE_TYPE_B, SH_SLICE_TYPE_I, SH_SLICE_TYPE_SI, and slice_header_t::slice_type.

Referenced by write_slice_header().

Here is the call graph for this function:

void write_scaling_list bs_t b,
int *  scalingList,
int  sizeOfScalingList,
int  useDefaultScalingMatrixFlag
 

Definition at line 1146 of file h264_stream.c.

References bs_write_se().

Referenced by write_pic_parameter_set_rbsp(), and write_seq_parameter_set_rbsp().

Here is the call graph for this function:

void write_seq_parameter_set_rbsp h264_stream_t h,
bs_t b
 

Definition at line 1055 of file h264_stream.c.

References sps_t::bit_depth_chroma_minus8, sps_t::bit_depth_luma_minus8, bs_write_se(), bs_write_u(), bs_write_u1(), bs_write_u8(), bs_write_ue(), sps_t::chroma_format_idc, sps_t::constraint_set0_flag, sps_t::constraint_set1_flag, sps_t::constraint_set2_flag, sps_t::constraint_set3_flag, sps_t::delta_pic_order_always_zero_flag, sps_t::direct_8x8_inference_flag, sps_t::frame_crop_bottom_offset, sps_t::frame_crop_left_offset, sps_t::frame_crop_right_offset, sps_t::frame_crop_top_offset, sps_t::frame_cropping_flag, sps_t::frame_mbs_only_flag, sps_t::gaps_in_frame_num_value_allowed_flag, sps_t::level_idc, sps_t::log2_max_frame_num_minus4, sps_t::log2_max_pic_order_cnt_lsb_minus4, sps_t::mb_adaptive_frame_field_flag, sps_t::num_ref_frames, sps_t::num_ref_frames_in_pic_order_cnt_cycle, sps_t::offset_for_non_ref_pic, sps_t::offset_for_ref_frame, sps_t::offset_for_top_to_bottom_field, sps_t::pic_height_in_map_units_minus1, sps_t::pic_order_cnt_type, sps_t::pic_width_in_mbs_minus1, sps_t::profile_idc, sps_t::qpprime_y_zero_transform_bypass_flag, sps_t::reserved_zero_4bits, sps_t::residual_colour_transform_flag, sps_t::ScalingList4x4, sps_t::ScalingList8x8, sps_t::seq_parameter_set_id, sps_t::seq_scaling_list_present_flag, sps_t::seq_scaling_matrix_present_flag, h264_stream_t::sps, sps_t::UseDefaultScalingMatrix4x4Flag, sps_t::UseDefaultScalingMatrix8x8Flag, sps_t::vui_parameters_present_flag, write_rbsp_trailing_bits(), write_scaling_list(), and write_vui_parameters().

Referenced by write_nal_unit().

Here is the call graph for this function:

void write_slice_header h264_stream_t h,
bs_t b
 

Definition at line 1497 of file h264_stream.c.

References slice_header_t::bottom_field_flag, bs_write_se(), bs_write_u(), bs_write_u1(), bs_write_ue(), slice_header_t::cabac_init_idc, pps_t::deblocking_filter_control_present_flag, sps_t::delta_pic_order_always_zero_flag, slice_header_t::delta_pic_order_cnt, slice_header_t::delta_pic_order_cnt_bottom, slice_header_t::direct_spatial_mv_pred_flag, slice_header_t::disable_deblocking_filter_idc, pps_t::entropy_coding_mode_flag, slice_header_t::field_pic_flag, slice_header_t::first_mb_in_slice, sps_t::frame_mbs_only_flag, slice_header_t::frame_num, slice_header_t::idr_pic_id, log2, sps_t::log2_max_frame_num_minus4, sps_t::log2_max_pic_order_cnt_lsb_minus4, h264_stream_t::nal, nal_t::nal_ref_idc, nal_t::nal_unit_type, slice_header_t::num_ref_idx_active_override_flag, slice_header_t::num_ref_idx_l0_active_minus1, slice_header_t::num_ref_idx_l1_active_minus1, pps_t::num_slice_groups_minus1, slice_header_t::pic_order_cnt_lsb, sps_t::pic_order_cnt_type, pps_t::pic_order_present_flag, slice_header_t::pic_parameter_set_id, pps_t::pic_size_in_map_units_minus1, h264_stream_t::pps, slice_header_t::redundant_pic_cnt, pps_t::redundant_pic_cnt_present_flag, h264_stream_t::sh, SH_SLICE_TYPE_B, SH_SLICE_TYPE_I, SH_SLICE_TYPE_P, SH_SLICE_TYPE_SI, SH_SLICE_TYPE_SP, slice_header_t::slice_alpha_c0_offset_div2, slice_header_t::slice_beta_offset_div2, slice_header_t::slice_group_change_cycle, pps_t::slice_group_change_rate_minus1, pps_t::slice_group_map_type, slice_header_t::slice_qp_delta, slice_header_t::slice_qs_delta, slice_header_t::slice_type, slice_header_t::sp_for_switch_flag, h264_stream_t::sps, pps_t::weighted_bipred_idc, pps_t::weighted_pred_flag, write_dec_ref_pic_marking(), write_pred_weight_table(), and write_ref_pic_list_reordering().

Referenced by write_slice_layer_rbsp().

Here is the call graph for this function:

void write_slice_layer_rbsp h264_stream_t h,
bs_t b
 

Definition at line 1428 of file h264_stream.c.

References write_rbsp_slice_trailing_bits(), and write_slice_header().

Referenced by write_nal_unit().

Here is the call graph for this function:

void write_vui_parameters h264_stream_t h,
bs_t b
 

Definition at line 1171 of file h264_stream.c.

References bs_write_u(), bs_write_u1(), bs_write_u8(), bs_write_ue(), SAR_Extended, h264_stream_t::sps, sps_t::vui, and write_hrd_parameters().

Referenced by write_seq_parameter_set_rbsp().

Here is the call graph for this function:


Generated on Sat Jul 22 22:05:25 2006 by  doxygen 1.4.4