FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
cbs_h2645.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "bytestream.h"
#include "cbs.h"
#include "cbs_internal.h"
#include "cbs_h264.h"
#include "cbs_h265.h"
#include "golomb.h"
#include "h264.h"
#include "h264_sei.h"
#include "h2645_parse.h"
#include "hevc.h"
#include "hevc_sei.h"
#include "cbs_h264_syntax_template.c"
#include "cbs_h265_syntax_template.c"

Go to the source code of this file.

Macros

#define HEADER(name)
 
#define CHECK(call)
 
#define FUNC_NAME(rw, codec, name)   cbs_ ## codec ## _ ## rw ## _ ## name
 
#define FUNC_H264(rw, name)   FUNC_NAME(rw, h264, name)
 
#define FUNC_H265(rw, name)   FUNC_NAME(rw, h265, name)
 
#define SUBSCRIPTS(subs,...)   (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)
 
#define u(width, name, range_min, range_max)   xu(width, name, current->name, range_min, range_max, 0)
 
#define flag(name)   u(1, name, 0, 1)
 
#define ue(name, range_min, range_max)   xue(name, current->name, range_min, range_max, 0)
 
#define se(name, range_min, range_max)   xse(name, current->name, range_min, range_max, 0)
 
#define us(width, name, range_min, range_max, subs,...)   xu(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)
 
#define flags(name, subs,...)   xu(1, name, current->name, 0, 1, subs, __VA_ARGS__)
 
#define ues(name, range_min, range_max, subs,...)   xue(name, current->name, range_min, range_max, subs, __VA_ARGS__)
 
#define ses(name, range_min, range_max, subs,...)   xse(name, current->name, range_min, range_max, subs, __VA_ARGS__)
 
#define fixed(width, name, value)
 
#define READ
 
#define READWRITE   read
 
#define RWContext   GetBitContext
 
#define xu(width, name, var, range_min, range_max, subs,...)
 
#define xue(name, var, range_min, range_max, subs,...)
 
#define xse(name, var, range_min, range_max, subs,...)
 
#define infer(name, value)
 
#define more_rbsp_data(var)   ((var) = cbs_h2645_read_more_rbsp_data(rw))
 
#define byte_alignment(rw)   (get_bits_count(rw) % 8)
 
#define allocate(name, size)
 
#define FUNC(name)   FUNC_H264(READWRITE, name)
 
#define FUNC(name)   FUNC_H265(READWRITE, name)
 
#define WRITE
 
#define READWRITE   write
 
#define RWContext   PutBitContext
 
#define xu(width, name, var, range_min, range_max, subs,...)
 
#define xue(name, var, range_min, range_max, subs,...)
 
#define xse(name, var, range_min, range_max, subs,...)
 
#define infer(name, value)
 
#define more_rbsp_data(var)   (var)
 
#define byte_alignment(rw)   (put_bits_count(rw) % 8)
 
#define allocate(name, size)
 
#define FUNC(name)   FUNC_H264(READWRITE, name)
 
#define FUNC(name)   FUNC_H265(READWRITE, name)
 
#define cbs_h2645_replace_ps(h26n, ps_name, ps_var, id_element)
 

Functions

static int cbs_read_ue_golomb (CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, const int *subscripts, uint32_t *write_to, uint32_t range_min, uint32_t range_max)
 
static int cbs_read_se_golomb (CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, const int *subscripts, int32_t *write_to, int32_t range_min, int32_t range_max)
 
static int cbs_write_ue_golomb (CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max)
 
static int cbs_write_se_golomb (CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, const int *subscripts, int32_t value, int32_t range_min, int32_t range_max)
 
static int cbs_h2645_read_more_rbsp_data (GetBitContext *gbc)
 
static void cbs_h264_free_pps (void *unit, uint8_t *content)
 
static void cbs_h264_free_sei_payload (H264RawSEIPayload *payload)
 
static void cbs_h264_free_sei (void *unit, uint8_t *content)
 
static void cbs_h264_free_slice (void *unit, uint8_t *content)
 
static void cbs_h265_free_vps (void *unit, uint8_t *content)
 
static void cbs_h265_free_sps (void *unit, uint8_t *content)
 
static void cbs_h265_free_pps (void *unit, uint8_t *content)
 
static void cbs_h265_free_slice (void *unit, uint8_t *content)
 
