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
Xiph.Org
aom-rav1e
Commits
dc9d36c0
Commit
dc9d36c0
authored
Oct 26, 2015
by
Marco Paniconi
Committed by
Gerrit Code Review
Oct 26, 2015
Browse files
Merge "Code cleanup for vp9-denoiser."
parents
cce3982c
f2845ed8
Changes
2
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_denoiser.c
View file @
dc9d36c0
...
...
@@ -21,12 +21,7 @@
#include "vp9/encoder/vp9_denoiser.h"
#include "vp9/encoder/vp9_encoder.h"
/* The VP9 denoiser is a work-in-progress. It currently is only designed to work
* with speed 6, though it (inexplicably) seems to also work with speed 5 (one
* would need to modify the source code in vp9_pickmode.c and vp9_encoder.c to
* make the calls to the vp9_denoiser_* functions when in speed 5).
*
* The implementation is very similar to that of the VP8 denoiser. While
/* The VP9 denoiser is similar to that of the VP8 denoiser. While
* choosing the motion vectors / reference frames, the denoiser is run, and if
* it did not modify the signal to much, the denoised block is copied to the
* signal.
...
...
@@ -328,7 +323,7 @@ void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb,
struct
buf_2d
src
=
mb
->
plane
[
0
].
src
;
int
is_skin
=
0
;
if
(
bs
<=
BLOCK_16X16
&&
!
denoiser
->
no_
denoising
)
{
if
(
bs
<=
BLOCK_16X16
&&
denoiser
->
denoising
_on
)
{
// Take center pixel in block to determine is_skin.
const
int
y_width_shift
=
(
4
<<
b_width_log2_lookup
[
bs
])
>>
1
;
const
int
y_height_shift
=
(
4
<<
b_height_log2_lookup
[
bs
])
>>
1
;
...
...
@@ -345,7 +340,7 @@ void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb,
is_skin
=
vp9_skin_pixel
(
ysource
,
usource
,
vsource
);
}
if
(
!
denoiser
->
no_
denoising
)
if
(
denoiser
->
denoising
_on
)
decision
=
perform_motion_compensation
(
denoiser
,
mb
,
bs
,
denoiser
->
increase_denoising
,
mi_row
,
mi_col
,
ctx
,
...
...
@@ -528,8 +523,8 @@ void vp9_denoiser_init_noise_estimate(VP9_DENOISER *denoiser,
int
height
)
{
// Denoiser is off by default, i.e., no denoising is performed.
// Noise level is measured periodically, and if observed to be above
// thresh_noise_estimate, then denoising is performed, i.e.,
no_
denoising =
0
.
denoiser
->
no_
denoising
=
1
;
// thresh_noise_estimate, then denoising is performed, i.e., denoising
_on
=
1
.
denoiser
->
denoising
_on
=
0
;
denoiser
->
noise_estimate
=
0
;
denoiser
->
noise_estimate_count
=
0
;
denoiser
->
thresh_noise_estimate
=
20
;
...
...
@@ -657,9 +652,9 @@ void vp9_denoiser_update_noise_estimate(VP9_COMP *const cpi) {
// Reset counter and check noise level condition.
cpi
->
denoiser
.
noise_estimate_count
=
0
;
if
(
cpi
->
denoiser
.
noise_estimate
>
cpi
->
denoiser
.
thresh_noise_estimate
)
cpi
->
denoiser
.
no_
denoising
=
0
;
cpi
->
denoiser
.
denoising
_on
=
1
;
else
cpi
->
denoiser
.
no_
denoising
=
1
;
cpi
->
denoiser
.
denoising
_on
=
0
;
}
}
}
...
...
vp9/encoder/vp9_denoiser.h
View file @
dc9d36c0
...
...
@@ -32,7 +32,7 @@ typedef struct vp9_denoiser {
YV12_BUFFER_CONFIG
last_source
;
int
increase_denoising
;
int
frame_buffer_initialized
;
int
no_
denoising
;
int
denoising
_on
;
int
noise_estimate
;
int
thresh_noise_estimate
;
int
noise_estimate_count
;
...
...
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