Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
a8fb8f61
Commit
a8fb8f61
authored
Mar 28, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_qp: split expression parsing out of loop
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
625bd463
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
vf_qp.c
libavfilter/vf_qp.c
+14
-9
No files found.
libavfilter/vf_qp.c
View file @
a8fb8f61
...
...
@@ -50,26 +50,31 @@ static int config_input(AVFilterLink *inlink)
AVFilterContext
*
ctx
=
inlink
->
dst
;
QPContext
*
s
=
ctx
->
priv
;
int
i
;
int
ret
;
AVExpr
*
e
=
NULL
;
static
const
char
*
var_names
[]
=
{
"known"
,
"qp"
,
NULL
};
if
(
!
s
->
qp_expr_str
)
return
0
;
ret
=
av_expr_parse
(
&
e
,
s
->
qp_expr_str
,
var_names
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
ctx
);
if
(
ret
<
0
)
return
ret
;
s
->
h
=
(
inlink
->
h
+
15
)
>>
4
;
s
->
qstride
=
(
inlink
->
w
+
15
)
>>
4
;
for
(
i
=
-
129
;
i
<
128
;
i
++
)
{
double
var_values
[]
=
{
i
!=
-
129
,
i
,
0
};
static
const
char
*
var_names
[]
=
{
"known"
,
"qp"
,
NULL
};
double
temp_val
;
int
ret
;
double
var_values
[]
=
{
i
!=
-
129
,
i
,
0
};
double
temp_val
=
av_expr_eval
(
e
,
var_values
,
NULL
);
ret
=
av_expr_parse_and_eval
(
&
temp_val
,
s
->
qp_expr_str
,
var_names
,
var_values
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
ctx
);
if
(
ret
<
0
)
return
ret
;
if
(
isnan
(
temp_val
))
{
av_expr_free
(
e
);
return
AVERROR
(
EINVAL
);
}
s
->
lut
[
i
+
129
]
=
lrintf
(
temp_val
);
}
av_expr_free
(
e
);
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment