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
3ff811a4
Commit
3ff811a4
authored
Nov 12, 2023
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_colortemperature: add gbr(a)pf support
parent
10440a48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
vf_colortemperature.c
libavfilter/vf_colortemperature.c
+44
-0
No files found.
libavfilter/vf_colortemperature.c
View file @
3ff811a4
...
...
@@ -183,6 +183,47 @@ static int temperature_slice16(AVFilterContext *ctx, void *arg, int jobnr, int n
return
0
;
}
static
int
temperature_slice32
(
AVFilterContext
*
ctx
,
void
*
arg
,
int
jobnr
,
int
nb_jobs
)
{
ColorTemperatureContext
*
s
=
ctx
->
priv
;
AVFrame
*
frame
=
arg
;
const
int
width
=
frame
->
width
;
const
int
height
=
frame
->
height
;
const
float
preserve
=
s
->
preserve
;
const
float
mix
=
s
->
mix
;
const
float
*
color
=
s
->
color
;
const
int
slice_start
=
(
height
*
jobnr
)
/
nb_jobs
;
const
int
slice_end
=
(
height
*
(
jobnr
+
1
))
/
nb_jobs
;
const
ptrdiff_t
glinesize
=
frame
->
linesize
[
0
]
/
sizeof
(
float
);
const
ptrdiff_t
blinesize
=
frame
->
linesize
[
1
]
/
sizeof
(
float
);
const
ptrdiff_t
rlinesize
=
frame
->
linesize
[
2
]
/
sizeof
(
float
);
float
*
gptr
=
(
float
*
)
frame
->
data
[
0
]
+
slice_start
*
glinesize
;
float
*
bptr
=
(
float
*
)
frame
->
data
[
1
]
+
slice_start
*
blinesize
;
float
*
rptr
=
(
float
*
)
frame
->
data
[
2
]
+
slice_start
*
rlinesize
;
for
(
int
y
=
slice_start
;
y
<
slice_end
;
y
++
)
{
for
(
int
x
=
0
;
x
<
width
;
x
++
)
{
float
g
=
gptr
[
x
];
float
b
=
bptr
[
x
];
float
r
=
rptr
[
x
];
float
nr
,
ng
,
nb
;
float
l0
,
l1
,
l
;
PROCESS
()
gptr
[
x
]
=
ng
;
bptr
[
x
]
=
nb
;
rptr
[
x
]
=
nr
;
}
gptr
+=
glinesize
;
bptr
+=
blinesize
;
rptr
+=
rlinesize
;
}
return
0
;
}
static
int
temperature_slice8p
(
AVFilterContext
*
ctx
,
void
*
arg
,
int
jobnr
,
int
nb_jobs
)
{
ColorTemperatureContext
*
s
=
ctx
->
priv
;
...
...
@@ -285,6 +326,7 @@ static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_GBRP9
,
AV_PIX_FMT_GBRP10
,
AV_PIX_FMT_GBRP12
,
AV_PIX_FMT_GBRP14
,
AV_PIX_FMT_GBRP16
,
AV_PIX_FMT_GBRAP10
,
AV_PIX_FMT_GBRAP12
,
AV_PIX_FMT_GBRAP16
,
AV_PIX_FMT_GBRPF32
,
AV_PIX_FMT_GBRAPF32
,
AV_PIX_FMT_RGB48
,
AV_PIX_FMT_BGR48
,
AV_PIX_FMT_RGBA64
,
AV_PIX_FMT_BGRA64
,
AV_PIX_FMT_NONE
...
...
@@ -308,6 +350,8 @@ static av_cold int config_input(AVFilterLink *inlink)
s
->
do_slice
=
s
->
depth
<=
8
?
temperature_slice8
:
temperature_slice16
;
if
(
!
planar
)
s
->
do_slice
=
s
->
depth
<=
8
?
temperature_slice8p
:
temperature_slice16p
;
if
(
s
->
depth
==
32
)
s
->
do_slice
=
temperature_slice32
;
ff_fill_rgba_map
(
s
->
rgba_map
,
inlink
->
format
);
...
...
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