Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
6a9cb5a7
Commit
6a9cb5a7
authored
Feb 21, 2022
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_lagfun: add float formats support
parent
58492ce4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
vf_lagfun.c
libavfilter/vf_lagfun.c
+7
-5
No files found.
libavfilter/vf_lagfun.c
View file @
6a9cb5a7
...
...
@@ -63,6 +63,7 @@ static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUV420P16
,
AV_PIX_FMT_YUV422P16
,
AV_PIX_FMT_YUV444P16
,
AV_PIX_FMT_GBRP
,
AV_PIX_FMT_GBRP9
,
AV_PIX_FMT_GBRP10
,
AV_PIX_FMT_GBRP12
,
AV_PIX_FMT_GBRP14
,
AV_PIX_FMT_GBRP16
,
AV_PIX_FMT_GRAYF32
,
AV_PIX_FMT_GBRPF32
,
AV_PIX_FMT_GBRAPF32
,
AV_PIX_FMT_NONE
};
...
...
@@ -70,7 +71,7 @@ typedef struct ThreadData {
AVFrame
*
in
,
*
out
;
}
ThreadData
;
#define LAGFUN(name, type
)
\
#define LAGFUN(name, type
, round)
\
static int lagfun_frame##name(AVFilterContext *ctx, void *arg, \
int jobnr, int nb_jobs) \
{ \
...
...
@@ -104,7 +105,7 @@ static int lagfun_frame##name(AVFilterContext *ctx, void *arg, \
if (ctx->is_disabled) { \
dst[x] = src[x]; \
} else { \
dst[x] =
lrintf(v);
\
dst[x] =
round(v);
\
} \
} \
\
...
...
@@ -117,8 +118,9 @@ static int lagfun_frame##name(AVFilterContext *ctx, void *arg, \
return 0; \
}
LAGFUN
(
8
,
uint8_t
)
LAGFUN
(
16
,
uint16_t
)
LAGFUN
(
8
,
uint8_t
,
lrintf
)
LAGFUN
(
16
,
uint16_t
,
lrintf
)
LAGFUN
(
32
,
float
,
)
static
int
config_output
(
AVFilterLink
*
outlink
)
{
...
...
@@ -133,7 +135,7 @@ static int config_output(AVFilterLink *outlink)
return
AVERROR_BUG
;
s
->
nb_planes
=
av_pix_fmt_count_planes
(
outlink
->
format
);
s
->
depth
=
desc
->
comp
[
0
].
depth
;
s
->
lagfun
=
s
->
depth
<=
8
?
lagfun_frame8
:
lagfun_frame16
;
s
->
lagfun
=
s
->
depth
<=
8
?
lagfun_frame8
:
s
->
depth
<=
16
?
lagfun_frame16
:
lagfun_frame32
;
if
((
ret
=
av_image_fill_linesizes
(
s
->
linesize
,
inlink
->
format
,
inlink
->
w
))
<
0
)
return
ret
;
...
...
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