FFmpeg
|
#include "libavcodec/get_bits.h"
#include "libavcodec/golomb.h"
#include "libavcodec/hevc.h"
#include "libavutil/intreadwrite.h"
#include "avc.h"
#include "avio.h"
#include "hevc.h"
Go to the source code of this file.
Data Structures | |
struct | HVCCNALUnitArray |
struct | HEVCDecoderConfigurationRecord |
struct | HVCCProfileTierLevel |
Macros | |
#define | MAX_SPATIAL_SEGMENTATION 4096 |
Functions | |
static void | hvcc_update_ptl (HEVCDecoderConfigurationRecord *hvcc, HVCCProfileTierLevel *ptl) |
static void | hvcc_parse_ptl (GetBitContext *gb, HEVCDecoderConfigurationRecord *hvcc, unsigned int max_sub_layers_minus1) |
static void | skip_sub_layer_hrd_parameters (GetBitContext *gb, unsigned int cpb_cnt_minus1, uint8_t sub_pic_hrd_params_present_flag) |
static void | skip_hrd_parameters (GetBitContext *gb, uint8_t cprms_present_flag, unsigned int max_sub_layers_minus1) |
static void | skip_timing_info (GetBitContext *gb) |
static void | hvcc_parse_vui (GetBitContext *gb, HEVCDecoderConfigurationRecord *hvcc, unsigned int max_sub_layers_minus1) |
static void | skip_sub_layer_ordering_info (GetBitContext *gb) |
static int | hvcc_parse_vps (GetBitContext *gb, HEVCDecoderConfigurationRecord *hvcc) |
static void | skip_scaling_list_data (GetBitContext *gb) |
static int | parse_rps (GetBitContext *gb, unsigned int rps_idx, unsigned int num_rps, unsigned int num_delta_pocs[MAX_SHORT_TERM_RPS_COUNT]) |
static int | hvcc_parse_sps (GetBitContext *gb, HEVCDecoderConfigurationRecord *hvcc) |
static int | hvcc_parse_pps (GetBitContext *gb, HEVCDecoderConfigurationRecord *hvcc) |
static uint8_t * | nal_unit_extract_rbsp (const uint8_t *src, uint32_t src_len, uint32_t *dst_len) |
static void | nal_unit_parse_header (GetBitContext *gb, uint8_t *nal_type) |
static int | hvcc_array_add_nal_unit (uint8_t *nal_buf, uint32_t nal_size, uint8_t nal_type, int ps_array_completeness, HEVCDecoderConfigurationRecord *hvcc) |
static int | hvcc_add_nal_unit (uint8_t *nal_buf, uint32_t nal_size, int ps_array_completeness, HEVCDecoderConfigurationRecord *hvcc) |
static void | hvcc_init (HEVCDecoderConfigurationRecord *hvcc) |
static void | hvcc_close (HEVCDecoderConfigurationRecord *hvcc) |
static int | hvcc_write (AVIOContext *pb, HEVCDecoderConfigurationRecord *hvcc) |
int | ff_hevc_annexb2mp4 (AVIOContext *pb, const uint8_t *buf_in, int size, int filter_ps, int *ps_count) |
Writes Annex B formatted HEVC NAL units to the provided AVIOContext. | |
int | ff_hevc_annexb2mp4_buf (const uint8_t *buf_in, uint8_t **buf_out, int *size, int filter_ps, int *ps_count) |
Writes Annex B formatted HEVC NAL units to a data buffer. | |
int | ff_isom_write_hvcc (AVIOContext *pb, const uint8_t *data, int size, int ps_array_completeness) |
Writes HEVC extradata (parameter sets, declarative SEI NAL units) to the provided AVIOContext. | |
#define MAX_SPATIAL_SEGMENTATION 4096 |
Definition at line 29 of file hevc.c.
Referenced by hvcc_init(), and hvcc_write().
|
static |
Definition at line 70 of file hevc.c.
Referenced by hvcc_parse_ptl().
|
static |
Definition at line 124 of file hevc.c.
Referenced by hvcc_parse_sps(), and hvcc_parse_vps().
|
static |
Definition at line 173 of file hevc.c.
Referenced by skip_hrd_parameters().
|
static |
Definition at line 192 of file hevc.c.
Referenced by hvcc_parse_vui().
|
static |
Definition at line 262 of file hevc.c.
Referenced by hvcc_parse_vui().
|
static |
Definition at line 271 of file hevc.c.
Referenced by hvcc_parse_sps().
|
static |
Definition at line 349 of file hevc.c.
Referenced by hvcc_parse_sps().
|
static |
Definition at line 356 of file hevc.c.
Referenced by hvcc_add_nal_unit().
|
static |
Definition at line 393 of file hevc.c.
Referenced by hvcc_parse_sps().
|
static |
Definition at line 412 of file hevc.c.
Referenced by hvcc_parse_sps().
|
static |
Definition at line 476 of file hevc.c.
Referenced by hvcc_add_nal_unit().
|
static |
Definition at line 577 of file hevc.c.
Referenced by hvcc_add_nal_unit().
|
static |
Definition at line 633 of file hevc.c.
Referenced by hvcc_add_nal_unit().
|
static |
Definition at line 665 of file hevc.c.
Referenced by hvcc_add_nal_unit().
|
static |
Definition at line 678 of file hevc.c.
Referenced by hvcc_add_nal_unit().
|
static |
Definition at line 731 of file hevc.c.
Referenced by ff_isom_write_hvcc().
|
static |
Definition at line 787 of file hevc.c.
Referenced by ff_isom_write_hvcc().
|
static |
Definition at line 807 of file hevc.c.
Referenced by ff_isom_write_hvcc().
|
static |
Definition at line 821 of file hevc.c.
Referenced by ff_isom_write_hvcc().
int ff_hevc_annexb2mp4 | ( | AVIOContext * | pb, |
const uint8_t * | buf_in, | ||
int | size, | ||
int | filter_ps, | ||
int * | ps_count | ||
) |
Writes Annex B formatted HEVC NAL units to the provided AVIOContext.
The NAL units are converted to an MP4-compatible format (start code prefixes are replaced by 4-byte size fields, as per ISO/IEC 14496-15).
If filter_ps is non-zero, any HEVC parameter sets found in the input will be discarded, and *ps_count will be set to the number of discarded PS NAL units.
pb | address of the AVIOContext where the data shall be written |
buf_in | address of the buffer holding the input data |
size | size (in bytes) of the input buffer |
filter_ps | whether to write parameter set NAL units to the output (0) or to discard them (non-zero) |
ps_count | address of the variable where the number of discarded parameter set NAL units shall be written, may be NULL |
Definition at line 1017 of file hevc.c.
Referenced by ff_hevc_annexb2mp4_buf(), and ff_mov_write_packet().
int ff_hevc_annexb2mp4_buf | ( | const uint8_t * | buf_in, |
uint8_t ** | buf_out, | ||
int * | size, | ||
int | filter_ps, | ||
int * | ps_count | ||
) |
Writes Annex B formatted HEVC NAL units to a data buffer.
The NAL units are converted to an MP4-compatible format (start code prefixes are replaced by 4-byte size fields, as per ISO/IEC 14496-15).
If filter_ps is non-zero, any HEVC parameter sets found in the input will be discarded, and *ps_count will be set to the number of discarded PS NAL units.
On output, *size holds the size (in bytes) of the output data buffer.
buf_in | address of the buffer holding the input data |
size | address of the variable holding the size (in bytes) of the input buffer (on input) and of the output buffer (on output) |
buf_out | address of the variable holding the address of the output buffer |
filter_ps | whether to write parameter set NAL units to the output (0) or to discard them (non-zero) |
ps_count | address of the variable where the number of discarded parameter set NAL units shall be written, may be NULL |
Definition at line 1065 of file hevc.c.
Referenced by ff_mov_write_packet(), and mkv_write_block().
int ff_isom_write_hvcc | ( | AVIOContext * | pb, |
const uint8_t * | data, | ||
int | size, | ||
int | ps_array_completeness | ||
) |
Writes HEVC extradata (parameter sets, declarative SEI NAL units) to the provided AVIOContext.
If the extradata is Annex B format, it gets converted to hvcC format before writing.
pb | address of the AVIOContext where the hvcC shall be written |
data | address of the buffer holding the data needed to write the hvcC |
size | size (in bytes) of the data buffer |
ps_array_completeness | whether all parameter sets are in the hvcC (1) or there may be additional parameter sets in the bitstream (0) |
Definition at line 1081 of file hevc.c.
Referenced by mkv_write_codecprivate(), and mov_write_hvcc_tag().