Go to the documentation of this file.
91 strcmp(
s->amount_str,
"0")) {
103 if (
s->drop_str &&
s->dropamount) {
105 s->drop_str,
s->dropamount);
130 int i,
ret, amount, drop = 0;
137 s->var_values[
VAR_N] =
s->pkt_idx++;
157 amount = (
s->state % 10001 + 1);
167 drop = !(
s->state %
FFABS((
int)res));
173 drop = !(
s->state %
s->dropamount);
195 if (amount &&
s->state % amount == 0)
210 s->amount_pexpr =
s->drop_pexpr =
NULL;
213 #define OFFSET(x) offsetof(NoiseContext, x)
214 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_BSF_PARAM)
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_LOG_WARNING
Something somehow does not look correct.
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 const AVClass noise_class
static void noise_close(AVBSFContext *bsf)
#define AV_LOG_VERBOSE
Detailed information.
void(* filter)(uint8_t *src, int stride, int qscale)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
const FFBitStreamFilter ff_noise_bsf
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
The bitstream filter state.
int av_expr_parse(AVExpr **expr, const char *s, const char *const *const_names, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), int log_offset, void *log_ctx)
Parse an expression.
static int noise(AVBSFContext *ctx, AVPacket *pkt)
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
static int noise_init(AVBSFContext *ctx)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const char *const var_names[]
static double av_q2d(AVRational a)
Convert an AVRational to a double.
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
@ AV_CODEC_ID_WRAPPED_AVFRAME
Passthrough codec, AVFrames wrapped in AVPacket.
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
const char * av_default_item_name(void *ptr)
Return the context name.
AVBitStreamFilter p
The public AVBitStreamFilter.
int(* init)(AVBSFContext *ctx)
#define AV_NOPTS_VALUE
Undefined timestamp value.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
int flags
A combination of AV_PKT_FLAG values.
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
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...
@ AV_OPT_TYPE_INT
Underlying C type is int.
int av_packet_make_writable(AVPacket *pkt)
Create a writable reference for the data described by a given packet, avoiding data copy if possible.
double var_values[VAR_VARS_NB]
char * av_strdup(const char *s)
Duplicate a string.
This structure stores compressed data.
int64_t pos
byte position in stream, -1 if unknown
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
static const AVOption options[]
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
void * priv_data
Format private data.