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
231bf4d1
Commit
231bf4d1
authored
Jan 28, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_colorbalance: use the name 's' for the pointer to the private context
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
87577f55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
vf_colorbalance.c
libavfilter/vf_colorbalance.c
+24
-24
No files found.
libavfilter/vf_colorbalance.c
View file @
231bf4d1
...
...
@@ -84,7 +84,7 @@ static int query_formats(AVFilterContext *ctx)
static
int
config_output
(
AVFilterLink
*
outlink
)
{
AVFilterContext
*
ctx
=
outlink
->
src
;
ColorBalanceContext
*
cb
=
ctx
->
priv
;
ColorBalanceContext
*
s
=
ctx
->
priv
;
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
outlink
->
format
);
double
*
shadows
,
*
midtones
,
*
highlights
,
*
buffer
;
int
i
,
r
,
g
,
b
;
...
...
@@ -110,27 +110,27 @@ static int config_output(AVFilterLink *outlink)
for
(
i
=
0
;
i
<
256
;
i
++
)
{
r
=
g
=
b
=
i
;
r
=
av_clip_uint8
(
r
+
cb
->
cyan_red
.
shadows
*
shadows
[
r
]);
r
=
av_clip_uint8
(
r
+
cb
->
cyan_red
.
midtones
*
midtones
[
r
]);
r
=
av_clip_uint8
(
r
+
cb
->
cyan_red
.
highlights
*
highlights
[
r
]);
r
=
av_clip_uint8
(
r
+
s
->
cyan_red
.
shadows
*
shadows
[
r
]);
r
=
av_clip_uint8
(
r
+
s
->
cyan_red
.
midtones
*
midtones
[
r
]);
r
=
av_clip_uint8
(
r
+
s
->
cyan_red
.
highlights
*
highlights
[
r
]);
g
=
av_clip_uint8
(
g
+
cb
->
magenta_green
.
shadows
*
shadows
[
g
]);
g
=
av_clip_uint8
(
g
+
cb
->
magenta_green
.
midtones
*
midtones
[
g
]);
g
=
av_clip_uint8
(
g
+
cb
->
magenta_green
.
highlights
*
highlights
[
g
]);
g
=
av_clip_uint8
(
g
+
s
->
magenta_green
.
shadows
*
shadows
[
g
]);
g
=
av_clip_uint8
(
g
+
s
->
magenta_green
.
midtones
*
midtones
[
g
]);
g
=
av_clip_uint8
(
g
+
s
->
magenta_green
.
highlights
*
highlights
[
g
]);
b
=
av_clip_uint8
(
b
+
cb
->
yellow_blue
.
shadows
*
shadows
[
b
]);
b
=
av_clip_uint8
(
b
+
cb
->
yellow_blue
.
midtones
*
midtones
[
b
]);
b
=
av_clip_uint8
(
b
+
cb
->
yellow_blue
.
highlights
*
highlights
[
b
]);
b
=
av_clip_uint8
(
b
+
s
->
yellow_blue
.
shadows
*
shadows
[
b
]);
b
=
av_clip_uint8
(
b
+
s
->
yellow_blue
.
midtones
*
midtones
[
b
]);
b
=
av_clip_uint8
(
b
+
s
->
yellow_blue
.
highlights
*
highlights
[
b
]);
cb
->
lut
[
R
][
i
]
=
r
;
cb
->
lut
[
G
][
i
]
=
g
;
cb
->
lut
[
B
][
i
]
=
b
;
s
->
lut
[
R
][
i
]
=
r
;
s
->
lut
[
G
][
i
]
=
g
;
s
->
lut
[
B
][
i
]
=
b
;
}
av_free
(
buffer
);
ff_fill_rgba_map
(
cb
->
rgba_map
,
outlink
->
format
);
cb
->
step
=
av_get_padded_bits_per_pixel
(
desc
)
>>
3
;
ff_fill_rgba_map
(
s
->
rgba_map
,
outlink
->
format
);
s
->
step
=
av_get_padded_bits_per_pixel
(
desc
)
>>
3
;
return
0
;
}
...
...
@@ -138,13 +138,13 @@ static int config_output(AVFilterLink *outlink)
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
in
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
ColorBalanceContext
*
cb
=
ctx
->
priv
;
ColorBalanceContext
*
s
=
ctx
->
priv
;
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
const
uint8_t
roffset
=
cb
->
rgba_map
[
R
];
const
uint8_t
goffset
=
cb
->
rgba_map
[
G
];
const
uint8_t
boffset
=
cb
->
rgba_map
[
B
];
const
uint8_t
aoffset
=
cb
->
rgba_map
[
A
];
const
int
step
=
cb
->
step
;
const
uint8_t
roffset
=
s
->
rgba_map
[
R
];
const
uint8_t
goffset
=
s
->
rgba_map
[
G
];
const
uint8_t
boffset
=
s
->
rgba_map
[
B
];
const
uint8_t
aoffset
=
s
->
rgba_map
[
A
];
const
int
step
=
s
->
step
;
const
uint8_t
*
srcrow
=
in
->
data
[
0
];
uint8_t
*
dstrow
;
AVFrame
*
out
;
...
...
@@ -167,9 +167,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
uint8_t
*
dst
=
dstrow
;
for
(
j
=
0
;
j
<
outlink
->
w
*
step
;
j
+=
step
)
{
dst
[
j
+
roffset
]
=
cb
->
lut
[
R
][
src
[
j
+
roffset
]];
dst
[
j
+
goffset
]
=
cb
->
lut
[
G
][
src
[
j
+
goffset
]];
dst
[
j
+
boffset
]
=
cb
->
lut
[
B
][
src
[
j
+
boffset
]];
dst
[
j
+
roffset
]
=
s
->
lut
[
R
][
src
[
j
+
roffset
]];
dst
[
j
+
goffset
]
=
s
->
lut
[
G
][
src
[
j
+
goffset
]];
dst
[
j
+
boffset
]
=
s
->
lut
[
B
][
src
[
j
+
boffset
]];
if
(
in
!=
out
&&
step
==
4
)
dst
[
j
+
aoffset
]
=
src
[
j
+
aoffset
];
}
...
...
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