static void cbs_h265_free_sei_payload (H265RawSEIPayload *payload)
 
static void cbs_h265_free_sei (void *unit, uint8_t *content)
 
static int cbs_h2645_fragment_add_nals (CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const H2645Packet *packet)
 
static int cbs_h2645_split_fragment (CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
 
 cbs_h2645_replace_ps (cbs_h2645_replace_ps(4, cbs_h2645_replace_ps(SPS, cbs_h2645_replace_ps(sps, seq_parameter_set_id)
 
static int cbs_h265_read_nal_unit (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
 
static int cbs_h264_write_nal_unit (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
 
static int cbs_h265_write_nal_unit (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
 
static int cbs_h2645_write_nal_unit (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
 
static int cbs_h2645_assemble_fragment (CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
 
static void cbs_h264_close (CodedBitstreamContext *ctx)
 
static void cbs_h265_close (CodedBitstreamContext *ctx)
 
int ff_cbs_h264_add_sei_message (CodedBitstreamContext *ctx, CodedBitstreamFragment *au, const H264RawSEIPayload *payload)
 Add an SEI message to an access unit. More...
 
int ff_cbs_h264_delete_sei_message (CodedBitstreamContext *ctx, CodedBitstreamFragment *au, CodedBitstreamUnit *nal, int position)
 Delete an SEI message from an access unit. More...
 

Variables

const CodedBitstreamType ff_cbs_type_h264
 
const CodedBitstreamType ff_cbs_type_h265
 

Macro Definition Documentation

#define HEADER (   name)
#define CHECK (   call)
Value:
do { \
err = (call); \
if (err < 0) \
return err; \
} while (0)
return
if(ret< 0)
Definition: vf_mcdeint.c:279

Definition at line 241 of file cbs_h2645.c.

#define FUNC_NAME (   rw,
  codec,
  name 
)    cbs_ ## codec ## _ ## rw ## _ ## name

Definition at line 247 of file cbs_h2645.c.

#define FUNC_H264 (   rw,
  name 
)    FUNC_NAME(rw, h264, name)

Definition at line 248 of file cbs_h2645.c.

#define FUNC_H265 (   rw,
  name 
)    FUNC_NAME(rw, h265, name)

Definition at line 249 of file cbs_h2645.c.

#define SUBSCRIPTS (   subs,
  ... 
)    (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)

Definition at line 251 of file cbs_h2645.c.

#define u (   width,
  name,
  range_min,
  range_max 
)    xu(width, name, current->name, range_min, range_max, 0)

Definition at line 253 of file cbs_h2645.c.

Referenced by adpcm_compress_trellis(), adpcm_decode_frame(), application_data(), apply_lut(), apply_lut10(), aud(), av_gcd(), avui_decode_frame(), aw_pulse_set2(), bitpacked_decode_yuv422p10(), build_diff_map(), build_huff(), build_huff10(), calc_combed_score(), calc_persp_luts(), calculate_codes(), cinepak_decode_codebook(), comment(), convert_input(), cpia_decode_frame(), cqt_calc(), create_chrominance_lut(), decode_aybr(), decode_aybri(), decode_byry(), decode_byryi(), decode_c82i(), decode_c82p(), decode_ca2i(), decode_ca2p(), decode_ca4i(), decode_ca4p(), decode_fint(), decode_frame(), decode_subband_slice_buffered(), decode_ybr(), decode_ybr10(), decode_ybr10i(), decode_ybri(), decode_ybyr(), decode_yry10(), decode_yry10i(), decompress(), dht(), do_chromakey_slice(), dqt(), dv_decode_ac(), dxv_decompress_cgo(), encode_422_bitstream(), encode_frame(), ff_print_debug_info2(), ff_rtjpeg_decode_frame_yuv420(), ff_sws_alphablendaway(), ff_vorbis_len2vlc(), ff_yuv2rgb_c_init_tables(), fill_elements(), fill_in_tongue(), fill_lut(), filter_frame(), frame_block_to_cell(), frame_header(), generate_joint_tables(), generate_kernel(), get_benchmark_time_stamps(), get_bits(), get_s16l(), hl_decode_mb_predict_luma(), hrd_parameters(), huff_build(), huff_build10(), huff_build12(), huffman_table(), init(), intra_predict(), inv_cdf(), jp2_find_codestream(), lcg_random(), main(), mode17(), mode23(), mode24(), model256_update(), model2_update(), model_update(), monochrome_color_location(), motionpixels_tableinit(), mp_build_rgb_yuv_table(), mp_set_zero_yuv(), mp_yuv_to_rgb(), mss2_blit_wmv9_template(), nal_unit_header(), pick_color(), pow_m1_4(), pps(), print_option(), process_slice_uyvy422(), process_slice_yuv420p(), process_slice_yuv422p(), process_slice_yuv444p(), profile_tier_level(), quantisation_table(), read_block_types(), read_high_coeffs(), render_default_font(), resample_cubic(), resample_linear(), reverse_dc_prediction(), rgb16_32ToUV_c_template(), rgb2yuv_fsb(), rso_write_header(), rv34_pred_4x4_block(), rv40_weak_loop_filter(), sbr_sum_square_c(), scan_float(), scan_header(), scan_int32(), sei_content_light_level(), sei_display_orientation(), sei_mastering_display(), sei_mastering_display_colour_volume(), sei_pic_timestamp(), sei_pic_timing(), sei_recovery_point(), sei_user_data_registered(), sign_extend(), slice_header(), slice_segment_header(), sps(), sps_extension(), sps_scc_extension(), svq3_add_idct_c(), svq3_decode_mb(), sws_scale(), tm2_decode_blocks(), uninit_options(), v308_decode_frame(), v308_encode_frame(), v408_decode_frame(), v408_encode_frame(), v410_decode_frame(), v410_encode_frame(), vp9_handle_packet(), vps(), vui_parameters(), wavpack_encode_block(), wv_get_value_float(), y216_decode_frame(), y41p_decode_frame(), y41p_encode_frame(), yuv2nv12cX_c(), yuv2p010cX_c(), yuv2p016cX_c(), yuv2rgb(), yuv2yuv(), yuv4_decode_frame(), yuv4_encode_frame(), and zero12v_decode_frame().

#define flag (   name)    u(1, name, 0, 1)
#define ue (   name,
  range_min,
  range_max 
)    xue(name, current->name, range_min, range_max, 0)
#define se (   name,
  range_min,
  range_max 
)    xse(name, current->name, range_min, range_max, 0)
#define us (   width,
  name,
  range_min,
  range_max,
  subs,
  ... 
)    xu(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)
#define flags (   name,
  subs,
  ... 
)    xu(1, name, current->name, 0, 1, subs, __VA_ARGS__)
Examples:
ffhash.c.

