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
c784b5cf
Commit
c784b5cf
authored
Sep 09, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_histogram: set foreground alpha if possible in destination format
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
915abab2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
vf_histogram.c
libavfilter/vf_histogram.c
+4
-2
No files found.
libavfilter/vf_histogram.c
View file @
c784b5cf
...
...
@@ -35,6 +35,7 @@ typedef struct HistogramContext {
int
histogram_size
;
int
mult
;
int
ncomp
;
int
dncomp
;
uint8_t
bg_color
[
4
];
uint8_t
fg_color
[
4
];
int
level_height
;
...
...
@@ -236,6 +237,7 @@ static int config_output(AVFilterLink *outlink)
outlink
->
h
=
(
h
->
level_height
+
h
->
scale_height
)
*
FFMAX
(
ncomp
*
h
->
display_mode
,
1
);
h
->
odesc
=
av_pix_fmt_desc_get
(
outlink
->
format
);
h
->
dncomp
=
h
->
odesc
->
nb_components
;
outlink
->
sample_aspect_ratio
=
(
AVRational
){
1
,
1
};
return
0
;
...
...
@@ -319,7 +321,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if
(
h
->
histogram_size
<=
256
)
{
for
(
j
=
h
->
level_height
-
1
;
j
>=
col_height
;
j
--
)
{
if
(
h
->
display_mode
)
{
for
(
l
=
0
;
l
<
h
->
ncomp
;
l
++
)
for
(
l
=
0
;
l
<
h
->
d
ncomp
;
l
++
)
out
->
data
[
l
][(
j
+
start
)
*
out
->
linesize
[
l
]
+
i
]
=
h
->
fg_color
[
l
];
}
else
{
out
->
data
[
p
][(
j
+
start
)
*
out
->
linesize
[
p
]
+
i
]
=
255
;
...
...
@@ -332,7 +334,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
for
(
j
=
h
->
level_height
-
1
;
j
>=
col_height
;
j
--
)
{
if
(
h
->
display_mode
)
{
for
(
l
=
0
;
l
<
h
->
ncomp
;
l
++
)
for
(
l
=
0
;
l
<
h
->
d
ncomp
;
l
++
)
AV_WN16
(
out
->
data
[
l
]
+
(
j
+
start
)
*
out
->
linesize
[
l
]
+
i
*
2
,
h
->
fg_color
[
l
]
*
mult
);
}
else
{
AV_WN16
(
out
->
data
[
p
]
+
(
j
+
start
)
*
out
->
linesize
[
p
]
+
i
*
2
,
255
*
mult
);
...
...
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