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
370cecc1
Commit
370cecc1
authored
Mar 13, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_vectorscope: less aggressive memory allocation
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
55c87214
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
vf_vectorscope.c
libavfilter/vf_vectorscope.c
+24
-1
No files found.
libavfilter/vf_vectorscope.c
View file @
370cecc1
...
...
@@ -64,7 +64,8 @@ typedef struct VectorscopeContext {
int
flags
;
int
colorspace
;
int
cs
;
uint8_t
peak
[
4096
][
4096
];
uint8_t
*
peak_memory
;
uint8_t
**
peak
;
void
(
*
vectorscope
)(
struct
VectorscopeContext
*
s
,
AVFrame
*
in
,
AVFrame
*
out
,
int
pd
);
...
...
@@ -252,10 +253,23 @@ static int query_formats(AVFilterContext *ctx)
static
int
config_output
(
AVFilterLink
*
outlink
)
{
VectorscopeContext
*
s
=
outlink
->
src
->
priv
;
int
i
;
s
->
intensity
=
s
->
fintensity
*
(
s
->
size
-
1
);
outlink
->
h
=
outlink
->
w
=
s
->
size
;
outlink
->
sample_aspect_ratio
=
(
AVRational
){
1
,
1
};
s
->
peak_memory
=
av_calloc
(
s
->
size
,
s
->
size
);
if
(
!
s
->
peak_memory
)
return
AVERROR
(
ENOMEM
);
s
->
peak
=
av_calloc
(
s
->
size
,
sizeof
(
*
s
->
peak
));
if
(
!
s
->
peak
)
return
AVERROR
(
ENOMEM
);
for
(
i
=
0
;
i
<
s
->
size
;
i
++
)
s
->
peak
[
i
]
=
s
->
peak_memory
+
s
->
size
*
i
;
return
0
;
}
...
...
@@ -1298,6 +1312,14 @@ static int config_input(AVFilterLink *inlink)
return
0
;
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
VectorscopeContext
*
s
=
ctx
->
priv
;
av_freep
(
&
s
->
peak
);
av_freep
(
&
s
->
peak_memory
);
}
static
const
AVFilterPad
inputs
[]
=
{
{
.
name
=
"default"
,
...
...
@@ -1323,6 +1345,7 @@ AVFilter ff_vf_vectorscope = {
.
priv_size
=
sizeof
(
VectorscopeContext
),
.
priv_class
=
&
vectorscope_class
,
.
query_formats
=
query_formats
,
.
uninit
=
uninit
,
.
inputs
=
inputs
,
.
outputs
=
outputs
,
};
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