Definition at line 263 of file cbs_h2645.c.

Referenced by add_index_entry(), aom_encode(), aom_init(), ape_tag_read_field(), apply_param_change(), asf_read_stream_properties(), asf_write_packet(), av_get_cpu_flags(), av_opt_query_ranges(), av_opt_set_defaults2(), av_parse_cpu_flags(), av_read_image_line(), av_timecode_init(), av_vdpau_bind_context(), av_write_image_line(), avfilter_graph_queue_command(), avfilter_graph_set_auto_convert(), avi_add_ientry(), avi_read_idx1(), avi_write_header(), avi_write_packet_internal(), avio_check(), bidir_refine(), check(), crypto_open2(), decode_frame(), decode_frame_header(), decode_header(), decode_hextile(), decode_init(), decode_mb_b(), decode_rle(), decode_subblock(), decode_subblock3(), decode_tile_info(), device_open(), dnxhd_decode_dct_block(), dump_paramchange(), dump_stream_format(), dxa_read_header(), encode_codebook(), encode_frame(), encode_mode(), epzs_motion_search2(), epzs_motion_search4(), fbdev_read_header(), fbdev_write_header(), ff_ac3_apply_rematrixing(), ff_add_index_entry(), ff_alsa_open(), ff_draw_init(), ff_get_cpu_max_align_aarch64(), ff_get_cpu_max_align_ppc(), ff_get_cpu_max_align_x86(), ff_get_unscaled_swscale(), ff_mediacodec_dec_send(), ff_mms_asf_header_parser(), ff_mp4_parse_es_descr(), ff_parse_mpeg2_descriptor(), ff_rdt_parse_packet(), ff_vc1_b_intfi_loop_filter(), ff_vc1_i_loop_filter(), ff_vc1_p_intfr_loop_filter(), ff_vc1_p_loop_filter(), ffat_init_encoder(), fileTest(), filter_codec_opts(), filter_frame(), find_prev_closest_index(), flush(), flv_read_header(), flv_read_packet(), flv_write_packet(), gdv_decode_frame(), get_audio_flags(), get_mb_score(), get_needed_flags(), get_opt_flags_string(), gif_read_image(), hls_read_seek(), hpel_motion_search(), hrd_parameters(), init_context_defaults(), init_noise(), ipvideo_decode_block_opcode_0x7(), ipvideo_decode_block_opcode_0x7_16(), ipvideo_decode_block_opcode_0x8(), ipvideo_decode_block_opcode_0x8_16(), ipvideo_decode_block_opcode_0x9(), ipvideo_decode_block_opcode_0x9_16(), ipvideo_decode_block_opcode_0xA(), ipvideo_decode_block_opcode_0xA_16(), is_animated_webp_packet(), lvf_read_packet(), magy_decode_slice(), magy_decode_slice10(), main(), matroska_parse_block(), matroska_parse_wavpack(), mjpeg_decode_app(), mkv_write_vtt_blocks(), mov_fix_index(), mov_parse_stsd_audio(), mov_read_tfhd(), mov_read_timecode_track(), mov_read_tkhd(), mov_read_trun(), mov_write_tfhd_tag(), mov_write_tkhd_tag(), mov_write_trun_tag(), mpeg_decode_user_data(), mpegps_read_pes_header(), mpegts_push_data(), mpegts_write_pes(), mpegts_write_section1(), msvideo1_decode_16bit(), msvideo1_decode_8bit(), mxf_compute_ptses_fake_index(), mxf_parse_physical_source_package(), mxf_parse_structural_metadata(), noise(), nut_write_packet(), nvenc_check_capabilities(), ogg_read_page(), old_codec37(), opt_cpuflags(), opt_loglevel(), parse_MP4SLDescrTag(), parse_opus_ts_header(), parse_pcr(), parse_pixel_format(), pmp_header(), pp_config_props(), pps(), pred_weight_table(), process_command(), profile_tier_level(), qpel_motion_search(), read_desc_chunk(), read_header(), read_moof_duration(), read_packet(), read_part_of_packet(), read_trun_duration(), rm_read_dts(), rm_read_header(), rm_read_packet(), rtp_parse_one_packet(), rtp_parse_packet_internal(), rtp_resolve_host(), rv10_write_header(), scaling_list_data(), sdl2_write_header(), sdr2_read_packet(), sei_pic_timing(), selfTest(), seqvideo_decode(), show_help_default(), slice_segment_header(), smacker_read_packet(), sps(), st_ref_pic_set(), sub_layer_hrd_parameters(), sws_alloc_set_opts(), sws_getCachedContext(), sws_init_context(), swscale(), thread_get_buffer_internal(), thread_main(), txd_decode_frame(), udp_resolve_host(), url_alloc_for_protocol(), vaapi_map_frame(), validate_avframe_allocation(), vmdaudio_decode_frame(), vorbis_packet(), vps(), wmavoice_decode_init(), write_header(), write_sm_data(), and wv_read_block_header().

