Go to the documentation of this file.
53 return (
data[21] & 3) + 1;
66 uint8_t dv_profile = 7;
68 for (
int i = 0;
i <
ctx->par_out->nb_coded_side_data;
i++) {
84 ctx->par_out->nb_coded_side_data,
86 if (sd && sd->
size >= 23) {
92 ctx->par_out->extradata = new_ed;
93 ctx->par_out->extradata_size = sd->
size;
97 static const uint8_t el_div[] = {
104 int div = dv_profile <
FF_ARRAY_ELEMS(el_div) ? el_div[dv_profile] : 0;
109 if (dv_profile == 7 &&
ctx->par_in->width <= 1920)
112 ctx->par_out->width =
ctx->par_in->width / div;
113 ctx->par_out->height =
ctx->par_in->height / div;
120 &
ctx->par_out->nb_coded_side_data,
124 ctx->par_in->extradata_size);
126 ctx->par_out->extradata_size);
138 const uint8_t **payload,
int *payload_size)
147 if (!keep_el ||
nal->raw_size <= 2)
149 *payload =
nal->raw_data + 2;
150 *payload_size =
nal->raw_size - 2;
156 *payload =
nal->raw_data;
157 *payload_size =
nal->raw_size;
163 *payload =
nal->raw_data;
164 *payload_size =
nal->raw_size;
179 int prefix_size =
s->out_nal_length_size ?
s->out_nal_length_size : 4;
191 for (
int i = 0;
i <
s->pkt.nb_nals;
i++) {
192 const uint8_t *payload;
196 out_size += prefix_size + payload_size;
212 for (
int i = 0;
i <
s->pkt.nb_nals;
i++) {
213 const uint8_t *payload;
217 switch (
s->out_nal_length_size) {
219 case 1:
AV_WB8 (
dst, payload_size);
break;
225 memcpy(
dst, payload, payload_size);
248 #define OFFSET(x) offsetof(DOVISplitContext, x)
249 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_BSF_PARAM)
271 .
p.
name =
"dovi_split",
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_LOG_WARNING
Something somehow does not look correct.
static const AVOption dovi_split_options[]
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int nal_is_kept(const DOVISplitContext *s, const H2645NAL *nal, const uint8_t **payload, int *payload_size)
uint8_t * data
The data buffer.
int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length, void *logctx, int nal_length_size, enum AVCodecID codec_id, int flags)
Split an input packet into NAL units.
This structure stores auxiliary information for decoding, presenting, or otherwise processing the cod...
void av_packet_side_data_remove(AVPacketSideData *sd, int *pnb_sd, enum AVPacketSideDataType type)
Remove side data of the given type from a side data array.
void(* filter)(uint8_t *src, int stride, int qscale)
int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt)
Called by the bitstream filters to get the next packet for filtering.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
The bitstream filter state.
@ AV_PKT_DATA_DOVI_CONF
DOVI configuration ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2....
static av_cold void close(AVCodecParserContext *s)
static enum AVCodecID dovi_split_codec_ids[]
void ff_h2645_packet_uninit(H2645Packet *pkt)
Free all the allocated memory in the packet.
static int dovi_split_init(AVBSFContext *ctx)
#define FF_ARRAY_ELEMS(a)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static void dovi_split_close(AVBSFContext *ctx)
static AVFormatContext * ctx
const FFBitStreamFilter ff_dovi_split_bsf
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
enum AVPacketSideDataType type
const char * av_default_item_name(void *ptr)
Return the context name.
AVCodecID
Identify the syntax and semantics of the bitstream.
const AVPacketSideData * av_packet_side_data_get(const AVPacketSideData *sd, int nb_sd, enum AVPacketSideDataType type)
Get side information from a side data array.
AVBitStreamFilter p
The public AVBitStreamFilter.
int(* init)(AVBSFContext *ctx)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#define i(width, name, range_min, range_max)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
static const AVClass dovi_split_class
AVBufferRef * av_buffer_alloc(size_t size)
Allocate an AVBuffer of the given size using av_malloc().
int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
Copy only "properties" fields from src to dst.
static int FUNC() nal(CodedBitstreamContext *ctx, RWContext *rw, LCEVCRawNAL *current, int nal_unit_type)
static int hvcc_nal_length_size(const uint8_t *data, int size)
static int dovi_split_filter(AVBSFContext *ctx, AVPacket *out)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define AV_INPUT_BUFFER_PADDING_SIZE
@ AV_OPT_TYPE_INT
Underlying C type is int.
A reference to a data buffer.
@ H2645_FLAG_SMALL_PADDING
@ AV_PKT_DATA_HEVC_CONF
Dolby Vision enhancement-layer HEVC decoder configuration.
This structure stores compressed data.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
void * priv_data
Format private data.