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)
Value:
do { \
} while (0)
void ff_cbs_trace_header(CodedBitstreamContext *ctx, const char *name)
Definition: cbs.c:367
AVFormatContext * ctx
Definition: movenc.c:48
const char * name
Definition: opengl_enc.c:103

Definition at line 237 of file cbs_h2645.c.

#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_chromahold_slice(), 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)

Definition at line 255 of file cbs_h2645.c.

#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__)

Definition at line 263 of file cbs_h2645.c.

#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:353
#define av_unused
Definition: attributes.h:125
const char * name
Definition: opengl_enc.c:103

Definition at line 270 of file cbs_h2645.c.

#define READ

Definition at line 276 of file cbs_h2645.c.

#define READWRITE   read

Definition at line 350 of file cbs_h2645.c.

#define RWContext   GetBitContext

Definition at line 351 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:426
#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 353 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 359 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 365 of file cbs_h2645.c.

#define infer (   name,
  value 
)
Value:
do { \
current->name = value; \
} while (0)
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109

Definition at line 372 of file cbs_h2645.c.

#define more_rbsp_data (   var)    ((var) = cbs_h2645_read_more_rbsp_data(rw))

Definition at line 381 of file cbs_h2645.c.

Referenced by pps().

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

Definition at line 383 of file cbs_h2645.c.

#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
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
Definition: avcodec.h:782
const char * name
Definition: opengl_enc.c:103

Definition at line 385 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 397 of file cbs_h2645.c.

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

Definition at line 397 of file cbs_h2645.c.

#define WRITE

Definition at line 349 of file cbs_h2645.c.

#define READWRITE   write

Definition at line 350 of file cbs_h2645.c.

#define RWContext   PutBitContext

Definition at line 351 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:469
#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 353 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 359 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 365 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 372 of file cbs_h2645.c.

#define more_rbsp_data (   var)    (var)

Definition at line 381 of file cbs_h2645.c.

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

Definition at line 383 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 385 of file cbs_h2645.c.

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

Definition at line 397 of file cbs_h2645.c.

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

Definition at line 397 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 703 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 417 of file cbs_h2645.c.

Referenced by cbs_h2645_replace_ps().

static void cbs_h264_free_sei_payload ( H264RawSEIPayload payload)
static

Definition at line 424 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 446 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 455 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 462 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 469 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 476 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 483 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 490 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 502 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 511 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 544 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 730 of file cbs_h2645.c.

static int cbs_h265_read_nal_unit ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit 
)
static

Definition at line 899 of file cbs_h2645.c.

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

Definition at line 1053 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 1190 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 1320 of file cbs_h2645.c.

static int cbs_h2645_assemble_fragment ( CodedBitstreamContext ctx,
CodedBitstreamFragment frag 
)
static

Definition at line 1379 of file cbs_h2645.c.

static void cbs_h264_close ( CodedBitstreamContext ctx)
static

Definition at line 1466 of file cbs_h2645.c.

static void cbs_h265_close ( CodedBitstreamContext ctx)
static

Definition at line 1481 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 1524 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 1586 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:1320
static int cbs_h2645_assemble_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Definition: cbs_h2645.c:1379
static void cbs_h264_close(CodedBitstreamContext *ctx)
Definition: cbs_h2645.c:1466
static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
Definition: cbs_h2645.c:544

Definition at line 1498 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:1320
static int cbs_h265_read_nal_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_h2645.c:899
static int cbs_h2645_assemble_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Definition: cbs_h2645.c:1379
static void cbs_h265_close(CodedBitstreamContext *ctx)
Definition: cbs_h2645.c:1481
static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
Definition: cbs_h2645.c:544

Definition at line 1511 of file cbs_h2645.c.