#define ues (   name,
  range_min,
  range_max,
  subs,
  ... 
)    xue(name, current->name, range_min, range_max, subs, __VA_ARGS__)
#define ses (   name,
  range_min,
  range_max,
  subs,
  ... 
)    xse(name, current->name, range_min, range_max, subs, __VA_ARGS__)
#define fixed (   width,
  name,
  value 
)
Value:
do { \
av_unused uint32_t fixed_value = value; \
xu(width, name, fixed_value, value, value, 0); \
} while (0)
#define width
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
#define xu(width, name, var, range_min, range_max, subs,...)
Definition: cbs_h2645.c:352
#define av_unused
Definition: attributes.h:125
const char * name
Definition: opengl_enc.c:103

Definition at line 270 of file cbs_h2645.c.

Referenced by byte_alignment(), filler(), guess_mv(), main(), profile_tier_level(), rbsp_trailing_bits(), sei(), sei_payload(), slice_header(), and vps().

#define READ

Definition at line 276 of file cbs_h2645.c.

#define READWRITE   read

Definition at line 349 of file cbs_h2645.c.

#define RWContext   GetBitContext

Definition at line 350 of file cbs_h2645.c.

#define xu (   width,
  name,
  var,
  range_min,
  range_max,
  subs,
  ... 
)
Value:
do { \
uint32_t value = range_min; \
SUBSCRIPTS(subs, __VA_ARGS__), \
&value, range_min, range_max)); \
var = value; \
} while (0)
int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, uint32_t *write_to, uint32_t range_min, uint32_t range_max)
Definition: cbs.c:420
#define width
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
AVFormatContext * ctx
Definition: movenc.c:48
#define CHECK(call)
Definition: cbs_h2645.c:241
#define SUBSCRIPTS(subs,...)
Definition: cbs_h2645.c:251
const char * name
Definition: opengl_enc.c:103

