libgpac
Documentation of the core library of GPAC
hevcmerge.c File Reference
#include <gpac/bitstream.h>
#include <gpac/filters.h>
#include <gpac/avparse.h>
#include <gpac/constants.h>
#include <gpac/internal/media_dev.h>
#include <math.h>
+ Include dependency graph for hevcmerge.c:

Data Structures

struct  HEVCTilePidCtx
 
struct  HEVCGridInfo
 
struct  GF_HEVCMergeCtx
 

Macros

#define CHECK_SPS_VAL(__name)
 
#define CHECK_PPS_VAL(__name)
 
#define OFFS(_n)   #_n, offsetof(GF_HEVCMergeCtx, _n)
 

Functions

void hevc_rewrite_sps (char *in_SPS, u32 in_SPS_length, u32 width, u32 height, char **out_SPS, u32 *out_SPS_length)
 
static void hevcmerge_rewrite_pps (GF_HEVCMergeCtx *ctx, char *in_PPS, u32 in_PPS_length, char **out_PPS, u32 *out_PPS_length)
 
u32 hevcmerge_rewrite_slice (GF_HEVCMergeCtx *ctx, HEVCTilePidCtx *tile_pid, char *in_slice, u32 in_slice_length)
 
static GF_Err hevcmerge_rewrite_config (GF_HEVCMergeCtx *ctx, GF_FilterPid *opid, char *data, u32 size)
 
static void hevcmerge_write_nal (GF_HEVCMergeCtx *ctx, char *output_nal, char *rewritten_nal, u32 out_nal_size)
 
static u32 hevcmerge_compute_address (GF_HEVCMergeCtx *ctx, HEVCTilePidCtx *tile_pid, Bool use_y_coord)
 
void hevcmerge_build_srdmap (GF_HEVCMergeCtx *ctx, Bool use_abs_pos)
 
static GF_Err hevcmerge_rebuild_grid (GF_HEVCMergeCtx *ctx, GF_FilterPid *pid)
 
static GF_Err hevcmerge_check_sps_pps (GF_HEVCMergeCtx *ctx, HEVCTilePidCtx *pid_base, HEVCTilePidCtx *pid_o)
 
static GF_Err hevcmerge_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
static GF_Err hevcmerge_process (GF_Filter *filter)
 
static Bool hevcmerge_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
static GF_Err hevcmerge_initialize (GF_Filter *filter)
 
static void hevcmerge_finalize (GF_Filter *filter)
 
const GF_FilterRegister * hevcmerge_register (GF_FilterSession *session)
 

Variables

static const GF_FilterCapability HEVCMergeCaps []
 
static const GF_FilterArgs HEVCMergeArgs []
 
GF_FilterRegister HEVCMergeRegister
 

Data Structure Documentation

◆ HEVCTilePidCtx

struct HEVCTilePidCtx
+ Collaboration diagram for HEVCTilePidCtx:
Data Fields
GF_FilterPid * pid
u32 slice_segment_address
u32 width
u32 height
Bool in_error
u32 nalu_size_length
u32 dsi_crc
HEVCState hevc_state
u32 pos_row
u32 pos_col
u32 timescale
u32 nb_pck
Bool has_pos
s32 pos_x
s32 pos_y

◆ HEVCGridInfo

struct HEVCGridInfo
Data Fields
u32 width
u32 height
u32 row_pos
u32 max_row_pos
u32 last_row_idx
u32 pos_x

◆ GF_HEVCMergeCtx

struct GF_HEVCMergeCtx
+ Collaboration diagram for GF_HEVCMergeCtx:
Data Fields
Bool strict
Bool mrows
GF_FilterPid * opid
s32 base_pps_init_qp_delta_minus26
u32 nb_bits_per_address_dst
u32 out_width
u32 out_height
u8 * buffer_nal
u8 * buffer_nal_no_epb
u8 * buffer_nal_in_no_epb
u32 buffer_nal_alloc
u32 buffer_nal_no_epb_alloc
u32 buffer_nal_in_no_epb_alloc
GF_BitStream * bs_au_in
GF_BitStream * bs_nal_in
GF_BitStream * bs_nal_out
HEVCGridInfo * grid
u32 nb_cols
u8 * sei_suffix_buf
u32 sei_suffix_len
u32 sei_suffix_alloc
u32 hevc_nalu_size_length
u32 max_CU_width
u32 max_CU_height
GF_List * pids
GF_List * ordered_pids
Bool in_error
Bool enable_multi_rows
u32 nb_rows
u32 merge_set_id
Bool is_playing
GF_FEVT_Play play_evt

Macro Definition Documentation

◆ CHECK_SPS_VAL

#define CHECK_SPS_VAL (   __name)
Value:
if (sps_base->__name != sps_o->__name ) { \
GF_LOG(GF_LOG_WARNING, GF_LOG_MEDIA, ("[HEVCMerge] "#__name" differs in SPS between %s and %s, undefined results\n", src_base, src_o));\
all_ok = GF_FALSE;\
}\
@ GF_LOG_MEDIA
Definition: tools.h:792
@ GF_LOG_WARNING
Definition: tools.h:743
@ GF_FALSE
Definition: setup.h:473

◆ CHECK_PPS_VAL

#define CHECK_PPS_VAL (   __name)
Value:
if (pps_base->__name != pps_o->__name ) { \
GF_LOG(GF_LOG_WARNING, GF_LOG_MEDIA, ("[HEVCMerge] "#__name" differs in PPS, undefined results\n"));\
all_ok = GF_FALSE;\
}\

◆ OFFS

#define OFFS (   _n)    #_n, offsetof(GF_HEVCMergeCtx, _n)

Function Documentation

◆ hevc_rewrite_sps()

void hevc_rewrite_sps ( char *  in_SPS,
u32  in_SPS_length,
u32  width,
u32  height,
char **  out_SPS,
u32 out_SPS_length 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hevcmerge_rewrite_pps()

static void hevcmerge_rewrite_pps ( GF_HEVCMergeCtx ctx,
char *  in_PPS,
u32  in_PPS_length,
char **  out_PPS,
u32 out_PPS_length 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hevcmerge_rewrite_slice()

u32 hevcmerge_rewrite_slice ( GF_HEVCMergeCtx ctx,
HEVCTilePidCtx tile_pid,
char *  in_slice,
u32  in_slice_length 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hevcmerge_rewrite_config()

static GF_Err hevcmerge_rewrite_config ( GF_HEVCMergeCtx ctx,
GF_FilterPid *  opid,
char *  data,
u32  size 
)
static

used for storing AVC sequenceParameterSetNALUnit and pictureParameterSetNALUnit

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hevcmerge_write_nal()

static void hevcmerge_write_nal ( GF_HEVCMergeCtx ctx,
char *  output_nal,
char *  rewritten_nal,
u32  out_nal_size 
)
static
+ Here is the caller graph for this function:

◆ hevcmerge_compute_address()

static u32 hevcmerge_compute_address ( GF_HEVCMergeCtx ctx,
HEVCTilePidCtx tile_pid,
Bool  use_y_coord 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hevcmerge_build_srdmap()

void hevcmerge_build_srdmap ( GF_HEVCMergeCtx ctx,
Bool  use_abs_pos 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hevcmerge_rebuild_grid()

static GF_Err hevcmerge_rebuild_grid ( GF_HEVCMergeCtx ctx,
GF_FilterPid *  pid 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hevcmerge_check_sps_pps()

static GF_Err hevcmerge_check_sps_pps ( GF_HEVCMergeCtx ctx,
HEVCTilePidCtx pid_base,
HEVCTilePidCtx pid_o 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hevcmerge_configure_pid()

static GF_Err hevcmerge_configure_pid ( GF_Filter *  filter,
GF_FilterPid *  pid,
Bool  is_remove 
)
static
+ Here is the call graph for this function:

◆ hevcmerge_process()

static GF_Err hevcmerge_process ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ hevcmerge_process_event()

static Bool hevcmerge_process_event ( GF_Filter *  filter,
const GF_FilterEvent *  evt 
)
static
+ Here is the call graph for this function:

◆ hevcmerge_initialize()

static GF_Err hevcmerge_initialize ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ hevcmerge_finalize()

static void hevcmerge_finalize ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ hevcmerge_register()

const GF_FilterRegister* hevcmerge_register ( GF_FilterSession *  session)

Variable Documentation

◆ HEVCMergeCaps

const GF_FilterCapability HEVCMergeCaps[]
static
Initial value:
=
{
}
@ GF_CODECID_HEVC
Definition: constants.h:416
@ GF_CODECID_HEVC_MERGE
Definition: constants.h:466
@ GF_STREAM_VISUAL
Definition: constants.h:64
#define GF_CAPS_OUTPUT
Definition: filters.h:2232
#define CAP_UINT(_f, _a, _b)
Definition: filters.h:2172
#define GF_CAPS_INPUT_EXCLUDED
Definition: filters.h:2228
#define CAP_BOOL(_f, _a, _b)
Definition: filters.h:2180
#define GF_CAPS_INPUT
Definition: filters.h:2220
@ GF_PROP_PID_CODECID
Definition: filters.h:1116
@ GF_PROP_PID_STREAM_TYPE
Definition: filters.h:1112
@ GF_PROP_PID_UNFRAMED
Definition: filters.h:1118
@ GF_TRUE
Definition: setup.h:474

◆ HEVCMergeArgs

const GF_FilterArgs HEVCMergeArgs[]
static
Initial value:
=
{
{ OFFS(strict), "strict comparison of SPS and PPS of input PIDs", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(mrows), "signal multiple rows in tile grid when possible", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{0}
}
@ GF_FS_ARG_HINT_ADVANCED
Definition: filters.h:2102
@ GF_PROP_BOOL
Definition: filters.h:858
#define OFFS(_n)
Definition: hevcmerge.c:1624

◆ HEVCMergeRegister

GF_FilterRegister HEVCMergeRegister