Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guillaume Martres
aom-rav1e
Commits
1580a88c
Commit
1580a88c
authored
Jun 19, 2014
by
Tim Kopp
Committed by
Gerrit Code Review
Jun 19, 2014
Browse files
Merge "Implemented vp9_denoiser_{alloc,free}()"
parents
19125ae1
2a720673
Changes
1
Show whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_denoiser.c
View file @
1580a88c
...
...
@@ -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
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