Definition at line 352 of file cbs_h2645.c.

Referenced by extension_data(), sei(), sei_buffering_period(), sei_payload(), sei_user_data_registered(), and sei_user_data_unregistered().

#define xue (   name,
  var,
  range_min,
  range_max,
  subs,
  ... 
)
Value:
do { \
uint32_t value = range_min; \
SUBSCRIPTS(subs, __VA_ARGS__), \
&value, range_min, range_max)); \
var = value; \
} while (0)
static int cbs_read_ue_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, const int *subscripts, uint32_t *write_to, uint32_t range_min, uint32_t range_max)
Definition: cbs_h2645.c:35
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
AVFormatContext * ctx
Definition: movenc.c:48
#define CHECK(call)
Definition: cbs_h2645.c:241
#define SUBSCRIPTS(subs,...)
Definition: cbs_h2645.c:251
const char * name
Definition: opengl_enc.c:103

Definition at line 358 of file cbs_h2645.c.

Referenced by dec_ref_pic_marking(), and ref_pic_list_modification().

#define xse (   name,
  var,
  range_min,
  range_max,
  subs,
  ... 
)
Value:
do { \
int32_t value = range_min; \
SUBSCRIPTS(subs, __VA_ARGS__), \
&value, range_min, range_max)); \
var = value; \
} while (0)
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
int32_t
AVFormatContext * ctx
Definition: movenc.c:48
#define CHECK(call)
Definition: cbs_h2645.c:241
static int cbs_read_se_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, const int *subscripts, int32_t *write_to, int32_t range_min, int32_t range_max)
Definition: cbs_h2645.c:87
#define SUBSCRIPTS(subs,...)
Definition: cbs_h2645.c:251
const char * name
Definition: opengl_enc.c:103

Definition at line 364 of file cbs_h2645.c.

#define infer (   name,
  value 
)
#define more_rbsp_data (   var)    ((var) = cbs_h2645_read_more_rbsp_data(rw))

Definition at line 380 of file cbs_h2645.c.

Referenced by pps().

#define byte_alignment (   rw)    (get_bits_count(rw) % 8)

Definition at line 382 of file cbs_h2645.c.

Referenced by rbsp_trailing_bits(), sei_payload(), slice_header(), and trailing_bits().

#define allocate (   name,
  size 
)
Value:
do { \
if (!name ## _ref) \
return AVERROR(ENOMEM); \
name = name ## _ref->data; \
} while (0)
ptrdiff_t size
Definition: opengl_enc.c:101
#define AVERROR(e)
Definition: error.h:43
return
AVBufferRef * av_buffer_allocz(int size)
Same as av_buffer_alloc(), except the returned buffer will be initialized to zero.
Definition: buffer.c:83
if(ret< 0)
Definition: vf_mcdeint.c:279
const char * name
Definition: opengl_enc.c:103

Definition at line 384 of file cbs_h2645.c.

Referenced by extension_data(), pps(), sei_payload(), sei_user_data_registered(), and sei_user_data_unregistered().

#define FUNC (   name)    FUNC_H264(READWRITE, name)

Definition at line 396 of file cbs_h2645.c.

#define FUNC (   name)    FUNC_H265(READWRITE, name)

Definition at line 396 of file cbs_h2645.c.

#define WRITE

Definition at line 348 of file cbs_h2645.c.

#define READWRITE   write

Definition at line 349 of file cbs_h2645.c.

#define RWContext   PutBitContext

Definition at line 350 of file cbs_h2645.c.

#define xu (   width,
  name,
  var,
  range_min,
  range_max,
  subs,
  ... 
)
Value:
do { \
uint32_t value = var; \
SUBSCRIPTS(subs, __VA_ARGS__), \
value, range_min, range_max)); \
} while (0)
int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max)
Definition: cbs.c:463
#define width
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
AVFormatContext * ctx
Definition: movenc.c:48
#define CHECK(call)
Definition: cbs_h2645.c:241
#define SUBSCRIPTS(subs,...)
Definition: cbs_h2645.c:251
const char * name
Definition: opengl_enc.c:103

