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
1c88ef0c
Commit
1c88ef0c
authored
Sep 02, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_vectorscope: support more formats for color4 mode in common case
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
19dfbe92
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
vf_vectorscope.c
libavfilter/vf_vectorscope.c
+12
-8
filter-vectorscope_color4
tests/ref/fate/filter-vectorscope_color4
+3
-3
No files found.
libavfilter/vf_vectorscope.c
View file @
1c88ef0c
...
@@ -43,6 +43,7 @@ typedef struct VectorscopeContext {
...
@@ -43,6 +43,7 @@ typedef struct VectorscopeContext {
const
uint8_t
*
bg_color
;
const
uint8_t
*
bg_color
;
int
planewidth
[
4
];
int
planewidth
[
4
];
int
planeheight
[
4
];
int
planeheight
[
4
];
int
hsub
,
vsub
;
int
x
,
y
,
pd
;
int
x
,
y
,
pd
;
int
is_yuv
;
int
is_yuv
;
int
envelope
;
int
envelope
;
...
@@ -117,8 +118,7 @@ static int query_formats(AVFilterContext *ctx)
...
@@ -117,8 +118,7 @@ static int query_formats(AVFilterContext *ctx)
if
(
!
ctx
->
inputs
[
0
]
->
out_formats
)
{
if
(
!
ctx
->
inputs
[
0
]
->
out_formats
)
{
const
enum
AVPixelFormat
*
in_pix_fmts
;
const
enum
AVPixelFormat
*
in_pix_fmts
;
if
(((
s
->
x
==
1
&&
s
->
y
==
2
)
||
(
s
->
x
==
2
&&
s
->
y
==
1
))
&&
if
((
s
->
x
==
1
&&
s
->
y
==
2
)
||
(
s
->
x
==
2
&&
s
->
y
==
1
))
(
s
->
mode
!=
COLOR4
))
in_pix_fmts
=
in2_pix_fmts
;
in_pix_fmts
=
in2_pix_fmts
;
else
else
in_pix_fmts
=
in1_pix_fmts
;
in_pix_fmts
=
in1_pix_fmts
;
...
@@ -173,6 +173,8 @@ static int config_input(AVFilterLink *inlink)
...
@@ -173,6 +173,8 @@ static int config_input(AVFilterLink *inlink)
s
->
bg_color
=
black_yuva_color
;
s
->
bg_color
=
black_yuva_color
;
}
}
s
->
hsub
=
desc
->
log2_chroma_w
;
s
->
vsub
=
desc
->
log2_chroma_h
;
s
->
planeheight
[
1
]
=
s
->
planeheight
[
2
]
=
FF_CEIL_RSHIFT
(
inlink
->
h
,
desc
->
log2_chroma_h
);
s
->
planeheight
[
1
]
=
s
->
planeheight
[
2
]
=
FF_CEIL_RSHIFT
(
inlink
->
h
,
desc
->
log2_chroma_h
);
s
->
planeheight
[
0
]
=
s
->
planeheight
[
3
]
=
inlink
->
h
;
s
->
planeheight
[
0
]
=
s
->
planeheight
[
3
]
=
inlink
->
h
;
s
->
planewidth
[
1
]
=
s
->
planewidth
[
2
]
=
FF_CEIL_RSHIFT
(
inlink
->
w
,
desc
->
log2_chroma_w
);
s
->
planewidth
[
1
]
=
s
->
planewidth
[
2
]
=
FF_CEIL_RSHIFT
(
inlink
->
w
,
desc
->
log2_chroma_w
);
...
@@ -266,6 +268,8 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
...
@@ -266,6 +268,8 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
const
uint8_t
*
spx
=
src
[
px
];
const
uint8_t
*
spx
=
src
[
px
];
const
uint8_t
*
spy
=
src
[
py
];
const
uint8_t
*
spy
=
src
[
py
];
const
uint8_t
*
spd
=
src
[
pd
];
const
uint8_t
*
spd
=
src
[
pd
];
const
int
hsub
=
s
->
hsub
;
const
int
vsub
=
s
->
vsub
;
uint8_t
**
dst
=
out
->
data
;
uint8_t
**
dst
=
out
->
data
;
uint8_t
*
dpx
=
dst
[
px
];
uint8_t
*
dpx
=
dst
[
px
];
uint8_t
*
dpy
=
dst
[
py
];
uint8_t
*
dpy
=
dst
[
py
];
...
@@ -361,13 +365,13 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
...
@@ -361,13 +365,13 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
}
}
break
;
break
;
case
COLOR4
:
case
COLOR4
:
for
(
i
=
0
;
i
<
h
;
i
++
)
{
for
(
i
=
0
;
i
<
in
->
height
;
i
++
)
{
const
int
iwx
=
i
*
slinesizex
;
const
int
iwx
=
(
i
>>
vsub
)
*
slinesizex
;
const
int
iwy
=
i
*
slinesizey
;
const
int
iwy
=
(
i
>>
vsub
)
*
slinesizey
;
const
int
iwd
=
i
*
slinesized
;
const
int
iwd
=
i
*
slinesized
;
for
(
j
=
0
;
j
<
w
;
j
++
)
{
for
(
j
=
0
;
j
<
in
->
width
;
j
++
)
{
const
int
x
=
spx
[
iwx
+
j
];
const
int
x
=
spx
[
iwx
+
(
j
>>
hsub
)
];
const
int
y
=
spy
[
iwy
+
j
];
const
int
y
=
spy
[
iwy
+
(
j
>>
hsub
)
];
const
int
pos
=
y
*
dlinesize
+
x
;
const
int
pos
=
y
*
dlinesize
+
x
;
dpd
[
pos
]
=
FFMAX
(
spd
[
iwd
+
j
],
dpd
[
pos
]);
dpd
[
pos
]
=
FFMAX
(
spd
[
iwd
+
j
],
dpd
[
pos
]);
...
...
tests/ref/fate/filter-vectorscope_color4
View file @
1c88ef0c
#tb 0: 1/25
#tb 0: 1/25
0, 0, 0, 1, 196608, 0x
b6d22af1
0, 0, 0, 1, 196608, 0x
4d2e53c4
0, 1, 1, 1, 196608, 0x
d7c6f971
0, 1, 1, 1, 196608, 0x
795e1dcc
0, 2, 2, 1, 196608, 0x
fe729faa
0, 2, 2, 1, 196608, 0x
e4268800
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