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
d94d2527
Commit
d94d2527
authored
Oct 24, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_waveform: add gratcicule to rgb input
parent
8c733013
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
vf_waveform.c
libavfilter/vf_waveform.c
+22
-17
No files found.
libavfilter/vf_waveform.c
View file @
d94d2527
...
...
@@ -102,6 +102,7 @@ typedef struct WaveformContext {
int
shift_w
[
4
],
shift_h
[
4
];
GraticuleLines
*
glines
;
int
nb_glines
;
int
rgb
;
int
(
*
waveform_slice
)(
AVFilterContext
*
ctx
,
void
*
arg
,
int
jobnr
,
int
nb_jobs
);
...
...
@@ -2610,17 +2611,18 @@ static void graticule_row(WaveformContext *s, AVFrame *out)
const
float
o1
=
s
->
opacity
;
const
float
o2
=
1
.
-
o1
;
const
int
height
=
s
->
display
==
PARADE
?
out
->
height
/
s
->
acomp
:
out
->
height
;
int
k
=
0
,
c
,
p
,
l
,
offset_x
=
0
,
offset_y
=
0
;
int
C
,
k
=
0
,
c
,
p
,
l
,
offset_x
=
0
,
offset_y
=
0
;
for
(
c
=
0
;
c
<
s
->
ncomp
;
c
++
)
{
if
(
!
((
1
<<
c
)
&
s
->
pcomp
)
||
(
!
s
->
display
&&
k
>
0
))
continue
;
k
++
;
C
=
s
->
rgb
?
0
:
c
;
for
(
p
=
0
;
p
<
s
->
ncomp
;
p
++
)
{
const
int
v
=
s
->
grat_yuva_color
[
p
];
for
(
l
=
0
;
l
<
s
->
nb_glines
;
l
++
)
{
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
c
].
pos
;
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
C
].
pos
;
int
x
=
offset_x
+
(
s
->
mirror
?
s
->
size
-
1
-
pos
:
pos
);
uint8_t
*
dst
=
out
->
data
[
p
]
+
offset_y
*
out
->
linesize
[
p
]
+
x
;
...
...
@@ -2629,8 +2631,8 @@ static void graticule_row(WaveformContext *s, AVFrame *out)
}
for
(
l
=
0
;
l
<
s
->
nb_glines
&&
(
s
->
flags
&
1
);
l
++
)
{
const
char
*
name
=
s
->
glines
[
l
].
line
[
c
].
name
;
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
c
].
pos
;
const
char
*
name
=
s
->
glines
[
l
].
line
[
C
].
name
;
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
C
].
pos
;
int
x
=
offset_x
+
(
s
->
mirror
?
s
->
size
-
1
-
pos
:
pos
)
-
10
;
if
(
x
<
0
)
...
...
@@ -2651,17 +2653,18 @@ static void graticule16_row(WaveformContext *s, AVFrame *out)
const
float
o2
=
1
.
-
o1
;
const
int
mult
=
s
->
max
/
256
;
const
int
height
=
s
->
display
==
PARADE
?
out
->
height
/
s
->
acomp
:
out
->
height
;
int
k
=
0
,
c
,
p
,
l
,
offset_x
=
0
,
offset_y
=
0
;
int
C
,
k
=
0
,
c
,
p
,
l
,
offset_x
=
0
,
offset_y
=
0
;
for
(
c
=
0
;
c
<
s
->
ncomp
;
c
++
)
{
if
(
!
((
1
<<
c
)
&
s
->
pcomp
)
||
(
!
s
->
display
&&
k
>
0
))
continue
;
k
++
;
C
=
s
->
rgb
?
0
:
c
;
for
(
p
=
0
;
p
<
s
->
ncomp
;
p
++
)
{
const
int
v
=
s
->
grat_yuva_color
[
p
]
*
mult
;
for
(
l
=
0
;
l
<
s
->
nb_glines
;
l
++
)
{
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
c
].
pos
;
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
C
].
pos
;
int
x
=
offset_x
+
(
s
->
mirror
?
s
->
size
-
1
-
pos
:
pos
);
uint16_t
*
dst
=
(
uint16_t
*
)(
out
->
data
[
p
]
+
offset_y
*
out
->
linesize
[
p
])
+
x
;
...
...
@@ -2670,8 +2673,8 @@ static void graticule16_row(WaveformContext *s, AVFrame *out)
}
for
(
l
=
0
;
l
<
s
->
nb_glines
&&
(
s
->
flags
&
1
);
l
++
)
{
const
char
*
name
=
s
->
glines
[
l
].
line
[
c
].
name
;
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
c
].
pos
;
const
char
*
name
=
s
->
glines
[
l
].
line
[
C
].
name
;
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
C
].
pos
;
int
x
=
offset_x
+
(
s
->
mirror
?
s
->
size
-
1
-
pos
:
pos
)
-
10
;
if
(
x
<
0
)
...
...
@@ -2691,17 +2694,18 @@ static void graticule_column(WaveformContext *s, AVFrame *out)
const
float
o1
=
s
->
opacity
;
const
float
o2
=
1
.
-
o1
;
const
int
width
=
s
->
display
==
PARADE
?
out
->
width
/
s
->
acomp
:
out
->
width
;
int
k
=
0
,
c
,
p
,
l
,
offset_y
=
0
,
offset_x
=
0
;
int
C
,
k
=
0
,
c
,
p
,
l
,
offset_y
=
0
,
offset_x
=
0
;
for
(
c
=
0
;
c
<
s
->
ncomp
;
c
++
)
{
if
((
!
((
1
<<
c
)
&
s
->
pcomp
)
||
(
!
s
->
display
&&
k
>
0
)))
continue
;
k
++
;
C
=
s
->
rgb
?
0
:
c
;
for
(
p
=
0
;
p
<
s
->
ncomp
;
p
++
)
{
const
int
v
=
s
->
grat_yuva_color
[
p
];
for
(
l
=
0
;
l
<
s
->
nb_glines
;
l
++
)
{
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
c
].
pos
;
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
C
].
pos
;
int
y
=
offset_y
+
(
s
->
mirror
?
s
->
size
-
1
-
pos
:
pos
);
uint8_t
*
dst
=
out
->
data
[
p
]
+
y
*
out
->
linesize
[
p
]
+
offset_x
;
...
...
@@ -2710,8 +2714,8 @@ static void graticule_column(WaveformContext *s, AVFrame *out)
}
for
(
l
=
0
;
l
<
s
->
nb_glines
&&
(
s
->
flags
&
1
);
l
++
)
{
const
char
*
name
=
s
->
glines
[
l
].
line
[
c
].
name
;
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
c
].
pos
;
const
char
*
name
=
s
->
glines
[
l
].
line
[
C
].
name
;
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
C
].
pos
;
int
y
=
offset_y
+
(
s
->
mirror
?
s
->
size
-
1
-
pos
:
pos
)
-
10
;
if
(
y
<
0
)
...
...
@@ -2732,17 +2736,18 @@ static void graticule16_column(WaveformContext *s, AVFrame *out)
const
float
o2
=
1
.
-
o1
;
const
int
mult
=
s
->
max
/
256
;
const
int
width
=
s
->
display
==
PARADE
?
out
->
width
/
s
->
acomp
:
out
->
width
;
int
k
=
0
,
c
,
p
,
l
,
offset_x
=
0
,
offset_y
=
0
;
int
C
,
k
=
0
,
c
,
p
,
l
,
offset_x
=
0
,
offset_y
=
0
;
for
(
c
=
0
;
c
<
s
->
ncomp
;
c
++
)
{
if
((
!
((
1
<<
c
)
&
s
->
pcomp
)
||
(
!
s
->
display
&&
k
>
0
)))
continue
;
k
++
;
C
=
s
->
rgb
?
0
:
c
;
for
(
p
=
0
;
p
<
s
->
ncomp
;
p
++
)
{
const
int
v
=
s
->
grat_yuva_color
[
p
]
*
mult
;
for
(
l
=
0
;
l
<
s
->
nb_glines
;
l
++
)
{
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
c
].
pos
;
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
C
].
pos
;
int
y
=
offset_y
+
(
s
->
mirror
?
s
->
size
-
1
-
pos
:
pos
);
uint16_t
*
dst
=
(
uint16_t
*
)(
out
->
data
[
p
]
+
y
*
out
->
linesize
[
p
])
+
offset_x
;
...
...
@@ -2751,8 +2756,8 @@ static void graticule16_column(WaveformContext *s, AVFrame *out)
}
for
(
l
=
0
;
l
<
s
->
nb_glines
&&
(
s
->
flags
&
1
);
l
++
)
{
const
char
*
name
=
s
->
glines
[
l
].
line
[
c
].
name
;
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
c
].
pos
;
const
char
*
name
=
s
->
glines
[
l
].
line
[
C
].
name
;
const
uint16_t
pos
=
s
->
glines
[
l
].
line
[
C
].
pos
;
int
y
=
offset_y
+
(
s
->
mirror
?
s
->
size
-
1
-
pos
:
pos
)
-
10
;
if
(
y
<
0
)
...
...
@@ -2996,8 +3001,8 @@ static int config_input(AVFilterLink *inlink)
case
AV_PIX_FMT_GBRP9
:
case
AV_PIX_FMT_GBRP10
:
case
AV_PIX_FMT_GBRP12
:
s
->
rgb
=
1
;
memcpy
(
s
->
bg_color
,
black_gbrp_color
,
sizeof
(
s
->
bg_color
));
s
->
graticulef
=
graticule_none
;
break
;
default:
memcpy
(
s
->
bg_color
,
black_yuva_color
,
sizeof
(
s
->
bg_color
));
...
...
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