Definition at line 352 of file cbs_h2645.c.

#define xue (   name,
  var,
  range_min,
  range_max,
  subs,
  ... 
)
Value:
do { \
uint32_t value = var; \
SUBSCRIPTS(subs, __VA_ARGS__), \
value, range_min, range_max)); \
} while (0)
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
AVFormatContext * ctx
Definition: movenc.c:48
#define CHECK(call)
Definition: cbs_h2645.c:241
#define SUBSCRIPTS(subs,...)
Definition: cbs_h2645.c:251
static int cbs_write_ue_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max)
Definition: cbs_h2645.c:143
const char * name
Definition: opengl_enc.c:103

Definition at line 358 of file cbs_h2645.c.

#define xse (   name,
  var,
  range_min,
  range_max,
  subs,
  ... 
)
Value:
do { \
SUBSCRIPTS(subs, __VA_ARGS__), \
value, range_min, range_max)); \
} while (0)
static int cbs_write_se_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, const int *subscripts, int32_t value, int32_t range_min, int32_t range_max)
Definition: cbs_h2645.c:186
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
int32_t
AVFormatContext * ctx
Definition: movenc.c:48
#define CHECK(call)
Definition: cbs_h2645.c:241
#define SUBSCRIPTS(subs,...)
Definition: cbs_h2645.c:251
const char * name
Definition: opengl_enc.c:103

Definition at line 364 of file cbs_h2645.c.

