55 for (pass = 1; pass <= 2; pass++) {
56 long value, range_start, range_end;
61 for (str = list_string; *
str;) {
62 value = strtol(str, &value_end, 0);
65 str = (
const char *)value_end;
69 range_end = strtol(str, &value_end, 0);
73 for (value = range_start; value < range_end; value++) {
121 for (i = frag->
nb_units - 1; i >= 0; i--) {
122 for (j = 0; j < ctx->
nb_types; j++) {
158 "remove_types is required.\n");
218 #define OFFSET(x) offsetof(FilterUnitsContext, x) 219 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM) 221 {
"pass_types",
"List of unit types to pass through the filter.",
224 {
"remove_types",
"List of unit types to remove in the filter.",
239 .
name =
"filter_units",
241 .priv_class = &filter_units_class,
int nb_units
Number of units in this fragment.
AVCodecParameters * par_out
Parameters of the output stream.
static const AVClass filter_units_class
#define LIBAVUTIL_VERSION_INT
int ff_cbs_write_packet(CodedBitstreamContext *ctx, AVPacket *pkt, CodedBitstreamFragment *frag)
Write the bitstream of a fragment to a packet.
static av_cold int init(AVCodecContext *avctx)
int ff_cbs_init(CodedBitstreamContext **ctx_ptr, enum AVCodecID codec_id, void *log_ctx)
Create and initialise a new context for the given codec.
void ff_cbs_delete_unit(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int position)
Delete a unit from a fragment and free all memory it uses.
CodedBitstreamUnitType type
Codec-specific type of this unit.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
The bitstream filter state.
const char * av_default_item_name(void *ptr)
Return the context name.
CodedBitstreamContext * cbc
enum FilterUnitsContext::@59 mode
void * priv_data
Opaque filter-specific private data.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static void filter(int16_t *output, ptrdiff_t out_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len, int clip)
uint32_t CodedBitstreamUnitType
The codec-specific type of a bitstream unit.
int ff_cbs_read_packet(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVPacket *pkt)
Read the data bitstream from a packet into a fragment, then split into units and decompose.
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
void ff_cbs_fragment_free(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Free the units array of a fragment in addition to what ff_cbs_fragment_reset does.
#define i(width, name, range_min, range_max)
static int filter_units_init(AVBSFContext *bsf)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void filter_units_close(AVBSFContext *bsf)
static int filter_units_filter(AVBSFContext *bsf, AVPacket *pkt)
int ff_cbs_write_extradata(CodedBitstreamContext *ctx, AVCodecParameters *par, CodedBitstreamFragment *frag)
Write the bitstream of a fragment to the extradata in codec parameters.
const char * remove_types
int nb_decompose_unit_types
Length of the decompose_unit_types array.
Coded bitstream fragment structure, combining one or more units.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
CodedBitstreamUnitType * type_list
const AVBitStreamFilter ff_filter_units_bsf
Describe the class of an AVClass context structure.
void ff_cbs_fragment_reset(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Free the units contained in a fragment as well as the fragment's own data buffer, but not the units a...
Context structure for coded bitstream operations.
void ff_cbs_close(CodedBitstreamContext **ctx_ptr)
Close a context and free all internal state.
int ff_cbs_read_extradata(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVCodecParameters *par)
Read the extradata bitstream found in codec parameters into a fragment, then split into units and dec...
CodedBitstreamFragment fragment
common internal and external API header
static enum AVCodecID codec_ids[]
CodedBitstreamUnitType * decompose_unit_types
Array of unit types which should be decomposed when reading.
enum AVCodecID ff_cbs_all_codec_ids[]
Table of all supported codec IDs.
static const AVOption filter_units_options[]
static int filter_units_make_type_list(const char *list_string, CodedBitstreamUnitType **type_list, int *nb_types)
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
#define av_malloc_array(a, b)
This structure stores compressed data.
AVCodecParameters * par_in
Parameters of the input stream.
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.