Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
2a720673
Commit
2a720673
authored
Jun 11, 2014
by
Tim Kopp
Browse files
Implemented vp9_denoiser_{alloc,free}()
Change-Id: I79eba79f7c52eec19ef2356278597e06620d5e27
parent
99d648b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_denoiser.c
View file @
2a720673
...
...
@@ -40,10 +40,36 @@ void vp9_denoiser_update_frame_stats() {
int
vp9_denoiser_alloc
(
VP9_DENOISER
*
denoiser
,
int
width
,
int
height
,
int
border
)
{
assert
(
denoiser
);
denoiser
->
running_avg_y
.
stride
=
width
+
2
*
border
;
denoiser
->
running_avg_y
.
buf
=
calloc
(
((
2
*
border
)
+
width
)
*
((
2
*
border
)
+
height
),
sizeof
(
uint8_t
));
if
(
denoiser
->
running_avg_y
.
buf
==
NULL
)
{
vp9_denoiser_free
(
denoiser
);
return
1
;
}
denoiser
->
mc_running_avg_y
.
stride
=
width
+
2
*
border
;
denoiser
->
mc_running_avg_y
.
buf
=
calloc
(
((
2
*
border
)
+
width
)
*
((
2
*
border
)
+
height
),
sizeof
(
uint8_t
));
if
(
denoiser
->
mc_running_avg_y
.
buf
==
NULL
)
{
vp9_denoiser_free
(
denoiser
);
return
1
;
}
return
0
;
}
void
vp9_denoiser_free
(
VP9_DENOISER
*
denoiser
)
{
if
(
denoiser
->
running_avg_y
.
buf
!=
NULL
)
{
free
(
denoiser
->
running_avg_y
.
buf
);
}
if
(
denoiser
->
mc_running_avg_y
.
buf
!=
NULL
)
{
free
(
denoiser
->
mc_running_avg_y
.
buf
);
}
return
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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