#define infer (   name,
  value 
)
Value:
do { \
if (current->name != (value)) { \
av_log(ctx->log_ctx, AV_LOG_WARNING, "Warning: " \
"%s does not match inferred value: " \
"%"PRId64", but should be %"PRId64".\n", \
#name, (int64_t)current->name, (int64_t)(value)); \
} \
} while (0)
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:182
#define av_log(a,...)
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
AVFormatContext * ctx
Definition: movenc.c:48
if(ret< 0)
Definition: vf_mcdeint.c:279
const char * name
Definition: opengl_enc.c:103

Definition at line 371 of file cbs_h2645.c.

#define more_rbsp_data (   var)    (var)

Definition at line 380 of file cbs_h2645.c.

#define byte_alignment (   rw)    (put_bits_count(rw) % 8)

Definition at line 382 of file cbs_h2645.c.

#define allocate (   name,
  size 
)
Value:
do { \
if (!name) { \
av_log(ctx->log_ctx, AV_LOG_ERROR, "%s must be set " \
"for writing.\n", #name); \
} \
} while (0)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
return
AVFormatContext * ctx
Definition: movenc.c:48
if(ret< 0)
Definition: vf_mcdeint.c:279
const char * name
Definition: opengl_enc.c:103

Definition at line 384 of file cbs_h2645.c.

#define FUNC (   name)    FUNC_H264(READWRITE, name)

Definition at line 396 of file cbs_h2645.c.

#define FUNC (   name)    FUNC_H265(READWRITE, name)

Definition at line 396 of file cbs_h2645.c.

#define cbs_h2645_replace_ps (   h26n,
  ps_name,
  ps_var,
  id_element 
)
Value:
static int cbs_h26 ## h26n ## _replace_ ## ps_var(CodedBitstreamContext *ctx, \
{ \
CodedBitstreamH26 ## h26n ## Context *priv = ctx->priv_data; \
H26 ## h26n ## Raw ## ps_name *ps_var = unit->content; \
unsigned int id = ps_var->id_element; \
if (id > FF_ARRAY_ELEMS(priv->ps_var)) { \
av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid " #ps_name \
" id : %d.\n", id); \
} \
if (priv->ps_var[id] == priv->active_ ## ps_var) \
priv->active_ ## ps_var = NULL ; \
av_buffer_unref(&priv->ps_var ## _ref[id]); \
if (unit->content_ref) \
priv->ps_var ## _ref[id] = av_buffer_ref(unit->content_ref); \
else \
priv->ps_var ## _ref[id] = av_buffer_alloc(sizeof(*ps_var)); \
if (!priv->ps_var ## _ref[id]) \
return AVERROR(ENOMEM); \
priv->ps_var[id] = (H26 ## h26n ## Raw ## ps_name *)priv->ps_var ## _ref[id]->data; \
if (!unit->content_ref) \
memcpy(priv->ps_var[id], ps_var, sizeof(*ps_var)); \
return 0; \
}
Definition: async.c:56
#define NULL
Definition: coverity.c:32
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
Definition: buffer.c:125
Coded bitstream unit structure.
Definition: cbs.h:64
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
#define AVERROR(e)
Definition: error.h:43
return
AVFormatContext * ctx
Definition: movenc.c:48
#define FF_ARRAY_ELEMS(a)
AVBufferRef * av_buffer_alloc(int size)
Allocate an AVBuffer of the given size using av_malloc().
Definition: buffer.c:67
Context structure for coded bitstream operations.
Definition: cbs.h:159
if(ret< 0)
Definition: vf_mcdeint.c:279
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
Definition: buffer.c:93
void * priv_data
Format private data.
Definition: avformat.h:1379
enum AVCodecID id

Definition at line 702 of file cbs_h2645.c.

Function Documentation

static int cbs_read_ue_golomb ( CodedBitstreamContext ctx,
GetBitContext gbc,
const char *  name,
const int subscripts,
uint32_t *  write_to,
uint32_t  range_min,
uint32_t  range_max 
)
static

Definition at line 35 of file cbs_h2645.c.

static int cbs_read_se_golomb ( CodedBitstreamContext ctx,
GetBitContext gbc,
const char *  name,
const int subscripts,
int32_t write_to,
int32_t  range_min,
int32_t  range_max 
)
static

Definition at line 87 of file cbs_h2645.c.

static int cbs_write_ue_golomb ( CodedBitstreamContext ctx,
PutBitContext pbc,
const char *  name,
const int subscripts,
uint32_t  value,
uint32_t  range_min,
uint32_t  range_max 
)
static

Definition at line 143 of file cbs_h2645.c.

static int cbs_write_se_golomb ( CodedBitstreamContext ctx,
PutBitContext pbc,
const char *  name,
const int subscripts,
int32_t  value,
int32_t  range_min,
int32_t  range_max 
)
static

Definition at line 186 of file cbs_h2645.c.

static int cbs_h2645_read_more_rbsp_data ( GetBitContext gbc)
static

Definition at line 307 of file cbs_h2645.c.

Referenced by extension_data(), and sei().

static void cbs_h264_free_pps ( void unit,
uint8_t content 
)
static

Definition at line 416 of file cbs_h2645.c.

Referenced by cbs_h2645_replace_ps().

static void cbs_h264_free_sei_payload ( H264RawSEIPayload payload)
static

Definition at line 423 of file cbs_h2645.c.

Referenced by cbs_h264_free_sei(), and ff_cbs_h264_delete_sei_message().

static void cbs_h264_free_sei ( void unit,
uint8_t content 
)
static

Definition at line 445 of file cbs_h2645.c.

Referenced by cbs_h2645_replace_ps(), and ff_cbs_h264_add_sei_message().

static void cbs_h264_free_slice ( void unit,
uint8_t content 
)
static

Definition at line 454 of file cbs_h2645.c.

Referenced by cbs_h2645_replace_ps().

static void cbs_h265_free_vps ( void unit,
uint8_t content 
)
static

Definition at line 461 of file cbs_h2645.c.

Referenced by cbs_h265_read_nal_unit().

static void cbs_h265_free_sps ( void unit,
uint8_t content 
)
static

Definition at line 468 of file cbs_h2645.c.

Referenced by cbs_h265_read_nal_unit().

static void cbs_h265_free_pps ( void unit,
uint8_t content 
)
static

Definition at line 475 of file cbs_h2645.c.

Referenced by cbs_h265_read_nal_unit().

static void cbs_h265_free_slice ( void unit,
uint8_t content 
)
static

Definition at line 482 of file cbs_h2645.c.

Referenced by cbs_h265_read_nal_unit().

static void cbs_h265_free_sei_payload ( H265RawSEIPayload payload)
static

Definition at line 489 of file cbs_h2645.c.

Referenced by cbs_h265_free_sei().

static void cbs_h265_free_sei ( void unit,
uint8_t content 
)
static

Definition at line 501 of file cbs_h2645.c.

Referenced by cbs_h265_read_nal_unit().

static int cbs_h2645_fragment_add_nals ( CodedBitstreamContext ctx,
CodedBitstreamFragment frag,
const H2645Packet packet 
)
static

Definition at line 510 of file cbs_h2645.c.

Referenced by cbs_h2645_split_fragment().

static int cbs_h2645_split_fragment ( CodedBitstreamContext ctx,
CodedBitstreamFragment frag,
int  header 
)
static

Definition at line 543 of file cbs_h2645.c.

cbs_h2645_replace_ps ( cbs_h2645_replace_ps(  4,
cbs_h2645_replace_ps(  SPS,
cbs_h2645_replace_ps(  sps,
seq_parameter_set_id   
)

Definition at line 729 of file cbs_h2645.c.

static int cbs_h265_read_nal_unit ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit 
)
static

Definition at line 881 of file cbs_h2645.c.

static int cbs_h264_write_nal_unit ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit,
PutBitContext pbc 
)
static

Definition at line 1035 of file cbs_h2645.c.

Referenced by cbs_h2645_write_nal_unit().

static int cbs_h265_write_nal_unit ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit,
PutBitContext pbc 
)
static

Definition at line 1156 of file cbs_h2645.c.

Referenced by cbs_h2645_write_nal_unit().

static int cbs_h2645_write_nal_unit ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit 
)
static

Definition at line 1286 of file cbs_h2645.c.

static int cbs_h2645_assemble_fragment ( CodedBitstreamContext ctx,
CodedBitstreamFragment frag 
)
static

Definition at line 1345 of file cbs_h2645.c.

static void cbs_h264_close ( CodedBitstreamContext ctx)
static

Definition at line 1432 of file cbs_h2645.c.

static void cbs_h265_close ( CodedBitstreamContext ctx)
static

Definition at line 1447 of file cbs_h2645.c.

int ff_cbs_h264_add_sei_message ( CodedBitstreamContext ctx,
CodedBitstreamFragment au,
const H264RawSEIPayload payload 
)

Add an SEI message to an access unit.

Definition at line 1490 of file cbs_h2645.c.

Referenced by h264_metadata_filter().

int ff_cbs_h264_delete_sei_message ( CodedBitstreamContext ctx,
CodedBitstreamFragment access_unit,
CodedBitstreamUnit nal_unit,
int  position 
)

Delete an SEI message from an access unit.

Deletes from nal_unit, which must be an SEI NAL unit. If this is the last message in nal_unit, also deletes it from access_unit.

Definition at line 1552 of file cbs_h2645.c.

Referenced by h264_metadata_filter().

Variable Documentation

const CodedBitstreamType ff_cbs_type_h264
Initial value:
= {
.codec_id = AV_CODEC_ID_H264,
.priv_data_size = sizeof(CodedBitstreamH264Context),
.split_fragment = &cbs_h2645_split_fragment,
.read_unit = &cbs_h264_read_nal_unit,
.write_unit = &cbs_h2645_write_nal_unit,
.assemble_fragment = &cbs_h2645_assemble_fragment,
.close = &cbs_h264_close,
}
static int cbs_h2645_write_nal_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_h2645.c:1286
static int cbs_h2645_assemble_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Definition: cbs_h2645.c:1345
static void cbs_h264_close(CodedBitstreamContext *ctx)
Definition: cbs_h2645.c:1432
static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
Definition: cbs_h2645.c:543

Definition at line 1464 of file cbs_h2645.c.

const CodedBitstreamType ff_cbs_type_h265
Initial value:
= {
.codec_id = AV_CODEC_ID_HEVC,
.priv_data_size = sizeof(CodedBitstreamH265Context),
.split_fragment = &cbs_h2645_split_fragment,
.read_unit = &cbs_h265_read_nal_unit,
.write_unit = &cbs_h2645_write_nal_unit,
.assemble_fragment = &cbs_h2645_assemble_fragment,
.close = &cbs_h265_close,
}
static int cbs_h2645_write_nal_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_h2645.c:1286
static int cbs_h265_read_nal_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_h2645.c:881
static int cbs_h2645_assemble_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Definition: cbs_h2645.c:1345
static void cbs_h265_close(CodedBitstreamContext *ctx)
Definition: cbs_h2645.c:1447
static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
Definition: cbs_h2645.c:543

Definition at line 1477 of file cbs_h2645.c.