Go to the documentation of this file.
66 .log_level_offset_offset = offsetof(
Parser, log_offset),
67 .parent_log_context_offset = offsetof(
Parser, log_ctx),
75 [
'y'-
'E']= { 8.271806125530276749e-25, 1e-24, -24 },
76 [
'z'-
'E']= { 8.4703294725430034e-22, 1e-21, -21 },
77 [
'a'-
'E']= { 8.6736173798840355e-19, 1e-18, -18 },
78 [
'f'-
'E']= { 8.8817841970012523e-16, 1e-15, -15 },
79 [
'p'-
'E']= { 9.0949470177292824e-13, 1e-12, -12 },
80 [
'n'-
'E']= { 9.3132257461547852e-10, 1e-9, -9 },
81 [
'u'-
'E']= { 9.5367431640625e-7, 1e-6, -6 },
82 [
'm'-
'E']= { 9.765625e-4, 1e-3, -3 },
83 [
'c'-
'E']= { 9.8431332023036951e-3, 1e-2, -2 },
84 [
'd'-
'E']= { 9.921256574801246e-2, 1e-1, -1 },
85 [
'h'-
'E']= { 1.0159366732596479e2, 1e2, 2 },
86 [
'k'-
'E']= { 1.024e3, 1e3, 3 },
87 [
'K'-
'E']= { 1.024e3, 1e3, 3 },
88 [
'M'-
'E']= { 1.048576e6, 1e6, 6 },
89 [
'G'-
'E']= { 1.073741824e9, 1e9, 9 },
90 [
'T'-
'E']= { 1.099511627776e12, 1e12, 12 },
91 [
'P'-
'E']= { 1.125899906842624e15, 1e15, 15 },
92 [
'E'-
'E']= { 1.152921504606847e18, 1e18, 18 },
93 [
'Z'-
'E']= { 1.1805916207174113e21, 1e21, 21 },
94 [
'Y'-
'E']= { 1.2089258196146292e24, 1e24, 24 },
111 if(numstr[0]==
'0' && (numstr[1]|0x20)==
'x') {
112 d = strtoul(numstr, &next, 16);
114 d =
strtod(numstr, &next);
117 if (next[0] ==
'd' && next[1] ==
'B') {
121 }
else if (*next >=
'E' && *next <=
'z') {
124 if (next[1] ==
'i') {
146 #define IS_IDENTIFIER_CHAR(c) ((c) - '0' <= 9U || (c) - 'a' <= 25U || (c) - 'A' <= 25U || (c) == '_')
151 for (
i=0; prefix[
i];
i++) {
152 if (prefix[
i] !=
s[
i])
return 0;
226 return v0 + (v1 - v0) *
f;
235 #define COMPUTE_NEXT_RANDOM() \
236 int idx = av_clip(eval_expr(p, e->param[0]), 0, VARS-1); \
237 FFSFC64 *s = p->prng_state + idx; \
241 r = isnan(p->var[idx]) ? 0 : p->var[idx]; \
242 ff_sfc64_init(s, r, r, r, 12); \
244 r = ff_sfc64_get(s); \
249 return r * (1.0/UINT64_MAX);
264 double t = 1, d = 0, v;
268 double var0 = p->
var[
id];
269 for(
i=0;
i<1000;
i++) {
283 double low = -1,
high = -1, v, low_v = -DBL_MAX, high_v = DBL_MAX;
284 double var0 = p->
var[0];
286 for(
i=-1;
i<1024;
i++) {
290 p->
var[0] = x_max*pow(0.9,
i-255);
291 if (
i&1) p->
var[0] *= -1;
292 if (
i&2) p->
var[0] += low;
296 if (v<=0 && v>low_v) {
300 if (v>=0 && v<high_v) {
304 if (low>=0 &&
high>=0){
305 for (j=0; j<1000; j++) {
310 if (v<=0) low = p->
var[0];
321 return -low_v<high_v ? low :
high;
329 case e_max:
return e->
value * (d > d2 ? d : d2);
330 case e_min:
return e->
value * (d < d2 ? d : d2);
331 case e_eq:
return e->
value * (d == d2 ? 1.0 : 0.0);
332 case e_gt:
return e->
value * (d > d2 ? 1.0 : 0.0);
333 case e_gte:
return e->
value * (d >= d2 ? 1.0 : 0.0);
334 case e_lt:
return e->
value * (d < d2 ? 1.0 : 0.0);
335 case e_lte:
return e->
value * (d <= d2 ? 1.0 : 0.0);
372 char *next = p->
s, *s0 = p->
s;
408 p->
s= strchr(p->
s,
'(');
420 if (p->
s[0] !=
')') {
441 if (p->
s[0] !=
')') {
544 *sign= (*p->
s ==
'+') - (*p->
s ==
'-');
556 if (next != p->
s && next[0] ==
'd' && next[1] ==
'B') {
566 int sign, sign2,
ret;
585 if (e0) e0->
value *= (sign|1);
597 while (p->
s[0]==
'*' || p->
s[0]==
'/') {
621 while (*p->
s ==
'+' || *p->
s ==
'-') {
649 while (*p->
s ==
';') {
713 const char *
const *
func2_names,
double (*
const *funcs2)(
void *,
double,
double),
714 int log_offset,
void *log_ctx)
770 if (!e || !counter || !
size)
806 const char *
const *
func2_names,
double (*
const *funcs2)(
void *,
double,
double),
807 void *opaque,
int log_offset,
void *log_ctx)
static av_always_inline double ff_exp10(double x)
Compute 10^x for floating point values.
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 struct @425 constants[]
static int parse_primary(AVExpr **e, Parser *p)
double strtod(const char *, char **)
#define COMPUTE_NEXT_RANDOM()
static av_const int av_isspace(int c)
Locale-independent conversion of ASCII isspace.
const uint8_t ff_reverse[256]
int av_expr_count_func(AVExpr *e, unsigned *counter, int size, int arg)
Track the presence of user provided functions and their number of occurrences in a parsed expression.
const char *const * const_names
#define IS_IDENTIFIER_CHAR(c)
double(*const funcs2)(void *, double a, double b)
static const char *const func2_names[]
static const double const_values[]
int64_t av_gcd(int64_t a, int64_t b)
Compute the greatest common divisor of two integer operands.
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.
const char *const * func1_names
static __device__ float trunc(float a)
static const struct @424 si_prefixes[ 'z' - 'E'+1]
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
static const char *const func1_names[]
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
#define FFDIFFSIGN(x, y)
Comparator.
double(*const funcs1)(void *, double a)
static __device__ float ceil(float a)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
static int expr_count(AVExpr *e, unsigned *counter, int size, int type)
static double(*const funcs1[])(void *, double)
static __device__ float floor(float a)
int av_expr_count_vars(AVExpr *e, unsigned *counter, int size)
Track the presence of variables and their number of occurrences in a parsed expression.
double(* func1)(void *, double)
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
static const AVClass eval_class
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
static __device__ float fabs(float a)
static int parse_pow(AVExpr **e, Parser *p, int *sign)
const char * av_default_item_name(void *ptr)
Return the context name.
static int parse_dB(AVExpr **e, Parser *p, int *sign)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int av_expr_parse_and_eval(double *d, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
static double eval_expr(Parser *p, AVExpr *e)
static av_const double hypot(double x, double y)
static int verify_expr(AVExpr *e)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
static int parse_subexpr(AVExpr **e, Parser *p)
static AVExpr * make_eval_expr(int type, int value, AVExpr *p0, AVExpr *p1)
#define AV_LOG_INFO
Standard information.
#define i(width, name, range_min, range_max)
static double etime(double v)
static av_always_inline av_const double round(double x)
static int parse_factor(AVExpr **e, Parser *p)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
double av_strtod(const char *numstr, char **tail)
Parse the string in numstr and return its value as a double.
static const char *const const_names[]
const char *const * func2_names
int64_t av_gettime(void)
Get the current time in microseconds.
static int strmatch(const char *s, const char *prefix)
static int parse_term(AVExpr **e, Parser *p)
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
static int parse_expr(AVExpr **e, Parser *p)
const double * const_values
double(* func2)(void *, double, double)